[MIG][12.0] product_warranty

This commit is contained in:
Murtuza Saleh
2019-04-23 13:41:35 +05:30
committed by Lois Suarez
parent c462a06d45
commit 279a22b2aa
15 changed files with 210 additions and 207 deletions

View File

@@ -14,13 +14,13 @@ Product Warranty
: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/11.0/product_warranty
:target: https://github.com/OCA/rma/tree/12.0/product_warranty
:alt: OCA/rma
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rma-11-0/rma-11-0-product_warranty
:target: https://translation.odoo-community.org/projects/rma-12-0/rma-12-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/11.0
:target: https://runbot.odoo-community.org/runbot/145/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -50,7 +50,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rma/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 <https://github.com/OCA/rma/issues/new?body=module:%20product_warranty%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/rma/issues/new?body=module:%20product_warranty%0Aversion:%2012.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.
@@ -76,6 +76,7 @@ Contributors
* Yanina Aular <yanina.aular@vauxoo.com>
* Cyril Gaudin <cyril.gaudin@camptocamp.com>
* Bima Jati Wijaya <bimajatiwijaya@gmail.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
Other credits
~~~~~~~~~~~~~
@@ -115,6 +116,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-osi-scampbell| |maintainer-max3903|
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/11.0/product_warranty>`_ project on GitHub.
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/12.0/product_warranty>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -1,5 +1,3 @@
# © 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

@@ -3,14 +3,13 @@
{
'name': 'Product Warranty',
'version': '11.0.1.0.0',
'version': '12.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',
'sale_management',
],
'data': [
'security/ir.model.access.csv',

View File

@@ -1,64 +1,81 @@
<?xml version="1.0"?>
<odoo>
<data noupdate="1">
<?xml version="1.0" encoding="utf-8"?>
<odoo 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_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>
<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 -->
<!-- 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.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_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>
<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>
<!-- Warranty Information of iMac Product in Supplier Info -->
<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_product_8_product_template" model="product.template">
<field name="warranty">5</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>
<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

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

View File

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

View File

@@ -12,9 +12,8 @@ class ProductSupplierInfo(models.Model):
@api.model
def _get_default_instructions(self):
""" Get selected lines to add to exchange """
instruction_ids = self.env['return.instruction']\
return self.env['return.instruction']\
.search([('is_default', '=', True)], limit=1)
return instruction_ids
@api.depends('warranty_return_partner')
def _compute_warranty_return_address(self):
@@ -24,15 +23,14 @@ class ProductSupplierInfo(models.Model):
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
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(
@@ -40,40 +38,32 @@ class ProductSupplierInfo(models.Model):
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"
)
"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)"
)
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 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 "
"(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"
)
help="Instructions for product return.")
active_supplier = fields.Boolean(
help="Is this supplier still active, only for information"
)
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.)"
)
"(computed field based on other infos.)")
warranty_return_other_address = fields.Many2one(
'res.partner',
string='Return address',
string='Return other address',
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'.")

View File

@@ -13,4 +13,4 @@ class ResCompany(models.Model):
string='Return address',
help="Default address where the customers has to send back the "
"returned product. If empty, the address is the "
"company address")
"company address.")

View File

@@ -13,9 +13,9 @@ class ReturnInstruction(models.Model):
name = fields.Char('Title', required=True)
instructions = fields.Text(
'Instructions',
help="Instructions for product return")
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")
"supplier info's. Be careful to "
"have only one default.")

View File

@@ -8,3 +8,4 @@
* Yanina Aular <yanina.aular@vauxoo.com>
* Cyril Gaudin <cyril.gaudin@camptocamp.com>
* Bima Jati Wijaya <bimajatiwijaya@gmail.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Product Warranty</title>
<style type="text/css">
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! 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/11.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-11-0/rma-11-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/11.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/rma/tree/12.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-12-0/rma-12-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/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Extends the product warranty management with warranty details on product /
supplier relation:</p>
<ul class="simple">
@@ -400,7 +400,7 @@ Management).</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rma/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/rma/issues/new?body=module:%20product_warranty%0Aversion:%2011.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/rma/issues/new?body=module:%20product_warranty%0Aversion:%2012.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>
</div>
<div class="section" id="credits">
@@ -425,6 +425,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Yanina Aular &lt;<a class="reference external" href="mailto:yanina.aular&#64;vauxoo.com">yanina.aular&#64;vauxoo.com</a>&gt;</li>
<li>Cyril Gaudin &lt;<a class="reference external" href="mailto:cyril.gaudin&#64;camptocamp.com">cyril.gaudin&#64;camptocamp.com</a>&gt;</li>
<li>Bima Jati Wijaya &lt;<a class="reference external" href="mailto:bimajatiwijaya&#64;gmail.com">bimajatiwijaya&#64;gmail.com</a>&gt;</li>
<li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
@@ -450,7 +451,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</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>This module is part of the <a class="reference external" href="https://github.com/OCA/rma/tree/11.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/rma/tree/12.0/product_warranty">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>
</div>
</div>

View File

@@ -1,5 +1,3 @@
# 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

@@ -8,8 +8,8 @@
<field name="arch" type="xml">
<page name="sales" position="inside">
<group>
<group id="warranty-left">
<label for="warranty"/>
<group string="Warranty" id="warranty-left">
<label name="warranty" for="warranty"/>
<div>
<field name="warranty" class="oe_inline"/>
<field name="warranty_type" class="oe_inline"/>

View File

@@ -1,90 +1,91 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<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">
<!-- 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 string="Return instructions">
<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"/>
</form>
</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_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 id="product_supplierinfo_warranty_tree_view" model="ir.ui.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>
</record>
</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"/>
<!-- supplier info form view -->
<record id="product_supplierinfo_warranty_form_view" model="ir.ui.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"
col="4">
<field name="active_supplier"/>
<field name="warranty_duration"/>
<field name="return_instructions"/>
</field>
</field>
</record>
</group>
<group col="4">
<field name="warranty_return_partner"/>
<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>
</xpath>
</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

@@ -1,21 +1,22 @@
<?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"/>
<!-- 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 col="2">
<group>
<field name="crm_return_address_id"/>
</group>
</xpath>
</field>
</record>
</group>
</xpath>
</field>
</record>
</data>
</odoo>