Compare commits

..

33 Commits

Author SHA1 Message Date
jinling.yang
8803380a30 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/new1 2024-11-26 15:37:40 +08:00
胡尧
5ccc836b20 Accept Merge Request #1553: (feature/sale_order_route_pick -> develop)
Merge Request: 修改排程单bug

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1553?initial=true
2024-11-26 11:51:47 +08:00
胡尧
087bb0e8fe 取消制造订单排程时,将其下所有子制造订单改为已排状态的逻辑 2024-11-26 11:51:09 +08:00
胡尧
09a476ffa5 修改子制造订单的销售订单 2024-11-26 11:26:17 +08:00
禹翔辉
429ad2b77c Accept Merge Request #1552: (feature/返工优化_5 -> develop)
Merge Request: 1、返工向导模型添加新的工单字段;2、工单tree视图添加重新加工分类

Created By: @禹翔辉
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1552
2024-11-26 11:17:22 +08:00
yuxianghui
c215e3dc27 Merge branch 'feature/采购优化' into feature/返工优化_5 2024-11-26 11:15:56 +08:00
yuxianghui
0a1da79487 1、返工向导模型添加新的工单字段;2、工单tree视图添加重新加工分类 2024-11-26 11:14:45 +08:00
jinling.yang
42e4e15cdb Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-11-26 10:58:20 +08:00
胡尧
a3e7a23979 Accept Merge Request #1551: (feature/sale_order_route_pick -> develop)
Merge Request: 采购单根据采购类型拆分

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1551
2024-11-26 10:48:25 +08:00
胡尧
430a628e18 Merge branch 'develop' into feature/sale_order_route_pick 2024-11-26 10:47:32 +08:00
胡尧
5f70690af5 采购单根据采购类型拆分 2024-11-26 10:45:43 +08:00
杨金灵
b852933a9e Accept Merge Request #1550: (feature/修复制造订单问题 -> develop)
Merge Request: 修复制造订单问题-退回调整

Created By: @杨金灵
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1550
2024-11-26 10:44:56 +08:00
jinling.yang
074c45aa3d Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复制造订单问题
# Conflicts:
#	sf_manufacturing/models/stock.py
2024-11-26 10:41:30 +08:00
jinling.yang
a52545d19a Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-11-26 10:39:23 +08:00
jinling.yang
3e55bb4717 修复制造订单批量调整 2024-11-26 10:39:04 +08:00
jinling.yang
be408b98de 修复制造订单相关问题 2024-11-25 18:00:06 +08:00
马广威
12cc5fd0d2 Accept Merge Request #1549: (feature/制造功能优化 -> develop)
Merge Request: 内部调拨单缺少源单据

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1549?initial=true
2024-11-25 17:25:38 +08:00
mgw
589df289be 内部调拨单缺少源单据 2024-11-25 17:24:14 +08:00
胡尧
7abc88f2c3 Accept Merge Request #1548: (feature/sale_order_route_pick -> develop)
Merge Request: 测试坯料采购单根据采购类型合并

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1548?initial=true
2024-11-25 17:19:22 +08:00
胡尧
f318dc758b 测试坯料采购单根据采购类型合并 2024-11-25 17:18:57 +08:00
胡尧
6628e22ac0 Accept Merge Request #1547: (feature/sale_order_route_pick -> develop)
Merge Request: 子制造订单增加拍承担

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1547?initial=true
2024-11-25 16:46:33 +08:00
管欢
c4cf4e2392 Accept Merge Request #1546: (feature/model_type_update -> develop)
Merge Request: 修复模型类型详情界面的配置工序不能删除

Created By: @管欢
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @管欢
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1546?initial=true
2024-11-25 16:44:45 +08:00
胡尧
56dfb98df5 子制造订单增加拍承担 2024-11-25 16:43:46 +08:00
jinling.yang
bcc9f0301c Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-11-25 16:23:09 +08:00
jinling.yang
17f2571be3 Merge branch 'feature/修复工序' into develop 2024-11-25 16:22:53 +08:00
杨金灵
a9b24f7961 Accept Merge Request #1545: (feature/修复工序 -> develop)
Merge Request: 修复工序

Created By: @杨金灵
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @杨金灵
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1545
2024-11-25 16:22:38 +08:00
jinling.yang
321125adf6 还原代码 2024-11-25 16:18:41 +08:00
jinling.yang
5c0db45223 修复工单开始 2024-11-25 16:03:40 +08:00
jinling.yang
76cc8845d2 修复工序 2024-11-25 15:40:41 +08:00
jinling.yang
38031a2537 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-11-25 15:02:08 +08:00
jinling.yang
1fe64e2b5d Merge branch 'feature/修复制造订单问题' into develop 2024-11-25 15:01:26 +08:00
jinling.yang
75bbcd23a4 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-11-25 13:59:40 +08:00
jinling.yang
e8c166be31 Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop 2024-11-25 10:25:52 +08:00
11 changed files with 153 additions and 56 deletions

View File

@@ -1,4 +1,5 @@
import logging
from itertools import groupby
from odoo import models, fields, api, _
@@ -7,11 +8,10 @@ class StockRuleInherit(models.Model):
@api.model
def _run_buy(self, procurements):
# 首先调用父类的 _run_buy 方法,以保留原有逻辑
super(StockRuleInherit, self)._run_buy(procurements)
# 然后在这里添加自定义的逻辑
# 判断补货组的采购类型
procurements_group = {'standard': [], 'consignment': []}
for procurement, rule in procurements:
is_consignment = False
product = procurement.product_id
# 获取主 BOM
bom = self.env['mrp.bom'].search([('product_tmpl_id', '=', product.product_tmpl_id.id)], limit=1)
@@ -23,21 +23,65 @@ class StockRuleInherit(models.Model):
# 检查路线
for route in raw_material.route_ids:
# print('route.name:', route.name)
if route.name == '按订单补给外包商': # 或者用 route.id 检查精确的路线
print("按订单补给外包商============是")
# 使用 procurement.values['supplier'] 获取供应商
supplier = procurement.values.get('supplier')
if supplier:
domain = rule._make_po_get_domain(procurement.company_id, procurement.values,
supplier.partner_id)
logging.info("domain=============: %s", domain)
po = self.env['purchase.order'].sudo().search([
('partner_id', '=', supplier.partner_id.id),
('company_id', '=', procurement.company_id.id), # 保证公司一致
('origin', '=', procurement.origin), # 根据来源匹配
('state', '=', 'draft') # 状态为草稿
], limit=1)
logging.info("po=: %s", po)
if po:
po.write({'purchase_type': 'consignment'})
break
if route.name == '按订单补给外包商':
is_consignment = True
if is_consignment:
procurements_group['consignment'].append((procurement, rule))
else:
procurements_group['standard'].append((procurement, rule))
for key, value in procurements_group.items():
super(StockRuleInherit, self)._run_buy(value)
if key == 'consignment':
for procurement, rule in value:
supplier = procurement.values.get('supplier')
if supplier:
domain = rule._make_po_get_domain(procurement.company_id, procurement.values,
supplier.partner_id)
logging.info("domain=============: %s", domain)
po = self.env['purchase.order'].sudo().search([
('partner_id', '=', supplier.partner_id.id),
('company_id', '=', procurement.company_id.id), # 保证公司一致
('origin', '=', procurement.origin), # 根据来源匹配
('state', '=', 'draft') # 状态为草稿
], limit=1)
logging.info("po=: %s", po)
if po:
po.write({'purchase_type': 'consignment'})
# # 首先调用父类的 _run_buy 方法,以保留原有逻辑
# super(StockRuleInherit, self)._run_buy(procurements)
# 然后在这里添加自定义的逻辑
# for procurement, rule in procurements:
# product = procurement.product_id
# # 获取主 BOM
# bom = self.env['mrp.bom'].search([('product_tmpl_id', '=', product.product_tmpl_id.id)], limit=1)
# if bom:
# # 遍历 BOM 中的组件(即坯料等)
# for line in bom.bom_line_ids:
# raw_material = line.product_id
# # 检查路线
# for route in raw_material.route_ids:
# # print('route.name:', route.name)
# if route.name == '按订单补给外包商': # 或者用 route.id 检查精确的路线
# print("按订单补给外包商============是")
# # 使用 procurement.values['supplier'] 获取供应商
# supplier = procurement.values.get('supplier')
# if supplier:
# domain = rule._make_po_get_domain(procurement.company_id, procurement.values,
# supplier.partner_id)
# logging.info("domain=============: %s", domain)
# po = self.env['purchase.order'].sudo().search([
# ('partner_id', '=', supplier.partner_id.id),
# ('company_id', '=', procurement.company_id.id), # 保证公司一致
# ('origin', '=', procurement.origin), # 根据来源匹配
# ('state', '=', 'draft') # 状态为草稿
# ], limit=1)
# logging.info("po=: %s", po)
# if po:
# po.write({'purchase_type': 'consignment'})
# break

View File

@@ -12,6 +12,7 @@
<field name="state" select="multi" string="状态" icon="fa-building" enable_counters="1"/>
<field name="construction_period_status" select="multi" icon="fa-building" enable_counters="1"/>
<field name="tag_type" select="multi" icon="fa-building" enable_counters="1"/>
<!-- <field name="manual_quotation" select="multi" string="" icon="fa-building" enable_counters="1"/>-->
</searchpanel>

View File

@@ -388,9 +388,12 @@ class MrpProduction(models.Model):
def technology_confirm(self):
process_parameters = []
account_moves = []
parameters_not = []
special_design = self.technology_design_ids.filtered(
lambda a: a.routing_tag == 'special' and a.is_auto is False)
for special in special_design:
if special.route_id.routing_type == '表面工艺' and not special.process_parameters_id:
parameters_not.append(special.route_id.name)
if special.process_parameters_id:
product_production_process = self.env['product.template'].search(
[('server_product_process_parameters_id', '=', special.process_parameters_id.id)])
@@ -404,6 +407,8 @@ class MrpProduction(models.Model):
account_moves.append(purchase.name)
if account_moves:
raise UserError(_("请联系工厂生产经理对采购订单为%s生成的账单进行取消", ", ".join(account_moves)))
if parameters_not:
raise UserError(_("【工艺设计】-【工序】为%s未选择参数,请选择", ", ".join(parameters_not)))
if process_parameters:
raise UserError(_("【工艺设计】-【参数】为%s的在【产品】中不存在,请先创建", ", ".join(process_parameters)))
# 判断同一个加工面的标准工序的顺序是否依次排序
@@ -1301,6 +1306,7 @@ class MrpProduction(models.Model):
raise_user_error=not self.env.context.get('from_orderpoint'))
productions = self.env['mrp.production'].sudo().search(
[('origin', '=', self.origin)], order='id desc', limit=1)
productions.write({'programming_no': self.programming_no, 'is_remanufacture': True})
move = self.env['stock.move'].search([('origin', '=', productions.name)], order='id desc')
for mo in move:
domain = []
@@ -1327,7 +1333,6 @@ class MrpProduction(models.Model):
mo_move.write({'reference': sfp_move.reference, 'partner_id': sfp_move.partner_id.id,
'picking_id': sfp_move.picking_id.id, 'picking_type_id': sfp_move.picking_type_id.id,
'production_id': False})
productions.write({'programming_no': self.programming_no, 'is_remanufacture': True})
# productions.procurement_group_id.mrp_production_ids.move_dest_ids.write(
# {'group_id': self.env['procurement.group'].search([('name', '=', sale_order.name)])})
stock_picking_remanufacture = self.env['stock.picking'].search([('origin', '=', productions.name)])
@@ -1461,6 +1466,29 @@ class MrpProduction(models.Model):
])
order.delivery_count = len(order.picking_ids)
def action_view_purchase_orders(self):
self.ensure_one()
if self.product_id.product_tmpl_id.single_manufacturing == True:
production = self.env['mrp.production'].search([('origin', '=', self.origin), ('product_id', '=', self.product_id.id)], limit=1, order='id asc')
else:
production = self
purchase_order_ids = (production.procurement_group_id.stock_move_ids.created_purchase_line_id.order_id | production.procurement_group_id.stock_move_ids.move_orig_ids.purchase_line_id.order_id).ids
action = {
'res_model': 'purchase.order',
'type': 'ir.actions.act_window',
}
if len(purchase_order_ids) == 1:
action.update({
'view_mode': 'form',
'res_id': purchase_order_ids[0],
})
else:
action.update({
'name': _("Purchase Order generated from %s", self.name),
'domain': [('id', 'in', purchase_order_ids)],
'view_mode': 'tree,form',
})
return action
class sf_detection_result(models.Model):
_name = 'sf.detection.result'

View File

@@ -141,8 +141,8 @@ class ResMrpWorkOrder(models.Model):
# 是否绑定托盘
is_trayed = fields.Boolean(string='是否绑定托盘', default=False)
tag_type = fields.Selection([("重新加工", "重新加工")], string="标签", tracking=True)
technology_design_id = fields.Many2one('sf.technology.design')
def _compute_default_construction_period_status(self):
@@ -281,8 +281,7 @@ class ResMrpWorkOrder(models.Model):
# if technology_design.is_auto is False:
# domain = [('origin', '=', order.production_id.name)]
# else:
domain = [('purchase_type', '=', 'consignment'), ('origin', '=', ','.join(production_list)),
('state', '!=', 'cancel')]
domain = [('purchase_type', '=', 'consignment'), ('origin', '=', ','.join(production_list))]
purchase = self.env['purchase.order'].search(domain)
if not purchase:
order.surface_technics_purchase_count = 0
@@ -308,8 +307,7 @@ class ResMrpWorkOrder(models.Model):
# if technology_design.is_auto is False:
# domain = [('origin', '=', self.production_id.name)]
# else:
domain = [('origin', '=', ','.join(production_list)), ('purchase_type', '=', 'consignment'),
('state', '!=', 'cancel')]
domain = [('origin', '=', ','.join(production_list)), ('purchase_type', '=', 'consignment')]
purchase_orders = self.env['purchase.order'].search(domain)
result = {
"type": "ir.actions.act_window",
@@ -1077,6 +1075,13 @@ class ResMrpWorkOrder(models.Model):
if workorder.state != 'pending':
workorder.state = 'pending'
continue
# ================= 如果制造订单制造类型为【人工线下加工】==========================
if (workorder.production_id.production_type == '人工线下加工'
and workorder.production_id.schedule_state == '已排'
and len(workorder.production_id.picking_ids.filtered(
lambda w: w.state not in ['done', 'cancel'])) == 0):
workorder.state = 'ready'
continue
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
or workorder.production_id.schedule_state != '已排'
@@ -1197,11 +1202,12 @@ class ResMrpWorkOrder(models.Model):
raise UserError('制造订单【%s】缺少组件的序列号信息!' % self.production_id.name)
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
# cnc校验
cnc_workorder = self.search(
[('production_id', '=', self.production_id.id), ('routing_type', '=', 'CNC加工')],
limit=1, order='id asc')
if not cnc_workorder.cnc_ids:
raise UserError(_('该制造订单还未下发CNC程序请稍后再试'))
if self.production_id.production_type == '自动化产线加工':
cnc_workorder = self.search(
[('production_id', '=', self.production_id.id), ('routing_type', '=', 'CNC加工')],
limit=1, order='id asc')
if not cnc_workorder.cnc_ids:
raise UserError(_('该制造订单还未下发CNC程序请稍后再试'))
else:
if self.production_id.tool_state in ['1', '2']:
if self.production_id.tool_state == '1':

View File

@@ -281,6 +281,13 @@ class StockRule(models.Model):
workorder_duration += workorder.duration_expected
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
# 如果订单为空,则获取来源制造订单的销售单
if not sale_order:
mrp_production = self.env['mrp.production'].sudo().search([('name', '=', production.origin)], limit=1)
if mrp_production:
sale_order = self.env['sale.order'].sudo().search([('name', '=', mrp_production.origin)])
else:
mrp_production = production
if sale_order:
# sale_order.write({'schedule_status': 'to schedule'})
self.env['sf.production.plan'].sudo().with_company(company_id).create({
@@ -288,7 +295,7 @@ class StockRule(models.Model):
'order_deadline': sale_order.deadline_of_delivery,
'production_id': production.id,
'date_planned_start': production.date_planned_start,
'origin': production.origin,
'origin': mrp_production.origin,
'product_qty': production.product_qty,
'product_id': production.product_id.id,
'state': 'draft',
@@ -332,8 +339,8 @@ class StockRule(models.Model):
product_routing_workcenter = self.env[model].search(domain, order='sequence asc')
if production_item.production_type == '自动化产线加工':
for k in (production_item.product_id.model_processing_panel.split(',')):
i += 1
for route in product_routing_workcenter:
i += 1
technology_design_values.append(
self.env['sf.technology.design'].json_technology_design_str(k, route, i, False))
else:
@@ -970,19 +977,21 @@ class ReStockMove(models.Model):
创建调拨单时,在此新增或修改调拨单的数据
"""
res = super(ReStockMove, self)._get_new_picking_values()
if self[0].origin and self.picking_type_id.name in ['生产发料', '内部调拨']:
production = self.env['mrp.production'].search([('name', '=', self[0].origin)], limit=1, order='id asc')
productions = self.env['mrp.production'].search(
[('origin', '=', production.origin), ('product_id', '=', production.product_id.id)])
res['origin'] = ','.join(productions.mapped('name'))
res['retrospect_ref'] = production.product_id.name
## 制造订单报废生成的新制造订单不走合并
production_remanufacture = None
if 'origin' in res:
if self.picking_type_id.name in ['生产发料', '内部调拨']:
production_remanufacture = self.env['mrp.production'].search(
[('name', '=', res['origin']), ('is_remanufacture', '=', True)])
if not production_remanufacture:
if self[0].origin and self.picking_type_id.name in ['生产发料', '内部调拨']:
production = self.env['mrp.production'].search([('name', '=', self[0].origin)], limit=1, order='id asc')
productions = self.env['mrp.production'].search(
[('origin', '=', production.origin), ('product_id', '=', production.product_id.id)])
res['origin'] = ','.join(productions.mapped('name'))
res['retrospect_ref'] = production.product_id.name
return res
def _single_manufactuing_mo_generate_origin(self, res):
"""
单个制造订单的完成move单据修改来源为该制造订单关联的销售订单下所有成品相同的制造订单
"""
class ReStockQuant(models.Model):
_inherit = 'stock.quant'

View File

@@ -120,7 +120,8 @@
<!-- <field name="production_line_state" readonly="1"/>-->
<field name="part_name"/>
<field name="part_number" string="零件图号"/>
<field name="tool_state" attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"/>
<field name="tool_state"
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工'])]}"/>
<field name="tool_state_remark" string="备注" attrs="{'invisible': [('tool_state', '!=', '1')]}"/>
<field name="deadline_of_delivery" readonly="1"/>
<field name="tool_state_remark2" invisible="1"/>
@@ -365,7 +366,8 @@
<field name="sequence" widget="handle"/>
<field name="route_id" context="{'production_id': production_id}"
attrs="{'readonly': [('id', '!=', False)]}" options="{'no_create': True}"/>
<field name="process_parameters_id" attrs="{'readonly': [('id', '!=', False)]}"
<field name="process_parameters_id"
attrs="{'readonly': [('id', '!=', False),('routing_tag', '=', 'standard')]}"
string="参数" context="{'route_id':route_id}" options="{'no_create': True}"/>
<field name="panel" readonly="1"/>
<field name="routing_tag" readonly="1" widget="badge"
@@ -387,13 +389,16 @@
</page>
</xpath>
<xpath expr="//sheet/group/group/div[@class='d-flex flex-row align-items-start']/span[last()]" position="attributes">
<xpath expr="//sheet/group/group/div[@class='d-flex flex-row align-items-start']/span[last()]"
position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//sheet/group/group/div[@class='d-flex flex-row align-items-start']/button[@name='action_product_forecast_report']" position="attributes">
<xpath expr="//sheet/group/group/div[@class='d-flex flex-row align-items-start']/button[@name='action_product_forecast_report']"
position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//sheet/div[@class='oe_button_box']/button[@name='action_view_mrp_production_childs']/div/span[last()]" position="replace">
<xpath expr="//sheet/div[@class='oe_button_box']/button[@name='action_view_mrp_production_childs']/div/span[last()]"
position="replace">
<span class="o_stat_text">子MO</span>
</xpath>
</field>

View File

@@ -32,6 +32,7 @@
</field>
<xpath expr="//field[@name='qty_remaining']" position="after">
<field name="manual_quotation" optional="show"/>
<field name="tag_type" optional="show"/>
<field name="construction_period_status" optional="show" widget="badge"
decoration-success="construction_period_status == '正常'"
decoration-warning="construction_period_status == '预警'"

View File

@@ -14,7 +14,7 @@ class ProductionTechnologyReAdjustWizard(models.TransientModel):
def confirm(self):
if self.is_technology_re_adjust is True:
domain = [('origin', '=', self.origin), ('state', '=', 'technology_to_confirmed'),
domain = [('origin', '=', self.origin), ('state', '=', 'confirmed'),
('product_id', '=', self.production_id.product_id.id)]
else:
domain = [('id', '=', self.production_id.id)]

View File

@@ -15,6 +15,8 @@ class ReworkWizard(models.TransientModel):
production_id = fields.Many2one('mrp.production', string='制造订单号')
workorder_ids = fields.Many2many('mrp.workorder', 'rework_wizard_to_work_order', string='所有工单',
domain="[('production_id', '=', production_id),('state','=','done')]")
hidden_workorder_ids = fields.Many2many('mrp.workorder', 'rework_wizard_to_work_order_hidden',
string='所有工单(hidden)')
rework_reason = fields.Selection(
[("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"),
("operate computer", "操机"),

View File

@@ -12,6 +12,7 @@
<field name="tool_state" invisible="True"/>
<field name="routing_type" invisible="True"/>
<field name="processing_panel_id" invisible="1"/>
<field name="hidden_workorder_ids" invisible="1"/>
<group>
<field name="workorder_ids" string="工序" attrs='{"invisible": [("routing_type","=","装夹预调")]}'>
<tree create="0" editable='bottom' delete="0">

View File

@@ -259,10 +259,10 @@ class sf_production_plan(models.Model):
# sale_obj = self.env['sale.order'].search([('name', '=', record.origin)])
# if 'S' in sale_obj.name:
# sale_obj.schedule_status = 'to process'
mrp_production_ids = record.production_id._get_children().ids
print('mrp_production_ids', mrp_production_ids)
for i in mrp_production_ids:
record.env['mrp.production'].sudo().browse(i).schedule_state = '已排'
# mrp_production_ids = record.production_id._get_children().ids
# print('mrp_production_ids', mrp_production_ids)
# for i in mrp_production_ids:
# record.env['mrp.production'].sudo().browse(i).schedule_state = '已排'
# record.production_id.date_planned_start = record.date_planned_start
# record.production_id.date_planned_finished = record.date_planned_finished
record.sudo().production_id.production_line_id = record.production_line_id.id