From 042f05f2e5fd95a9a7b6b4e1992575e7fed92dfa Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 1 Sep 2015 15:23:22 +0200 Subject: [PATCH] [IMP] stock: barcode of a product or location should not be copied when duplicating (copy=False) --- addons/product/product.py | 2 +- addons/stock/stock.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 649c69f9eef..24f06276dd3 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -956,7 +956,7 @@ class product_product(osv.osv): 'default_code' : fields.char('Internal Reference', select=True), 'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the product without removing it."), 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade", select=True, auto_join=True), - 'barcode': fields.char('Barcode', help="International Article Number used for product identification.", oldname='ean13'), + 'barcode': fields.char('Barcode', help="International Article Number used for product identification.", oldname='ean13', copy=False), 'name_template': fields.related('product_tmpl_id', 'name', string="Template Name", type='char', store={ 'product.template': (_get_name_template_ids, ['name'], 10), 'product.product': (lambda self, cr, uid, ids, c=None: ids, [], 10), diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4c241a3f8de..abf04707b0b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -128,7 +128,7 @@ class stock_location(osv.osv): 'return_location': fields.boolean('Is a Return Location?', help='Check this box to allow using this location as a return location.'), 'removal_strategy_id': fields.many2one('product.removal', 'Removal Strategy', help="Defines the default method used for suggesting the exact location (shelf) where to take the products from, which lot etc. for this location. This method can be enforced at the product category level, and a fallback is made on the parent locations if none is set here."), 'putaway_strategy_id': fields.many2one('product.putaway', 'Put Away Strategy', help="Defines the default method used for suggesting the exact location (shelf) where to store the products. This method can be enforced at the product category level, and a fallback is made on the parent locations if none is set here."), - 'barcode': fields.char('Barcode', oldname='loc_barcode'), + 'barcode': fields.char('Barcode', copy=False, oldname='loc_barcode'), } _defaults = { 'active': True,