diff --git a/sf_maintenance/__manifest__.py b/sf_maintenance/__manifest__.py index ce8f638e..595a5d25 100644 --- a/sf_maintenance/__manifest__.py +++ b/sf_maintenance/__manifest__.py @@ -6,7 +6,7 @@ 'category': '工厂设备', 'description': """ """, - 'depends': ['hr_maintenance', 'sf_base', 'sf_message'], + 'depends': ['hr_maintenance', 'sf_base'], 'data': [ 'security/group_security.xml', 'security/ir.model.access.csv', diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py index dd7266cc..e20fd97c 100644 --- a/sf_maintenance/models/sf_maintenance.py +++ b/sf_maintenance/models/sf_maintenance.py @@ -33,7 +33,7 @@ class SfMaintenanceEquipmentAGVLog(models.Model): class SfMaintenanceEquipment(models.Model): - _inherit = ['maintenance.equipment', 'sf.message.template'] + _inherit = ['maintenance.equipment'] _description = '设备' crea_url = "/api/machine_tool/create" diff --git a/sf_manufacturing/__manifest__.py b/sf_manufacturing/__manifest__.py index 10c949f5..35501367 100644 --- a/sf_manufacturing/__manifest__.py +++ b/sf_manufacturing/__manifest__.py @@ -10,7 +10,7 @@ """, 'category': 'sf', 'website': 'https://www.sf.jikimo.com', - 'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'sf_warehouse','sf_message'], + 'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'sf_warehouse'], 'data': [ 'data/stock_data.xml', 'data/empty_racks_data.xml', diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index bc049c12..97d172c9 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -18,7 +18,7 @@ from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController class ResMrpWorkOrder(models.Model): - _inherit = ['mrp.workorder', 'sf.message.template'] + _inherit = ['mrp.workorder'] _order = 'sequence asc' product_tmpl_name = fields.Char('坯料产品名称', related='production_bom_id.bom_line_ids.product_id.name') diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 37fa02bd..071f1167 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_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index 1690b632..3eab030e 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -545,7 +545,7 @@ class ProductionLot(models.Model): class StockPicking(models.Model): - _inherit = ['stock.picking', 'sf.message.template'] + _inherit = ['stock.picking'] surface_technics_parameters_id = fields.Many2one('sf.production.process.parameter', string="表面工艺可选参数") diff --git a/sf_message/__manifest__.py b/sf_message/__manifest__.py index 3a0f37d8..492510d1 100644 --- a/sf_message/__manifest__.py +++ b/sf_message/__manifest__.py @@ -11,7 +11,7 @@ """, 'category': 'sf', 'website': 'https://www.sf.jikimo.com', - 'depends': ['base', 'sf_base'], + 'depends': ['base', 'sf_plan'], 'data': [ 'security/ir.model.access.csv', 'views/sf_message_template_view.xml', diff --git a/sf_message/models/__init__.py b/sf_message/models/__init__.py index ec5b1c2f..b0c058fc 100644 --- a/sf_message/models/__init__.py +++ b/sf_message/models/__init__.py @@ -1 +1,8 @@ from . import sf_message_template +from . import sf_message_sale +from . import sf_message_plan +from . import sf_message_stock_picking +from . import sf_message_cam_program +from . import sf_message_functional_tool_assembly +from . import sf_message_purchase +from . import sf_message_workorder diff --git a/sf_message/models/sf_message_cam_program.py b/sf_message/models/sf_message_cam_program.py new file mode 100644 index 00000000..5a6154e5 --- /dev/null +++ b/sf_message/models/sf_message_cam_program.py @@ -0,0 +1,6 @@ +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'] diff --git a/sf_message/models/sf_message_functional_tool_assembly.py b/sf_message/models/sf_message_functional_tool_assembly.py new file mode 100644 index 00000000..6b5e4ebf --- /dev/null +++ b/sf_message/models/sf_message_functional_tool_assembly.py @@ -0,0 +1,6 @@ +from odoo import models, fields, api, _ + + +class SFMessagefunctionalToolAssembly(models.Model): + _name = 'sf.functional.tool.assembly' + _inherit = ['sf.functional.tool.assembly', 'sf.message.template'] diff --git a/sf_message/models/sf_message_plan.py b/sf_message/models/sf_message_plan.py new file mode 100644 index 00000000..913b61de --- /dev/null +++ b/sf_message/models/sf_message_plan.py @@ -0,0 +1,6 @@ +from odoo import models, fields, api, _ + + +class SFMessagePlan(models.Model): + _name = 'sf.production.plan' + _inherit = ['sf.production.plan', 'sf.message.template'] diff --git a/sf_message/models/sf_message_purchase.py b/sf_message/models/sf_message_purchase.py new file mode 100644 index 00000000..89836486 --- /dev/null +++ b/sf_message/models/sf_message_purchase.py @@ -0,0 +1,6 @@ +from odoo import models, fields, api, _ + + +class SFMessagePurchase(models.Model): + _name = 'purchase.order' + _inherit = ['purchase.order', 'sf.message.template'] diff --git a/sf_message/models/sf_message_sale.py b/sf_message/models/sf_message_sale.py new file mode 100644 index 00000000..2f9a9c01 --- /dev/null +++ b/sf_message/models/sf_message_sale.py @@ -0,0 +1,6 @@ +from odoo import models, fields, api, _ + + +class SFMessageSale(models.Model): + _name = 'sale.order' + _inherit = ['sale.order', 'sf.message.template'] diff --git a/sf_message/models/sf_message_stock_picking.py b/sf_message/models/sf_message_stock_picking.py new file mode 100644 index 00000000..894dce9d --- /dev/null +++ b/sf_message/models/sf_message_stock_picking.py @@ -0,0 +1,6 @@ +from odoo import models, fields, api, _ + + +class SFMessageStockPicking(models.Model): + _name = 'stock.picking' + _inherit = ['stock.picking', 'sf.message.template'] diff --git a/sf_message/models/sf_message_template.py b/sf_message/models/sf_message_template.py index 481497e0..5f695a52 100644 --- a/sf_message/models/sf_message_template.py +++ b/sf_message/models/sf_message_template.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from odoo import models, fields, api +from abc import ABC, abstractmethod class SfMessageTemplate(models.Model): @@ -47,3 +48,8 @@ class SfMessageTemplate(models.Model): if self.notification_department_id: self.notification_employee_ids = False + @abstractmethod + def dispatch(self, args): + """ + 强迫继承该类必走该抽象方法' + """ diff --git a/sf_message/models/sf_message_workorder.py b/sf_message/models/sf_message_workorder.py new file mode 100644 index 00000000..cab2408d --- /dev/null +++ b/sf_message/models/sf_message_workorder.py @@ -0,0 +1,6 @@ +from odoo import models, fields, api, _ + + +class SFMessageWork(models.Model): + _name = 'mrp.workorder' + _inherit = ['mrp.workorder', 'sf.message.template'] diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py index cf4fa621..ddd3bcc5 100644 --- a/sf_plan/models/custom_plan.py +++ b/sf_plan/models/custom_plan.py @@ -11,7 +11,7 @@ from odoo.exceptions import UserError, ValidationError class sf_production_plan(models.Model): _name = 'sf.production.plan' _description = 'sf_production_plan' - _inherit = ['mail.thread', 'sf.message.template'] + _inherit = ['mail.thread'] # _order = 'state desc, write_date desc' state = fields.Selection([ 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 diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 9e45a141..d19a3b02 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -11,7 +11,7 @@ READONLY_FIELD_STATES = { class ReSaleOrder(models.Model): - _inherit = ['sale.order', 'sf.message.template'] + _inherit = 'sale.order' mrp_production_count = fields.Integer( "Count of MO generated", @@ -183,7 +183,7 @@ class ProductTemplate(models.Model): class RePurchaseOrder(models.Model): - _inherit = ['purchase.order','sf.message.template'] + _inherit = 'purchase.order' mrp_production_count = fields.Integer( "Count of MO Source", diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py index da9c9850..d9ab1536 100644 --- a/sf_tool_management/models/base.py +++ b/sf_tool_management/models/base.py @@ -181,7 +181,7 @@ class MachineTableToolChangingApply(models.Model): class CAMWorkOrderProgramKnifePlan(models.Model): _name = 'sf.cam.work.order.program.knife.plan' - _inherit = ['mail.thread', 'sf.message.template'] + _inherit = ['mail.thread'] _description = 'CAM工单程序用刀计划' name = fields.Char('工单任务编号') @@ -349,7 +349,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model): class FunctionalToolAssembly(models.Model): _name = 'sf.functional.tool.assembly' - _inherit = ['mail.thread', 'barcodes.barcode_events_mixin', 'sf.message.template'] + _inherit = ['mail.thread', 'barcodes.barcode_events_mixin'] _description = '功能刀具组装' _order = 'tool_loading_time desc, use_tool_time asc' @@ -1143,7 +1143,7 @@ class FunctionalToolAssembly(models.Model): class FunctionalToolDismantle(models.Model): _name = 'sf.functional.tool.dismantle' - _inherit = ["barcodes.barcode_events_mixin", 'mail.thread', 'sf.message.template'] + _inherit = ["barcodes.barcode_events_mixin", 'mail.thread'] _description = '功能刀具拆解' def on_barcode_scanned(self, barcode):