[FIX] account: Dashboard invoices refunds link
When clicking on the "Refunds" link of a Sale / Purchase invoices journal, creating a new invoice did not create a new refund invoice, but a normal invoice. opw-675408
This commit is contained in:
@@ -281,13 +281,15 @@ class account_journal(models.Model):
|
||||
action_name = 'action_move_journal_line'
|
||||
|
||||
_journal_invoice_type_map = {
|
||||
'sale': 'out_invoice',
|
||||
'purchase': 'in_invoice',
|
||||
'bank': 'bank',
|
||||
'cash': 'cash',
|
||||
'general': 'general',
|
||||
('sale', None): 'out_invoice',
|
||||
('purchase', None): 'in_invoice',
|
||||
('sale', 'refund'): 'out_refund',
|
||||
('purchase', 'refund'): 'in_refund',
|
||||
('bank', None): 'bank',
|
||||
('cash', None): 'cash',
|
||||
('general', None): 'general',
|
||||
}
|
||||
invoice_type = _journal_invoice_type_map[self.type]
|
||||
invoice_type = _journal_invoice_type_map[(self.type, self._context.get('invoice_type'))]
|
||||
|
||||
ctx = self._context.copy()
|
||||
ctx.update({
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<a type="object" name="open_action" context="{'use_domain': [('type','in',('out_refund','in_refund'))]}">
|
||||
<a type="object" name="open_action" context="{'use_domain': [('type','in',('out_refund','in_refund'))], 'invoice_type': 'refund'}">
|
||||
<span t-if="journal_type == 'sale'">Refunds</span>
|
||||
<span t-if="journal_type == 'purchase'">Refunds</span>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user