diff options
| author | william <wan@odoo.com> | 2020-03-30 11:46:27 +0000 |
|---|---|---|
| committer | william <wan@odoo.com> | 2020-08-05 11:57:10 +0000 |
| commit | 82dc0cb7b91ae59beae7e1c865b670afc5958b31 (patch) | |
| tree | 949b949b249cdac265310798d5abb82675a1741b /addons/payment/models/payment_acquirer.py | |
| parent | 276ba8e90c87f8294286f915508766761a58d1e2 (diff) | |
[IMP] account: soft post entries in the future
Add an easy way to not post the entries in the future when calling
post() on it, but rather set it to be auto-posted at accounting date.
This is useful when we are creating a lot of entries in batch and some
might be in the future, some in the past, and we don't want to separate
that in two batch every time. (asset, accrual, transfer,... )
Diffstat (limited to 'addons/payment/models/payment_acquirer.py')
| -rw-r--r-- | addons/payment/models/payment_acquirer.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index c4b20bac604..c470186e4a8 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -674,7 +674,7 @@ class PaymentTransaction(models.Model): self.payment_id = payment if self.invoice_ids: - self.invoice_ids.filtered(lambda move: move.state == 'draft').post() + self.invoice_ids.filtered(lambda move: move.state == 'draft')._post() (payment.line_ids + self.invoice_ids.line_ids)\ .filtered(lambda line: line.account_id == payment.destination_account_id and not line.reconciled)\ @@ -814,7 +814,7 @@ class PaymentTransaction(models.Model): def _reconcile_after_transaction_done(self): # Validate invoices automatically upon the transaction is posted. invoices = self.mapped('invoice_ids').filtered(lambda inv: inv.state == 'draft') - invoices.post() + invoices._post() # Create & Post the payments. for trans in self: |
