-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[REF] i18n/localization.rst: improve the instruction #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0fc7dca to
85fbcca
Compare
|
@odoo/rd-accounting |
8dcae5d to
42d7610
Compare
jco-odoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things are just wrong historically and just gave a lot of comments with ideas on how to improve, but if you are new to it, your spirit might be better at improving it.
@oco-odoo @qdp-odoo I think @yelizariev started something that could be a start of a collaborative effort to gradually improve the documentation. I think the same should e.g. be done for how (account_)edi works.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| .. note:: | ||
|
|
||
| First of all, before I proceed, we need to talk about the templates. A template is a record that allows replica of itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would not hurt to explain this maybe above still. At least it makes clear that you can have multiple companies with different CoA. Maybe also tell that the goal of the localization module is to provide the accountant with accounts, taxes, ... that are specific for its country.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I heard templates will be possible removed. And developer doesn't really need to know about templates. It just works.
Anyway, I don't have inspiration for another introduction. Post you version, if you have an idea.
|
|
||
| Like any other record, a tag can be created with the following xml structure: | ||
| Tags is a way to sort accounts. | ||
| For example, imagine you want to create a financial report having multiple lines but you have no way to find a rule to dispatch the accounts according their ``code`` or ``name``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never use name (do not give people bad ideas, as e.g. the user can change the name)
There are countries where the CoA is structured extensively where it is e.g. almost legally required to know which code goes where e.g. Peru. In other countries, the codes of the accounts will change from one company to the other. In those latter cases, you would rather use tags, because if the user changes the accounts like that, he can easily add the right tags himself.
If we can use codes, that is still the most straightforward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change this part and I don't quite understand your suggestion. You want to remove or 'name' ?
|
|
||
| Account groups allows to describe structure of chart of accounts. Just check example from `l10n_il/data/account.group.template.csv <https://github.com/odoo/odoo/blob/15.0/addons/l10n_il/data/account.group.template.csv>`__: | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically the right group_id is set as a computed field on each account and account groups form a hierarchy themselves. (not immediately clear from the table below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a screenshot of a report where it is used. (need to activate the option for hierarchy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't use account groups yet. I may improve this part later
| Taxes | ||
| ----- | ||
|
|
||
| To add taxes you first need to specify tax groups. It has just two fields: name and country. Create file `data/account_tax_group_data.xml` and list the groups: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tax groups are used for the summary of the totals at the bottom-right of the invoice. Normally, you should at least have one by tax amount and probably also to make the distinction between 0% and exempt taxes e.g. We have no templates here, only a country related.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make suggestion via +- button in github?
I'm not ready to add overview of the tax groups myself because I never used it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are indeed more than just two fields on that model https://github.com/odoo/odoo/blob/15.0/addons/account/models/account_tax.py#L23-L33
Though, I'm not sure this is the right place to explain the subtotal feature. Same goes for the advance tax, tax payable & receivable and sequence. If we want a complete explanation of everything in this l10n tutorial, we'll have to explain the entirety of accounting features.
Maybe we could just be not too specific about it and say something like:
| To add taxes you first need to specify tax groups. It has just two fields: name and country. Create file `data/account_tax_group_data.xml` and list the groups: | |
| To add taxes you first need to specify tax groups. These are used on invoices to regroup and display tax amounts. | |
| Two fields are required on these: name and country. Other fields are available to better control the display of subtotals on the invoice or to impact the way the tax closing move is generated. | |
| Create file `data/account_tax_group_data.xml` and list the groups: |
The documentation on tax closing (https://github.com/odoo/documentation/blob/15.0/content/applications/finance/accounting/reporting/declarations/tax_returns.rst ) doesn't seem to mention the accounts set on the group, nor to give any explanation on advance tax payments. Maybe we could consider that, but probably not here.
Same goes for preceding_subtotal ; it's more advanced be we could add something elsewhere in the doc.
| Adding a new fiscal position to my Chart of Accounts | ||
| #################################################### | ||
| class AccountTaxReportLine(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add a more descriptive text than copy pasting the code. Also tax report functionality is similar to the financial report one and it would be good to explain that we have formula(s), code (how you have domain in financial report and the link with the taxes in the tax report), how you can have parent and children lines. There is also the possibility to put formula None when you do not want to put anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the carryover it is probably not that badly explained but giving a general idea here could help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tag name could be explained as the name given to the +/- tags in the tax configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may improve it later when I understand it. If you could rewrite this part, you could post your suggestion via +- tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we do a doc only about carryover somewhere ? I don't think putting everything in the l10n page is a good idea. Again: what exactly to we want here?
| When the whole accounts are generated, you have the possibility to override the newly generated chart of accounts by adding some properties that correspond to default accounts used in certain situations. | ||
| This must be done after the creation of accounts before each one must be linked to the chart of accounts. | ||
| <!-- [Optional] When set to True, it can be applied only if partner has VAT number. False by default --> | ||
| <field name="vat_required" eval="True"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rephrasing: it can only be applied when the partner has a VAT number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure which version is better
JCO: it can only be applied when the partner has a VAT number.
https://context.reverso.net/%D0%BF%D0%B5%D1%80%D0%B5%D0%B2%D0%BE%D0%B4/%D0%B0%D0%BD%D0%B3%D0%BB%D0%B8%D0%B9%D1%81%D0%BA%D0%B8%D0%B9-%D1%84%D1%80%D0%B0%D0%BD%D1%86%D1%83%D0%B7%D1%81%D0%BA%D0%B8%D0%B9/it+can+only
IEL: it can be applied only if partner has VAT number.
| For the fields meaning dive directly to the source: | ||
|
|
||
| .. code-block:: py | ||
| * `account.financial.html.report (v15) <https://github.com/odoo/enterprise/blob/d4eff9d39469cf3fe18589a1547cb0cdb93f4ae9/account_reports/models/account_financial_report.py#L59-L75>`__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe improve it later? This PR is already big enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should explain financial reports here. As stated in my previous comments, this is not the aim of this page, and if we do, it'll become a messy box were we put everything. We should have dedicated pages for the different report engines that are available for XML definition, and only link those pages here.
william-andre
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be possible to use the autoclass and autoattribute rst commands like done in this file?
https://github.com/odoo/documentation/blob/15.0/content/developer/reference/backend/orm.rst
4c9928b to
7dfa760
Compare
Reconciliation models section is deleted because it was obsolete and rarely used in localization modules
7dfa760 to
931302d
Compare
|
@william-andre I'd prefer to avoid docs generated from the code here. The fields definitions I copy-pasted is more a temporary solution, rather than the final goal. I think to replace it with more human-readable text when I understand the topic better |
| <record id="..." model="account.chart.template"> | ||
| <!-- [Required] Specify the name to display for this CoA. --> | ||
| <field name="name">...</field> | ||
| **Transfer code** is used to create a transfer account that is an intermediary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing coma: "... account, that is ... "
|
|
||
| <!-- [Required] Specify a prefix of the cash accounts. --> | ||
| <field name="cash_account_code_prefix">...</field> | ||
| Next settings for the chart of accounts are set in a separate file, because we need to provide `list of accounts <#accounts>`__ first. In `data/l10n_XX_chart_post_data.xml` we set some default accounts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... provide the list of accounts ...
| </record> | ||
| For example, let's take a look to the Belgium chart of accounts. | ||
| The last step on installing Chart of Accounts is applying it on current company. File `data/account_chart_template_configure_data.xml` is responsible for that: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather trying to apply it to current company. A little more explanation on the fact it will only be set on the current company (and only on this one) when it does not have a chart of accounts yet would probably be welcome here.
| <value eval="[ref('l10n_XX.l10n_XX_chart_template')]"/> | ||
| </function> | ||
| Finally, you may add a demo company, so the localization can be easily tested in demo mode. Check `l10n_ch/demo/demo_company.xml <https://github.com/odoo/odoo/blob/15.0/addons/l10n_ch/demo/demo_company.xml>`__ for example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... for an example.
| <field name="currency_id" ref="..."/> | ||
| <field name="currency_id" ref="base.XXX"/> | ||
| <!-- [Optional] Boolean to allow the user to reconcile entries in this account. True by default. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
False by default.
| Each distribution has following parameters: | ||
| * `factor_percent` - Factor to apply on the account move lines generated from this distribution line, in percents | ||
| * `repartition_type` - either 'base' or 'tax' | ||
| * `account_id` - Account on which to post the tax amount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for tax repartition lines. If not set, the base account will be used.
| either based on payment using the 'on_payment' key. | ||
| The default value is 'on_invoice'. --> | ||
| <field name="tax_exigibility">...</field> | ||
| In previous section you noticed fields `invoice_repartition_line_ids` / `refund_repartition_line_ids` and probably understand nothing about it. Good news: you are not alone on this incomprehension. Bad news: you have to figure it out a bit. The topic is complicated indeed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| In previous section you noticed fields `invoice_repartition_line_ids` / `refund_repartition_line_ids` and probably understand nothing about it. Good news: you are not alone on this incomprehension. Bad news: you have to figure it out a bit. The topic is complicated indeed: | |
| In the previous section you noticed fields `invoice_repartition_line_ids` / `refund_repartition_line_ids` and probably understood nothing about it. Good news: you are not alone on this incomprehension. Bad news: you have to figure it out a bit. The topic is complicated indeed: |
| :height: 394 | ||
|
|
||
| An example found in the ``l10n_pl`` module: | ||
| So, once you have properly configured taxes, you just need to add `data/account_tax_report_data.xml` file with a single record for `account.tax.report` in beginning: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| So, once you have properly configured taxes, you just need to add `data/account_tax_report_data.xml` file with a single record for `account.tax.report` in beginning: | |
| So, once you have properly configured taxes, you just need to add `data/account_tax_report_data.xml` file with a single record for `account.tax.report` at the beginning: |
Actually, you might define multiple tax reports. From 14.0 on, at least.
| Adding a new fiscal position to my Chart of Accounts | ||
| #################################################### | ||
| class AccountTaxReportLine(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we do a doc only about carryover somewhere ? I don't think putting everything in the l10n page is a good idea. Again: what exactly to we want here?
| For the fields meaning dive directly to the source: | ||
|
|
||
| .. code-block:: py | ||
| * `account.financial.html.report (v15) <https://github.com/odoo/enterprise/blob/d4eff9d39469cf3fe18589a1547cb0cdb93f4ae9/account_reports/models/account_financial_report.py#L59-L75>`__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should explain financial reports here. As stated in my previous comments, this is not the aim of this page, and if we do, it'll become a messy box were we put everything. We should have dedicated pages for the different report engines that are available for XML definition, and only link those pages here.
|
Everything should be in here #1334 |
Add missing parts and fix out-of-dated docs