优化代码,修复检测人功能

This commit is contained in:
mgw
2024-01-02 17:55:02 +08:00
parent 56d8190fc6
commit ccdbfda019
3 changed files with 83 additions and 81 deletions

View File

@@ -202,8 +202,7 @@ class StockRule(models.Model):
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
if sale_order:
sale_order.write({'schedule_status': 'to schedule'})
self.env['sf.production.plan'].sudo().with_company(company_id). \
create({
self.env['sf.production.plan'].sudo().with_company(company_id).create({
'name': production.name,
'order_deadline': sale_order.deadline_of_delivery,
'production_id': production.id,