diff --git a/addons/procurement/wizard/make_procurement_product.py b/addons/procurement/wizard/make_procurement_product.py index bf83bc73f1a..391e8d0853d 100644 --- a/addons/procurement/wizard/make_procurement_product.py +++ b/addons/procurement/wizard/make_procurement_product.py @@ -67,6 +67,7 @@ class make_procurement(osv.osv_memory): for proc in self.browse(cr, uid, ids, context=context): wh = wh_obj.browse(cr, uid, proc.warehouse_id.id, context=context) + print "Company,", wh.company_id procure_id = procurement_obj.create(cr, uid, { 'name':'INT: '+str(user), 'date_planned': proc.date_planned, @@ -75,6 +76,7 @@ class make_procurement(osv.osv_memory): 'product_uom': proc.uom_id.id, 'location_id': wh.lot_stock_id.id, 'procure_method':'make_to_order', + 'company_id': wh.company_id.id, }) procurement_obj.signal_button_confirm(cr, uid, [procure_id]) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7b1c6e0dd84..6b8dbc982fa 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1632,9 +1632,9 @@ class stock_move(osv.osv): def _check_company_location(self, cr, uid, ids, context=None): for record in self.browse(cr, uid, ids, context=context): if record.location_id.company_id and (record.company_id.id != record.location_id.company_id.id): - raise osv.except_osv(_('Error'), _('The company of the source location %s of %s and the company of the stock move %s should be the same') % (record.location_id.name, record.location_id.company_id.name, record.company_id)) + raise osv.except_osv(_('Error'), _('The company of the source location %s of %s and the company of the stock move %s %s should be the same') % (record.location_id.name, record.location_id.company_id.name, record.name, record.company_id)) if record.location_dest_id.company_id and (record.company_id.id != record.location_dest_id.company_id.id): - raise osv.except_osv(_('Error'), _('The company of the destination location %s of %s and the company of the stock move %s should be the same') % (record.location_dest_id.name, record.location_dest_id.company_id.name, record.company_id.name)) + raise osv.except_osv(_('Error'), _('The company of the destination location %s of %s and the company of the stock move %s %s should be the same') % (record.location_dest_id.name, record.location_dest_id.company_id.name, record.name, record.company_id.name)) return True _constraints = [ diff --git a/addons/stock_location/procurement_pull.py b/addons/stock_location/procurement_pull.py index 5b030b5befe..c564422962f 100644 --- a/addons/stock_location/procurement_pull.py +++ b/addons/stock_location/procurement_pull.py @@ -65,6 +65,8 @@ class procurement_order(osv.osv): 'note': _('Picking for pulled procurement coming from original location %s, pull rule %s, via original Procurement %s (#%d)') % (proc.location_id.name, line.name, proc.name, proc.id), 'invoice_state': line.invoice_state, }) + + print "COmpany_id line:", line.company_id move_id = move_obj.create(cr, uid, { 'name': line.name, 'picking_id': picking_id, diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml index 15f4248daa3..6c4adcaef36 100644 --- a/addons/stock_location/test/stock_location_pull_flow.yml +++ b/addons/stock_location/test/stock_location_pull_flow.yml @@ -145,6 +145,7 @@ picking_type: out procure_method: make_to_stock type_proc: move + company_id: stock.res_company_1 - invoice_state: none location_id: stock.stock_location_shop1 location_src_id: stock.stock_location_suppliers @@ -153,11 +154,13 @@ picking_type: out procure_method: make_to_stock type_proc: move + company_id: stock.res_company_1 - invoice_state: none location_id: stock.stock_location_suppliers location_src_id: stock.stock_location_stock name: E003 type_proc: buy + company_id: base.main_company property_stock_inventory: stock.location_inventory property_stock_procurement: stock.location_procurement property_stock_production: stock.location_production