[MERGE] stock, sale, sale_stock: several usability problem fixed.
lp bug: https://launchpad.net/bugs/1269045 fixed bzr revid: qdp-launchpad@openerp.com-20140120160303-v5hmfmb6roeg56v6
This commit is contained in:
commit
3f8ec15bbe
|
@ -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'),
|
||||
|
|
|
@ -134,6 +134,7 @@
|
|||
<field name="mes_type"/>
|
||||
</group>
|
||||
</group>
|
||||
<separator string="Logistical Units"/>
|
||||
<field name="packaging" groups="product.group_stock_packaging">
|
||||
<form string="Packaging" version="7.0">
|
||||
<group col="4">
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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', '') 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
|
||||
|
|
Loading…
Reference in New Issue