diff options
Diffstat (limited to 'indoteknik_custom/models/purchase_pricelist.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_pricelist.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py index 68fb796e..b5f719cb 100755 --- a/indoteknik_custom/models/purchase_pricelist.py +++ b/indoteknik_custom/models/purchase_pricelist.py @@ -23,6 +23,14 @@ class PurchasePricelist(models.Model): brand_id = fields.Many2one('x_manufactures', string='Brand') count_brand_vendor = fields.Integer(string='Count Brand Vendor') is_winner = fields.Boolean(string='Winner', default=False, help='Pemenang yang direkomendasikan oleh Merchandise') + + @api.constrains('include_price') + def sync_pricelist_tier(self): + for rec in self: + promotion_product = self.env['promotion.product'].search([('product_id', '=', rec.product_id.id)]) + + for promotion in promotion_product: + promotion.program_line_id.get_price_tier(promotion.product_id, promotion.qty) @api.depends('product_id', 'vendor_id') def _compute_name(self): |
