Skip to content

Commit

Permalink
[16.0][MIG] account_avatax_repair_oca: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kobros-tech committed Dec 7, 2024
1 parent 3bb05d9 commit 2b1aeb1
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 268 deletions.
15 changes: 9 additions & 6 deletions account_avatax_repair_oca/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Avalara Avatax Certified Connector for Repair Orders
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2416d2c62ed385c5f83423a256cb672d4377b35ee302007dc735f048f4a756ea
!! source digest: sha256:b77119abe2120c5449e396ea149383fa7c8586365fa2e384be2ebd929f302b40
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -17,13 +17,13 @@ Avalara Avatax Certified Connector for Repair 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/14.0/account_avatax_repair_oca
:target: https://github.com/OCA/account-fiscal-rule/tree/16.0/account_avatax_repair_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-14-0/account-fiscal-rule-14-0-account_avatax_repair_oca
:target: https://translation.odoo-community.org/projects/account-fiscal-rule-16-0/account-fiscal-rule-16-0-account_avatax_repair_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=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-fiscal-rule&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -104,7 +104,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-fiscal-rule/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 <https://github.com/OCA/account-fiscal-rule/issues/new?body=module:%20account_avatax_repair_oca%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-fiscal-rule/issues/new?body=module:%20account_avatax_repair_oca%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand All @@ -123,6 +123,9 @@ Contributors
* ForgeFlow (https://www.forgeflow.com)

* Alex Paris
* Kencove (https://www.kencove.com)

* Mohamed Alkobrosli

Maintainers
~~~~~~~~~~~
Expand All @@ -137,6 +140,6 @@ 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.

This module is part of the `OCA/account-fiscal-rule <https://github.com/OCA/account-fiscal-rule/tree/14.0/account_avatax_repair_oca>`_ project on GitHub.
This module is part of the `OCA/account-fiscal-rule <https://github.com/OCA/account-fiscal-rule/tree/16.0/account_avatax_repair_oca>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion account_avatax_repair_oca/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Avalara Avatax Certified Connector for Repair Orders",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"summary": "Repair Orders with automatic Tax application using Avatax",
"license": "AGPL-3",
Expand Down
228 changes: 0 additions & 228 deletions account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot

This file was deleted.

7 changes: 3 additions & 4 deletions account_avatax_repair_oca/models/repair_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _avatax_prepare_line(self, sign=1, doc_type=None):
}
return res

Check warning on line 46 in account_avatax_repair_oca/models/repair_fee.py

View check run for this annotation

Codecov / codecov/patch

account_avatax_repair_oca/models/repair_fee.py#L46

Added line #L46 was not covered by tests

@api.onchange("product_uom_qty", "discount", "price_unit", "tax_id")
@api.onchange("product_uom_qty", "price_unit", "tax_id")
def onchange_reset_avatax_amount(self):
"""
When changing quantities or prices, reset the Avatax computed amount.
Expand All @@ -56,9 +56,7 @@ def onchange_reset_avatax_amount(self):
line.tax_amt_avatax = 0
line.repair_id.amount_tax_avatax = 0

Check warning on line 57 in account_avatax_repair_oca/models/repair_fee.py

View check run for this annotation

Codecov / codecov/patch

account_avatax_repair_oca/models/repair_fee.py#L56-L57

Added lines #L56 - L57 were not covered by tests

@api.depends(
"product_uom_qty", "discount", "price_unit", "tax_id", "tax_amt_avatax"
)
@api.depends("product_uom_qty", "price_unit", "tax_id", "tax_amt_avatax")
def _compute_amount(self):
"""
If we have a Avatax computed amount, use it instead of the Odoo computed one
Expand All @@ -71,3 +69,4 @@ def _compute_amount(self):
"price_total": line.price_subtotal + line.tax_amt_avatax,
}
line.update(vals)
return

Check warning on line 72 in account_avatax_repair_oca/models/repair_fee.py

View check run for this annotation

Codecov / codecov/patch

account_avatax_repair_oca/models/repair_fee.py#L71-L72

Added lines #L71 - L72 were not covered by tests
7 changes: 3 additions & 4 deletions account_avatax_repair_oca/models/repair_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _avatax_prepare_line(self, sign=1, doc_type=None):
}
return res

@api.onchange("product_uom_qty", "discount", "price_unit", "tax_id")
@api.onchange("product_uom_qty", "price_unit", "tax_id")
def onchange_reset_avatax_amount(self):
"""
When changing quantities or prices, reset the Avatax computed amount.
Expand All @@ -56,9 +56,7 @@ def onchange_reset_avatax_amount(self):
line.tax_amt_avatax = 0
line.repair_id.amount_tax_avatax = 0

@api.depends(
"product_uom_qty", "discount", "price_unit", "tax_id", "tax_amt_avatax"
)
@api.depends("product_uom_qty", "price_unit", "tax_id", "tax_amt_avatax")
def _compute_amount(self):
"""
If we have a Avatax computed amount, use it instead of the Odoo computed one
Expand All @@ -71,3 +69,4 @@ def _compute_amount(self):
"price_total": line.price_subtotal + line.tax_amt_avatax,
}
line.update(vals)
return

Check warning on line 72 in account_avatax_repair_oca/models/repair_line.py

View check run for this annotation

Codecov / codecov/patch

account_avatax_repair_oca/models/repair_line.py#L71-L72

Added lines #L71 - L72 were not covered by tests
10 changes: 5 additions & 5 deletions account_avatax_repair_oca/models/repair_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Repair(models.Model):
store=True,
copy=False,
)
location_code = fields.Char("Location Code", help="Origin address location code")
location_code = fields.Char(help="Origin address location code")
calculate_tax_on_save = fields.Boolean()
avatax_request_log = fields.Text(
"Avatax API Request Log", readonly=True, copy=False
Expand Down Expand Up @@ -95,7 +95,7 @@ def _create_invoices(self, group=False):
"exemption_code_id": repair.exemption_code_id.id or False,
"exemption_locked": True,
"location_code": repair.location_code or "",
"warehouse_id": repair.location_id.get_warehouse().id or "",
"warehouse_id": repair.location_id.warehouse_id or "",
"tax_on_shipping_address": True,
"so_partner_id": repair.partner_id,
}
Expand Down Expand Up @@ -135,8 +135,8 @@ def _compute_tax_address_id(self):
def _compute_is_avatax(self):
repair = self.with_company(self.company_id)
partner_invoice = repair.partner_invoice_id or repair.partner_id
fpos = self.env["account.fiscal.position"].get_fiscal_position(
partner_invoice.id, delivery_id=repair.address_id.id
fpos = self.env["account.fiscal.position"]._get_fiscal_position(
partner_invoice, delivery=repair.address_id
)
self.is_avatax = fpos

Expand Down Expand Up @@ -165,7 +165,7 @@ def _avatax_compute_tax(self):
avatax_config = self.company_id.get_avatax_config_company()
if not avatax_config:
return False

Check warning on line 167 in account_avatax_repair_oca/models/repair_order.py

View check run for this annotation

Codecov / codecov/patch

account_avatax_repair_oca/models/repair_order.py#L167

Added line #L167 was not covered by tests
warehouse = self.location_id.get_warehouse()
warehouse = self.location_id.warehouse_id
partner = self.partner_id
if avatax_config.use_partner_invoice_id:
partner = self.partner_invoice_id
Expand Down
3 changes: 3 additions & 0 deletions account_avatax_repair_oca/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions account_avatax_repair_oca/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
* ForgeFlow (https://www.forgeflow.com)

* Alex Paris
* Kencove (https://www.kencove.com)

* Mohamed Alkobrosli
Loading

0 comments on commit 2b1aeb1

Please sign in to comment.