summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-08-03 06:15:54 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-08-03 06:15:54 +0000
commit0be8a77f6cbb31d3ac8cf9e3e606d2266a20c2ec (patch)
tree6f62bce6e049935b5a85e445ee7d959242fe7e7c /indoteknik_custom/models/sale_order.py
parentf0f30aa566c0e49b03fd86f86bbcd80d6c7383ce (diff)
parent4a670f1f85848ef46c605fd67ff4e3d305571522 (diff)
Merged in production (pull request #80)
Production
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
-rwxr-xr-xindoteknik_custom/models/sale_order.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 12043996..25d28bbb 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -89,6 +89,7 @@ class SaleOrder(models.Model):
purchase_total = fields.Monetary(string='Purchase Total', compute='_compute_purchase_total')
voucher_id = fields.Many2one(comodel_name='voucher', string='Voucher')
amount_voucher_disc = fields.Float(string='Voucher Discount')
+ source_id = fields.Many2one('utm.source', 'Source', domain="[('id', 'in', [32, 59, 60, 61])]")
def _compute_purchase_total(self):
for order in self:
@@ -336,7 +337,9 @@ class SaleOrder(models.Model):
raise UserError("Status harus draft atau sent")
if not order.partner_invoice_id.npwp:
raise UserError("NPWP harus diisi di master data konsumen, jika non pkp dapat diisi 00.000.000.0-000.000")
-
+ if '-' not in order.npwp or '.' not in order.npwp:
+ raise UserError("Isi NPWP Dengan Benar!")
+
if order.partner_id.parent_id:
if not order.partner_id.parent_id.property_payment_term_id:
raise UserError("Payment Term pada Master Data Customer harus diisi")
@@ -487,7 +490,9 @@ class SaleOrder(models.Model):
raise UserError("Tax di Header harus diisi")
if not order.carrier_id:
raise UserError("Shipping Method harus diisi")
- # approval1 = approval2 = 0
+ if '-' not in order.npwp or '.' not in order.npwp:
+ raise UserError("Isi NPWP Dengan Benar!")
+
for line in order.order_line:
if not line.product_id or line.product_id.type == 'service':
continue