From cfed77d1a55ef6a0da83fddabe4d31339c746581 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Fri, 8 Dec 2023 15:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=A0=B9=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=A2=9E=E5=8A=A0=E5=AE=A1=E6=A0=B8=E6=8C=89=E9=92=AE?= =?UTF-8?q?=20=E4=BB=A5=E5=8F=8A=E5=AE=A1=E6=A0=B8=E7=8A=B6=E6=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_mrs_connect/models/sync_common.py | 2 +- sf_sale/models/auto_quatotion_common.py | 2 +- sf_sale/models/quick_easy_order.py | 4 +- sf_warehouse/models/model.py | 80 +++++ sf_warehouse/security/ir.model.access.csv | 2 +- sf_warehouse/views/shelf_location.xml | 328 ++++++++++---------- sf_warehouse/views/view.xml | 236 +++++++++++++- 8 files changed, 484 insertions(+), 174 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 83ff3df4..bed75e6d 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -6,8 +6,8 @@ import os from odoo import models, fields, api, _ from odoo.exceptions import ValidationError 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_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py index 1542cf99..7babb3a4 100644 --- a/sf_mrs_connect/models/sync_common.py +++ b/sf_mrs_connect/models/sync_common.py @@ -32,7 +32,7 @@ class MrStaticResourceDataSync(models.Model): # logging.info("材料型号已每日同步成功") # self.env['mrs.international.standards']._cron_mrs_international_standards_func() # logging.info("材料型号材料应用已每日同步成功") - self.env['material.apply']._cron_material_apply_func() + self.env['material.apply'].sync_material_apply() logging.info("材料型号材料应用已每日同步成功") self.env['sf.production.process.category'].sync_production_process_category_yesterday() logging.info("表面工艺类别已每日同步成功") 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 5ec1fd52..1e5f274c 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -5,8 +5,8 @@ import os import json from datetime import datetime import requests -#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_warehouse/models/model.py b/sf_warehouse/models/model.py index 0151b10b..de7b64e6 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -226,6 +226,14 @@ class ShelfLocation(models.Model): name = fields.Char('名称', required=True, size=20) barcode = fields.Char('编码', copy=False, size=15) + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + # 仓库类别(selection:库区、库位、货位) location_type = fields.Selection([ ('货架', '货架'), @@ -568,3 +576,75 @@ class SfProductCategory(models.Model): def action_check(self): self.check_state = 'enable' + + +class SfUomCategory(models.Model): + _inherit = 'uom.category' + + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfBarcodeNomenclature(models.Model): + _inherit = 'barcode.nomenclature' + + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfPutawayRule(models.Model): + _inherit = 'stock.putaway.rule' + + check_state = fields.Selection([ + ('enable', '同意'), + ('close', '不同意') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfWarehouseOrderpoint(models.Model): + _inherit = 'stock.warehouse.orderpoint' + + check_state = fields.Selection([ + ('enable', '同意'), + ('close', '不同意') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfStockQuant(models.Model): + _inherit = 'stock.quant' + + check_state = fields.Selection([ + ('enable', '同意'), + ('close', '不同意') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfStockScrap(models.Model): + _inherit = 'stock.scrap' + + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' diff --git a/sf_warehouse/security/ir.model.access.csv b/sf_warehouse/security/ir.model.access.csv index 2b36e265..e17842f1 100644 --- a/sf_warehouse/security/ir.model.access.csv +++ b/sf_warehouse/security/ir.model.access.csv @@ -1,5 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_stock_location,stock.location,model_stock_location,base.group_user,1,1,1,0 +access_sf_shelf_location,sf.shelf.location,model_sf_shelf_location,sf_warehouse.group_sf_stock_user,1,1,1,0 access_procurement_group,procurement.group,stock.model_procurement_group,base.group_user,1,1,1,0 access_stock_warehouse_manager,stock.warehouse.manager,stock.model_stock_warehouse,sf_warehouse.group_sf_stock_user,1,1,1,0 diff --git a/sf_warehouse/views/shelf_location.xml b/sf_warehouse/views/shelf_location.xml index 458db805..e82fbc16 100644 --- a/sf_warehouse/views/shelf_location.xml +++ b/sf_warehouse/views/shelf_location.xml @@ -1,178 +1,194 @@ - - - Shelf Location tree - sf.shelf.location - - - - - - - - + + + Shelf Location tree + sf.shelf.location + + + + + + +