Skip to content

[IMP] accouting/l10n_br: Adding information about credit usage in the Avalara integration .rst #13630

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

Closed
wants to merge 1 commit into from

Conversation

giri-odoo
Copy link
Contributor

@giri-odoo giri-odoo commented Jun 9, 2025

To comply with legal requirements—especially consumer protection laws (Lei de Proteção ao Consumidor) — and to ensure full transparency with our users, we provide the following explanation of how credit consumption works in the Avalara integration.

@robodoo
Copy link
Collaborator

robodoo commented Jun 9, 2025

Pull request status dashboard

@giri-odoo
Copy link
Contributor Author

@sclo-odoo @vbe-odoo

@vbe-odoo vbe-odoo self-requested a review June 9, 2025 14:37
Copy link
Contributor

@vbe-odoo vbe-odoo left a comment

Choose a reason for hiding this comment

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

Hello @giri-odoo
Thanks for the PR with the improvements!

I left some comments as part of my pre-review, this PR will be reviewed by other teams after I conclude my review.

Help me improving the PR and commit title, you can take the PR done by @sclo-odoo here #12921
Example: [IMP] accouting/l10n_br: Adding NFC-e feature

That is the title convention needed. You can try using the GitHub desktop to make that edit, try here on the web-based GitHub, if close and create a new PR if those 2 steps weren't possible.

Thanks again!

Comment on lines 181 to 183
- Correction letter (Carta de Correção)
- Invoice cancellation
- Other tax validations
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
- Correction letter (Carta de Correção)
- Invoice cancellation
- Other tax validations
- :ref:`Correction letter (Carta de Correção) <localizations/brazil/correction-letter>`
- :ref:`Invoice cancellation <localizations/brazil/invoice-cancellation>`
- :ref:`Sales Refund via Credit Note <localizations/brazil/credit-notes>`
- :ref:`Sales Complementary Invoice via Debit Note <localizations/brazil/debit-notes>`
- :ref:`Invalidate invoice number range <localizations/brazil/invalidate-invoice-number-range>`
- Other tax validations.

Please do the same for the NFS-e section.
Feel free to modify of add cases, but if we are gonna add the detailed consumption, it is better to add all scenarios where a credit is consumed, which is every time a API call is done, like in the added scenarios. I've added the links to the specific section within the User Doc as we have it, and it is good to refer the user to that section if needed.

For Credit Notes (sales refund) and Debit Notes (Sales Complementary), there's also a Tax Computation required, so maybe you would like to add that a Tax Computation will be consumed on those scenarios as well.
:ref:create an account in AvaTax <localizations/brazil/avatax-account>

.. important::
The Avalara integration operates on a credit-based system, where each interaction with Avalara consumes 1 credit. Below are the main credit-consuming operations:

:guilabel:`Sales Application`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested changes on the NF-e section also applies here.

@giri-odoo giri-odoo changed the title Update brazil.rst [IMP] accouting/l10n_br: Adding information about credit usage in the Avalara integration .rst Jun 9, 2025
@giri-odoo
Copy link
Contributor Author

@vbe-odoo Thanks for the feedback! I've already made all the changes.

@vbe-odoo
Copy link
Contributor

vbe-odoo commented Jun 9, 2025

Hello @giri-odoo, thanks for the changes.

Just a few remarks:

  • The E-Invoice for goods (NF-e) and E-Invoice for services (NFS-e) sections are not looking so nice when checking in runbot (you can check this by copiying the branch name giri-odoo-patch-1 > go to https://runbot.odoo.com/ > Access and wake up the Documentation build and then when on the user documentation > go to Fiscal Localizations > Brazil > there you can check your changes > Video.
  • PoS Section has the same problem.

Here are the images:
image
image
image

Thanks!
cc' @sclo-odoo

@giri-odoo
Copy link
Contributor Author

Hi @vbe-odoo , I made the requested formatting changes. Please see the images. For some reason I couldn't identify, the initial text of the NFC-e is in bold. Do you have any idea why ?

Here the images:
image
image
image

@vbe-odoo
Copy link
Contributor

vbe-odoo commented Jun 10, 2025

Hi @giri-odoo I don't really know why it is bolded, and something else I could not identify why is not working, is the last link on the bullet points (- :ref:`Invalidate invoice number range <localizations/brazil/invalidate-invoice-number-range>) somehow that link is not showing up, but I think the guys from MKT could help us with this.

@samueljlieber hello 👋 !
Can you help me review this PR whenever you have some time?

Thanks! 🙏
cc' @sclo-odoo

@giri-odoo
Copy link
Contributor Author

@vbe-odoo Thanks for your response and your help! I'll be standing by!

cc: @sclo-odoo

@vbe-odoo vbe-odoo requested a review from samueljlieber June 12, 2025 12:58
@samueljlieber
Copy link
Contributor

samueljlieber commented Jun 13, 2025

Hi @giri-odoo! Thank you for your contribution! I took a quick look at the helpful information you've added, and there seems to be the same explination in two spots (in NF-e and NFS-e sections).

To avoid writing the same content twice, I suggest placeing this information in a single spot and then it can be referenced in multiple locations.

Since this information is about the Avalara integration, it makes sense to me to include this information in the Avalara integration section, what do you think?

I also suggest slightly modifying the formatting to utilize the note and example admonition blocks. And to try something different, we could use a flowchart to illustrate the credit consumption example:

Screenshot 2025-06-13 at 14-46-28 Brazil — Odoo 18 0 documentation

View the RST code for this 👆
.. important::
   The Avalara integration works on a credit-based system, where each interaction with Avalara
   consumes 1 credit. Below are the main credit-consuming operations:

   **Sales application**

   - Tax calculation on quotations and sales orders.

   **Accounting application**

   - Tax calculation on invoices.
   - Electronic invoice submission (NF-e or NFS-e).

   **Occasional operations**: (each step is billed separately)

   - :ref:`Correction letter (Carta de Correção) <localizations/brazil/correction-letter>`
   - :ref:`Invoice cancellation <localizations/brazil/invoice-cancellation>`
   - :ref:`Sales refund via credit note <localizations/brazil/credit-notes>`
   - :ref:`Sales complementary invoice via debit note <localizations/brazil/debit-notes>`
   - :ref:`Invalidate invoice number range <localizations/brazil/invalidate-invoice-number>`
   - Other tax validations.

.. note::
   If taxes are calculated in **Sales** and later issue the invoice in **Accounting**, the
   calculation happens twice, consuming 2 credits.

.. example::

   .. graphviz::

      digraph avalara_credit_consumption {
         rankdir=TB;
         node [shape=box];

         "Sales order confirmed" -> "Invoice created" [label=" 1 credit (tax calculation)"];
         "Invoice created" -> "Invoice confirmed and submitted"
         [label=" 1 credit (tax calculation)"];
         "Invoice confirmed and submitted" -> "Credits summary"
         [label=" 1 credit (tax calculation)\n+\n 1 credit (submit invoice)"];
         "Credits summary"
         [label="Total: 4 credits", shape=ellipse, style=filled, fillcolor=lightgrey];
      }

Let me know your thoughts @giri-odoo @vbe-odoo and I am happy to discuss further and/or make a second commit with these changes! Thanks! :)

@giri-odoo
Copy link
Contributor Author

Hi @samueljlieber! Thanks a lot for your suggestions — I really liked the idea of improving the structure and using flowcharts to explain the credit consumption logic.

That said, I believe it’s essential to keep the explanation of credit consumption inside each specific document type (NF-e, NFS-e).

Although the logic behind API consumption may look similar across different invoice types, in practice the context of each one matters a lot — especially for our clients, who often rely on this documentation to understand what they’re being charged for. Centralizing this information could create confusion for end users, and even lead to misinterpretations that go against consumer rights legislation in Brazil.

To ensure transparency and clarity, I’d prefer to keep the credit usage documented separately for each type of invoice. I fully agree with adopting note blocks, examples, and visual aids to improve readability.

In fact, according to Article 6, item III of the Brazilian Consumer Defense Code (CDC) — "the right to clear and adequate information about the different products and services, with correct specification of quantity, characteristics, composition, quality and price, as well as on the risks they present" — any additional charges or credit consumption must be explicitly communicated and contextualized. This reinforces the importance of keeping documentation precise and segmented.
🔗 Full text of the CDC (in Portuguese) - https://www.planalto.gov.br/ccivil_03/leis/l8078.htm

Happy to align further if needed. Thanks again for the great collaboration!

cc: @sclo-odoo

@samueljlieber
Copy link
Contributor

Hi @giri-odoo, thank you for the additional context about compliance. I'll make a commit to keep the explanation of credit consumption inside each specific document type (NF-e, NFS-e), but with the updated format :)

@samueljlieber samueljlieber changed the base branch from 18.0 to 17.0 June 18, 2025 13:45
@samueljlieber samueljlieber changed the base branch from 17.0 to 18.0 June 18, 2025 13:45
@C3POdoo C3POdoo requested a review from a team June 18, 2025 14:03
Copy link
Contributor

@samueljlieber samueljlieber left a comment

Choose a reason for hiding this comment

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

Made the formatting changes in c13084e, approving and passing to l10n doc review!

@afma-odoo afma-odoo requested review from afma-odoo and removed request for a team June 20, 2025 08:26
Copy link
Contributor

@afma-odoo afma-odoo left a comment

Choose a reason for hiding this comment

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

Thank you @samueljlieber and @giri-odoo for this update!
I just added some suggestions, let me know if you have any questions! Thanks :)

Comment on lines 189 to 203
.. example::

.. graphviz::

digraph avalara_credit_consumption {
rankdir=TB;
node [shape=box];

"Sales order confirmed" -> "Invoice created" [label=" 1 credit (tax calculation)"];
"Invoice created" -> "Invoice confirmed and submitted"
[label=" 1 credit (tax calculation)"];
"Invoice confirmed and submitted" -> "Credits summary"
[label=" 1 credit (tax calculation)\n+\n 1 credit (submit invoice)"];
"Credits summary"
[label="Total: 4 credits", shape=ellipse, style=filled, fillcolor=lightgrey];
Copy link
Contributor

Choose a reason for hiding this comment

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

I just have an error message for this, but I guess it's because it's not installed on my laptop ;)
image

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this error is due to not having graphviz installed on your computer, however, I am now seeing the same issue on Runbot.

Although this seems to be possible, to avoid any issues with merging or translations of this graph, maybe it is best to avoid using graphviz.

I'll make a commit to use basic RST syntax to outline this flow.

Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2025-06-23 at 10 04 58 AM

@samueljlieber
Copy link
Contributor

Thank you @afma-odoo, your suggestions were implemented in 498338e :)

Copy link
Contributor

@afma-odoo afma-odoo left a comment

Choose a reason for hiding this comment

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

Great, thanks @samueljlieber for the update!
I approve it and ping be-doc-review for the final review :)
Thank you!

@afma-odoo afma-odoo requested a review from a team June 23, 2025 14:38
Copy link
Contributor

@xpl-odoo xpl-odoo left a comment

Choose a reason for hiding this comment

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

Very minor suggestions :)

To comply with legal requirements—especially consumer protection laws (Lei de Proteção ao Consumidor) — and to ensure full transparency with our users, we provide the following explanation of how credit consumption works in the Avalara integration.

Co-authored-by: Valentino <vbe@odoo.com>
@samueljlieber
Copy link
Contributor

Thanks @xpl-odoo! Implemented your suggestions in 91b5020 :)

Copy link
Contributor

@xpl-odoo xpl-odoo left a comment

Choose a reason for hiding this comment

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

Thanks @samueljlieber (and everyone else ;))
@robodoo r+

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