multi_store_security.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0"?>
  2. <openerp>
  3. <data noupdate="1">
  4. <record model="res.groups" id="group_multi_store">
  5. <field name="name">Multi Stores</field>
  6. <field name="category_id" ref="base.module_category_usability"/>
  7. <field name="users" eval="[(4, ref('base.user_root'))]"/>
  8. </record>
  9. <record id="res_store_rule" model="ir.rule">
  10. <field name="name">multi-store store rule</field>
  11. <field name="model_id" ref="model_res_store"/>
  12. <field name="domain_force">[('id','child_of',[user.store_id.id])]</field>
  13. </record>
  14. <record id="journal_store_rule" model="ir.rule">
  15. <field name="name">Journal multi-store</field>
  16. <field name="model_id" ref="account.model_account_journal"/>
  17. <field name="global" eval="True"/>
  18. <!-- <field name="perm_read" eval="False"/> -->
  19. <field name="domain_force">['|',('store_ids','=',False),('store_ids','child_of',[user.store_id.id])]</field>
  20. </record>
  21. <record id="account_move_store_rule" model="ir.rule">
  22. <field name="name">Account Entry</field>
  23. <field name="model_id" ref="account.model_account_move"/>
  24. <field name="global" eval="True"/>
  25. <field name="domain_force">['|',('journal_id.store_ids','=',False),('journal_id.store_ids','child_of',[user.store_id.id])]</field>
  26. </record>
  27. <record id="invoice_store_rule" model="ir.rule">
  28. <field name="name">Invoice multi-store</field>
  29. <field name="model_id" ref="account.model_account_invoice"/>
  30. <field name="global" eval="True"/>
  31. <field name="domain_force">['|',('journal_id.store_ids','=',False),('journal_id.store_ids','child_of',[user.store_id.id])]</field>
  32. </record>
  33. <record id="voucher_store_rule" model="ir.rule">
  34. <field name="name">Voucher multi-store</field>
  35. <field name="model_id" ref="account_voucher.model_account_voucher"/>
  36. <field name="global" eval="True"/>
  37. <field name="domain_force">['|',('journal_id.store_ids','=',False),('journal_id.store_ids','child_of',[user.store_id.id])]</field>
  38. </record>
  39. <record id="account_bank_statement_store_rule" model="ir.rule">
  40. <field name="name">Account Bank Statement multi-store</field>
  41. <field name="model_id" ref="account.model_account_bank_statement"/>
  42. <field name="global" eval="True"/>
  43. <field name="domain_force">['|',('journal_id.store_ids','=',False),('journal_id.store_ids','child_of',[user.store_id.id])]</field>
  44. </record>
  45. </data>
  46. </openerp>