summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/product_template.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-05-22 02:15:56 +0000
committerIT Fixcomart <it@fixcomart.co.id>2024-05-22 02:15:56 +0000
commitad1325d80785f236a32bff2f2645fe8c85c50efb (patch)
tree85d8772e1af6ef37a0bfe3bc19064258b7bea39d /indoteknik_custom/models/product_template.py
parentf6c324302fb2a6490c9c95836887e2c58d684e86 (diff)
parent4f5594be8d73f88fbb42671525d0d2c6ed977abe (diff)
Merged in production (pull request #143)
Production
Diffstat (limited to 'indoteknik_custom/models/product_template.py')
-rwxr-xr-xindoteknik_custom/models/product_template.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 8494e18a..97ad07a7 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -350,6 +350,18 @@ class ProductProduct(models.Model):
is_edited = fields.Boolean(string='Is Edited')
qty_sold = fields.Float(string='Sold Quantity', compute='_get_qty_sold')
+ def update_internal_reference_variants(self, limit=100):
+ variants = self.env['product.product'].search([
+ ('default_code', '=', False),
+ ('type', '=', 'product'),
+ ('active', '=', True)
+ ], limit=limit, order='write_date desc')
+ for variant in variants:
+ if not variant.default_code:
+ variant.default_code = 'ITV.'+str(variant.id)
+
+ _logger.info('Updated variant %s' % variant.name)
+
def _get_po_suggest(self, qty_purchase):
if self.qty_available_bandengan < qty_purchase:
return 'harus beli'