diff --git a/product_warranty/README.rst b/product_warranty/README.rst index af902ece..83035c96 100644 --- a/product_warranty/README.rst +++ b/product_warranty/README.rst @@ -13,15 +13,15 @@ Product Warranty .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github - :target: https://github.com/OCA/rma/tree/15.0/product_warranty - :alt: OCA/rma +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2F/opt/odoo/oca/rma/-lightgray.png?logo=github + :target: https://github.com/OCA//opt/odoo/oca/rma//tree/16.0/product_warranty + :alt: OCA//opt/odoo/oca/rma/ .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/rma-15-0/rma-15-0-product_warranty + :target: https://translation.odoo-community.org/projects//opt/odoo/oca/rma/-16-0//opt/odoo/oca/rma/-16-0-product_warranty :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/145/15.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA//opt/odoo/oca/rma/&target_branch=16.0 + :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -33,6 +33,12 @@ to set product warranty details on products and product-supplier relation. .. contents:: :local: +Configuration +============= + +To manage the available return instructions, enable debug mode and go to +*Sales -> Configuration -> Product Return Instructions*. + Usage ===== @@ -48,10 +54,10 @@ To use this module, you need to: Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -117,6 +123,6 @@ Current `maintainers `__: |maintainer-osi-scampbell| |maintainer-max3903| -This module is part of the `OCA/rma `_ project on GitHub. +This module is part of the `OCA//opt/odoo/oca/rma/ `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_warranty/__manifest__.py b/product_warranty/__manifest__.py index 7155d0e6..feaa7d03 100644 --- a/product_warranty/__manifest__.py +++ b/product_warranty/__manifest__.py @@ -11,9 +11,10 @@ "depends": ["sale_management"], "data": [ "security/ir.model.access.csv", - "views/res_company.xml", - "views/product_warranty.xml", - "views/product_template.xml", + "views/res_company_views.xml", + "views/product_supplierinfo_views.xml", + "views/product_template_views.xml", + "views/return_instructions_views.xml", ], "demo": ["demo/product_warranty.xml", "demo/res_company.xml"], "images": ["images/product_warranty.png"], diff --git a/product_warranty/demo/product_warranty.xml b/product_warranty/demo/product_warranty.xml index db2d913b..7980de56 100644 --- a/product_warranty/demo/product_warranty.xml +++ b/product_warranty/demo/product_warranty.xml @@ -40,7 +40,7 @@ name="product_tmpl_id" ref="product.product_product_3_product_template" /> - + 5 1 @@ -52,7 +52,7 @@ name="product_tmpl_id" ref="product.product_product_3_product_template" /> - + 5 1 diff --git a/product_warranty/i18n/es.po b/product_warranty/i18n/es.po index aece0a78..9421d525 100644 --- a/product_warranty/i18n/es.po +++ b/product_warranty/i18n/es.po @@ -275,33 +275,3 @@ msgstr "" #: model:ir.model.fields.selection,name:product_warranty.selection__product_template__warranty_type__year msgid "Year(s)" msgstr "" - -#~ msgid "" -#~ "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" -#~ msgstr "" -#~ "Garantía en meses para este producto/proveedor. Únicamente para " -#~ "relaciones empresa/proveedor (Orden de compra); la relación cliente/" -#~ "proveedor (Orden de venta) usa siempre el campo garantía de la ficha de " -#~ "producto" - -#~ msgid "Products return instructions" -#~ msgstr "Instrucciones de devolución de los productos" - -#~ msgid "Information about a product supplier" -#~ msgstr "Información sobre un proveedor de producto" - -#~ 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" -#~ msgstr "" -#~ "Quién se encarga del tratamiento de retorno de garantía hacia el cliente " -#~ "final. Compañía utilizará la entrega compagny actual o la dirección por " -#~ "defecto y así sucesivamente para el proveedor y el fabricante de la " -#~ "marca. No significa necessarly que la garantía que se aplica es el de la " -#~ "pareja de retorno (es decir: pueden ser devueltos a la empresa y estar " -#~ "bajo la garantía de la marca" diff --git a/product_warranty/i18n/fr.po b/product_warranty/i18n/fr.po index 80737010..b8ffaa7c 100644 --- a/product_warranty/i18n/fr.po +++ b/product_warranty/i18n/fr.po @@ -258,6 +258,3 @@ msgstr "" #: model:ir.model.fields.selection,name:product_warranty.selection__product_template__warranty_type__year msgid "Year(s)" msgstr "" - -#~ msgid "Information about a product supplier" -#~ msgstr "Information sur le fournisseur du produit" diff --git a/product_warranty/models/product_supplierinfo.py b/product_warranty/models/product_supplierinfo.py index 3ce480f1..7977ac1c 100644 --- a/product_warranty/models/product_supplierinfo.py +++ b/product_warranty/models/product_supplierinfo.py @@ -16,30 +16,6 @@ class ProductSupplierInfo(models.Model): [("is_default", "=", True)], limit=1 ) - @api.depends("warranty_return_partner") - def _compute_warranty_return_address(self): - """Method to return the partner delivery address or if none, the - default address - """ - for record in self: - return_partner = record.warranty_return_partner - partner_id = record.company_id.partner_id.id - if return_partner and return_partner == "supplier": - partner_id = record.name.id - elif ( - return_partner - and return_partner == "company" - and record.company_id.crm_return_address_id - ): - partner_id = record.company_id.crm_return_address_id.id - elif ( - return_partner - and return_partner == "other" - and record.warranty_return_other_address - ): - partner_id = record.warranty_return_other_address.id - record.warranty_return_address = partner_id - warranty_duration = fields.Float( "Period", help="Warranty in month for this product/supplier relation. Only " @@ -82,3 +58,27 @@ class ProductSupplierInfo(models.Model): help="Where the customer has to send back the product(s) " "if warranty return is set to 'other'.", ) + + @api.depends("warranty_return_partner") + def _compute_warranty_return_address(self): + """Method to return the partner delivery address or if none, the + default address + """ + for record in self: + return_partner = record.warranty_return_partner + partner_id = record.company_id.partner_id.id + if return_partner and return_partner == "supplier": + partner_id = record.partner_id.id + elif ( + return_partner + and return_partner == "company" + and record.company_id.crm_return_address_id + ): + partner_id = record.company_id.crm_return_address_id.id + elif ( + return_partner + and return_partner == "other" + and record.warranty_return_other_address + ): + partner_id = record.warranty_return_other_address.id + record.warranty_return_address = partner_id diff --git a/product_warranty/readme/CONFIGURE.rst b/product_warranty/readme/CONFIGURE.rst new file mode 100644 index 00000000..5cb5bf37 --- /dev/null +++ b/product_warranty/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +To manage the available return instructions, enable debug mode and go to +*Sales -> Configuration -> Product Return Instructions*. diff --git a/product_warranty/static/description/index.html b/product_warranty/static/description/index.html index 64a03f9e..384ec8b8 100644 --- a/product_warranty/static/description/index.html +++ b/product_warranty/static/description/index.html @@ -3,7 +3,7 @@ - + Product Warranty