From baaeac10eb5702b8304ef7e6a5142eca43deb4c1 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Thu, 23 Nov 2023 16:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=90=8D=E7=A7=B0=E8=A7=84=E5=88=99=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=B6=E9=80=A0=E6=A8=A1=E5=9D=97=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BB=84=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/security/group_security.xml | 3 ++- sf_base/security/ir.model.access.csv | 2 ++ sf_maintenance/models/sf_maintenance.py | 4 +--- sf_manufacturing/models/product_template.py | 4 ++-- sf_sale/models/auto_quatotion_common.py | 2 +- sf_sale/models/quick_easy_order.py | 4 ++-- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sf_base/security/group_security.xml b/sf_base/security/group_security.xml index 60daf15e..d727278a 100644 --- a/sf_base/security/group_security.xml +++ b/sf_base/security/group_security.xml @@ -3,11 +3,12 @@ 制造普通用户 + - + diff --git a/sf_base/security/ir.model.access.csv b/sf_base/security/ir.model.access.csv index 37daa2b3..1a550d41 100644 --- a/sf_base/security/ir.model.access.csv +++ b/sf_base/security/ir.model.access.csv @@ -40,3 +40,5 @@ access_maintenance_equipment_image,maintenance_equipment_image,model_maintenance + + diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py index a46f7f69..d4aa6ba4 100644 --- a/sf_maintenance/models/sf_maintenance.py +++ b/sf_maintenance/models/sf_maintenance.py @@ -158,10 +158,8 @@ class SfMaintenanceEquipment(models.Model): def create(self, vals): # 在创建设备之前执行一些自定义逻辑 - vals.name = vals.MTcode + '#' + vals.type_id.name - - equipment = super(SfMaintenanceEquipment, self).create(vals) + equipment.name = equipment.MTcode + '#' + equipment.category_id.name # 在创建设备之后执行一些自定义逻辑 # ... diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index ea0841ad..73d3d4aa 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -3,8 +3,8 @@ from odoo import models, fields, api, _ from odoo.exceptions import ValidationError from odoo.modules import get_resource_path from odoo.addons.sf_base.commons.common import Common -#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 diff --git a/sf_sale/models/auto_quatotion_common.py b/sf_sale/models/auto_quatotion_common.py index 1b29c6d2..09ea3f0f 100644 --- a/sf_sale/models/auto_quatotion_common.py +++ b/sf_sale/models/auto_quatotion_common.py @@ -2,7 +2,7 @@ import logging from odoo.modules import get_resource_path from odoo import fields, models, api -#from quatotion import readSql, feature_recognize, auto_quatotion +from quatotion import readSql, feature_recognize, auto_quatotion __author__ = 'jinling.yang' _logger = logging.getLogger(__name__) diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 310bbc7a..e9f152a8 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -1,7 +1,7 @@ from odoo import models, fields, api 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 from odoo.exceptions import ValidationError, UserError from odoo.addons.sf_base.commons.common import Common from datetime import datetime