diff options
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 8 |
1 files changed, 8 insertions, 0 deletions
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: |
