From d966917a5ba95074b6773f49fcb2c3c924296029 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 18 Jul 2023 16:38:29 +0700 Subject: Fix lost merge voucher with promotion program --- indoteknik_api/models/product_product.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indoteknik_api/models') diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index 03742d69..334b58c5 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -48,6 +48,11 @@ class ProductProduct(models.Model): } return data + def has_active_program(self): + program_line = self.env['promotion.program.line'] + product_promotions = program_line.get_active_promotions(self.id) + return True if len(product_promotions) > 0 else False + def calculate_website_price(self): pricelist = self.env.user_pricelist -- cgit v1.2.3