From 6738a855bb8e9981b74276384f11873a1962614e Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Sun, 17 Dec 2023 10:48:51 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9D=83=E9=99=90=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_base/security/ir.model.access.csv | 3 +
sf_maintenance/security/ir.model.access.csv | 4 +-
sf_manufacturing/models/mrp_production.py | 27 ++
sf_manufacturing/security/ir.model.access.csv | 22 +-
.../views/mrp_production_addional_change.xml | 18 ++
sf_plan/__manifest__.py | 1 +
sf_plan/models/__init__.py | 1 +
sf_plan/models/change_manufactuing.py | 293 ++++++++++++++++++
sf_plan/views/change_manufactuing.xml | 170 ++++++++++
sf_plan/views/menuitem_override.xml | 0
sf_quality/__manifest__.py | 2 +-
sf_quality/security/ir.model.access.csv | 3 +
sf_sale/security/ir.model.access.csv | 3 +
sf_warehouse/__manifest__.py | 2 +-
sf_warehouse/security/ir.model.access.csv | 16 +
15 files changed, 561 insertions(+), 4 deletions(-)
create mode 100644 sf_plan/models/change_manufactuing.py
create mode 100644 sf_plan/views/change_manufactuing.xml
create mode 100644 sf_plan/views/menuitem_override.xml
diff --git a/sf_base/security/ir.model.access.csv b/sf_base/security/ir.model.access.csv
index 6ff1f8a8..c07cc8c6 100644
--- a/sf_base/security/ir.model.access.csv
+++ b/sf_base/security/ir.model.access.csv
@@ -37,6 +37,9 @@ access_purchase_order_line_group_purchase_director,access_purchase_order_line_gr
+access_purchase_order,purchase.order,purchase.model_purchase_order,sf_base.group_plan_dispatch,1,0,0,0
+access_purchase_order_line,purchase.order.line,purchase.model_purchase_order_line,sf_base.group_plan_dispatch,1,0,0,0
+access_account_move_line,account.move.line,account.model_account_move_line,sf_base.group_plan_dispatch,1,0,0,0
diff --git a/sf_maintenance/security/ir.model.access.csv b/sf_maintenance/security/ir.model.access.csv
index e8f2ab32..3396ae59 100644
--- a/sf_maintenance/security/ir.model.access.csv
+++ b/sf_maintenance/security/ir.model.access.csv
@@ -7,4 +7,6 @@ access_maintenance_standard_image,maintenance_standard_image,model_maintenance_s
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_user,1,1,1,1
-
+access_maintenance_request,maintenance_request,model_maintenance_request,sf_base.group_plan_dispatch,1,0,0,0
+access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_base.group_plan_dispatch,1,0,0,0
+access_equipment_maintenance_standards,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_base.group_plan_dispatch,1,0,0,0
\ No newline at end of file
diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index 42e70d14..54697f9b 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -15,6 +15,33 @@ class MrpProduction(models.Model):
schedule_state = fields.Selection([('未排', '未排'), ('已排', '已排')],
string='排程状态', default='未排')
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
@api.depends('request_ids')
def _compute_maintenance_count(self):
for production in self:
diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv
index 0c620608..f4f8948a 100644
--- a/sf_manufacturing/security/ir.model.access.csv
+++ b/sf_manufacturing/security/ir.model.access.csv
@@ -84,4 +84,24 @@ access_mrp_workcenter_tag_manager,access.mrp.workcenter.tag,mrp.model_mrp_workce
access_mrp_production_split_multi,access.mrp.production.split.multi,mrp.model_mrp_production_split_multi,sf_base.group_sf_mrp_user,1,1,1,0
access_mrp_production_split,access.mrp.production.split,mrp.model_mrp_production_split,sf_base.group_sf_mrp_user,1,1,1,0
access_mrp_production_split_line,access.mrp.production.split.line,mrp.model_mrp_production_split_line,sf_base.group_sf_mrp_user,1,1,1,0
-access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0
\ No newline at end of file
+access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0
+
+access_mrp_production,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,1,1,0
+access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,0,0,0
+access_sf_production_line,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,1,1,0
+access_mrp_workcenter,mrp_workcenter,model_mrp_workcenter,sf_base.group_plan_dispatch,1,1,1,0
+access_mrp_bom,mrp.bom,mrp.model_mrp_bom,sf_base.group_plan_dispatch,1,1,1,0
+access_mrp_bom_line,mrp.bom.line,mrp.model_mrp_bom_line,sf_base.group_plan_dispatch,1,0,0,0
+access_mrp_unbuild,mrp.unbuild,mrp.model_mrp_unbuild,sf_base.group_plan_dispatch,1,1,1,0
+access_stock_scrap,stock.scrap,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,1,1,0
+access_sf_model_type,sf.model.type,model_sf_model_type,sf_base.group_plan_dispatch,1,1,1,0
+access_mrp_routing_workcenter,mrp.routing.workcenter,mrp.model_mrp_routing_workcenter,sf_base.group_plan_dispatch,1,1,1,0
+access_mrp_document,mrp.document,mrp.model_mrp_document,sf_base.group_plan_dispatch,1,0,0,0
+access_sf_product_model_type_routing_sort,sf.product.model.type.routing.sort,model_sf_product_model_type_routing_sort,sf_base.group_plan_dispatch,1,0,0,0
+access_sf_embryo_model_type_routing_sort,sf.embryo.model.type.routing.sort,model_sf_embryo_model_type_routing_sort,sf_base.group_plan_dispatch,1,0,0,0
+access_sf_surface_technics_model_type_routing_sort,sf.surface_technics.model.type.routing.sort,model_sf_surface_technics_model_type_routing_sort,sf_base.group_plan_dispatch,1,0,0,0
+access_mrp_workcenter_capacity,mrp.workcenter.capacity,mrp.model_mrp_workcenter_capacity,sf_base.group_plan_dispatch,1,0,0,0
+
+
+
+access_mrp_workcenter_productivity,mrp.workcenter.productivity,mrp.model_mrp_workcenter_productivity,sf_base.group_plan_dispatch,1,0,0,0
\ No newline at end of file
diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml
index 3f16b734..8f183857 100644
--- a/sf_manufacturing/views/mrp_production_addional_change.xml
+++ b/sf_manufacturing/views/mrp_production_addional_change.xml
@@ -52,6 +52,24 @@
+
+
+ custom.mrp.production.form
+ mrp.production
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sf_plan/__manifest__.py b/sf_plan/__manifest__.py
index d0cd7bcb..257400d3 100644
--- a/sf_plan/__manifest__.py
+++ b/sf_plan/__manifest__.py
@@ -18,6 +18,7 @@
'security/ir.model.access.csv',
# 'security/rules.xml',
'views/view.xml',
+ 'views/change_manufactuing.xml'
],
'assets': {
diff --git a/sf_plan/models/__init__.py b/sf_plan/models/__init__.py
index c47d4ff3..57dea5da 100644
--- a/sf_plan/models/__init__.py
+++ b/sf_plan/models/__init__.py
@@ -2,3 +2,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import custom_plan
+from . import change_manufactuing
diff --git a/sf_plan/models/change_manufactuing.py b/sf_plan/models/change_manufactuing.py
new file mode 100644
index 00000000..34943b67
--- /dev/null
+++ b/sf_plan/models/change_manufactuing.py
@@ -0,0 +1,293 @@
+# -*- coding: utf-8 -*-
+import re
+from odoo import api, fields, models, _
+
+
+class CustomMrpUnBuild(models.Model):
+ _inherit = 'mrp.unbuild'
+ _description = "拆解单"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
+
+class CustomStockScrap(models.Model):
+ _inherit = 'stock.scrap'
+ _description = "报废单"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
+
+class CustomWorkCenter(models.Model):
+ _inherit = 'mrp.workcenter'
+ _description = "工作中心"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
+
+class CustomSfProductionLine(models.Model):
+ _inherit = 'sf.production.line'
+ _description = "生产线"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
+
+class CustomSfModelType(models.Model):
+ _inherit = 'sf.model.type'
+ _description = "模型类型"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
+
+class CustomMrpRoutingWorkcenter(models.Model):
+ _inherit = 'mrp.routing.workcenter'
+ _description = "工序"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
+
+class CustomProductTemplate(models.Model):
+ _inherit = 'product.template'
+ _description = "产品模板"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
+
+class CustomMrpBom(models.Model):
+ _inherit = 'mrp.bom'
+ _description = "BOM清单"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
+
+
+class CustomStockLot(models.Model):
+ _inherit = 'stock.lot'
+ _description = "批次序列号"
+
+ check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
+ active = fields.Boolean(string='已归档', default=True)
+
+ def action_check(self):
+ """
+ 审核启用
+ """
+ self.check_status = True
+ self.active = True
+
+ def action_uncheck(self):
+ """
+ 审核禁用
+ """
+ self.check_status = False
+ self.active = False
+
+ def archive(self):
+ """
+ 归档
+ """
+ self.write({'active': False})
+
+ def unarchive(self):
+ """
+ 取消归档
+ """
+ self.write({'active': True})
diff --git a/sf_plan/views/change_manufactuing.xml b/sf_plan/views/change_manufactuing.xml
new file mode 100644
index 00000000..9579036b
--- /dev/null
+++ b/sf_plan/views/change_manufactuing.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+ custom.mrp.unbuild.form
+ mrp.unbuild
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ custom.stock.scrap.form
+ stock.scrap
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ custom.product.template.form
+ product.template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ custom.mrp.bom.form
+ mrp.bom
+
+
+
+
+
+
+
+
+
+
+ custom.view.production.lot.form
+ stock.lot
+
+
+
+
+
+
+
+
+
+
+ custom.sf.production.line.form
+ sf.production.line
+
+
+
+
+
+
+
+
+
+
+ custom.form.sf.model.type
+ sf.model.type
+
+
+
+
+
+
+
+
+
+
+ custom.mrp.workcenter.view.form
+ mrp.workcenter
+
+
+
+
+
+
+
+
+
+
+ custom.mrp.routing.workcenter.form.view
+ mrp.routing.workcenter
+
+
+
+
+
+
+
+
+
+
diff --git a/sf_plan/views/menuitem_override.xml b/sf_plan/views/menuitem_override.xml
new file mode 100644
index 00000000..e69de29b
diff --git a/sf_quality/__manifest__.py b/sf_quality/__manifest__.py
index 7f50a93d..d6f946e1 100644
--- a/sf_quality/__manifest__.py
+++ b/sf_quality/__manifest__.py
@@ -16,7 +16,7 @@
'depends': ['quality_control', 'sf_maintenance'],
'data': [
'security/ir.model.access.csv',
- 'views/view.xml'
+ # 'views/view.xml'
],
'assets': {
diff --git a/sf_quality/security/ir.model.access.csv b/sf_quality/security/ir.model.access.csv
index be8cddb7..0d2b16ef 100644
--- a/sf_quality/security/ir.model.access.csv
+++ b/sf_quality/security/ir.model.access.csv
@@ -40,4 +40,7 @@ access_quality_alert_team_group_sf_order_user,quality_alert_team_group_sf_order_
access_quality_alert_team_group_sf_mrp_manager,quality_alert_team_group_sf_mrp_manager,quality.model_quality_alert_team,sf_base.group_sf_mrp_manager,1,0,0,0
+access_quality_alert_stage,quality.alert.stage,quality.model_quality_alert_stage,sf_base.group_plan_dispatch,1,0,0,0
+
+
diff --git a/sf_sale/security/ir.model.access.csv b/sf_sale/security/ir.model.access.csv
index 171a6d4d..c4900a5f 100644
--- a/sf_sale/security/ir.model.access.csv
+++ b/sf_sale/security/ir.model.access.csv
@@ -10,6 +10,9 @@ access_crm_team_member_director,crm_team_member_director,sales_team.model_crm_te
access_res_users,res_users,base.model_res_users,sf_base.group_sale_director,1,1,1,0
+access_sale_order,sale_order,model_sale_order,sf_base.group_plan_dispatch,1,0,0,0
+
+
diff --git a/sf_warehouse/__manifest__.py b/sf_warehouse/__manifest__.py
index 29b396dc..b6a59e8c 100644
--- a/sf_warehouse/__manifest__.py
+++ b/sf_warehouse/__manifest__.py
@@ -10,7 +10,7 @@
""",
'category': 'sf',
'website': 'https://www.sf.jikimo.com',
- 'depends': ['stock', 'web', ],
+ 'depends': ['stock', 'web', 'sf_base'],
'data': [
'security/sf_stock_security.xml',
'security/ir.model.access.csv',
diff --git a/sf_warehouse/security/ir.model.access.csv b/sf_warehouse/security/ir.model.access.csv
index e17842f1..2367fbd7 100644
--- a/sf_warehouse/security/ir.model.access.csv
+++ b/sf_warehouse/security/ir.model.access.csv
@@ -94,3 +94,19 @@ access_stock_picking_label_type_user,picking.label.type.user,stock.model_picking
access_stock_lot_label_layout_user,lot.label.layout.user,stock.model_lot_label_layout,sf_warehouse.group_sf_stock_user,1,1,1,0
access_stock_replenish_option,stock.replenishment.option,stock.model_stock_replenishment_option,sf_warehouse.group_sf_stock_user,1,1,1,0
access_mrp_production,mrp.production,mrp.model_mrp_production,sf_warehouse.group_sf_stock_user,1,1,1,0
+
+access_sf_shelf_location,sf.shelf.location,model_sf_shelf_location,sf_base.group_plan_dispatch,1,0,0,0
+access_stock_move,stock.move,stock.model_stock_move,sf_base.group_plan_dispatch,1,0,0,0
+access_stock_scrap_user,stock.scrap.user,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0
+access_stock_scrap_manager,stock.scrap.manager,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0
+access_stock_picking,stock.picking,stock.model_stock_picking,sf_base.group_plan_dispatch,1,0,0,0
+access_stock_lot,stock.lot,stock.model_stock_lot,sf_base.group_plan_dispatch,1,1,1,0
+access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,sf_base.group_plan_dispatch,1,0,0,0
+access_stock_quant,stock.quant,stock.model_stock_quant,sf_base.group_plan_dispatch,1,0,0,0
+
+access_product_product,product.product,product.model_product_product,sf_base.group_plan_dispatch,1,1,1,0
+access_product_template,product.template,product.model_product_template,sf_base.group_plan_dispatch,1,1,1,0
+
+access_stock_inventory_conflict,stock.inventory.conflict,stock.model_stock_inventory_conflict,sf_base.group_plan_dispatch,1,0,0,0
+access_stock_inventory_warning,stock.inventory.warning,stock.model_stock_inventory_warning,sf_base.group_plan_dispatch,1,0,0,0
+access_stock_inventory_adjustment_name,stock.inventory.adjustment.name,stock.model_stock_inventory_adjustment_name,sf_base.group_plan_dispatch,1,0,0,0
\ No newline at end of file