From a21fc77edfba8d2d645f4ddf224fb097aea61d0a Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 15 Sep 2023 10:16:13 +0700 Subject: limit function update_internal_reference --- indoteknik_custom/models/product_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 8daa0b7a..f67ab474 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -137,13 +137,13 @@ class ProductTemplate(models.Model): product.seq_new_product = seq _logger.info('Updated New Product %s' % product.name) - def update_internal_reference(self): + def update_internal_reference(self, limit=100): templates_without_variant = self.env['product.template'].search([ ('default_code', '=', False), ('type', '=', 'product'), ('active', '=', True), ('product_variant_ids', '=', False), - ]) + ], limit=limit) for template_without_variant in templates_without_variant: template_without_variant.default_code = 'IT.'+str(template_without_variant.id) _logger.info('Updated Template %s' % template_without_variant.name) -- cgit v1.2.3