From 65fe5e9cb0865293eb6d0626d2c99f35d6862b3c Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 30 May 2024 16:09:35 +0700 Subject: add invoice_date_due and terima faktur on bills --- indoteknik_custom/models/account_move.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom/models/account_move.py') diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index b306b6af..aa8b97be 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -246,7 +246,7 @@ class AccountMove(models.Model): due_date = tukar_date + timedelta(days=add_days) invoice.invoice_date_due = due_date - @api.onchange('date_terima_tukar_faktur') + @api.constrains('date_terima_tukar_faktur') def change_date_terima_tukar_faktur(self): for invoice in self: if not invoice.date_terima_tukar_faktur: @@ -266,6 +266,13 @@ class AccountMove(models.Model): } return action + def open_form_multi_update_bills(self): + action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_account_move_multi_update_bills') + action['context'] = { + 'move_ids': [x.id for x in self] + } + return action + @api.constrains('efaktur_id', 'ref', 'date', 'journal_id', 'name') def constrains_edit(self): for rec in self.line_ids: -- cgit v1.2.3