diff --git a/account_avatax_sale_oca/README.rst b/account_avatax_sale_oca/README.rst index 5d407644a..d97458cbb 100644 --- a/account_avatax_sale_oca/README.rst +++ b/account_avatax_sale_oca/README.rst @@ -17,13 +17,13 @@ Avalara Avatax Certified Connector for Sales Orders :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--fiscal--rule-lightgray.png?logo=github - :target: https://github.com/OCA/account-fiscal-rule/tree/17.0/account_avatax_sale_oca + :target: https://github.com/OCA/account-fiscal-rule/tree/18.0/account_avatax_sale_oca :alt: OCA/account-fiscal-rule .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/account-fiscal-rule-17-0/account-fiscal-rule-17-0-account_avatax_sale_oca + :target: https://translation.odoo-community.org/projects/account-fiscal-rule-18-0/account-fiscal-rule-18-0-account_avatax_sale_oca :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/account-fiscal-rule&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-fiscal-rule&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -52,47 +52,46 @@ will be reported as a net deduction on the line item cost. Create New Sales Order -- Navigate to: Sales >> Orders >> Orders -- Click Create button +- Navigate to: Sales >> Orders >> Orders +- Click Create button Compute Taxes with AvaTax -- The module will calculate tax when the sales order is confirmed, or - by navigating to Action >> Update taxes with Avatax. At this step, - the sales order will retrieve the tax amount from Avalara but will - not report the transaction to the AvaTax dashboard. Only invoice, - refund, and payment activity are reported to the dashboard. -- The module will check if there is a selected warehouse and will - automatically determine the address of the warehouse and the origin - location. If no address is assigned to the warehouse the module will - automatically use the address of the company as its origin. Location - code will automatically populate with the warehouse code but can be - modified if needed. -- Hide Exemption & Tax Based on shipping address -- this will provide - this feature support at sale order level. +- The module will calculate tax when the sales order is confirmed, or by + navigating to Action >> Update taxes with Avatax. At this step, the + sales order will retrieve the tax amount from Avalara but will not + report the transaction to the AvaTax dashboard. Only invoice, refund, + and payment activity are reported to the dashboard. +- The module will check if there is a selected warehouse and will + automatically determine the address of the warehouse and the origin + location. If no address is assigned to the warehouse the module will + automatically use the address of the company as its origin. Location + code will automatically populate with the warehouse code but can be + modified if needed. +- Hide Exemption & Tax Based on shipping address -- this will provide + this feature support at sale order level. Tax Exemption Status -- Tax exemption status can be defined on Contacts. -- In a multi-company environment, the exemption status is defined per - Company, since each individual company is required to secure the - exemption certificates to claim for exemption application, and this - may not be the case for all Companies. -- If the customer is tax exempt, in the "Avatax" tab, check the "Is Tax - Exempt" checkbox. When checked, the exemption details can be - provided. The Exemption Code is the type of exemption, and the - Exemption Number is an identification number to use on the customer's - State. -- This exemption status will only be applied for delivery addresses in - the State matching the State of the exemption address. The same - customer can have exemptiions on several states. For this use - additional Contact/Addresses for those states, and enter the - exempention details there. -- To make this data management simpler, is it possible to set the - customer as exempt country wide, using the corresponding checkbox. In - this case the exemption status will be used for delivery addresses in - any state. Using this option has compliance risks, so plase use it - with care. +- Tax exemption status can be defined on Contacts. +- In a multi-company environment, the exemption status is defined per + Company, since each individual company is required to secure the + exemption certificates to claim for exemption application, and this + may not be the case for all Companies. +- If the customer is tax exempt, in the "Avatax" tab, check the "Is Tax + Exempt" checkbox. When checked, the exemption details can be provided. + The Exemption Code is the type of exemption, and the Exemption Number + is an identification number to use on the customer's State. +- This exemption status will only be applied for delivery addresses in + the State matching the State of the exemption address. The same + customer can have exemptions on several states. For this use + additional Contact/Addresses for those states, and enter the + exempention details there. +- To make this data management simpler, is it possible to set the + customer as exempt country wide, using the corresponding checkbox. In + this case the exemption status will be used for delivery addresses in + any state. Using this option has compliance risks, so plase use it + with care. Bug Tracker =========== @@ -100,7 +99,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -117,24 +116,30 @@ Authors Contributors ------------ -- Odoo SA +- Odoo SA - - Fabrice Henrion + - Fabrice Henrion -- Open Source Integrators (https://opensourceintegrators.com) +- Open Source Integrators (https://opensourceintegrators.com) - - Daniel Reis - - Bhavesh Odedra - - Sandip Mangukiya - - Nikul Chaudhary + - Daniel Reis + - Bhavesh Odedra + - Sandip Mangukiya + - Nikul Chaudhary -- Serpent CS +- Serpent CS - - Murtuza Saleh + - Murtuza Saleh -- Sodexis +- Sodexis - - Atchuthan Ubendran + - Atchuthan Ubendran + +- Kencove (https://kencove.com) + + - Don Kendall + - Mohamed Alkobrosli + - Wai-Lun Lin Maintainers ----------- @@ -157,6 +162,6 @@ Current `maintainer `__: |maintainer-dreispt| -This module is part of the `OCA/account-fiscal-rule `_ project on GitHub. +This module is part of the `OCA/account-fiscal-rule `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_avatax_sale_oca/__manifest__.py b/account_avatax_sale_oca/__manifest__.py index 6adaa9b83..2e066b1ee 100644 --- a/account_avatax_sale_oca/__manifest__.py +++ b/account_avatax_sale_oca/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Avalara Avatax Certified Connector for Sales Orders", - "version": "17.0.1.1.0", + "version": "18.0.1.0.0", "author": "Open Source Integrators, Fabrice Henrion," "Sodexis, Odoo Community Association (OCA)", "summary": "Sales Orders with automatic Tax application using Avatax", diff --git a/account_avatax_sale_oca/models/sale_order.py b/account_avatax_sale_oca/models/sale_order.py index 6a22014d4..b0a916d23 100644 --- a/account_avatax_sale_oca/models/sale_order.py +++ b/account_avatax_sale_oca/models/sale_order.py @@ -24,7 +24,7 @@ def _compute_hide_exemption(self): "Hide Exemption & Tax Based on shipping address", compute="_compute_hide_exemption", # For past transactions visibility default=lambda self: self.env.company.get_avatax_config_company, - help="Uncheck the this field to show exemption fields on SO/Invoice form view. " + help="Uncheck this field to show exemption fields on SO/Invoice form view. " "Also, it will show Tax based on shipping address button", ) tax_amount = fields.Monetary(string="AvaTax") diff --git a/account_avatax_sale_oca/readme/CONTRIBUTORS.md b/account_avatax_sale_oca/readme/CONTRIBUTORS.md index 467df06af..8d0875306 100644 --- a/account_avatax_sale_oca/readme/CONTRIBUTORS.md +++ b/account_avatax_sale_oca/readme/CONTRIBUTORS.md @@ -9,3 +9,7 @@ - Murtuza Saleh - Sodexis - Atchuthan Ubendran +- Kencove () + - Don Kendall \<\> + - Mohamed Alkobrosli \<\> + - Wai-Lun Lin \<\> diff --git a/account_avatax_sale_oca/readme/USAGE.md b/account_avatax_sale_oca/readme/USAGE.md index 2a080edb5..f94f64731 100644 --- a/account_avatax_sale_oca/readme/USAGE.md +++ b/account_avatax_sale_oca/readme/USAGE.md @@ -43,7 +43,7 @@ Tax Exemption Status is an identification number to use on the customer's State. - This exemption status will only be applied for delivery addresses in the State matching the State of the exemption address. The same - customer can have exemptiions on several states. For this use + customer can have exemptions on several states. For this use additional Contact/Addresses for those states, and enter the exempention details there. - To make this data management simpler, is it possible to set the diff --git a/account_avatax_sale_oca/static/description/index.html b/account_avatax_sale_oca/static/description/index.html index c2fe52732..5f7471d30 100644 --- a/account_avatax_sale_oca/static/description/index.html +++ b/account_avatax_sale_oca/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,7 +369,7 @@

Avalara Avatax Certified Connector for Sales Orders

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:27ff9d1210f28b5d09820d54064d01e7cd14f54fb45e081f4f906b8adec6c46a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: AGPL-3 OCA/account-fiscal-rule Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/account-fiscal-rule Translate me on Weblate Try me on Runboat

This module is a component of the Avatax Integration with odoo app. Please refer to the corresponding documentation.

Table of contents

@@ -401,11 +402,11 @@

Usage

Compute Taxes with AvaTax

    -
  • The module will calculate tax when the sales order is confirmed, or -by navigating to Action >> Update taxes with Avatax. At this step, -the sales order will retrieve the tax amount from Avalara but will -not report the transaction to the AvaTax dashboard. Only invoice, -refund, and payment activity are reported to the dashboard.
  • +
  • The module will calculate tax when the sales order is confirmed, or by +navigating to Action >> Update taxes with Avatax. At this step, the +sales order will retrieve the tax amount from Avalara but will not +report the transaction to the AvaTax dashboard. Only invoice, refund, +and payment activity are reported to the dashboard.
  • The module will check if there is a selected warehouse and will automatically determine the address of the warehouse and the origin location. If no address is assigned to the warehouse the module will @@ -423,13 +424,12 @@

    Usage

    exemption certificates to claim for exemption application, and this may not be the case for all Companies.
  • If the customer is tax exempt, in the “Avatax” tab, check the “Is Tax -Exempt” checkbox. When checked, the exemption details can be -provided. The Exemption Code is the type of exemption, and the -Exemption Number is an identification number to use on the customer’s -State.
  • +Exempt” checkbox. When checked, the exemption details can be provided. +The Exemption Code is the type of exemption, and the Exemption Number +is an identification number to use on the customer’s State.
  • This exemption status will only be applied for delivery addresses in the State matching the State of the exemption address. The same -customer can have exemptiions on several states. For this use +customer can have exemptions on several states. For this use additional Contact/Addresses for those states, and enter the exempention details there.
  • To make this data management simpler, is it possible to set the @@ -444,7 +444,7 @@

    Bug Tracker

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    @@ -479,18 +479,26 @@

    Contributors

  • Atchuthan Ubendran
+
  • Kencove (https://kencove.com) +
  • Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    Current maintainer:

    dreispt

    -

    This module is part of the OCA/account-fiscal-rule project on GitHub.

    +

    This module is part of the OCA/account-fiscal-rule project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/account_avatax_sale_oca/tests/__init__.py b/account_avatax_sale_oca/tests/__init__.py new file mode 100644 index 000000000..6f699d0d8 --- /dev/null +++ b/account_avatax_sale_oca/tests/__init__.py @@ -0,0 +1 @@ +from . import test_sale_order diff --git a/account_avatax_sale_oca/tests/test_sale_order.py b/account_avatax_sale_oca/tests/test_sale_order.py new file mode 100644 index 000000000..83ab6375f --- /dev/null +++ b/account_avatax_sale_oca/tests/test_sale_order.py @@ -0,0 +1,129 @@ +# Copyright 2025 Kencove, Open Source Integrators +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +import logging + +from odoo.tests.common import tagged + +from odoo.addons.account_avatax_oca.tests.common import TestAvataxCommon + +_logger = logging.getLogger(__name__) + + +@tagged("-at_install", "post_install") +class TestAvataxSaleOrder(TestAvataxCommon): + @classmethod + def setUpClass(cls): + res = super().setUpClass() + + cls.company = cls.env.user.company_id + cls.company.write( + { + "street": "255 Executive Park Blvd", + "city": "San Francisco", + "state_id": cls.env.ref("base.state_us_5").id, + "country_id": cls.env.ref("base.us").id, + "zip": "94134", + } + ) + + cls.product_A = cls.env["product.product"].create( + { + "name": "Product A", + "list_price": 100, + "sale_ok": True, + } + ) + + cls.product_B = cls.env["product.product"].create( + { + "name": "Product B", + "list_price": 5, + "sale_ok": True, + } + ) + + # Create exemption + cls.exemption = cls.env["exemption.code"].create( + { + "name": "RESALE", + "code": "1234", + } + ) + + cls.company2 = cls.env["res.company"].create( + { + "name": "Test Avatax Company", + "currency_id": cls.env.ref("base.USD").id, + "street": "266 Executive Park Blvd", + "city": "San Francisco", + "state_id": cls.env.ref("base.state_us_5").id, + "country_id": cls.env.ref("base.us").id, + "zip": "94134", + } + ) + + cls.partner_exempt = cls.env["res.partner"].create( + { + "name": "Tax Exempt Partner", + "is_company": True, + "street": "2288 Market St", + "city": "San Francisco", + "state_id": cls.env.ref("base.state_us_5").id, + "country_id": cls.env.ref("base.us").id, + "zip": "94114", + "property_account_position_id": cls.fp_avatax.id, + "property_tax_exempt": True, + "property_exemption_number": "1234", + "property_exemption_code_id": cls.exemption.id, + } + ) + + # Create sale order + cls.order = cls.env["sale.order"].create( + { + "company_id": cls.company.id, + "partner_id": cls.partner_exempt.id, + } + ) + cls.uom_unit = cls.env.ref("uom.product_uom_unit") + cls.order.write( + { + "order_line": [ + ( + 0, + False, + { + "product_id": cls.product_A.id, + "name": "1 Product A", + "product_uom": cls.uom_unit.id, + "product_uom_qty": 1.0, + }, + ), + ( + 0, + False, + { + "product_id": cls.product_B.id, + "name": "2 Product B", + "product_uom": cls.uom_unit.id, + "product_uom_qty": 1.0, + }, + ), + ] + } + ) + + return res + + def test__compute_onchange_exemption(self): + self.assertEqual(self.order.exemption_code, "1234") + self.assertTrue(self.order.exemption_code_id) + # code and number are none for not configured avatax company + self.order.company_id = self.company2.id + self.assertFalse(self.order.exemption_code) + self.assertFalse(self.order.exemption_code_id) + # code and number are computed for configured avatax company + self.order.company_id = self.company.id + self.assertEqual(self.order.exemption_code, "1234") + self.assertTrue(self.order.exemption_code_id) diff --git a/account_avatax_sale_oca/views/avalara_salestax_view.xml b/account_avatax_sale_oca/views/avalara_salestax_view.xml index 988322348..2724c646f 100644 --- a/account_avatax_sale_oca/views/avalara_salestax_view.xml +++ b/account_avatax_sale_oca/views/avalara_salestax_view.xml @@ -4,7 +4,6 @@ avalara.salestax -
    @@ -31,7 +30,6 @@
    -
    diff --git a/account_avatax_sale_oca/views/sale_order_view.xml b/account_avatax_sale_oca/views/sale_order_view.xml index bff7c1dd6..cbc213042 100644 --- a/account_avatax_sale_oca/views/sale_order_view.xml +++ b/account_avatax_sale_oca/views/sale_order_view.xml @@ -63,7 +63,7 @@ - +