account_security.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data noupdate="0">
  4. <!--
  5. There are 4 groups
  6. The way the groups work is different when `account_accountant` is installed or not.
  7. Invoicing only:
  8. ```
  9. group_account_invoice ⇨ group_account_manager (only those two should be used)
  10. group_account_readonly ⇨ group_account_user (those two are only visible through a server action)
  11. ```
  12. Invoicing + Accounting:
  13. ```
  14. group_account_invoice ⬂
  15. group_account_readonly ⇨ group_account_user ⇨ group_account_manager
  16. ```
  17. `group_account_user` is almost (a bit more than) the sum of `group_account_invoice` and `group_account_readonly`
  18. `group_account_manager` is the king (except when Consolidation is installed, then there is a super-king)
  19. `group_account_invoice` can create/edit invoices, refunds, payments, etc but cannot see accounting related stuff (journal entries, reports, reconciliation,...)
  20. `group_account_readonly` can see (and only see) everything, including the journal entries, advanced configuration, reports
  21. `group_account_user` is the accountant: he can do everything except advanced config (accounting periods for instance)
  22. `group_account_manager` can edit some config that `group_account_user` cannot do
  23. When you have only Invoicing installed, only `group_account_invoice` and `group_account_manager` should be used. The others are giving a shallow access to Accounting features, but we want to remove that.
  24. -->
  25. <record model="ir.module.category" id="base.module_category_accounting_accounting">
  26. <field name="description">Helps you handle your accounting needs, if you are not an accountant, we suggest you to install only the Invoicing.</field>
  27. <field name="sequence">7</field>
  28. </record>
  29. <record id="group_delivery_invoice_address" model="res.groups">
  30. <field name="name">Delivery Address</field>
  31. <field name="category_id" ref="base.module_category_hidden"/>
  32. </record>
  33. <record id="group_show_line_subtotals_tax_excluded" model="res.groups">
  34. <field name="name">Tax display B2B</field>
  35. <field name="comment">Show line subtotals without taxes (B2B)</field>
  36. <field name="category_id" ref="base.module_category_hidden"/>
  37. </record>
  38. <record id="group_show_line_subtotals_tax_included" model="res.groups">
  39. <field name="name">Tax display B2C</field>
  40. <field name="comment">Show line subtotals with taxes included (B2C)</field>
  41. <field name="category_id" ref="base.module_category_hidden"/>
  42. </record>
  43. <record id="group_account_readonly" model="res.groups">
  44. <field name="name">Show Accounting Features - Readonly</field>
  45. <field name="category_id" ref="base.module_category_hidden"/>
  46. <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
  47. </record>
  48. <record id="group_account_invoice" model="res.groups">
  49. <field name="name">Billing</field>
  50. <field name="category_id" ref="base.module_category_accounting_accounting"/>
  51. <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
  52. </record>
  53. <record id="group_account_user" model="res.groups">
  54. <field name="name">Show Full Accounting Features</field>
  55. <field name="category_id" ref="base.module_category_hidden"/>
  56. <field name="implied_ids" eval="[(4, ref('group_account_invoice')), (4, ref('group_account_readonly'))]"/>
  57. </record>
  58. <record id="group_account_manager" model="res.groups">
  59. <field name="name">Billing Administrator</field>
  60. <field name="category_id" ref="base.module_category_accounting_accounting"/>
  61. <field name="implied_ids" eval="[(4, ref('group_account_invoice')),(4, ref('base.group_private_addresses'))]"/>
  62. <field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
  63. </record>
  64. <record id="group_warning_account" model="res.groups">
  65. <field name="name">A warning can be set on a partner (Account)</field>
  66. <field name="category_id" ref="base.module_category_hidden"/>
  67. </record>
  68. <record id="group_cash_rounding" model="res.groups">
  69. <field name="name">Allow the cash rounding management</field>
  70. <field name="category_id" ref="base.module_category_hidden"/>
  71. </record>
  72. <record id="group_sale_receipts" model="res.groups">
  73. <field name="name">Sale Receipt</field>
  74. <field name="category_id" ref="base.module_category_hidden"/>
  75. </record>
  76. <record id="group_purchase_receipts" model="res.groups">
  77. <field name="name">Purchase Receipt</field>
  78. <field name="category_id" ref="base.module_category_hidden"/>
  79. </record>
  80. </data>
  81. <data noupdate="1">
  82. <record id="account_analytic_line_rule_billing_user" model="ir.rule">
  83. <field name="name">account.analytic.line.billing.user</field>
  84. <field name="model_id" ref="analytic.model_account_analytic_line"/>
  85. <field name="domain_force">[(1, '=', 1)]</field>
  86. <field name="groups" eval="[(4, ref('account.group_account_invoice'))]"/>
  87. </record>
  88. <record id="base.group_public" model="res.groups">
  89. <field name="implied_ids" eval="[(4, ref('account.group_show_line_subtotals_tax_excluded'))]"/>
  90. </record>
  91. <record id="base.group_portal" model="res.groups">
  92. <field name="implied_ids" eval="[(4, ref('account.group_show_line_subtotals_tax_excluded'))]"/>
  93. </record>
  94. <record id="base.group_user" model="res.groups">
  95. <field name="implied_ids" eval="[(4, ref('account.group_show_line_subtotals_tax_excluded'))]"/>
  96. </record>
  97. <record id="base.default_user" model="res.users">
  98. <field name="groups_id" eval="[(4,ref('account.group_account_manager'))]"/>
  99. </record>
  100. <record id="account_move_comp_rule" model="ir.rule">
  101. <field name="name">Account Entry</field>
  102. <field name="model_id" ref="model_account_move"/>
  103. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  104. </record>
  105. <record id="account_move_line_comp_rule" model="ir.rule">
  106. <field name="name">Entry lines</field>
  107. <field name="model_id" ref="model_account_move_line"/>
  108. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  109. </record>
  110. <record id="journal_group_comp_rule" model="ir.rule">
  111. <field name="name">Journal Group multi-company</field>
  112. <field name="model_id" ref="model_account_journal_group"/>
  113. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  114. </record>
  115. <record id="journal_comp_rule" model="ir.rule">
  116. <field name="name">Journal multi-company</field>
  117. <field name="model_id" ref="model_account_journal"/>
  118. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  119. </record>
  120. <record id="account_comp_rule" model="ir.rule">
  121. <field name="name">Account multi-company</field>
  122. <field name="model_id" ref="model_account_account"/>
  123. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  124. </record>
  125. <record id="account_group_comp_rule" model="ir.rule">
  126. <field name="name">Account Group multi-company</field>
  127. <field name="model_id" ref="model_account_group"/>
  128. <field name="domain_force">[('company_id', 'in', company_ids)]</field>
  129. </record>
  130. <record id="account_root_comp_rule" model="ir.rule">
  131. <field name="name">Account Root multi-company</field>
  132. <field name="model_id" ref="model_account_root"/>
  133. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  134. </record>
  135. <record id="tax_comp_rule" model="ir.rule">
  136. <field name="name">Tax multi-company</field>
  137. <field name="model_id" ref="model_account_tax"/>
  138. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  139. </record>
  140. <record id="tax_rep_comp_rule" model="ir.rule">
  141. <field name="name">Tax Repartition multi-company</field>
  142. <field name="model_id" ref="model_account_tax_repartition_line"/>
  143. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  144. </record>
  145. <record id="invoice_analysis_comp_rule" model="ir.rule">
  146. <field name="name">Invoice Analysis multi-company</field>
  147. <field name="model_id" ref="model_account_invoice_report"/>
  148. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  149. </record>
  150. <record id="account_fiscal_position_comp_rule" model="ir.rule">
  151. <field name="name">Account fiscal Mapping company rule</field>
  152. <field name="model_id" ref="model_account_fiscal_position"/>
  153. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  154. </record>
  155. <record model="ir.rule" id="account_bank_statement_comp_rule">
  156. <field name="name">Account bank statement company rule</field>
  157. <field name="model_id" ref="model_account_bank_statement"/>
  158. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  159. </record>
  160. <record model="ir.rule" id="account_bank_statement_line_comp_rule">
  161. <field name="name">Account bank statement line company rule</field>
  162. <field name="model_id" ref="model_account_bank_statement_line"/>
  163. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  164. </record>
  165. <record model="ir.rule" id="account_reconcile_model_template_comp_rule">
  166. <field name="name">Account reconcile model template company rule</field>
  167. <field name="model_id" ref="model_account_reconcile_model"/>
  168. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  169. </record>
  170. <record model="ir.rule" id="account_reconcile_model_line_template_comp_rule">
  171. <field name="name">Account reconcile model_line template company rule</field>
  172. <field name="model_id" ref="model_account_reconcile_model_line"/>
  173. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  174. </record>
  175. <record model="ir.rule" id="account_payment_comp_rule">
  176. <field name="name">Account payment company rule</field>
  177. <field name="model_id" ref="model_account_payment"/>
  178. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  179. </record>
  180. <record model="ir.rule" id="account_payment_term_comp_rule">
  181. <field name="name">Account payment term company rule</field>
  182. <field name="model_id" ref="model_account_payment_term"/>
  183. <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
  184. </record>
  185. <!-- Billing record rules for account.move -->
  186. <record id="account_move_see_all" model="ir.rule">
  187. <field name="name">All Journal Entries</field>
  188. <field ref="model_account_move" name="model_id"/>
  189. <field name="domain_force">[(1, '=', 1)]</field>
  190. <field name="groups" eval="[(4, ref('account.group_account_invoice'))]"/>
  191. </record>
  192. <record id="account_move_line_see_all" model="ir.rule">
  193. <field name="name">All Journal Items</field>
  194. <field ref="model_account_move_line" name="model_id"/>
  195. <field name="domain_force">[(1, '=', 1)]</field>
  196. <field name="groups" eval="[(4, ref('account.group_account_invoice'))]"/>
  197. </record>
  198. <!-- Portal for invoice move and invoice move lines -->
  199. <record id="account_invoice_rule_portal" model="ir.rule">
  200. <field name="name">Portal Personal Account Invoices</field>
  201. <field name="model_id" ref="account.model_account_move"/>
  202. <field name="domain_force">[('state', 'not in', ('cancel', 'draft')), ('move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund')), ('message_partner_ids','child_of',[user.commercial_partner_id.id])]</field>
  203. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  204. </record>
  205. <record id="account_invoice_line_rule_portal" model="ir.rule">
  206. <field name="name">Portal Invoice Lines</field>
  207. <field name="model_id" ref="account.model_account_move_line"/>
  208. <field name="domain_force">[('parent_state', 'not in', ('cancel', 'draft')), ('move_id.move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund')), ('move_id.message_partner_ids','child_of',[user.commercial_partner_id.id])]</field>
  209. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  210. </record>
  211. <!-- Some modules (i.e. sale) restrict the access for some users
  212. We want the readonly group to still have the read access on all moves.-->
  213. <record id="account_move_rule_group_readonly" model="ir.rule">
  214. <field name="name">Readonly Move</field>
  215. <field name="model_id" ref="model_account_move"/>
  216. <field name="domain_force">[(1, '=', 1)]</field>
  217. <field name="groups" eval="[(4, ref('account.group_account_readonly'))]"/>
  218. <field name="perm_write" eval="False"/>
  219. <field name="perm_create" eval="False"/>
  220. <field name="perm_unlink" eval="False"/>
  221. </record>
  222. <record id="account_move_line_rule_group_readonly" model="ir.rule">
  223. <field name="name">Readonly Move Line</field>
  224. <field name="model_id" ref="model_account_move_line"/>
  225. <field name="domain_force">[(1, '=', 1)]</field>
  226. <field name="groups" eval="[(4, ref('account.group_account_readonly'))]"/>
  227. <field name="perm_write" eval="False"/>
  228. <field name="perm_create" eval="False"/>
  229. <field name="perm_unlink" eval="False"/>
  230. </record>
  231. <!-- Some modules (i.e. sale) restrict the access for some users
  232. We want the invoice group to still have all access on all moves.-->
  233. <record id="account_move_rule_group_invoice" model="ir.rule">
  234. <field name="name">Readonly Move</field>
  235. <field name="model_id" ref="model_account_move"/>
  236. <field name="domain_force">[(1, '=', 1)]</field>
  237. <field name="groups" eval="[(4, ref('account.group_account_invoice'))]"/>
  238. </record>
  239. <record id="account_move_line_rule_group_invoice" model="ir.rule">
  240. <field name="name">Readonly Move Line</field>
  241. <field name="model_id" ref="model_account_move_line"/>
  242. <field name="domain_force">[(1, '=', 1)]</field>
  243. <field name="groups" eval="[(4, ref('account.group_account_invoice'))]"/>
  244. </record>
  245. <record id="account_invoice_send_rule_group_invoice" model="ir.rule">
  246. <field name="name">Readonly Invoice Send and Print</field>
  247. <field name="model_id" ref="model_account_invoice_send"/>
  248. <field name="domain_force">[(1, '=', 1)]</field>
  249. <field name="groups" eval="[(4, ref('account.group_account_invoice'))]"/>
  250. </record>
  251. <record id="report_external_value_comp_rule" model="ir.rule">
  252. <field name="name">Report External Value multi-company</field>
  253. <field name="model_id" ref="model_account_report_external_value"/>
  254. <field name="domain_force">[('company_id', 'in', company_ids)]</field>
  255. </record>
  256. </data>
  257. </odoo>