计划模块增加权限控制

This commit is contained in:
mgw
2023-11-22 17:55:30 +08:00
parent a36c30b5c1
commit 6fed64ba2a
5 changed files with 18 additions and 12 deletions

View File

@@ -16,6 +16,7 @@
'depends': ['sf_manufacturing'],
'data': [
'security/ir.model.access.csv',
# 'security/rules.xml',
'views/view.xml',
],

View File

@@ -1,8 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sf_production_plan,sf.production.plan,model_sf_production_plan,base.group_user,1,1,1,1
access_sf_machine_schedule,sf.machine.schedule,model_sf_machine_schedule,base.group_user,1,1,1,1
access_sf_production_plan,sf.production.plan,model_sf_production_plan,base.group_user,1,0,0,0
access_sf_production_plan_for_dispatch,sf.production.plan for dispatch,model_sf_production_plan,sf_base.group_plan_dispatch,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sf_production_plan sf.production.plan model_sf_production_plan base.group_user 1 1 0 1 0 1 0
3 access_sf_machine_schedule access_sf_production_plan_for_dispatch sf.machine.schedule sf.production.plan for dispatch model_sf_machine_schedule model_sf_production_plan base.group_user sf_base.group_plan_dispatch 1 1 1 1 0

View File

@@ -0,0 +1,9 @@
<odoo>
<record id="plan_order_rule_own" model="ir.rule">
<field name="name">Own Orders Only</field>
<field name="model_id" ref="model_sf_production_plan"/>
<field name="groups" eval="[(4, ref('sf_base.group_plan_dispatch'))]"/>
<!-- <field name="domain_force">[('user_id', '=', user.id)]</field> -->
<field name="domain_force">[('create_uid', '=', user.id)]</field>
</record>
</odoo>

View File

@@ -18,8 +18,8 @@
<field name="date_planned_start"/>
<field name="date_planned_finished"/>
<field name="schedule_setting"/>
<button name="do_production_schedule" class="btn schedule_done" string="生产排程" type="object" attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程" type="object" attrs="{'invisible': [('state', 'not in', ['done'])]}"/>
<button name="do_production_schedule" class="btn schedule_done" string="生产排程" type="object" attrs="{'invisible': [('state', 'not in', ['draft'])]}" groups="sf_base.group_plan_dispatch"/>
<button name="cancel_production_schedule" class="btn schedule_cancel" string="取消排程" type="object" attrs="{'invisible': [('state', 'not in', ['done'])]}" groups="sf_base.group_plan_dispatch"/>
</tree>
</field>
</record>
@@ -31,8 +31,8 @@
<form string="订单计划">
<header>
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}'/>
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"/>
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}' groups="sf_base.group_plan_dispatch"/>
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight" groups="sf_base.group_plan_dispatch"/>
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
<field name="state" widget="statusbar" statusbar_visible="draft,done,processing,finished"/>
@@ -261,6 +261,7 @@
name="计划"
sequence="150"
action="sf_production_plan_action"
groups="sf_base.group_plan_dispatch"
/>
<!-- <record model="ir.ui.menu" id="mrp_custom_menu" inherit_id="mrp.menu_mrp_manufacturing"> -->