diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-04-03 14:39:01 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-04-03 14:39:01 +0700 |
| commit | de2b61c0baa0d1d2bdf59adf5538a8e765620f05 (patch) | |
| tree | 25c2164512e00c22bf22dfdb1bca33309e3f50af | |
| parent | 357c51e9d3f73831d7b565ac8e1beb83430931ef (diff) | |
Add pricing group validation on purchase pricelist
| -rwxr-xr-x | indoteknik_custom/models/purchase_pricelist.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py index d61fe70e..b189b464 100755 --- a/indoteknik_custom/models/purchase_pricelist.py +++ b/indoteknik_custom/models/purchase_pricelist.py @@ -89,6 +89,10 @@ class PurchasePricelist(models.Model): product_group = rec.product_id.product_tmpl_id.x_manufacture.pricing_group or None price_incl = rec.include_price + if not product_group: + self.env.cr.commit() + raise ValidationError(_('Produk %s tidak memiliki "Pricing Group"' % rec.product_id.display_name)) + markup_percentage = price_group['markup'][product_group] if markup_percentage == 0: continue |
