新增按规格生成的采购申请订单跳过审核环节自动更新为已批准状态
This commit is contained in:
@@ -4,15 +4,15 @@ from odoo import fields, models, api, _
|
||||
class StatusChange(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
def action_confirm(self):
|
||||
res = super(StatusChange, self).action_confirm()
|
||||
# 采购申请自动确认
|
||||
pr_ids = self.env["purchase.request"].sudo().search(
|
||||
[('origin', 'like', self.name), ('rule_new_add', '=', True)])
|
||||
if pr_ids:
|
||||
pr_ids.write({'need_validation': False})
|
||||
pr_ids.write({"state": "approved"})
|
||||
return res
|
||||
# def action_confirm(self):
|
||||
# res = super(StatusChange, self).action_confirm()
|
||||
# # 采购申请自动确认
|
||||
# pr_ids = self.env["purchase.request"].sudo().search(
|
||||
# [('origin', 'like', self.name), ('rule_new_add', '=', True)])
|
||||
# if pr_ids:
|
||||
# pr_ids.write({'need_validation': False})
|
||||
# pr_ids.write({"state": "approved"})
|
||||
# return res
|
||||
|
||||
purchase_request_purchase_order_count = fields.Integer('采购申请单数量', compute='_compute_purchase_request_count',
|
||||
store=True)
|
||||
|
||||
Reference in New Issue
Block a user