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_warehouse/models/model.py b/sf_warehouse/models/model.py index 0338e98a..b78ab04c 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -11,6 +11,14 @@ class SfLocation(models.Model): name = fields.Char('Location Name', required=True, size=20) barcode = fields.Char('Barcode', 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([ # ('库区', '库区'), @@ -218,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([ ('货架', '货架'), @@ -501,3 +517,135 @@ class SfProcurementGroup(models.Model): res = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]), order='route_sequence, sequence', limit=1) return res + + +class SfWarehouse(models.Model): + _inherit = 'stock.warehouse' + + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfRule(models.Model): + _inherit = 'stock.rule' + + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfRoute(models.Model): + _inherit = 'stock.route' + + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfPickingType(models.Model): + _inherit = 'stock.picking.type' + + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + def action_check(self): + self.check_state = 'enable' + + +class SfProductCategory(models.Model): + _inherit = 'product.category' + + check_state = fields.Selection([ + ('enable', '启用'), + ('close', '关闭') + ], string='审核状态', default='close') + + 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 + + + + + + +