仓库模块,点击出货的那一步是怎么触发销售订单已送货的字段为True?
-
各位大神们:
在仓库模块,点击出货的那一步是怎么触发销售订单已送货的字段为True?谢谢!!
追加代码:
def test_state(self, cr, uid, ids, mode, *args):
assert mode in ('finished', 'canceled'), _("invalid mode for test_state")
finished = True
canceled = False
write_done_ids = []
write_cancel_ids = []
for order in self.browse(cr, uid, ids, context={}):
for line in order.order_line:
if (not line.procurement_id) or (line.procurement_id.state=='done'):
if line.state != 'done':
write_done_ids.append(line.id)
else:
finished = False
if line.procurement_id:
if (line.procurement_id.state == 'cancel'):
canceled = True
if line.state != 'exception':
write_cancel_ids.append(line.id)
if write_done_ids:
self.pool.get('sale.order.line').write(cr, uid, write_done_ids, {'state': 'done'})
if write_cancel_ids:
self.pool.get('sale.order.line').write(cr, uid, write_cancel_ids, {'state': 'exception'})
print mode,'mode'
if mode == 'finished':
return finished
elif mode == 'canceled':
return canceled
它是通过以下的函数执行为True的,但是查不到从哪里调用了sale.wkf_sale的工作流???请指教!!!