Merge pull request !9383 from 李鹏宇/dev
This commit is contained in:
@@ -191,3 +191,16 @@ class InheritPurchaseOrderLine(models.Model):
|
||||
])
|
||||
record.category_ids = [(6, 0, matching_categories.ids)] if matching_categories else [(5,)]
|
||||
|
||||
def button_confirm(self):
|
||||
for order in self:
|
||||
# 去掉状态限制,所有状态都可以确认
|
||||
order.order_line._validate_analytic_distribution()
|
||||
order._add_supplier_to_product()
|
||||
if order._approval_allowed():
|
||||
order.button_approve()
|
||||
else:
|
||||
order.write({'state': 'to approve'})
|
||||
if order.partner_id not in order.message_partner_ids:
|
||||
order.message_subscribe([order.partner_id.id])
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user