Skip to content

Conversation

@yelizariev
Copy link
Contributor

@yelizariev yelizariev commented Nov 8, 2021

Add missing parts and fix out-of-dated docs

@robodoo
Copy link
Collaborator

robodoo commented Nov 8, 2021

@yelizariev yelizariev force-pushed the 15.0-accounting-locatization--IEL branch 9 times, most recently from 0fc7dca to 85fbcca Compare November 12, 2021 15:35
@yelizariev yelizariev marked this pull request as ready for review November 12, 2021 15:35
@yelizariev
Copy link
Contributor Author

@odoo/rd-accounting

@yelizariev yelizariev force-pushed the 15.0-accounting-locatization--IEL branch 4 times, most recently from 8dcae5d to 42d7610 Compare November 15, 2021 09:54
Copy link
Contributor

@jco-odoo jco-odoo left a 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.
Copy link
Contributor

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.

Copy link
Contributor Author

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``.
Copy link
Contributor

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.

Copy link
Contributor Author

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>`__:


Copy link
Contributor

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)

Copy link
Contributor

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)

Copy link
Contributor Author

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:
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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:

Suggested change
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):
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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"/>
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>`__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In financial reports, we have the special date changer as well.

It would not be bad to have some section about how the P&L and balance sheet can be linked @Shawcker and how the current year earnings (and previous year earnings), ... work @Levizar

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor

@william-andre william-andre left a 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

@yelizariev yelizariev force-pushed the 15.0-accounting-locatization--IEL branch 2 times, most recently from 4c9928b to 7dfa760 Compare November 16, 2021 11:50
Reconciliation models section is deleted because it was obsolete and rarely used
in localization modules
@yelizariev yelizariev force-pushed the 15.0-accounting-locatization--IEL branch from 7dfa760 to 931302d Compare November 16, 2021 12:00
@yelizariev
Copy link
Contributor Author

@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
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

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.
Copy link
Contributor

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. -->
Copy link
Contributor

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
Copy link
Contributor

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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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):
Copy link
Contributor

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>`__
Copy link
Contributor

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
Copy link
Contributor

Everything should be in here #1334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants