summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-03-19 15:52:53 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-03-19 15:52:53 +0700
commit2440436fd96cc64929b4581ab7fd86cc74381443 (patch)
tree0e6f1bcd58d3b6900ebddf38ea2881c400fe2310 /indoteknik_custom/models
parent3df78ee977b1800030248f561ee4f3c690bae329 (diff)
button upload efaktur and invoice on bills vendor
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/account_move.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 58e462a0..e26e8266 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -46,6 +46,30 @@ class AccountMove(models.Model):
help="Dipakai untuk alamat tempel")
address_invoice = fields.Char(related='real_invoice_id.street', string='Invoice Address', readonly=True)
+ bills_efaktur_exporter = fields.Many2one('res.users', string='Efaktur Exporter')
+ bills_date_efaktur = fields.Datetime(string="eFaktur Exported Date", required=False)
+ bills_efaktur_document = fields.Binary(string="eFaktur", required=False)
+ bills_invoice_exporter =fields.Many2one('res.users', string='Invoice Exporter')
+ bills_date_invoice = fields.Datetime(string="Invoice Exported Date", required=False)
+ bills_invoice_document = fields.Binary(string="Invoice", required=False)
+ is_invoice_uploaded = fields.Boolean(string="Is Invoice Uploaded", default=False)
+ is_efaktur_uploaded = fields.Boolean(string="Is eFaktur Uploaded", default=False)
+
+ @api.constrains('bills_efaktur_document')
+ def _constrains_efaktur_document(self):
+ for move in self:
+ current_time = datetime.utcnow()
+ move.bills_date_efaktur = current_time
+ move.bills_efaktur_exporter = self.env.user.id
+ move.is_efaktur_uploaded = True
+
+ @api.constrains('bills_invoice_document')
+ def _constrains_invoice_efaktur(self):
+ for move in self:
+ current_time = datetime.utcnow()
+ move.bills_date_invoice = current_time
+ move.bills_invoice_exporter = self.env.user.id
+ move.is_invoice_uploaded = True
@api.constrains('partner_id')
def _constrains_real_invoice(self):