mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] 10.0 bank_payment_order move invoice_ref calculation to python
This commit is contained in:
@@ -21,6 +21,7 @@ class AccountPaymentOrderReport(models.AbstractModel):
|
||||
'data': data,
|
||||
'env': self.env,
|
||||
'get_bank_account_name': self.get_bank_account_name,
|
||||
'get_invoice_ref': self.get_invoice_ref,
|
||||
'formatLang': formatLang,
|
||||
}
|
||||
return self.env['report'].render(
|
||||
@@ -46,3 +47,9 @@ class AccountPaymentOrderReport(models.AbstractModel):
|
||||
return name
|
||||
else:
|
||||
return False
|
||||
|
||||
@api.model
|
||||
def get_invoice_ref(self, line):
|
||||
value = (line.move_line_id.invoice_id.number or
|
||||
line.move_line_id.move_id.name)
|
||||
return value or ''
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<span t-esc="get_bank_account_name(line.partner_bank_id)"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-raw="'%s <br>' % line.move_line_id.invoice_id.number or line.move_line_id.move_id.name or ''"/>
|
||||
<span t-esc="get_invoice_ref(line)"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-field="line.date"/>
|
||||
|
||||
Reference in New Issue
Block a user