From 1acbf560bc50b7cabfcdb33787afa6960a67a908 Mon Sep 17 00:00:00 2001 From: manu Date: Mon, 17 Oct 2011 17:18:40 +0200 Subject: [PATCH] [Update] refund & picking to apply for both supplier/customer claim type --- crm_claim_rma/wizard/picking_from_returned_lines.py | 2 +- crm_claim_rma/wizard/refund_from_returned_lines.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crm_claim_rma/wizard/picking_from_returned_lines.py b/crm_claim_rma/wizard/picking_from_returned_lines.py index b44f9e76..d322aa39 100644 --- a/crm_claim_rma/wizard/picking_from_returned_lines.py +++ b/crm_claim_rma/wizard/picking_from_returned_lines.py @@ -164,7 +164,7 @@ class picking_out_from_returned_lines(osv.osv_memory): for picking in self.browse(cr, uid,ids): claim_id = self.pool.get('crm.claim').browse(cr, uid, context['active_id']) partner_id = claim_id.partner_id.id - # location type + # location type location = -1 if claim_id.claim_type == "customer": location = claim_id.partner_id.property_stock_customer.id diff --git a/crm_claim_rma/wizard/refund_from_returned_lines.py b/crm_claim_rma/wizard/refund_from_returned_lines.py index 37347395..179b3fd1 100644 --- a/crm_claim_rma/wizard/refund_from_returned_lines.py +++ b/crm_claim_rma/wizard/refund_from_returned_lines.py @@ -71,6 +71,10 @@ class refund_from_returned_lines(osv.osv_memory): for refund in self.browse(cr, uid,ids): claim_id = self.pool.get('crm.claim').browse(cr, uid, context['active_id']) partner_id = claim_id.partner_id.id + # invoice type + invoice_type = 'out_refund' + if claim_id.claim_type == "supplier": + invoice_type = 'in_refund' # create invoice invoice_id = self.pool.get('account.invoice').create(cr, uid, { 'claim_origine' : "none", @@ -112,7 +116,7 @@ class refund_from_returned_lines(osv.osv_memory): 'name': 'Customer Refounds', 'view_type': 'form', 'view_mode': 'tree,form', - 'domain' : "[('type', '=', 'out_refund'),('partner_id','=',%s)]"%partner_id, + 'domain' : "[('type', '=', %s),('partner_id','=',%s)]"%(invoice_type,partner_id), 'res_model': 'account.invoice', 'type': 'ir.actions.act_window', }