[MIG] product_warranty: Migration to 16.0

Co-Authored By: Stefan Ungureanu <stefan.ungureanu@tecnativa.com>
This commit is contained in:
arulbalamurugan
2022-11-29 12:05:46 +05:30
committed by Antoni Marroig Campomar
parent a4084d8c55
commit 6bcf4cb7ff
13 changed files with 126 additions and 140 deletions

View File

@@ -13,15 +13,15 @@ Product Warranty
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2F/opt/odoo/oca/rma/-lightgray.png?logo=github
:target: https://github.com/OCA/rma/tree/15.0/product_warranty :target: https://github.com/OCA//opt/odoo/oca/rma//tree/16.0/product_warranty
:alt: OCA/rma :alt: OCA//opt/odoo/oca/rma/
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |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 :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/145/15.0 :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA//opt/odoo/oca/rma/&target_branch=16.0
:alt: Try me on Runbot :alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -33,6 +33,12 @@ to set product warranty details on products and product-supplier relation.
.. contents:: .. contents::
:local: :local:
Configuration
=============
To manage the available return instructions, enable debug mode and go to
*Sales -> Configuration -> Product Return Instructions*.
Usage Usage
===== =====
@@ -48,10 +54,10 @@ To use this module, you need to:
Bug Tracker Bug Tracker
=========== ===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rma/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA//opt/odoo/oca/rma//issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/rma/issues/new?body=module:%20product_warranty%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA//opt/odoo/oca/rma//issues/new?body=module:%20product_warranty%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@@ -117,6 +123,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-osi-scampbell| |maintainer-max3903| |maintainer-osi-scampbell| |maintainer-max3903|
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/15.0/product_warranty>`_ project on GitHub. This module is part of the `OCA//opt/odoo/oca/rma/ <https://github.com/OCA//opt/odoo/oca/rma//tree/16.0/product_warranty>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -11,9 +11,10 @@
"depends": ["sale_management"], "depends": ["sale_management"],
"data": [ "data": [
"security/ir.model.access.csv", "security/ir.model.access.csv",
"views/res_company.xml", "views/res_company_views.xml",
"views/product_warranty.xml", "views/product_supplierinfo_views.xml",
"views/product_template.xml", "views/product_template_views.xml",
"views/return_instructions_views.xml",
], ],
"demo": ["demo/product_warranty.xml", "demo/res_company.xml"], "demo": ["demo/product_warranty.xml", "demo/res_company.xml"],
"images": ["images/product_warranty.png"], "images": ["images/product_warranty.png"],

View File

@@ -40,7 +40,7 @@
name="product_tmpl_id" name="product_tmpl_id"
ref="product.product_product_3_product_template" ref="product.product_product_3_product_template"
/> />
<field name="name" ref="base.res_partner_4" /> <field name="partner_id" ref="base.res_partner_4" />
<field name="delay">5</field> <field name="delay">5</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
</record> </record>
@@ -52,7 +52,7 @@
name="product_tmpl_id" name="product_tmpl_id"
ref="product.product_product_3_product_template" ref="product.product_product_3_product_template"
/> />
<field name="name" ref="base.res_partner_3" /> <field name="partner_id" ref="base.res_partner_3" />
<field name="delay">5</field> <field name="delay">5</field>
<field name="min_qty">1</field> <field name="min_qty">1</field>
</record> </record>

View File

@@ -275,33 +275,3 @@ msgstr ""
#: model:ir.model.fields.selection,name:product_warranty.selection__product_template__warranty_type__year #: model:ir.model.fields.selection,name:product_warranty.selection__product_template__warranty_type__year
msgid "Year(s)" msgid "Year(s)"
msgstr "" 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"

View File

@@ -258,6 +258,3 @@ msgstr ""
#: model:ir.model.fields.selection,name:product_warranty.selection__product_template__warranty_type__year #: model:ir.model.fields.selection,name:product_warranty.selection__product_template__warranty_type__year
msgid "Year(s)" msgid "Year(s)"
msgstr "" msgstr ""
#~ msgid "Information about a product supplier"
#~ msgstr "Information sur le fournisseur du produit"

View File

@@ -16,30 +16,6 @@ class ProductSupplierInfo(models.Model):
[("is_default", "=", True)], limit=1 [("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( warranty_duration = fields.Float(
"Period", "Period",
help="Warranty in month for this product/supplier relation. Only " 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) " help="Where the customer has to send back the product(s) "
"if warranty return is set to 'other'.", "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

View File

@@ -0,0 +1,2 @@
To manage the available return instructions, enable debug mode and go to
*Sales -> Configuration -> Product Return Instructions*.

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Product Warranty</title> <title>Product Warranty</title>
<style type="text/css"> <style type="text/css">
@@ -367,25 +367,31 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/rma/tree/15.0/product_warranty"><img alt="OCA/rma" src="https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/rma-15-0/rma-15-0-product_warranty"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/145/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA//opt/odoo/oca/rma//tree/16.0/product_warranty"><img alt="OCA//opt/odoo/oca/rma/" src="https://img.shields.io/badge/github-OCA%2F/opt/odoo/oca/rma/-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects//opt/odoo/oca/rma/-16-0//opt/odoo/oca/rma/-16-0-product_warranty"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA//opt/odoo/oca/rma/&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of Sales Management to allows you <p>This module extends the functionality of Sales Management to allows you
to set product warranty details on products and product-supplier relation.</p> to set product warranty details on products and product-supplier relation.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li> <li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li> <li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul> <li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li> <li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li> <li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#other-credits" id="id6">Other credits</a></li> <li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li> <li><a class="reference internal" href="#other-credits" id="id7">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
<p>To manage the available return instructions, enable debug mode and go to
<em>Sales -&gt; Configuration -&gt; Product Return Instructions</em>.</p>
</div>
<div class="section" id="usage"> <div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1> <h1><a class="toc-backref" href="#id2">Usage</a></h1>
<p>To use this module, you need to:</p> <p>To use this module, you need to:</p>
<ol class="arabic simple"> <ol class="arabic simple">
<li>Go to <em>Sales &gt; Products &gt; Products (or Product Variants)</em></li> <li>Go to <em>Sales &gt; Products &gt; Products (or Product Variants)</em></li>
@@ -397,24 +403,24 @@ edit supplier information lines an set the warranty information for each one.</l
</ol> </ol>
</div> </div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rma/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA//opt/odoo/oca/rma//issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/rma/issues/new?body=module:%20product_warranty%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA//opt/odoo/oca/rma//issues/new?body=module:%20product_warranty%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
<h1><a class="toc-backref" href="#id3">Credits</a></h1> <h1><a class="toc-backref" href="#id4">Credits</a></h1>
<div class="section" id="authors"> <div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2> <h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Akretion</li> <li>Akretion</li>
<li>Vauxoo</li> <li>Vauxoo</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2> <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple"> <ul class="simple">
<li>Emmanuel Samyn &lt;<a class="reference external" href="mailto:esamyn&#64;gmail.com">esamyn&#64;gmail.com</a>&gt;</li> <li>Emmanuel Samyn &lt;<a class="reference external" href="mailto:esamyn&#64;gmail.com">esamyn&#64;gmail.com</a>&gt;</li>
<li>Paulius Sladkevičius &lt;<a class="reference external" href="mailto:paulius&#64;inovera.lt">paulius&#64;inovera.lt</a>&gt;</li> <li>Paulius Sladkevičius &lt;<a class="reference external" href="mailto:paulius&#64;inovera.lt">paulius&#64;inovera.lt</a>&gt;</li>
@@ -430,7 +436,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</ul> </ul>
</div> </div>
<div class="section" id="other-credits"> <div class="section" id="other-credits">
<h2><a class="toc-backref" href="#id6">Other credits</a></h2> <h2><a class="toc-backref" href="#id7">Other credits</a></h2>
<p>This module has been financially supported by:</p> <p>This module has been financially supported by:</p>
<ul class="simple"> <ul class="simple">
<li>Inovera &lt;<a class="reference external" href="https://www.inovera.lt">https://www.inovera.lt</a>&gt;</li> <li>Inovera &lt;<a class="reference external" href="https://www.inovera.lt">https://www.inovera.lt</a>&gt;</li>
@@ -444,7 +450,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2> <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p> <p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
@@ -452,7 +458,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/osi-scampbell"><img alt="osi-scampbell" src="https://github.com/osi-scampbell.png?size=40px" /></a> <a class="reference external" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a></p> <p><a class="reference external" href="https://github.com/osi-scampbell"><img alt="osi-scampbell" src="https://github.com/osi-scampbell.png?size=40px" /></a> <a class="reference external" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rma/tree/15.0/product_warranty">OCA/rma</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA//opt/odoo/oca/rma//tree/16.0/product_warranty">OCA//opt/odoo/oca/rma/</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@@ -6,11 +6,12 @@ from odoo.tests.common import TransactionCase
class TestProductWarranty(TransactionCase): class TestProductWarranty(TransactionCase):
def setUp(self): @classmethod
super(TestProductWarranty, self).setUp() def setUpClass(cls):
self.instruction_model = self.env["return.instruction"] super().setUpClass()
self.supplierinfo = self.env["product.supplierinfo"] cls.instruction_model = cls.env["return.instruction"]
self.create_product_supplierinfo() cls.supplierinfo = cls.env["product.supplierinfo"]
cls.create_product_supplierinfo(cls)
def create_product_supplierinfo(self): def create_product_supplierinfo(self):
""" """
@@ -23,7 +24,7 @@ class TestProductWarranty(TransactionCase):
other_partner = self.env.ref("base.res_partner_12") other_partner = self.env.ref("base.res_partner_12")
supplierinfo_data = dict( supplierinfo_data = dict(
name=partner_id.id, partner_id=partner_id.id,
product_name="Test SupplierInfo for display Default Instruction", product_name="Test SupplierInfo for display Default Instruction",
min_qty=4, min_qty=4,
delay=5, delay=5,
@@ -59,7 +60,7 @@ class TestProductWarranty(TransactionCase):
self.assertEqual( self.assertEqual(
self.supplierinfo_brw.warranty_return_address.id, self.supplierinfo_brw.warranty_return_address.id,
self.supplierinfo_brw.name.id, self.supplierinfo_brw.partner_id.id,
) )
self.supplierinfo_brw.write({"warranty_return_partner": "company"}) self.supplierinfo_brw.write({"warranty_return_partner": "company"})

View File

@@ -1,47 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<odoo> <odoo>
<!-- return instructions tree view -->
<record id="product_return_instructions_tree_view" model="ir.ui.view">
<field name="name">product.return.instructions.tree</field>
<field name="model">return.instruction</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="instructions" />
<field name="is_default" />
</tree>
</field>
</record>
<!-- return instructions form view -->
<record id="product_return_instructions_form_view" model="ir.ui.view">
<field name="name">product.return.instructions.form</field>
<field name="model">return.instruction</field>
<field name="arch" type="xml">
<form string="Return instructions">
<sheet>
<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" />
</sheet>
</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_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 --> <!-- supplier info tree view -->
<record id="product_supplierinfo_warranty_tree_view" model="ir.ui.view"> <record id="product_supplierinfo_warranty_tree_view" model="ir.ui.view">
<field name="name">product.supplierinfo.warranty.tree</field> <field name="name">product.supplierinfo.warranty.tree</field>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- return instructions tree view -->
<record id="product_return_instructions_tree_view" model="ir.ui.view">
<field name="name">product.return.instructions.tree</field>
<field name="model">return.instruction</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="instructions" />
<field name="is_default" />
</tree>
</field>
</record>
<!-- return instructions form view -->
<record id="product_return_instructions_form_view" model="ir.ui.view">
<field name="name">product.return.instructions.form</field>
<field name="model">return.instruction</field>
<field name="arch" type="xml">
<form string="Return instructions">
<sheet>
<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" />
</sheet>
</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_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"
/>
</odoo>