summaryrefslogtreecommitdiff
path: root/addons/l10n_ar
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_ar
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_ar')
-rw-r--r--addons/l10n_ar/models/account_move.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/l10n_ar/models/account_move.py b/addons/l10n_ar/models/account_move.py
index b444383fbde..19894f44911 100644
--- a/addons/l10n_ar/models/account_move.py
+++ b/addons/l10n_ar/models/account_move.py
@@ -145,7 +145,7 @@ class AccountMove(models.Model):
action = self.env.ref('account.action_account_journal_form')
raise RedirectWarning(msg, action.id, _('Go to Journals'))
- def post(self):
+ def _post(self, soft=True):
ar_invoices = self.filtered(lambda x: x.company_id.country_id == self.env.ref('base.ar') and x.l10n_latam_use_documents)
for rec in ar_invoices:
rec.l10n_ar_afip_responsibility_type_id = rec.commercial_partner_id.l10n_ar_afip_responsibility_type_id.id
@@ -159,9 +159,9 @@ class AccountMove(models.Model):
# We make validations here and not with a constraint because we want validation before sending electronic
# data on l10n_ar_edi
ar_invoices._check_argentinian_invoice_taxes()
- res = super().post()
- self._set_afip_service_dates()
- return res
+ posted = super()._post(soft)
+ posted._set_afip_service_dates()
+ return posted
def _reverse_moves(self, default_values_list=None, cancel=False):
if not default_values_list: