From 490eb81e704691df3e6d5c354837a08e4f982538 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 7 Mar 2024 14:05:08 +0700 Subject: Add selected pricelist to calculate on purchase pricelist --- indoteknik_custom/models/price_group.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indoteknik_custom/models/price_group.py') diff --git a/indoteknik_custom/models/price_group.py b/indoteknik_custom/models/price_group.py index 2a1bbc91..1b1c817f 100644 --- a/indoteknik_custom/models/price_group.py +++ b/indoteknik_custom/models/price_group.py @@ -19,6 +19,22 @@ class PriceGroup(models.Model): group7 = fields.Float(string='Kelompok 7 (%)') group8 = fields.Float(string='Kelompok 8 (%)') + def collect_price_group(self): + PRICE_GROUP_ID = { + 'markup': 1, + 'tier_1': 2, + 'tier_2': 3, + 'tier_3': 4, + 'tier_4': 5, + 'tier_5': 6, + } + + result = {} + for key in PRICE_GROUP_ID: + result[key] = self.env['price.group'].browse(PRICE_GROUP_ID[key]) + + return result + class Manufacture(models.Model): _inherit = 'x_manufactures' -- cgit v1.2.3