From bf84a6df71756afdd4b8846b8bba8fea4d243dee Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 25 Jan 2024 16:04:03 +0700 Subject: add field date_upload_efaktur on invoices --- indoteknik_custom/models/account_move.py | 7 +++++++ indoteknik_custom/views/account_move.xml | 1 + 2 files changed, 8 insertions(+) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 948f6e62..592a3ae7 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -38,6 +38,13 @@ class AccountMove(models.Model): sale_id = fields.Many2one('sale.order', string='Sale Order') reklas_id = fields.Many2one('account.move', string='Nomor CAB', domain="[('partner_id', '=', partner_id)]") new_invoice_day_to_due = fields.Integer(string="New Day Due", compute="_compute_invoice_day_to_due") + date_efaktur_upload = fields.Datetime(string='eFaktur Upload Date') + + @api.constrains('efaktur_document') + def _constrains_date_efaktur(self): + for move in self: + current_time = datetime.utcnow() + move.date_efaktur_upload = current_time def open_form_multi_create_reklas_penjualan(self): action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_view_invoice_reklas_penjualan') diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 677a1d99..a7d339ce 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -25,6 +25,7 @@ + pdf_viewer -- cgit v1.2.3