Merge branch 'develop' into feature/wechat_message

This commit is contained in:
胡尧
2024-09-23 14:03:18 +08:00
29 changed files with 266 additions and 87 deletions

View File

@@ -21,8 +21,9 @@ class ToolMaterialsBasicParameters(models.Model):
neck_length = fields.Float('颈部长度(mm)')
handle_diameter = fields.Float('柄部直径(mm)')
handle_length = fields.Float('柄部长度(mm)')
blade_tip_diameter = fields.Integer('刀尖直径(mm)')
blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角度)', size=20)
blade_tip_diameter = fields.Float('刀尖直径(mm)')
blade_tip_working_size = fields.Char('刀尖倒角度)', size=20)
tip_r_size = fields.Float('刀尖R角(mm)')
blade_tip_taper = fields.Integer('刀尖锥度(°)')
blade_diameter = fields.Float('刃部直径(mm)')
blade_length = fields.Float('刃部长度(mm)')

View File

@@ -30,6 +30,7 @@ patch(barcodeGenericHandlers, "start", {
"O-CMD.PAGER-FIRST": () => updatePager("first"),
"O-CMD.PAGER-LAST": () => updatePager("last"),
"O-CMD.CONFIRM": () => customClickOnButton(".jikimo_button_confirm"),
"O-CMD.FLUSHED": () => customClickOnButton(".jikimo_button_flushed"),
};
barcode.bus.addEventListener("barcode_scanned", (ev) => {

View File

@@ -15,6 +15,7 @@
<field name="handle_length"/>
<field name="blade_tip_diameter"/>
<field name="blade_tip_working_size"/>
<field name="tip_r_size"/>
<field name="blade_tip_taper"/>
<field name="blade_diameter"/>
<field name="blade_length"/>
@@ -95,6 +96,7 @@
<field name="handle_length"/>
<field name="blade_tip_diameter"/>
<field name="blade_tip_working_size"/>
<field name="tip_r_size"/>
<field name="blade_tip_taper"/>
<field name="blade_diameter"/>
<field name="blade_length"/>
@@ -139,6 +141,7 @@
</group>
<group attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
<field name="blade_tip_working_size"/>
<field name="tip_r_size"/>
<field name="blade_tip_diameter" class="diameter"/>
<field name="blade_tip_taper"/>
<field name="blade_helix_angle"/>

View File

@@ -222,6 +222,7 @@
<field name="handle_diameter" class="diameter"/>
<field name="handle_length"/>
<field name="blade_tip_working_size" class="du"/>
<field name="tip_r_size"/>
<field name="blade_tip_diameter" class="diameter"/>
<field name="blade_tip_taper" class="du"/>
<field name="blade_helix_angle" class="du"/>

View File

@@ -191,6 +191,8 @@
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('id', '!=', False)]}"/>
<field name="cutting_tool_blade_tip_working_size"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('id', '!=', False)]}"/>
<field name="cutting_tool_blade_tip_r_size"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('id', '!=', False)]}"/>
<field name="cutting_tool_blade_tip_diameter" string="刀尖直径(mm)" class="diameter"
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')],'readonly': [('id', '!=', False)]}"/>
<field name="cutting_tool_blade_tip_taper" string="刀尖锥度(°)"

View File

@@ -623,7 +623,7 @@ class Sf_Dashboard_Connect(http.Controller):
# 未完成订单
not_done_orders = plan_obj.search(
[('production_line_id.name', '=', line), ('state', 'not in', ['finished']),
('production_id.state', 'not in', ['cancel']), ('active', '=', True)
('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True)
])
# print(not_done_orders)
# 完成订单

View File

@@ -1582,8 +1582,11 @@ class SfWorkOrderBarcodes(models.Model):
[('routing_type', '=', '装夹预调'), ('rfid_code', '=', barcode)])
if workorder_olds:
name = ''
tem_list = []
for workorder in workorder_olds:
name = '%s %s' % (name, workorder.production_id.name)
tem_list.append(workorder.production_id.name)
for i in list(set(tem_list)):
name = '%s %s' % (name, i)
raise UserError('该托盘已绑定【%s】制造订单,请先解除绑定!!!' % name)
if workorder:
if workorder.routing_type == '装夹预调':

View File

@@ -90,7 +90,8 @@ 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))
cutting_tool_blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角)', size=20)
cutting_tool_blade_tip_working_size = fields.Char('刀尖倒角度(°)', size=20)
cutting_tool_blade_tip_r_size = fields.Float('刀尖R角(mm)')
fit_blade_shape_id = fields.Many2one('maintenance.equipment.image',
'适配刀片形状', domain=[('type', '=', '刀片形状')])
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
@@ -237,6 +238,7 @@ class ResProductMo(models.Model):
self.cutting_tool_blade_tip_taper = self.specification_id.blade_tip_taper
self.cutting_tool_blade_helix_angle = self.specification_id.blade_helix_angle
self.cutting_tool_blade_tip_working_size = self.specification_id.blade_tip_working_size
self.cutting_tool_blade_tip_r_size = self.specification_id.tip_r_size
self.cutting_tool_pitch = self.specification_id.pitch
self.cutting_tool_blade_width = self.specification_id.blade_width
self.cutting_tool_blade_depth = self.specification_id.blade_depth

View File

@@ -520,7 +520,7 @@
<xpath expr="//form//header" position="inside">
<button type="object" class="oe_highlight jikimo_button_confirm" name="get_three_check_datas"
string="获取数据" attrs='{"invisible": [("state","!=","progress")]}'/>
string="获取数据" attrs='{"invisible": [("state","!=","progress"), ("routing_type","!=","装夹预调")]}'/>
</xpath>

View File

@@ -11,10 +11,9 @@
""",
'category': 'sf',
'website': 'https://www.sf.jikimo.com',
'depends': ['base', 'sf_plan', 'sf_sale'],
'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify'],
'data': [
'security/ir.model.access.csv',
'views/sf_message_template_view.xml',
'data/bussiness_node.xml'
],
'test': [
],

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" ?>
<odoo>
<data noupdate="1">
<record id="bussiness_pending_order" model="jikimo.message.bussiness.node">
<field name="name">待接单</field>
<field name="model">sale.order</field>
</record>
<record id="bussiness_to_be_confirm" model="jikimo.message.bussiness.node">
<field name="name">确认接单</field>
<field name="model">sale.order</field>
</record>
</data>
</odoo>

View File

@@ -3,4 +3,4 @@ from odoo import models, fields, api, _
class SFMessageCamProgram(models.Model):
_name = 'sf.cam.work.order.program.knife.plan'
_inherit = ['sf.cam.work.order.program.knife.plan', 'sf.message.template']
_inherit = ['sf.cam.work.order.program.knife.plan', 'jikimo.message.dispatch']

View File

@@ -3,4 +3,4 @@ from odoo import models, fields, api, _
class SFMessagefunctionalToolAssembly(models.Model):
_name = 'sf.functional.tool.assembly'
_inherit = ['sf.functional.tool.assembly', 'sf.message.template']
_inherit = ['sf.functional.tool.assembly', 'jikimo.message.dispatch']

View File

@@ -1,6 +1,25 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
class SFMessagePlan(models.Model):
_name = 'sf.production.plan'
_inherit = ['sf.production.plan', 'sf.message.template']
_inherit = ['sf.production.plan', 'jikimo.message.dispatch']
# def create(self, vals_list):
# res = super(SFMessagePlan, self).create(vals_list)
# if res:
# try:
# res.add_queue('待排程')
# except Exception as e:
# logging.info('add_queue error:%s' % e)
# return res
#
# def _get_message(self):
# res = super(SFMessagePlan, self)._get_message()
# if res:
# try:
# res.add_queue('待排程')
# except Exception as e:
# logging.info('_get_message error:%s' % e)
# return res

View File

@@ -3,4 +3,4 @@ from odoo import models, fields, api, _
class SFMessagePurchase(models.Model):
_name = 'purchase.order'
_inherit = ['purchase.order', 'sf.message.template']
_inherit = ['purchase.order', 'jikimo.message.dispatch']

View File

@@ -1,11 +1,39 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
class SFMessageSale(models.Model):
_name = 'sale.order'
_inherit = ['sale.order', 'sf.message.template']
_inherit = ['sale.order', 'jikimo.message.dispatch']
# def create(self):
# res = super(SFMessageSale, self).create()
# if res is True:
def create(self, vals_list):
res = super(SFMessageSale, self).create(vals_list)
if res:
try:
res.add_queue('待接单')
except Exception as e:
logging.info('add_queue error:%s' % e)
return res
# 确认接单
def action_confirm(self):
res = super(SFMessageSale, self).action_confirm()
if res is True:
try:
self.add_queue('确认接单')
except Exception as e:
logging.info('add_queue error:%s' % e)
return res
# 继承并重写jikimo.message.dispatch的_get_message()
def _get_message(self, message_queue_ids):
res = super(SFMessageSale, self)._get_message(message_queue_ids)
if message_queue_ids.message_template_id.bussiness_node_id.name == '确认接单':
# sale_order = self.env['sale.order'].search([('id', '=', message_queue_ids.model.res_id)])
sale_order_line = self.env['sale.order.line'].search([('order_id', '=', int(message_queue_ids.res_id))])
if len(sale_order_line) == 1:
product = sale_order_line[0].product_id.name
elif len(sale_order_line) > 1:
product = '%s...' % sale_order_line[0].product_id.name
res[0] = res[0].replace('{{product_id}}', product)
return res

View File

@@ -3,4 +3,4 @@ from odoo import models, fields, api, _
class SFMessageStockPicking(models.Model):
_name = 'stock.picking'
_inherit = ['stock.picking', 'sf.message.template']
_inherit = ['stock.picking', 'jikimo.message.dispatch']

View File

@@ -4,31 +4,9 @@ from abc import ABC, abstractmethod
class SfMessageTemplate(models.Model):
_name = "sf.message.template"
_description = u'消息模板'
_inherit = "jikimo.message.template"
name = fields.Char(string=u"名称", required=True)
description = fields.Char(string=u"描述")
content = fields.Html(string=u"内容", render_engine='qweb', translate=True, prefetch=True, sanitize=False)
msgtype = fields.Selection(
[('text', u'文字'), ('markdown', u'Markdown')], u'消息类型',
required=True, default='markdown')
notification_department_id = fields.Many2one('hr.department', u'通知部门', required=True)
notification_employee_ids = fields.Many2many('hr.employee', string=u'员工',
domain="[('department_id', '=',notification_department_id)]",
required=True)
is_send_time = fields.Boolean(string=u"定时发送", default=False)
send_time_1 = fields.Integer('发送时间点1')
send_time_2 = fields.Integer('发送时间点2')
active = fields.Boolean(string=u"是否有效", default=True)
@api.onchange('notification_department_id')
def _clear_employee_ids(self):
if self.notification_department_id:
self.notification_employee_ids = False
@abstractmethod
def dispatch(self, args):
"""
强迫继承该类必走该抽象方法'
"""
def _get_message_model(self):
res = super(SfMessageTemplate, self)._get_message_model()
res.append("sale.order")
return res

View File

@@ -3,4 +3,4 @@ from odoo import models, fields, api, _
class SFMessageWork(models.Model):
_name = 'mrp.workorder'
_inherit = ['mrp.workorder', 'sf.message.template']
_inherit = ['mrp.workorder', 'jikimo.message.dispatch']

View File

@@ -1,9 +1,23 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sf_message_template_group_sale_salemanager,sf_message_template,model_sf_message_template,sf_base.group_sale_salemanager,1,1,1,0
access_sf_message_template_group_purchase,sf_message_template,model_sf_message_template,sf_base.group_purchase,1,1,1,0
access_sf_message_template_group_sf_stock_user,sf_message_template,model_sf_message_template,sf_base.group_sf_stock_user,1,1,1,0
access_sf_message_template_group_sf_order_user,sf_message_template,model_sf_message_template,sf_base.group_sf_order_user,1,1,1,0
access_sf_message_template_group_sf_tool_user,sf_message_template,model_sf_message_template,sf_base.group_sf_tool_user,1,1,1,0
access_jikimo_message_template_group_sale_salemanager,jikimo_message_template,model_jikimo_message_template,sf_base.group_sale_salemanager,1,1,1,0
access_jikimo_message_template_group_purchase,jikimo_message_template,model_jikimo_message_template,sf_base.group_purchase,1,1,1,0
access_jikimo_message_template_group_sf_stock_user,jikimo_message_template,model_jikimo_message_template,sf_base.group_sf_stock_user,1,1,1,0
access_jikimo_message_template_group_sf_order_user,jikimo_message_template,model_jikimo_message_template,sf_base.group_sf_order_user,1,1,1,0
access_jikimo_message_template_group_sf_tool_user,jikimo_message_template,model_jikimo_message_template,sf_base.group_sf_tool_user,1,1,1,0
access_jikimo_message_bussiness_node_group_sale_salemanager,jikimo_message_bussiness_node,model_jikimo_message_bussiness_node,sf_base.group_sale_salemanager,1,1,1,0
access_jikimo_message_bussiness_node_group_purchase,jikimo_message_bussiness_node,model_jikimo_message_bussiness_node,sf_base.group_purchase,1,1,1,0
access_jikimo_message_bussiness_node_group_sf_stock_user,jikimo_message_bussiness_node,model_jikimo_message_bussiness_node,sf_base.group_sf_stock_user,1,1,1,0
access_jikimo_message_bussiness_node_group_sf_order_user,jikimo_message_bussiness_node,model_jikimo_message_bussiness_node,sf_base.group_sf_order_user,1,1,1,0
access_jikimo_message_bussiness_node_group_sf_tool_user,jikimo_message_bussiness_node,model_jikimo_message_bussiness_node,sf_base.group_sf_tool_user,1,1,1,0
access_jikimo_message_queue_group_sale_salemanager,jikimo_message_queue,model_jikimo_message_queue,sf_base.group_sale_salemanager,1,1,1,0
access_jikimo_message_queue_group_purchase,jikimo_message_queue,model_jikimo_message_queue,sf_base.group_purchase,1,1,1,0
access_jikimo_message_queue_group_sf_stock_user,jikimo_message_queue,model_jikimo_message_queue,sf_base.group_sf_stock_user,1,1,1,0
access_jikimo_message_queue_group_sf_order_user,jikimo_message_queue,model_jikimo_message_queue,sf_base.group_sf_order_user,1,1,1,0
access_jikimo_message_queue_group_sf_tool_user,jikimo_message_queue,model_jikimo_message_queue,sf_base.group_sf_tool_user,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sf_message_template_group_sale_salemanager access_jikimo_message_template_group_sale_salemanager sf_message_template jikimo_message_template model_sf_message_template model_jikimo_message_template sf_base.group_sale_salemanager 1 1 1 0
3 access_sf_message_template_group_purchase access_jikimo_message_template_group_purchase sf_message_template jikimo_message_template model_sf_message_template model_jikimo_message_template sf_base.group_purchase 1 1 1 0
4 access_sf_message_template_group_sf_stock_user access_jikimo_message_template_group_sf_stock_user sf_message_template jikimo_message_template model_sf_message_template model_jikimo_message_template sf_base.group_sf_stock_user 1 1 1 0
5 access_sf_message_template_group_sf_order_user access_jikimo_message_template_group_sf_order_user sf_message_template jikimo_message_template model_sf_message_template model_jikimo_message_template sf_base.group_sf_order_user 1 1 1 0
6 access_sf_message_template_group_sf_tool_user access_jikimo_message_template_group_sf_tool_user sf_message_template jikimo_message_template model_sf_message_template model_jikimo_message_template sf_base.group_sf_tool_user 1 1 1 0
7 access_jikimo_message_bussiness_node_group_sale_salemanager jikimo_message_bussiness_node model_jikimo_message_bussiness_node sf_base.group_sale_salemanager 1 1 1 0
8 access_jikimo_message_bussiness_node_group_purchase jikimo_message_bussiness_node model_jikimo_message_bussiness_node sf_base.group_purchase 1 1 1 0
9 access_jikimo_message_bussiness_node_group_sf_stock_user jikimo_message_bussiness_node model_jikimo_message_bussiness_node sf_base.group_sf_stock_user 1 1 1 0
10 access_jikimo_message_bussiness_node_group_sf_order_user jikimo_message_bussiness_node model_jikimo_message_bussiness_node sf_base.group_sf_order_user 1 1 1 0
11 access_jikimo_message_bussiness_node_group_sf_tool_user jikimo_message_bussiness_node model_jikimo_message_bussiness_node sf_base.group_sf_tool_user 1 1 1 0
12 access_jikimo_message_queue_group_sale_salemanager jikimo_message_queue model_jikimo_message_queue sf_base.group_sale_salemanager 1 1 1 0
13 access_jikimo_message_queue_group_purchase jikimo_message_queue model_jikimo_message_queue sf_base.group_purchase 1 1 1 0
14 access_jikimo_message_queue_group_sf_stock_user jikimo_message_queue model_jikimo_message_queue sf_base.group_sf_stock_user 1 1 1 0
15 access_jikimo_message_queue_group_sf_order_user jikimo_message_queue model_jikimo_message_queue sf_base.group_sf_order_user 1 1 1 0
16 access_jikimo_message_queue_group_sf_tool_user jikimo_message_queue model_jikimo_message_queue sf_base.group_sf_tool_user 1 1 1 0
17
18
19
20
21
22
23

View File

@@ -7,7 +7,7 @@
<record id="sf_message_template_view_form" model="ir.ui.view">
<field name="name">sf.message.template.view.form</field>
<field name="model">sf.message.template</field>
<field name="model">message.template</field>
<field name="arch" type="xml">
<form string="消息模板">
<sheet>
@@ -18,14 +18,12 @@
</h1>
</div>
<group>
<!-- <field name="type"/>-->
<!-- <field name="type"/>-->
<field name="notify_model_id"/>
<field name="content" widget="html" class="oe-bordered-editor"
options="{'style-inline': true, 'codeview': true, 'dynamic_placeholder': true}"/>
<field name="description"/>
<field name="msgtype"/>
<field name="is_send_time"/>
<field name="send_time_1" attrs="{'invisible': [('is_send_time', '=', False)]}"/>
<field name="send_time_2" attrs="{'invisible': [('is_send_time', '=', False)]}"/>
<field name="notification_department_id"/>
<field name="notification_employee_ids" widget="many2many_tags"/>
</group>
@@ -36,16 +34,13 @@
<record id="sf_message_template_view_tree" model="ir.ui.view">
<field name="name">sf.message.template.view.tree</field>
<field name="model">sf.message.template</field>
<field name="model">message.template</field>
<field name="arch" type="xml">
<tree string="消息模板">
<field name="name"/>
<!-- <field name="type"/>-->
<!-- <field name="type"/>-->
<field name="content"/>
<field name="msgtype"/>
<field name="is_send_time"/>
<field name="send_time_1" attrs="{'invisible': [('is_send_time', '=', False)]}"/>
<field name="send_time_2" attrs="{'invisible': [('is_send_time', '=', False)]}"/>
<field name="notification_department_id"/>
<field name="notification_employee_ids" widget="many2many_tags"/>
<field name="description"/>
@@ -55,7 +50,7 @@
<record id="sf_message_template_search_view" model="ir.ui.view">
<field name="name">sf.message.template.search.view</field>
<field name="model">sf.message.template</field>
<field name="model">message.template</field>
<field name="arch" type="xml">
<search>
<field name="name" string="模糊搜索"
@@ -69,7 +64,7 @@
<!--定义单证类型视图动作-->
<record id="sf_message_template_action" model="ir.actions.act_window">
<field name="name">消息模板</field>
<field name="res_model">sf.message.template</field>
<field name="res_model">message.template</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="sf_message_template_view_tree"/>
</record>

View File

@@ -2438,6 +2438,7 @@ class CuttingToolBasicParameters(models.Model):
'handle_length': integral_tool_item['shank_length'],
'blade_tip_diameter': integral_tool_item['tip_diameter'],
'blade_tip_working_size': integral_tool_item['tip_handling_size'],
'tip_r_size': integral_tool_item['tip_r_size'],
'blade_tip_taper': integral_tool_item['knife_tip_taper'],
'blade_helix_angle': integral_tool_item['blade_helix_angle'],
'blade_width': integral_tool_item['blade_width'],
@@ -2459,6 +2460,7 @@ class CuttingToolBasicParameters(models.Model):
'handle_length': integral_tool_item['shank_length'],
'blade_tip_diameter': integral_tool_item['tip_diameter'],
'blade_tip_working_size': integral_tool_item['tip_handling_size'],
'tip_r_size': integral_tool_item['tip_r_size'],
'blade_tip_taper': integral_tool_item['knife_tip_taper'],
'blade_helix_angle': integral_tool_item['blade_helix_angle'],
'blade_width': integral_tool_item['blade_width'],
@@ -2789,6 +2791,7 @@ class CuttingToolBasicParameters(models.Model):
'handle_length': integral_tool_item['shank_length'],
'blade_tip_diameter': integral_tool_item['tip_diameter'],
'blade_tip_working_size': integral_tool_item['tip_handling_size'],
'tip_r_size': integral_tool_item['tip_r_size'],
'blade_tip_taper': integral_tool_item['knife_tip_taper'],
'blade_helix_angle': integral_tool_item['blade_helix_angle'],
'blade_width': integral_tool_item['blade_width'],
@@ -2810,6 +2813,7 @@ class CuttingToolBasicParameters(models.Model):
'handle_length': integral_tool_item['shank_length'],
'blade_tip_diameter': integral_tool_item['tip_diameter'],
'blade_tip_working_size': integral_tool_item['tip_handling_size'],
'tip_r_size': integral_tool_item['tip_r_size'],
'blade_tip_taper': integral_tool_item['knife_tip_taper'],
'blade_helix_angle': integral_tool_item['blade_helix_angle'],
'blade_width': integral_tool_item['blade_width'],

View File

@@ -357,6 +357,8 @@ class FunctionalToolAssembly(models.Model):
"""
智能工厂组装单处扫码校验刀具物料
"""
if 'O-CMD' in barcode:
return ''
for record in self:
tool_assembly_id = self.env['sf.functional.tool.assembly'].browse(self.ids)
lot_ids = self.env['stock.lot'].sudo().search([('rfid', '=', barcode)])
@@ -835,7 +837,7 @@ class FunctionalToolAssembly(models.Model):
if options == '刀柄+整体式刀具':
if not integral_ids:
raise ValidationError('功能刀具清单的BOM未配置[刀柄]信息请先配置BOM再开始组装')
raise ValidationError('功能刀具清单的BOM未配置[整体式刀具]信息请先配置BOM再开始组装')
return {'options': options, 'handle_ids': handle_ids, 'integral_ids': integral_ids}
elif options == '刀柄+刀杆+刀片':
if not blade_ids:

View File

@@ -298,8 +298,8 @@ class SfShelfLocationLot(models.Model):
brand_id = fields.Many2one('sf.machine.brand', '品牌', related='product_id.brand_id')
cutting_tool_blade_diameter = fields.Float('刃部直径(mm)', related='product_id.cutting_tool_blade_diameter')
cutting_tool_blade_tip_working_size = fields.Char('刀尖R角(mm)',
related='product_id.cutting_tool_blade_tip_working_size')
cutting_tool_blade_tip_working_size = fields.Float('刀尖R角(mm)',
related='product_id.cutting_tool_blade_tip_r_size')
cutting_tool_blade_radius = fields.Char('刀尖圆弧半径(mm)',
related='product_id.cutting_tool_blade_tip_circular_arc_radius')
cutting_tool_cutter_arbor_diameter = fields.Float('刀杆直径(mm)',

View File

@@ -18,8 +18,7 @@
<field name="arch" type="xml">
<tree create="0" export_xlsx="0" delete="0">
<header>
<button string="确认" name="set_tool_material" type="object"
class="treeHeaderBtn"/>
<button string="确认" name="set_tool_material" type="object" class="treeHeaderBtn"/>
</header>
<field name="name"/>
<field name="cutting_tool_type_id"/>
@@ -62,6 +61,7 @@
<field name="brand_id"/>
<field name="shelf_location_id"/>
<field name="lot_id"/>
<field name="qty"/>
</tree>
</field>
</record>
@@ -86,6 +86,7 @@
<field name="brand_id"/>
<field name="shelf_location_id"/>
<field name="lot_id"/>
<field name="qty"/>
</tree>
</field>
</record>
@@ -111,6 +112,7 @@
<field name="brand_id"/>
<field name="shelf_location_id"/>
<field name="lot_id"/>
<field name="qty"/>
</tree>
</field>
</record>
@@ -135,6 +137,7 @@
<field name="brand_id"/>
<field name="shelf_location_id"/>
<field name="lot_id"/>
<field name="qty"/>
</tree>
</field>
</record>

View File

@@ -478,9 +478,9 @@
class="btn-primary"/>
<button string="确认组装" name="functional_tool_assembly" type="object"
attrs="{'invisible': [('assemble_status', 'not in', ['01'])]}"
class="btn-primary"/>
class="btn-primary jikimo_button_confirm"/>
<button name="get_tool_preset_parameter" string="获取测量值"
type="object" class="btn-primary"
type="object" class="btn-primary jikimo_button_flushed"
attrs="{'invisible': [('assemble_status', 'in', ['0','1','2'])]}"
/>
<field name="assemble_status" widget="statusbar" statusbar_visible="0,01,1"/>

View File

@@ -1030,3 +1030,67 @@ div.dropdown-menu.bootstrap-datetimepicker-widget {
z-index: 9999 !important;
margin-top: 12px;
}
// 自定义的下拉
.o_menu_sections_fix{
display: flex!important;
align-items: center;
}
.custom_dropdown {
position: relative;
.title {
color: #1f2631;
padding: 0 12px;
line-height: var(--o-navbar-height);
margin: 0;
cursor: pointer;
display: block;
}
.custom_dropdown_fixed {
position: absolute;
top: var(--o-navbar-height);
z-index: 1000;
padding: 0.5rem 0;
margin: 0;
font-size: 1.08333333rem;
color: #495057;
text-align: left;
background-color: #FFFFFF;
box-shadow: 0 1rem 1.1rem rgba(0, 0, 0, 0.1);
border-radius: 0.25rem;
display: none;
a {
display: block;
padding: 3px 20px;
clear: both;
font-weight: 400;
color: #495057;
text-align: inherit;
white-space: nowrap;
background-color: transparent;
border: 0;
&:hover {
color: #00005A !important;
background-color: #ebf0fd;
transition: all 0.3s linear;
}
}
}
.subtitle {
margin: 5px 0 0px;
padding: 5px 0;
text-indent: 5px;
background: rgba(0, 0, 0, 0.1);
font-size: 14px;
}
&:hover {
.title {
background-color: rgba(0, 0, 0, 0.08);
transition: all .3s;
}
.custom_dropdown_fixed{
display: block;
}
}
}

View File

@@ -1,16 +1,37 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates>
<t t-name="theme_systray">
<li class="new_icon">
<label class="theme_vista" style="margin-bottom:0px;" title="Change backend theme">
<t t-if="widget.is_admin">
<div class="icon_div">
<div class="toggle-icon" role="button">
<i id='theme_vista' class="fa fa-paint-brush" role="img" aria-label="Theme" width="22" height="22"/>
</div>
</div>
</t>
</label>
</li>
</t>
<t t-name="theme_systray">
<li class="new_icon">
<label class="theme_vista" style="margin-bottom:0px;" title="Change backend theme">
<t t-if="widget.is_admin">
<div class="icon_div">
<div class="toggle-icon" role="button">
<i id='theme_vista' class="fa fa-paint-brush" role="img" aria-label="Theme" width="22"
height="22"/>
</div>
</div>
</t>
</label>
</li>
</t>
<t t-name="customDropdownChild" owl="1">
<t t-foreach="children" t-as="child" t-key="child.id">
<t t-if="!child.childrenTree.length">
<a class="t2" t-attf-href="{{getMenuItemHref(child)}}">
<t t-esc="child.name"></t>
</a>
</t>
<div t-if="child.childrenTree.length">
<p class="subtitle">
<t t-esc="child.name"></t>
</p>
<t t-call="customDropdownChild">
<t t-set="children" t-value="child.childrenTree"/>
</t>
</div>
</t>
</t>
</templates>

View File

@@ -24,10 +24,35 @@
</div>
<!-- Current App Sections -->
<div class="d-none d-md-block">
<t t-if="currentAppSections.length"
t-call="web.NavBar.SectionsMenu">
<t t-set="sections" t-value="currentAppSections"/>
<div class="d-none d-md-block o_menu_sections_fix ">
<!-- <t t-if="currentAppSections.length"-->
<!-- t-call="web.NavBar.SectionsMenu">-->
<!-- <t t-set="sections" t-value="currentAppSections"/>-->
<!-- </t>-->
<t t-if="currentAppSections.length">
<t t-foreach="currentAppSections" t-as="menu" t-key="menu.id">
<div class="custom_dropdown" >
<t t-if="menu.childrenTree.length" >
<p class="title"><t t-esc="menu.name"></t> </p>
<div class="custom_dropdown_fixed">
<t t-call="customDropdownChild">
<t t-set="children" t-value="menu.childrenTree"/>
</t>
</div>
</t>
<!-- <t t-if="menu.childrenTree.length">-->
<!-- <p class="title"><t t-esc="menu.name"></t> </p>-->
<!-- <div class="custom_dropdown_fixed">-->
<!-- <t t-foreach="menu.childrenTree" t-as="child" t-key="child.id">-->
<!-- <a t-attf-href="{{getMenuItemHref(child, 123)}}"> <t t-esc="child.name"></t></a>-->
<!-- </t>-->
<!-- </div>-->
<!-- </t>-->
<t t-if="!menu.childrenTree.length">
<a class="title" t-attf-href="{{getMenuItemHref(menu)}}"> <t t-esc="menu.name"></t></a>
</t>
</div>
</t>
</t>
</div>
<div class="d-xs-block d-sm-block d-md-none">