[IMP] stock: default product_qty in stock.inventory.line is 1, so that when scanning products it will add a new line each time with quantity set to 1

bzr revid: qdp-launchpad@openerp.com-20130916061702-c22fg6cdhu1smxib
This commit is contained in:
Quentin (OpenERP) 2013-09-16 08:17:02 +02:00
parent 3150373c2d
commit adf2410619
1 changed files with 5 additions and 1 deletions

View File

@ -2010,6 +2010,10 @@ class stock_inventory_line(osv.osv):
'partner_id': fields.many2one('res.partner', 'Owner'),
}
_defaults = {
'product_qty': 1,
}
def _resolve_inventory_line(self, cr, uid, inventory_line, theorical_lines, context=None):
#TODO : package_id management !
found = False
@ -2056,7 +2060,7 @@ class stock_inventory_line(osv.osv):
if uom and uom != obj_product.uom_id.id:
uom_record = uom_obj.browse(cr, uid, uom, context=context)
th_qty = uom_obj._compute_qty_obj(cr, uid, obj_product.uom_id, th_qty, uom_record)
return {'value': {'product_qty': th_qty, 'th_qty': th_qty, 'product_uom_id': uom or obj_product.uom_id.id}}
return {'value': {'th_qty': th_qty, 'product_uom_id': uom or obj_product.uom_id.id}}
#----------------------------------------------------------