From dd8f35133c24f84896a90dda343978d893ce5c4c Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Fri, 7 Oct 2022 16:41:52 +0700 Subject: add web_tax_id and qty_stock_vendor --- indoteknik_custom/models/product_template.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 348bda99..c1761f08 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -16,10 +16,18 @@ class ProductTemplate(models.Model): ) x_lazada = fields.Text(string="Lazada") x_tokopedia = fields.Text(string="Tokopedia") + web_tax_id = fields.Many2one('account.tax', string='Website Tax') web_price = fields.Float( 'Web Price', compute='_compute_web_price', digits='Product Price', inverse='_set_product_lst_price', help="Web Price with pricelist_id = 1") + qty_stock_vendor = fields.Float('QTY Stock Vendor', compute='_compute_qty_stock_vendor') + + def _compute_qty_stock_vendor(self): + for product_template in self: + product_template.qty_stock_vendor = 0 + for product_variant in product_template.product_variant_ids: + product_template.qty_stock_vendor += product_variant.qty_stock_vendor def _compute_web_price(self): for template in self: -- cgit v1.2.3