Merge branch 'develop' into feature/必填字段label添加星号
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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -22,11 +22,10 @@
|
||||
'views/ftp_button.xml',
|
||||
|
||||
'views/compensation.xml',
|
||||
|
||||
'views/SfWorkOrderBarcodes.xml',
|
||||
# 'views/SfWorkOrderBarcodes.xml',
|
||||
'views/WorkCenterBarcodes.xml',
|
||||
'views/Stock_picking_Barcodes.xml',
|
||||
'views/machine_monitor.xml',
|
||||
# 'views/machine_monitor.xml',
|
||||
'views/machine_info_present.xml',
|
||||
'views/delivery_record.xml',
|
||||
'views/res_config_settings_views.xml',
|
||||
|
||||
@@ -13,6 +13,11 @@ from odoo.exceptions import ValidationError
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.addons.sf_machine_connect.models import py2opcua, ftp_operate
|
||||
|
||||
import shutil
|
||||
from io import BytesIO
|
||||
from zipfile import ZipFile
|
||||
from odoo.exceptions import MissingError
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -537,21 +542,69 @@ class WorkCenterBarcode(models.Model):
|
||||
else:
|
||||
return False
|
||||
|
||||
def cnc_file_download(self):
|
||||
"""
|
||||
一个下载当前cnc所有nc文件为一个zip包的功能
|
||||
"""
|
||||
self.ensure_one()
|
||||
|
||||
class CuttingTimeToolType(models.Model):
|
||||
_inherit = 'sf.cutting_tool.type'
|
||||
total_cut_time = fields.Char(string='总切削时长')
|
||||
predict_life_time = fields.Char(string='预估寿命')
|
||||
# 只能看到未被占用的刀位,或者有提示说占没占用
|
||||
tool_position = fields.Char(string='选择刀位')
|
||||
# cnc_ids = fields.One2many(string='选择机床')
|
||||
is_connect_tool_position = fields.Boolean(string='是否已绑定刀位', default=False)
|
||||
# 如果没有附件,直接返回
|
||||
if not self.cnc_ids:
|
||||
return
|
||||
|
||||
def tool_connect_machine(self):
|
||||
pass
|
||||
# 处理第一个附件的文件名
|
||||
first_attachment = self.cnc_ids[0].cnc_id
|
||||
file_name = first_attachment.display_name.split('-')[0] + '.zip'
|
||||
|
||||
def tool_unconnect_machine(self):
|
||||
pass
|
||||
# 创建一个内存文件和一个zip文件
|
||||
memory_file = BytesIO()
|
||||
with ZipFile(memory_file, 'w') as zipf:
|
||||
# 遍历需要下载的附件
|
||||
for item in self.cnc_ids:
|
||||
a = item.cnc_id
|
||||
datas = base64.standard_b64decode(a.datas)
|
||||
|
||||
# 将nc文件写入zip文件
|
||||
zipf.writestr(a.display_name, datas)
|
||||
|
||||
# 然后可以创建一个ir.attachment对象,将生成的zip文件保存为一个新的附件
|
||||
memory_file.seek(0)
|
||||
output = base64.b64encode(memory_file.read())
|
||||
memory_file.close()
|
||||
|
||||
attachment_data = {
|
||||
'name': file_name,
|
||||
'type': 'binary',
|
||||
'res_model': self._name,
|
||||
'res_id': self.id,
|
||||
'datas': output
|
||||
}
|
||||
attachment = self.env['ir.attachment'].create(attachment_data)
|
||||
|
||||
# 返回附件的下载链接
|
||||
download_url = '/web/content/%s?download=true' % attachment.id
|
||||
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'url': str(base_url) + download_url,
|
||||
'target': 'self',
|
||||
}
|
||||
|
||||
|
||||
# class CuttingTimeToolType(models.Model):
|
||||
# _inherit = 'sf.cutting_tool.type'
|
||||
# total_cut_time = fields.Char(string='总切削时长')
|
||||
# predict_life_time = fields.Char(string='预估寿命')
|
||||
# # 只能看到未被占用的刀位,或者有提示说占没占用
|
||||
# tool_position = fields.Char(string='选择刀位')
|
||||
# # cnc_ids = fields.One2many(string='选择机床')
|
||||
# is_connect_tool_position = fields.Boolean(string='是否已绑定刀位', default=False)
|
||||
#
|
||||
# def tool_connect_machine(self):
|
||||
# pass
|
||||
#
|
||||
# def tool_unconnect_machine(self):
|
||||
# pass
|
||||
|
||||
|
||||
class DeliveryRecord(models.Model):
|
||||
@@ -579,4 +632,3 @@ class DeliveryRecord(models.Model):
|
||||
# return super().create(values)
|
||||
# except:
|
||||
# raise Exception('b_purchase_order.py:create()')
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="inherit_id" ref="sf_manufacturing.view_mrp_production_workorder_tray_form_inherit_sf"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header" position="inside">
|
||||
<button string="程序下载" name="cnc_file_download" type="object" class="oe_highlight"/>
|
||||
</xpath>
|
||||
<xpath expr="//page//field[@name='cnc_ids']" position="before">
|
||||
<group>
|
||||
<group>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
BIN
web_widget_model_viewer/static/src/images/not_model.png
Normal file
BIN
web_widget_model_viewer/static/src/images/not_model.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
@@ -19,31 +19,34 @@ var QWeb = core.qweb;
|
||||
import { Component, onWillUpdateProps, useState, useRef, useEffect } from "@odoo/owl";
|
||||
|
||||
export class StepViewer extends Component {
|
||||
setup() {
|
||||
console.log('setup')
|
||||
setup() {
|
||||
this.props.url = this.formatUrl();
|
||||
}
|
||||
|
||||
formatUrl(){
|
||||
var url = '';
|
||||
if (this.props.value) {
|
||||
if (utils.is_bin_size(this.props.value)) {
|
||||
if (this.props.value.slice(-1) == 'b' && !isNaN(this.props.value.split(' ')[0])) {
|
||||
var url_props = {
|
||||
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']+'/web/content/'+url_props['model']+'/'+url_props['id']+'/'+url_props['field']+'?download=true'
|
||||
console.log('url', url)
|
||||
|
||||
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)
|
||||
return url
|
||||
} else {
|
||||
url = "data:model/gltf-binary;base64," + this.props.value;
|
||||
console.log('url222', url)
|
||||
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";
|
||||
}
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
StepViewer.template = "web_widget_model_viewer.BinaryField3d";
|
||||
|
||||
Reference in New Issue
Block a user