-
wan authored
Task 2124952 Extract all the demo data from `l10n_generic_coa` to a new way of generating the demo data for accounting modules. Because the data needs to be created multiple times, and right after the chart template instanciation, it cannot be done the usual way. Instead, we use python generators to declare the data. It allows us to reference data that was not created yet at the start of the creation of the demo. An xml_id is given, prefixed with the id of the company it is created for (just like the instanciation of the chart template) To find the correct accounts, a helper method has been added to `account.account`. It will look for an account with the correct xml_id (which is the one of the l10n_generic_coa, that we have to put on the other l10n modules too, in the future). If it didn't find the xml_id, it will look for an account with the correct type. If it still didn't find one, just take any account.
d31c5c70