diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-23 14:19:38 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-23 14:19:38 +0700 |
| commit | 3ed54712ca9856f3be937f8325db030d0796532e (patch) | |
| tree | a0e96a3a10f59bde060113b941b681addca43f73 /indoteknik_custom/models/promotion_program_line.py | |
| parent | 23014336a1fe1fe5ef54fad30cf6c3d9cc59b2d8 (diff) | |
Refactor pricelist on product price
Diffstat (limited to 'indoteknik_custom/models/promotion_program_line.py')
| -rw-r--r-- | indoteknik_custom/models/promotion_program_line.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/indoteknik_custom/models/promotion_program_line.py b/indoteknik_custom/models/promotion_program_line.py index c888f01a..55331aea 100644 --- a/indoteknik_custom/models/promotion_program_line.py +++ b/indoteknik_custom/models/promotion_program_line.py @@ -126,9 +126,9 @@ class PromotionProgramLine(models.Model): 'label': dict(self._fields['promotion_type'].selection).get(self.promotion_type) } - def format(self, user = None, pricelist = False): + def format(self, user = None): ir_attachment = self.env['ir.attachment'] - product_price = self.product_id.calculate_website_price(pricelist=pricelist) + product_price = self.product_id.calculate_website_price() return { 'id': self.id, 'name': self.name, @@ -142,7 +142,11 @@ class PromotionProgramLine(models.Model): 'price': self.calculate_price(price=product_price) } - def res_format(self, user, pricelist): - data = [x.format(user, pricelist=pricelist) for x in self] + def res_format(self, user): + data = [x.format(user) for x in self] + return data + + def res_format_cart(self, user): + data = self.format(user) return data |
