mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[INIT] crm_claim_rma & product_warranty
This commit is contained in:
23
product_warranty/__init__.py
Normal file
23
product_warranty/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- 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/>. #
|
||||
#########################################################################
|
||||
|
||||
import product_warranty
|
||||
49
product_warranty/__openerp__.py
Normal file
49
product_warranty/__openerp__.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# -*- 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': """
|
||||
Akretion - Emmanuel Samyn
|
||||
Extend the product warranty management with warranty details on product / supplier relation
|
||||
* supplier warranty duration
|
||||
* return product to company, supplier, brand, other
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['product'],
|
||||
'init_xml': [],
|
||||
'update_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:
|
||||
72
product_warranty/i18n/fr.po
Normal file
72
product_warranty/i18n/fr.po
Normal file
@@ -0,0 +1,72 @@
|
||||
# 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: 2011-10-20 10:07+0000\n"
|
||||
"PO-Revision-Date: 2011-10-20 10:07+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"
|
||||
|
||||
#. module: product_warranty
|
||||
#: field:product.supplierinfo,warranty_duration:0
|
||||
msgid "Warranty"
|
||||
msgstr "Garantie"
|
||||
|
||||
#. 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
|
||||
#: model:ir.module.module,description:product_warranty.module_meta_information
|
||||
msgid "\n"
|
||||
"Akretion - Emmanuel Samyn\n"
|
||||
"Extend the product warranty management with warranty details on product / supplier relation\n"
|
||||
"* supplier warranty duration\n"
|
||||
"* return product to company, supplier, brand, other\n"
|
||||
" "
|
||||
msgstr "\n"
|
||||
"Akretion - Emmanuel Samyn\n"
|
||||
"Extend the product warranty management with warranty details on product / supplier relation\n"
|
||||
"* supplier warranty duration\n"
|
||||
"* return product to company, supplier, brand, other\n"
|
||||
" "
|
||||
|
||||
#. 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
|
||||
#: field:product.supplierinfo,active_supplier:0
|
||||
msgid "Active supplier"
|
||||
msgstr "Fournisseur actif"
|
||||
|
||||
#. module: product_warranty
|
||||
#: constraint:product.supplierinfo:0
|
||||
msgid "Error: The default UOM and the Supplier Product UOM must be in the same category."
|
||||
msgstr "Erreur : l'UdM par défaut et l'UdM du fournisseur doivent appartenir à la même catégorie."
|
||||
|
||||
#. module: product_warranty
|
||||
#: model:ir.module.module,shortdesc:product_warranty.module_meta_information
|
||||
msgid "Product warranty"
|
||||
msgstr "Garantie du produit"
|
||||
|
||||
#. module: product_warranty
|
||||
#: field:product.supplierinfo,warranty_return_partner:0
|
||||
msgid "Warrantee return"
|
||||
msgstr "Retour garantie"
|
||||
|
||||
#. 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 "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."
|
||||
|
||||
BIN
product_warranty/images/product_warranty.png
Normal file
BIN
product_warranty/images/product_warranty.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
72
product_warranty/product_warranty.py
Normal file
72
product_warranty/product_warranty.py
Normal file
@@ -0,0 +1,72 @@
|
||||
# -*- 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 osv import fields, osv
|
||||
|
||||
#=====
|
||||
class return_instruction(osv.osv):
|
||||
_name = "return.instruction"
|
||||
_description = "Instructions for product return"
|
||||
_columns = {
|
||||
'name': fields.char('Title', size=128, 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"),
|
||||
}
|
||||
return_instruction()
|
||||
|
||||
#=====
|
||||
class product_supplierinfo(osv.osv):
|
||||
_inherit = "product.supplierinfo"
|
||||
|
||||
def get_warranty_return_partner(self, cr, uid, context=None):
|
||||
if self.pool.get('ir.module.module').search(cr, uid, [('name','like','product_brand'),('state','like','installed')]):
|
||||
return [
|
||||
('company','Company'),
|
||||
('supplier','Supplier'),
|
||||
('brand','Brand manufacturer'),
|
||||
('other','Other'),]
|
||||
else:
|
||||
return [
|
||||
('company','Company'),
|
||||
('supplier','Supplier'),
|
||||
('other','Other'),]
|
||||
|
||||
# Get selected lines to add to exchange
|
||||
def _get_default_instructions(self, cr, uid,context):
|
||||
instruction_ids = self.pool.get('return.instruction').search(cr, uid, [('is_default','=','FALSE')])
|
||||
if instruction_ids:
|
||||
return instruction_ids[0]
|
||||
|
||||
_columns = {
|
||||
"warranty_duration" : fields.float('Warranty', 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, 'Warrantee return', size=128, 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',help="Instructions for product return"),
|
||||
'active_supplier' : fields.boolean('Active supplier', help=""),
|
||||
}
|
||||
_defaults = {
|
||||
'warranty_return_partner': lambda *a: 'company',
|
||||
'return_instructions': _get_default_instructions,
|
||||
}
|
||||
|
||||
product_supplierinfo()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
101
product_warranty/product_warranty_view.xml
Normal file
101
product_warranty/product_warranty_view.xml
Normal file
@@ -0,0 +1,101 @@
|
||||
<?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/>. #
|
||||
#########################################################################
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- return instructions -->
|
||||
<!-- supplier info 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="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Return instructions">
|
||||
<field name="name"/>
|
||||
<field name="instructions"/>
|
||||
<field name="is_default"/>
|
||||
</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="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Return instructions">
|
||||
<field name="name"/>
|
||||
<field name="is_default"/>
|
||||
<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="type">ir.actions.act_window</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_extended"
|
||||
id="menu_product_return_instructions_action"
|
||||
parent="product.prod_config_main" sequence="3"/>
|
||||
<!-- supplier info -->
|
||||
<!-- 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="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field position="after" name="delay">
|
||||
<field name="warranty_duration"/>
|
||||
<field name="warranty_return_partner"/>
|
||||
<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="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field position="after" name="delay">
|
||||
<field name="warranty_duration"/>
|
||||
<field name="warranty_return_partner" readonly="0"/>
|
||||
<field name="active_supplier"/>
|
||||
<field name="return_instructions"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user