diff --git a/modules/product/CHANGELOG b/modules/product/CHANGELOG index 4d8eb49430..9439eaada3 100644 --- a/modules/product/CHANGELOG +++ b/modules/product/CHANGELOG @@ -1,3 +1,4 @@ +* Support generate barcode of different type * Add code on product category * Add product deactivable mixins diff --git a/modules/product/product.py b/modules/product/product.py index e0a36915a0..84e8fcc66c 100644 --- a/modules/product/product.py +++ b/modules/product/product.py @@ -860,7 +860,9 @@ class ProductIdentifier(sequence_ordered(), ModelSQL, ModelView): code=self.code, product=product)) - def barcode(self, format='svg', **options): - if barcode and self.type in barcode.BARCODES: + def barcode(self, format='svg', type=None, **options): + if type is None: + type = self.type + if barcode and type in barcode.BARCODES: generator = getattr(barcode, 'generate_%s' % format) - return generator(self.type, self.on_change_with_code(), **options) + return generator(type, self.on_change_with_code(), **options)