diff --git a/__unported__/product_warranty/__init__.py b/__unported__/product_warranty/__init__.py deleted file mode 100644 index 7c715039..00000000 --- a/__unported__/product_warranty/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################### -# # -# # -######################################################################### -# # -# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # -# # -#You should have received a copy of the GNU General Public License # -#along with this program. If not, see . # -######################################################################### -from . import product_warranty -from . import res_company \ No newline at end of file diff --git a/__unported__/product_warranty/__openerp__.py b/__unported__/product_warranty/__openerp__.py deleted file mode 100644 index 472bde78..00000000 --- a/__unported__/product_warranty/__openerp__.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################### -# # -# # -######################################################################### -# # -# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # -# # -#You should have received a copy of the GNU General Public License # -#along with this program. If not, see . # -######################################################################### - - -{ - 'name': 'Product warranty', - 'version': '1.0', - 'category': 'Generic Modules/Product', - 'description': """ -Product Warranty -================ - -Extend the product warranty management with warranty details on product / supplier relation: - -* supplier warranty duration -* Set default return address for company (if different from standard one) -* return product to company, supplier, other - - -Those informations are used in the RMA Claim (Product Return Management) module. - -""", - 'author': "Akretion,Odoo Community Association (OCA)", - 'website': 'http://akretion.com', - 'license': 'AGPL-3', - 'depends': ['product'], - 'data': [ - 'security/ir.model.access.csv', - 'res_company_view.xml', - 'product_warranty_view.xml', - ], - 'demo_xml': [], - 'test': [], - 'installable': True, - 'active': False, - 'certificate': '', - 'images': ['images/product_warranty.png'], -} - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/product_warranty/README.rst b/product_warranty/README.rst new file mode 100644 index 00000000..70f169fe --- /dev/null +++ b/product_warranty/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Product Warranty +================ + +Extends the product warranty management with warranty details on product / +supplier relation: + +* supplier warranty duration +* Set default return address for company (if different from standard one) +* Whether to return product to company, supplier, other + +Usage +===== + +The new information is not explicitly used by the system until you install +another module that makes use of it, e.g. RMA Claim (Product Return +Management). + +Credits +======= + +Contributors +------------ + +* Emmanuel Samyn +* Paulius Sladkevičius +* Benoît Guillot +* David Beal +* Maxime Chambreuil +* Joël Grand-Guillaume +* Ondřej Kuzník + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/product_warranty/__init__.py b/product_warranty/__init__.py new file mode 100644 index 00000000..4e914a85 --- /dev/null +++ b/product_warranty/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from . import product_warranty +from . import res_company diff --git a/product_warranty/__openerp__.py b/product_warranty/__openerp__.py new file mode 100644 index 00000000..f0d15262 --- /dev/null +++ b/product_warranty/__openerp__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Product warranty', + 'version': '1.0', + 'category': 'Generic Modules/Product', + 'author': "Akretion,Odoo Community Association (OCA)", + 'website': 'http://akretion.com', + 'license': 'AGPL-3', + 'depends': ['product'], + 'data': [ + 'security/ir.model.access.csv', + 'res_company_view.xml', + 'product_warranty_view.xml', + ], + 'demo_xml': [], + 'test': [], + 'installable': True, + 'images': ['images/product_warranty.png'], +} diff --git a/__unported__/product_warranty/i18n/es.po b/product_warranty/i18n/es.po similarity index 96% rename from __unported__/product_warranty/i18n/es.po rename to product_warranty/i18n/es.po index e2d613ac..93d58607 100644 --- a/__unported__/product_warranty/i18n/es.po +++ b/product_warranty/i18n/es.po @@ -35,9 +35,9 @@ msgstr "Información de garantía" #: help:product.supplierinfo,warranty_return_partner:0 msgid "" "Who is in charge of the warranty return treatment toward the end customer. " -"Company will use the current compagny delivery or default address and so on " -"for supplier and brand manufacturer. Doesn't necessarly mean that the " -"warranty to be applied is the one of the return partner (ie: can be returned " +"Company will use the current company delivery or default address and so on " +"for supplier and brand manufacturer. Doesn't necessarily mean that the " +"warranty to be applied is the one of the return partner (i.e. can be returned " "to the company and be under the brand warranty" msgstr "" "Especifica quién es el responsable del tratamiento de la devolución de " @@ -51,7 +51,7 @@ msgstr "" #: help:product.supplierinfo,warranty_return_other_address_id:0 msgid "" "Where the customer has to send back the product(s) if warranty return is " -"setto 'other'." +"set to 'other'." msgstr "" "Dónde debe enviar el cliente de vuelta el/los producto/s si la garantía de " "devolución se establece a 'otra'." diff --git a/__unported__/product_warranty/i18n/fr.po b/product_warranty/i18n/fr.po similarity index 95% rename from __unported__/product_warranty/i18n/fr.po rename to product_warranty/i18n/fr.po index 7de5da02..60c3abc7 100644 --- a/__unported__/product_warranty/i18n/fr.po +++ b/product_warranty/i18n/fr.po @@ -34,9 +34,9 @@ msgstr "" #: help:product.supplierinfo,warranty_return_partner:0 msgid "" "Who is in charge of the warranty return treatment toward the end customer. " -"Company will use the current compagny delivery or default address and so on " -"for supplier and brand manufacturer. Doesn't necessarly mean that the " -"warranty to be applied is the one of the return partner (ie: can be returned " +"Company will use the current company delivery or default address and so on " +"for supplier and brand manufacturer. Doesn't necessarily mean that the " +"warranty to be applied is the one of the return partner (i.e. can be returned " "to the company and be under the brand warranty" msgstr "" "Indique qui est en charge du traitement du retour garantie envers le client " @@ -49,7 +49,7 @@ msgstr "" #: help:product.supplierinfo,warranty_return_other_address_id:0 msgid "" "Where the customer has to send back the product(s) if warranty return is " -"setto 'other'." +"set to 'other'." msgstr "" #. module: product_warranty diff --git a/__unported__/product_warranty/i18n/product_warranty.pot b/product_warranty/i18n/product_warranty.pot similarity index 93% rename from __unported__/product_warranty/i18n/product_warranty.pot rename to product_warranty/i18n/product_warranty.pot index 7c7fd45b..fe6295d5 100644 --- a/__unported__/product_warranty/i18n/product_warranty.pot +++ b/product_warranty/i18n/product_warranty.pot @@ -30,12 +30,12 @@ msgstr "" #. module: product_warranty #: help:product.supplierinfo,warranty_return_partner:0 -msgid "Who is in charge of the warranty return treatment toward the end customer. Company will use the current compagny delivery or default address and so on for supplier and brand manufacturer. Doesn't necessarly mean that the warranty to be applied is the one of the return partner (ie: can be returned to the company and be under the brand warranty" +msgid "Who is in charge of the warranty return treatment toward the end customer. Company will use the current company delivery or default address and so on for supplier and brand manufacturer. Doesn't necessarily mean that the warranty to be applied is the one of the return partner (i.e. can be returned to the company and be under the brand warranty" msgstr "" #. module: product_warranty #: help:product.supplierinfo,warranty_return_other_address_id:0 -msgid "Where the customer has to send back the product(s) if warranty return is setto 'other'." +msgid "Where the customer has to send back the product(s) if warranty return is set to 'other'." msgstr "" #. module: product_warranty @@ -129,4 +129,3 @@ msgstr "" #: field:return.instruction,instructions:0 msgid "Instructions" msgstr "" - diff --git a/__unported__/product_warranty/images/product_warranty.png b/product_warranty/images/product_warranty.png similarity index 100% rename from __unported__/product_warranty/images/product_warranty.png rename to product_warranty/images/product_warranty.png diff --git a/__unported__/product_warranty/product_warranty.py b/product_warranty/product_warranty.py similarity index 63% rename from __unported__/product_warranty/product_warranty.py rename to product_warranty/product_warranty.py index 2ad7aabb..c34cb4e9 100644 --- a/__unported__/product_warranty/product_warranty.py +++ b/product_warranty/product_warranty.py @@ -1,24 +1,22 @@ # -*- coding: utf-8 -*- -######################################################################### -# # -# # -######################################################################### -# # -# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn, Benoît Guillot # -# # -#This program is free software: you can redistribute it and/or modify # -#it under the terms of the GNU General Public License as published by # -#the Free Software Foundation, either version 3 of the License, or # -#(at your option) any later version. # -# # -#This program is distributed in the hope that it will be useful, # -#but WITHOUT ANY WARRANTY; without even the implied warranty of # -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -#GNU General Public License for more details. # -# # -#You should have received a copy of the GNU General Public License # -#along with this program. If not, see . # -######################################################################### +############################################################################## +# +# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn, Benoît Guillot +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## from openerp.osv import orm, fields @@ -52,14 +50,16 @@ class product_supplierinfo(orm.Model): """ Get selected lines to add to exchange """ instr_obj = self.pool.get('return.instruction') instruction_ids = instr_obj.search(cr, uid, - [('is_default', '=', 'FALSE')], + [('is_default', '=', True)], context=context) if instruction_ids: return instruction_ids[0] return False - def _get_warranty_return_address(self, cr, uid, ids, field_names, arg, context=None): - """ Method to return the partner delivery address or if none, the default address + def _get_warranty_return_address(self, cr, uid, ids, field_names, arg, + context=None): + """ Method to return the partner delivery address or if none, the + default address dedicated_delivery_address stand for the case a new type of address more particularly dedicated to return delivery would be @@ -76,28 +76,33 @@ class product_supplierinfo(orm.Model): partner_id = supplier_info.name.id elif return_partner == 'company': if supplier_info.company_id.crm_return_address_id: - partner_id = supplier_info.company_id.crm_return_address_id.id + partner_id = supplier_info.company_id.\ + crm_return_address_id.id elif return_partner == 'other': if supplier_info.warranty_return_other_address_id: - partner_id = supplier_info.warranty_return_other_address_id.id + partner_id = supplier_info.\ + warranty_return_other_address_id.id result[supplier_info.id] = partner_id return result _columns = { "warranty_duration": fields.float( 'Period', - help="Warranty in month for this product/supplier relation. Only for " - "company/supplier relation (purchase order) ; the customer/company " - "relation (sale order) always use the product main warranty field"), + help="Warranty in month for this product/supplier relation. " + "Only for company/supplier relation (purchase order) ; " + "the customer/company relation (sale order) always use " + "the product main warranty field"), "warranty_return_partner": fields.selection( get_warranty_return_partner, 'Return type', required=True, - help="Who is in charge of the warranty return treatment toward the end customer. " - "Company will use the current compagny delivery or default address and so on for " - "supplier and brand manufacturer. Doesn't necessarly mean that the warranty to be " - "applied is the one of the return partner (ie: can be returned to the company and " - "be under the brand warranty"), + help="Who is in charge of the warranty return treatment toward " + "the end customer. Company will use the current company " + "delivery or default address and so on for supplier and " + "brand manufacturer. Doesn't necessarily mean that " + "the warranty to be applied is the one of the return partner " + "(i.e. can be returned to the company and be under the brand " + "warranty"), 'return_instructions': fields.many2one( 'return.instruction', 'Instructions', diff --git a/__unported__/product_warranty/product_warranty_view.xml b/product_warranty/product_warranty_view.xml similarity index 77% rename from __unported__/product_warranty/product_warranty_view.xml rename to product_warranty/product_warranty_view.xml index bf59e48b..5160ed2b 100644 --- a/__unported__/product_warranty/product_warranty_view.xml +++ b/product_warranty/product_warranty_view.xml @@ -1,22 +1,23 @@ @@ -34,15 +35,17 @@ - + product.return.instructions.form return.instruction
- - + + + + @@ -56,11 +59,11 @@ tree,form
- + + parent="product.prod_config_main" sequence="3"/> @@ -77,7 +80,7 @@ - + product.supplierinfo.warranty.form diff --git a/__unported__/product_warranty/res_company.py b/product_warranty/res_company.py similarity index 93% rename from __unported__/product_warranty/res_company.py rename to product_warranty/res_company.py index a3625170..146979ee 100644 --- a/__unported__/product_warranty/res_company.py +++ b/product_warranty/res_company.py @@ -3,7 +3,8 @@ # # Copyright 2013 Camptocamp # Copyright 2009-2013 Akretion, -# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume +# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, +# Joel Grand-Guillaume # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as diff --git a/__unported__/product_warranty/res_company_view.xml b/product_warranty/res_company_view.xml similarity index 96% rename from __unported__/product_warranty/res_company_view.xml rename to product_warranty/res_company_view.xml index 492be670..34bdf2ee 100644 --- a/__unported__/product_warranty/res_company_view.xml +++ b/product_warranty/res_company_view.xml @@ -13,7 +13,7 @@ - + diff --git a/__unported__/product_warranty/security/ir.model.access.csv b/product_warranty/security/ir.model.access.csv similarity index 100% rename from __unported__/product_warranty/security/ir.model.access.csv rename to product_warranty/security/ir.model.access.csv