From 3592c254ca5baf4a0a769f500f9e28a9cbc272a7 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Thu, 27 Apr 2023 14:33:12 +0700 Subject: set maturity date if change date in account move --- indoteknik_custom/models/account_move.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index db4886f4..56f3e82c 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -36,6 +36,10 @@ class AccountMove(models.Model): res = super(AccountMove, self).action_post() # if not self.env.user.is_accounting: # raise UserError('Hanya Accounting yang bisa Posting') + if self._name == 'account.move': + for entry in self: + for line in entry.line_ids: + line.date_maturity = entry.date return res def _compute_invoice_day_to_due(self): -- cgit v1.2.3