From d0cea6ac39f1ea7deff7472743e0f3d71d9a37a3 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 15 Jan 2014 14:01:23 +0100 Subject: [PATCH] [FIX]rename group_stock_production_lot to match correct group, remove few extra spaces to match standard. Fix traceback on onchange: product_packaging_change and remove setting default package when creating SOL lp bug: https://launchpad.net/bugs/1269045 fixed bzr revid: csn@openerp.com-20140115130123-3ragkt93ukfrfhmq --- addons/product/product.py | 8 ++++---- addons/product/product_view.xml | 1 + addons/sale/sale.py | 2 +- addons/sale_stock/sale_stock.py | 5 +---- addons/stock/stock.py | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 4b63100dbee..f22fcdbdfbf 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -627,15 +627,15 @@ class product_product(osv.osv): 'incoming_qty': fields.function(_product_incoming_qty, type='float', string='Incoming'), 'outgoing_qty': fields.function(_product_outgoing_qty, type='float', string='Outgoing'), 'price': fields.function(_product_price, type='float', string='Price', digits_compute=dp.get_precision('Product Price')), - 'lst_price' : fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Product Price')), + 'lst_price': fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Product Price')), 'code': fields.function(_product_code, type='char', string='Internal Reference'), - 'partner_ref' : fields.function(_product_partner_ref, type='char', string='Customer ref'), - 'default_code' : fields.char('Internal Reference', size=64, select=True), + 'partner_ref': fields.function(_product_partner_ref, type='char', string='Customer ref'), + 'default_code': fields.char('Internal Reference', size=64, select=True), 'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the product without removing it."), 'variants': fields.char('Variants', size=64), 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade", select=True), 'ean13': fields.char('EAN13 Barcode', size=13, help="International Article Number used for product identification."), - 'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."), + 'packaging': fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."), 'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Product Price')), 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Product Price')), 'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'), diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index e9aac7419c8..99820f8b02d 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -134,6 +134,7 @@ +
diff --git a/addons/sale/sale.py b/addons/sale/sale.py index f5e95f88b32..04743c95e41 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -995,7 +995,7 @@ class sale_order_line(osv.osv): lang = lang or context.get('lang', False) if not partner_id: raise osv.except_osv(_('No Customer Defined!'), _('Before choosing a product,\n select a customer in the sales form.')) - warning = {} + warning = False product_uom_obj = self.pool.get('product.uom') partner_obj = self.pool.get('res.partner') product_obj = self.pool.get('product.product') diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 7d065c700f2..8f373488ee3 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -289,14 +289,11 @@ class sale_order_line(osv.osv): res = self.product_id_change(cr, uid, ids, pricelist=pricelist, product=product, qty=qty, uom=uom, partner_id=partner_id, packaging=packaging, flag=False, context=context) - warning_msgs = res.get('warning') and res['warning']['message'] + warning_msgs = res.get('warning') and res['warning'].get('message', False) or '' products = product_obj.browse(cr, uid, product, context=context) if not products.packaging: packaging = result['product_packaging'] = False - elif not packaging and products.packaging and not flag: - packaging = products.packaging[0].id - result['product_packaging'] = packaging if packaging: default_uom = products.uom_id and products.uom_id.id diff --git a/addons/stock/stock.py b/addons/stock/stock.py index de9917f453d..ca98ff2ffe3 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1999,7 +1999,7 @@ class stock_inventory(osv.osv): if stock_settings.group_stock_tracking_owner: res_filter.append(('owner', _('One owner only'))) res_filter.append(('product_owner', _('One product for a specific owner'))) - if stock_settings.group_stock_production_lot: + if stock_settings.group_stock_tracking_lot: res_filter.append(('lot', _('One Lot/Serial Number'))) if stock_settings.group_stock_tracking_lot: res_filter.append(('pack', _('A Pack')))