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/l10n_de | |
| 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/l10n_de')
| -rw-r--r-- | addons/l10n_de/models/datev.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/l10n_de/models/datev.py b/addons/l10n_de/models/datev.py index be1382f3f74..edcfd693057 100644 --- a/addons/l10n_de/models/datev.py +++ b/addons/l10n_de/models/datev.py @@ -21,7 +21,7 @@ class AccountTax(models.Model): class AccountMove(models.Model): _inherit = 'account.move' - def post(self): + def _post(self, soft=True): # OVERRIDE to check the invoice lines taxes. for invoice in self.filtered(lambda move: move.is_invoice()): for line in invoice.invoice_line_ids: @@ -32,4 +32,4 @@ class AccountMove(models.Model): if tax.id not in account_tax: raise UserError(_('Account %s does not authorize to have tax %s specified on the line. \ Change the tax used in this invoice or remove all taxes from the account') % (account_name, tax.name)) - return super(AccountMove, self).post() + return super()._post(soft) |
