mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Merge pull request #538 from acsone/12.0-ref_account_payment_order_draft2open_tbi
[12.0] [REF] Payment Order: better performance of draft2open method
This commit is contained in:
@@ -279,7 +279,12 @@ class AccountPaymentOrder(models.Model):
|
||||
payline.ml_maturity_date,
|
||||
requested_date))
|
||||
# Write requested_date on 'date' field of payment line
|
||||
payline.date = requested_date
|
||||
# norecompute is for avoiding a chained recomputation
|
||||
# payment_line_ids.date
|
||||
# > payment_line_ids.amount_company_currency
|
||||
# > total_company_currency
|
||||
with self.env.norecompute():
|
||||
payline.date = requested_date
|
||||
# Group options
|
||||
if order.payment_mode_id.group_lines:
|
||||
hashcode = payline.payment_line_hashcode()
|
||||
@@ -295,6 +300,7 @@ class AccountPaymentOrder(models.Model):
|
||||
'paylines': payline,
|
||||
'total': payline.amount_currency,
|
||||
}
|
||||
order.recompute()
|
||||
# Create bank payment lines
|
||||
for paydict in list(group_paylines.values()):
|
||||
# Block if a bank payment line is <= 0
|
||||
|
||||
Reference in New Issue
Block a user