diff options
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 6454bc21..ccbc9ff6 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -43,24 +43,24 @@ class ProductTemplate(models.Model): for template in self: product = self.env['product.product'].search([('product_tmpl_id', '=', template.id)], limit=1) - product_pricelist_default = self.env['ir.config_parameter'].sudo().get_param('product.pricelist.default') - product_pricelist_disc = self.env['product.pricelist.item'].search([ - ('pricelist_id', '=', product_pricelist_default), - ('product_id', '=', product.id)], limit=1) - disc = product_pricelist_disc.price_discount + # product_pricelist_default = self.env['ir.config_parameter'].sudo().get_param('product.pricelist.default') + # product_pricelist_disc = self.env['product.pricelist.item'].search([ + # ('pricelist_id', '=', product_pricelist_default.int()), + # ('product_id', '=', product.id)], limit=1) + # disc = product_pricelist_disc.price_discount product_pricelist_item = self.env['product.pricelist.item'].search([ - ('pricelist_id', '=', product_pricelist_disc.base_pricelist_id.id), + ('pricelist_id', '=', 1), ('product_id', '=', product.id)], limit=1) price = product_pricelist_item.fixed_price - - if not disc and not price: - template.web_price = 0 - elif not disc: - template.web_price = price - else: - price_disc = price - (price * disc / 100) - template.web_price = price_disc + # + # if not disc and not price: + # template.web_price = 0 + # elif not disc: + template.web_price = price + # else: + # price_disc = price - (price * disc / 100) + # template.web_price = price_disc def _have_promotion_program(self): for template in self: |
