mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[ADD] default return instructions to product_supplierinfo
This commit is contained in:
@@ -50,6 +50,12 @@ class product_supplierinfo(osv.osv):
|
|||||||
('brand','Brand manufacturer'),
|
('brand','Brand manufacturer'),
|
||||||
('other','Other'),]
|
('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 = {
|
_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_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"),
|
"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"),
|
||||||
@@ -58,6 +64,7 @@ class product_supplierinfo(osv.osv):
|
|||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'warranty_return_partner': lambda *a: 'company',
|
'warranty_return_partner': lambda *a: 'company',
|
||||||
|
'return_instructions': _get_default_instructions,
|
||||||
}
|
}
|
||||||
|
|
||||||
product_supplierinfo()
|
product_supplierinfo()
|
||||||
|
|||||||
Reference in New Issue
Block a user