[IMP] print uid
bzr revid: jco@openerp.com-20130510141550-q11e9ieyfoxi36r8
This commit is contained in:
parent
f36aabdad3
commit
cbf4cc35c4
|
@ -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 = [
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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."
|
Loading…
Reference in New Issue