Merge pull request #23 from credativUK/8.0-product_warranty

product warranty port v8
This commit is contained in:
Yannick Vaucher
2015-05-22 15:11:48 +02:00
14 changed files with 184 additions and 151 deletions

View File

@@ -1,23 +0,0 @@
# -*- coding: utf-8 -*-
#########################################################################
# #
# #
#########################################################################
# #
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn #
# #
#This program is free software: you can redistribute it and/or modify #
#it under the terms of the GNU General Public License as published by #
#the Free Software Foundation, either version 3 of the License, or #
#(at your option) any later version. #
# #
#This program is distributed in the hope that it will be useful, #
#but WITHOUT ANY WARRANTY; without even the implied warranty of #
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
#GNU General Public License for more details. #
# #
#You should have received a copy of the GNU General Public License #
#along with this program. If not, see <http://www.gnu.org/licenses/>. #
#########################################################################
from . import product_warranty
from . import res_company

View File

@@ -1,59 +0,0 @@
# -*- coding: utf-8 -*-
#########################################################################
# #
# #
#########################################################################
# #
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn #
# #
#This program is free software: you can redistribute it and/or modify #
#it under the terms of the GNU General Public License as published by #
#the Free Software Foundation, either version 3 of the License, or #
#(at your option) any later version. #
# #
#This program is distributed in the hope that it will be useful, #
#but WITHOUT ANY WARRANTY; without even the implied warranty of #
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
#GNU General Public License for more details. #
# #
#You should have received a copy of the GNU General Public License #
#along with this program. If not, see <http://www.gnu.org/licenses/>. #
#########################################################################
{
'name': 'Product warranty',
'version': '1.0',
'category': 'Generic Modules/Product',
'description': """
Product Warranty
================
Extend the product warranty management with warranty details on product / supplier relation:
* supplier warranty duration
* Set default return address for company (if different from standard one)
* return product to company, supplier, other
Those informations are used in the RMA Claim (Product Return Management) module.
""",
'author': "Akretion,Odoo Community Association (OCA)",
'website': 'http://akretion.com',
'license': 'AGPL-3',
'depends': ['product'],
'data': [
'security/ir.model.access.csv',
'res_company_view.xml',
'product_warranty_view.xml',
],
'demo_xml': [],
'test': [],
'installable': True,
'active': False,
'certificate': '',
'images': ['images/product_warranty.png'],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -0,0 +1,48 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Product Warranty
================
Extends the product warranty management with warranty details on product /
supplier relation:
* supplier warranty duration
* Set default return address for company (if different from standard one)
* Whether to return product to company, supplier, other
Usage
=====
The new information is not explicitly used by the system until you install
another module that makes use of it, e.g. RMA Claim (Product Return
Management).
Credits
=======
Contributors
------------
* Emmanuel Samyn <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>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.

View File

@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import product_warranty
from . import res_company

View File

@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Product warranty',
'version': '1.0',
'category': 'Generic Modules/Product',
'author': "Akretion,Odoo Community Association (OCA)",
'website': 'http://akretion.com',
'license': 'AGPL-3',
'depends': ['product'],
'data': [
'security/ir.model.access.csv',
'res_company_view.xml',
'product_warranty_view.xml',
],
'demo_xml': [],
'test': [],
'installable': True,
'images': ['images/product_warranty.png'],
}

View File

@@ -35,9 +35,9 @@ msgstr "Información de garantía"
#: help:product.supplierinfo,warranty_return_partner:0
msgid ""
"Who is in charge of the warranty return treatment toward the end customer. "
"Company will use the current compagny delivery or default address and so on "
"for supplier and brand manufacturer. Doesn't necessarly mean that the "
"warranty to be applied is the one of the return partner (ie: can be returned "
"Company will use the current company delivery or default address and so on "
"for supplier and brand manufacturer. Doesn't necessarily mean that the "
"warranty to be applied is the one of the return partner (i.e. can be returned "
"to the company and be under the brand warranty"
msgstr ""
"Especifica quién es el responsable del tratamiento de la devolución de "
@@ -51,7 +51,7 @@ msgstr ""
#: help:product.supplierinfo,warranty_return_other_address_id:0
msgid ""
"Where the customer has to send back the product(s) if warranty return is "
"setto 'other'."
"set to 'other'."
msgstr ""
"Dónde debe enviar el cliente de vuelta el/los producto/s si la garantía de "
"devolución se establece a 'otra'."

View File

@@ -34,9 +34,9 @@ msgstr ""
#: help:product.supplierinfo,warranty_return_partner:0
msgid ""
"Who is in charge of the warranty return treatment toward the end customer. "
"Company will use the current compagny delivery or default address and so on "
"for supplier and brand manufacturer. Doesn't necessarly mean that the "
"warranty to be applied is the one of the return partner (ie: can be returned "
"Company will use the current company delivery or default address and so on "
"for supplier and brand manufacturer. Doesn't necessarily mean that the "
"warranty to be applied is the one of the return partner (i.e. can be returned "
"to the company and be under the brand warranty"
msgstr ""
"Indique qui est en charge du traitement du retour garantie envers le client "
@@ -49,7 +49,7 @@ msgstr ""
#: help:product.supplierinfo,warranty_return_other_address_id:0
msgid ""
"Where the customer has to send back the product(s) if warranty return is "
"setto 'other'."
"set to 'other'."
msgstr ""
#. module: product_warranty

View File

@@ -30,12 +30,12 @@ msgstr ""
#. module: product_warranty
#: help:product.supplierinfo,warranty_return_partner:0
msgid "Who is in charge of the warranty return treatment toward the end customer. Company will use the current compagny delivery or default address and so on for supplier and brand manufacturer. Doesn't necessarly mean that the warranty to be applied is the one of the return partner (ie: can be returned to the company and be under the brand warranty"
msgid "Who is in charge of the warranty return treatment toward the end customer. Company will use the current company delivery or default address and so on for supplier and brand manufacturer. Doesn't necessarily mean that the warranty to be applied is the one of the return partner (i.e. can be returned to the company and be under the brand warranty"
msgstr ""
#. module: product_warranty
#: help:product.supplierinfo,warranty_return_other_address_id:0
msgid "Where the customer has to send back the product(s) if warranty return is setto 'other'."
msgid "Where the customer has to send back the product(s) if warranty return is set to 'other'."
msgstr ""
#. module: product_warranty
@@ -129,4 +129,3 @@ msgstr ""
#: field:return.instruction,instructions:0
msgid "Instructions"
msgstr ""

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@@ -1,24 +1,22 @@
# -*- coding: utf-8 -*-
#########################################################################
# #
# #
#########################################################################
# #
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn, Benoît Guillot #
# #
#This program is free software: you can redistribute it and/or modify #
#it under the terms of the GNU General Public License as published by #
#the Free Software Foundation, either version 3 of the License, or #
#(at your option) any later version. #
# #
#This program is distributed in the hope that it will be useful, #
#but WITHOUT ANY WARRANTY; without even the implied warranty of #
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
#GNU General Public License for more details. #
# #
#You should have received a copy of the GNU General Public License #
#along with this program. If not, see <http://www.gnu.org/licenses/>. #
#########################################################################
##############################################################################
#
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn, Benoît Guillot
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import orm, fields
@@ -52,14 +50,16 @@ class product_supplierinfo(orm.Model):
""" Get selected lines to add to exchange """
instr_obj = self.pool.get('return.instruction')
instruction_ids = instr_obj.search(cr, uid,
[('is_default', '=', 'FALSE')],
[('is_default', '=', True)],
context=context)
if instruction_ids:
return instruction_ids[0]
return False
def _get_warranty_return_address(self, cr, uid, ids, field_names, arg, context=None):
""" Method to return the partner delivery address or if none, the default address
def _get_warranty_return_address(self, cr, uid, ids, field_names, arg,
context=None):
""" Method to return the partner delivery address or if none, the
default address
dedicated_delivery_address stand for the case a new type of
address more particularly dedicated to return delivery would be
@@ -76,28 +76,33 @@ class product_supplierinfo(orm.Model):
partner_id = supplier_info.name.id
elif return_partner == 'company':
if supplier_info.company_id.crm_return_address_id:
partner_id = supplier_info.company_id.crm_return_address_id.id
partner_id = supplier_info.company_id.\
crm_return_address_id.id
elif return_partner == 'other':
if supplier_info.warranty_return_other_address_id:
partner_id = supplier_info.warranty_return_other_address_id.id
partner_id = supplier_info.\
warranty_return_other_address_id.id
result[supplier_info.id] = partner_id
return result
_columns = {
"warranty_duration": fields.float(
'Period',
help="Warranty in month for this product/supplier relation. Only for "
"company/supplier relation (purchase order) ; the customer/company "
"relation (sale order) always use the product main warranty field"),
help="Warranty in month for this product/supplier relation. "
"Only for company/supplier relation (purchase order) ; "
"the customer/company relation (sale order) always use "
"the product main warranty field"),
"warranty_return_partner": fields.selection(
get_warranty_return_partner,
'Return type',
required=True,
help="Who is in charge of the warranty return treatment toward the end customer. "
"Company will use the current compagny delivery or default address and so on for "
"supplier and brand manufacturer. Doesn't necessarly mean that the warranty to be "
"applied is the one of the return partner (ie: can be returned to the company and "
"be under the brand warranty"),
help="Who is in charge of the warranty return treatment toward "
"the end customer. Company will use the current company "
"delivery or default address and so on for supplier and "
"brand manufacturer. Doesn't necessarily mean that "
"the warranty to be applied is the one of the return partner "
"(i.e. can be returned to the company and be under the brand "
"warranty"),
'return_instructions': fields.many2one(
'return.instruction',
'Instructions',

View File

@@ -1,22 +1,23 @@
<?xml version="1.0"?>
<!--
#########################################################################
# #
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn #
# #
#This program is free software: you can redistribute it and/or modify #
#it under the terms of the GNU General Public License as published by #
#the Free Software Foundation, either version 3 of the License, or #
#(at your option) any later version. #
# #
#This program is distributed in the hope that it will be useful, #
#but WITHOUT ANY WARRANTY; without even the implied warranty of #
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
#GNU General Public License for more details. #
# #
#You should have received a copy of the GNU General Public License #
#along with this program. If not, see <http://www.gnu.org/licenses/>. #
#########################################################################
##############################################################################
#
# Copyright (C) 2009-2011 Akretion, Emmanuel Samyn
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-->
<openerp>
@@ -34,15 +35,17 @@
</tree>
</field>
</record>
<!-- supplier info 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">
<field name="name"/>
<field name="is_default"/>
<group col='4'>
<field name="name"/>
<field name="is_default"/>
</group>
<separator string="Instructions" colspan="4"/>
<field name="instructions" nolabel="1" colspan="4"/>
</form>
@@ -56,11 +59,11 @@
<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="product.prod_config_main" sequence="3"/>
parent="product.prod_config_main" sequence="3"/>
<!-- supplier info -->
<!-- supplier info tree view -->
<record model="ir.ui.view" id="product_supplierinfo_warranty_tree_view">
@@ -77,7 +80,7 @@
</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>

View File

@@ -3,7 +3,8 @@
#
# Copyright 2013 Camptocamp
# Copyright 2009-2013 Akretion,
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau,
# Joel Grand-Guillaume
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as

View File

@@ -13,7 +13,7 @@
<field name="company_registry" position="after">
<separator string="Crm product return address" colspan="4"/>
<field name="crm_return_address_id"/>
</field>
</field>
</data>
</field>
</record>