diff options
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 9 |
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 |
