从另一个模块(action_donne 和 action_confirm')创建股票移动 odoo 12 时出错?
Erroro in creating stock move odoo 12 from other module ( action_donne and action_confirm')?
我想在 odoo 12 中点击按钮后创建一个动作,但是没有动作确认和 action_done 方法
他们在 odoo 12 中更改了他们的名字吗?
谢谢
"-----------------------------------------------------------------"
'stock.move' object has no attribute 'action_confirm'
'stock.move' object has no attribute 'action_done'
"-----------------------------------------------------------------"
@api.multi
def _mvm(self, piece):
stock_move_obj = self.env["stock.move"]
location_id=self.env['stock.location'].search([('name' ,'=', 'PDR')], limit=1)
location_dest_id=self.env['stock.location'].search([('id' ,'=', 7)], limit=1)
vals = {
'product_id': piece.product.id,
'product_uom_qty': piece.use_qty,
'name': piece.product.name,
'product_uom':piece.product.uom_id.id,
'location_id': location_id.id,
'location_dest_id':location_dest_id.id
}
#pdb.set_trace()
mv = stock_move_obj.sudo().create(vals)
mv.action_confirm()
mv.sudo().action_done()
return True
穆罕默德
Error说明对象根本没有这个方法,
将方法替换为 mv._action_confirm
& mv._action_done
.
谢谢
我想在 odoo 12 中点击按钮后创建一个动作,但是没有动作确认和 action_done 方法 他们在 odoo 12 中更改了他们的名字吗? 谢谢
"-----------------------------------------------------------------"
'stock.move' object has no attribute 'action_confirm'
'stock.move' object has no attribute 'action_done'
"-----------------------------------------------------------------"
@api.multi
def _mvm(self, piece):
stock_move_obj = self.env["stock.move"]
location_id=self.env['stock.location'].search([('name' ,'=', 'PDR')], limit=1)
location_dest_id=self.env['stock.location'].search([('id' ,'=', 7)], limit=1)
vals = {
'product_id': piece.product.id,
'product_uom_qty': piece.use_qty,
'name': piece.product.name,
'product_uom':piece.product.uom_id.id,
'location_id': location_id.id,
'location_dest_id':location_dest_id.id
}
#pdb.set_trace()
mv = stock_move_obj.sudo().create(vals)
mv.action_confirm()
mv.sudo().action_done()
return True
穆罕默德
Error说明对象根本没有这个方法,
将方法替换为 mv._action_confirm
& mv._action_done
.
谢谢