From 6591e663b658cdb46795727d9741ddb3686c51fb Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Mon, 23 Sep 2024 10:26:53 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BE=85=E6=8E=92?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 ++-- sf_message/models/sf_message_sale.py | 8 ++------ sf_sale/models/quick_easy_order.py | 4 ++-- sf_sale/models/quick_easy_order_old.py | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 209c694e..48cabaf7 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError 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 class ResProductMo(models.Model): diff --git a/sf_message/models/sf_message_sale.py b/sf_message/models/sf_message_sale.py index 1a9fe70b..fb9d5976 100644 --- a/sf_message/models/sf_message_sale.py +++ b/sf_message/models/sf_message_sale.py @@ -27,6 +27,7 @@ class SFMessageSale(models.Model): # 继承并重写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))]) @@ -34,10 +35,5 @@ class SFMessageSale(models.Model): product = sale_order_line[0].product_id.name elif len(sale_order_line) > 1: product = '%s...' % sale_order_line[0].product_id.name - res = super(SFMessageSale, self)._get_message(message_queue_ids) - if res: - try: - res.add_queue('待排程') - except Exception as e: - logging.info('_get_message error:%s' % e) + res[0] = res[0].replace('{{product_id}}', product) return res diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index cb1886a1..081807a4 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -8,8 +8,8 @@ from datetime import datetime import requests from odoo import http from odoo.http import request -# 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 from odoo import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 9bd61132..4756a2c5 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -# 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 from odoo.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path From b8baa84270e3f3c5e6cb84550d16c76fdad745cd Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Mon, 23 Sep 2024 10:30:51 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 144 +++++++++++++++---------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index 6c4ba7ff..daf049eb 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -292,78 +292,78 @@ class StockRule(models.Model): for product_id, all_production in grouped_product_ids.items(): # 为同一个product_id创建一个生产订单名称列表 product_id_to_production_names[product_id] = [production.name for production in all_production] - # for production_item in productions: - # - # production_programming = self.env['mrp.production'].search( - # [('product_id.id', '=', production_item.product_id.id), - # ('origin', '=', production_item.origin)], - # limit=1, order='id asc') - # if production_item.product_id.id in product_id_to_production_names: - # if not production_programming.programming_no: - # if production_item.product_id.model_process_parameters_ids: - # is_purchase = False - # sorted_process_parameters = sorted(production_item.product_id.model_process_parameters_ids, - # key=lambda w: w.id) - # - # consecutive_process_parameters = [] - # m = 0 - # for i in range(len(sorted_process_parameters) - 1): - # if m == 0: - # is_purchase = False - # if self.env['product.template']._get_process_parameters_product( - # sorted_process_parameters[i]).partner_id == self.env[ - # 'product.template']._get_process_parameters_product(sorted_process_parameters[ - # i + 1]).partner_id and \ - # sorted_process_parameters[i].gain_way == '外协': - # if sorted_process_parameters[i] not in consecutive_process_parameters: - # consecutive_process_parameters.append(sorted_process_parameters[i]) - # consecutive_process_parameters.append(sorted_process_parameters[i + 1]) - # m += 1 - # continue - # else: - # if m == len(consecutive_process_parameters) - 1 and m != 0: - # self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, - # production_item, - # product_id_to_production_names) - # if sorted_process_parameters[i] in consecutive_process_parameters: - # is_purchase = True - # consecutive_process_parameters = [] - # m = 0 - # # 当前面的连续外协采购单生成再生成当前外协采购单 - # if is_purchase is False: - # self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, - # production_item, - # product_id_to_production_names) - # if m == len(consecutive_process_parameters) - 1 and m != 0: - # self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, - # production_item, - # product_id_to_production_names) - # if sorted_process_parameters[i] in consecutive_process_parameters: - # is_purchase = True - # consecutive_process_parameters = [] - # m = 0 - # if m == len(consecutive_process_parameters) - 1 and m != 0: - # self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, - # production_item, - # product_id_to_production_names) - # if is_purchase is False and m == 0: - # if len(sorted_process_parameters) == 1: - # self.env['purchase.order'].get_purchase_order(sorted_process_parameters, - # production_item, - # product_id_to_production_names) - # else: - # self.env['purchase.order'].get_purchase_order(sorted_process_parameters[i], - # production_item, - # product_id_to_production_names) - # # # 同一个产品多个制造订单对应一个编程单和模型库 - # # # 只调用一次fetchCNC,并将所有生产订单的名称作为字符串传递 - # if not production_item.programming_no: - # if not production_programming.programming_no: - # production_item.fetchCNC( - # ', '.join(product_id_to_production_names[production_item.product_id.id])) - # else: - # production_item.write({'programming_no': production_programming.programming_no, - # 'programming_state': '编程中'}) + for production_item in productions: + + production_programming = self.env['mrp.production'].search( + [('product_id.id', '=', production_item.product_id.id), + ('origin', '=', production_item.origin)], + limit=1, order='id asc') + if production_item.product_id.id in product_id_to_production_names: + if not production_programming.programming_no: + if production_item.product_id.model_process_parameters_ids: + is_purchase = False + sorted_process_parameters = sorted(production_item.product_id.model_process_parameters_ids, + key=lambda w: w.id) + + consecutive_process_parameters = [] + m = 0 + for i in range(len(sorted_process_parameters) - 1): + if m == 0: + is_purchase = False + if self.env['product.template']._get_process_parameters_product( + sorted_process_parameters[i]).partner_id == self.env[ + 'product.template']._get_process_parameters_product(sorted_process_parameters[ + i + 1]).partner_id and \ + sorted_process_parameters[i].gain_way == '外协': + if sorted_process_parameters[i] not in consecutive_process_parameters: + consecutive_process_parameters.append(sorted_process_parameters[i]) + consecutive_process_parameters.append(sorted_process_parameters[i + 1]) + m += 1 + continue + else: + if m == len(consecutive_process_parameters) - 1 and m != 0: + self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, + production_item, + product_id_to_production_names) + if sorted_process_parameters[i] in consecutive_process_parameters: + is_purchase = True + consecutive_process_parameters = [] + m = 0 + # 当前面的连续外协采购单生成再生成当前外协采购单 + if is_purchase is False: + self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, + production_item, + product_id_to_production_names) + if m == len(consecutive_process_parameters) - 1 and m != 0: + self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, + production_item, + product_id_to_production_names) + if sorted_process_parameters[i] in consecutive_process_parameters: + is_purchase = True + consecutive_process_parameters = [] + m = 0 + if m == len(consecutive_process_parameters) - 1 and m != 0: + self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, + production_item, + product_id_to_production_names) + if is_purchase is False and m == 0: + if len(sorted_process_parameters) == 1: + self.env['purchase.order'].get_purchase_order(sorted_process_parameters, + production_item, + product_id_to_production_names) + else: + self.env['purchase.order'].get_purchase_order(sorted_process_parameters[i], + production_item, + product_id_to_production_names) + # # 同一个产品多个制造订单对应一个编程单和模型库 + # # 只调用一次fetchCNC,并将所有生产订单的名称作为字符串传递 + if not production_item.programming_no: + if not production_programming.programming_no: + production_item.fetchCNC( + ', '.join(product_id_to_production_names[production_item.product_id.id])) + else: + production_item.write({'programming_no': production_programming.programming_no, + 'programming_state': '编程中'}) return True From 4cee5213bbd76ebd327affd562bbc341421bb6ed Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Mon, 23 Sep 2024 10:48:48 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=80=BC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/models/tool_other_features.py | 2 +- sf_manufacturing/models/product_template.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sf_base/models/tool_other_features.py b/sf_base/models/tool_other_features.py index 5bd597ae..9dd30710 100644 --- a/sf_base/models/tool_other_features.py +++ b/sf_base/models/tool_other_features.py @@ -21,7 +21,7 @@ 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_diameter = fields.Float('刀尖直径(mm)') blade_tip_working_size = fields.Char('刀尖倒角度(°)', size=20) tip_r_size = fields.Float('刀尖R角(mm)') blade_tip_taper = fields.Integer('刀尖锥度(°)') diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 48cabaf7..b18ab04c 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -237,8 +237,8 @@ class ResProductMo(models.Model): self.cutting_tool_blade_tip_diameter = self.specification_id.blade_tip_diameter 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.tip_r_size - self.cutting_tool_blade_tip_r_size = self.specification_id.blade_tip_working_size + 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 From cab0e1ce0b4c1da7377e641b8cd09e5f439f4fb7 Mon Sep 17 00:00:00 2001 From: hy <1298386937@qq.com> Date: Mon, 23 Sep 2024 10:54:37 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=A1=B6=E9=83=A8=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E7=BA=A7=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/src/scss/theme.scss | 7 +++ .../static/src/xml/systray.xml | 47 ++++++++++++++----- .../static/src/xml/top_bar.xml | 47 +++++++++++-------- 3 files changed, 68 insertions(+), 33 deletions(-) diff --git a/vista_backend_theme/static/src/scss/theme.scss b/vista_backend_theme/static/src/scss/theme.scss index a7555c7f..669de341 100644 --- a/vista_backend_theme/static/src/scss/theme.scss +++ b/vista_backend_theme/static/src/scss/theme.scss @@ -1077,6 +1077,13 @@ div.dropdown-menu.bootstrap-datetimepicker-widget { } } } + .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); diff --git a/vista_backend_theme/static/src/xml/systray.xml b/vista_backend_theme/static/src/xml/systray.xml index 7f3865b2..a3005a15 100644 --- a/vista_backend_theme/static/src/xml/systray.xml +++ b/vista_backend_theme/static/src/xml/systray.xml @@ -1,16 +1,37 @@ - -
  • - -
  • -
    + +
  • + +
  • +
    + + + + + + + + + +
    +

    + +

    + + + +
    + +
    +
    \ No newline at end of file diff --git a/vista_backend_theme/static/src/xml/top_bar.xml b/vista_backend_theme/static/src/xml/top_bar.xml index 05b399b6..12a2a20b 100644 --- a/vista_backend_theme/static/src/xml/top_bar.xml +++ b/vista_backend_theme/static/src/xml/top_bar.xml @@ -24,28 +24,35 @@ -
    - - - - - - -
    - -

    -
    - - - -
    -
    - - - -
    + + + + +
    + +

    +
    + + + +
    +
    + + + + + + + + + + + +
    +
    From 4f73f57ddfe734aa915d27d84be012e003274b71 Mon Sep 17 00:00:00 2001 From: hy <1298386937@qq.com> Date: Mon, 23 Sep 2024 10:59:10 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BA=A4=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vista_backend_theme/static/src/xml/top_bar.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vista_backend_theme/static/src/xml/top_bar.xml b/vista_backend_theme/static/src/xml/top_bar.xml index 12a2a20b..aa32caa3 100644 --- a/vista_backend_theme/static/src/xml/top_bar.xml +++ b/vista_backend_theme/static/src/xml/top_bar.xml @@ -25,10 +25,10 @@
    - - - + + + +
    From 6e20a466ced8a2a282007976ba789d5fc2b0aad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Mon, 23 Sep 2024 11:21:17 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=86=99=E6=AD=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_frontend/views/bye_odoo.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jikimo_frontend/views/bye_odoo.xml b/jikimo_frontend/views/bye_odoo.xml index 0930f551..75136cc1 100644 --- a/jikimo_frontend/views/bye_odoo.xml +++ b/jikimo_frontend/views/bye_odoo.xml @@ -5,9 +5,9 @@