[ADD] product return_instruction to product_warranty

This commit is contained in:
manu
2011-10-20 19:02:44 +02:00
parent d8a0943ed5
commit 5310ea882e
2 changed files with 59 additions and 0 deletions

View File

@@ -22,6 +22,18 @@
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"
@@ -41,6 +53,7 @@ class product_supplierinfo(osv.osv):
_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 = {

View File

@@ -21,6 +21,50 @@
<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>
@@ -32,6 +76,7 @@
<field name="warranty_duration"/>
<field name="warranty_return_partner"/>
<field name="active_supplier"/>
<field name="return_instructions"/>
</field>
</field>
</record>
@@ -47,6 +92,7 @@
<field name="warranty_duration"/>
<field name="warranty_return_partner" readonly="0"/>
<field name="active_supplier"/>
<field name="return_instructions"/>
</field>
</field>
</record>