diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-10-02 09:44:39 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-10-02 09:44:39 +0700 |
| commit | 2739d3040a69228192096ee16373610149a2fb47 (patch) | |
| tree | 545aa797d7407e8f22250dff15648495b891928f /indoteknik_custom/models/purchase_pricelist.py | |
| parent | 4d3d219b5f1002822a16067a28261fd59b170ff8 (diff) | |
| parent | 7d3780ede67579b5891218efc370dc82eef510a1 (diff) | |
Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into production
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..e5b35d7f 100755 --- a/indoteknik_custom/models/purchase_pricelist.py +++ b/indoteknik_custom/models/purchase_pricelist.py @@ -23,6 +23,13 @@ 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') + + 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): @@ -111,5 +118,6 @@ class PurchasePricelist(models.Model): tier_prod_pricelist = self.env['product.pricelist.item'].search(product_domain + [('pricelist_id', '=', tier_pricelist.id)], limit=1) tier_prod_pricelist.price_discount = tier_perc + rec.sync_pricelist_tier() rec.product_id.product_tmpl_id._create_solr_queue('_sync_price_to_solr')
\ No newline at end of file |
