summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/res_partner.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-01-15 14:25:36 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-01-15 14:25:36 +0700
commit4aa7c5af3bd15ca382fe72fbfea416c169d58ebf (patch)
tree759a64f08f54576bad1ca8b120c9dbf28cccf151 /indoteknik_custom/models/res_partner.py
parent4ad4ee17e29d9583b1d2da76af93a1c28fbc8874 (diff)
<iman> add nitku
Diffstat (limited to 'indoteknik_custom/models/res_partner.py')
-rw-r--r--indoteknik_custom/models/res_partner.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py
index 57fab403..f081e274 100644
--- a/indoteknik_custom/models/res_partner.py
+++ b/indoteknik_custom/models/res_partner.py
@@ -102,6 +102,7 @@ class ResPartner(models.Model):
])
sppkp = fields.Char(string="SPPKP", tracking=True)
npwp = fields.Char(string="NPWP", tracking=True)
+ nitku = fields.Char(string="NITKU", tracking=True)
counter = fields.Integer(string="Counter", default=0)
leadtime = fields.Integer(string="Leadtime", default=0)
digital_invoice_tax = fields.Boolean(string="Digital Invoice & Faktur Pajak")
@@ -449,3 +450,10 @@ class ResPartner(models.Model):
return partner.property_payment_term_id.name if partner.property_payment_term_id.id else 'Cash Before Delivery (C.B.D)'
+ @api.constrains('nitku')
+ def _onchange_nitku(self):
+ if self.nitku:
+ if not self.nitku.isdigit():
+ raise UserError("NITKU harus berupa angka.")
+ if len(self.nitku) != 22:
+ raise UserError("NITKU harus memiliki tepat 22 angka.") \ No newline at end of file