mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[FIX] navigation button issue TypeError: unhashable type: 'list'
This commit is contained in:
committed by
ahenriquez
parent
e136c0e6e1
commit
8ded2c6c76
@@ -93,13 +93,14 @@ class RmaOrder(models.Model):
|
||||
result = action.read()[0]
|
||||
invoice_ids = self.mapped(
|
||||
'rma_line_ids.refund_line_ids.invoice_id').ids
|
||||
if invoice_ids:
|
||||
# choose the view_mode accordingly
|
||||
if len(invoice_ids) > 1:
|
||||
result['domain'] = [('id', 'in', invoice_ids)]
|
||||
else:
|
||||
res = self.env.ref('account.invoice_supplier_form', False)
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = invoice_ids and invoice_ids[0]
|
||||
result['res_id'] = invoice_ids[0]
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
@@ -112,10 +113,11 @@ class RmaOrder(models.Model):
|
||||
res = self.env.ref('account.invoice_form', False)
|
||||
result = action.read()[0]
|
||||
invoice_ids = self.mapped('rma_line_ids.invoice_id').ids
|
||||
if invoice_ids:
|
||||
# choose the view_mode accordingly
|
||||
if len(invoice_ids) > 1:
|
||||
result['domain'] = [('id', 'in', invoice_ids)]
|
||||
else:
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = invoice_ids and invoice_ids[0]
|
||||
result['res_id'] = invoice_ids[0]
|
||||
return result
|
||||
|
||||
@@ -210,13 +210,14 @@ class RmaOrderLine(models.Model):
|
||||
action = self.env.ref('account.action_invoice_tree2')
|
||||
result = action.read()[0]
|
||||
invoice_ids = self.mapped('refund_line_ids.invoice_id').ids
|
||||
if invoice_ids:
|
||||
# choose the view_mode accordingly
|
||||
if len(invoice_ids) > 1:
|
||||
result['domain'] = [('id', 'in', invoice_ids)]
|
||||
else:
|
||||
res = self.env.ref('account.invoice_supplier_form', False)
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
result['res_id'] = invoice_ids and invoice_ids[0]
|
||||
result['res_id'] = invoice_ids[0]
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user