-
Notifications
You must be signed in to change notification settings - Fork 10k
[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
Conversation
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.
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!
- Correction letter (Carta de Correção) | ||
- Invoice cancellation | ||
- Other tax validations |
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.
- 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`: |
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.
Suggested changes on the NF-e section also applies here.
@vbe-odoo Thanks for the feedback! I've already made all the changes. |
Hello @giri-odoo, thanks for the changes. Just a few remarks:
Thanks! |
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 ? |
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 ( @samueljlieber hello 👋 ! Thanks! 🙏 |
@vbe-odoo Thanks for your response and your help! I'll be standing by! cc: @sclo-odoo |
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: 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! :) |
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. Happy to align further if needed. Thanks again for the great collaboration! cc: @sclo-odoo |
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 :) |
e2f20ab
to
c13084e
Compare
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.
Made the formatting changes in c13084e, approving and passing to l10n doc review!
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.
Thank you @samueljlieber and @giri-odoo for this update!
I just added some suggestions, let me know if you have any questions! Thanks :)
.. 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]; |
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.
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.
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.
c13084e
to
498338e
Compare
Thank you @afma-odoo, your suggestions were implemented in 498338e :) |
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.
Great, thanks @samueljlieber for the update!
I approve it and ping be-doc-review for the final review :)
Thank you!
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.
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>
498338e
to
91b5020
Compare
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.
Thanks @samueljlieber (and everyone else ;))
@robodoo r+
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.