diff --git a/addons/stock/stock.py b/addons/stock/stock.py index cffc78beb11..eedf56f731e 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1631,11 +1631,11 @@ class stock_move(osv.osv): return True #TODO: change demo data for this to be possible 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 and the company of the stock move should be the same') % record.location_id.name) -# 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 and the company of the stock move should be the same') % record.location_dest_id.name) + 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 and the company of the stock move should be the same') % record.location_id.name) + 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 and the company of the stock move should be the same') % record.location_dest_id.name) return True _constraints = [ diff --git a/addons/stock_fifo_lifo/test/fifolifo_price.yml b/addons/stock_fifo_lifo/test/fifolifo_price.yml index 28071348b79..728b40aff00 100644 --- a/addons/stock_fifo_lifo/test/fifolifo_price.yml +++ b/addons/stock_fifo_lifo/test/fifolifo_price.yml @@ -207,6 +207,8 @@ !python {model: stock.partial.picking}: | pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fifo_usd")).picking_ids print pick_ids + print uid, context + print self.pool.get('res.users').browse(cr, uid, uid).company_id.id partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [pick_ids[0].id]}) print partial_id self.do_partial(cr, uid, [partial_id]) diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml index a87ed2cb30c..15f4248daa3 100644 --- a/addons/stock_location/test/stock_location_pull_flow.yml +++ b/addons/stock_location/test/stock_location_pull_flow.yml @@ -166,7 +166,7 @@ I create a procurement order. - !record {model: procurement.order, id: procurement_order_test0}: - company_id: base.main_company + company_id: stock.res_company_1 date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S') location_id: stock.stock_location_shop0 name: Testing pulled flow @@ -187,7 +187,6 @@ !python {model: procurement.order.compute.all}: | proc_obj = self.pool.get('procurement.order') proc_obj._procure_confirm(cr,uid) - - I check the new procurement order has been created . - @@ -201,4 +200,4 @@ !python {model: stock.picking }: | from openerp.tools.translate import _ picking_id = self.search(cr, uid, [('origin','=','Testing pulled flow:E001'),('type','=','out')]) - assert len(picking_id), "Picking hasn't Created." + assert len(picking_id), "Picking hasn't Created." \ No newline at end of file