summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-10-07 16:41:52 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-10-07 16:41:52 +0700
commitdd8f35133c24f84896a90dda343978d893ce5c4c (patch)
tree4d1a65b24fa9abaa922955507759797d6cdb46f4
parented2ae23c3bff0c97f8b159ad1dad0a2c93cc2ef3 (diff)
add web_tax_id and qty_stock_vendor
-rwxr-xr-xindoteknik_custom/models/product_template.py8
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: