mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[Update] refund & picking to apply for both supplier/customer claim type
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user