取消采购申请部分确认生成的反向单据
This commit is contained in:
@@ -13,4 +13,14 @@ class PurchaseOrder(models.Model):
|
||||
('done', '完成'),
|
||||
('cancel', '取消'),
|
||||
('rejected', '已驳回')
|
||||
], string='Status', readonly=True, index=True, copy=False, default='draft', tracking=True)
|
||||
], string='Status', readonly=True, index=True, copy=False, default='draft', tracking=True)
|
||||
|
||||
|
||||
def button_confirm(self):
|
||||
res = super(PurchaseOrder, self).button_confirm()
|
||||
# 取消反向调拨单
|
||||
reverse_move_ids = self.env['stock.move'].search([('origin', '=', self.name), ('purchase_line_id', '=', False)])
|
||||
if reverse_move_ids:
|
||||
reverse_move_ids.picking_id.action_cancel()
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user