Files
odoo_source/addons/account/security/ir.model.access.csv
T
wan 5125748616 [REF] account: remove chart template
Rewrite the whole chart template mechanism, removing the templates
stored in the database. The new format will mainly use CSV.

Speed up install time
---------------------

* About half of the time of installing a localization for the first time is
  taken by creating the template records. This new in code format gets
  completely rid of this.
* Creating the template records could often not be done in batch because
  of parent/children relations.
* The instanciation of the accounts on the company has been entirely
  reworked too, by
  - optimizing the order of creation of records to avoid UPDATE queries
  - using precomputed fields to avoid UPDATE queries
  - updating the translation in batch
  - deactivating logging in the chatter
  - avoiding access rights checks by checking the rights at the start

Overall, when installing a chart template for the first time, it is 4
times faster because half of the time spent on saving the template in
the database is not done at all anymore, and the instanciation on the
company is more than twice as fast.

Reduce technical debt
---------------------

There is no need to synchronize the templates with the real records
anymore. No need to use hooks to copy the data from one to the other.

It is easier to change a template in a stable version, which can often
be necessary due to legal reasons (i.e. a change of tax rates, reporting
tags,...)

Two modules have been removed:
* `l10n_generic_coa`: since there is nothing left datawise in this
  module, it can be integrated in `account` for free. It is just code
  and CSV.
* `l10n_multilang`: the fields that this module modified to be
  translatable are now always translatable:
  - there was an issue when updating modules that deleted all the
    translations because the fields were not translatable at some point
    during the loading of the registry, then they because translatable
    again but lost all translations because of the column type change.
  - most devs are not able to understand all the languages needed for
    all the localization available. Therefore, english has been added in
    the sources in most localization to understand better issues while
    debugging.
  - no need to call post init hooks anymore, doing the sync with the
    templates.
  - more: see "Translations" section

Because most of the data is now in CSV, it is also easier for product
owners to edit, audit, modify files themselves, removing one layer
during trivial development processes when only data should be changed.

More flexibility for declaration
--------------------------------

The data declaration can now be done easily in python or CSV.
A nice feature is that you can declare everything at once, even for some
more complex chart of accounts:
* if you have to set default taxes on accounts, would need to
  - declare the accounts because accounts are required on the taxes
  - declare the taxes
  - declare the taxes to put on the accounts
  This would lead to scatter information in multiple files. Now,
  everything can be declared in the same place and the loading of the
  chart of accounts will do the 3 steps automatically.
* if you have a relation of child/parent, you would first need to
  declare the parents then the children, and the loading would not be
  efficient because done one by one. Now, everything is done in batch
  automatically without having to think about it.

It is also easier to update fields on records where there was no field
for that on the templates, like
* setting a restriction for journals on accounts
* setting specific values on the company
* modifying journals and linking them easily by using the xml_id instead
  of having to compute it manually

Translations
------------

Some countries have multiple languages (i.e. Belgium uses officially
French, Dutch and German, and the CoA also has an official English
version) and we must support the languages in all these countries.
All these translations are known, and hard coded without using out
translation platform (Transifex). We also like to have the English
version (even if an official one doesn't exist) so that support can be
done more easily in databases using chart templates in other languages
(especially using a non roman alphabet).

Because the translations were not on Transifex for these records, it was
really hard to maintain: the translation templates (`.pot` files) were
not easy to extract as the automatic export would give values mixing
both the CoA and the menuitmes, the fields' strings,... But we don't
want to translate the CoA as we already know the value.
Managing the translations in the `.po` files was also annoying:
- it is easy to forget that the translations need an update too
- it requires a special editor, special terminal commands that everyone
  is not familiar with
- it is easy to make mistakes in the source string

The new format is the following: `field@en_US` where `field` is the
translatable field (usually `name`) and `en_US` is the locale code.
This allows to have the whole declaration on one line, everything in one
file. It also makes the process easier when debugging: instead of
searching for the translation in the `.po` files, it directly appears
next to the configuration of the account/tax/... .

Update of the code
------------------

The code can be updated using this script
https://github.com/william-andre/transform_coa
Forward ports can be managed too by stashing/resetting/checkout the new
modules or the changes in the modules updated in the same PR.

task-2687567

Part-of: odoo/odoo#110016
2023-02-17 19:30:40 +01:00

15 KiB

1idnamemodel_id:idgroup_id:idperm_readperm_writeperm_createperm_unlink
2access_account_cash_rounding_readonlyaccount.cash.roundingmodel_account_cash_roundingaccount.group_account_readonly1000
3access_account_cash_rounding_uinvoiceaccount.cash.roundingmodel_account_cash_roundingaccount.group_account_invoice1111
4access_res_partner_group_account_managerres_partner group_account_managermodel_res_partneraccount.group_account_manager1000
5access_res_currency_account_managerres.currency account managerbase.model_res_currencygroup_account_manager1111
6access_res_currency_rate_account_managerres.currency.rate account managerbase.model_res_currency_rategroup_account_manager1111
7access_account_invoice_report_readonlyaccount.invoice.report_usermodel_account_invoice_reportaccount.group_account_readonly1000
8access_account_invoice_report_billingaccount.invoice.report_billingmodel_account_invoice_reportaccount.group_account_invoice1000
9access_account_invoice_reportaccount.invoice.reportmodel_account_invoice_reportaccount.group_account_manager1111
10access_account_incoterms_allaccount.incoterms allmodel_account_incoterms1000
11access_account_incoterms_manageraccount.incoterms managermodel_account_incotermsaccount.group_account_manager1111
12access_account_fiscal_position_product_manageraccount.fiscal.position account.managermodel_account_fiscal_positionaccount.group_account_manager1111
13access_account_fiscal_position_tax_product_manageraccount.fiscal.position.tax account.managermodel_account_fiscal_position_taxaccount.group_account_manager1111
14access_account_fiscal_position_account_product_manageraccount.fiscal.position account.managermodel_account_fiscal_position_accountaccount.group_account_manager1111
15access_account_fiscal_positionaccount.fiscal.position allmodel_account_fiscal_positionbase.group_user1000
16access_account_fiscal_position_taxaccount.fiscal.position.tax allmodel_account_fiscal_position_taxbase.group_user1000
17access_account_fiscal_position_accountaccount.fiscal.position allmodel_account_fiscal_position_accountbase.group_user1000
18access_product_product_account_userproduct.product.account.userproduct.model_product_productgroup_account_readonly1000
19access_product_product_account_managerproduct.product.account.managerproduct.model_product_productaccount.group_account_manager1111
20access_account_bank_statement_group_readonlyaccount.bank.statement.group.invoicemodel_account_bank_statementaccount.group_account_readonly1000
21access_account_bank_statement_group_invoiceaccount.bank.statement.group.invoicemodel_account_bank_statementaccount.group_account_invoice1000
22access_account_bank_statement_line_group_readonlyaccount.bank.statement.line.group.invoicemodel_account_bank_statement_lineaccount.group_account_readonly1000
23access_account_bank_statement_line_group_invoiceaccount.bank.statement.line.group.invoicemodel_account_bank_statement_lineaccount.group_account_invoice1000
24access_account_bank_statementaccount.bank.statementmodel_account_bank_statementaccount.group_account_user1111
25access_account_bank_statement_lineaccount.bank.statement.linemodel_account_bank_statement_lineaccount.group_account_user1111
26access_account_move_line_manageraccount.move.line managermodel_account_move_lineaccount.group_account_manager1000
27access_account_move_manageraccount.move managermodel_account_moveaccount.group_account_manager1000
28access_account_move_readonlyaccount.move readonlymodel_account_moveaccount.group_account_readonly1000
29access_account_move_uinvoiceaccount.movemodel_account_moveaccount.group_account_invoice1111
30access_account_move_line_readonlyaccount.move.line readonlymodel_account_move_lineaccount.group_account_readonly1000
31access_account_move_line_uinvoiceaccount.move.line invoicemodel_account_move_lineaccount.group_account_invoice1111
32access_account_invoice_portalaccount.move.portalaccount.model_account_movebase.group_portal1000
33access_account_invoice_line_portalaccount.move.line.portalaccount.model_account_move_linebase.group_portal1000
34access_account_analytic_line_manageraccount.analytic.line managermodel_account_analytic_lineaccount.group_account_manager1000
35access_account_analytic_accountaccount.analytic.accountanalytic.model_account_analytic_accountbase.group_user1000
36access_account_analytic_line_readonlyaccount.analytic.line invoicemodel_account_analytic_lineaccount.group_account_readonly1000
37access_account_analytic_line_invoiceaccount.analytic.line invoicemodel_account_analytic_lineaccount.group_account_invoice1111
38access_account_analytic_accountantaccount.analytic.account accountantanalytic.model_account_analytic_accountaccount.group_account_user1111
39access_account_analytic_plan_accountantaccount.analytic.plan accountantanalytic.model_account_analytic_planaccount.group_account_user1111
40access_account_analytic_distribution_readonlyaccount.analytic.distribution invoiceanalytic.model_account_analytic_distribution_modelaccount.group_account_readonly1000
41access_account_analytic_distribution_invoiceaccount.analytic.distribution invoiceanalytic.model_account_analytic_distribution_modelaccount.group_account_invoice1111
42access_account_journal_readonlyaccount.journalmodel_account_journalaccount.group_account_readonly1000
43access_account_journal_manageraccount.journalmodel_account_journalaccount.group_account_manager1111
44access_account_journal_invoiceaccount.journal invoicemodel_account_journalaccount.group_account_invoice1000
45access_account_journal_group_allaccount.journal.group allmodel_account_journal_group1000
46access_account_journal_group_manageraccount.journal.group managermodel_account_journal_groupaccount.group_account_manager1111
47access_account_group_manageraccount.groupmodel_account_groupaccount.group_account_manager1111
48access_account_groupaccount.groupmodel_account_groupaccount.group_account_readonly1000
49access_account_root_manageraccount.rootmodel_account_rootaccount.group_account_manager1000
50access_account_rootaccount.rootmodel_account_rootaccount.group_account_readonly1000
51access_account_account_manageraccount.accountmodel_account_accountaccount.group_account_manager1111
52access_account_accountaccount.account.readonlymodel_account_accountaccount.group_account_readonly1000
53access_account_account_useraccount.account usermodel_account_accountbase.group_user1000
54access_account_account_partner_manageraccount.account partner managermodel_account_accountbase.group_partner_manager1000
55access_account_account_invoiceaccount.account invoicemodel_account_accountaccount.group_account_invoice1000
56access_account_tax_internal_useraccount.tax internal usermodel_account_taxbase.group_user1000
57access_account_tax_readonlyaccount.taxmodel_account_taxaccount.group_account_readonly1000
58access_account_tax_invoiceaccount.taxmodel_account_taxaccount.group_account_invoice1000
59access_account_tax_manageraccount.taxmodel_account_taxaccount.group_account_manager1111
60access_account_account_taxaccount.account.tagmodel_account_account_tagaccount.group_account_user1111
61access_account_account_tax_readonlyaccount.account.tagmodel_account_account_tagaccount.group_account_readonly1000
62access_account_account_tax_useraccount.account.tagmodel_account_account_tagaccount.group_account_invoice1000
63access_account_tax_repartition_line_useraccount.tax repartition.line.usermodel_account_tax_repartition_linebase.group_user1000
64access_account_tax_repartition_line_readonlyaccount.tax repartition.line.invoicemodel_account_tax_repartition_lineaccount.group_account_readonly1000
65access_account_tax_repartition_line_invoiceaccount.tax repartition.line.invoicemodel_account_tax_repartition_lineaccount.group_account_invoice1000
66access_account_tax_repartition_line_manageraccount.tax repartition.line.managermodel_account_tax_repartition_lineaccount.group_account_manager1111
67access_account_tax_group_internal_useraccount.tax.group internal usermodel_account_tax_groupbase.group_user1000
68access_account_tax_group_readonlyaccount.tax.groupmodel_account_tax_groupaccount.group_account_readonly1000
69access_account_tax_groupaccount.tax.groupmodel_account_tax_groupaccount.group_account_invoice1000
70access_account_tax_group_manageraccount.tax.groupmodel_account_tax_groupaccount.group_account_manager1111
71access_account_reconcile_model_readonlyaccount.reconcile.model.readonlymodel_account_reconcile_modelaccount.group_account_readonly1000
72access_account_reconcile_model_billingaccount.reconcile.model.billingmodel_account_reconcile_modelaccount.group_account_invoice1010
73access_account_reconcile_modelaccount.reconcile.modelmodel_account_reconcile_modelaccount.group_account_user1111
74access_account_reconcile_model_line_readonlyaccount.reconcile.model.line.readonlymodel_account_reconcile_model_lineaccount.group_account_readonly1000
75access_account_reconcile_model_line_billingaccount.reconcile.model.line.billingmodel_account_reconcile_model_lineaccount.group_account_invoice1010
76access_account_reconcile_model_lineaccount.reconcile.model.linemodel_account_reconcile_model_lineaccount.group_account_user1111
77access_account_reconcile_model_partner_mapping_readonlyaccount.reconcile.model.partner.mapping.readonlymodel_account_reconcile_model_partner_mappingaccount.group_account_readonly1000
78access_account_reconcile_model_partner_mapping_billingaccount.reconcile.model.partner.mapping.billingmodel_account_reconcile_model_partner_mappingaccount.group_account_invoice1010
79access_account_reconcile_model_partner_mappingaccount.reconcile.model.partner.mappingmodel_account_reconcile_model_partner_mappingaccount.group_account_user1111
80access_account_partial_reconcile_readonlyaccount.partial.reconcile.readonlymodel_account_partial_reconcileaccount.group_account_readonly1000
81access_account_partial_reconcile_group_invoiceaccount.partial.reconcile.group.invoicemodel_account_partial_reconcileaccount.group_account_invoice1111
82access_account_partial_reconcileaccount.partial.reconcilemodel_account_partial_reconcileaccount.group_account_user1111
83access_account_full_reconcile_group_readonlyaccount.full.reconcile.group.invoicemodel_account_full_reconcileaccount.group_account_readonly1000
84access_account_full_reconcile_group_invoiceaccount.full.reconcile.group.invoicemodel_account_full_reconcileaccount.group_account_invoice1111
85access_account_full_reconcileaccount.full.reconcilemodel_account_full_reconcileaccount.group_account_user1111
86access_account_payment_term_partner_manageraccount.payment.term partner managermodel_account_payment_termbase.group_user1000
87access_account_payment_term_manageraccount.payment.termmodel_account_payment_termaccount.group_account_manager1111
88access_account_payment_term_line_partner_manageraccount.payment.term.line partner managermodel_account_payment_term_linebase.group_user1000
89access_account_payment_term_line_manageraccount.payment.term.linemodel_account_payment_term_lineaccount.group_account_manager1111
90access_account_payment_method_line_readonlyaccount.payment.method.linemodel_account_payment_method_linebase.group_user1000
91access_account_payment_method_lineaccount.payment.method.linemodel_account_payment_method_lineaccount.group_account_invoice1111
92access_account_payment_method_readonlyaccount.payment.methodmodel_account_payment_methodbase.group_user1000
93access_account_payment_methodaccount.payment.methodmodel_account_payment_methodaccount.group_account_invoice1111
94access_account_payment_readonlyaccount.paymentmodel_account_paymentaccount.group_account_readonly1000
95access_account_paymentaccount.paymentmodel_account_paymentaccount.group_account_invoice1111
96access_account_payment_registeraccess.account.payment.registermodel_account_payment_registeraccount.group_account_invoice1110
97access_account_automatic_entry_wizardaccess.account.automatic.entry.wizardmodel_account_automatic_entry_wizardaccount.group_account_user1110
98access_account_unreconcileaccess.account.unreconcilemodel_account_unreconcileaccount.group_account_user1110
99access_account_resequenceaccess.account.resequence.wizardmodel_account_resequence_wizardaccount.group_account_manager1110
100access_validate_account_moveaccess.validate.account.movemodel_validate_account_moveaccount.group_account_invoice1110
101access_account_move_reversalaccess.account.move.reversalmodel_account_move_reversalaccount.group_account_invoice1110
102access_account_financial_year_opaccess.account.financial.year.opmodel_account_financial_year_opaccount.group_account_manager1110
103access_account_setup_bank_manual_configaccess.account.setup.bank.manual.configmodel_account_setup_bank_manual_configaccount.group_account_manager1110
104access_account_invoice_sendaccess.account.invoice.sendmodel_account_invoice_sendaccount.group_account_invoice1110
105access_account_tour_upload_billaccount.tour.upload.billmodel_account_tour_upload_billaccount.group_account_manager1110
106access_account_tour_upload_bill_email_confirmaccount.tour.upload.bill.email.confirmmodel_account_tour_upload_bill_email_confirmaccount.group_account_manager1110
107access_account_accrued_orders_wizardaccount.account.accrued.orders.wizardaccount.model_account_accrued_orders_wizardgroup_account_user1110
108access_account_report_readonlyaccount.report.readonlymodel_account_reportaccount.group_account_readonly1000
109access_account_report_ac_useraccount.report.ac.usermodel_account_reportaccount.group_account_manager1111
110access_account_report_line_readonlyaccount.report.line.readonlymodel_account_report_lineaccount.group_account_readonly1000
111access_account_report_line_ac_useraccount.report.line.ac.usermodel_account_report_lineaccount.group_account_manager1111
112access_account_report_expression_readonlyaccount.report.expression.readonlymodel_account_report_expressionaccount.group_account_readonly1000
113access_account_report_expression_ac_useraccount.report.expression.ac.usermodel_account_report_expressionaccount.group_account_manager1111
114access_account_report_column_readonlyaccount.report.column.readonlymodel_account_report_columnaccount.group_account_readonly1000
115access_account_report_column_ac_useraccount.report.column.ac.usermodel_account_report_columnaccount.group_account_manager1111
116access_account_report_external_value_readonlyaccount.report.external.value.readonlymodel_account_report_external_valueaccount.group_account_readonly1000
117access_account_report_external_value_ac_useraccount.report.external.value.ac.usermodel_account_report_external_valueaccount.group_account_manager1111