增加刀具管理权限控制,刀具组权限控制,隐藏工单上原生按钮,修复只读权限后修改记录无权限问题等

This commit is contained in:
mgw
2024-01-19 11:49:57 +08:00
parent cffda26ed0
commit 2dfd3c9128
10 changed files with 125 additions and 93 deletions

View File

@@ -287,11 +287,11 @@ class ShelfLocation(models.Model):
"""
for record in self:
if record.product_sn_id:
record.product_id = record.product_sn_id.product_id
record.location_status = '占用'
record.sudo().product_id = record.product_sn_id.product_id
record.sudo().location_status = '占用'
else:
record.product_id = False
record.location_status = '空闲'
record.sudo().product_id = False
record.sudo().location_status = '空闲'
@api.depends('location_type')
def _compute_hide_what(self):
@@ -300,12 +300,12 @@ class ShelfLocation(models.Model):
:return:
"""
for record in self:
record.hide_shelf = False
record.hide_location = False
record.sudo().hide_shelf = False
record.sudo().hide_location = False
if record.location_type and record.location_type == '货架':
record.hide_shelf = True
record.sudo().hide_shelf = True
elif record.location_type and record.location_type == '货位':
record.hide_location = True
record.sudo().hide_location = True
else:
pass

View File

@@ -96,7 +96,7 @@ access_stock_lot_label_layout_user,lot.label.layout.user,stock.model_lot_label_l
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_group_plan_dispatch,sf.shelf.location,model_sf_shelf_location,sf_base.group_plan_dispatch,1,1,0,0
access_sf_shelf_location_group_plan_dispatch,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,1,1,0
access_stock_picking,stock.picking,stock.model_stock_picking,sf_base.group_plan_dispatch,1,0,0,0
access_stock_lot_group_plan_dispatch,stock.lot,stock.model_stock_lot,sf_base.group_plan_dispatch,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
96 access_sf_shelf_location_group_plan_dispatch sf.shelf.location model_sf_shelf_location sf_base.group_plan_dispatch 1 1 0 0 0
97 access_stock_move stock.move stock.model_stock_move sf_base.group_plan_dispatch 1 1 1 0
98 access_stock_picking stock.picking stock.model_stock_picking sf_base.group_plan_dispatch 1 0 0 0
99 access_stock_lot_group_plan_dispatch stock.lot stock.model_stock_lot sf_base.group_plan_dispatch 1 0 0 0
100 access_stock_lot_group_plan_director stock.lot stock.model_stock_lot sf_base.group_plan_director 1 1 1 0
101 access_stock_warehouse_orderpoint stock.warehouse.orderpoint stock.model_stock_warehouse_orderpoint sf_base.group_plan_dispatch 1 1 0 0
102 access_product_product product.product product.model_product_product sf_base.group_plan_dispatch 1 0 0 0

View File

@@ -73,5 +73,19 @@
</field>
</record>
<record id="sf_vpicktree" model="ir.ui.view">
<field name="name">sf.vpicktree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree"/>
<field name="arch" type="xml">
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
<button name="do_unreserve" type="object" string="取消保留" groups="sf_warehouse.group_sf_stock_user"/>
</xpath>
<xpath expr="//header//button[@name='action_assign']" position="replace">
<button name="action_assign" type="object" string="检查可用量" groups="sf_warehouse.group_sf_stock_user"/>
</xpath>
</field>
</record>
</data>
</odoo>