summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-01-25 16:04:03 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-01-25 16:04:03 +0700
commitbf84a6df71756afdd4b8846b8bba8fea4d243dee (patch)
treed0f012c18e1aa8282b9facdb793d95bb3d7abea4
parentab11e1060a839b5cbd13b56e98fa291cc6a74e38 (diff)
add field date_upload_efaktur on invoices
-rw-r--r--indoteknik_custom/models/account_move.py7
-rw-r--r--indoteknik_custom/views/account_move.xml1
2 files changed, 8 insertions, 0 deletions
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 @@
</field>
<field name="efaktur_document" position="before">
<field name="no_faktur_pajak" attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}"/>
+ <field name="date_efaktur_upload"/>
</field>
<field name="efaktur_document" position="attributes">
<attribute name="widget">pdf_viewer</attribute>