From 5beb7b341701c2dcf82729659d080c03136a814a Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 13 Jul 2023 16:57:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A3=85=E5=A4=B9=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BB=B6=E8=A3=85?= =?UTF-8?q?=E5=A4=B9page=EF=BC=8C=E5=90=8D=E5=AD=97=E4=B8=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84page=E5=90=8D=E7=A7=B0=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E7=89=A9=E6=96=99=EF=BC=8C=E5=8E=BB=E6=8E=89=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E4=BB=B6=E8=A3=85=E5=A4=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/__manifest__.py | 1 - sf_base/models/__init__.py | 1 - sf_base/models/assemble.py | 44 ------ sf_base/models/functional_fixture.py | 2 +- sf_base/security/ir.model.access.csv | 1 - sf_base/views/assemble_view.xml | 131 ------------------ sf_base/views/functional_fixture_view.xml | 4 +- sf_base/views/menu_fixture_view.xml | 7 - sf_manufacturing/models/mrp_production.py | 1 + sf_manufacturing/models/mrp_workorder.py | 41 ++++-- sf_manufacturing/views/mrp_workorder_view.xml | 126 ++++++++--------- sf_mrs_connect/models/sync_common.py | 8 +- 12 files changed, 91 insertions(+), 276 deletions(-) delete mode 100644 sf_base/models/assemble.py delete mode 100644 sf_base/views/assemble_view.xml diff --git a/sf_base/__manifest__.py b/sf_base/__manifest__.py index 85182220..6f05a4a5 100644 --- a/sf_base/__manifest__.py +++ b/sf_base/__manifest__.py @@ -20,7 +20,6 @@ 'views/functional_fixture_view.xml', 'wizard/workpiece_clamping_wizard_view.xml', 'wizard/stock_removal_wizard_view.xml', - 'views/assemble_view.xml', 'views/menu_view.xml', "views/tool_views.xml", "views/tool_menu.xml", diff --git a/sf_base/models/__init__.py b/sf_base/models/__init__.py index f81781ec..cc906ab8 100644 --- a/sf_base/models/__init__.py +++ b/sf_base/models/__init__.py @@ -3,7 +3,6 @@ from . import common from . import tool_base_new from . import fixture from . import functional_fixture -from . import assemble diff --git a/sf_base/models/assemble.py b/sf_base/models/assemble.py deleted file mode 100644 index c8568f99..00000000 --- a/sf_base/models/assemble.py +++ /dev/null @@ -1,44 +0,0 @@ -from odoo import models, fields, api - - -class Assemble(models.Model): - _name = 'sf.assemble' - _description = "组合装夹" - - functional_fixture_code = fields.Char(string="功能夹具编码", readonly=True) - name = fields.Char(string="功能夹具名称", readonly=True) - functional_fixture_type_id = fields.Many2one('sf.functional.fixture.type', string="功能夹具类型", readonly=True) - chuck_name = fields.Char(string="卡盘名称") - chuck_brand_id = fields.Many2one('sf.machine.brand', string="卡盘品牌") - chuck_type_id = fields.Char(string="卡盘类型") - chuck_model_id = fields.Char(string="卡盘型号") - tray_name = fields.Char(string="托盘名称") - tray_brand_id = fields.Many2one('sf.machine.brand', string="托盘品牌") - tray_type_id = fields.Char(string="托盘类型") - tray_model_id = fields.Char(string="托盘型号") - real_code = fields.Char(string="真实坯料编码") - real_name = fields.Char(string="真实坯料名称") - real_width = fields.Float(string="真实宽度") - real_length = fields.Float(string="真实长度") - real_height = fields.Float(string="真实高度") - real_diameter = fields.Float(string="真实直径") - total_wight = fields.Float(string="总重量") - maximum_carrying_weight = fields.Char(string="最大承载重量[kg]") - maximum_clamping_force = fields.Char(string="最大夹持力[n]") - production_line = fields.Char(string="生产线") - # 以下为智能工厂工单带过来的机床信息 - machine_tool = fields.Many2one('sf.machine_tool', string="机床名称") - machine_tool_startime = fields.Date(string="机床开始加工时间") - # 以下为智能工厂工单带过来的信息 - apply_staff = fields.Char(string="申请人") - machine_tool_code = fields.Char(string="机床编码") - apply_time = fields.Date(string="申请时间") - apply_reason = fields.Char(string="申请原因") - # 以下为装夹的信息 - preset_staff = fields.Char(string="预调名称") - preset_time = fields.Date(string="预调时间") - material_taker = fields.Char(string="领料人") - material_removal_time = fields.Date(string="领料出库时间") - remark = fields.Char(string="备注") - # 以下为出库的信息 - stock_removal_code = fields.Char(string="出库人") diff --git a/sf_base/models/functional_fixture.py b/sf_base/models/functional_fixture.py index f8acaab2..cce1d9e3 100644 --- a/sf_base/models/functional_fixture.py +++ b/sf_base/models/functional_fixture.py @@ -16,7 +16,7 @@ class FunctionalFixture(models.Model): code = fields.Char(string='编码', readonly=True) name = fields.Char(string="名称", size=15, required=True) - functional_fixture_type_id = fields.Many2one('sf.functional.fixture.type', string="功能夹具类型", required=True) + type_id = fields.Many2one('sf.functional.fixture.type', string="功能夹具类型", required=True) zero_chuck_model_ids = fields.Many2many('sf.fixture.model', 'rel_fixture_model_zero_chuck', string="零点卡盘型号", required=True, domain=[('fixture_material_type', '=', '零点卡盘')]) diff --git a/sf_base/security/ir.model.access.csv b/sf_base/security/ir.model.access.csv index a3fdb8e5..16f639b7 100644 --- a/sf_base/security/ir.model.access.csv +++ b/sf_base/security/ir.model.access.csv @@ -26,7 +26,6 @@ access_sf_functional_fixture_type,sf_functional_fixture_type,model_sf_functional access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,base.group_user,1,1,1,1 access_sf_workpiece_clamping_wizard,sf_workpiece_clamping_wizard,model_sf_workpiece_clamping_wizard,base.group_user,1,1,1,1 access_sf_stock_removal_wizard,sf_stock_removal_wizard,model_sf_stock_removal_wizard,base.group_user,1,1,1,1 -access_sf_assemble,sf_assemble,model_sf_assemble,base.group_user,1,1,1,1 diff --git a/sf_base/views/assemble_view.xml b/sf_base/views/assemble_view.xml deleted file mode 100644 index ccad42f9..00000000 --- a/sf_base/views/assemble_view.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - search.sf.assemble - sf.assemble - - - - - - - - - - - - 工件夹具 - sf.assemble - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 工件夹具 - sf.assemble - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - 工件夹具 - ir.actions.act_window - sf.assemble - tree,form - - -
\ No newline at end of file diff --git a/sf_base/views/functional_fixture_view.xml b/sf_base/views/functional_fixture_view.xml index 799c6351..2cf4d50a 100644 --- a/sf_base/views/functional_fixture_view.xml +++ b/sf_base/views/functional_fixture_view.xml @@ -82,7 +82,7 @@ - + @@ -98,7 +98,7 @@ - + diff --git a/sf_base/views/menu_fixture_view.xml b/sf_base/views/menu_fixture_view.xml index 64d5873a..7186fe35 100644 --- a/sf_base/views/menu_fixture_view.xml +++ b/sf_base/views/menu_fixture_view.xml @@ -38,11 +38,4 @@ name="功能夹具" sequence="4" /> - - \ No newline at end of file diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 3507919d..05bacce5 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -6,6 +6,7 @@ from odoo import api, fields, models, _ class MrpProduction(models.Model): _inherit = 'mrp.production' _description = "制造订单" + _order = 'create_date desc' tray_ids = fields.One2many('sf.tray', 'production_id', string="托盘") maintenance_count = fields.Integer(compute='_compute_maintenance_count', string="Number of maintenance requests") diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 3b1ecdb1..a5b110d7 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -16,7 +16,7 @@ from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController class ResMrpWorkOrder(models.Model): _inherit = 'mrp.workorder' - _order = 'sequence' + _order = 'sequence asc,create_date desc' product_tmpl_id_length = fields.Float(related='production_id.product_tmpl_id.length', readonly=True, store=True, check_company=True, string="坯料长度(mm)") @@ -108,6 +108,33 @@ class ResMrpWorkOrder(models.Model): supplier_id = fields.Many2one('res.partner', string='外协供应商') equipment_id = fields.Many2one('maintenance.equipment', string='加工设备') schedule_state = fields.Selection(related='production_id.schedule_state', store=True) + # 工件装夹信息 + functional_fixture_code = fields.Char(string="功能夹具编码", readonly=True) + functional_fixture_serial_number = fields.Char(string="功能夹具序列号", readonly=True) + functional_fixture_id = fields.Many2one('sf.functional.fixture', string="功能夹具") + functional_fixture_type_id = fields.Many2one('sf.functional.fixture.type', string="功能夹具类型", readonly=True) + chuck_serial_number = fields.Char(string="卡盘序列号") + chuck_name = fields.Char(string="卡盘名称") + chuck_brand_id = fields.Many2one('sf.machine.brand', string="卡盘品牌") + chuck_type_id = fields.Char(string="卡盘类型") + chuck_model_id = fields.Char(string="卡盘型号") + tray_serial_number = fields.Char(string="卡盘序列号") + tray_name = fields.Char(string="托盘名称") + tray_brand_id = fields.Many2one('sf.machine.brand', string="托盘品牌") + tray_type_id = fields.Char(string="托盘类型") + tray_model_id = fields.Char(string="托盘型号") + total_wight = fields.Float(string="总重量") + maximum_carrying_weight = fields.Char(string="最大承载重量[kg]") + maximum_clamping_force = fields.Char(string="最大夹持力[n]") + production_line = fields.Char(string="生产线") + preset_program_information = fields.Char(string="预调程序信息") + + @api.onchange('functional_fixture_id') + def _onchange_functional_fixture_id(self): + if self.functional_fixture_id: + self.functional_fixture_code = self.functional_fixture_id.code + self.functional_fixture_type_id = self.functional_fixture_id.type_id.id + def get_no_data(self, production_id): process_parameter_workorder = self.search( @@ -524,18 +551,6 @@ class ResMrpWorkOrder(models.Model): }) super().button_finish() - def action_view_schedule_tree(self): - # 执行打开树视图的操作(已排程的工单) - return { - 'name': 'Schedule Work Order Tree', - 'type': 'ir.actions.act_window', - 'res_model': 'mrp.workorder', - 'target': 'current', - 'view_mode': 'tree', - 'views': [[self.env.ref('mrp.mrp_production_workorder_tree_editable_view').id], 'tree'], - 'domain': [('schedule_state', '=', '已排')], - } - class CNCprocessing(models.Model): _name = 'sf.cnc.processing' diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index db5f2ed4..c4152c3c 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -95,39 +95,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mrp.production.workorder.tray.form.inherit.sf mrp.workorder @@ -137,6 +104,7 @@ +