Compare commits

..

23 Commits

Author SHA1 Message Date
huziyang@jikimo.com
22f36d095c 跟新 2025-07-18 16:18:09 +08:00
guanhuan
fe8df494f9 需求计划列表字段位置变动 2025-06-30 17:13:46 +08:00
guanhuan
32cd68e15f 调拨动作中屏蔽验证 2025-06-30 13:36:04 +08:00
guanhuan
f0e47371ed 新增坯料类型 2025-06-27 15:29:02 +08:00
yuxianghui
6dde814acc 产品-form页面加工参数 添加坯料类型字段 2025-06-27 15:17:15 +08:00
yuxianghui
71ab241e94 产品添加坯料类型字段,值来着bfm下单 2025-06-27 15:10:15 +08:00
yuxianghui
0a13acbb68 修改 销售订单确认时,生成产品BOM时校验单位用量值的提示信息 2025-06-26 17:04:50 +08:00
hyyy
4b026535f8 修改固定列tree的传参方式 2025-06-25 14:01:34 +08:00
hyyy
99ac89f995 需求-字段命名调整 2025-06-25 09:54:37 +08:00
yuxianghui
35b1d648c3 产品新增单件用量 unit_number 字段,值由bfm下单同步获得;产品生成的BOM中组件数量的值由unit_number 字段提供。 2025-06-24 15:36:23 +08:00
guanhuan
fe3492ceb5 坯料尺寸显示修改 2025-06-24 11:32:41 +08:00
yuxianghui
4274b9fe99 出厂检验报告-页脚修改回退 2025-06-20 17:53:04 +08:00
禹翔辉
4ddabdefa1 Accept Merge Request #2227: (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/2227
2025-06-20 13:39:42 +08:00
yuxianghui
364127beb3 1 2025-06-20 13:37:42 +08:00
yuxianghui
109ea8729d 优化出厂检验报告模版 2025-06-20 12:03:17 +08:00
禹翔辉
32de726164 Accept Merge Request #2226: (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/2226
2025-06-20 11:49:32 +08:00
yuxianghui
79f89f068b 修改出厂检验报告模版 2025-06-20 11:47:59 +08:00
禹翔辉
52189cff72 Accept Merge Request #2225: (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/2225
2025-06-20 11:37:18 +08:00
yuxianghui
aadccce47e 修改出厂检验报告生成模版 2025-06-20 11:35:23 +08:00
胡尧
abd88fd721 Accept Merge Request #2224: (feature/6711 -> develop)
Merge Request: 修改产量接口bug

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2224?initial=true
2025-06-20 11:27:06 +08:00
胡尧
2c2fa87719 修改产量接口bug 2025-06-20 11:26:48 +08:00
胡尧
7d8b7048a8 Accept Merge Request #2223: (feature/6711 -> develop)
Merge Request: 去掉多余代码

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2223?initial=true
2025-06-20 11:15:58 +08:00
胡尧
e7b312fb22 去掉多余代码 2025-06-20 10:53:31 +08:00
24 changed files with 790 additions and 92 deletions

View File

@@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import models

View File

@@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': '机企猫 需求计划排程队列',
'version': '1.0',
'summary': """ 使用队列进行排程 """,
'author': 'fox',
'website': '',
'category': '',
'depends': ['queue_job_batch', 'sf_demand_plan'],
'data': [
],
'application': True,
'installable': True,
'auto_install': False,
'license': 'LGPL-3',
}

View File

@@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import production_demand_plan

View File

@@ -1,20 +0,0 @@
from odoo import models, fields
class ProductionDemandPlan(models.Model):
_inherit = 'sf.production.demand.plan'
def _do_production_schedule(self, pro_plan_list):
"""使用队列进行排程"""
batch_size = 10
current_time = fields.Datetime.now().strftime('%Y%m%d%H%M%S')
index = 1
for i in range(0, len(pro_plan_list), batch_size):
batch = self.env['queue.job.batch'].get_new_batch('plan-%s-%s' % (current_time, index))
pro_plans = pro_plan_list[i:i+batch_size]
pro_plans.with_context(
job_batch=batch
).with_delay().do_production_schedule()
index += 1
batch.enqueue()

View File

@@ -190,7 +190,7 @@ def _create(self, data_list):
# 如果该用户组被限制创建或更新操作 # 如果该用户组被限制创建或更新操作
if rec['is_create_or_update']: if rec['is_create_or_update']:
raise UserError( raise UserError(
_("您没有执行此操作%s的权限。请联系管理员" % group_xml_id)) _("您没有执行此操作的权限。请联系管理员"))
else: else:
# 如果 'access.right' 模型不存在,可以在这里定义备选逻辑 # 如果 'access.right' 模型不存在,可以在这里定义备选逻辑
# 例如,记录日志、发送通知或者简单地跳过这部分逻辑 # 例如,记录日志、发送通知或者简单地跳过这部分逻辑

View File

@@ -10,7 +10,7 @@
""", """,
'category': 'sf', 'category': 'sf',
'website': 'https://www.sf.jikimo.com', 'website': 'https://www.sf.jikimo.com',
'depends': ['sf_plan'], 'depends': ['sf_plan', 'jikimo_printing'],
'data': [ 'data': [
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'views/demand_plan.xml', 'views/demand_plan.xml',

View File

@@ -72,6 +72,7 @@ class SfProductionDemandPlan(models.Model):
model_long = fields.Char('尺寸(mm)', compute='_compute_model_long') model_long = fields.Char('尺寸(mm)', compute='_compute_model_long')
blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类', blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类',
related='product_id.blank_type') related='product_id.blank_type')
blank_precision = fields.Selection([('精坯', '精坯'), ('粗坯', '粗坯')], string='坯料类型', related='product_id.blank_precision')
embryo_long = fields.Char('坯料尺寸(mm)', compute='_compute_embryo_long') embryo_long = fields.Char('坯料尺寸(mm)', compute='_compute_embryo_long')
materials_id = fields.Char('材料', compute='_compute_materials_id', store=True) materials_id = fields.Char('材料', compute='_compute_materials_id', store=True)
model_machining_precision = fields.Selection(selection=_get_machining_precision, string='精度', model_machining_precision = fields.Selection(selection=_get_machining_precision, string='精度',
@@ -196,10 +197,13 @@ class SfProductionDemandPlan(models.Model):
else: else:
line.model_long = None line.model_long = None
@api.depends('product_id.model_long', 'product_id.model_width', 'product_id.model_height') @api.depends('product_id.model_long', 'product_id.model_width', 'product_id.model_height', 'product_id.blank_type')
def _compute_embryo_long(self): def _compute_embryo_long(self):
for line in self: for line in self:
if line.product_id: if line.product_id:
if line.product_id.blank_type == '圆料':
line.embryo_long = f"Ø{round(line.product_id.model_width, 3)}*{round(line.product_id.model_long, 3)}"
else:
line.embryo_long = f"{round(line.product_id.model_long, 3)}*{round(line.product_id.model_width, 3)}*{round(line.product_id.model_height, 3)}" line.embryo_long = f"{round(line.product_id.model_long, 3)}*{round(line.product_id.model_width, 3)}*{round(line.product_id.model_height, 3)}"
else: else:
line.embryo_long = None line.embryo_long = None
@@ -323,13 +327,9 @@ class SfProductionDemandPlan(models.Model):
date_planned_start = datetime.combine(date_part, time_part) date_planned_start = datetime.combine(date_part, time_part)
pro_plan_list.production_line_id = sf_production_line.id pro_plan_list.production_line_id = sf_production_line.id
pro_plan_list.date_planned_start = date_planned_start pro_plan_list.date_planned_start = date_planned_start
self._do_production_schedule(pro_plan_list)
def _do_production_schedule(self, pro_plan_list):
for pro_plan in pro_plan_list: for pro_plan in pro_plan_list:
pro_plan.do_production_schedule() pro_plan.do_production_schedule()
def button_action_print(self): def button_action_print(self):
return { return {
'res_model': 'sf.demand.plan.print.wizard', 'res_model': 'sf.demand.plan.print.wizard',
@@ -403,6 +403,7 @@ class SfProductionDemandPlan(models.Model):
outsourcing_purchase_request.extend(pr_ids.ids) outsourcing_purchase_request.extend(pr_ids.ids)
if record.supply_method == 'outsourcing' and not record.sale_order_line_id.is_incoming_material: if record.supply_method == 'outsourcing' and not record.sale_order_line_id.is_incoming_material:
bom_line_ids = record.product_id.bom_ids.bom_line_ids bom_line_ids = record.product_id.bom_ids.bom_line_ids
if bom_line_ids:
# BOM_数量 # BOM_数量
total_product_qty = sum(line.product_qty for line in bom_line_ids) total_product_qty = sum(line.product_qty for line in bom_line_ids)
bom_product_ids = bom_line_ids.mapped('product_id') bom_product_ids = bom_line_ids.mapped('product_id')

View File

@@ -82,3 +82,8 @@
cursor: pointer; cursor: pointer;
} }
} }
th[data-name=processing_time] + th::before{
content: '待执行单据';
line-height: 38px;
}

View File

@@ -4,14 +4,15 @@
<field name="model">sf.production.demand.plan</field> <field name="model">sf.production.demand.plan</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="需求计划" default_order="sequence desc,id desc" editable="bottom" <tree string="需求计划" default_order="sequence desc,id desc" editable="bottom"
class="demand_plan_tree"> class="demand_plan_tree freeze-columns-before-part_number">
<header> <header>
<button string="打印" name="button_action_print" type="object" <button string="打印" name="button_action_print" type="object"
class="btn-primary"/> class="btn-primary"/>
<button string="创建工艺设计任务" name="%(sf_manufacturing.action_create_technology_design_task_wizard)d"
type="action" class="btn-secondary" context="{'active_model': 'sf.production.demand.plan', 'active_ids': active_ids}"/>
</header> </header>
<field name="sequence" widget="handle"/> <field name="sequence" widget="handle"/>
<field name="id" optional="hide"/> <field name="id" optional="hide"/>
<field name="priority"/>
<field name="status"/> <field name="status"/>
<field name="customer_name"/> <field name="customer_name"/>
<field name="order_remark"/> <field name="order_remark"/>
@@ -28,7 +29,8 @@
<field name="qty_delivered"/> <field name="qty_delivered"/>
<field name="qty_to_deliver"/> <field name="qty_to_deliver"/>
<field name="model_long"/> <field name="model_long"/>
<field name="blank_type"/> <field name="blank_type" optional="hide"/>
<field name="blank_precision"/>
<field name="embryo_long"/> <field name="embryo_long"/>
<field name="materials_id"/> <field name="materials_id"/>
<field name="model_machining_precision"/> <field name="model_machining_precision"/>
@@ -43,7 +45,10 @@
<field name="date_order"/> <field name="date_order"/>
<field name="contract_code"/> <field name="contract_code"/>
<field name="plan_remark"/> <field name="plan_remark"/>
<field name="processing_time"/> <field name="priority" decoration-danger="priority == '1'"
decoration-warning="priority == '2'"
decoration-info="priority == '3'"
decoration-success="priority == '4'"/>
<field name="material_check" optional="hide"/> <field name="material_check" optional="hide"/>
<field name="hide_action_open_mrp_production" invisible="1"/> <field name="hide_action_open_mrp_production" invisible="1"/>
<field name="hide_action_purchase_orders" invisible="1"/> <field name="hide_action_purchase_orders" invisible="1"/>
@@ -62,6 +67,7 @@
<field name="planned_start_date"/> <field name="planned_start_date"/>
<field name="actual_start_date"/> <field name="actual_start_date"/>
<field name="actual_end_date"/> <field name="actual_end_date"/>
<field name="processing_time"/>
<field name="create_date" optional="hide" string="创建时间"/> <field name="create_date" optional="hide" string="创建时间"/>
<field name="create_uid" optional="hide" string="创建人"/> <field name="create_uid" optional="hide" string="创建人"/>
<field name="write_date" string="更新时间"/> <field name="write_date" string="更新时间"/>
@@ -91,7 +97,8 @@
<group expand="0" string="Group By"> <group expand="0" string="Group By">
<filter name="group_by_priority" string="优先级" domain="[]" context="{'group_by': 'priority'}"/> <filter name="group_by_priority" string="优先级" domain="[]" context="{'group_by': 'priority'}"/>
<filter name="group_by_status" string="状态" domain="[]" context="{'group_by': 'status'}"/> <filter name="group_by_status" string="状态" domain="[]" context="{'group_by': 'status'}"/>
<filter name="group_by_customer_name" string="客户" domain="[]" context="{'group_by': 'customer_name'}"/> <filter name="group_by_customer_name" string="客户" domain="[]"
context="{'group_by': 'customer_name'}"/>
<filter name="group_by_is_incoming_material" string="客供料" domain="[]" <filter name="group_by_is_incoming_material" string="客供料" domain="[]"
context="{'group_by': 'is_incoming_material'}"/> context="{'group_by': 'is_incoming_material'}"/>
<filter name="group_by_supply_method" string="供货方式" domain="[]" <filter name="group_by_supply_method" string="供货方式" domain="[]"
@@ -122,4 +129,9 @@
action="sf_production_demand_plan_action" action="sf_production_demand_plan_action"
parent="sf_plan.sf_production_plan_menu" parent="sf_plan.sf_production_plan_menu"
/> />
<!-- 调拨动作中屏蔽验证-->
<record id="stock.action_validate_picking" model="ir.actions.server">
<field name="binding_model_id" eval="False"/>
</record>
</odoo> </odoo>

View File

@@ -3,6 +3,7 @@ import logging
import re import re
from odoo import models, fields, api from odoo import models, fields, api
from odoo.exceptions import ValidationError
class ResProductCategory(models.Model): class ResProductCategory(models.Model):
@@ -47,11 +48,14 @@ class ResMrpBomMo(models.Model):
item.subcontractor_name = '' item.subcontractor_name = ''
def bom_create_line_has(self, embryo): def bom_create_line_has(self, embryo):
product = self.product_tmpl_id
if product.unit_number in (0, None, False):
raise ValidationError(f'产品{product.name}单件用量的值不能为{product.unit_number}')
vals = { vals = {
'bom_id': self.id, 'bom_id': self.id,
'product_id': embryo.id, 'product_id': embryo.id,
'product_tmpl_id': embryo.product_tmpl_id.id, 'product_tmpl_id': embryo.product_tmpl_id.id,
'product_qty': 1, 'product_qty': product.unit_number,
'product_uom_id': 1 'product_uom_id': 1
} }
return self.env['mrp.bom.line'].sudo().create(vals) return self.env['mrp.bom.line'].sudo().create(vals)

View File

@@ -95,6 +95,8 @@
<page string="加工参数"> <page string="加工参数">
<group> <group>
<group string="模型"> <group string="模型">
<field name="blank_type" readonly="1"/>
<field name="blank_precision" readonly="1"/>
<label for="model_long" string="坯料尺寸[mm]"/> <label for="model_long" string="坯料尺寸[mm]"/>
<div class="o_address_format"> <div class="o_address_format">
<label for="model_long" string="长"/> <label for="model_long" string="长"/>
@@ -104,7 +106,7 @@
<label for="model_height" string="高"/> <label for="model_height" string="高"/>
<field name="model_height" class="o_address_zip"/> <field name="model_height" class="o_address_zip"/>
</div> </div>
<field name="blank_type" readonly="1"/> <field name="unit_number" readonly="1"/>
<field name="model_volume" string="体积[mm³]"/> <field name="model_volume" string="体积[mm³]"/>
<field name="product_model_type_id" string="模型类型"/> <field name="product_model_type_id" string="模型类型"/>
<field name="model_processing_panel" placeholder="例如R,U" string="加工面板" <field name="model_processing_panel" placeholder="例如R,U" string="加工面板"

View File

@@ -489,7 +489,7 @@ class Sf_Dashboard_Connect(http.Controller):
# 工单返工数量 # 工单返工数量
plan_data_rework = work_order_obj.search(plan_domain + [ plan_data_rework = work_order_obj.search(work_order_domain + [
('state', 'in', ['rework']) ('state', 'in', ['rework'])
]) ])
@@ -857,7 +857,6 @@ class Sf_Dashboard_Connect(http.Controller):
:param kw: :param kw:
:return: :return:
""" """
request.env['stock.warehouse'].browse(request.env.company.id).pbm_loc_id
# res = {'status': 1, 'message': '成功', 'not_done_data': [], 'done_data': []} # res = {'status': 1, 'message': '成功', 'not_done_data': [], 'done_data': []}
res = {'status': 1, 'message': '成功', 'data': {}} res = {'status': 1, 'message': '成功', 'data': {}}
plan_obj = request.env['sf.production.plan'].sudo() plan_obj = request.env['sf.production.plan'].sudo()

View File

@@ -31,6 +31,7 @@
'wizard/sf_programming_reason_views.xml', 'wizard/sf_programming_reason_views.xml',
'wizard/sale_order_cancel_views.xml', 'wizard/sale_order_cancel_views.xml',
'wizard/process_outsourcing.xml', 'wizard/process_outsourcing.xml',
'wizard/create_technology_design_task_wizard_views.xml',
'views/mrp_views_menus.xml', 'views/mrp_views_menus.xml',
'views/agv_scheduling_views.xml', 'views/agv_scheduling_views.xml',
'views/stock_lot_views.xml', 'views/stock_lot_views.xml',
@@ -48,6 +49,8 @@
'views/mrp_workorder_batch_replan.xml', 'views/mrp_workorder_batch_replan.xml',
'views/purchase_order_view.xml', 'views/purchase_order_view.xml',
'views/product_template_views.xml', 'views/product_template_views.xml',
'views/sf_technology_design_task_views.xml',
'views/sf_technology_design_task_dashboard.xml',
# 'views/stock_warehouse_orderpoint.xml', # 'views/stock_warehouse_orderpoint.xml',
], ],
'assets': { 'assets': {

View File

@@ -36,6 +36,14 @@
<field name="padding">5</field> <field name="padding">5</field>
</record> </record>
<record id="sequence_technology_design_task" model="ir.sequence">
<field name="name">工艺设计任务编码规则</field>
<field name="code">sf.technology.design.task</field>
<field name="prefix">TD/%(year)s%(month)s%(day)s/</field>
<field name="padding">4</field>
<field name="company_id" eval="False"/>
</record>
<record id="stock_location_locations_virtual_outcontract" model="stock.location"> <record id="stock_location_locations_virtual_outcontract" model="stock.location">
<field name="name">外协</field> <field name="name">外协</field>
<field name="location_id" ref="stock.stock_location_locations_virtual"/> <field name="location_id" ref="stock.stock_location_locations_virtual"/>

View File

@@ -18,4 +18,5 @@ from . import quick_easy_order
from . import purchase_order from . import purchase_order
from . import quality_check from . import quality_check
from . import purchase_request_line from . import purchase_request_line
from . import sf_technology_design_task
# from . import stock_warehouse_orderpoint # from . import stock_warehouse_orderpoint

View File

@@ -27,9 +27,11 @@ class ResProductMo(models.Model):
categ_type = fields.Selection(string='产品的类别', related='categ_id.type', store=True) categ_type = fields.Selection(string='产品的类别', related='categ_id.type', store=True)
model_name = fields.Char('模型名称') model_name = fields.Char('模型名称')
blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类') blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类')
blank_precision = fields.Selection([('精坯', '精坯'), ('粗坯', '粗坯')], string='坯料类型')
model_long = fields.Float('模型长(mm)', digits=(16, 3)) model_long = fields.Float('模型长(mm)', digits=(16, 3))
model_width = fields.Float('模型宽(mm)', digits=(16, 3)) model_width = fields.Float('模型宽(mm)', digits=(16, 3))
model_height = fields.Float('模型高(mm)', digits=(16, 3)) model_height = fields.Float('模型高(mm)', digits=(16, 3))
unit_number = fields.Float('单件用量', digits=(16, 3), default=1)
model_volume = fields.Float('模型体积(m³)') model_volume = fields.Float('模型体积(m³)')
model_area = fields.Float('模型表面积(m²)') model_area = fields.Float('模型表面积(m²)')
model_machining_precision = fields.Selection(selection=_get_machining_precision, string='加工精度') model_machining_precision = fields.Selection(selection=_get_machining_precision, string='加工精度')
@@ -901,9 +903,11 @@ class ResProductMo(models.Model):
vals = { vals = {
'name': product_name, 'name': product_name,
'blank_type': item.get('blank_type'), 'blank_type': item.get('blank_type'),
'blank_precision': item.get('blank_precision'),
'model_long': item.get('blank_length') if blank_bool else self.format_float(item['model_long'] + embryo_redundancy_id.long), 'model_long': item.get('blank_length') if blank_bool else self.format_float(item['model_long'] + embryo_redundancy_id.long),
'model_width': item.get('blank_width') if blank_bool else self.format_float(item['model_width'] + embryo_redundancy_id.width), 'model_width': item.get('blank_width') if blank_bool else self.format_float(item['model_width'] + embryo_redundancy_id.width),
'model_height': item.get('blank_height') if blank_bool else self.format_float(item['model_height'] + embryo_redundancy_id.height), 'model_height': item.get('blank_height') if blank_bool else self.format_float(item['model_height'] + embryo_redundancy_id.height),
'unit_number': item.get('unit_number'),
'model_volume': self.format_float(((item['model_long'] + embryo_redundancy_id.long) * 'model_volume': self.format_float(((item['model_long'] + embryo_redundancy_id.long) *
(item['model_width'] + embryo_redundancy_id.width) * (item['model_width'] + embryo_redundancy_id.width) *
(item['model_height'] + embryo_redundancy_id.height))) if not blank_bool else ( (item['model_height'] + embryo_redundancy_id.height))) if not blank_bool else (

View File

@@ -0,0 +1,251 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api, _
from odoo.exceptions import ValidationError
class SfTechnologyDesignTask(models.Model):
_name = 'sf.technology.design.task'
_description = '工艺设计任务'
_order = 'create_date desc'
_inherit = ['mail.thread', 'mail.activity.mixin']
# 基本信息
name = fields.Char('任务编号', required=True, copy=False, readonly=True,
default=lambda self: _('New'))
state = fields.Selection([
('pending', '待工艺设计'),
('in_progress', '进行中'),
('completed', '已完成'),
('cancelled', '已取消'),
], string='状态', default='pending', tracking=True)
# 关联需求计划
demand_plan_id = fields.Many2one('sf.production.demand.plan', string='需求计划', required=True, ondelete='cascade')
# 销售订单信息
sale_order_id = fields.Many2one('sale.order', string='销售订单', compute='_compute_sale_order_info', store=True)
sale_order_line_id = fields.Many2one('sale.order.line', string='销售订单明细', compute='_compute_sale_order_info', store=True)
customer_name = fields.Char('客户名称', compute='_compute_sale_order_info', store=True)
# 产品信息
product_id = fields.Many2one('product.product', string='产品名称', compute='_compute_product_info', store=True)
part_name = fields.Char('零件名称', compute='_compute_product_info', store=True)
part_number = fields.Char('零件图号', compute='_compute_product_info', store=True)
model_id = fields.Char('模型ID', compute='_compute_product_info', store=True)
# 产品类型和文件
product_type = fields.Selection([
('standard', '标准件'),
('custom', '定制件'),
('prototype', '样件'),
], string='零件类型', default='custom', store=True)
model_file = fields.Binary('模型文件', compute='_compute_model_info', store=True)
model_filename = fields.Char('模型文件名', compute='_compute_model_info', store=True)
# 材料信息
materials_id = fields.Many2one('sf.production.materials', string='材料及型号', compute='_compute_material_info', store=True)
blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类', compute='_compute_material_info', store=True)
blank_precision = fields.Selection([('精坯', '精坯'), ('粗坯', '粗坯')], string='坯料类型', compute='_compute_material_info', store=True)
embryo_long = fields.Char('坯料尺寸', compute='_compute_embryo_long', store=True)
# 加工信息
machining_precision = fields.Selection([
('0.10', '±0.10mm'),
('0.05', '±0.05mm'),
('0.03', '±0.03mm'),
('0.02', '±0.02mm'),
('0.01', '±0.01mm')
], string='加工精度', compute='_compute_machining_info', store=True)
machining_panel = fields.Char('加工面', compute='_compute_machining_info', store=True)
# 订单信息
product_uom_qty = fields.Float('订单数量', compute='_compute_order_info', store=True)
is_incoming_material = fields.Boolean('客供料', compute='_compute_order_info', store=True)
# 工艺参数
clamping_times = fields.Integer('装夹次数', default=1)
single_clamping_duration = fields.Float('单次装夹时长(分钟)', default=30.0)
cnc_processing_duration = fields.Float('CNC加工时长(分钟)', default=0.0)
# 质量要求
customer_quality_requirements = fields.Text('客户质量要求')
processing_drawing_2d = fields.Binary('2D加工图纸')
processing_drawing_filename = fields.Char('2D图纸文件名')
# 时间信息
create_date = fields.Datetime('创建时间', default=fields.Datetime.now)
start_date = fields.Datetime('开始时间')
complete_date = fields.Datetime('完成时间')
deadline = fields.Datetime('截止时间')
# 负责人
assigned_to = fields.Many2one('res.users', string='负责人', tracking=True)
created_by = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user, readonly=True)
# 备注
notes = fields.Text('备注')
@api.depends('demand_plan_id')
def _compute_sale_order_info(self):
for record in self:
if record.demand_plan_id:
record.sale_order_id = record.demand_plan_id.sale_order_id
record.sale_order_line_id = record.demand_plan_id.sale_order_line_id
record.customer_name = record.demand_plan_id.customer_name
else:
record.sale_order_id = False
record.sale_order_line_id = False
record.customer_name = ""
@api.depends('demand_plan_id')
def _compute_product_info(self):
for record in self:
if record.demand_plan_id and record.demand_plan_id.product_id:
record.product_id = record.demand_plan_id.product_id
if record.product_id.product_tmpl_id:
record.part_name = record.product_id.product_tmpl_id.part_name
record.part_number = record.product_id.product_tmpl_id.part_number
record.model_id = record.product_id.product_tmpl_id.model_id
else:
record.part_name = ""
record.part_number = ""
record.model_id = ""
else:
record.product_id = False
record.part_name = ""
record.part_number = ""
record.model_id = ""
@api.depends('product_id')
def _compute_model_info(self):
for record in self:
if record.product_id and record.product_id.product_tmpl_id:
template = record.product_id.product_tmpl_id
record.model_file = template.model_file
record.model_filename = template.model_name
else:
record.model_file = False
record.model_filename = ""
@api.depends('product_id')
def _compute_material_info(self):
for record in self:
if record.product_id and record.product_id.product_tmpl_id:
template = record.product_id.product_tmpl_id
record.materials_id = template.materials_id
record.blank_type = template.blank_type
record.blank_precision = template.blank_precision
else:
record.materials_id = False
record.blank_type = False
record.blank_precision = False
@api.depends('product_id')
def _compute_machining_info(self):
for record in self:
if record.product_id and record.product_id.product_tmpl_id:
template = record.product_id.product_tmpl_id
record.machining_precision = template.model_machining_precision
record.machining_panel = template.model_processing_panel
else:
record.machining_precision = False
record.machining_panel = ""
@api.depends('demand_plan_id')
def _compute_order_info(self):
for record in self:
if record.demand_plan_id:
record.product_uom_qty = record.demand_plan_id.product_uom_qty
record.is_incoming_material = record.demand_plan_id.is_incoming_material
else:
record.product_uom_qty = 0.0
record.is_incoming_material = False
@api.depends('product_id')
def _compute_embryo_long(self):
for record in self:
if record.product_id and record.product_id.product_tmpl_id:
template = record.product_id.product_tmpl_id
record.embryo_long = f"{template.model_long}×{template.model_width}×{template.model_height}"
else:
record.embryo_long = ""
@api.model
def create(self, vals):
if vals.get('name', _('New')) == _('New'):
vals['name'] = self.env['ir.sequence'].next_by_code('sf.technology.design.task') or _('New')
return super(SfTechnologyDesignTask, self).create(vals)
def action_start_design(self):
"""开始工艺设计"""
self.ensure_one()
if self.state != 'pending':
raise ValidationError(_('只有待工艺设计的任务才能开始设计'))
self.write({
'state': 'in_progress',
'start_date': fields.Datetime.now(),
})
self.message_post(body=_('工艺设计任务已开始'))
def action_complete_design(self):
"""完成工艺设计"""
self.ensure_one()
if self.state != 'in_progress':
raise ValidationError(_('只有进行中的任务才能完成'))
self.write({
'state': 'completed',
'complete_date': fields.Datetime.now(),
})
self.message_post(body=_('工艺设计任务已完成'))
def action_cancel_task(self):
"""取消任务"""
self.ensure_one()
if self.state in ['completed']:
raise ValidationError(_('已完成的任务不能取消'))
self.write({
'state': 'cancelled',
})
self.message_post(body=_('工艺设计任务已取消'))
def action_reset_to_pending(self):
"""重置为待工艺设计"""
self.ensure_one()
if self.state not in ['in_progress', 'cancelled']:
raise ValidationError(_('只有进行中或已取消的任务才能重置'))
self.write({
'state': 'pending',
'start_date': False,
'complete_date': False,
})
self.message_post(body=_('工艺设计任务已重置为待设计状态'))
@api.model
def create_from_demand_plan(self, demand_plan_ids):
"""从需求计划创建工艺设计任务"""
tasks = self.env['sf.technology.design.task']
for demand_plan in demand_plan_ids:
# 检查是否已存在工艺设计任务
existing_task = self.search([
('demand_plan_id', '=', demand_plan.id),
('state', 'not in', ['cancelled'])
], limit=1)
if not existing_task:
task_vals = {
'demand_plan_id': demand_plan.id,
'deadline': fields.Datetime.now() + fields.timedelta(days=3), # 默认3天期限
}
task = self.create(task_vals)
tasks |= task
return tasks
def get_task_count_by_state(self):
"""获取各状态的任务数量"""
return {
'pending': self.search_count([('state', '=', 'pending')]),
'in_progress': self.search_count([('state', '=', 'in_progress')]),
'completed': self.search_count([('state', '=', 'completed')]),
'cancelled': self.search_count([('state', '=', 'cancelled')]),
}

View File

@@ -196,3 +196,9 @@ access_sf_sale_order_cancel_wizard,sf_sale_order_cancel_wizard,model_sf_sale_ord
access_sf_sale_order_cancel_line,sf_sale_order_cancel_line,model_sf_sale_order_cancel_line,sf_base.group_sf_order_user,1,0,1,1 access_sf_sale_order_cancel_line,sf_sale_order_cancel_line,model_sf_sale_order_cancel_line,sf_base.group_sf_order_user,1,0,1,1
access_product_creation_wizard,product_creation_wizard,model_product_creation_wizard,base.group_user,1,1,1,0 access_product_creation_wizard,product_creation_wizard,model_product_creation_wizard,base.group_user,1,1,1,0
access_sf_technology_design_task_group_sf_mrp_user,sf_technology_design_task_group_sf_mrp_user,model_sf_technology_design_task,sf_base.group_sf_mrp_user,1,1,1,0
access_sf_technology_design_task_group_sf_mrp_manager,sf_technology_design_task_group_sf_mrp_manager,model_sf_technology_design_task,sf_base.group_sf_mrp_manager,1,1,1,1
access_sf_technology_design_task_group_plan_dispatch,sf_technology_design_task_group_plan_dispatch,model_sf_technology_design_task,sf_base.group_plan_dispatch,1,1,1,0
access_sf_technology_design_task_group_production_engineer,sf_technology_design_task_group_production_engineer,model_sf_technology_design_task,sf_base.group_production_engineer,1,1,1,0
access_sf_create_technology_design_task_wizard_group_sf_mrp_user,sf_create_technology_design_task_wizard_group_sf_mrp_user,model_sf_create_technology_design_task_wizard,sf_base.group_sf_mrp_user,1,1,1,0
access_sf_create_technology_design_task_wizard_group_sf_mrp_manager,sf_create_technology_design_task_wizard_group_sf_mrp_manager,model_sf_create_technology_design_task_wizard,sf_base.group_sf_mrp_manager,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
196
197
198
199
200
201
202
203
204

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- 工艺设计任务仪表板视图 -->
<record id="view_sf_technology_design_task_dashboard" model="ir.ui.view">
<field name="name">sf.technology.design.task.dashboard</field>
<field name="model">sf.technology.design.task</field>
<field name="arch" type="xml">
<kanban class="o_kanban_small_column" default_group_by="state">
<field name="name"/>
<field name="state"/>
<field name="product_id"/>
<field name="part_name"/>
<field name="assigned_to"/>
<field name="deadline"/>
<field name="create_date"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
</strong>
</div>
</div>
<div class="o_kanban_record_body">
<div class="o_kanban_primary_left">
<field name="product_id"/>
</div>
<div class="o_kanban_primary_right">
<field name="part_name"/>
</div>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<field name="assigned_to"/>
</div>
<div class="oe_kanban_bottom_right">
<field name="deadline"/>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- 工艺设计任务仪表板动作 -->
<record id="action_sf_technology_design_task_dashboard" model="ir.actions.act_window">
<field name="name">工艺设计任务仪表板</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.technology.design.task</field>
<field name="view_mode">kanban</field>
<field name="view_id" ref="view_sf_technology_design_task_dashboard"/>
<field name="context">{'search_default_filter_pending': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
创建第一个工艺设计任务
</p>
<p>
工艺设计任务用于管理产品工艺设计流程,包括从需求计划到工艺完成的整个过程。
</p>
</field>
</record>
<!-- 工艺设计任务仪表板菜单 -->
<menuitem id="menu_sf_technology_design_task_dashboard"
name="工艺设计仪表板"
sequence="15"
action="action_sf_technology_design_task_dashboard"
parent="mrp.menu_mrp_manufacturing"/>
</odoo>

View File

@@ -0,0 +1,280 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- 工艺设计任务列表视图 -->
<record id="view_sf_technology_design_task_tree" model="ir.ui.view">
<field name="name">sf.technology.design.task.tree</field>
<field name="model">sf.technology.design.task</field>
<field name="arch" type="xml">
<tree string="工艺设计任务" default_order="create_date desc"
class="technology_design_task_tree freeze-columns-before-part_number">
<header>
<button string="开始设计" name="action_start_design" type="object"
class="btn-primary" attrs="{'invisible': [('state', '!=', 'pending')]}"/>
<button string="完成设计" name="action_complete_design" type="object"
class="btn-success" attrs="{'invisible': [('state', '!=', 'in_progress')]}"/>
<button string="取消任务" name="action_cancel_task" type="object"
class="btn-secondary" attrs="{'invisible': [('state', 'in', ['completed'])]}"/>
<button string="重置任务" name="action_reset_to_pending" type="object"
class="btn-warning" attrs="{'invisible': [('state', 'not in', ['in_progress', 'cancelled'])]}"/>
</header>
<!-- 主要字段 -->
<field name="name" string="任务编号"/>
<field name="state" widget="badge"
decoration-success="state == 'completed'"
decoration-warning="state == 'in_progress'"
decoration-danger="state == 'cancelled'"/>
<field name="sale_order_id" string="销售单号"/>
<field name="product_id" string="产品名称"/>
<field name="part_name" string="零件名称"/>
<field name="part_number" string="零件图号"/>
<field name="product_type" string="零件类型"/>
<field name="model_id" string="模型ID" optional="hide"/>
<field name="model_filename" string="模型文件" optional="hide"/>
<field name="materials_id" string="材料及型号"/>
<field name="blank_type" string="坯料分类" optional="hide"/>
<field name="blank_precision" string="坯料类型" optional="hide"/>
<field name="embryo_long" string="坯料尺寸" optional="hide"/>
<field name="machining_precision" string="加工精度" optional="hide"/>
<field name="machining_panel" string="加工面" optional="hide"/>
<field name="product_uom_qty" string="订单数量"/>
<field name="is_incoming_material" string="客供料"/>
<field name="clamping_times" string="装夹次数" optional="hide"/>
<field name="single_clamping_duration" string="单次装夹时长" optional="hide"/>
<field name="cnc_processing_duration" string="CNC加工时长" optional="hide"/>
<field name="customer_quality_requirements" string="客户质量要求" optional="hide"/>
<field name="processing_drawing_filename" string="2D加工图纸" optional="hide"/>
<field name="customer_name" string="客户名称" optional="hide"/>
<!-- 时间字段 -->
<field name="create_date" string="创建时间" optional="hide"/>
<field name="start_date" string="开始时间" optional="hide"/>
<field name="complete_date" string="完成时间" optional="hide"/>
<field name="deadline" string="截止时间" optional="hide"/>
<!-- 负责人字段 -->
<field name="assigned_to" string="负责人" optional="hide"/>
<field name="created_by" string="创建人" optional="hide"/>
<!-- 备注 -->
<field name="notes" string="备注" optional="hide"/>
</tree>
</field>
</record>
<!-- 工艺设计任务搜索视图 -->
<record id="view_sf_technology_design_task_search" model="ir.ui.view">
<field name="name">sf.technology.design.task.search</field>
<field name="model">sf.technology.design.task</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="sale_order_id"/>
<field name="product_id"/>
<field name="part_name"/>
<field name="part_number"/>
<field name="customer_name"/>
<field name="materials_id"/>
<field name="assigned_to"/>
<field name="created_by"/>
<filter name="filter_pending" string="待工艺设计" domain="[('state', '=', 'pending')]"/>
<filter name="filter_in_progress" string="进行中" domain="[('state', '=', 'in_progress')]"/>
<filter name="filter_completed" string="已完成" domain="[('state', '=', 'completed')]"/>
<filter name="filter_cancelled" string="已取消" domain="[('state', '=', 'cancelled')]"/>
<separator/>
<filter name="filter_my_tasks" string="我的任务" domain="[('assigned_to', '=', uid)]"/>
<filter name="filter_overdue" string="已逾期" domain="[('deadline', '&lt;', context_today()), ('state', 'not in', ['completed', 'cancelled'])]"/>
<group expand="0" string="Group By">
<filter name="group_by_state" string="状态" domain="[]" context="{'group_by': 'state'}"/>
<filter name="group_by_sale_order" string="销售单号" domain="[]" context="{'group_by': 'sale_order_id'}"/>
<filter name="group_by_product" string="产品" domain="[]" context="{'group_by': 'product_id'}"/>
<filter name="group_by_customer" string="客户" domain="[]" context="{'group_by': 'customer_name'}"/>
<filter name="group_by_assigned_to" string="负责人" domain="[]" context="{'group_by': 'assigned_to'}"/>
<filter name="group_by_created_by" string="创建人" domain="[]" context="{'group_by': 'created_by'}"/>
<filter name="group_by_create_date" string="创建日期" domain="[]" context="{'group_by': 'create_date:day'}"/>
<filter name="group_by_deadline" string="截止日期" domain="[]" context="{'group_by': 'deadline:day'}"/>
</group>
</search>
</field>
</record>
<!-- 工艺设计任务表单视图 -->
<record id="view_sf_technology_design_task_form" model="ir.ui.view">
<field name="name">sf.technology.design.task.form</field>
<field name="model">sf.technology.design.task</field>
<field name="arch" type="xml">
<form string="工艺设计任务">
<header>
<button name="action_start_design" string="开始设计" type="object"
class="btn-primary" attrs="{'invisible': [('state', '!=', 'pending')]}"/>
<button name="action_complete_design" string="完成设计" type="object"
class="btn-success" attrs="{'invisible': [('state', '!=', 'in_progress')]}"/>
<button name="action_cancel_task" string="取消任务" type="object"
class="btn-secondary" attrs="{'invisible': [('state', 'in', ['completed'])]}"/>
<button name="action_reset_to_pending" string="重置任务" type="object"
class="btn-warning" attrs="{'invisible': [('state', 'not in', ['in_progress', 'cancelled'])]}"/>
<field name="state" widget="statusbar"
statusbar_visible="pending,in_progress,completed"/>
</header>
<sheet>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group string="基本信息">
<field name="demand_plan_id"/>
<field name="sale_order_id"/>
<field name="customer_name"/>
<field name="assigned_to"/>
<field name="created_by"/>
</group>
<group string="时间信息">
<field name="create_date"/>
<field name="start_date"/>
<field name="complete_date"/>
<field name="deadline"/>
</group>
</group>
<notebook>
<page string="产品信息">
<group>
<group string="产品详情">
<field name="product_id"/>
<field name="part_name"/>
<field name="part_number"/>
<field name="product_type"/>
<field name="model_id"/>
<field name="model_file" filename="model_filename"/>
<field name="model_filename" invisible="1"/>
</group>
<group string="材料信息">
<field name="materials_id"/>
<field name="blank_type"/>
<field name="blank_precision"/>
<field name="embryo_long"/>
</group>
</group>
</page>
<page string="加工信息">
<group>
<group string="加工参数">
<field name="machining_precision"/>
<field name="machining_panel"/>
<field name="product_uom_qty"/>
<field name="is_incoming_material"/>
</group>
<group string="工艺参数">
<field name="clamping_times"/>
<field name="single_clamping_duration"/>
<field name="cnc_processing_duration"/>
</group>
</group>
</page>
<page string="质量要求">
<group>
<field name="customer_quality_requirements" nolabel="1"/>
</group>
<group string="图纸文件">
<field name="processing_drawing_2d" filename="processing_drawing_filename"/>
<field name="processing_drawing_filename" invisible="1"/>
</group>
</page>
<page string="备注">
<field name="notes" nolabel="1"/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<!-- 工艺设计任务动作 -->
<record id="action_sf_technology_design_task" model="ir.actions.act_window">
<field name="name">工艺设计任务</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.technology.design.task</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_filter_pending': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
创建第一个工艺设计任务
</p>
<p>
工艺设计任务用于管理产品工艺设计流程,包括从需求计划到工艺完成的整个过程。
</p>
</field>
</record>
<!-- 工艺设计任务菜单 -->
<menuitem id="menu_sf_technology_design_task"
name="工艺设计任务"
sequence="20"
action="action_sf_technology_design_task"
parent="mrp.menu_mrp_manufacturing"/>
<!-- 工艺设计任务看板视图 -->
<record id="view_sf_technology_design_task_kanban" model="ir.ui.view">
<field name="name">sf.technology.design.task.kanban</field>
<field name="model">sf.technology.design.task</field>
<field name="arch" type="xml">
<kanban class="o_kanban_small_column" default_group_by="state">
<field name="name"/>
<field name="state"/>
<field name="product_id"/>
<field name="part_name"/>
<field name="assigned_to"/>
<field name="deadline"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="name"/>
</strong>
</div>
</div>
<div class="o_kanban_record_body">
<div class="o_kanban_primary_left">
<field name="product_id"/>
</div>
<div class="o_kanban_primary_right">
<field name="part_name"/>
</div>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<field name="assigned_to"/>
</div>
<div class="oe_kanban_bottom_right">
<field name="deadline"/>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
</odoo>

View File

@@ -7,3 +7,4 @@ from . import mrp_workorder_batch_replan_wizard
from . import sf_programming_reason from . import sf_programming_reason
from . import sale_order_cancel from . import sale_order_cancel
from . import process_outsourcing from . import process_outsourcing
from . import create_technology_design_task_wizard

View File

@@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api, _
from odoo.exceptions import UserError
class CreateTechnologyDesignTaskWizard(models.TransientModel):
_name = 'sf.create.technology.design.task.wizard'
_description = '创建工艺设计任务向导'
demand_plan_ids = fields.Many2many('sf.production.demand.plan', string='需求计划', required=True)
assigned_to = fields.Many2one('res.users', string='负责人', default=lambda self: self.env.user)
deadline = fields.Datetime('截止时间', required=True)
notes = fields.Text('备注')
@api.model
def default_get(self, fields_list):
res = super(CreateTechnologyDesignTaskWizard, self).default_get(fields_list)
if self.env.context.get('active_model') == 'sf.production.demand.plan':
demand_plan_ids = self.env.context.get('active_ids', [])
res['demand_plan_ids'] = [(6, 0, demand_plan_ids)]
return res
def action_create_tasks(self):
"""创建工艺设计任务"""
if not self.demand_plan_ids:
raise UserError(_('请选择需求计划'))
# 检查是否已存在工艺设计任务
existing_tasks = self.env['sf.technology.design.task'].search([
('demand_plan_id', 'in', self.demand_plan_ids.ids),
('state', 'not in', ['cancelled'])
])
if existing_tasks:
raise UserError(_('以下需求计划已存在工艺设计任务:\n%s') %
'\n'.join([task.demand_plan_id.name for task in existing_tasks]))
# 创建工艺设计任务
tasks = self.env['sf.technology.design.task']
for demand_plan in self.demand_plan_ids:
task_vals = {
'demand_plan_id': demand_plan.id,
'assigned_to': self.assigned_to.id,
'deadline': self.deadline,
'notes': self.notes,
}
task = self.env['sf.technology.design.task'].create(task_vals)
tasks |= task
# 返回工艺设计任务列表视图
return {
'type': 'ir.actions.act_window',
'name': _('工艺设计任务'),
'res_model': 'sf.technology.design.task',
'view_mode': 'tree,form',
'domain': [('id', 'in', tasks.ids)],
'context': {'search_default_filter_pending': 1},
}

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_create_technology_design_task_wizard_form" model="ir.ui.view">
<field name="name">sf.create.technology.design.task.wizard.form</field>
<field name="model">sf.create.technology.design.task.wizard</field>
<field name="arch" type="xml">
<form string="创建工艺设计任务">
<group>
<field name="demand_plan_ids" widget="many2many_tags"/>
<field name="assigned_to"/>
<field name="deadline"/>
<field name="notes"/>
</group>
<footer>
<button name="action_create_tasks" string="创建任务" type="object" class="btn-primary"/>
<button string="取消" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="action_create_technology_design_task_wizard" model="ir.actions.act_window">
<field name="name">创建工艺设计任务</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sf.create.technology.design.task.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>