Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/页面优化

# Conflicts:
#	sf_manufacturing/models/stock.py
This commit is contained in:
jinling.yang
2023-09-14 09:46:28 +08:00
19 changed files with 410 additions and 208 deletions

View File

@@ -189,28 +189,30 @@ class StockRule(models.Model):
'mail.message_origin_link',
values={'self': production, 'origin': origin_production},
subtype_id=self.env.ref('mail.mt_note').id)
# '''
# 创建生产计划
# '''
# # 工单耗时
# workorder_duration = 0
# for workorder in production.workorder_ids:
# workorder_duration += workorder.duration_expected
#
# sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
# if sale_order:
# bb = sale_order.deadline_of_delivery
# productions = self.env['sf.production.plan'].with_user(SUPERUSER_ID).sudo().with_company(company_id). \
# create({
# 'name': production.name,
# 'production_id': production.id,
# 'date_planned_start': production.date_planned_start,
# 'origin': production.origin,
# 'product_qty': production.product_qty,
# 'product_id': production.product_id.id,
# 'state': 'draft',
# })
'''
创建生产计划
'''
# 工单耗时
workorder_duration = 0
for workorder in production.workorder_ids:
workorder_duration += workorder.duration_expected
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
if sale_order:
bb = sale_order.deadline_of_delivery
productions = self.env['sf.production.plan'].with_user(SUPERUSER_ID).sudo().with_company(company_id). \
create({
'name': production.name,
'order_deadline': sale_order.deadline_of_delivery,
'production_id': production.id,
'date_planned_start': production.date_planned_start,
'origin': production.origin,
'product_qty': production.product_qty,
'product_id': production.product_id.id,
'state': 'draft',
})
return True