Openerp 我在stock.picking move\行中插入值,但单击save it Error后,以下字段在有效的stock.move in Odo10中
这个按钮Openerp 我在stock.picking move\行中插入值,但单击save it Error后,以下字段在有效的stock.move in Odo10中,openerp,odoo-9,odoo-10,Openerp,Odoo 9,Odoo 10,这个按钮 <span class="o_stat_value"><field name="test_field"/>Material Out</span> 我继承purchase.order并创建一个按钮,并将 选股。按钮的作用是储存原始数据的值 所以当点击保存按钮显示 以下字段是无效的stock.move 大宗报价 从bom.line.ids插入到stock.move stock.picking的值,使用p
<span class="o_stat_value"><field name="test_field"/>Material Out</span>
我继承purchase.order并创建一个按钮,并将
选股。按钮的作用是储存原始数据的值
所以当点击保存按钮显示
以下字段是无效的stock.move
大宗报价
从bom.line.ids插入到stock.move stock.picking的值,使用picking\u id、location\u id、application\u dest\u id和'purchase=ok,in purchase\u id
class SkylineJobOrder(models.Model):
_name = 'skyline.job.order'
_inherit = 'purchase.order'
@api.multi
def action_workorder_out(self):
x = 0
""" This opens the xml view specified in xml_id for the current Work Order in Manufacturing """
self.ensure_one()
xml_id = self.env.context.get('xml_id')
if xml_id:
res = self.env['ir.actions.act_window'].for_xml_id('stock', xml_id)
production = self.env['mrp.production'].search([('product_id','=',self.product_id.id)])
for item in production:
x = item.bom_id.id
bomline = self.env['mrp.bom.line'].search([('bom_id','=',x)])
for record in bomline:
res.update(
context={'default_states':'draft','default_partner_id': self.partner_id.id,'default_move_lines': [(0,0, {'address_in_id':self.partner_id.id,'product_id':record.product_id.id,'product_uom': record.product_uom_id.id,'product_uom_qty':record.product_qty,'scrapped':False,'state':'draft','picking_id':False,'name': 'test','procurement_id': record.operation_id.id,'split_from': self.id,'no_open': True,'no_create':True,'availability':1,'location_dest_id':8,'picking_id':35})]}
)
print res
return res
return False