diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-09-15 10:16:13 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-09-15 10:16:13 +0700 |
| commit | a21fc77edfba8d2d645f4ddf224fb097aea61d0a (patch) | |
| tree | cc234a96925c09a113b0abafbf19ea7c154eed2a | |
| parent | 0cd5b2654ca6260632d24e8981aeaef1d4015c4c (diff) | |
limit function update_internal_reference
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 4 |
1 files 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) |
