lunch_security.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" ?>
  2. <odoo>
  3. <record model="ir.module.category" id="module_lunch_category">
  4. <field name="name">Lunch</field>
  5. <field name="description">Helps you handle your lunch needs, if you are a manager you will be able to create new products, cashmoves and to confirm or cancel orders.</field>
  6. <field name="sequence">16</field>
  7. </record>
  8. <record id="group_lunch_user" model="res.groups">
  9. <field name="name">User : Order your meal</field>
  10. <field name="category_id" ref="base.module_category_human_resources_lunch"/>
  11. </record>
  12. <record id="group_lunch_manager" model="res.groups">
  13. <field name="name">Administrator</field>
  14. <field name="implied_ids" eval="[(4, ref('group_lunch_user'))]"/>
  15. <field name="category_id" ref="base.module_category_human_resources_lunch"/>
  16. <field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
  17. </record>
  18. <data noupdate="1">
  19. <record id="lunch_mind_your_own_food_money" model="ir.rule">
  20. <field name="name">lunch.cashmove: do not see other people's cashmove</field>
  21. <field name="model_id" ref="model_lunch_cashmove"/>
  22. <field name="groups" eval="[(4, ref('group_lunch_user'))]"/>
  23. <field name="domain_force">[('user_id', '=', user.id)]</field>
  24. </record>
  25. <record id="lunch_mind_other_food_money" model="ir.rule">
  26. <field name="name">lunch.cashmove: do see other people's cashmove</field>
  27. <field name="model_id" ref="model_lunch_cashmove"/>
  28. <field name="groups" eval="[(4, ref('group_lunch_manager'))]"/>
  29. <field name="domain_force">[(1, '=', 1)]</field>
  30. </record>
  31. <record id="lunch_order_rule_delete" model="ir.rule">
  32. <field name="name">lunch.order: Only new and cancelled order lines deleted.</field>
  33. <field name="model_id" ref="lunch.model_lunch_order"/>
  34. <field name="domain_force">[('state', 'in', ('new', 'cancelled'))]</field>
  35. <field name="perm_read" eval="0"/>
  36. <field name="perm_write" eval="0"/>
  37. <field name="perm_create" eval="0"/>
  38. <field name="perm_unlink" eval="1" />
  39. <field name="groups" eval="[(4,ref('lunch.group_lunch_user'))]"/>
  40. </record>
  41. <record id="lunch_order_rule_write" model="ir.rule">
  42. <field name="name">lunch.order: Don't change confirmed order</field>
  43. <field name="model_id" ref="lunch.model_lunch_order"/>
  44. <field name="domain_force">[('state', '!=', 'confirmed'), ('user_id', '=', user.id)]</field>
  45. <field name="perm_read" eval="0"/>
  46. <field name="perm_create" eval="0"/>
  47. <field name="perm_unlink" eval="0"/>
  48. <field name="groups" eval="[(4, ref('base.group_user'))]"/>
  49. </record>
  50. <record id="lunch_order_rule_write_manager" model="ir.rule">
  51. <field name="name">manager can do whatever</field>
  52. <field name="model_id" ref="lunch.model_lunch_order"/>
  53. <field name="domain_force">[(1, '=', 1)]</field>
  54. <field name="perm_read" eval="0"/>
  55. <field name="perm_create" eval="0"/>
  56. <field name="perm_unlink" eval="0"/>
  57. <field name="groups" eval="[(4, ref('lunch.group_lunch_manager'))]"/>
  58. </record>
  59. <record id="base.default_user" model="res.users">
  60. <field name="groups_id" eval="[(4,ref('lunch.group_lunch_manager'))]"/>
  61. </record>
  62. <record id="ir_rule_lunch_supplier_multi_company" model="ir.rule">
  63. <field name="name">Lunch supplier: Multi Company</field>
  64. <field name="model_id" ref="model_lunch_supplier"/>
  65. <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
  66. </record>
  67. <record id="ir_rule_lunch_order_multi_company" model="ir.rule">
  68. <field name="name">Lunch order: Multi Company</field>
  69. <field name="model_id" ref="model_lunch_order"/>
  70. <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
  71. </record>
  72. <record id="ir_rule_lunch_product_multi_company" model="ir.rule">
  73. <field name="name">Lunch product: Multi Company</field>
  74. <field name="model_id" ref="model_lunch_product"/>
  75. <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
  76. </record>
  77. <record id="ir_rule_lunch_product_category_multi_company" model="ir.rule">
  78. <field name="name">Lunch product category: Multi Company</field>
  79. <field name="model_id" ref="model_lunch_product_category"/>
  80. <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
  81. </record>
  82. <record id="ir_rule_lunch_location_multi_company" model="ir.rule">
  83. <field name="name">Lunch location: Multi Company</field>
  84. <field name="model_id" ref="model_lunch_location"/>
  85. <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
  86. </record>
  87. </data>
  88. </odoo>