diff --git a/addons/base_import/models.py b/addons/base_import/models.py index 996dbf7964d..1c03a641ca7 100644 --- a/addons/base_import/models.py +++ b/addons/base_import/models.py @@ -114,6 +114,9 @@ class ir_import(orm.TransientModel): elif field['type'] == 'one2many' and depth: f['fields'] = self.get_fields( cr, uid, field['relation'], context=context, depth=depth-1) + f['fields'].append(dict(fields=[], required=False, id='id', name='.id', string=_("Database ID"))) + import pudb + pudb.set_trace() fields.append(f) diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py index 7f55adbab4c..0dc6b3739f5 100644 --- a/addons/stock/wizard/stock_fill_inventory.py +++ b/addons/stock/wizard/stock_fill_inventory.py @@ -104,15 +104,16 @@ class stock_fill_inventory(osv.osv_memory): datas = {} res[location] = {} move_ids = move_obj.search(cr, uid, ['|',('location_dest_id','=',location),('location_id','=',location),('state','=','done')], context=context) - + local_context = dict(context) + local_context['raise-exception'] = False for move in move_obj.browse(cr, uid, move_ids, context=context): lot_id = move.prodlot_id.id prod_id = move.product_id.id if move.location_dest_id.id != move.location_id.id: if move.location_dest_id.id == location: - qty = uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id) + qty = uom_obj._compute_qty_obj(cr, uid, move.product_uom,move.product_qty, move.product_id.uom_id, context=local_context) else: - qty = -uom_obj._compute_qty(cr, uid, move.product_uom.id,move.product_qty, move.product_id.uom_id.id) + qty = -uom_obj._compute_qty_obj(cr, uid, move.product_uom,move.product_qty, move.product_id.uom_id, context=local_context) if datas.get((prod_id, lot_id)):