Merge pull request #139 from ursais/11.0-mig-product_warranty

[MIG] product_warranty
This commit is contained in:
Maxime Chambreuil
2019-01-14 17:03:57 -06:00
committed by GitHub
26 changed files with 1016 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
**This file is going to be generated by oca-gen-addon-readme.**
*Manual changes will be overwritten.*
Please provide content in the ``readme`` directory:
* **DESCRIPTION.rst** (required)
* INSTALL.rst (optional)
* CONFIGURE.rst (optional)
* **USAGE.rst** (optional, highly recommended)
* DEVELOP.rst (optional)
* ROADMAP.rst (optional)
* HISTORY.rst (optional, recommended)
* **CONTRIBUTORS.rst** (optional, highly recommended)
* CREDITS.rst (optional)
Content of this README will also be drawn from the addon manifest,
from keys such as name, authors, maintainers, development_status,
and license.
A good, one sentence summary in the manifest is also highly recommended.

View File

@@ -0,0 +1,5 @@
# © 2016 Cyril Gaudin (Camptocamp)
# © 2009-2011 Akretion, Emmanuel Samyn
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

View File

@@ -0,0 +1,31 @@
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Product Warranty',
'version': '11.0.1.0.0',
'category': 'Generic Modules/Product',
'author': 'Akretion, Vauxoo, Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/rma',
'license': 'AGPL-3',
'depends': [
'product',
'sale',
],
'data': [
'security/ir.model.access.csv',
'views/res_company.xml',
'views/product_warranty.xml',
'views/product_template.xml'
],
'demo': [
'demo/product_warranty.xml',
'demo/res_company.xml',
],
'images': ['images/product_warranty.png'],
'development_status': 'Production/Stable',
'maintainers': [
'osi-scampbell',
'max3903',
]
}

View File

@@ -0,0 +1,64 @@
<?xml version="1.0"?>
<odoo>
<data noupdate="1">
<record id="return_instruction_1" model="return.instruction">
<field name="name">Default Instruction</field>
<field name="instructions">To return a product purchased through our platform vendor Marketplace access our online Returns Center and click Return products to begin the application process for the return.
Select the product you want to return and the reason for the return. You will need you to provide detailed information to enable the seller to handle your request. Once the seller has reviewed your application, it will respond by e-mail within 3 working days.</field>
<field name="is_default">1</field>
</record>
<record id="return_instruction_2" model="return.instruction">
<field name="name">Provisional Instruction</field>
<field name="instructions">Under the provisions of these Conditions of Sale, you may return the products received once you have contacted our customer service department adidas Mexico and the request is authorized. If you choose to return your order, we will refund: the full purchase price, as long as we have previously returned the products you order in perfect condition: (i) new product unused, (ii) with packaging, original box and tags (iii) be in the period of 30 calendar days after receiving the product. If you do not return the products to fulfill the above conditions, we are entitled to charge the products or the costs of recovery.</field>
</record>
<!-- Warranty Information of PC Assemble SC234 Product in Supplier Info -->
<record id="product.product_product_3_product_template" model="product.template">
<field name="warranty">5</field>
</record>
<record id="product_supplierinfo_warranty_31" model="product.supplierinfo">
<field name="return_instructions" ref="return_instruction_2"/>
<field name="warranty_return_partner">other</field>
<field name="warranty_return_other_address"
ref="base.res_partner_address_7"/>
<field name="warranty_duration">8</field>
<field name="product_tmpl_id" ref="product.product_product_3_product_template"/>
<field name="name" ref="base.res_partner_4"/>
<field name="delay">5</field>
<field name="min_qty">1</field>
</record>
<record id="product_supplierinfo_warranty_32" model="product.supplierinfo">
<field name="return_instructions" ref="return_instruction_1"/>
<field name="warranty_return_partner">supplier</field>
<field name="warranty_duration">12</field>
<field name="product_tmpl_id" ref="product.product_product_3_product_template"/>
<field name="name" ref="base.res_partner_3"/>
<field name="delay">5</field>
<field name="min_qty">1</field>
</record>
<!-- Warranty Information of iMac Product in Supplier Info -->
<record id="product.product_product_8_product_template" model="product.template">
<field name="warranty">5</field>
</record>
<record id="product.product_supplierinfo_5" model="product.supplierinfo">
<field name="return_instructions" ref="return_instruction_1"/>
<field name="warranty_return_partner">supplier</field>
<field name="warranty_duration">10</field>
</record>
<record id="product.product_supplierinfo_6" model="product.supplierinfo">
<field name="return_instructions" ref="return_instruction_2"/>
<field name="warranty_return_partner">supplier</field>
<field name="warranty_duration">6</field>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<odoo>
<data noupdate="1">
<record id="base.main_company" model="res.company">
<field name="crm_return_address_id" ref="base.res_partner_main1"/>
</record>
</data>
</odoo>

294
product_warranty/i18n/es.po Normal file
View File

@@ -0,0 +1,294 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * product_warranty
#
msgid ""
msgstr ""
"Project-Id-Version: product_warranty.es\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2013-11-21 15:06+0000\n"
"PO-Revision-Date: 2014-01-22 19:43+0000\n"
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
"Language-Team: Domatix Technologies\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-05-24 06:50+0000\n"
"X-Generator: Launchpad (build 17017)\n"
"Language: es_ES\n"
"X-Poedit-SourceCharset: utf-8\n"
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_return_address
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_return_other_address_id
#: field:product.supplierinfo,warranty_return_address:0
#: field:product.supplierinfo,warranty_return_other_address_id:0
msgid "Return address"
msgstr "Dirección de devolución"
#. module: product_warranty
#: view:product.supplierinfo:0
msgid "Warranty informations"
msgstr "Información de garantía"
#. 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 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 "
"garantía para el cliente final. La compañía utilizará la dirección por "
"defecto o la dirección de envío de la compañía, y así sucesivamente por "
"proveedor y marca del fabricante. No significa necesariamente que la "
"garantía que se aplica es el de la empresa que hace la devolución (es decir: "
"se puede devolver a la empresa y estar bajo la garantía de la marca)"
#. 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 "
"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'."
#. module: product_warranty
#: help:product.supplierinfo,warranty_duration:0
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."
#. module: product_warranty
#: view:res.company:0
msgid "Crm product return address"
msgstr "Dirección de devolución del producto"
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_return_instruction
#: help:product.supplierinfo,return_instructions:0
#: help:return.instruction,instructions:0
msgid "Instructions for product return"
msgstr "Instrucciones para la devolución del producto"
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_duration
#: field:product.supplierinfo,warranty_duration:0
msgid "Period"
msgstr "Periodo"
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_name
#: field:return.instruction,name:0
msgid "Title"
msgstr "Título"
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_res_company
msgid "Companies"
msgstr "Compañías"
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_active_supplier
#: field:product.supplierinfo,active_supplier:0
msgid "Active supplier"
msgstr "Proveedor activo"
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_is_default
#: field:return.instruction,is_default:0
msgid "Is default"
msgstr "Por defecto"
#. module: product_warranty
#: help:product.supplierinfo,warranty_return_address:0
msgid ""
"Where the goods should be returned (computed field based on other infos.)"
msgstr ""
"Dónde se devolverán los bienes (campo calculado basado en otra información)."
#. module: product_warranty
#: help:return.instruction,is_default:0
msgid ""
"If is default, will be use to set the default value in supplier infos. Be "
"careful to have only one default"
msgstr ""
"Si es por defecto, se usará para establecer el valor por defecto en la "
"información del proveedor. Tenga cuidado de tener sólo un por defecto."
#. module: product_warranty
#: model:ir.actions.act_window,name:product_warranty.product_return_instructions_action
#: model:ir.ui.menu,name:product_warranty.menu_product_return_instructions_action
msgid "Products return instructions"
msgstr "Instrucciones de devolución de los productos"
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_product_supplierinfo
msgid "Information about a product supplier"
msgstr "Información sobre un proveedor de producto"
#. module: product_warranty
#: help:product.supplierinfo,active_supplier:0
msgid "Is this supplier still active, only for information"
msgstr "Indica si el proveedor todavía está activo. Sólo para información."
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_return_partner
#: field:product.supplierinfo,warranty_return_partner:0
msgid "Return type"
msgstr "Tipo de devolución"
#. module: product_warranty
#: view:return.instruction:0
msgid "Return instructions"
msgstr "Instrucciones de devolución"
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_return_instructions
#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_instructions
#: field:product.supplierinfo,return_instructions:0
#: view:return.instruction:0
#: field:return.instruction,instructions:0
msgid "Instructions"
msgstr "Instrucciones"
#. module: product_warranty
#: field:product.supplierinfo,active_supplier:0
msgid "Active supplier"
msgstr "Proveedor activo"
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_res_company
msgid "Companies"
msgstr "Compañías"
#. module: product_warranty
#: field:return.instruction,create_uid:0
msgid "Created by"
msgstr "Creado por"
#. module: product_warranty
#: field:return.instruction,create_date:0
msgid "Created on"
msgstr "Creado en"
#. module: product_warranty
#: view:res.company:product_warranty.company_form
msgid "Crm product return address"
msgstr "Dirección de devolución del producto"
#. module: product_warranty
#: help:res.company,crm_return_address_id:0
msgid "Default address where the customers has to send back the returned product. If empty, the address is the company address"
msgstr "Dirección por defecto donde los clientes deben enviar de regresa los productos devueltos. Si está vacío, la dirección es la dirección de la compañía"
#. module: product_warranty
#: field:return.instruction,id:0
msgid "ID"
msgstr "ID"
#. module: product_warranty
#: help:return.instruction,is_default:0
msgid "If is default, will be use to set the default value in supplier infos. Be careful to have only one default"
msgstr "Si es por defecto, se usará para establecer el valor por defecto en la información del proveedor. Tenga cuidado de tener sólo un por defecto."
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_product_supplierinfo
msgid "Information about a product supplier"
msgstr "Información sobre un proveedor de producto"
#. module: product_warranty
#: field:product.supplierinfo,return_instructions:0
#: view:return.instruction:product_warranty.product_return_instructions_form_view
#: field:return.instruction,instructions:0
msgid "Instructions"
msgstr "Instrucciones"
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_return_instruction
#: help:product.supplierinfo,return_instructions:0
#: help:return.instruction,instructions:0
msgid "Instructions for product return"
msgstr "Instrucciones para la devolución del producto"
#. module: product_warranty
#: field:return.instruction,is_default:0
msgid "Is default"
msgstr "Por defecto"
#. module: product_warranty
#: help:product.supplierinfo,active_supplier:0
msgid "Is this supplier still active, only for information"
msgstr "Indica si el proveedor todavía está activo. Sólo para información."
#. module: product_warranty
#: field:return.instruction,write_uid:0
msgid "Last Updated by"
msgstr "Last Updated by"
#. module: product_warranty
#: field:return.instruction,write_date:0
msgid "Last Updated on"
msgstr "Last Updated on"
#. module: product_warranty
#: field:product.supplierinfo,warranty_duration:0
msgid "Period"
msgstr "Periodo"
#. module: product_warranty
#: model:ir.actions.act_window,name:product_warranty.product_return_instructions_action
#: model:ir.ui.menu,name:product_warranty.menu_product_return_instructions_action
msgid "Products Return Instructions"
msgstr "Intrucciones para devolución de productos"
#. module: product_warranty
#: field:product.supplierinfo,warranty_return_other_address:0
#: field:res.company,crm_return_address_id:0
msgid "Return address"
msgstr "Dirección de retorno"
#. module: product_warranty
#: view:return.instruction:product_warranty.product_return_instructions_form_view
#: view:return.instruction:product_warranty.product_return_instructions_tree_view
msgid "Return instructions"
msgstr "Instrucciones de devolución"
#. module: product_warranty
#: field:product.supplierinfo,warranty_return_partner:0
msgid "Return type"
msgstr "Tipo de devolución"
#. module: product_warranty
#: field:return.instruction,name:0
msgid "Title"
msgstr "Título"
#. module: product_warranty
#: help:product.supplierinfo,warranty_duration:0
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 la relación producto/proveedor. Sólo para la relación producto/compañía (orden de compra); la relación cliente/compañía (orden de venta) siempre usa el producto principal para el campo garantía"
#. module: product_warranty
#: view:product.supplierinfo:product_warranty.product_supplierinfo_warranty_form_view
msgid "Warranty informations"
msgstr "Información de garantía"
#. module: product_warranty
#: help:product.supplierinfo,warranty_return_other_address:0
msgid "Where the customer has to send back the product(s) if warranty return is set to 'other'."
msgstr "Donde el cliente debe enviar el producto si la garantía es 'otros'"
#. 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"
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"

View File

@@ -0,0 +1,16 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_warranty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-17 20:41+0000\n"
"PO-Revision-Date: 2015-07-17 20:41+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

View File

@@ -0,0 +1,16 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_warranty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-17 20:41+0000\n"
"PO-Revision-Date: 2015-07-17 20:41+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

View File

@@ -0,0 +1,16 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_warranty
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-17 20:41+0000\n"
"PO-Revision-Date: 2015-07-17 20:41+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

155
product_warranty/i18n/fr.po Normal file
View File

@@ -0,0 +1,155 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * product_warranty
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.0.2\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2013-11-21 15:06+0000\n"
"PO-Revision-Date: 2014-01-22 19:17+0000\n"
"Last-Translator: Joël Grand-Guillaume @ camptocamp "
"<joel.grandguillaume@camptocamp.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-05-24 06:50+0000\n"
"X-Generator: Launchpad (build 17017)\n"
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_return_address
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_return_other_address_id
#: field:product.supplierinfo,warranty_return_address:0
#: field:product.supplierinfo,warranty_return_other_address_id:0
msgid "Return address"
msgstr ""
#. module: product_warranty
#: view:product.supplierinfo:0
msgid "Warranty informations"
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 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 "
"final. L'entreprise utilise l'adresse de livraison, et sinon l'adresse par "
"défaut. Il en va de même pour les options fournisseur ou fabricant. Ce champ "
"n'implique pas forcément que la garantie qui va s'appliquer est celle de "
"celui qui gère le retour."
#. 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 "
"set to 'other'."
msgstr ""
#. module: product_warranty
#: help:product.supplierinfo,warranty_duration:0
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 ""
"Garantie en nombre de mois pour ce fournisseur. Uniquement pour la relation "
"entreprise/fournisseur (commandes d'achat) ; La relation entreprise/client "
"(commandes de vente) utilise toujours le champ de garantie de la fiche "
"produit"
#. module: product_warranty
#: view:res.company:0
msgid "Crm product return address"
msgstr ""
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_return_instruction
#: help:product.supplierinfo,return_instructions:0
#: help:return.instruction,instructions:0
msgid "Instructions for product return"
msgstr ""
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_duration
#: field:product.supplierinfo,warranty_duration:0
msgid "Period"
msgstr ""
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_name
#: field:return.instruction,name:0
msgid "Title"
msgstr ""
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_res_company
msgid "Companies"
msgstr ""
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_active_supplier
#: field:product.supplierinfo,active_supplier:0
msgid "Active supplier"
msgstr "Fournisseur actif"
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_is_default
#: field:return.instruction,is_default:0
msgid "Is default"
msgstr ""
#. module: product_warranty
#: help:product.supplierinfo,warranty_return_address:0
msgid ""
"Where the goods should be returned (computed field based on other infos.)"
msgstr ""
#. module: product_warranty
#: help:return.instruction,is_default:0
msgid ""
"If is default, will be use to set the default value in supplier infos. Be "
"careful to have only one default"
msgstr ""
#. module: product_warranty
#: model:ir.actions.act_window,name:product_warranty.product_return_instructions_action
#: model:ir.ui.menu,name:product_warranty.menu_product_return_instructions_action
msgid "Products return instructions"
msgstr ""
#. module: product_warranty
#: model:ir.model,name:product_warranty.model_product_supplierinfo
msgid "Information about a product supplier"
msgstr "Information sur le fournisseur du produit"
#. module: product_warranty
#: help:product.supplierinfo,active_supplier:0
msgid "Is this supplier still active, only for information"
msgstr ""
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_warranty_return_partner
#: field:product.supplierinfo,warranty_return_partner:0
msgid "Return type"
msgstr ""
#. module: product_warranty
#: view:return.instruction:0
msgid "Return instructions"
msgstr ""
#. module: product_warranty
#: model:ir.model.fields,field_description:product_warranty.field_product_supplierinfo_return_instructions
#: model:ir.model.fields,field_description:product_warranty.field_return_instruction_instructions
#: field:product.supplierinfo,return_instructions:0
#: view:return.instruction:0
#: field:return.instruction,instructions:0
msgid "Instructions"
msgstr ""

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@@ -0,0 +1,10 @@
# © 2016 Cyril Gaudin (Camptocamp)
# © 2009-2011 Akretion, Emmanuel Samyn
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import (
return_instruction,
product_supplierinfo,
res_company,
product_template
)

View File

@@ -0,0 +1,79 @@
# © 2016 Cyril Gaudin (Camptocamp)
# © 2015 Vauxoo
# © 2009-2011 Akretion, Emmanuel Samyn, Benoît Guillot
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ProductSupplierInfo(models.Model):
_inherit = "product.supplierinfo"
@api.model
def _get_default_instructions(self):
""" Get selected lines to add to exchange """
instruction_ids = self.env['return.instruction']\
.search([('is_default', '=', True)], limit=1)
return instruction_ids
@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:
if return_partner == 'supplier':
partner_id = record.name.id
elif return_partner == 'company':
if record.company_id.crm_return_address_id:
partner_id = record.company_id.crm_return_address_id.id
elif return_partner == 'other':
if 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 "
"for company/supplier relation (purchase order) ; the "
"customer/company relation (sale order) always use the "
"product main warranty field"
)
warranty_return_partner = fields.Selection(
[('company', 'Company'), ('supplier', 'Supplier'), ('other', 'Other')],
string='Return type',
required=True,
default='company',
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)"
)
return_instructions = fields.Many2one(
'return.instruction',
'Instructions',
default=_get_default_instructions,
help="Instructions for product return"
)
active_supplier = fields.Boolean(
help="Is this supplier still active, only for information"
)
warranty_return_address = fields.Many2one(
'res.partner',
compute='_compute_warranty_return_address',
string="Return address",
help="Where the goods should be returned "
"(computed field based on other infos.)"
)
warranty_return_other_address = fields.Many2one(
'res.partner',
string='Return address',
help="Where the customer has to send back the product(s) "
"if warranty return is set to 'other'."
)

View File

@@ -0,0 +1,16 @@
# Copyright (C) 2018 - TODAY, Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
warranty = fields.Integer(string='Warranty Duration')
warranty_type = fields.Selection([('day', 'Day(s)'),
('week', 'Week(s)'),
('month', 'Month(s)'),
('year', 'Year(s)')],
string='Warranty Type',
required=True, default='day')

View File

@@ -0,0 +1,16 @@
# © 2016 Joel Grand-Guillaume, Cyril Gaudin (Camptocamp)
# © 2009-2013 Akretion, Emmanuel Samyn, Raphaël Valyi, Sébastien Beau
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResCompany(models.Model):
_inherit = "res.company"
crm_return_address_id = fields.Many2one(
'res.partner',
string='Return address',
help="Default address where the customers has to send back the "
"returned product. If empty, the address is the "
"company address")

View File

@@ -0,0 +1,21 @@
# © 2016 Cyril Gaudin (Camptocamp)
# © 2015 Vauxoo
# © 2009-2011 Akretion, Emmanuel Samyn, Benoît Guillot
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ReturnInstruction(models.Model):
_name = "return.instruction"
_description = "Instructions for product return"
name = fields.Char('Title', required=True)
instructions = fields.Text(
'Instructions',
help="Instructions for product return")
is_default = fields.Boolean('Is default',
help="If is default, will be use "
"to set the default value in "
"supplier infos. Be careful to "
"have only one default")

View File

@@ -0,0 +1,10 @@
* Emmanuel Samyn <esamyn@gmail.com>
* Paulius Sladkevičius <paulius@inovera.lt>
* Benoît Guillot <benoit.guillot@akretion.com.br>
* David Beal <david.beal@akretion.com>
* Maxime Chambreuil <maxime.chambreuil@savoirfairelinux.com>
* Joël Grand-Guillaume <joel.grandguillaume@gmail.com>
* Ondřej Kuzník <ondrej.kuznik@credativ.co.uk>
* Yanina Aular <yanina.aular@vauxoo.com>
* Cyril Gaudin <cyril.gaudin@camptocamp.com>
* Bima Jati Wijaya <bimajatiwijaya@gmail.com>

View File

@@ -0,0 +1,10 @@
This module has been financially supported by:
* Inovera <https://www.inovera.lt>
* Akretion Brazil <https://www.akretion.com.br>
* Akretion <https://www.akretion.com>
* Savoir-faire Linux <https://www.savoirfairelinux.com>
* Credativ <https://www.credativ.co.uk>
* Vauxoo <https://www.vauxoo.com>
* Camp 2 Camp <https://camptocamp.com>
* Open Source Integrators <https://www.opensourceintegrators.com>

View File

@@ -0,0 +1,6 @@
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

View File

@@ -0,0 +1,3 @@
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).

View File

@@ -0,0 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_return_instruction_user","return.instruction.user","model_return_instruction","base.group_user","True","False","False","False"
"access_return_instruction_manager","return.instruction.manager","model_return_instruction","sales_team.group_sale_manager","True","True","True","True"
"access_return_instruction_salesman","return.instruction.salesman","model_return_instruction","sales_team.group_sale_salesman","True","True","True","True"
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_return_instruction_user return.instruction.user model_return_instruction base.group_user True False False False
3 access_return_instruction_manager return.instruction.manager model_return_instruction sales_team.group_sale_manager True True True True
4 access_return_instruction_salesman return.instruction.salesman model_return_instruction sales_team.group_sale_salesman True True True True

View File

@@ -0,0 +1,5 @@
# Author: Yanina Aular
# Copyright 2015 Vauxoo
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_product_warranty

View File

@@ -0,0 +1,73 @@
# © 2016 Cyril Gaudin (Camptocamp)
# © 2015 Vauxoo, Yanina Aular
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestProductWarranty(TransactionCase):
def setUp(self):
super(TestProductWarranty, self).setUp()
self.instruction_model = self.env['return.instruction']
self.supplierinfo = self.env['product.supplierinfo']
self.create_product_supplierinfo()
def create_product_supplierinfo(self):
"""
Create a record of product.supplier for next tests
"""
product_tmpl_id = self.env.ref('product.product_product_3')
partner_id = self.env.ref('base.res_partner_4')
other_partner = self.env.ref('base.res_partner_12')
supplierinfo_data = dict(
name=partner_id.id,
product_name='Test SupplierInfo for display Default Instruction',
min_qty=4,
delay=5,
warranty_return_partner='supplier',
product_tmpl_id=product_tmpl_id.id,
warranty_return_other_address=other_partner.id,
)
self.supplierinfo_brw = self.supplierinfo.create(supplierinfo_data)
def test_default_instruction(self):
"""
Test for return.instruction record with
default field in True. If is assigned
correctly when one record of
product.supplierinfo is created
"""
return_instructions_id = self.env.ref('product_warranty.'
'return_instruction_1')
self.assertEquals(self.supplierinfo_brw.return_instructions.id,
return_instructions_id.id)
def test_warranty_return_address(self):
"""
Test warranty_return_address field is calculate correctly depends of
warranty_return_partner
"""
self.create_product_supplierinfo()
self.assertEquals(self.supplierinfo_brw.warranty_return_address.id,
self.supplierinfo_brw.name.id)
self.supplierinfo_brw.write({'warranty_return_partner': 'company'})
self.assertEquals(self.supplierinfo_brw.warranty_return_address.id,
self.supplierinfo_brw.company_id.
crm_return_address_id.id)
self.supplierinfo_brw.write({'warranty_return_partner': 'other'})
self.assertEquals(
self.supplierinfo_brw.warranty_return_address.id,
self.supplierinfo_brw.warranty_return_other_address.id
)

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_template_extend_warranty" model="ir.ui.view">
<field name="model">product.template</field>
<field name="inherit_id"
ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<page name="sales" position="inside">
<group>
<group id="warranty-left">
<label for="warranty"/>
<div>
<field name="warranty" class="oe_inline"/>
<field name="warranty_type" class="oe_inline"/>
</div>
</group>
<group id="warranty-right"/>
</group>
</page>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,90 @@
<?xml version="1.0"?>
<odoo>
<data>
<!-- return instructions tree view -->
<record model="ir.ui.view" id="product_return_instructions_tree_view">
<field name="name">product.return.instructions.tree</field>
<field name="model">return.instruction</field>
<field name="arch" type="xml">
<tree string="Return instructions">
<field name="name"/>
<field name="instructions"/>
<field name="is_default"/>
</tree>
</field>
</record>
<!-- return instructions form view -->
<record model="ir.ui.view" id="product_return_instructions_form_view">
<field name="name">product.return.instructions.form</field>
<field name="model">return.instruction</field>
<field name="arch" type="xml">
<form string="Return instructions">
<group name="return_instructions" col='4'>
<field name="name"/>
<field name="is_default"/>
</group>
<separator string="Instructions" colspan="4"/>
<field name="instructions" nolabel="1" colspan="4"/>
</form>
</field>
</record>
<record id="product_return_instructions_action" model="ir.actions.act_window">
<field name="name">Products Return Instructions</field>
<field name="res_model">return.instruction</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="product_return_instructions_tree_view"/>
</record>
<menuitem action="product_return_instructions_action"
groups="base.group_no_one"
id="menu_product_return_instructions_action"
parent="sale.prod_config_main" sequence="3"/>
<!-- supplier info tree view -->
<record model="ir.ui.view" id="product_supplierinfo_warranty_tree_view">
<field name="name">product.supplierinfo.warranty.tree</field>
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_tree_view" />
<field name="arch" type="xml">
<field name="min_qty" position="before">
<field name="warranty_duration"/>
<field name="warranty_return_partner"/>
<field name="warranty_return_address"/>
<field name="active_supplier"/>
<field name="return_instructions"/>
</field>
</field>
</record>
<!-- supplier info form view -->
<record model="ir.ui.view" id="product_supplierinfo_warranty_form_view">
<field name="name">product.supplierinfo.warranty.form</field>
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_form_view" />
<field name="arch" type="xml">
<xpath expr="//group[last()]" position="after">
<group name="waranty_group" string="Warranty informations" colspan="4">
<field name="active_supplier"/>
<field name="warranty_duration"/>
<field name="return_instructions"/>
<group colspan="4">
<group>
<field name="warranty_return_partner"/>
</group>
<group>
<field name="warranty_return_other_address"
attrs="{'invisible':[('warranty_return_partner', '!=', 'other')], 'required':[('warranty_return_partner', '=', 'other')]}"
class="oe_inline"/>
<field name="warranty_return_address" attrs="{'invisible':[('warranty_return_partner', '=', 'other')]}" class="oe_inline" />
</group>
</group>
</group>
</xpath>
</field>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- INHERITED VIEW FOR THE OBJECT : res_company -->
<record id="company_form" model="ir.ui.view">
<field name="name">crm_claim_rma.company_form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='company_registry']/ancestor::group" position="after">
<separator string="CRM Product Return Address"/>
<group>
<field name="crm_return_address_id"/>
</group>
</xpath>
</field>
</record>
</data>
</odoo>