o我从中选择相同的字段mo.queue
,我想将其保存到procurement.order
表格中
我的代码如下所示:
def action_ship_create(self, cr, uid, ids, id_queue, context=None):
queue_obj = self.pool.get('mo.queue'). browse (cr, uid, id_queue, context=context)
mo_name = queue_obj.name
query_param = (mo_name)
cr.execute("select origin,create_date,product_uos_qty,product_qty,name,city from mo_queue",(query_param,))
ads = cr.fetchone()
name = ads and ads [0] or None
print "======================"
print name
print "======================"
val = { 'origin': name,
}
print "======================"
print val
print "======================"
return {'value': val }
proc_id = self.pool.get('procurement.order').create(cr, uid, {
'origin':origin,
})
proc_ids.append(proc_id)
打印的结果是:
print name = SO013
print val = {'origin': u'SO013'}
但是数据没有插入到procurement.order
表中。