Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug
This commit is contained in:
@@ -161,7 +161,7 @@ td.o_required_modifier {
|
|||||||
.o_list_view .o_list_table thead {
|
.o_list_view .o_list_table thead {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 100000;
|
//z-index: 100000;
|
||||||
}
|
}
|
||||||
|
|
||||||
//.o_list_view .o_list_table {
|
//.o_list_view .o_list_table {
|
||||||
@@ -174,7 +174,7 @@ td.o_required_modifier {
|
|||||||
.o_form_view.o_xxl_form_view .o_form_sheet_bg > .o_form_statusbar {
|
.o_form_view.o_xxl_form_view .o_form_sheet_bg > .o_form_statusbar {
|
||||||
position: sticky !important;
|
position: sticky !important;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 100000;
|
//z-index: 100000;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
@@ -264,25 +264,27 @@ div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .
|
|||||||
}
|
}
|
||||||
|
|
||||||
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||||
|
|
||||||
left: -95px;
|
left: -95px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom {
|
//.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom {
|
||||||
// display: flex !important;
|
// display: flex !important;
|
||||||
// flex-direction: column;
|
// flex-direction: column;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom>div:nth-child(1)>span:nth-child(1) {
|
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom > div:nth-child(1) > span:nth-child(1) {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom>div:nth-child(1) {
|
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom > div:nth-child(1) {
|
||||||
margin-top: -5px;
|
margin-top: -5px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-bg-warning {
|
.text-bg-warning {
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
],
|
],
|
||||||
'assets': {
|
'assets': {
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
'sf_machine_connect/static/src/xml/barcode_button.xml',
|
# 'sf_machine_connect/static/src/xml/barcode_button.xml',
|
||||||
'sf_machine_connect/static/src/js/barcode_button.js',
|
# 'sf_machine_connect/static/src/js/barcode_button.js',
|
||||||
'sf_machine_connect/static/src/css/barcode_button.css',
|
# 'sf_machine_connect/static/src/css/barcode_button.css',
|
||||||
],
|
],
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
'depends': ['sf_manufacturing'],
|
'depends': ['sf_manufacturing'],
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'views/view.xml'
|
'views/view.xml',
|
||||||
|
# 'views/duration_view.xml'
|
||||||
],
|
],
|
||||||
|
|
||||||
'assets': {
|
'assets': {
|
||||||
|
|||||||
@@ -2,3 +2,4 @@
|
|||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
from . import custom_plan
|
from . import custom_plan
|
||||||
|
# from . import duration
|
||||||
|
|||||||
25
sf_plan/models/duration.py
Normal file
25
sf_plan/models/duration.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import base64
|
||||||
|
import json, requests
|
||||||
|
from odoo import models, fields, api, _
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from odoo.exceptions import UserError, ValidationError
|
||||||
|
|
||||||
|
|
||||||
|
class HoleDuration(models.Model):
|
||||||
|
_name = 'hole.duration'
|
||||||
|
_description = 'Hole Duration'
|
||||||
|
|
||||||
|
hole_diameter = fields.Selection([('3', '≤¢3'), ('6', '≤¢6'), ('10', '≤¢10'), ('12', '≤¢12'), ('16', '≤¢16'), ('25', '≤¢25')], string='孔径', required=True)
|
||||||
|
name = fields.Char(string='名称', required=True, default='钻孔')
|
||||||
|
hole_depth = fields.Selection([
|
||||||
|
('10', '≤10'),
|
||||||
|
('30', '≤30'),
|
||||||
|
('50', '≤50'),
|
||||||
|
('70', '≤70'),
|
||||||
|
('90', '≤90'),
|
||||||
|
('100', '≤100'),
|
||||||
|
('120', '≤120'),
|
||||||
|
('150', '≤150')], string='深度', required=True)
|
||||||
|
working_hours = fields.Float(string='工时', required=True)
|
||||||
|
hole_expansion = fields.Float(string='扩孔', required=True, default=0.6)
|
||||||
52
sf_plan/views/duration_view.xml
Normal file
52
sf_plan/views/duration_view.xml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="hole_duration_tree" model="ir.ui.view">
|
||||||
|
<field name="name">hole.duration.tree</field>
|
||||||
|
<field name="model">hole.duration</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="孔加工">
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="hole_diameter"/>
|
||||||
|
<field name="hole_depth"/>
|
||||||
|
<field name="working_hours"/>
|
||||||
|
<field name="hole_expansion"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="hole_duration_form" model="ir.ui.view">
|
||||||
|
<field name="name">hole.duration.form</field>
|
||||||
|
<field name="model">hole.duration</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="孔加工">
|
||||||
|
<sheet>
|
||||||
|
<group>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="hole_diameter"/>
|
||||||
|
<field name="hole_depth"/>
|
||||||
|
<field name="working_hours"/>
|
||||||
|
<field name="hole_expansion"/>
|
||||||
|
</group>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="hole_duration_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">孔加工</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">hole.duration</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem
|
||||||
|
id="hole_duration_menu"
|
||||||
|
name="孔加工"
|
||||||
|
sequence="900"
|
||||||
|
action="hole_duration_action"
|
||||||
|
parent="sf_production_plan_menu"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
decoration-success="state == 'done'"
|
decoration-success="state == 'done'"
|
||||||
progress_bar="name"
|
progress_bar="name"
|
||||||
form_view_id="sf_production_plan_form"
|
form_view_id="sf_production_plan_form"
|
||||||
default_scale="week"
|
default_scale="day"
|
||||||
scales="day,week,month,year"
|
scales="day,week,month,year"
|
||||||
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}">
|
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}">
|
||||||
<field name="shift"/>
|
<field name="shift"/>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -8,48 +8,42 @@ class ProcedureEquipmentResourceSetting(models.Model):
|
|||||||
|
|
||||||
name = fields.Many2one('sf.production.line', string='生产线', required=True)
|
name = fields.Many2one('sf.production.line', string='生产线', required=True)
|
||||||
work_center_name_id = fields.Many2one('mrp.workcenter', string='工作中心名称')
|
work_center_name_id = fields.Many2one('mrp.workcenter', string='工作中心名称')
|
||||||
equipment_code = fields.Char(string='机台号', readonly=True, compute='_onchange_equipment_name_id')
|
equipment_name_id = fields.Many2one('maintenance.equipment', string='设备名称', readonly=True, search=True,
|
||||||
equipment_name_id = fields.Many2one('maintenance.equipment',
|
compute='_compute_equipment_name_id')
|
||||||
string='设备名称',
|
equipment_code = fields.Char(string='机台号', readonly=True, related='equipment_name_id.code')
|
||||||
readonly=True,
|
brand_id = fields.Many2one('sf.machine.brand', string='品牌', readonly=True, related='equipment_name_id.brand_id')
|
||||||
compute='_onchange_work_center_name_id')
|
type_id = fields.Many2one('sf.machine_tool.type', string='型号', readonly=True, related='equipment_name_id.type_id')
|
||||||
brand = fields.Char(string='品牌', readonly=True, compute='_onchange_equipment_name_id')
|
status = fields.Selection(string='设备状态', readonly=True, related='equipment_name_id.state')
|
||||||
model = fields.Char(string='型号', readonly=True, compute='_onchange_equipment_name_id')
|
|
||||||
# todo 传入工序数据
|
# todo 传入工序数据
|
||||||
working_procedure = fields.Char(string='工序', readonly=True)
|
working_procedure = fields.Char(string='工序', readonly=True)
|
||||||
production_capacity = fields.Float(string='产能', required=True, digits=(4, 1))
|
production_capacity = fields.Float(string='产能', required=True, digits=(4, 1))
|
||||||
working_calendar_id = fields.Many2one('sf.work.log.setting', string='工作日历')
|
working_calendar_id = fields.Many2one('sf.work.log.setting', string='工作日历')
|
||||||
working_shift_id = fields.Many2many('sf.working.shift', string='班次', readonly=True, compute='_onchange_working_calendar_id')
|
working_shift_id = fields.Many2many('sf.working.shift', string='班次', readonly=True,
|
||||||
|
compute='_compute_working_shift_id')
|
||||||
create_time = fields.Datetime(string='新增时间', default=lambda self: fields.Datetime.now(), readonly=True)
|
create_time = fields.Datetime(string='新增时间', default=lambda self: fields.Datetime.now(), readonly=True)
|
||||||
status = fields.Selection([('正常', '正常'), ('1', '故障停机'), ('2', '计划停机')],
|
|
||||||
string='设备状态',
|
|
||||||
readonly=True,
|
|
||||||
compute='_onchange_equipment_name_id')
|
|
||||||
participate_in_scheduling = fields.Boolean(string='参与排程', default=True)
|
participate_in_scheduling = fields.Boolean(string='参与排程', default=True)
|
||||||
|
|
||||||
@api.onchange('production_capacity')
|
@api.depends('work_center_name_id')
|
||||||
def _onchange_production_capacity(self):
|
def _compute_equipment_name_id(self):
|
||||||
|
for record in self:
|
||||||
|
if record.work_center_name_id:
|
||||||
|
record.equipment_name_id = record.work_center_name_id.equipment_id
|
||||||
|
else:
|
||||||
|
record.equipment_name_id = None
|
||||||
|
|
||||||
|
@api.constrains('production_capacity')
|
||||||
|
def _check_production_capacity(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.production_capacity < 0:
|
if record.production_capacity < 0:
|
||||||
raise UserError("输入的产能值不正确,请重新输入!")
|
raise UserError("产能不能为负!")
|
||||||
|
|
||||||
@api.depends('work_center_name_id')
|
|
||||||
def _onchange_work_center_name_id(self):
|
|
||||||
for record in self:
|
|
||||||
record.equipment_name_id = record.work_center_name_id.equipment_id
|
|
||||||
|
|
||||||
@api.onchange('equipment_name_id')
|
|
||||||
def _onchange_equipment_name_id(self):
|
|
||||||
for record in self:
|
|
||||||
record.equipment_code = record.equipment_name_id.code
|
|
||||||
record.brand = record.equipment_name_id.brand_id.name
|
|
||||||
record.model = record.equipment_name_id.type_id.name
|
|
||||||
record.status = record.equipment_name_id.state
|
|
||||||
|
|
||||||
@api.depends('working_calendar_id')
|
@api.depends('working_calendar_id')
|
||||||
def _onchange_working_calendar_id(self):
|
def _compute_working_shift_id(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.working_shift_id = record.working_calendar_id.working_shift_ids
|
if record.working_calendar_id:
|
||||||
|
record.working_shift_id = record.working_calendar_id.working_shift_ids
|
||||||
|
else:
|
||||||
|
record.working_shift_id = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ class WorkScheduleCalendar(models.Model):
|
|||||||
name = fields.Selection([('休息日', '休息日'), ('计划停机', '计划停机'), ('工作日', '工作日')], '日历事件名称')
|
name = fields.Selection([('休息日', '休息日'), ('计划停机', '计划停机'), ('工作日', '工作日')], '日历事件名称')
|
||||||
date_time = fields.Date('休息时间')
|
date_time = fields.Date('休息时间')
|
||||||
name_id = fields.Many2one('sf.work.log.setting', '工作日历名称')
|
name_id = fields.Many2one('sf.work.log.setting', '工作日历名称')
|
||||||
calendar_code = fields.Char('工作日历编码', readonly=True, compute='_compute_name_id')
|
calendar_code = fields.Char('工作日历编码', readonly=True, compute='_compute_calendar_code')
|
||||||
|
|
||||||
day_off_id = fields.Many2many('sf.day.off', string='休息日')
|
day_off_id = fields.Many2many('sf.day.off', string='休息日')
|
||||||
scheduled_outage = fields.Char('计划停机')
|
scheduled_outage = fields.Char('计划停机')
|
||||||
@@ -266,7 +266,7 @@ class WorkScheduleCalendar(models.Model):
|
|||||||
annual_planned_downtime = fields.Char('年计划停机时长', readonly=True)
|
annual_planned_downtime = fields.Char('年计划停机时长', readonly=True)
|
||||||
|
|
||||||
@api.depends('name_id')
|
@api.depends('name_id')
|
||||||
def _compute_name_id(self):
|
def _compute_calendar_code(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record:
|
if record:
|
||||||
record.calendar_code = record.name_id.code
|
record.calendar_code = record.name_id.code
|
||||||
|
|||||||
@@ -29,6 +29,69 @@
|
|||||||
<field name="active" eval="False"/>
|
<field name="active" eval="False"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- 隐藏讨论 -->
|
||||||
|
<record id="mail.menu_root_discuss" model="ir.ui.menu">
|
||||||
|
<field name="active" eval="False"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整采购菜单顺序 -->
|
||||||
|
<record id="purchase.menu_purchase_root" model="ir.ui.menu">
|
||||||
|
<field name="sequence" eval="33"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整计划菜单顺序 -->
|
||||||
|
<record id="sf_plan.sf_production_plan_menu" model="ir.ui.menu">
|
||||||
|
<field name="sequence" eval="36"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整制造菜单顺序 -->
|
||||||
|
<record id="mrp.menu_mrp_root" model="ir.ui.menu">
|
||||||
|
<field name="sequence" eval="39"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整质量菜单顺序 -->
|
||||||
|
<record id="quality_control.menu_quality_root" model="ir.ui.menu">
|
||||||
|
<field name="sequence" eval="42"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整设备菜单顺序 -->
|
||||||
|
<record id="maintenance.menu_maintenance_title" model="ir.ui.menu">
|
||||||
|
<field name="sequence" eval="45"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整条码菜单顺序 -->
|
||||||
|
<record id="stock_barcode.stock_barcode_menu" model="ir.ui.menu">
|
||||||
|
<field name="sequence" eval="48"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整库存菜单顺序 -->
|
||||||
|
<record id="stock.menu_stock_root" model="ir.ui.menu">
|
||||||
|
<field name="sequence" eval="51"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整仪表板菜单顺序 -->
|
||||||
|
<record id="spreadsheet_dashboard.spreadsheet_dashboard_menu_root" model="ir.ui.menu">
|
||||||
|
<field name="sequence" eval="54"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 调整开票菜单名字及顺序 -->
|
||||||
|
<record id="account.menu_finance" model="ir.ui.menu">
|
||||||
|
<field name="name">应收应付</field>
|
||||||
|
<field name="sequence" eval="57"/>
|
||||||
|
</record>
|
||||||
|
<!-- 隐藏跟踪链 -->
|
||||||
|
<record id="utm.menu_link_tracker_root" model="ir.ui.menu">
|
||||||
|
<field name="active" eval="False"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <record id="mrp_workorder.menu_mrp_workorder_workcenter" model="ir.ui.menu"> -->
|
||||||
|
<!-- <field name="name">工单计划</field> -->
|
||||||
|
<!-- <field name="sequence" eval="300"/> -->
|
||||||
|
<!-- <field name="parent_id" ref="sf_plan.sf_production_plan_menu"/> -->
|
||||||
|
<!-- </record> -->
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="day_off_ids" widget="many2many_tags"
|
<field name="day_off_ids" widget="many2many_tags" placeholder="请选择"
|
||||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||||
<field name="status"/>
|
<field name="status"/>
|
||||||
</group>
|
</group>
|
||||||
@@ -101,8 +101,8 @@
|
|||||||
<tree string="班次" editable="bottom" >
|
<tree string="班次" editable="bottom" >
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="start_time"/>
|
<field name="start_time" placeholder="请选择"/>
|
||||||
<field name="end_time"/>
|
<field name="end_time" placeholder="请选择"/>
|
||||||
<field name="remark"/>
|
<field name="remark"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -211,8 +211,8 @@
|
|||||||
<field name="work_center_name_id"/>
|
<field name="work_center_name_id"/>
|
||||||
<field name="equipment_name_id"/>
|
<field name="equipment_name_id"/>
|
||||||
<field name="equipment_code"/>
|
<field name="equipment_code"/>
|
||||||
<field name="brand" optional="hide"/>
|
<field name="brand_id" optional="hide"/>
|
||||||
<field name="model" optional="hide"/>
|
<field name="type_id" optional="hide"/>
|
||||||
<field name="working_procedure"/>
|
<field name="working_procedure"/>
|
||||||
<field name="production_capacity" optional="hide"/>
|
<field name="production_capacity" optional="hide"/>
|
||||||
<field name="working_calendar_id" optional="hide"/>
|
<field name="working_calendar_id" optional="hide"/>
|
||||||
@@ -233,14 +233,14 @@
|
|||||||
<sheet>
|
<sheet>
|
||||||
<div>
|
<div>
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name"/>
|
<field name="name" placeholder="请选择"/>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="work_center_name_id"/>
|
<field name="work_center_name_id" placeholder="请选择"/>
|
||||||
<field name="production_capacity"/>
|
<field name="production_capacity"/>
|
||||||
<field name="working_calendar_id"/>
|
<field name="working_calendar_id" placeholder="请选择"/>
|
||||||
<field name="create_time"/>
|
<field name="create_time"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
@@ -254,12 +254,12 @@
|
|||||||
<group>`
|
<group>`
|
||||||
<group>
|
<group>
|
||||||
<field name="equipment_name_id"/>
|
<field name="equipment_name_id"/>
|
||||||
<field name="brand"/>
|
<field name="brand_id"/>
|
||||||
<field name="status"/>
|
<field name="status"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="equipment_code" string="机台号"/>
|
<field name="equipment_code" string="机台号"/>
|
||||||
<field name="model"/>
|
<field name="type_id"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
@@ -277,8 +277,8 @@
|
|||||||
<field name="work_center_name_id"/>
|
<field name="work_center_name_id"/>
|
||||||
<field name="equipment_code"/>
|
<field name="equipment_code"/>
|
||||||
<field name="equipment_name_id"/>
|
<field name="equipment_name_id"/>
|
||||||
<field name="brand"/>
|
<field name="brand_id"/>
|
||||||
<field name="model"/>
|
<field name="type_id"/>
|
||||||
<field name="working_procedure"/>
|
<field name="working_procedure"/>
|
||||||
<field name="production_capacity"/>
|
<field name="production_capacity"/>
|
||||||
<field name="working_calendar_id"/>
|
<field name="working_calendar_id"/>
|
||||||
|
|||||||
@@ -24,28 +24,28 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
return categories.browse(mrs_cutting_tool_type_ids)
|
return categories.browse(mrs_cutting_tool_type_ids)
|
||||||
|
|
||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '整体式刀具')])
|
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
||||||
|
|
||||||
# 刀片型号
|
# 刀片型号
|
||||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀片')])
|
domain=[('cutting_tool_material_id', '=', '刀片')])
|
||||||
|
|
||||||
# 刀杆型号
|
# 刀杆型号
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀杆')])
|
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
||||||
|
|
||||||
# 刀盘型号
|
# 刀盘型号
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀盘')])
|
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
||||||
|
|
||||||
# 刀柄型号
|
# 刀柄型号
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀柄')])
|
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
||||||
|
|
||||||
# 夹头型号
|
# 夹头型号
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '夹头')])
|
domain=[('cutting_tool_material_id', '=', '夹头')])
|
||||||
|
|
||||||
diameter = fields.Float('直径(mm)')
|
diameter = fields.Float('直径(mm)')
|
||||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||||
@@ -103,28 +103,28 @@ class FunctionalCuttingToolEntityCache(models.Model):
|
|||||||
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
|
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
|
||||||
|
|
||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '整体式刀具')])
|
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
||||||
|
|
||||||
# 刀片型号
|
# 刀片型号
|
||||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀片')])
|
domain=[('cutting_tool_material_id', '=', '刀片')])
|
||||||
|
|
||||||
# 刀杆型号
|
# 刀杆型号
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀杆')])
|
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
||||||
|
|
||||||
# 刀盘型号
|
# 刀盘型号
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀盘')])
|
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
||||||
|
|
||||||
# 刀柄型号
|
# 刀柄型号
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀柄')])
|
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
||||||
|
|
||||||
# 夹头型号
|
# 夹头型号
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '夹头')])
|
domain=[('cutting_tool_material_id', '=', '夹头')])
|
||||||
|
|
||||||
diameter = fields.Float('直径(mm)')
|
diameter = fields.Float('直径(mm)')
|
||||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||||
@@ -153,33 +153,33 @@ class FunctionalToolWarning(models.Model):
|
|||||||
related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
||||||
|
|
||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '整体式刀具')],
|
domain=[('cutting_tool_material_id', '=', '整体式刀具')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
||||||
|
|
||||||
# 刀片型号
|
# 刀片型号
|
||||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀片')],
|
domain=[('cutting_tool_material_id', '=', '刀片')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
||||||
|
|
||||||
# 刀杆型号
|
# 刀杆型号
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀杆')],
|
domain=[('cutting_tool_material_id', '=', '刀杆')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
||||||
|
|
||||||
# 刀盘型号
|
# 刀盘型号
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀盘')],
|
domain=[('cutting_tool_material_id', '=', '刀盘')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
||||||
|
|
||||||
# 刀柄型号
|
# 刀柄型号
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀柄')],
|
domain=[('cutting_tool_material_id', '=', '刀柄')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
||||||
|
|
||||||
# 夹头型号
|
# 夹头型号
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '夹头')],
|
domain=[('cutting_tool_material_id', '=', '夹头')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
||||||
|
|
||||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||||
@@ -267,33 +267,33 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
|||||||
# related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
# related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
||||||
|
|
||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '整体式刀具')],
|
domain=[('cutting_tool_material_id', '=', '整体式刀具')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
||||||
|
|
||||||
# 刀片型号
|
# 刀片型号
|
||||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀片')],
|
domain=[('cutting_tool_material_id', '=', '刀片')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
||||||
|
|
||||||
# 刀杆型号
|
# 刀杆型号
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀杆')],
|
domain=[('cutting_tool_material_id', '=', '刀杆')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
||||||
|
|
||||||
# 刀盘型号
|
# 刀盘型号
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀盘')],
|
domain=[('cutting_tool_material_id', '=', '刀盘')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
||||||
|
|
||||||
# 刀柄型号
|
# 刀柄型号
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀柄')],
|
domain=[('cutting_tool_material_id', '=', '刀柄')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
||||||
|
|
||||||
# 夹头型号
|
# 夹头型号
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '夹头')],
|
domain=[('cutting_tool_material_id', '=', '夹头')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
||||||
|
|
||||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||||
@@ -375,33 +375,33 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
|||||||
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
||||||
|
|
||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '整体式刀具')],
|
domain=[('cutting_tool_material_id', '=', '整体式刀具')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
||||||
|
|
||||||
# 刀片型号
|
# 刀片型号
|
||||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀片')],
|
domain=[('cutting_tool_material_id', '=', '刀片')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
||||||
|
|
||||||
# 刀杆型号
|
# 刀杆型号
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀杆')],
|
domain=[('cutting_tool_material_id', '=', '刀杆')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
||||||
|
|
||||||
# 刀盘型号
|
# 刀盘型号
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀盘')],
|
domain=[('cutting_tool_material_id', '=', '刀盘')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
||||||
|
|
||||||
# 刀柄型号
|
# 刀柄型号
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀柄')],
|
domain=[('cutting_tool_material_id', '=', '刀柄')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
||||||
|
|
||||||
# 夹头型号
|
# 夹头型号
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '夹头')],
|
domain=[('cutting_tool_material_id', '=', '夹头')],
|
||||||
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
||||||
|
|
||||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||||
@@ -752,39 +752,39 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
||||||
|
|
||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '整体式刀具')])
|
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
||||||
integral_code = fields.Char('整体式刀具序列号', readonly=True)
|
integral_code = fields.Char('整体式刀具序列号', readonly=True)
|
||||||
integral_name = fields.Char('整体式刀具名称', readonly=True)
|
integral_name = fields.Char('整体式刀具名称', readonly=True)
|
||||||
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', '整体式刀具品牌', readonly=True)
|
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', '整体式刀具品牌', readonly=True)
|
||||||
# 刀片型号
|
# 刀片型号
|
||||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀片')])
|
domain=[('cutting_tool_material_id', '=', '刀片')])
|
||||||
blade_code = fields.Char('刀片序列号', readonly=True)
|
blade_code = fields.Char('刀片序列号', readonly=True)
|
||||||
blade_name = fields.Char('刀片名称', readonly=True)
|
blade_name = fields.Char('刀片名称', readonly=True)
|
||||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True)
|
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True)
|
||||||
# 刀杆型号
|
# 刀杆型号
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀杆')])
|
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
||||||
bar_code = fields.Char('刀杆序列号', readonly=True)
|
bar_code = fields.Char('刀杆序列号', readonly=True)
|
||||||
bar_name = fields.Char('刀杆名称', readonly=True)
|
bar_name = fields.Char('刀杆名称', readonly=True)
|
||||||
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True)
|
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True)
|
||||||
# 刀盘型号
|
# 刀盘型号
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀盘')])
|
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
||||||
pad_code = fields.Char('刀盘序列号', readonly=True)
|
pad_code = fields.Char('刀盘序列号', readonly=True)
|
||||||
pad_name = fields.Char('刀盘名称', readonly=True)
|
pad_name = fields.Char('刀盘名称', readonly=True)
|
||||||
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True)
|
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True)
|
||||||
|
|
||||||
# 刀柄型号
|
# 刀柄型号
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '刀柄')])
|
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
||||||
handle_code = fields.Char('刀柄序列号', readonly=True)
|
handle_code = fields.Char('刀柄序列号', readonly=True)
|
||||||
handle_name = fields.Char('刀柄名称', readonly=True)
|
handle_name = fields.Char('刀柄名称', readonly=True)
|
||||||
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True)
|
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True)
|
||||||
# 夹头型号
|
# 夹头型号
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||||
domain=[('cutting_tool_type', '=', '夹头')])
|
domain=[('cutting_tool_material_id', '=', '夹头')])
|
||||||
chuck_code = fields.Char('夹头序列号', readonly=True)
|
chuck_code = fields.Char('夹头序列号', readonly=True)
|
||||||
chuck_name = fields.Char('夹头名称', readonly=True)
|
chuck_name = fields.Char('夹头名称', readonly=True)
|
||||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True)
|
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True)
|
||||||
|
|||||||
@@ -95,24 +95,27 @@
|
|||||||
<!-- attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"-->
|
<!-- attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"-->
|
||||||
<group col="1">
|
<group col="1">
|
||||||
<group string="适合加工方式">
|
<group string="适合加工方式">
|
||||||
<field name="suitable_machining_method_ids" string=""
|
<field name="suitable_machining_method_ids" string="" widget="custom_many2many_checkboxes"
|
||||||
widget="custom_many2many_checkboxes"/>
|
domain="[('id','in',suitable_machining_method_ids)]"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<group string="刀尖特征">
|
<group string="刀尖特征">
|
||||||
<field name="blade_tip_characteristics_ids" string=""
|
<field name="blade_tip_characteristics_ids" string="" widget="custom_many2many_checkboxes"
|
||||||
widget="custom_many2many_checkboxes"/>
|
domain="[('id','in',blade_tip_characteristics_ids)]"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="柄部类型">
|
<group string="柄部类型">
|
||||||
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"/>
|
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"
|
||||||
|
domain="[('id','in',handle_type_ids)]"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<group string="走刀方向">
|
<group string="走刀方向">
|
||||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"
|
||||||
|
domain="[('id','in',cutting_direction_ids)]"/>
|
||||||
</group>
|
</group>
|
||||||
<group string="适合冷却液">
|
<group string="适合冷却液">
|
||||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"
|
||||||
|
domain="[('id','in',suitable_coolant_ids)]"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
|
|
||||||
# 功能刀具组装信息
|
# 功能刀具组装信息
|
||||||
# 整体式刀具型号
|
# 整体式刀具型号
|
||||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=False,
|
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=False,
|
||||||
domain=[('cutting_tool_type', '=', '整体式刀具')])
|
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
||||||
integral_code = fields.Char('整体式刀具序列号', readonly=True, compute='_compute_integral_code')
|
integral_code = fields.Char('整体式刀具序列号', readonly=True, compute='_compute_integral_code')
|
||||||
integral_name = fields.Char('整体式刀具名称', readonly=True, compute='_compute_integral_name')
|
integral_name = fields.Char('整体式刀具名称', readonly=True, compute='_compute_integral_name')
|
||||||
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', '整体式刀具品牌', readonly=True,
|
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', '整体式刀具品牌', readonly=True,
|
||||||
@@ -164,13 +164,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
def _compute_sf_tool_brand_id_1(self):
|
def _compute_sf_tool_brand_id_1(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.cutting_tool_integral_model_id:
|
if record.cutting_tool_integral_model_id:
|
||||||
self.sf_tool_brand_id_1 = record.cutting_tool_integral_model_id.mrs_machine_brand_id.id
|
self.sf_tool_brand_id_1 = record.cutting_tool_integral_model_id.brand_id.id
|
||||||
else:
|
else:
|
||||||
self.sf_tool_brand_id_1 = None
|
self.sf_tool_brand_id_1 = None
|
||||||
|
|
||||||
# 刀片型号
|
# 刀片型号
|
||||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=False,
|
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=False,
|
||||||
domain=[('cutting_tool_type', '=', '刀片')])
|
domain=[('cutting_tool_material_id', '=', '刀片')])
|
||||||
blade_code = fields.Char('刀片序列号', readonly=True, compute='_compute_blade_code')
|
blade_code = fields.Char('刀片序列号', readonly=True, compute='_compute_blade_code')
|
||||||
blade_name = fields.Char('刀片名称', readonly=True, compute='_compute_blade_name')
|
blade_name = fields.Char('刀片名称', readonly=True, compute='_compute_blade_name')
|
||||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True,
|
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True,
|
||||||
@@ -196,13 +196,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
def _compute_sf_tool_brand_id_2(self):
|
def _compute_sf_tool_brand_id_2(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.cutting_tool_blade_model_id:
|
if record.cutting_tool_blade_model_id:
|
||||||
self.sf_tool_brand_id_2 = self.cutting_tool_blade_model_id.mrs_machine_brand_id.id
|
self.sf_tool_brand_id_2 = self.cutting_tool_blade_model_id.brand_id.id
|
||||||
else:
|
else:
|
||||||
self.sf_tool_brand_id_2 = None
|
self.sf_tool_brand_id_2 = None
|
||||||
|
|
||||||
# 刀杆型号
|
# 刀杆型号
|
||||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=False,
|
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=False,
|
||||||
domain=[('cutting_tool_type', '=', '刀杆')])
|
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
||||||
bar_code = fields.Char('刀杆序列号', readonly=True, compute='_compute_bar_code')
|
bar_code = fields.Char('刀杆序列号', readonly=True, compute='_compute_bar_code')
|
||||||
bar_name = fields.Char('刀杆名称', readonly=True, compute='_compute_bar_name')
|
bar_name = fields.Char('刀杆名称', readonly=True, compute='_compute_bar_name')
|
||||||
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True,
|
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True,
|
||||||
@@ -228,13 +228,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
def _compute_sf_tool_brand_id_3(self):
|
def _compute_sf_tool_brand_id_3(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.cutting_tool_cutterbar_model_id:
|
if record.cutting_tool_cutterbar_model_id:
|
||||||
self.sf_tool_brand_id_3 = self.cutting_tool_cutterbar_model_id.mrs_machine_brand_id.id
|
self.sf_tool_brand_id_3 = self.cutting_tool_cutterbar_model_id.brand_id.id
|
||||||
else:
|
else:
|
||||||
self.sf_tool_brand_id_3 = None
|
self.sf_tool_brand_id_3 = None
|
||||||
|
|
||||||
# 刀盘型号
|
# 刀盘型号
|
||||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=False,
|
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=False,
|
||||||
domain=[('cutting_tool_type', '=', '刀盘')])
|
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
||||||
pad_code = fields.Char('刀盘序列号', readonly=True, compute='_compute_pad_code')
|
pad_code = fields.Char('刀盘序列号', readonly=True, compute='_compute_pad_code')
|
||||||
pad_name = fields.Char('刀盘名称', readonly=True, compute='_compute_pad_name')
|
pad_name = fields.Char('刀盘名称', readonly=True, compute='_compute_pad_name')
|
||||||
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True,
|
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True,
|
||||||
@@ -260,13 +260,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
def _compute_sf_tool_brand_id_4(self):
|
def _compute_sf_tool_brand_id_4(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.cutting_tool_cutterpad_model_id:
|
if record.cutting_tool_cutterpad_model_id:
|
||||||
self.sf_tool_brand_id_4 = self.cutting_tool_cutterpad_model_id.mrs_machine_brand_id.id
|
self.sf_tool_brand_id_4 = self.cutting_tool_cutterpad_model_id.brand_id.id
|
||||||
else:
|
else:
|
||||||
self.sf_tool_brand_id_4 = None
|
self.sf_tool_brand_id_4 = None
|
||||||
|
|
||||||
# 刀柄型号
|
# 刀柄型号
|
||||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=False,
|
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=False,
|
||||||
domain=[('cutting_tool_type', '=', '刀柄')])
|
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
||||||
handle_code = fields.Char('刀柄序列号', readonly=True, compute='_compute_handle_code')
|
handle_code = fields.Char('刀柄序列号', readonly=True, compute='_compute_handle_code')
|
||||||
handle_name = fields.Char('刀柄名称', readonly=True, compute='_compute_handle_name')
|
handle_name = fields.Char('刀柄名称', readonly=True, compute='_compute_handle_name')
|
||||||
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True,
|
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True,
|
||||||
@@ -292,13 +292,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
def _compute_sf_tool_brand_id_5(self):
|
def _compute_sf_tool_brand_id_5(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.cutting_tool_cutterhandle_model_id:
|
if record.cutting_tool_cutterhandle_model_id:
|
||||||
self.sf_tool_brand_id_5 = self.cutting_tool_cutterhandle_model_id.mrs_machine_brand_id.id
|
self.sf_tool_brand_id_5 = self.cutting_tool_cutterhandle_model_id.brand_id.id
|
||||||
else:
|
else:
|
||||||
self.sf_tool_brand_id_5 = None
|
self.sf_tool_brand_id_5 = None
|
||||||
|
|
||||||
# 夹头型号
|
# 夹头型号
|
||||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=False,
|
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=False,
|
||||||
domain=[('cutting_tool_type', '=', '夹头')])
|
domain=[('cutting_tool_material_id', '=', '夹头')])
|
||||||
chuck_code = fields.Char('夹头序列号', readonly=True, compute='_compute_chuck_code')
|
chuck_code = fields.Char('夹头序列号', readonly=True, compute='_compute_chuck_code')
|
||||||
chuck_name = fields.Char('夹头名称', readonly=True, compute='_compute_chuck_name')
|
chuck_name = fields.Char('夹头名称', readonly=True, compute='_compute_chuck_name')
|
||||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True,
|
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True,
|
||||||
@@ -324,7 +324,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
def _compute_sf_tool_brand_id_6(self):
|
def _compute_sf_tool_brand_id_6(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.cutting_tool_cutterhead_model_id:
|
if record.cutting_tool_cutterhead_model_id:
|
||||||
self.sf_tool_brand_id_6 = self.cutting_tool_cutterhead_model_id.mrs_machine_brand_id.id
|
self.sf_tool_brand_id_6 = self.cutting_tool_cutterhead_model_id.brand_id.id
|
||||||
else:
|
else:
|
||||||
self.sf_tool_brand_id_6 = None
|
self.sf_tool_brand_id_6 = None
|
||||||
|
|
||||||
|
|||||||
@@ -143,28 +143,30 @@
|
|||||||
<group string="组装物料信息">
|
<group string="组装物料信息">
|
||||||
<group>
|
<group>
|
||||||
<field name="cutting_tool_integral_model_id" string="整体式刀具型号"
|
<field name="cutting_tool_integral_model_id" string="整体式刀具型号"
|
||||||
options="{'no_create': True, 'no_quick_create': True}"
|
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"
|
||||||
attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"/>
|
attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"/>
|
||||||
<field name="integral_code"
|
<field name="integral_code"
|
||||||
attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"/>
|
attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"/>
|
||||||
<field name="cutting_tool_blade_model_id" string="刀片型号"
|
<field name="cutting_tool_blade_model_id" string="刀片型号"
|
||||||
options="{'no_create': True, 'no_quick_create': True}"
|
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"
|
||||||
attrs="{'invisible': [('cutting_tool_integral_model_id', '!=', False)]}"/>
|
attrs="{'invisible': [('cutting_tool_integral_model_id', '!=', False)]}"/>
|
||||||
<field name="blade_code"
|
<field name="blade_code"
|
||||||
attrs="{'invisible': [('cutting_tool_integral_model_id', '!=', False)]}"/>
|
attrs="{'invisible': [('cutting_tool_integral_model_id', '!=', False)]}"/>
|
||||||
<field name="cutting_tool_cutterbar_model_id" string="刀杆型号"
|
<field name="cutting_tool_cutterbar_model_id" string="刀杆型号"
|
||||||
options="{'no_create': True, 'no_quick_create': True}"
|
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"
|
||||||
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterpad_model_id', '!=', False)]}"/>
|
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterpad_model_id', '!=', False)]}"/>
|
||||||
<field name="bar_code"
|
<field name="bar_code"
|
||||||
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterpad_model_id', '!=', False)]}"/>
|
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterpad_model_id', '!=', False)]}"/>
|
||||||
<field name="cutting_tool_cutterpad_model_id" string="刀盘型号"
|
<field name="cutting_tool_cutterpad_model_id" string="刀盘型号"
|
||||||
options="{'no_create': True, 'no_quick_create': True}"
|
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"
|
||||||
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterbar_model_id', '!=', False)]}"/>
|
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterbar_model_id', '!=', False)]}"/>
|
||||||
<field name="pad_code"
|
<field name="pad_code"
|
||||||
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterbar_model_id', '!=', False)]}"/>
|
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterbar_model_id', '!=', False)]}"/>
|
||||||
<field name="cutting_tool_cutterhandle_model_id" string="刀柄型号" options="{'no_create': True, 'no_quick_create': True}"/>
|
<field name="cutting_tool_cutterhandle_model_id" string="刀柄型号"
|
||||||
|
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"/>
|
||||||
<field name="handle_code"/>
|
<field name="handle_code"/>
|
||||||
<field name="cutting_tool_cutterhead_model_id" string="夹头型号" options="{'no_create': True, 'no_quick_create': True}"/>
|
<field name="cutting_tool_cutterhead_model_id" string="夹头型号"
|
||||||
|
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"/>
|
||||||
<field name="chuck_code"/>
|
<field name="chuck_code"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
|
|||||||
BIN
web_enterprise/static/img/jikimo_backgroud.png
Normal file
BIN
web_enterprise/static/img/jikimo_backgroud.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -9,7 +9,7 @@
|
|||||||
radial-gradient(at 7% 13%, hsla(268,5%,47%,0.42) 0px, transparent 50%),
|
radial-gradient(at 7% 13%, hsla(268,5%,47%,0.42) 0px, transparent 50%),
|
||||||
radial-gradient(at 96% 94%, hsla(267,5%,46%,0.51) 0px, transparent 50%),
|
radial-gradient(at 96% 94%, hsla(267,5%,46%,0.51) 0px, transparent 50%),
|
||||||
radial-gradient(at 3% 96%, hsla(289,17%,21%,0.41) 0px, transparent 50%),
|
radial-gradient(at 3% 96%, hsla(289,17%,21%,0.41) 0px, transparent 50%),
|
||||||
url("/web_enterprise/static/img/home-menu-bg-overlay.svg")
|
url("/web_enterprise/static/img/jikimo_backgroud.png")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -684,10 +684,19 @@ export default AbstractRenderer.extend(WidgetAdapterMixin, {
|
|||||||
const stopDate = this.state.stopDate;
|
const stopDate = this.state.stopDate;
|
||||||
let day = this.state.startDate;
|
let day = this.state.startDate;
|
||||||
const dates = [];
|
const dates = [];
|
||||||
while (day <= stopDate) {
|
const shift_time = 8;
|
||||||
dates.push(day);
|
if (this.state.scale == "day") {
|
||||||
day = day.clone().add(1, token);
|
while (day <= stopDate) {
|
||||||
|
dates.push(day);
|
||||||
|
day = day.clone().add(shift_time, token);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while (day <= stopDate) {
|
||||||
|
dates.push(day);
|
||||||
|
day = day.clone().add(1, token);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
console.log(dates)
|
||||||
return dates;
|
return dates;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -806,6 +815,7 @@ export default AbstractRenderer.extend(WidgetAdapterMixin, {
|
|||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
async _renderView() {
|
async _renderView() {
|
||||||
|
console.log('this.state', this.state)
|
||||||
const oldRowWidgets = Object.keys(this.rowWidgets).map((rowId) => {
|
const oldRowWidgets = Object.keys(this.rowWidgets).map((rowId) => {
|
||||||
return this.rowWidgets[rowId];
|
return this.rowWidgets[rowId];
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -261,12 +261,18 @@ var GanttRow = Widget.extend({
|
|||||||
_adaptPills: function () {
|
_adaptPills: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
var dateStartField = this.state.dateStartField;
|
var dateStartField = this.state.dateStartField;
|
||||||
|
console.log("dateStartField",dateStartField)
|
||||||
var dateStopField = this.state.dateStopField;
|
var dateStopField = this.state.dateStopField;
|
||||||
|
console.log("dateStopField",dateStopField)
|
||||||
var ganttStartDate = this.state.startDate;
|
var ganttStartDate = this.state.startDate;
|
||||||
|
console.log("ganttStartDate",ganttStartDate)
|
||||||
var ganttStopDate = this.state.stopDate;
|
var ganttStopDate = this.state.stopDate;
|
||||||
|
console.log("ganttStopDate",ganttStopDate)
|
||||||
this.pills.forEach(function (pill) {
|
this.pills.forEach(function (pill) {
|
||||||
var pillStartDate = self._convertToUserTime(pill[dateStartField]);
|
var pillStartDate = self._convertToUserTime(pill[dateStartField]);
|
||||||
|
console.log("pillStartDate",pillStartDate)
|
||||||
var pillStopDate = self._convertToUserTime(pill[dateStopField]);
|
var pillStopDate = self._convertToUserTime(pill[dateStopField]);
|
||||||
|
console.log("pillStopDate",pillStopDate)
|
||||||
if (pillStartDate < ganttStartDate) {
|
if (pillStartDate < ganttStartDate) {
|
||||||
pill.startDate = ganttStartDate;
|
pill.startDate = ganttStartDate;
|
||||||
pill.disableStartResize = true;
|
pill.disableStartResize = true;
|
||||||
@@ -457,16 +463,50 @@ var GanttRow = Widget.extend({
|
|||||||
this.pills.forEach(function (pill) {
|
this.pills.forEach(function (pill) {
|
||||||
let widthPill;
|
let widthPill;
|
||||||
let margin;
|
let margin;
|
||||||
|
const shift_time = 8;
|
||||||
switch (self.state.scale) {
|
switch (self.state.scale) {
|
||||||
case 'day':
|
case 'day':
|
||||||
left = pill.startDate.diff(pill.startDate.clone().startOf('hour'), 'minutes');
|
// left = pill.startDate.diff(pill.startDate.clone().startOf('hour'), 'minutes');
|
||||||
pill.leftMargin = (left / 60) * 100;
|
left = pill.startDate.diff(pill.startDate.clone().startOf('day'), 'minutes') % (shift_time * 60);
|
||||||
|
|
||||||
|
console.log('left', left)
|
||||||
|
pill.leftMargin = (left / (shift_time * 60)) * 100;
|
||||||
|
console.log('pill.leftMargin', pill.leftMargin)
|
||||||
diff = pill.stopDate.diff(pill.startDate, 'minutes');
|
diff = pill.stopDate.diff(pill.startDate, 'minutes');
|
||||||
var gapSize = pill.stopDate.diff(pill.startDate, 'hours') - 1; // Eventually compensate border(s) width
|
console.log('diff', diff)
|
||||||
widthPill = (diff / 60) * 100;
|
var gapSize = pill.stopDate.diff(pill.startDate, 'hours') - shift_time; // Eventually compensate border(s) width
|
||||||
|
console.log('gapSize', gapSize)
|
||||||
|
widthPill = (diff / (shift_time * 60)) * 100;
|
||||||
|
console.log('widthPill', widthPill)
|
||||||
margin = pill.aggregatedPills ? 0 : 4;
|
margin = pill.aggregatedPills ? 0 : 4;
|
||||||
|
console.log('margin', margin)
|
||||||
pill.width = gapSize > 0 ? `calc(${widthPill}% + ${gapSize}px - ${margin}px)` : `calc(${widthPill}% - ${margin}px)`;
|
pill.width = gapSize > 0 ? `calc(${widthPill}% + ${gapSize}px - ${margin}px)` : `calc(${widthPill}% - ${margin}px)`;
|
||||||
|
console.log('pill.width', pill.width)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// left = pill.startDate.diff(pill.startDate.clone().startOf('hour'), 'minutes');
|
||||||
|
// console.log('left', left)
|
||||||
|
// left = (left / (8 * 60)) * 100; // 修改这里,以8小时为单位
|
||||||
|
// console.log('adjusted left', left)
|
||||||
|
// pill.leftMargin = left;
|
||||||
|
//
|
||||||
|
// diff = pill.stopDate.diff(pill.startDate, 'minutes');
|
||||||
|
// console.log('diff', diff)
|
||||||
|
// diff = (diff / (8 * 60)) * 100; // 修改这里,以8小时为单位
|
||||||
|
// console.log('adjusted diff', diff)
|
||||||
|
//
|
||||||
|
// var gapSize = pill.stopDate.diff(pill.startDate, 'hours') / 8 - 1; // 修改这里,以8小时为单位
|
||||||
|
// console.log('gapSize', gapSize)
|
||||||
|
//
|
||||||
|
// widthPill = diff;
|
||||||
|
// console.log('widthPill', widthPill)
|
||||||
|
//
|
||||||
|
// margin = pill.aggregatedPills ? 0 : 4;
|
||||||
|
// console.log('margin', margin)
|
||||||
|
//
|
||||||
|
// pill.width = gapSize > 0 ? `calc(${widthPill}% + ${gapSize}px - ${margin}px)` : `calc(${widthPill}% - ${margin}px)`;
|
||||||
|
// console.log('pill.width', pill.width)
|
||||||
|
// break;
|
||||||
case 'week':
|
case 'week':
|
||||||
case 'month':
|
case 'month':
|
||||||
left = pill.startDate.diff(pill.startDate.clone().startOf('day'), 'hours');
|
left = pill.startDate.diff(pill.startDate.clone().startOf('day'), 'hours');
|
||||||
@@ -666,21 +706,28 @@ var GanttRow = Widget.extend({
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_insertIntoSlot: function () {
|
_insertIntoSlot: function () {
|
||||||
|
console.log('this.slots', this.slots);
|
||||||
var slotsToFill = this.slots;
|
var slotsToFill = this.slots;
|
||||||
this.pills.forEach(function (currentPill) {
|
this.pills.forEach(function (currentPill) {
|
||||||
var skippedSlots = [];
|
var skippedSlots = [];
|
||||||
slotsToFill.some(function (currentSlot) {
|
slotsToFill.some(function (currentSlot) {
|
||||||
|
console.log('currentPill.startDate1111111111', currentPill)
|
||||||
|
// console.log('currentSlot.stop2222222222222', currentSlot.stop)
|
||||||
var fitsInThisSlot = currentPill.startDate < currentSlot.stop;
|
var fitsInThisSlot = currentPill.startDate < currentSlot.stop;
|
||||||
|
console.log('fitsInThisSlot', fitsInThisSlot)
|
||||||
if (fitsInThisSlot) {
|
if (fitsInThisSlot) {
|
||||||
currentSlot.pills.push(currentPill);
|
currentSlot.pills.push(currentPill);
|
||||||
|
console.log('currentSlot.pills', currentSlot.pills)
|
||||||
} else {
|
} else {
|
||||||
skippedSlots.push(currentSlot);
|
skippedSlots.push(currentSlot);
|
||||||
|
console.log('skippedSlots', skippedSlots)
|
||||||
}
|
}
|
||||||
return fitsInThisSlot;
|
return fitsInThisSlot;
|
||||||
});
|
});
|
||||||
// Pills are sorted by start date, so any slot that was skipped
|
// Pills are sorted by start date, so any slot that was skipped
|
||||||
// for this pill will not be suitable for any of the next pills
|
// for this pill will not be suitable for any of the next pills
|
||||||
slotsToFill = _.difference(slotsToFill, skippedSlots);
|
slotsToFill = _.difference(slotsToFill, skippedSlots);
|
||||||
|
console.log('slotsToFill', slotsToFill)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -727,7 +774,7 @@ var GanttRow = Widget.extend({
|
|||||||
let index = 0;
|
let index = 0;
|
||||||
for (const date of this.viewInfo.slots) {
|
for (const date of this.viewInfo.slots) {
|
||||||
const slotStart = date;
|
const slotStart = date;
|
||||||
const slotStop = date.clone().add(1, interval);
|
const slotStop = date.clone().add(8, interval);
|
||||||
const isToday = date.isSame(new Date(), 'day') && this.state.scale !== 'day';
|
const isToday = date.isSame(new Date(), 'day') && this.state.scale !== 'day';
|
||||||
|
|
||||||
let slotStyle = '';
|
let slotStyle = '';
|
||||||
@@ -759,6 +806,7 @@ var GanttRow = Widget.extend({
|
|||||||
stop: slotStop,
|
stop: slotStop,
|
||||||
pills: [],
|
pills: [],
|
||||||
});
|
});
|
||||||
|
console.log('啊啊啊啊this啊啊啊啊.啊啊啊啊slots啊啊啊啊', this.slots)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -76,8 +76,17 @@
|
|||||||
<div t-attf-class="col position-relative o_gantt_header_cell text-center p-2 #{isToday? 'o_gantt_today' : ''} ">
|
<div t-attf-class="col position-relative o_gantt_header_cell text-center p-2 #{isToday? 'o_gantt_today' : ''} ">
|
||||||
<t t-if="widget.state.scale in formats" t-esc="slot.format(formats[widget.state.scale])"/>
|
<t t-if="widget.state.scale in formats" t-esc="slot.format(formats[widget.state.scale])"/>
|
||||||
<small t-else="">
|
<small t-else="">
|
||||||
<b t-esc="slot.format('k')"/>
|
<t t-if="slot.format('k') == 24">
|
||||||
<span class="d-block d-xl-inline-block" t-esc="slot.format('a')"/>
|
<div>夜班</div>
|
||||||
|
</t>
|
||||||
|
<t t-if="slot.format('k') == 8">
|
||||||
|
<div>早班</div>
|
||||||
|
</t>
|
||||||
|
<t t-if="slot.format('k') == 16">
|
||||||
|
<div>晚班</div>
|
||||||
|
</t>
|
||||||
|
<!-- <b t-esc="slot.format('k')"/> -->
|
||||||
|
<!-- <span class="d-block d-xl-inline-block" t-esc="slot.format('a')"/> -->
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
|||||||
Reference in New Issue
Block a user