1
我試圖打電話action_done()
兩次執行兩個股票招式:使用action_done函數執行庫存移動?
- 從移動源old_product_id從distination distination
- 招新的product_id到源
如何通過res{}
字典功能action_done(self,cr,uid,ids,context=None)
哪些執行庫存移動,它應該返回什麼?
class my_class(osv.osv):
...
...
def action_move(self, cr , uid, res, context=None)
if context is None:
context= {}
move_obj = self.pool.get('stock.move')
res1 = {
'product_id': old_product_id,
'location_id': location_id,
'location_dest_id': location_dest_id,
'product_uom_qty': product_qty,
}
res2 = {
'product_id': new_product_id,
'location_id': location_dest_id,
'location_dest_id': location_id,
'product_uom_qty': product_qty,
}
move_obj.action_done(self,cr, uid, res, context=context)
move_obj.action_done(self,cr, uid, res2, context=context)
return ????