计划模块增加权限控制
This commit is contained in:
@@ -199,7 +199,7 @@ class StockRule(models.Model):
|
||||
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
|
||||
if sale_order:
|
||||
bb = sale_order.deadline_of_delivery
|
||||
productions = self.env['sf.production.plan'].with_user(SUPERUSER_ID).sudo().with_company(company_id). \
|
||||
productions = self.env['sf.production.plan'].sudo().with_company(company_id). \
|
||||
create({
|
||||
'name': production.name,
|
||||
'order_deadline': sale_order.deadline_of_delivery,
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
'depends': ['sf_manufacturing'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
# 'security/rules.xml',
|
||||
'views/view.xml',
|
||||
],
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
9
sf_plan/security/rules.xml
Normal file
9
sf_plan/security/rules.xml
Normal 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>
|
||||
@@ -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"> -->
|
||||
|
||||
Reference in New Issue
Block a user