From d4c34a87df20938f5e6db8a33c8aa5d85f485bcf Mon Sep 17 00:00:00 2001 From: manu Date: Mon, 31 Oct 2011 15:56:53 +0100 Subject: [PATCH 1/2] [ADD] sequence in return_line [FIX] warranty return items --- crm_claim_rma/wizard/returned_lines_from_serial.py | 12 ++++++------ product_warranty/product_warranty.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crm_claim_rma/wizard/returned_lines_from_serial.py b/crm_claim_rma/wizard/returned_lines_from_serial.py index 4c3c2d9b..ca8c41ec 100644 --- a/crm_claim_rma/wizard/returned_lines_from_serial.py +++ b/crm_claim_rma/wizard/returned_lines_from_serial.py @@ -82,7 +82,7 @@ class returned_lines_from_serial(osv.osv_memory): # Get partner from case is set to filter serials def _get_default_partner_id(self, cr, uid, context): - return self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['partner_id'])['partner_id'] + return self.pool.get('crm.claim').read(cr, uid, context['active_id'], ['partner_id'])['partner_id'][0] _defaults = { 'qty_1': lambda *a: 1.0, @@ -134,7 +134,7 @@ class returned_lines_from_serial(osv.osv_memory): # Refactor code : create 1 "createmethode" called by each if with values as parameters return_line.create(cr, uid, { 'claim_id': context['active_id'], - 'name': result.claim_1, + 'claim_origine': result.claim_1, 'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_1.id,context), #'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id],[result.prodlot_id_1.product_id.id]), #PRODLOT_ID can be in many invoice !! 'product_returned_quantity' : result.qty_1, @@ -147,7 +147,7 @@ class returned_lines_from_serial(osv.osv_memory): if result.prodlot_id_2.id : return_line.create(cr, uid, { 'claim_id': context['active_id'], - 'name': result.claim_2, + 'claim_origine': result.claim_2, 'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_2.id,context), # 'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id]), 'product_returned_quantity' : result.qty_2, @@ -160,7 +160,7 @@ class returned_lines_from_serial(osv.osv_memory): if result.prodlot_id_3.id : return_line.create(cr, uid, { 'claim_id': context['active_id'], - 'name': result.claim_3, + 'claim_origine': result.claim_3, 'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_3.id,context), # 'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id]), 'product_returned_quantity' : result.qty_3, @@ -173,7 +173,7 @@ class returned_lines_from_serial(osv.osv_memory): if result.prodlot_id_4.id : return_line.create(cr, uid, { 'claim_id': context['active_id'], - 'name': result.claim_4, + 'claim_origine': result.claim_4, 'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_4.id,context), # 'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id]), 'product_returned_quantity' : result.qty_4, @@ -186,7 +186,7 @@ class returned_lines_from_serial(osv.osv_memory): if result.prodlot_id_5.id : return_line.create(cr, uid, { 'claim_id': context['active_id'], - 'name': result.claim_5, + 'claim_origine': result.claim_5, 'product_id' : self.get_product_id(cr, uid,ids,result.prodlot_id_5.id,context), # 'invoice_id' : self.prodlot_2_invoice(cr, uid,[result.prodlot_id_1.id],[result.prodlot_id_1.product_id.id]), 'product_returned_quantity' : result.qty_5, diff --git a/product_warranty/product_warranty.py b/product_warranty/product_warranty.py index d66d1cb3..b11858e3 100644 --- a/product_warranty/product_warranty.py +++ b/product_warranty/product_warranty.py @@ -47,7 +47,7 @@ class product_supplierinfo(osv.osv): else: return [ ('company','Company'), - ('brand','Brand manufacturer'), + ('supplier','Supplier'), ('other','Other'),] # Get selected lines to add to exchange From bc6df05673001559bf1e610e58f0b5dff819be95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulius=20Sladkevi=C4=8Dius?= Date: Thu, 15 Dec 2011 17:10:20 +0200 Subject: [PATCH 2/2] Added security rights for product_warranty --- product_warranty/__openerp__.py | 5 +++-- product_warranty/security/ir.model.access.csv | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 product_warranty/security/ir.model.access.csv diff --git a/product_warranty/__openerp__.py b/product_warranty/__openerp__.py index 1e45d31e..03f092b0 100644 --- a/product_warranty/__openerp__.py +++ b/product_warranty/__openerp__.py @@ -36,10 +36,11 @@ Extend the product warranty management with warranty details on product / suppli 'depends': ['product'], 'init_xml': [], 'update_xml': [ + 'security/ir.model.access.csv', 'product_warranty_view.xml', ], - 'demo_xml': [], - 'test': [], + 'demo_xml': [], + 'test': [], 'installable': True, 'active': False, 'certificate' : '', diff --git a/product_warranty/security/ir.model.access.csv b/product_warranty/security/ir.model.access.csv new file mode 100644 index 00000000..a90c8a7a --- /dev/null +++ b/product_warranty/security/ir.model.access.csv @@ -0,0 +1,3 @@ +"id","name","model_id","group_id","perm_read","perm_write","perm_create","perm_unlink" +"access_return_instruction_user","return.instruction.user","return.instruction","Sales / User","True","True","True", +"access_return_instruction_manager","return.instruction.manager","return.instruction","Sales / Manager","True","True","True","True"