Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug

# Conflicts:
#	sf_maintenance/views/maintenance_views.xml
This commit is contained in:
qihao.gong@jikimo.com
2023-09-15 14:27:16 +08:00
21 changed files with 532 additions and 325 deletions

View File

@@ -49,24 +49,29 @@ td.o_required_modifier {
display: flex;
flex-direction: column;
position: absolute;
top: 0;
top: 28px;
bottom: 0;
right: 8px;
right: 18px;
margin: auto;
height: 34px;
//height: 34px;
height: unset !important;
align-items: center;
}
.show_state > div {
width: 12px;
width: 20px;
height: 12px;
border: 1px solid #000
}
.show_state > div:nth-child(2) {
border-top: none;
.show_state > div:nth-child(1) {
border-bottom: none;
}
.show_state > div:nth-child(2) {
border-top: 1px solid black !important;
}
.oe_kanban_card.kanban_color_2 {
background-color: #FF4343 !important;
color: #fff;
@@ -83,6 +88,11 @@ td.o_required_modifier {
color: #fff;
}
.my-image div {
width: 122px !important;
height: 122px !important;
}
.my-image img {
width: 100%;
height: 100%;
@@ -148,4 +158,101 @@ td.o_required_modifier {
justify-content: flex-start;
}
//-----------------------------------------------------------
.o_list_view .o_list_table thead {
position: sticky;
top: 0;
z-index: 100000;
}
//.o_list_view .o_list_table {
// height: 1799px !important;
//}
.table-responsive {
overflow: unset;
}
.o_form_view.o_xxl_form_view .o_form_sheet_bg > .o_form_statusbar {
position: sticky !important;
top: 0;
z-index: 100000;
}
//-----------------------------------------------------------
//图文展示换行及对齐
.many2many_flex {
flex-wrap: wrap;
}
.many2many_flex > div {
width: 110px;
margin-right: 15px;
display: flex;
flex-direction: column;
align-items: flex-start;
}
div[class="o_content o_component_with_search_panel"] .oe_kanban_color_0 {
position: relative;
padding: 0 !important;
}
div[class="o_content o_component_with_search_panel"] img[name="equipment_image"] {
width: 150px !important;
height: 150px !important;
}
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
position: absolute;
top: -52px;
left: -55px;
width: 80px;
}
div[class="o_content o_component_with_search_panel"] .o_primary > span:nth-of-type(1) {
position: absolute;
top: 10px;
left: 168px;
}
div[class="o_content o_component_with_search_panel"] .o_primary > span:nth-of-type(2) {
margin-left: 18px;
}
div[class="o_content o_component_with_search_panel"] .o_kanban_dashboard:not(.o_legacy_kanban_view) .o_kanban_record > div .o_kanban_manage_toggle_button {
top: 10px !important;
right: 17px !important;
}
div[class="o_content o_component_with_search_panel"] .o_kanban_record_headings .ml8 {
margin-left: 0px !important;
}
div[class="o_content o_component_with_search_panel"] .o_kanban_dashboard:not(.o_legacy_kanban_view) .o_kanban_record > div .o_kanban_card_content {
min-height: 0 !important;
height: 0 !important;
}
div[class="o_content o_component_with_search_panel"] .o_kanban_dashboard:not(.o_legacy_kanban_view) .o_kanban_record > div .o_kanban_card_header + .container.o_kanban_card_content {
margin-top: -5px !important;
}
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_left {
right: 10px;
padding: 0 !important;
}
div[class="o_content o_component_with_search_panel"] .show_state {
right: 10px !important;
top: 45px !important;
}
div[class="o_content o_component_with_search_panel"] .show_state span {
margin-top: 10px;
font-size: 12px;
}
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
position: absolute;
top: 55px;
right: 263px;
}

View File

@@ -27,7 +27,7 @@ class Sf_Bf_Connect(http.Controller):
bfm_process_order_list = json.loads(kw['bfm_process_order_list'])
order_id = request.env['sale.order'].with_user(request.env.ref("base.user_admin")).sale_order_create(
company_id, kw['delivery_name'], kw['delivery_telephone'], kw['delivery_address'],
kw['delivery_end_date'])
kw['delivery_end_date'], kw['payments_way'], kw['pay_way'])
i = 1
# 给sale_order的default_code字段赋值
aa = request.env['sale.order'].sudo().search([('name', '=', order_id.name)])

View File

@@ -11,7 +11,7 @@
'category': 'sf',
'website': 'https://www.sf.jikimo.com',
'depends': ['mrp', 'base', 'sale', 'sf_manufacturing', 'web_widget_model_viewer', 'mrp_subcontracting', 'purchase_stock',
'uom'],
'uom','jikimo_frontend'],
'data': [
'data/product_data.xml',
'data/uom_data.xml',

View File

@@ -336,23 +336,24 @@
</group>
<group col="1" attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
<group string="适合加工方式">
<field name="suitable_machining_method_ids" string="" widget="many2many_checkboxes"/>
<field name="suitable_machining_method_ids" string=""
widget="custom_many2many_checkboxes"/>
</group>
<group>
<group string="刀尖特征">
<field name="blade_tip_characteristics_ids" string=""
widget="many2many_checkboxes"/>
widget="custom_many2many_checkboxes"/>
</group>
<group string="柄部类型">
<field name="handle_type_ids" string="" widget="many2many_checkboxes"/>
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"/>
</group>
</group>
<group>
<group string="走刀方向">
<field name="cutting_direction_ids" string="" widget="many2many_checkboxes"/>
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
</group>
<group string="适合冷却液">
<field name="suitable_coolant_ids" string="" widget="many2many_checkboxes"/>
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
</group>
</group>
<notebook>

View File

@@ -44,11 +44,9 @@ class SfMaintenanceEquipment(models.Model):
overhaul_period = fields.Integer(string='预防检修频次')
overhaul_duration = fields.Float(string='检修时长')
overhaul_id = fields.Many2one('equipment.maintenance.standards', string='设备检修标准',
domain="[('maintenance_type','=','检修')]")
@api.onchange('eq_maintenance_id', 'overhaul_id')
def _compute_equipment_maintenance_standards_ids(self):
for record in self:
@@ -145,7 +143,6 @@ class SfMaintenanceEquipment(models.Model):
machine_tool_id = fields.Many2one('sf.machine_tool', '机床')
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_id', '设备故障日志')
def name_get(self):
result = []
for parameter in self:
@@ -156,7 +153,6 @@ class SfMaintenanceEquipment(models.Model):
result.append((parameter.id, name))
return result
@api.constrains('rotate_speed')
def _check_rotate_speed(self):
if self.rotate_speed <= 0:
@@ -478,14 +474,17 @@ class SfMaintenanceEquipment(models.Model):
image_id = fields.Many2many('maintenance.equipment.image', 'equipment_id', string='设备图文')
class MaintenanceStandardImage(models.Model):
_name = 'maintenance.equipment.image'
_description = '设备图文展示'
_description = '能力特征库'
active = fields.Boolean('有效', default=True)
name = fields.Char('加工能力')
image = fields.Binary(string='设备图文')
name = fields.Char('名称')
image = fields.Binary(string='图文')
type = fields.Selection(
[('加工能力', '加工能力'), ('刀尖特征', '刀尖特征'), ('柄部类型', '柄部类型'), ('走刀方向', '走刀方向'), ('冷却液', '冷却液')],
string='特征')
equipment_id = fields.Many2many('maintenance.equipment', 'image_id', string='设备')
@api.model
@@ -518,6 +517,3 @@ class MaintenanceStandardImage(models.Model):
new_res.append([id, name, data_uri])
# 返回新的结果列表
return new_res

View File

@@ -337,12 +337,6 @@
<div class="o_kanban_record_bottom state_zc">
<field name="technician_user_id"/>
</div>
<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">-->
<!-- <field name="factory_id"/>-->
<!-- <span> | </span>-->
@@ -354,6 +348,12 @@
<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>
<p 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"/>
</p>
</div>
</div>
</t>
@@ -385,8 +385,9 @@
<field name="name">maintenance.equipment.image.tree</field>
<field name="model">maintenance.equipment.image</field>
<field name="arch" type="xml">
<tree string="设备图文">
<tree string="能力特征库">
<field name="name"/>
<field name="type"/>
<field name="image" widget="image"/>
<field name="equipment_id" invisible="1"/>
<field name="active" invisible="1"/>
@@ -398,11 +399,12 @@
<field name="name">maintenance.equipment.image.form</field>
<field name="model">maintenance.equipment.image</field>
<field name="arch" type="xml">
<form string="设备图文">
<form string="能力特征库">
<sheet>
<group>
<field name="name"/>
<field name="image" widget="image"/>
<field name="name" required="1"/>
<field name="type" required="1"/>
<field name="image" widget="image" required="1"/>
<field name="equipment_id" invisible="1"/>
<field name="active" invisible="1"/>
</group>
@@ -412,14 +414,14 @@
</record>
<record id="action_maintenance_equipment_image" model="ir.actions.act_window">
<field name="name">设备图文图文</field>
<field name="name">能力特征库</field>
<field name="res_model">maintenance.equipment.image</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
</record>
<menuitem
<menuitem
id="maintenance_equipment_image_form"
name="设备图文展示"
name="能力特征库"
parent="maintenance.menu_m_request"
action="action_maintenance_equipment_image"
groups="maintenance.group_equipment_manager,base.group_user"

View File

@@ -1,8 +1,8 @@
from odoo import models, fields, api
from odoo.exceptions import ValidationError
from odoo.modules import get_resource_path
from OCC.Extend.DataExchange import read_step_file
from OCC.Extend.DataExchange import write_stl_file
# from OCC.Extend.DataExchange import read_step_file
# from OCC.Extend.DataExchange import write_stl_file
import logging
import base64
import hashlib
@@ -91,15 +91,19 @@ class ResProductMo(models.Model):
cutting_tool_coarse_medium_fine = fields.Selection([('', ''), ('', ''), ('', '')], '粗/中/精')
cutting_tool_run_out_accuracy_max = fields.Float('端跳精度max', digits=(6, 1))
cutting_tool_run_out_accuracy_min = fields.Float('端跳精度min', digits=(6, 1))
suitable_machining_method_ids = fields.Many2many('sf.suitable.machining.method',
'rel_suitable_machining_method_product_template', '适合加工方式')
blade_tip_characteristics_ids = fields.Many2many('sf.blade.tip.characteristics',
'rel_blade_tip_characteristics_product_template', '刀尖特征')
handle_type_ids = fields.Many2many('sf.handle.type', 'rel_handle_type_product_template', '柄部类型')
cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction_product_template',
'走刀方向')
suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant_product_template',
'适合冷却液')
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
'rel_machining_product_template', '适合加工方式',
domain=[('type', '=', '加工能力')])
blade_tip_characteristics_ids = fields.Many2many('maintenance.equipment.image',
'rel_blade_tip_product_template', '刀尖特征',
domain=[('type', '=', '刀尖特征')])
handle_type_ids = fields.Many2many('maintenance.equipment.image', 'rel_handle_product_template', '柄部类型',
domain=[('type', '=', '柄部类型')])
cutting_direction_ids = fields.Many2many('maintenance.equipment.image', 'rel_cutting_product_template',
'走刀方向', domain=[('type', '=', '走刀方向')])
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template',
'适合冷却液', domain=[('type', '=', '冷却液')])
# @api.constrains('suitable_machining_method_ids')
# def _check_suitable_machining_method_ids(self):
@@ -734,7 +738,7 @@ class ResProductMo(models.Model):
def transition_glb_file(self, report_path, code):
shapes = read_step_file(report_path)
output_file = os.path.join('/tmp', str(code) + '.stl')
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
# write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
# 转化为glb
output_glb_file = os.path.join('/tmp', str(code) + '.glb')
util_path = get_resource_path('sf_dlm', 'static/util')
@@ -797,6 +801,7 @@ class ResMrpBomMo(models.Model):
else:
return False
# 查询材料型号默认排第一的供应商
def get_supplier(self, materials_type):

View File

@@ -189,6 +189,8 @@ class StockRule(models.Model):
'mail.message_origin_link',
values={'self': production, 'origin': origin_production},
subtype_id=self.env.ref('mail.mt_note').id)
'''
创建生产计划
'''
@@ -211,7 +213,6 @@ class StockRule(models.Model):
'product_id': production.product_id.id,
'state': 'draft',
})
return True

View File

@@ -31,28 +31,82 @@
<field name="arch" type="xml">
<!-- Desktop view -->
<xpath expr='(//field[@name="name"])[1]' position="after">
<field name="equipment_status" />
<field name="equipment_image" />
</xpath>
<xpath expr='(//field[@name="name"])[2]' position="after">
<field name="equipment_status" />
<field name="equipment_image" widget="image" />
</xpath>
<xpath expr='(//a[@name="unblock"])' position="after">
<div class="czyg">绿色:正常,红色:故障,黄色:下线/暂停</div>
</xpath>
</field>
</record>
<record id="mrp_workcenter_view_kanban_inherit_workorder" model="ir.ui.view">
<field name="name">mrp.workcenter.view.kanban.inherit.mrp.workorder</field>
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
<field name="arch" type="xml">
<!-- Desktop view -->
<xpath expr='(//field[@name="name"])[1]' position="before">
<field name="equipment_status"/>
<field name="equipment_image"/>
</xpath>
<xpath expr='(//field[@name="name"])[2]' position="before">
<field name="equipment_image" widget="image"/>
</xpath>
<xpath expr='(//a[@name="unblock"])' position="after">
<!-- <div class="czyg">绿色:正常,红色:故障,黄色:下线/暂停</div>-->
</xpath>
</field>
</record>
<!--&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;-->
<record id="mrp_workcenter_kanban_inherit1" model="ir.ui.view">
<field name="name">mrp.workcenter.kanban.inherit</field>
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
<field name="arch" type="xml">
<xpath expr="//kanban//templates//t" position="inside">
<p 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.equipment_status.raw_value == '正常' ? 'color_1' : ''}"></div>
<div t-attf-class="#{record.equipment_status.raw_value == '故障' ? 'color_2' : ''}"></div>
<div t-attf-class="#{record.equipment_status.raw_value == '不可用' ? 'color_3' : ''}"></div>
<span t-attf-class="#{record.equipment_status.raw_value == '正常' ? 'font_color_1' : ''}
#{record.equipment_status.raw_value == '故障' ? 'font_color_2' : ''}
#{record.equipment_status.raw_value == '不可用' ? 'font_color_3' : ''}">
<field name="equipment_status"/>
</span>
</p>
</xpath>
</field>
</record>
<!-- 继承原有的看板视图 -->
<record id="mrp_workcenter_kanban_inherit1" model="ir.ui.view">
<field name="name">mrp.workcenter.kanban.inherit</field>
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
<field name="arch" type="xml">
<xpath expr="//kanban//templates//t" position="inside">
<p 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.equipment_status.raw_value == '正常' ? 'color_1' : ''}"></div>
<div t-attf-class="#{record.equipment_status.raw_value == '故障' ? 'color_2' : ''}"></div>
<div t-attf-class="#{record.equipment_status.raw_value == '不可用' ? 'color_3' : ''}"></div>
<span t-attf-class="#{record.equipment_status.raw_value == '正常' ? 'font_color_1' : ''}
#{record.equipment_status.raw_value == '故障' ? 'font_color_2' : ''}
#{record.equipment_status.raw_value == '不可用' ? 'font_color_3' : ''}">
<field name="equipment_status"/>
</span>
</p>
</xpath>
</field>
</record>
<!-- override to change the no content image -->
<record id="mrp.action_work_orders" model="ir.actions.act_window">
<field name="help" type="html">
@@ -118,202 +172,203 @@
</field>
</record>
<record id="mrp_workcenter_view_kanban_inherit_maintenance" model="ir.ui.view">
<field name="name">mrp.workcenter.view.kanban.inherit.maintenance</field>
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='plan_order']" position="after">
<div>
<a name="%(maintenance.hr_equipment_request_action)d" type="action">Maintenance</a>
</div>
</xpath>
</field>
</record>
<record id="mrp_workcenter_view_kanban_inherit_maintenance" model="ir.ui.view">
<field name="name">mrp.workcenter.view.kanban.inherit.maintenance</field>
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='plan_order']" position="after">
<div>
<a name="%(maintenance.hr_equipment_request_action)d" type="action">Maintenance</a>
</div>
</xpath>
</field>
</record>
<!-- 此段勿删,备用。待生产线驾驶舱完全确定下拉并完成后再行删除!!! -->
<!-- 此段勿删,备用。待生产线驾驶舱完全确定下拉并完成后再行删除!!! -->
<!-- --><!-- 继承原有的看板视图 -->
<!-- <record id="mrp_workcenter_kanban_inherit1" model="ir.ui.view"> -->
<!-- <field name="name">mrp.workcenter.kanban.inherit</field> -->
<!-- <field name="model">mrp.workcenter</field> -->
<!-- <field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/> -->
<!-- <field name="arch" type="xml"> -->
<!-- <xpath expr="//kanban" position="replace"> -->
<!-- <kanban class="oe_background_grey o_kanban_dashboard o_workcenter_kanban" create="0" sample="1" -->
<!-- > -->
<!-- <field name="name"/> -->
<!-- <field name="color"/> -->
<!-- <field name="workorder_count"/> -->
<!-- <field name="working_state"/> -->
<!-- <field name="oee_target"/> -->
<!-- <field name="production_line_show"/> -->
<!-- <field name="production_line_id"/> -->
<!-- <templates> -->
<!-- <t t-name="kanban-box" -->
<!-- t-if="record.production_line_id.value == record.production_line_show.raw_value"> -->
<!-- <div t-on-click="console.log(record.production_line_id,'11111111111')"></div>--> -->
<!-- <div t-on-click="console.log(record.production_line_show,'22222222222')"></div>--> -->
<!-- <div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}"> -->
<!-- <div t-attf-class="o_kanban_card_header o_kanban_record_top"> -->
<!-- <div class="o_kanban_record_headings o_kanban_card_header_title"> -->
<!-- <span class="o_primary ml8" style="display: inline-block"> -->
<!-- <field name="name"/> -->
<!-- </span> -->
<!-- </div> -->
<!-- <div class="o_kanban_manage_button_section"> -->
<!-- <a class="o_kanban_manage_toggle_button" href="#"> -->
<!-- <i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/> -->
<!-- </a> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="container o_kanban_card_content"> -->
<!-- <div class="row mb16"> -->
<!-- <div class="col-6 o_kanban_primary_left"> -->
<!-- <div class="btn-group" name="o_wo"> -->
<!-- <t t-if="record.workorder_count.raw_value &gt; 0"> -->
<!-- <button class="btn btn-primary" name="action_work_order" -->
<!-- type="object" -->
<!-- context="{'search_default_ready': 1, 'search_default_progress': 1}"> -->
<!-- <span>WORK ORDERS</span> -->
<!-- </button> -->
<!-- </t> -->
<!-- <t t-if="record.workorder_count.raw_value &lt;= 0"> -->
<!-- <button class="btn btn-warning" -->
<!-- name="%(mrp.act_product_mrp_production_workcenter)d" -->
<!-- type="action"> -->
<!-- <span>PLAN ORDERS</span> -->
<!-- </button> -->
<!-- </t> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="col-6 o_kanban_primary_right"> -->
<!-- <div class="row" t-if="record.workorder_ready_count.raw_value &gt; 0"> -->
<!-- <div class="col-8"> -->
<!-- <a name="action_work_order" type="object" -->
<!-- context="{'search_default_ready': 1}"> -->
<!-- To Launch -->
<!-- </a> -->
<!-- </div> -->
<!-- <div class="col-4 text-end"> -->
<!-- <field name="workorder_ready_count"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row" t-if="record.workorder_progress_count.raw_value &gt; 0"> -->
<!-- <div class="col-8"> -->
<!-- <a name="action_work_order" type="object" -->
<!-- context="{'search_default_progress': 1}"> -->
<!-- In Progress -->
<!-- </a> -->
<!-- </div> -->
<!-- <div class="col-4 text-end"> -->
<!-- <field name="workorder_progress_count"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row" t-if="record.workorder_late_count.raw_value &gt; 0"> -->
<!-- <div class="col-8"> -->
<!-- <a name="action_work_order" type="object" -->
<!-- context="{'search_default_late': 1}"> -->
<!-- Late -->
<!-- </a> -->
<!-- </div> -->
<!-- <div class="col-4 text-end"> -->
<!-- <field name="workorder_late_count"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row" t-if="record.oee.raw_value &gt; 0"> -->
<!-- <div class="col-6"> -->
<!-- <a name="%(mrp.mrp_workcenter_productivity_report_oee)d" -->
<!-- type="action"> -->
<!-- OEE -->
<!-- </a> -->
<!-- </div> -->
<!-- <div class="col-6 text-end"> -->
<!-- <span t-att-class="record.oee_target.raw_value and (record.oee.raw_value &lt; record.oee_target.raw_value) and 'text-danger' or (record.oee.raw_value &gt; record.oee_target.raw_value) and 'text-success' or 'text-warning'"> -->
<!-- <strong> -->
<!-- <field name="oee" widget="integer"/>% -->
<!-- </strong> -->
<!-- </span> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row"> -->
<!-- <div class="col-12 o_kanban_primary_left" -->
<!-- style="position:absolute; bottom:10px;" name="wc_stages"> -->
<!-- <a name="%(mrp.act_mrp_block_workcenter)d" type="action" -->
<!-- class="o_status float-end" -->
<!-- title="No workorder currently in progress. Click to mark work center as blocked." -->
<!-- aria-label="No workorder currently in progress. Click to mark work center as blocked." -->
<!-- attrs="{'invisible': [('working_state','in',('blocked','done'))]}"/> -->
<!-- <a name="unblock" type="object" class=" o_status o_status_red float-end" -->
<!-- title="Workcenter blocked, click to unblock." -->
<!-- aria-label="Workcenter blocked, click to unblock." -->
<!-- attrs="{'invisible': [('working_state','in',('normal','done'))]}"/> -->
<!-- <a name="%(mrp.act_mrp_block_workcenter)d" type="action" -->
<!-- class="o_status o_status_green float-end" -->
<!-- title="Work orders in progress. Click to block work center." -->
<!-- aria-label="Work orders in progress. Click to block work center." -->
<!-- attrs="{'invisible': [('working_state','in',('normal','blocked'))]}"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="container o_kanban_card_manage_pane dropdown-menu" role="menu"> -->
<!-- <div class="row"> -->
<!-- <div class="col-6 o_kanban_card_manage_section o_kanban_manage_view"> -->
<!-- <div role="menuitem" class="o_kanban_card_manage_title"> -->
<!-- <span>Actions</span> -->
<!-- </div> -->
<!-- <div role="menuitem" name="plan_order"> -->
<!-- <a name="action_work_order" type="object">Plan Orders</a> -->
<!-- </div> -->
<!-- <div> -->
<!-- <a name="%(maintenance.hr_equipment_request_action)d" type="action"> -->
<!-- Maintenance -->
<!-- </a> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="col-6 o_kanban_card_manage_section o_kanban_manage_new"> -->
<!-- <div role="menuitem" class="o_kanban_card_manage_title"> -->
<!-- <span>Reporting</span> -->
<!-- </div> -->
<!-- <div role="menuitem"> -->
<!-- <a name="%(mrp.mrp_workcenter_productivity_report_oee)d" type="action"> -->
<!-- OEE -->
<!-- </a> -->
<!-- </div> -->
<!-- <div role="menuitem"> -->
<!-- <a name="%(mrp.mrp_workorder_workcenter_report)d" type="action" -->
<!-- context="{'search_default_thisyear':True}"> -->
<!-- Performance -->
<!-- </a> -->
<!-- </div> -->
<!-- <div role="menuitem"> -->
<!-- <a name="action_work_order" type="object" -->
<!-- context="{'search_default_waiting': 1}">Waiting Availability -->
<!-- </a> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- --><!-- 继承原有的看板视图 -->
<!-- <record id="mrp_workcenter_kanban_inherit1" model="ir.ui.view"> -->
<!-- <field name="name">mrp.workcenter.kanban.inherit</field> -->
<!-- <field name="model">mrp.workcenter</field> -->
<!-- <field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/> -->
<!-- <field name="arch" type="xml"> -->
<!-- <xpath expr="//kanban" position="replace"> -->
<!-- <kanban class="oe_background_grey o_kanban_dashboard o_workcenter_kanban" create="0" sample="1" -->
<!-- > -->
<!-- <field name="name"/> -->
<!-- <field name="color"/> -->
<!-- <field name="workorder_count"/> -->
<!-- <field name="working_state"/> -->
<!-- <field name="oee_target"/> -->
<!-- <field name="production_line_show"/> -->
<!-- <field name="production_line_id"/> -->
<!-- <templates> -->
<!-- <t t-name="kanban-box" -->
<!-- t-if="record.production_line_id.value == record.production_line_show.raw_value"> -->
<!-- <div t-on-click="console.log(record.production_line_id,'11111111111')"></div>--> -->
<!-- <div t-on-click="console.log(record.production_line_show,'22222222222')"></div>-->
-->
<!-- <div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}"> -->
<!-- <div t-attf-class="o_kanban_card_header o_kanban_record_top"> -->
<!-- <div class="o_kanban_record_headings o_kanban_card_header_title"> -->
<!-- <span class="o_primary ml8" style="display: inline-block"> -->
<!-- <field name="name"/> -->
<!-- </span> -->
<!-- </div> -->
<!-- <div class="o_kanban_manage_button_section"> -->
<!-- <a class="o_kanban_manage_toggle_button" href="#"> -->
<!-- <i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/> -->
<!-- </a> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="container o_kanban_card_content"> -->
<!-- <div class="row mb16"> -->
<!-- <div class="col-6 o_kanban_primary_left"> -->
<!-- <div class="btn-group" name="o_wo"> -->
<!-- <t t-if="record.workorder_count.raw_value &gt; 0"> -->
<!-- <button class="btn btn-primary" name="action_work_order" -->
<!-- type="object" -->
<!-- context="{'search_default_ready': 1, 'search_default_progress': 1}"> -->
<!-- <span>WORK ORDERS</span> -->
<!-- </button> -->
<!-- </t> -->
<!-- <t t-if="record.workorder_count.raw_value &lt;= 0"> -->
<!-- <button class="btn btn-warning" -->
<!-- name="%(mrp.act_product_mrp_production_workcenter)d" -->
<!-- type="action"> -->
<!-- <span>PLAN ORDERS</span> -->
<!-- </button> -->
<!-- </t> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="col-6 o_kanban_primary_right"> -->
<!-- <div class="row" t-if="record.workorder_ready_count.raw_value &gt; 0"> -->
<!-- <div class="col-8"> -->
<!-- <a name="action_work_order" type="object" -->
<!-- context="{'search_default_ready': 1}"> -->
<!-- To Launch -->
<!-- </a> -->
<!-- </div> -->
<!-- <div class="col-4 text-end"> -->
<!-- <field name="workorder_ready_count"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row" t-if="record.workorder_progress_count.raw_value &gt; 0"> -->
<!-- <div class="col-8"> -->
<!-- <a name="action_work_order" type="object" -->
<!-- context="{'search_default_progress': 1}"> -->
<!-- In Progress -->
<!-- </a> -->
<!-- </div> -->
<!-- <div class="col-4 text-end"> -->
<!-- <field name="workorder_progress_count"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row" t-if="record.workorder_late_count.raw_value &gt; 0"> -->
<!-- <div class="col-8"> -->
<!-- <a name="action_work_order" type="object" -->
<!-- context="{'search_default_late': 1}"> -->
<!-- Late -->
<!-- </a> -->
<!-- </div> -->
<!-- <div class="col-4 text-end"> -->
<!-- <field name="workorder_late_count"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row" t-if="record.oee.raw_value &gt; 0"> -->
<!-- <div class="col-6"> -->
<!-- <a name="%(mrp.mrp_workcenter_productivity_report_oee)d" -->
<!-- type="action"> -->
<!-- OEE -->
<!-- </a> -->
<!-- </div> -->
<!-- <div class="col-6 text-end"> -->
<!-- <span t-att-class="record.oee_target.raw_value and (record.oee.raw_value &lt; record.oee_target.raw_value) and 'text-danger' or (record.oee.raw_value &gt; record.oee_target.raw_value) and 'text-success' or 'text-warning'"> -->
<!-- <strong> -->
<!-- <field name="oee" widget="integer"/>% -->
<!-- </strong> -->
<!-- </span> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="row"> -->
<!-- <div class="col-12 o_kanban_primary_left" -->
<!-- style="position:absolute; bottom:10px;" name="wc_stages"> -->
<!-- <a name="%(mrp.act_mrp_block_workcenter)d" type="action" -->
<!-- class="o_status float-end" -->
<!-- title="No workorder currently in progress. Click to mark work center as blocked." -->
<!-- aria-label="No workorder currently in progress. Click to mark work center as blocked." -->
<!-- attrs="{'invisible': [('working_state','in',('blocked','done'))]}"/> -->
<!-- <a name="unblock" type="object" class=" o_status o_status_red float-end" -->
<!-- title="Workcenter blocked, click to unblock." -->
<!-- aria-label="Workcenter blocked, click to unblock." -->
<!-- attrs="{'invisible': [('working_state','in',('normal','done'))]}"/> -->
<!-- <a name="%(mrp.act_mrp_block_workcenter)d" type="action" -->
<!-- class="o_status o_status_green float-end" -->
<!-- title="Work orders in progress. Click to block work center." -->
<!-- aria-label="Work orders in progress. Click to block work center." -->
<!-- attrs="{'invisible': [('working_state','in',('normal','blocked'))]}"/> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="container o_kanban_card_manage_pane dropdown-menu" role="menu"> -->
<!-- <div class="row"> -->
<!-- <div class="col-6 o_kanban_card_manage_section o_kanban_manage_view"> -->
<!-- <div role="menuitem" class="o_kanban_card_manage_title"> -->
<!-- <span>Actions</span> -->
<!-- </div> -->
<!-- <div role="menuitem" name="plan_order"> -->
<!-- <a name="action_work_order" type="object">Plan Orders</a> -->
<!-- </div> -->
<!-- <div> -->
<!-- <a name="%(maintenance.hr_equipment_request_action)d" type="action"> -->
<!-- Maintenance -->
<!-- </a> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div class="col-6 o_kanban_card_manage_section o_kanban_manage_new"> -->
<!-- <div role="menuitem" class="o_kanban_card_manage_title"> -->
<!-- <span>Reporting</span> -->
<!-- </div> -->
<!-- <div role="menuitem"> -->
<!-- <a name="%(mrp.mrp_workcenter_productivity_report_oee)d" type="action"> -->
<!-- OEE -->
<!-- </a> -->
<!-- </div> -->
<!-- <div role="menuitem"> -->
<!-- <a name="%(mrp.mrp_workorder_workcenter_report)d" type="action" -->
<!-- context="{'search_default_thisyear':True}"> -->
<!-- Performance -->
<!-- </a> -->
<!-- </div> -->
<!-- <div role="menuitem"> -->
<!-- <a name="action_work_order" type="object" -->
<!-- context="{'search_default_waiting': 1}">Waiting Availability -->
<!-- </a> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- <div t-if="widget.editable" class="o_kanban_card_manage_settings row"> -->
<!-- <div role="menuitem" aria-haspopup="true" class="col-8"> -->
<!-- <ul role="menu" class="oe_kanban_colorpicker" data-field="color"/> -->
<!-- </div> -->
<!-- <div role="menuitem" class="text-end"> -->
<!-- <a type="edit">Settings</a> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </t> -->
<!-- </templates> -->
<!-- </kanban> -->
<!-- </xpath> -->
<!-- </field> -->
<!-- </record> -->
<!-- <div t-if="widget.editable" class="o_kanban_card_manage_settings row"> -->
<!-- <div role="menuitem" aria-haspopup="true" class="col-8"> -->
<!-- <ul role="menu" class="oe_kanban_colorpicker" data-field="color"/> -->
<!-- </div> -->
<!-- <div role="menuitem" class="text-end"> -->
<!-- <a type="edit">Settings</a> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </t> -->
<!-- </templates> -->
<!-- </kanban> -->
<!-- </xpath> -->
<!-- </field> -->
<!-- </record> -->
<!-- MRP.PRODUCTION -->
<record id="mrp_production_view_form_inherit_maintenance" model="ir.ui.view">
@@ -342,18 +397,18 @@
</field>
</record>
<!-- 生产线驾驶舱searchpanel -->
<record id="view_location_search_sf11111_inherit" model="ir.ui.view">
<field name="name">mrp.workcenter.inherit</field>
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.view_mrp_workcenter_search"/>
<field name="arch" type="xml">
<xpath expr="//search[1]" position="inside">
<searchpanel>
<field name="production_line_id" icon="fa-filter"/>
</searchpanel>
</xpath>
</field>
</record>
<!-- 生产线驾驶舱searchpanel -->
<record id="view_location_search_sf11111_inherit" model="ir.ui.view">
<field name="name">mrp.workcenter.inherit</field>
<field name="model">mrp.workcenter</field>
<field name="inherit_id" ref="mrp.view_mrp_workcenter_search"/>
<field name="arch" type="xml">
<xpath expr="//search[1]" position="inside">
<searchpanel>
<field name="production_line_id" icon="fa-filter"/>
</searchpanel>
</xpath>
</field>
</record>
</odoo>

View File

@@ -35,7 +35,7 @@
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"/>
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
<!-- <field name="state" widget="statusbar" statusbar_visible="draft,produce"/> -->
<field name="state" widget="statusbar" statusbar_visible="draft,done,processing,finished"/>
</header>
<sheet>
<div class="oe_title">
@@ -128,7 +128,7 @@
decoration-success="state == 'done'"
progress_bar="name"
form_view_id="sf_production_plan_form"
default_scale="year"
default_scale="week"
scales="day,week,month,year"
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}">
<field name="shift"/>

View File

@@ -10,7 +10,7 @@
""",
'category': 'sf',
'website': 'https://www.sf.jikimo.com',
'depends': ['sale_management', 'web_widget_model_viewer',],
'depends': ['sale', 'web_widget_model_viewer'],
'data': [
'security/group_security.xml',
'security/ir.model.access.csv',

View File

@@ -16,6 +16,7 @@ import requests
class QuickEasyOrder(models.Model):
_name = 'quick.easy.order'
_description = '简易下单'
_order = 'id desc'
name = fields.Char('订单编号', default=lambda self: self.env['ir.sequence'].next_by_code('quick.easy.order'))
model_length = fields.Float('长(mm)', digits=(16, 3))
@@ -48,6 +49,7 @@ class QuickEasyOrder(models.Model):
model_color_state = fields.Selection([
('success', '成功'),
('fail', '失败')], string='模型上色状态')
processing_time = fields.Integer('加工时长(min)')
@api.depends('unit_price', 'quantity')
def _compute_total_amount(self):
@@ -77,10 +79,10 @@ class QuickEasyOrder(models.Model):
model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
report_path = attachment._full_path(attachment.store_fname)
vals['model_file'] = self.transition_glb_file(report_path, model_code)
logging.info('create-model_file:%s' % len(vals['model_file']))
# logging.info('create-model_file:%s' % len(vals['model_file']))
obj = super(QuickEasyOrder, self).create(vals)
self.model_coloring(obj)
# self.model_coloring(obj)
self.distribute_to_factory(obj)
obj.state = '待接单'
return obj
@@ -88,14 +90,14 @@ class QuickEasyOrder(models.Model):
# 将attach的datas内容转为glb文件
def transition_glb_file(self, report_path, model_code):
shapes = read_step_file(report_path)
# output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
output_file = os.path.join('/tmp', str(model_code) + '.stl')
output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
# output_file = os.path.join('/tmp', str(model_code) + '.stl')
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
# 转化为glb
# output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
# output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
util_path = get_resource_path('sf_dlm', 'static/util')
cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file)
cmd = 'python %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file)
os.system(cmd)
# 转base64
with open(output_glb_file, 'rb') as fileObj:
@@ -120,17 +122,17 @@ class QuickEasyOrder(models.Model):
model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
logging.info("模型编码: %s" % model_code)
item.model_file = self.transition_glb_file(report_path, model_code)
ret = self.feature_recognition(report_path, model_code)
logging.info("自动报价返回值: %s" % ret)
boxshape = ret['boxshape'].tolist()
logging.info("自动报价boxshape: %s" % boxshape)
logging.info('自动报价feature_infos:%s' % ret['feature_infos'])
item.model_length = boxshape[0] # 长 单位mm
item.model_width = boxshape[1] # 宽
item.model_height = boxshape[2] # 高
item.model_volume = boxshape[0] * boxshape[1] * boxshape[2]
item.model_feature = json.dumps(ret['feature_infos'], ensure_ascii=False)
self._get_price(item)
# ret = self.feature_recognition(report_path, model_code)
# logging.info("自动报价返回值: %s" % ret)
# boxshape = ret['boxshape'].tolist()
# logging.info("自动报价boxshape: %s" % boxshape)
# logging.info('自动报价feature_infos:%s' % ret['feature_infos'])
# item.model_length = boxshape[0] # 长 单位mm
# item.model_width = boxshape[1] # 宽
# item.model_height = boxshape[2] # 高
# item.model_volume = boxshape[0] * boxshape[1] * boxshape[2]
# item.model_feature = json.dumps(ret['feature_infos'], ensure_ascii=False)
# self._get_price(item)
else:
item.model_file = False
item.model_feature = False
@@ -151,7 +153,7 @@ class QuickEasyOrder(models.Model):
base64_data = base64.b64encode(attachment.datas)
base64_datas = base64_data.decode('utf-8')
barcode = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
logging.info('model_file-size: %s' % len(item.model_file))
# logging.info('model_file-size: %s' % len(item.model_file))
res['bfm_process_order_list'].append({
'model_long': item.model_length,
'model_width': item.model_width,

View File

@@ -6,14 +6,16 @@ import base64
class ReSaleOrder(models.Model):
_inherit = 'sale.order'
deadline_of_delivery = fields.Date('货截止日')
deadline_of_delivery = fields.Date('订单交期')
person_of_delivery = fields.Char('交货人')
telephone_of_delivery = fields.Char('交货人电话号码')
address_of_delivery = fields.Char('交货人地址')
payments_way = fields.Selection([('现结', '现结'), ('月结', '月结')], '结算方式', default='现结')
pay_way = fields.Selection([('转账', '转账'), ('微信', '微信'), ('支付宝', '支付宝')], '支付方式')
# 业务平台分配工厂后在智能工厂先创建销售订单
def sale_order_create(self, company_id, delivery_name, delivery_telephone, delivery_address,
deadline_of_delivery):
deadline_of_delivery, payments_way, pay_way):
now_time = datetime.datetime.now()
partner = self.get_customer()
order_id = self.env['sale.order'].sudo().create({
@@ -22,11 +24,12 @@ class ReSaleOrder(models.Model):
'name': self.env['ir.sequence'].next_by_code('sale.order', sequence_date=now_time),
'partner_id': partner.id,
'state': 'draft',
# 'user_id': user_id.id,
'person_of_delivery': delivery_name,
'telephone_of_delivery': delivery_telephone,
'address_of_delivery': delivery_address,
'deadline_of_delivery': deadline_of_delivery
'deadline_of_delivery': deadline_of_delivery,
'payments_way': payments_way,
'pay_way': pay_way,
})
return order_id
@@ -49,7 +52,7 @@ class ReSaleOrder(models.Model):
product.materials_id.name),
'price_unit': product.list_price,
'product_uom_qty': item['number'],
'model_glb_file': base64.b64decode(item['model_file']),
'model_glb_file': base64.b64decode(item['model_file']),
}
return self.env['sale.order.line'].create(vals)

View File

@@ -16,16 +16,18 @@
<field name="model">quick.easy.order</field>
<field name="arch" type="xml">
<tree string="快速订单">
<field name="state" widget="label_selection"
<field name="state" widget="label_selection" string="状态"
options="{'classes': {'待接单': 'default', '加工中':'primary','物流中':'warning','已交付': 'success'}}"/>
<field name="name" string="订单号"/>
<field name="customer_id" string="客户"/>
<field name="material_id"/>
<field name="material_model_id"/>
<field name="parameter_ids" string="表面工艺参数" widget="many2many_tags"/>
<!-- <field name="parameter_ids" string="表面工艺参数" widget="many2many_tags"/>-->
<field name="quantity"/>
<field name="unit_price"/>
<field name="price"/>
<field name="create_uid" string="创建人"/>
<field name="create_date" string="创建时间"/>
<field optional="hide" name="delivery_time"/>
</tree>
</field>
@@ -74,6 +76,7 @@
options="{'format': false}"/>
</div>
<field name="model_volume" attrs="{'invisible': [('model_file', '=', False)]}"/>
<field name="processing_time"/>
</group>
</group>
</sheet>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record model="ir.ui.view" id="view_sale_order_form_inherit_sf">
<field name="name">sale.order.form.inherit.sf</field>
<field name="model">sale.order</field>
@@ -8,6 +9,8 @@
<field name="arch" type="xml">
<field name="payment_term_id" position="after">
<field name="deadline_of_delivery"/>
<field name="payments_way"/>
<field name="pay_way"/>
</field>
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
<field name="model_glb_file" widget="Viewer3D" optional="show"
@@ -25,6 +28,9 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_management.sale_order_form_quote"/>
<field name="arch" type="xml">
<field name="date_order" position="attributes">
<attribute name="string">下单日期</attribute>
</field>
<field name="sale_order_template_id" position="after">
<!-- <label for="person_of_delivery" string="交货信息"/>-->
<!-- <div>-->
@@ -39,5 +45,31 @@
</field>
</field>
</record>
<record id="view_quotation_with_onboarding_tree_inherit_sf" model="ir.ui.view">
<field name="name">sale.order.quotation.tree.inherit.sf</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree_with_onboarding"/>
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="string">订单号</attribute>
</field>
<field name="create_date" position="attributes">
<attribute name="string">下单时间</attribute>
</field>
</field>
</record>
<record id="view_order_tree_inherit_sf" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="string">订单号</attribute>
</field>
</field>
</record>
</data>
</odoo>

View File

@@ -551,7 +551,7 @@ class MachineTableToolChangingApply(models.Model):
name = fields.Many2one('maintenance.equipment', string='CNC机床',required=True, readonly=False,
group_expand='_read_group_names')
machine_table_type_id = fields.Many2one('sf.machine_tool.category', string='机床类型', readonly=True,
machine_table_type_id = fields.Many2one('maintenance.equipment.category', string='机床类型', readonly=True,
compute='_compute_name')
machine_tool_code = fields.Char(string='机台号', invisible=True, readonly=True, compute='_compute_name')
cutter_spacing_code = fields.Char(string='刀位号', readonly=False)
@@ -595,7 +595,7 @@ class MachineTableToolChangingApply(models.Model):
def _compute_name(self):
for record in self:
if record:
record.machine_table_type_id = record.name.machine_tool_category.id
record.machine_table_type_id = record.name.category_id.id
record.machine_tool_code = record.name.code
@api.depends('functional_tool_name_id')

View File

@@ -870,7 +870,7 @@
<sheet>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
<field name="name" readonly="0" placeholder="请选择"/>
</h1>
</div>
<group>
@@ -879,7 +879,7 @@
<field name="machine_tool_code" invisible="True"/>
<field name="cutter_spacing_code"/>
<field name="functional_tool_code"/>
<field name="functional_tool_name_id"/>
<field name="functional_tool_name_id" placeholder="请选择"/>
<field name="functional_tool_type_id"/>
</group>
</group>
@@ -999,19 +999,19 @@
<sheet>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
<field name="name" readonly="0" placeholder="请输入工单任务编号"/>
</h1>
</div>
<group>
<group>
<field name="cam_procedure_code"/>
<field name="cam_cutter_spacing_code"/>
<field name="machine_table_name_id"/>
<field name="machine_table_name_id" placeholder="请选择"/>
</group>
<group>
<field name="functional_tool_code"/>
<field name="functional_tool_name_id"/>
<field name="functional_tool_type_id"/>
<field name="functional_tool_name_id" placeholder="请选择"/>
<field name="functional_tool_type_id" placeholder="请选择"/>
<field name="machine_tool_cutter_spacing_code"/>
</group>
</group>
@@ -1027,7 +1027,7 @@
<field name="coarse_middle_thin"/>
</group>
<group>
<field name="need_knife_time"/>
<field name="need_knife_time" placeholder="请选择"/>
<field name="required_cutting_time"/>
<field name="whether_standard_tool"/>
<field name="applicant"/>
@@ -1168,12 +1168,12 @@
class="oe_highlight" attrs="{'invisible': [('loading_task_source', '!=', '1')]}" />
<field name="assemble_status" widget="statusbar" statusbar_visible="0,1,2"/>
</header>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<sheet>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="functional_tool_code" readonly="1"/>

View File

@@ -139,7 +139,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
mrs_cutting_tool_integral_model_ids = fields.Many2many('sf.cutting.tool.model',
'sf_functional_tool_assembly_order_id',
string='整体式刀具型号', readonly=False, domain=
[('mrs_cutting_tool_material_name', '=', '整体式刀具')])
[('cutting_tool_type', '=', '整体式刀具')])
integral_code = fields.Char('整体式刀具序列号', readonly=True,
compute='_compute_mrs_cutting_tool_integral_model_ids')
integral_name = fields.Char('整体式刀具名称', readonly=True)
@@ -147,7 +147,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
# 刀片型号
mrs_cutting_tool_blade_model_ids = fields.Many2many('sf.cutting.tool.model', 'sf_functional_tool_assembly_order_id',
string='刀片型号', readonly=False, domain=
[('mrs_cutting_tool_material_name', '=', '刀片')])
[('cutting_tool_type', '=', '刀片')])
blade_code = fields.Char('刀片序列号', readonly=True, compute='_compute_mrs_cutting_tool_blade_model_ids')
blade_name = fields.Char('刀片名称', readonly=True)
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True)
@@ -155,7 +155,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
mrs_cutting_tool_cutterbar_model_ids = fields.Many2many('sf.cutting.tool.model',
'sf_functional_tool_assembly_order_id',
string='刀杆型号', readonly=False, domain=
[('mrs_cutting_tool_material_name', '=', '刀杆')])
[('cutting_tool_type', '=', '刀杆')])
bar_code = fields.Char('刀杆序列号', readonly=True, compute='_compute_mrs_cutting_tool_cutterbar_model_ids')
bar_name = fields.Char('刀杆名称', readonly=True)
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True)
@@ -163,7 +163,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
mrs_cutting_tool_cutterpad_model_ids = fields.Many2many('sf.cutting.tool.model',
'sf_functional_tool_assembly_order_id',
string='刀盘型号', readonly=False, domain=
[('mrs_cutting_tool_material_name', '=', '刀盘')])
[('cutting_tool_type', '=', '刀盘')])
pad_code = fields.Char('刀盘序列号', readonly=True, compute='_compute_mrs_cutting_tool_cutterpad_model_ids')
pad_name = fields.Char('刀盘名称', readonly=True)
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True)
@@ -172,7 +172,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
mrs_cutting_tool_cutterhandle_model_ids = fields.Many2many('sf.cutting.tool.model',
'sf_functional_tool_assembly_order_id',
string='刀柄型号', readonly=False, domain=
[('mrs_cutting_tool_material_name', '=', '刀柄')])
[('cutting_tool_type', '=', '刀柄')])
handle_code = fields.Char('刀柄序列号', readonly=True, compute='_compute_mrs_cutting_tool_cutterhandle_model_ids')
handle_name = fields.Char('刀柄名称', readonly=True)
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True)
@@ -180,7 +180,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
mrs_cutting_tool_cutterhead_model_ids = fields.Many2many('sf.cutting.tool.model',
'sf_functional_tool_assembly_order_id',
string='夹头型号', readonly=False, domain=
[('mrs_cutting_tool_material_name', '=', '夹头')])
[('cutting_tool_type', '=', '夹头')])
chuck_code = fields.Char('夹头序列号', readonly=True, compute='_compute_mrs_cutting_tool_cutterhead_model_ids')
chuck_name = fields.Char('夹头名称', readonly=True)
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True)
@@ -201,7 +201,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if val:
self.integral_code = val.code
self.integral_name = val.name
self.sf_tool_brand_id_1 = val.mrs_machine_brand_id.id
self.sf_tool_brand_id_1 = val.brand_id.id
@api.depends('mrs_cutting_tool_blade_model_ids')
def _compute_mrs_cutting_tool_blade_model_ids(self):
@@ -211,7 +211,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if val:
self.blade_code = val.code
self.blade_name = val.name
self.sf_tool_brand_id_2 = val.mrs_machine_brand_id.id
self.sf_tool_brand_id_2 = val.brand_id.id
@api.depends('mrs_cutting_tool_cutterbar_model_ids')
def _compute_mrs_cutting_tool_cutterbar_model_ids(self):
@@ -221,7 +221,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if val:
self.bar_code = val.code
self.bar_name = val.name
self.sf_tool_brand_id_3 = val.mrs_machine_brand_id.id
self.sf_tool_brand_id_3 = val.brand_id.id
@api.depends('mrs_cutting_tool_cutterpad_model_ids')
def _compute_mrs_cutting_tool_cutterpad_model_ids(self):
@@ -231,7 +231,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if val:
self.pad_code = val.code
self.pad_name = val.name
self.sf_tool_brand_id_4 = val.mrs_machine_brand_id.id
self.sf_tool_brand_id_4 = val.brand_id.id
@api.depends('mrs_cutting_tool_cutterhandle_model_ids')
def _compute_mrs_cutting_tool_cutterhandle_model_ids(self):
@@ -241,7 +241,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if val:
self.handle_code = val.code
self.handle_name = val.name
self.sf_tool_brand_id_5 = val.mrs_machine_brand_id.id
self.sf_tool_brand_id_5 = val.brand_id.id
@api.depends('mrs_cutting_tool_cutterhead_model_ids')
def _compute_mrs_cutting_tool_cutterhead_model_ids(self):
@@ -251,7 +251,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if val:
self.chuck_code = val.code
self.chuck_name = val.name
self.sf_tool_brand_id_6 = val.mrs_machine_brand_id.id
self.sf_tool_brand_id_6 = val.brand_id.id
def functional_tool_assembly(self):
"""

View File

@@ -23,15 +23,15 @@
</group>
<group string="功能刀具信息">
<group>
<field name="replacement_tool_name_id"/>
<field name="replacement_tool_name_id" placeholder="请选择"/>
<field name="replacement_tool_type_id"/>
<field name="replacement_tool_coarse_middle_thin"/>
<field name="replacement_tool_coarse_middle_thin" placeholder="请选择"/>
<field name="applicant"/>
</group>
<group>
<field name="replacement_tool_code"/>
<field name="used_tool_time"/>
<field name="new_former"/>
<field name="used_tool_time" placeholder="请选择"/>
<field name="new_former" placeholder="请选择"/>
<field name="reason_for_applying"/>
</group>

View File

@@ -635,7 +635,7 @@ export default AbstractRenderer.extend(WidgetAdapterMixin, {
const focusDate = this.state.focusDate;
switch (this.state.scale) {
case 'day':
return focusDate.format('dddd, MMMM DD, YYYY');
return focusDate.format('YYYY MMMM DD dddd');
case 'week':
// const dateStart = focusDate.clone().startOf('week').format('DD MMMM YYYY');
const dateStart = focusDate.clone().startOf('week').format('YYYY MMMM DD ');

View File

@@ -25,7 +25,7 @@
</model-viewer>
</t>
<t t-if="!props.value">
<div style="color:#D23F3A">当前制造订单暂无模型</div>
<div style="color:#D23F3A">暂无模型</div>
</t>
<!-- <model-viewer-->