diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js index 3b0799cc..5845dbae 100644 --- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js @@ -31,7 +31,7 @@ export class MyCustomWidget extends Many2ManyCheckboxesField { } } -MyCustomWidget.template = "sf_plan.MyCustomWidget" +MyCustomWidget.template = "jikimo_frontend.MyCustomWidget" // MyCustomWidget.supportedTypes = ['many2many']; registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget); diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml index dedcfb11..bebae03b 100644 --- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml @@ -1,7 +1,7 @@ - +
diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py index 623e5e21..f2d2ac15 100644 --- a/sf_plan/models/custom_plan.py +++ b/sf_plan/models/custom_plan.py @@ -12,25 +12,46 @@ class sf_production_plan(models.Model): # _inherit = 'mrp.production' _description = 'sf_production_plan' - name = fields.Char(string='名称') + state = fields.Selection([ + ('draft', '待排程'), + ('done', '已排程'), + ('processing', '已加工'), + ('finished', '已完成') + ], string='工单状态', tracking=True) + name = fields.Char(string='工单编号') # selected = fields.Boolean(default=False) + order_number = fields.Char(string='订单号') + order_deadline = fields.Datetime(string='订单交期') production_id = fields.Many2one('mrp.production', '关联制造订单') product_qty = fields.Float(string='数量', digits='Product Unit of Measure', required=True, default=0.0) + production_line_id = fields.Many2one('sf.production.line', string='生产线') date_planned_start = fields.Datetime(string='计划开始时间', required=True, index=True, copy=False, default=fields.Datetime.now) date_planned_finished = fields.Datetime(string='计划结束时间') - state = fields.Selection([ - ('draft', '未排程'), ('done', '已排程')], string='状态', copy=False, index=True, readonly=True, - store=True, tracking=True) + # 排程设置selection(倒排,顺排,默认倒排) + schedule_setting = fields.Selection([ + ('reverse', '倒排'), ('positive', '顺排')], string='排程设置', default='reverse') product_id = fields.Many2one('product.product', '关联产品') origin = fields.Char(string='来源') + # 加工时长 + process_time = fields.Float(string='加工时长', digits=(16, 2)) + # 实际加工时长、实际开始时间、实际结束时间 + actual_process_time = fields.Float(string='实际加工时长', digits=(16, 2)) + actual_start_time = fields.Datetime(string='实际开始时间') + actual_end_time = fields.Datetime(string='实际结束时间') + shift = fields.Char(string='班次') + # 序号、坯料编号、坯料名称、材质、数量、长度、宽度、厚度、直径、计划开始时间、计划结束时间、状态(已产出与待产出)、操作、创建人、创建时间、客户名称、订单号、行号、长度、宽度、厚度、直径、交货数量、交货日期 # sequence = fields.Integer(string='序号', required=True, copy=False, readonly=True, index=True, # default=lambda self: self.env['ir.sequence'].sudo().next_by_code('sf.pl.plan')) sequence = fields.Integer(string='序号', copy=False, readonly=True, index=True) current_operation_name = fields.Char(string='当前工序名称', size=64, default='生产计划') - production_line_id = fields.Many2one('sf.production.line', string='生产线') + + + + + # state = fields.Selection([ # ('未排程', '未排程'), ('已排程', '已排程')], string='State', copy=False, index=True, readonly=True, diff --git a/sf_plan/views/view.xml b/sf_plan/views/view.xml index 1f35b088..04751d0c 100644 --- a/sf_plan/views/view.xml +++ b/sf_plan/views/view.xml @@ -9,11 +9,15 @@ + + + + - +
- + + + + + + + + - + @@ -115,8 +127,11 @@ color="production_line_id" decoration-success="state == 'done'" progress_bar="name" - form_view_id="sf_production_plan_form"> - + form_view_id="sf_production_plan_form" + default_scale="year" + scales="day,week,month,year" + precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}"> +