Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/生产排程
This commit is contained in:
@@ -256,7 +256,7 @@ class MachineToolType(models.Model):
|
||||
name = fields.Char('名称')
|
||||
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||
knife_type = fields.Selection(
|
||||
[("BT40", "BT40"), ("BT30", "BT30")],
|
||||
[("BT40", "BT40"), ("BT30", "BT30"), ("BT50", "BT50")],
|
||||
default="", string="刀把类型")
|
||||
number_of_knife_library = fields.Integer('刀库数量')
|
||||
rotate_speed = fields.Integer('转速')
|
||||
@@ -308,6 +308,13 @@ class MachineToolType(models.Model):
|
||||
active = fields.Boolean('有效', default=True)
|
||||
code = fields.Char('编码')
|
||||
|
||||
def _get_ids(self, machine_tool_type_code):
|
||||
machine_tool_type_ids = []
|
||||
for item in machine_tool_type_code:
|
||||
machine_tool_type = self.search([('code', '=', item)])
|
||||
machine_tool_type_ids.append(machine_tool_type.id)
|
||||
return [(6, 0, machine_tool_type_ids)]
|
||||
|
||||
|
||||
class MachineToolCategory(models.Model):
|
||||
_name = 'sf.machine_tool.category'
|
||||
|
||||
@@ -53,5 +53,10 @@ class FixtureModel(models.Model):
|
||||
screw_size = fields.Integer(string="螺牙大小[mm]", size=6)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
# @api.model
|
||||
# def create(self, vals):
|
||||
# obj = super(FixtureModel, self).create(vals)
|
||||
# return obj
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,27 +8,34 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div:has(.o_required_modifier)>label::before {
|
||||
div:has(.o_required_modifier) > label::before {
|
||||
content: '*' !important;
|
||||
color: red !important;
|
||||
padding: 0 4px !important;
|
||||
vertical-align: top !important;
|
||||
font-size: 1.5rem !important;
|
||||
}
|
||||
.my-image div {
|
||||
width: 100px !important;
|
||||
height: 130px !important;
|
||||
}
|
||||
|
||||
.my-image div {
|
||||
width: 110px !important;
|
||||
height: 110px !important;
|
||||
}
|
||||
|
||||
.add_flex {
|
||||
padding: 5px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.maintenance_name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_has_image_fill .o_kanban_image_fill_left {
|
||||
flex:unset !important;
|
||||
flex: unset !important;
|
||||
}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom {
|
||||
margin-top: 5px;
|
||||
display: inline !important;
|
||||
@@ -36,4 +43,80 @@ div:has(.o_required_modifier)>label::before {
|
||||
|
||||
td.o_required_modifier {
|
||||
display: table-cell !important;
|
||||
}
|
||||
|
||||
.show_state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 8px;
|
||||
margin: auto;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.show_state > div {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border: 1px solid #000
|
||||
}
|
||||
|
||||
.show_state > div:nth-child(2) {
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_2 {
|
||||
background-color: #FF4343 !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_1 {
|
||||
background-color: #27FEA9 !important;
|
||||
opacity: 0.7;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_3 {
|
||||
background-color: rgb(255, 150, 0) !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.my-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.color_1 {
|
||||
background-color: #27FEA9;
|
||||
}
|
||||
|
||||
.color_2 {
|
||||
background-color: #FF4343;
|
||||
}
|
||||
|
||||
.color_3 {
|
||||
background-color: rgb(255, 150, 0);
|
||||
}
|
||||
|
||||
.font_color_1 {
|
||||
color: rgb(0, 183, 0);
|
||||
}
|
||||
|
||||
.font_color_2 {
|
||||
color: #FF4343;
|
||||
}
|
||||
|
||||
.font_color_3 {
|
||||
color: rgb(255, 150, 0);
|
||||
}
|
||||
|
||||
.o_kanban_card_header_title {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.o_kanban_record_bottom {
|
||||
font-family: '华文中宋';
|
||||
//font-weight: bold;
|
||||
}
|
||||
@@ -30,6 +30,7 @@
|
||||
<field name="name"/>
|
||||
<field name="tag_ids" widget="many2many_tags" optional="hide"/>
|
||||
<field name="remark"/>
|
||||
<field name="image_brand" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -41,16 +42,16 @@
|
||||
<form string="品牌" create="0" edit="0" delete="1">
|
||||
<sheet>
|
||||
<!-- <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>-->
|
||||
<field name="image_brand" widget='image' class="oe_avatar"
|
||||
options="{'preview_image': 'image_128'}" string="log"/>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="name" readonly="1"/>
|
||||
</h1>
|
||||
<field name="image_brand" widget='image' class="oe_avatar"
|
||||
options="{'preview_image': 'image_128'}" string="log"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="code"/>
|
||||
<field name="tag_ids"
|
||||
widget="many2many_tags"
|
||||
options="{'color_field': 'color', 'no_create_edit': True}"
|
||||
@@ -108,15 +109,15 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code"/>
|
||||
<field name="name" placeholder="e.g. LED Monitor"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<label for="name"/>
|
||||
<h1>
|
||||
<field name="name" string="设备名称" placeholder="e.g. LED Monitor"/>
|
||||
</h1>
|
||||
<!-- <label for="name"/>-->
|
||||
<!-- <h1>-->
|
||||
<!-- <field name="name" string="设备名称" placeholder="e.g. LED Monitor"/>-->
|
||||
<!-- </h1>-->
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
<field name="brand_id" required="1"
|
||||
domain="[('tag_ids', '=', '机床')]"
|
||||
@@ -363,7 +364,7 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="MTcode"/>
|
||||
<field name="name" placeholder="e.g. LED Monitor"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group string="基本信息">
|
||||
@@ -374,7 +375,7 @@
|
||||
<!-- options="{'no_create': True}"/>-->
|
||||
<!-- </group>-->
|
||||
<group>
|
||||
<field name="name" required="1" string="设备名称" placeholder="e.g. LED Monitor"/>
|
||||
<field name="MTcode" required="1"/>
|
||||
<field name="type_id" required="1" options="{'no_create': True}"
|
||||
domain="[('brand_id', '=', brand_id)]"
|
||||
attrs="{'invisible': [('brand_id','=',False)]}"/>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code"/>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
@@ -57,7 +57,7 @@
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
@@ -119,12 +119,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="process_encode"/>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" required="1" string="名称"/>
|
||||
<field name="process_encode"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="可选参数">
|
||||
@@ -199,12 +199,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="materials_no" readonly="1" force_save="1"/>
|
||||
<field name="name" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="materials_no" readonly="1" force_save="1"/>
|
||||
<field name="gain_way" required="1"/>
|
||||
<field name="tensile_strength" required="1"/>
|
||||
<field name="hardness" required="1"/>
|
||||
@@ -278,12 +278,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="materials_no"/>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" required="1" string="名称"/>
|
||||
<field name="materials_no"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="型号">
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
<field name="name">夹具型号</field>
|
||||
<field name="model">sf.fixture.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="夹具型号">
|
||||
<tree string="夹具型号" create="0" edit="0" delete="1">
|
||||
<field name="code"/>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="brand_id"/>
|
||||
@@ -177,16 +177,16 @@
|
||||
<field name="name">夹具型号</field>
|
||||
<field name="model">sf.fixture.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="夹具型号">
|
||||
<form string="夹具型号" create="0" edit="0" delete="1" >
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
<field name="name" />
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
<field name="fixture_material_id" options="{'no_create': True}"/>
|
||||
<field name="fixture_material_type" invisible="1"/>
|
||||
<field name="multi_mounting_type_id" options="{'no_create': True}"/>
|
||||
|
||||
@@ -103,12 +103,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group string="基本信息">
|
||||
<group>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="code" />
|
||||
<field name="type_id"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="zero_chuck_model_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
|
||||
@@ -214,12 +214,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code"/>
|
||||
<field name="name" placeholder="e.g. LED Monitor"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="code" />
|
||||
<field name="cutting_tool_material_id"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<notebook>
|
||||
<page string="维保标准" attrs="{'invisible': [('equipment_maintenance_id', '=', False)]}">
|
||||
<field name="maintenance_standards" widget="ony2many">
|
||||
<tree create="False">
|
||||
<tree editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="maintenance_standards"/>
|
||||
</tree>
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
</header>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='maintenance']" position="attributes">
|
||||
<attribute name="string">维保</attribute>
|
||||
<attribute name="string">维保</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='maintenance_count']" position="attributes">
|
||||
<attribute name="string">维保</attribute>
|
||||
<attribute name="string">维保</attribute>
|
||||
</xpath>
|
||||
<!-- <field string="Maintenance" name="maintenance_count" widget="statinfo"/>-->
|
||||
<!-- <field string="Maintenance" name="maintenance_count" widget="statinfo"/>-->
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
|
||||
<button name="%(action_maintenance_logs)d"
|
||||
@@ -286,10 +286,7 @@
|
||||
</xpath>
|
||||
<xpath expr="//templates" position="inside">
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record oe_kanban_card oe_kanban_global_click
|
||||
#{record.state.raw_value == '正常' ? 'kanban_color_1' : ''}
|
||||
#{record.state.raw_value == '故障' ? 'kanban_color_2' : ''}
|
||||
#{record.state.raw_value == '不可用' ? 'kanban_color_3' : ''}">
|
||||
<div t-attf-class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record oe_kanban_card oe_kanban_global_click">
|
||||
|
||||
<field name="machine_tool_picture" class="o_kanban_image_fill_left d-block my-image"
|
||||
preview_image="image_128" widget="image"/>
|
||||
@@ -304,7 +301,10 @@
|
||||
<div class="o_kanban_record_bottom state_zc">
|
||||
<field name="state_zc"/>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom state_zc">
|
||||
<div class="o_kanban_record_bottom state_zc"
|
||||
t-attf-class="#{record.state.raw_value == '正常' ? 'font_color_1' : ''}
|
||||
#{record.state.raw_value == '故障' ? 'font_color_2' : ''}
|
||||
#{record.state.raw_value == '不可用' ? 'font_color_3' : ''}">
|
||||
<field name="state"/>
|
||||
</div>
|
||||
<!-- <div class="o_kanban_record_bottom">-->
|
||||
@@ -313,7 +313,12 @@
|
||||
<!-- <field name="supplier_id"/>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div class="show_state" t-attf-class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record oe_kanban_card oe_kanban_global_click
|
||||
">
|
||||
<div t-attf-class="#{record.state.raw_value == '正常' ? 'color_1' : ''}"></div>
|
||||
<div t-attf-class="#{record.state.raw_value == '故障' ? 'color_2' : ''}"></div>
|
||||
<div t-attf-class="#{record.state.raw_value == '不可用' ? 'color_3' : ''}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</xpath>
|
||||
|
||||
@@ -569,15 +569,20 @@ class MachineBrand(models.Model):
|
||||
result = json.loads(r['result'])
|
||||
if result['status'] == 1:
|
||||
for item in result['machine_brand_all_list']:
|
||||
|
||||
brand = self.env['sf.machine.brand'].search(
|
||||
[("code", '=', item['code'])])
|
||||
if not brand:
|
||||
if item.get('image_brand'):
|
||||
image = base64.b64decode(item['image_brand'])
|
||||
else:
|
||||
image = ''
|
||||
self.env['sf.machine.brand'].create({
|
||||
"id": item['id'],
|
||||
"name": item['name'],
|
||||
"code": item['code'],
|
||||
"remark": item['remark'],
|
||||
"image_brand": '' if not item['image_brand'] else base64.b64encode(item.image_brand),
|
||||
"image_brand": image,
|
||||
"tag_ids": self.env['sf.machine.brand.tags'].search(
|
||||
[("name", 'in', item['tag_ids'])]).ids
|
||||
})
|
||||
@@ -1519,10 +1524,11 @@ class SyncFixtureModel(models.Model):
|
||||
"materials_model_id": self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['materials_model_code'])]).id,
|
||||
"driving_way": item['driving_way'],
|
||||
"apply_machine_tool_type_id": self.env['sf.machine_tool.type'].search(
|
||||
[('code', '=', item['apply_machine_tool_type_code'])]).id,
|
||||
"apply_machine_tool_type_ids": self.env['sf.machine_tool.type'].sudo()._get_ids(
|
||||
item['apply_machine_tool_type_code']).id,
|
||||
"through_hole_size": item['through_hole_size'],
|
||||
"screw_size": item['screw_size'],
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
fixture_model.write({
|
||||
@@ -1548,10 +1554,11 @@ class SyncFixtureModel(models.Model):
|
||||
"materials_model_id": self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['materials_model_code'])]).id,
|
||||
"driving_way": item['driving_way'],
|
||||
"apply_machine_tool_type_id": self.env['sf.machine_tool.type'].search(
|
||||
[('code', '=', item['apply_machine_tool_type_code'])]).id,
|
||||
"apply_machine_tool_type_ids": self.env['sf.machine_tool.type'].sudo()._get_ids(
|
||||
item['apply_machine_tool_type_code']).id,
|
||||
"through_hole_size": item['through_hole_size'],
|
||||
"screw_size": item['screw_size'],
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
raise ValidationError("认证未通过")
|
||||
@@ -1599,10 +1606,11 @@ class SyncFixtureModel(models.Model):
|
||||
"materials_model_id": self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['materials_model_code'])]).id,
|
||||
"driving_way": item['driving_way'],
|
||||
"apply_machine_tool_type_id": self.env['sf.machine_tool.type'].search(
|
||||
[('code', '=', item['apply_machine_tool_type_code'])]).id,
|
||||
"apply_machine_tool_type_ids": self.env['sf.machine_tool.type'].sudo()._get_ids(
|
||||
item['apply_machine_tool_type_code']).id,
|
||||
"through_hole_size": item['through_hole_size'],
|
||||
"screw_size": item['screw_size'],
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
fixture_model.write({
|
||||
@@ -1628,8 +1636,8 @@ class SyncFixtureModel(models.Model):
|
||||
"materials_model_id": self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['materials_model_code'])]).id,
|
||||
"driving_way": item['driving_way'],
|
||||
"apply_machine_tool_type_id": self.env['sf.machine_tool.type'].search(
|
||||
[('code', '=', item['apply_machine_tool_type_code'])]).id,
|
||||
"apply_machine_tool_type_ids": self.env['sf.machine_tool.type'].sudo()._get_ids(
|
||||
item['apply_machine_tool_type_code']).id,
|
||||
"through_hole_size": item['through_hole_size'],
|
||||
"screw_size": item['screw_size'],
|
||||
"active": item['active'],
|
||||
|
||||
@@ -8,7 +8,7 @@ class ProcedureEquipmentResourceSetting(models.Model):
|
||||
|
||||
name = fields.Many2one('sf.production.line', string='生产线', required=True)
|
||||
work_center_name_id = fields.Many2one('mrp.workcenter', string='工作中心名称')
|
||||
equipment_code = fields.Char(string='机台号(原设备编码)', readonly=True, compute='_onchange_equipment_name_id')
|
||||
equipment_code = fields.Char(string='机台号', readonly=True, compute='_onchange_equipment_name_id')
|
||||
equipment_name_id = fields.Many2one('maintenance.equipment',
|
||||
string='设备名称',
|
||||
readonly=True,
|
||||
@@ -41,9 +41,9 @@ class ProcedureEquipmentResourceSetting(models.Model):
|
||||
@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.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')
|
||||
|
||||
@@ -26,14 +26,14 @@ class WorkLogSetting(models.Model):
|
||||
code = fields.Char(string='序号', default=_get_code)
|
||||
name = fields.Char(string='工作日历名称', required=True, size=15, length=30)
|
||||
|
||||
working_shift_ids = fields.Many2many('sf.working.shift', string='班次')
|
||||
working_shift_ids = fields.Many2many('sf.working.shift', string='班次', required=True)
|
||||
start_time = fields.Datetime(string='日开始时间', readonly=True, compute='_compute_working_shift_ids')
|
||||
end_time = fields.Datetime(string='日结束时间', readonly=True, compute='_compute_working_shift_ids')
|
||||
duration = fields.Char(string='时长', readonly=True, compute='_compute_working_shift_ids')
|
||||
|
||||
day_off_ids = fields.Many2many('sf.day.off', string='休息日', required=True)
|
||||
|
||||
status = fields.Boolean(string='状态', default=True)
|
||||
status = fields.Selection([('正常', '正常'), ('禁用', '禁用')], string='状态', default='正常')
|
||||
update_person = fields.Char(string='更新人', default=lambda self: self.env.user.name)
|
||||
update_time = fields.Datetime(string='更新时间', default=lambda self: fields.Datetime.now())
|
||||
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
sequence="599"
|
||||
/>
|
||||
|
||||
<menuitem id="menu_sf_work_log_setting"
|
||||
name="工作日历设置"
|
||||
parent="menu_sf_basic_setting"
|
||||
action="sf_work_log_setting_act"
|
||||
sequence="0"
|
||||
/>
|
||||
|
||||
<menuitem id="menu_sf_procedure_equipment_resource_setting"
|
||||
name="产线设备资源设置"
|
||||
parent="menu_sf_basic_setting"
|
||||
action="sf_procedure_equipment_resource_setting_act"
|
||||
sequence="0"
|
||||
/>
|
||||
<menuitem id="menu_sf_work_log_setting"
|
||||
name="工作日历设置"
|
||||
parent="menu_sf_basic_setting"
|
||||
action="sf_work_log_setting_act"
|
||||
sequence="10"
|
||||
/>
|
||||
|
||||
|
||||
<menuitem id="menu_sf_working_shift"
|
||||
name="班次"
|
||||
parent="menu_sf_basic_setting"
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
<field name="name">工作日历设置</field>
|
||||
<field name="model">sf.work.log.setting</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<tree string="工作日历设置">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="start_time"/>
|
||||
<field name="end_time"/>
|
||||
<field name="duration"/>
|
||||
<field name="day_off_ids" widget="many2many_tags"/>
|
||||
<field name="working_shift_ids" widget="many2many_tags"/>
|
||||
<field name="start_time" optional="hide"/>
|
||||
<field name="end_time" optional="hide"/>
|
||||
<field name="duration" optional="hide"/>
|
||||
<field name="status"/>
|
||||
<field name="update_person"/>
|
||||
<field name="update_time"/>
|
||||
@@ -30,38 +30,39 @@
|
||||
<field name="model">sf.work.log.setting</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<button string="查看日历"
|
||||
type="object"
|
||||
name="open_work_schedule_calendar"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
<field name="status" widget="statusbar" statusbar_visible="正常,禁用"/>
|
||||
</header>
|
||||
<sheet string-="工作日历设置">
|
||||
<group string="基础信息">
|
||||
<group>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="选择班次">
|
||||
<field name="working_shift_ids"/>
|
||||
</group>
|
||||
<group string="工作时间">
|
||||
<group>
|
||||
<field name="start_time"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="end_time"/>
|
||||
</group>
|
||||
</group>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="duration"/>
|
||||
<field name="day_off_ids"
|
||||
widget="many2many_tags"
|
||||
<field name="code"/>
|
||||
<field name="day_off_ids" widget="many2many_tags"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="status"/>
|
||||
</group>
|
||||
<group string="工作时间">
|
||||
<field name="start_time"/>
|
||||
<field name="end_time"/>
|
||||
<field name="duration"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="日历状态">
|
||||
<field name="status"/>
|
||||
<field name="setting_to_calendar_ids" invisible="True"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="选择班次">
|
||||
<field name="working_shift_ids"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="setting_to_calendar_ids" invisible="True"/>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
@@ -79,7 +80,7 @@
|
||||
<field name="name">休息日</field>
|
||||
<field name="model">sf.day.off</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<tree string="休息日" editable="bottom" delete="0">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -88,7 +89,7 @@
|
||||
<record id="sf_day_off_act" model="ir.actions.act_window">
|
||||
<field name="name">休息日</field>
|
||||
<field name="res_model">sf.day.off</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -97,7 +98,7 @@
|
||||
<field name="name">班次</field>
|
||||
<field name="model">sf.working.shift</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<tree string="班次" editable="bottom" >
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="start_time"/>
|
||||
@@ -107,32 +108,32 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_working_shift_form" model="ir.ui.view">
|
||||
<field name="name">班次</field>
|
||||
<field name="model">sf.working.shift</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="start_time"/>
|
||||
<field name="end_time"/>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="sf_working_shift_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">班次</field>-->
|
||||
<!-- <field name="model">sf.working.shift</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form>-->
|
||||
<!-- <sheet>-->
|
||||
<!-- <group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="name"/>-->
|
||||
<!-- <field name="start_time"/>-->
|
||||
<!-- <field name="end_time"/>-->
|
||||
<!-- <field name="remark"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="code"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- </sheet>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="sf_working_shift_act" model="ir.actions.act_window">
|
||||
<field name="name">班次</field>
|
||||
<field name="res_model">sf.working.shift</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -141,34 +142,35 @@
|
||||
<field name="name">工作日历</field>
|
||||
<field name="model">sf.work.schedule.calendar</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name_id" invisible="True"/>
|
||||
<tree string="工作日历" editable="bottom">
|
||||
<field name="calendar_code"/>
|
||||
<field name="name"/>
|
||||
<field name="name_id"/>
|
||||
<field name="date_time"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_work_schedule_calendar_form" model="ir.ui.view">
|
||||
<field name="name">工作日历</field>
|
||||
<field name="model">sf.work.schedule.calendar</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group string="日历基本信息">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="date_time"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name_id"/>
|
||||
<field name="calendar_code"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="sf_work_schedule_calendar_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">工作日历</field>-->
|
||||
<!-- <field name="model">sf.work.schedule.calendar</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form>-->
|
||||
<!-- <sheet>-->
|
||||
<!-- <group string="日历基本信息">-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="name"/>-->
|
||||
<!-- <field name="date_time"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="name_id"/>-->
|
||||
<!-- <field name="calendar_code"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- </sheet>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="sf_work_schedule_calendar_search" model="ir.ui.view">
|
||||
<field name="name">工作日历</field>
|
||||
@@ -196,7 +198,7 @@
|
||||
<record id="sf_work_schedule_calendar_act" model="ir.actions.act_window">
|
||||
<field name="name">工作日历</field>
|
||||
<field name="res_model">sf.work.schedule.calendar</field>
|
||||
<field name="view_mode">calendar,search,tree,form</field>
|
||||
<field name="view_mode">calendar,search,tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -207,15 +209,15 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="产线设备资源设置">
|
||||
<field name="work_center_name_id"/>
|
||||
<field name="equipment_code"/>
|
||||
<field name="equipment_name_id"/>
|
||||
<field name="brand"/>
|
||||
<field name="model"/>
|
||||
<field name="equipment_code"/>
|
||||
<field name="brand" optional="hide"/>
|
||||
<field name="model" optional="hide"/>
|
||||
<field name="working_procedure"/>
|
||||
<field name="production_capacity"/>
|
||||
<field name="working_calendar_id"/>
|
||||
<field name="working_shift_id" widget="many2many_tags"/>
|
||||
<field name="create_time"/>
|
||||
<field name="production_capacity" optional="hide"/>
|
||||
<field name="working_calendar_id" optional="hide"/>
|
||||
<field name="working_shift_id" widget="many2many_tags" optional="hide"/>
|
||||
<field name="create_time" optional="hide"/>
|
||||
<field name="status"/>
|
||||
<field name="participate_in_scheduling"/>
|
||||
<field name="name" invisible="True"/>
|
||||
@@ -229,41 +231,39 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="产线设备资源设置">
|
||||
<sheet>
|
||||
<group string="生产线">
|
||||
<group>
|
||||
<div>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="工作中心信息">
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="work_center_name_id"/>
|
||||
<field name="production_capacity"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="working_procedure"/>
|
||||
<field name="participate_in_scheduling"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="设备信息">`
|
||||
<group>
|
||||
<field name="equipment_name_id"/>
|
||||
<field name="brand"/>
|
||||
<field name="status"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="equipment_code" string="机台号"/>
|
||||
<field name="model"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="工作日历信息">
|
||||
<group>
|
||||
<field name="working_calendar_id"/>
|
||||
<field name="create_time"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="working_procedure"/>
|
||||
<field name="participate_in_scheduling"/>
|
||||
<field name="working_shift_id" widget="many2many_tags"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="设备信息">
|
||||
<group>`
|
||||
<group>
|
||||
<field name="equipment_name_id"/>
|
||||
<field name="brand"/>
|
||||
<field name="status"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="equipment_code" string="机台号"/>
|
||||
<field name="model"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="name" invisible="False"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" invisible="True"/>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
|
||||
<field name="mrs_cutting_tool_integral_model_ids"
|
||||
@@ -188,12 +188,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="name" invisible="False"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" invisible="True"/>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
|
||||
<field name="mrs_cutting_tool_integral_model_ids"
|
||||
@@ -385,12 +385,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="name" invisible="False"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" invisible="True"/>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
|
||||
<field name="mrs_cutting_tool_integral_model_ids"
|
||||
@@ -570,12 +570,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="name" invisible="False"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" invisible="True"/>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
|
||||
<field name="mrs_cutting_tool_integral_model_ids"
|
||||
@@ -1170,14 +1170,14 @@
|
||||
</header>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="functional_tool_code" readonly="1"/>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="functional_tool_type_id"/>
|
||||
<group>
|
||||
<group>
|
||||
<field name="functional_tool_code" readonly="1"/>
|
||||
<field name="functional_tool_type_id"/>
|
||||
<field name="functional_tool_diameter"/>
|
||||
<field name="functional_tool_length"/>
|
||||
<field name="functional_tool_cutting_type"/>
|
||||
|
||||
@@ -126,12 +126,16 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="刀具物料查询">
|
||||
<sheet>
|
||||
<group string='基本信息'>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="mrs_cutting_tool_material_name" invisible="1"/>
|
||||
<field name="sequence"/>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
<field name="mrs_machine_brand_id"/>
|
||||
<!-- <field name="mrs_cutting_tool_model_id"/> -->
|
||||
@@ -143,147 +147,158 @@
|
||||
<field name="three_d_model" widget="many2one"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string='刀具库存信息'>
|
||||
<group>
|
||||
<field name="number"/>
|
||||
<field name="mrs_materials_model_id"/>
|
||||
<field name="purchase_date"/>
|
||||
<field name="purchase_batch"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="supplier"/>
|
||||
<field name="warehouse_name"/>
|
||||
<field name="warehouse_area"/>
|
||||
<field name="warehouse_location"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string='刀具库存信息'>
|
||||
<group >
|
||||
<group>
|
||||
<field name="number"/>
|
||||
<field name="mrs_materials_model_id"/>
|
||||
<field name="purchase_date"/>
|
||||
<field name="purchase_batch"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="supplier"/>
|
||||
<field name="warehouse_name"/>
|
||||
<field name="warehouse_area"/>
|
||||
<field name="warehouse_location"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="刀片信息" attrs="{'invisible': [('cutting_tool_type','!=','刀片')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="blade_code" invisible="True"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_height"/>
|
||||
<field name="blade_radius"/>
|
||||
<field name="blade_hardness"/>
|
||||
<field name="blade_accuracy"/>
|
||||
<field name="blade_coating_material_id"/>
|
||||
<field name="mrs_cutting_tool_model_blade_cutter_bar_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="blade_top_angle"/>
|
||||
<field name="blade_front_angle"/>
|
||||
<field name="blade_rear_angle"/>
|
||||
<field name="blade_main_included_angle"/>
|
||||
<field name="blade_r_angle"/>
|
||||
<field name="blade_nut"/>
|
||||
<field name="mrs_cutting_tool_model_blade_cutter_pad_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="整体式刀具信息" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="integral_code" invisible="True"/>
|
||||
<field name="integral_total_length"/>
|
||||
<field name="integral_shank_length"/>
|
||||
<field name="integral_blade_length"/>
|
||||
<field name="integral_diameter"/>
|
||||
<field name="integral_blade_number"/>
|
||||
<field name="integral_accuracy"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="integral_front_angle"/>
|
||||
<field name="integral_rear_angle"/>
|
||||
<field name="integral_main_included_angle"/>
|
||||
<field name="integral_nut"/>
|
||||
<field name="integral_hardness"/>
|
||||
<field name="integral_coating_material"/>
|
||||
<field name="integral_scope"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="刀杆信息" attrs="{'invisible': [('cutting_tool_type','!=','刀杆')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="bar_code" invisible="True"/>
|
||||
<field name="bar_c_diameter"/>
|
||||
<field name="bar_total_length"/>
|
||||
<field name="bar_blade_number"/>
|
||||
<field name="bar_d_diameter"/>
|
||||
<field name="bar_scope"/>
|
||||
<field name="mrs_cutting_tool_model_bar_blade_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="bar_wrench"/>
|
||||
<field name="bar_screw"/>
|
||||
<field name="bar_radius"/>
|
||||
<field name="bar_accuracy"/>
|
||||
<field name="bar_hardness"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="刀盘信息" attrs="{'invisible': [('cutting_tool_type','!=','刀盘')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="pad_code" invisible="True"/>
|
||||
<field name="pad_c_diameter"/>
|
||||
<field name="pad_total_length"/>
|
||||
<field name="pad_blade_number"/>
|
||||
<field name="pad_d_diameter"/>
|
||||
<field name="pad_scope"/>
|
||||
<field name="mrs_cutting_tool_model_pad_blade_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="pad_wrench"/>
|
||||
<field name="pad_screw"/>
|
||||
<field name="pad_radius"/>
|
||||
<field name="pad_accuracy"/>
|
||||
<field name="pad_hardness"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="刀柄信息" attrs="{'invisible': [('cutting_tool_type','!=','刀柄')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="handle_code" invisible="True"/>
|
||||
<field name="handle_diameter"/>
|
||||
<field name="handle_flange_length"/>
|
||||
<field name="handle_flange_diameter"/>
|
||||
<field name="handle_clamping_diameter_min"/>
|
||||
<field name="handle_clamping_diameter_max"/>
|
||||
<field name="handle_clamping_range"/>
|
||||
<field name="handle_detection_accuracy"/>
|
||||
<field name="mrs_cutting_tool_model_handle_chuck_model_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="handle_jump_accuracy"/>
|
||||
<field name="handle_max_speed"/>
|
||||
<field name="handle_standard_speed"/>
|
||||
<field name="handle_weight"/>
|
||||
<field name="handle_body_accuracy"/>
|
||||
<field name="handle_nut"/>
|
||||
<field name="handle_detection_hardness"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="夹头信息" attrs="{'invisible': [('cutting_tool_type','!=','夹头')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="chuck_code" invisible="True"/>
|
||||
<field name="chuck_clamping_diameter_min"/>
|
||||
<field name="chuck_clamping_diameter_max"/>
|
||||
<field name="chuck_diameter"/>
|
||||
<field name="chuck_inner_diameter"/>
|
||||
<field name="chuck_feature"/>
|
||||
<field name="mrs_cutting_tool_model_chuck_handle_model_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="chuck_accuracy"/>
|
||||
<field name="chuck_height"/>
|
||||
<field name="chuck_nut"/>
|
||||
<field name="chuck_clamping_range"/>
|
||||
<field name="image"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
<group>
|
||||
<field name="cutting_tool_material_name" invisible="True"/>
|
||||
<field name="cutting_tool_type" invisible="True"/>
|
||||
</group>
|
||||
<group string="刀片信息" attrs="{'invisible': [('cutting_tool_type','!=','刀片')]}">
|
||||
<group>
|
||||
<field name="blade_code" invisible="True"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_height"/>
|
||||
<field name="blade_radius"/>
|
||||
<field name="blade_hardness"/>
|
||||
<field name="blade_accuracy"/>
|
||||
<field name="blade_coating_material_id"/>
|
||||
<field name="mrs_cutting_tool_model_blade_cutter_bar_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="blade_top_angle"/>
|
||||
<field name="blade_front_angle"/>
|
||||
<field name="blade_rear_angle"/>
|
||||
<field name="blade_main_included_angle"/>
|
||||
<field name="blade_r_angle"/>
|
||||
<field name="blade_nut"/>
|
||||
<field name="mrs_cutting_tool_model_blade_cutter_pad_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="整体式刀具信息" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<group>
|
||||
<field name="integral_code" invisible="True"/>
|
||||
<field name="integral_total_length"/>
|
||||
<field name="integral_shank_length"/>
|
||||
<field name="integral_blade_length"/>
|
||||
<field name="integral_diameter"/>
|
||||
<field name="integral_blade_number"/>
|
||||
<field name="integral_accuracy"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="integral_front_angle"/>
|
||||
<field name="integral_rear_angle"/>
|
||||
<field name="integral_main_included_angle"/>
|
||||
<field name="integral_nut"/>
|
||||
<field name="integral_hardness"/>
|
||||
<field name="integral_coating_material"/>
|
||||
<field name="integral_scope"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="刀杆信息" attrs="{'invisible': [('cutting_tool_type','!=','刀杆')]}">
|
||||
<group>
|
||||
<field name="bar_code" invisible="True"/>
|
||||
<field name="bar_c_diameter"/>
|
||||
<field name="bar_total_length"/>
|
||||
<field name="bar_blade_number"/>
|
||||
<field name="bar_d_diameter"/>
|
||||
<field name="bar_scope"/>
|
||||
<field name="mrs_cutting_tool_model_bar_blade_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="bar_wrench"/>
|
||||
<field name="bar_screw"/>
|
||||
<field name="bar_radius"/>
|
||||
<field name="bar_accuracy"/>
|
||||
<field name="bar_hardness"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="刀盘信息" attrs="{'invisible': [('cutting_tool_type','!=','刀盘')]}">
|
||||
<group>
|
||||
<field name="pad_code" invisible="True"/>
|
||||
<field name="pad_c_diameter"/>
|
||||
<field name="pad_total_length"/>
|
||||
<field name="pad_blade_number"/>
|
||||
<field name="pad_d_diameter"/>
|
||||
<field name="pad_scope"/>
|
||||
<field name="mrs_cutting_tool_model_pad_blade_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="pad_wrench"/>
|
||||
<field name="pad_screw"/>
|
||||
<field name="pad_radius"/>
|
||||
<field name="pad_accuracy"/>
|
||||
<field name="pad_hardness"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="刀柄信息" attrs="{'invisible': [('cutting_tool_type','!=','刀柄')]}">
|
||||
<group>
|
||||
<field name="handle_code" invisible="True"/>
|
||||
<field name="handle_diameter"/>
|
||||
<field name="handle_flange_length"/>
|
||||
<field name="handle_flange_diameter"/>
|
||||
<field name="handle_clamping_diameter_min"/>
|
||||
<field name="handle_clamping_diameter_max"/>
|
||||
<field name="handle_clamping_range"/>
|
||||
<field name="handle_detection_accuracy"/>
|
||||
<field name="mrs_cutting_tool_model_handle_chuck_model_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="handle_jump_accuracy"/>
|
||||
<field name="handle_max_speed"/>
|
||||
<field name="handle_standard_speed"/>
|
||||
<field name="handle_weight"/>
|
||||
<field name="handle_body_accuracy"/>
|
||||
<field name="handle_nut"/>
|
||||
<field name="handle_detection_hardness"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group string="夹头信息" attrs="{'invisible': [('cutting_tool_type','!=','夹头')]}">
|
||||
<group>
|
||||
<field name="chuck_code" invisible="True"/>
|
||||
<field name="chuck_clamping_diameter_min"/>
|
||||
<field name="chuck_clamping_diameter_max"/>
|
||||
<field name="chuck_diameter"/>
|
||||
<field name="chuck_inner_diameter"/>
|
||||
<field name="chuck_feature"/>
|
||||
<field name="mrs_cutting_tool_model_chuck_handle_model_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="chuck_accuracy"/>
|
||||
<field name="chuck_height"/>
|
||||
<field name="chuck_nut"/>
|
||||
<field name="chuck_clamping_range"/>
|
||||
<field name="image"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { registry } from "@web/core/registry";
|
||||
import { _lt } from "@web/core/l10n/translation";
|
||||
import { standardFieldProps } from "@web/views/fields/standard_field_props";
|
||||
import { useInputField } from "@web/views/fields/input_field_hook";
|
||||
import { FileUploader } from "@web/views/fields/file_handler";
|
||||
import { session } from "@web/session";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
import { isBinarySize } from "@web/core/utils/binary";
|
||||
import { download } from "@web/core/network/download";
|
||||
import {registry} from "@web/core/registry";
|
||||
import {_lt} from "@web/core/l10n/translation";
|
||||
import {standardFieldProps} from "@web/views/fields/standard_field_props";
|
||||
import {useInputField} from "@web/views/fields/input_field_hook";
|
||||
import {FileUploader} from "@web/views/fields/file_handler";
|
||||
import {session} from "@web/session";
|
||||
import {useService} from "@web/core/utils/hooks";
|
||||
import {isBinarySize} from "@web/core/utils/binary";
|
||||
import {download} from "@web/core/network/download";
|
||||
import utils from 'web.utils';
|
||||
|
||||
import core from 'web.core';
|
||||
@@ -16,13 +16,14 @@ import rpc from 'web.rpc';
|
||||
|
||||
var QWeb = core.qweb;
|
||||
|
||||
import { Component, onWillUpdateProps, useState, useRef, useEffect } from "@odoo/owl";
|
||||
import {Component, onWillUpdateProps, useState, useRef, useEffect} from "@odoo/owl";
|
||||
|
||||
export class StepViewer extends Component {
|
||||
setup() {
|
||||
this.props.url = this.formatUrl();
|
||||
}
|
||||
formatUrl(){
|
||||
|
||||
formatUrl() {
|
||||
var url = '';
|
||||
if (this.props.value) {
|
||||
if (this.props.value.slice(-1) == 'b' && !isNaN(this.props.value.split(' ')[0])) {
|
||||
@@ -30,23 +31,27 @@ export class StepViewer extends Component {
|
||||
base_url: session['web.base.url'],
|
||||
model: this.props.record.resModel,
|
||||
id: JSON.stringify(this.props.record.data['id']),
|
||||
field: this.props.name}
|
||||
url = url_props['base_url'].replace('http://', 'https://') +'/web/content/'+url_props['model']+'/'+url_props['id']+'/'+url_props['field']+'?download=true'
|
||||
field: this.props.name
|
||||
}
|
||||
url = url_props['base_url'].replace('http://', 'https://') + '/web/content/' + url_props['model'] + '/' + url_props['id'] + '/' + url_props['field'] + '?download=true'
|
||||
// url = 'http://localhost:8069'+'/web/content/'+url_props['model']+'/'+url_props['id']+'/'+url_props['field']+'?download=true'
|
||||
console.log('url111111',url)
|
||||
console.log('url111111', url)
|
||||
return url
|
||||
} else {
|
||||
url = "data:model/gltf-binary;base64," + this.props.value;
|
||||
console.log('url2',url)
|
||||
return url
|
||||
// localStorage.setItem('url',url)
|
||||
// let new_url = localStorage.getItem(('url'))
|
||||
// var oViewer = document.getElementsByTagName('model-viewer')[0];
|
||||
// return new_url
|
||||
// url = "web_widget_model_viewer/static/src/images/not_model.png";
|
||||
url = "data:model/gltf-binary;base64," + this.props.value;
|
||||
console.log('url2', url)
|
||||
return url
|
||||
// localStorage.setItem('url',url)
|
||||
// let new_url = localStorage.getItem(('url'))
|
||||
// var oViewer = document.getElementsByTagName('model-viewer')[0];
|
||||
// return new_url
|
||||
// url = "web_widget_model_viewer/static/src/images/not_model.png";
|
||||
}
|
||||
} else {
|
||||
var oImg = document.getElementsByClassName('test')[0]
|
||||
console.log(oImg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StepViewer.template = "web_widget_model_viewer.BinaryField3d";
|
||||
@@ -56,10 +61,10 @@ StepViewer.supportedTypes = ["binary"];
|
||||
|
||||
StepViewer.props = {
|
||||
...standardFieldProps,
|
||||
url: { type: String, optional: true },
|
||||
url: {type: String, optional: true},
|
||||
};
|
||||
|
||||
StepViewer.extractProps = ({ attrs }) => {
|
||||
StepViewer.extractProps = ({attrs}) => {
|
||||
return {
|
||||
url: attrs.options.url,
|
||||
};
|
||||
|
||||
@@ -2,37 +2,42 @@
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="web_widget_model_viewer.BinaryField3d" owl="1">
|
||||
|
||||
<model-viewer
|
||||
t-att-src='props.url'
|
||||
name="3D model"
|
||||
alt="3D model"
|
||||
auto-rotate="1"
|
||||
camera-controls="1"
|
||||
style ="background-color: #0D1D54;"
|
||||
>
|
||||
|
||||
<t t-if="props.value">
|
||||
<model-viewer
|
||||
t-att-src='props.url'
|
||||
name="3D model"
|
||||
alt="3D model"
|
||||
auto-rotate="1"
|
||||
camera-controls="1"
|
||||
style="background-color: #0D1D54;"
|
||||
>
|
||||
<!-- <div class="text-center mt-4 mb-4 mr-4">-->
|
||||
<!-- <span-->
|
||||
<!-- id="model-viewer-fullscreen"-->
|
||||
<!-- title="View fullscreen"-->
|
||||
<!-- role="img"-->
|
||||
<!-- aria-label="Fullscreen"-->
|
||||
<!-- >-->
|
||||
<!-- <i class="fa fa-arrows-alt fa-2x"/>-->
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
</model-viewer>
|
||||
|
||||
<!-- <model-viewer-->
|
||||
<!-- src='/jikimo_model_viewer/static/src/js/3d_viewer/test.glb'-->
|
||||
<!-- name="Test 3D model"-->
|
||||
<!-- alt="Test 3D model"-->
|
||||
<!-- auto-rotate="1"-->
|
||||
<!-- camera-controls="1"-->
|
||||
<!-- />-->
|
||||
|
||||
<!-- <span-->
|
||||
<!-- id="model-viewer-fullscreen"-->
|
||||
<!-- title="View fullscreen"-->
|
||||
<!-- role="img"-->
|
||||
<!-- aria-label="Fullscreen"-->
|
||||
<!-- >-->
|
||||
<!-- <i class="fa fa-arrows-alt fa-2x"/>-->
|
||||
<!-- </span>-->
|
||||
<!-- </div>-->
|
||||
</model-viewer>
|
||||
</t>
|
||||
<t t-if="!props.value">
|
||||
<div style="color:red">当前制造订单暂无模型</div>
|
||||
</t>
|
||||
|
||||
<!-- <model-viewer-->
|
||||
<!-- src='/jikimo_model_viewer/static/src/js/3d_viewer/test.glb'-->
|
||||
<!-- name="Test 3D model"-->
|
||||
<!-- alt="Test 3D model"-->
|
||||
<!-- auto-rotate="1"-->
|
||||
<!-- camera-controls="1"-->
|
||||
<!-- />-->
|
||||
|
||||
<script type="module"
|
||||
src="/web_widget_model_viewer/static/src/lib/model-viewer.min.js">
|
||||
src="/web_widget_model_viewer/static/src/lib/model-viewer.min.js">
|
||||
</script>
|
||||
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user