summaryrefslogtreecommitdiff
path: root/addons/l10n_cl
diff options
context:
space:
mode:
authorwilliam <wan@odoo.com>2020-03-30 11:46:27 +0000
committerwilliam <wan@odoo.com>2020-08-05 11:57:10 +0000
commit82dc0cb7b91ae59beae7e1c865b670afc5958b31 (patch)
tree949b949b249cdac265310798d5abb82675a1741b /addons/l10n_cl
parent276ba8e90c87f8294286f915508766761a58d1e2 (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_cl')
-rw-r--r--addons/l10n_cl/models/account_move.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/l10n_cl/models/account_move.py b/addons/l10n_cl/models/account_move.py
index 152d48e272e..605a2cf0a34 100644
--- a/addons/l10n_cl/models/account_move.py
+++ b/addons/l10n_cl/models/account_move.py
@@ -89,9 +89,9 @@ class AccountMove(models.Model):
def _onchange_journal(self):
self.l10n_latam_document_type_id = False
- def post(self):
+ def _post(self, soft=True):
self._check_document_types_post()
- super().post()
+ super()._post(soft)
def _l10n_cl_get_formatted_sequence(self, number=0):
return "%s %06d" % (self.l10n_latam_document_type_id.doc_code_prefix, number)
@@ -113,4 +113,4 @@ class AccountMove(models.Model):
param['journal_ids'] = journals
where_string += " AND l10n_latam_document_type_id = %(l10n_latam_document_type_id)s "
param['l10n_latam_document_type_id'] = self.l10n_latam_document_type_id.id or 0
- return where_string, param \ No newline at end of file
+ return where_string, param