From f7f2bd94852c2c0d5e79d3d8f5e01898cd517736 Mon Sep 17 00:00:00 2001
From: AlexPForgeFlow
Date: Mon, 24 Jul 2023 09:51:06 +0200
Subject: [PATCH 1/4] [ADD] account_avatax_repair_oca
---
account_avatax_repair_oca/README.rst | 94 +++++
account_avatax_repair_oca/__init__.py | 1 +
account_avatax_repair_oca/__manifest__.py | 16 +
account_avatax_repair_oca/models/__init__.py | 6 +
.../models/account_move.py | 17 +
.../models/avalara_salestax.py | 21 ++
account_avatax_repair_oca/models/partner.py | 27 ++
.../models/repair_fee.py | 73 ++++
.../models/repair_line.py | 73 ++++
.../models/repair_order.py | 333 +++++++++++++++++
.../readme/CONTRIBUTORS.rst | 4 +
.../readme/DESCRIPTION.rst | 2 +
account_avatax_repair_oca/readme/USAGE.rst | 58 +++
account_avatax_repair_oca/tests/__init__.py | 1 +
.../tests/test_repair_order.py | 340 ++++++++++++++++++
.../views/avalara_salestax_view.xml | 15 +
.../views/partner_view.xml | 18 +
.../views/repair_order_view.xml | 73 ++++
18 files changed, 1172 insertions(+)
create mode 100644 account_avatax_repair_oca/README.rst
create mode 100644 account_avatax_repair_oca/__init__.py
create mode 100644 account_avatax_repair_oca/__manifest__.py
create mode 100644 account_avatax_repair_oca/models/__init__.py
create mode 100644 account_avatax_repair_oca/models/account_move.py
create mode 100644 account_avatax_repair_oca/models/avalara_salestax.py
create mode 100644 account_avatax_repair_oca/models/partner.py
create mode 100644 account_avatax_repair_oca/models/repair_fee.py
create mode 100644 account_avatax_repair_oca/models/repair_line.py
create mode 100644 account_avatax_repair_oca/models/repair_order.py
create mode 100644 account_avatax_repair_oca/readme/CONTRIBUTORS.rst
create mode 100644 account_avatax_repair_oca/readme/DESCRIPTION.rst
create mode 100644 account_avatax_repair_oca/readme/USAGE.rst
create mode 100644 account_avatax_repair_oca/tests/__init__.py
create mode 100644 account_avatax_repair_oca/tests/test_repair_order.py
create mode 100644 account_avatax_repair_oca/views/avalara_salestax_view.xml
create mode 100644 account_avatax_repair_oca/views/partner_view.xml
create mode 100644 account_avatax_repair_oca/views/repair_order_view.xml
diff --git a/account_avatax_repair_oca/README.rst b/account_avatax_repair_oca/README.rst
new file mode 100644
index 000000000..13c2d44b2
--- /dev/null
+++ b/account_avatax_repair_oca/README.rst
@@ -0,0 +1,94 @@
+=====================================================
+Avalara Avatax Certified Connector for Repairs Orders
+=====================================================
+
+.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
+ :alt: License: AGPL-3
+
+
+|badge2|
+
+This module is a component of the Avatax Integration with odoo app.
+Please refer to the corresponding documentation.
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Usage
+=====
+
+The AvaTax module is integrated into Repair Orders and allows computation of taxes.
+Repairs order transactions do not appear in the in the AvaTax interface.
+
+The information placed in the repair order will automatically pass to the invoice
+on the Avalara server and can be viewed in the AvaTax control panel.
+
+Create New Repair Order
+
+- Navigate to: Repairs
+
+- Click Create button
+
+Compute Taxes with AvaTax
+
+- The module will calculate tax when the repair order is confirmed,
+ when the changes made to a repair order are saved, by navigating to Compute Taxes
+ or by navigating to Action >> Update taxes with Avatax.
+ At this step, the repair 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 repair 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 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.
+
+Credits
+=======
+
+Authors
+~~~~~~~
+
+* ForgeFlow
+
+Contributors
+~~~~~~~~~~~~
+
+
+* ForgeFlow (https://www.forgeflow.com)
+
+ * Alex Paris
diff --git a/account_avatax_repair_oca/__init__.py b/account_avatax_repair_oca/__init__.py
new file mode 100644
index 000000000..0650744f6
--- /dev/null
+++ b/account_avatax_repair_oca/__init__.py
@@ -0,0 +1 @@
+from . import models
diff --git a/account_avatax_repair_oca/__manifest__.py b/account_avatax_repair_oca/__manifest__.py
new file mode 100644
index 000000000..b727f03fd
--- /dev/null
+++ b/account_avatax_repair_oca/__manifest__.py
@@ -0,0 +1,16 @@
+{
+ "name": "Avalara Avatax Certified Connector for Repair Orders",
+ "version": "14.0.1.0.0",
+ "author": "ForgeFlow, Odoo Community Association (OCA)",
+ "summary": "Repair Orders with automatic Tax application using Avatax",
+ "license": "AGPL-3",
+ "category": "Inventory",
+ "website": "https://github.com/OCA/account-fiscal-rule",
+ "depends": ["account_avatax_oca", "repair"],
+ "data": [
+ "views/repair_order_view.xml",
+ "views/avalara_salestax_view.xml",
+ "views/partner_view.xml",
+ ],
+ "auto_install": True,
+}
diff --git a/account_avatax_repair_oca/models/__init__.py b/account_avatax_repair_oca/models/__init__.py
new file mode 100644
index 000000000..940b4f073
--- /dev/null
+++ b/account_avatax_repair_oca/models/__init__.py
@@ -0,0 +1,6 @@
+from . import account_move
+from . import partner
+from . import repair_order
+from . import repair_fee
+from . import repair_line
+from . import avalara_salestax
diff --git a/account_avatax_repair_oca/models/account_move.py b/account_avatax_repair_oca/models/account_move.py
new file mode 100644
index 000000000..d8319eebc
--- /dev/null
+++ b/account_avatax_repair_oca/models/account_move.py
@@ -0,0 +1,17 @@
+from odoo import api, models
+
+
+class AccountMove(models.Model):
+ _inherit = "account.move"
+
+ @api.onchange("partner_id")
+ def _onchange_partner_id(self):
+ res = super(AccountMove, self)._onchange_partner_id()
+ self._onchange_partner_shipping_id()
+ return res
+
+ @api.onchange("partner_shipping_id")
+ def _onchange_partner_shipping_id(self):
+ res = super(AccountMove, self)._onchange_partner_shipping_id()
+ self.tax_on_shipping_address = bool(self.partner_shipping_id)
+ return res
diff --git a/account_avatax_repair_oca/models/avalara_salestax.py b/account_avatax_repair_oca/models/avalara_salestax.py
new file mode 100644
index 000000000..3f03386d9
--- /dev/null
+++ b/account_avatax_repair_oca/models/avalara_salestax.py
@@ -0,0 +1,21 @@
+from odoo import fields, models
+
+
+class AvalaraSalestax(models.Model):
+ _inherit = "avalara.salestax"
+
+ use_partner_invoice_id = fields.Boolean(
+ "Use Invoice partner's customer code in SO",
+ default=True,
+ help="Use Sales Order's Invoice Address field to determine Taxable" "Status",
+ )
+ repair_calculate_tax = fields.Boolean(
+ "Auto Calculate Tax on Repair Save",
+ help="Automatically triggers API to calculate tax If changes made on"
+ "SO's warehouse_id, tax_on_shipping_address, "
+ "SO line's price_unit, discount, product_uom_qty",
+ )
+ override_line_taxes = fields.Boolean(
+ help="When checked, the Avatax computed tax will replace any other taxes"
+ " that may exist in the document line.",
+ )
diff --git a/account_avatax_repair_oca/models/partner.py b/account_avatax_repair_oca/models/partner.py
new file mode 100644
index 000000000..b698fbe93
--- /dev/null
+++ b/account_avatax_repair_oca/models/partner.py
@@ -0,0 +1,27 @@
+from odoo import _, api, fields, models
+
+
+class ResPartner(models.Model):
+ _inherit = "res.partner"
+
+ @api.onchange("property_exemption_country_wide")
+ def _onchange_property_exemption_contry_wide(self):
+ if self.property_exemption_country_wide:
+ message = (
+ _(
+ "Enabling the exemption status for all states"
+ " may have tax compliance risks,"
+ " and should be carefully considered.\n\n"
+ " Please ensure that your tax advisor was consulted and the"
+ " necessary tax exemption documentation was obtained"
+ " for every state this Partner may have transactions."
+ ),
+ )
+ return {"warning": {"title": _("Tax Compliance Risk"), "message": message}}
+
+ property_exemption_country_wide = fields.Boolean(
+ "Exemption Applies Country Wide",
+ help="When enabled, the delivery address State is irrelevant"
+ " when looking up the exemption status, meaning that the exemption"
+ " is considered applicable for all states",
+ )
diff --git a/account_avatax_repair_oca/models/repair_fee.py b/account_avatax_repair_oca/models/repair_fee.py
new file mode 100644
index 000000000..c830a5a07
--- /dev/null
+++ b/account_avatax_repair_oca/models/repair_fee.py
@@ -0,0 +1,73 @@
+from odoo import api, fields, models
+
+
+class RepairFee(models.Model):
+ _inherit = "repair.fee"
+
+ tax_amt_avatax = fields.Monetary(string="AvaTax")
+
+ @api.depends("tax_amt_avatax")
+ def _compute_price_total(self):
+ res = super()._compute_price_total()
+ for fee in self:
+ fee.price_total = fee.price_subtotal + fee.tax_amt_avatax
+ return res
+
+ def _avatax_prepare_line(self, sign=1, doc_type=None):
+ """
+ Prepare a line to use for Avatax computation.
+ Returns a dict
+ """
+ line = self
+ res = {}
+ # Add UPC to product item code
+ avatax_config = line.company_id.get_avatax_config_company()
+ product = line.product_id
+ if product.barcode and avatax_config.upc_enable:
+ item_code = "UPC:%d" % product.barcode
+ else:
+ item_code = product.default_code or ("ID:%d" % product.id)
+ tax_code = line.product_id.applicable_tax_code_id.name
+ amount = sign * line.price_unit * line.product_uom_qty
+ # Calculate discount amount
+ discount_amount = 0.0
+ is_discounted = False
+ res = {
+ "qty": line.product_uom_qty,
+ "itemcode": item_code,
+ "description": line.name,
+ "discounted": is_discounted,
+ "discount": discount_amount,
+ "amount": amount,
+ "tax_code": tax_code,
+ "id": line,
+ "tax_id": line.tax_id,
+ }
+ return res
+
+ @api.onchange("product_uom_qty", "discount", "price_unit", "tax_id")
+ def onchange_reset_avatax_amount(self):
+ """
+ When changing quantities or prices, reset the Avatax computed amount.
+ The Odoo computed tax amount will then be shown, as a reference.
+ The Avatax amount will be recomputed upon document validation.
+ """
+ for line in 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"
+ )
+ def _compute_amount(self):
+ """
+ If we have a Avatax computed amount, use it instead of the Odoo computed one
+ """
+ super()._compute_amount()
+ for line in self:
+ if line.tax_amt_avatax: # Has Avatax computed amount
+ vals = {
+ "price_tax": line.tax_amt_avatax,
+ "price_total": line.price_subtotal + line.tax_amt_avatax,
+ }
+ line.update(vals)
diff --git a/account_avatax_repair_oca/models/repair_line.py b/account_avatax_repair_oca/models/repair_line.py
new file mode 100644
index 000000000..61ce3b409
--- /dev/null
+++ b/account_avatax_repair_oca/models/repair_line.py
@@ -0,0 +1,73 @@
+from odoo import api, fields, models
+
+
+class RepairLine(models.Model):
+ _inherit = "repair.line"
+
+ tax_amt_avatax = fields.Monetary(string="AvaTax")
+
+ @api.depends("tax_amt_avatax")
+ def _compute_price_total(self):
+ res = super()._compute_price_total()
+ for line in self:
+ line.price_total = line.price_subtotal + line.tax_amt_avatax
+ return res
+
+ def _avatax_prepare_line(self, sign=1, doc_type=None):
+ """
+ Prepare a line to use for Avatax computation.
+ Returns a dict
+ """
+ line = self
+ res = {}
+ # Add UPC to product item code
+ avatax_config = line.company_id.get_avatax_config_company()
+ product = line.product_id
+ if product.barcode and avatax_config.upc_enable:
+ item_code = "UPC:%d" % product.barcode
+ else:
+ item_code = product.default_code or ("ID:%d" % product.id)
+ tax_code = line.product_id.applicable_tax_code_id.name
+ amount = sign * line.price_unit * line.product_uom_qty
+ # Calculate discount amount
+ discount_amount = 0.0
+ is_discounted = False
+ res = {
+ "qty": line.product_uom_qty,
+ "itemcode": item_code,
+ "description": line.name,
+ "discounted": is_discounted,
+ "discount": discount_amount,
+ "amount": amount,
+ "tax_code": tax_code,
+ "id": line,
+ "tax_id": line.tax_id,
+ }
+ return res
+
+ @api.onchange("product_uom_qty", "discount", "price_unit", "tax_id")
+ def onchange_reset_avatax_amount(self):
+ """
+ When changing quantities or prices, reset the Avatax computed amount.
+ The Odoo computed tax amount will then be shown, as a reference.
+ The Avatax amount will be recomputed upon document validation.
+ """
+ for line in 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"
+ )
+ def _compute_amount(self):
+ """
+ If we have a Avatax computed amount, use it instead of the Odoo computed one
+ """
+ super()._compute_amount()
+ for line in self:
+ if line.tax_amt_avatax: # Has Avatax computed amount
+ vals = {
+ "price_tax": line.tax_amt_avatax,
+ "price_total": line.price_subtotal + line.tax_amt_avatax,
+ }
+ line.update(vals)
diff --git a/account_avatax_repair_oca/models/repair_order.py b/account_avatax_repair_oca/models/repair_order.py
new file mode 100644
index 000000000..dfa5113fc
--- /dev/null
+++ b/account_avatax_repair_oca/models/repair_order.py
@@ -0,0 +1,333 @@
+from odoo import api, fields, models
+
+
+class Repair(models.Model):
+ _inherit = "repair.order"
+
+ amount_tax_avatax = fields.Monetary(string="AvaTax")
+
+ hide_exemption = fields.Boolean(
+ "Hide Exemption & Tax Based on shipping address",
+ compute="_compute_hide_exemption",
+ default=lambda self: self.env.company.get_avatax_config_company,
+ help="Uncheck the this field to show exemption fields on SO/Invoice form view. "
+ "Also, it will show Tax based on shipping address button",
+ )
+
+ is_avatax = fields.Boolean(compute="_compute_is_avatax")
+ exemption_code = fields.Char(
+ "Exemption Number",
+ compute="_compute_onchange_exemption",
+ readonly=False, # New computed writeable fields
+ store=True,
+ help="It show the customer exemption number",
+ copy=False,
+ )
+ exemption_code_id = fields.Many2one(
+ "exemption.code",
+ "Exemption Code",
+ compute="_compute_onchange_exemption",
+ readonly=False, # New computed writeable fields
+ store=True,
+ help="It show the customer exemption code",
+ copy=False,
+ )
+ tax_address_id = fields.Many2one(
+ "res.partner",
+ "Tax Address",
+ readonly=True,
+ states={"draft": [("readonly", False)]},
+ compute="_compute_tax_address_id",
+ store=True,
+ copy=False,
+ )
+ location_code = fields.Char("Location Code", help="Origin address location code")
+ calculate_tax_on_save = fields.Boolean()
+ avatax_request_log = fields.Text(
+ "Avatax API Request Log", readonly=True, copy=False
+ )
+ avatax_response_log = fields.Text(
+ "Avatax API Response Log", readonly=True, copy=False
+ )
+
+ @api.model
+ @api.depends("company_id", "partner_id", "partner_invoice_id", "state")
+ def _compute_hide_exemption(self):
+ avatax_config = self.env.company.get_avatax_config_company()
+ for order in self:
+ order.hide_exemption = avatax_config.hide_exemption
+
+ @api.depends("partner_invoice_id", "tax_address_id", "company_id")
+ def _compute_onchange_exemption(self):
+ for repair in self.filtered(lambda x: x.state not in ["done", "cancel"]):
+ invoice_partner = repair.partner_invoice_id.commercial_partner_id
+ ship_to_address = repair.tax_address_id
+ # Find an exemption address matching the Country + State
+ # of the Delivery address
+ exemption_addresses = (
+ invoice_partner | invoice_partner.child_ids
+ ).filtered("property_tax_exempt")
+ exemption_address_naive = exemption_addresses.filtered(
+ lambda a: a.country_id == ship_to_address.country_id
+ and (
+ a.state_id == ship_to_address.state_id
+ or invoice_partner.property_exemption_country_wide
+ )
+ )[:1]
+ # Force Company to get the correct values form the Property fields
+ exemption_address = exemption_address_naive.with_company(
+ repair.company_id.id
+ )
+ repair.exemption_code = exemption_address.property_exemption_number
+ repair.exemption_code_id = exemption_address.property_exemption_code_id
+
+ def _create_invoices(self, group=False):
+ res = super(Repair, self)._create_invoices(group)
+ for repair_id in res:
+ if repair_id not in res:
+ continue
+ repair = self.env["repair.order"].browse(repair_id)
+ invoice = self.env["account.move"].browse(res[repair_id])
+
+ invoice.write(
+ {
+ "exemption_code": repair.exemption_code or "",
+ "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 "",
+ "tax_on_shipping_address": True,
+ "so_partner_id": repair.partner_id,
+ }
+ )
+ return res
+
+ @api.onchange("operations", "fees_lines")
+ def onchange_reset_avatax_amount(self):
+ """
+ When changing quantities or prices, reset the Avatax computed amount.
+ The Odoo computed tax amount will then be shown, as a reference.
+ The Avatax amount will be recomputed upon document validation.
+ """
+ for repair in self:
+ repair.amount_tax_avatax = 0
+ repair.operations.write({"tax_amt_avatax": 0})
+ repair.fees_lines.write({"tax_amt_avatax": 0})
+
+ @api.depends("amount_tax_avatax")
+ def _amount_tax(self):
+ res = super()._amount_tax()
+ for order in self:
+ if order.amount_tax_avatax:
+ order.update(
+ {
+ "amount_tax": order.amount_tax_avatax,
+ }
+ )
+ return res
+
+ @api.depends("partner_id")
+ def _compute_tax_address_id(self):
+ for repair in self:
+ repair.tax_address_id = repair.partner_id
+
+ @api.depends("partner_invoice_id", "partner_id", "address_id")
+ 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
+ )
+ self.is_avatax = fpos
+
+ def _get_avatax_doc_type(self, commit=False):
+ return "SalesOrder"
+
+ def _avatax_prepare_lines(self, operations, fees_lines, doc_type=None):
+ """
+ Prepare the lines to use for Avatax computation.
+ Returns a list of dicts
+ """
+ lines = [
+ line._avatax_prepare_line(sign=1, doc_type=doc_type) for line in operations
+ ]
+ lines2 = [
+ line._avatax_prepare_line(sign=1, doc_type=doc_type) for line in fees_lines
+ ]
+ lines.extend(lines2)
+ return [x for x in lines if x]
+
+ def _avatax_compute_tax(self):
+ """Contact REST API and recompute taxes for a Sale Order"""
+ self and self.ensure_one()
+ doc_type = self._get_avatax_doc_type()
+ Tax = self.env["account.tax"]
+ avatax_config = self.company_id.get_avatax_config_company()
+ if not avatax_config:
+ return False
+ warehouse = self.location_id.get_warehouse()
+ partner = self.partner_id
+ if avatax_config.use_partner_invoice_id:
+ partner = self.partner_invoice_id
+ taxable_lines = self._avatax_prepare_lines(self.operations, self.fees_lines)
+ if taxable_lines:
+ tax_result = avatax_config.create_transaction(
+ fields.Date.today(),
+ self.name,
+ doc_type,
+ partner,
+ warehouse.partner_id or self.company_id.partner_id,
+ self.tax_address_id or self.partner_id,
+ taxable_lines,
+ self.user_id,
+ self.exemption_code or None,
+ self.exemption_code_id.code or None,
+ currency_id=self.currency_id,
+ log_to_record=self,
+ )
+ tax_result_lines = {int(x["lineNumber"]): x for x in tax_result["lines"]}
+ for line in self.operations:
+ external_line_identifier = self.env.context.get(
+ "lineNumber", False
+ ) # Used in tests
+ line_id = external_line_identifier or line.id
+ tax_result_line = tax_result_lines.get(line_id)
+ if tax_result_line:
+ # Should we check the rate with the tax amount?
+ # tax_amount = tax_result_line["taxCalculated"]
+ # rate = round(tax_amount / line.price_subtotal * 100, 2)
+ rate = tax_result_line["rate"]
+ tax = Tax.get_avalara_tax(rate, doc_type)
+ if tax not in line.tax_id:
+ line_taxes = (
+ tax
+ if avatax_config.override_line_taxes
+ else tax | line.tax_id.filtered(lambda x: not x.is_avatax)
+ )
+ line.tax_id = line_taxes
+ line.tax_amt_avatax = tax_result_line["tax"]
+
+ for line in self.fees_lines:
+ tax_result_line = tax_result_lines.get(line.id)
+ if tax_result_line:
+ # Should we check the rate with the tax amount?
+ # tax_amount = tax_result_line["taxCalculated"]
+ # rate = round(tax_amount / line.price_subtotal * 100, 2)
+ rate = tax_result_line["rate"]
+ tax = Tax.get_avalara_tax(rate, doc_type)
+ if tax not in line.tax_id:
+ line_taxes = (
+ tax
+ if avatax_config.override_line_taxes
+ else tax | line.tax_id.filtered(lambda x: not x.is_avatax)
+ )
+ line.tax_id = line_taxes
+ line.tax_amt_avatax = tax_result_line["tax"]
+
+ self.amount_tax_avatax = tax_result.get("totalTax")
+ return True
+
+ def avalara_compute_taxes(self):
+ """
+ Use Avatax API to compute taxes.
+ Sets the Taxes on each line, and lets odoo perfomr teh calculations.
+ """
+ for repair in self:
+ if repair.is_avatax:
+ repair._avatax_compute_tax()
+ return True
+
+ def action_repair_confirm(self):
+ avatax_config = self.company_id.get_avatax_config_company()
+ if avatax_config and avatax_config.force_address_validation:
+ addr = self.tax_address_id
+ if not addr.date_validation:
+ # The Confirm action will be interrupted
+ # if the address is not validated
+ return addr.button_avatax_validate_address()
+ if avatax_config:
+ self.avalara_compute_taxes()
+ res = super(Repair, self).action_repair_confirm()
+ return res
+
+ @api.onchange(
+ "operations",
+ "fees_lines",
+ "tax_address_id",
+ "partner_id",
+ )
+ def onchange_avatax_calculation(self):
+ avatax_config = self.env.company.get_avatax_config_company()
+ self.calculate_tax_on_save = False
+ if avatax_config.repair_calculate_tax:
+ if (
+ self._origin.tax_address_id.street != self.tax_address_id.street
+ or self._origin.partner_id != self.partner_id
+ ):
+ self.calculate_tax_on_save = True
+ return
+ for line in self.operations:
+ if (
+ line._origin.product_uom_qty != line.product_uom_qty
+ or line._origin.price_unit != line.price_unit
+ ):
+ self.calculate_tax_on_save = True
+ break
+ for line2 in self.fees_lines:
+ if (
+ line2._origin.product_uom_qty != line2.product_uom_qty
+ or line2._origin.price_unit != line2.price_unit
+ ):
+ self.calculate_tax_on_save = True
+ break
+
+ @api.model
+ def create(self, vals):
+ record = super(Repair, self).create(vals)
+ avatax_config = self.env.company.get_avatax_config_company()
+ if (
+ avatax_config.repair_calculate_tax
+ and record.calculate_tax_on_save
+ and not self._context.get("skip_second_write", False)
+ ):
+ record.with_context(skip_second_write=True).write(
+ {
+ "calculate_tax_on_save": False,
+ }
+ )
+ record.avalara_compute_taxes()
+ return record
+
+ def write(self, vals):
+ result = super(Repair, self).write(vals)
+ avatax_config = self.env.company.get_avatax_config_company()
+ for record in self:
+ if (
+ avatax_config.repair_calculate_tax
+ and record.calculate_tax_on_save
+ and record.state != "done"
+ and not self._context.get("skip_second_write", False)
+ ):
+ record.with_context(skip_second_write=True).write(
+ {
+ "calculate_tax_on_save": False,
+ }
+ )
+ record.avalara_compute_taxes()
+ return result
+
+ def copy(self, default=None):
+ repair = super().copy(default)
+ avatax_config = self.env.company.get_avatax_config_company()
+ if (
+ avatax_config.repair_calculate_tax
+ and repair.state != "done"
+ and not self._context.get("skip_second_write", False)
+ ):
+ repair.with_context(skip_second_write=True).write(
+ {
+ "calculate_tax_on_save": False,
+ }
+ )
+ repair.avalara_compute_taxes()
+ return repair
diff --git a/account_avatax_repair_oca/readme/CONTRIBUTORS.rst b/account_avatax_repair_oca/readme/CONTRIBUTORS.rst
new file mode 100644
index 000000000..4a2b38303
--- /dev/null
+++ b/account_avatax_repair_oca/readme/CONTRIBUTORS.rst
@@ -0,0 +1,4 @@
+
+* ForgeFlow (https://www.forgeflow.com)
+
+ * Alex Paris
diff --git a/account_avatax_repair_oca/readme/DESCRIPTION.rst b/account_avatax_repair_oca/readme/DESCRIPTION.rst
new file mode 100644
index 000000000..b9f7adc12
--- /dev/null
+++ b/account_avatax_repair_oca/readme/DESCRIPTION.rst
@@ -0,0 +1,2 @@
+This module is a component of the Avatax Integration with odoo app.
+Please refer to the corresponding documentation.
diff --git a/account_avatax_repair_oca/readme/USAGE.rst b/account_avatax_repair_oca/readme/USAGE.rst
new file mode 100644
index 000000000..c93fa9211
--- /dev/null
+++ b/account_avatax_repair_oca/readme/USAGE.rst
@@ -0,0 +1,58 @@
+The AvaTax module is integrated into Repair Orders and allows computation of taxes.
+Repairs order transactions do not appear in the in the AvaTax interface.
+
+The information placed in the repair order will automatically pass to the invoice
+on the Avalara server and can be viewed in the AvaTax control panel.
+
+They will be reported as a net deduction on the line item cost.
+
+Create New Repair Order
+
+- Navigate to: Repairs
+
+- Click Create button
+
+Compute Taxes with AvaTax
+
+- The module will calculate tax when the repair order is confirmed,
+ when the changes made to a repair order are saved, by navigating to Compute Taxes
+ or by navigating to Action >> Update taxes with Avatax.
+ At this step, the repair 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 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.
diff --git a/account_avatax_repair_oca/tests/__init__.py b/account_avatax_repair_oca/tests/__init__.py
new file mode 100644
index 000000000..bf6f8ef58
--- /dev/null
+++ b/account_avatax_repair_oca/tests/__init__.py
@@ -0,0 +1 @@
+from . import test_repair_order
diff --git a/account_avatax_repair_oca/tests/test_repair_order.py b/account_avatax_repair_oca/tests/test_repair_order.py
new file mode 100644
index 000000000..4f08128b6
--- /dev/null
+++ b/account_avatax_repair_oca/tests/test_repair_order.py
@@ -0,0 +1,340 @@
+import mock
+
+from odoo.tests import Form, tagged
+
+from odoo.addons.account.tests.common import AccountTestInvoicingCommon
+from odoo.addons.account_avatax_oca.models.avatax_rest_api import AvaTaxRESTService
+
+
+@tagged("post_install", "-at_install")
+class TestRepair(AccountTestInvoicingCommon):
+ @classmethod
+ def setUpClass(cls, chart_template_ref=None):
+ super().setUpClass(chart_template_ref=chart_template_ref)
+
+ # AvaTaxRESTService
+ cls.avatax = cls.env["avalara.salestax"].create(
+ {
+ "account_number": "1234",
+ "license_key": "1234",
+ "service_url": "https://rest.avatax.com/api/v2",
+ "company_code": "PA2",
+ "logging": True,
+ "use_so_partner_id": True,
+ "invoice_calculate_tax": True,
+ "repair_calculate_tax": True,
+ "disable_tax_calculation": False,
+ "company_id": cls.env.company.id,
+ }
+ )
+ cls.tax = cls.env["account.tax"].create(
+ {
+ "name": "AVATAX-TEST",
+ "amount_type": "percent",
+ "type_tax_use": "sale",
+ "is_avatax": True,
+ "tax_group_id": cls.env.ref("account.tax_group_taxes").id,
+ "company_id": cls.env.company.id,
+ }
+ )
+ fpos = cls.env["account.fiscal.position"].create(
+ {
+ "name": "FPOS Avatax",
+ "is_avatax": True,
+ "company_id": cls.env.company.id,
+ }
+ )
+
+ # Partners
+ cls.res_partner = cls.env["res.partner"].create(
+ {
+ "name": "Repair customer",
+ "property_account_position_id": fpos.id,
+ "street": "street",
+ "zip": "1234",
+ "city": "bcn",
+ "country_id": cls.env.ref("base.us").id,
+ "property_exemption_number": "111",
+ "property_tax_exempt": True,
+ }
+ )
+
+ # Products
+ cls.product_product_3 = cls.env["product.product"].create(
+ {"name": "Desk Combination"}
+ )
+ cls.product_product_11 = cls.env["product.product"].create(
+ {"name": "Conference Chair"}
+ )
+ cls.product_product_5 = cls.env["product.product"].create({"name": "Product 5"})
+ cls.product_product_6 = cls.env["product.product"].create(
+ {"name": "Large Cabinet"}
+ )
+ cls.product_product_12 = cls.env["product.product"].create(
+ {"name": "Office Chair Black"}
+ )
+ cls.product_product_13 = cls.env["product.product"].create(
+ {"name": "Corner Desk Left Sit"}
+ )
+ cls.product_product_2 = cls.env["product.product"].create(
+ {"name": "Virtual Home Staging"}
+ )
+ cls.product_service_order_repair = cls.env["product.product"].create(
+ {
+ "name": "Repair Services",
+ "type": "service",
+ }
+ )
+ cls.env.company.partner_id.street = "street"
+
+ # Location
+ cls.stock_warehouse = cls.env["stock.warehouse"].search(
+ [("company_id", "=", cls.env.company.id)], limit=1
+ )
+ cls.stock_location_14 = cls.env["stock.location"].create(
+ {
+ "name": "Shelf 2",
+ "location_id": cls.stock_warehouse.lot_stock_id.id,
+ }
+ )
+
+ def test_00_repair(self):
+ product_to_repair = self.product_product_5
+ product_to_add = self.product_product_5
+ partner = self.res_partner
+ mock_api_call = mock.patch.object(AvaTaxRESTService, "get_tax")
+ with mock_api_call as mock_func:
+ mock_func.return_value = {
+ "id": 0,
+ "code": "invented code",
+ "companyId": 123456,
+ "date": "2023-07-21",
+ "paymentDate": "2023-07-21",
+ "status": "Temporary",
+ "type": "SalesOrder",
+ "batchCode": "",
+ "currencyCode": "USD",
+ "exchangeRateCurrencyCode": "USD",
+ "customerUsageType": "",
+ "entityUseCode": "",
+ "customerVendorCode": "1689678087-0-Cust-43",
+ "customerCode": "1689678087-0-Cust-43",
+ "exemptNo": "",
+ "reconciled": False,
+ "locationCode": "",
+ "reportingLocationCode": "",
+ "purchaseOrderNo": "",
+ "referenceCode": "",
+ "salespersonCode": "Mitchell Admin",
+ "totalAmount": 320.0,
+ "totalExempt": 0.0,
+ "totalDiscount": 0.0,
+ "totalTax": 19.52,
+ "totalTaxable": 320.0,
+ "totalTaxCalculated": 19.52,
+ "adjustmentReason": "NotAdjusted",
+ "locked": False,
+ "version": 1,
+ "exchangeRateEffectiveDate": "2023-07-21",
+ "exchangeRate": 1.0,
+ "description": "RMA/00070",
+ "modifiedDate": "2023-07-21T15:02:45.2078018Z",
+ "modifiedUserId": 1094294,
+ "taxDate": "2023-07-21",
+ "lines": [
+ {
+ "id": 0,
+ "transactionId": 0,
+ "lineNumber": "999",
+ "customerUsageType": "",
+ "entityUseCode": "",
+ "description": "[E-COM07] Large Cabinet",
+ "discountAmount": 0.0,
+ "exemptAmount": 0.0,
+ "exemptCertId": 0,
+ "exemptNo": "",
+ "isItemTaxable": True,
+ "itemCode": "E-COM07",
+ "lineAmount": 320.0,
+ "quantity": 1.0,
+ "ref1": "",
+ "ref2": "",
+ "reportingDate": "2023-07-21",
+ "tax": 19.52,
+ "taxableAmount": 320.0,
+ "taxCalculated": 19.52,
+ "taxCode": "P0000000",
+ "taxCodeId": 4316,
+ "taxDate": "2023-07-21",
+ "taxIncluded": False,
+ "details": [
+ {
+ "id": 0,
+ "transactionLineId": 0,
+ "transactionId": 0,
+ "country": "US",
+ "region": "AZ",
+ "exemptAmount": 0.0,
+ "jurisCode": "04",
+ "jurisName": "ARIZONA",
+ "stateAssignedNo": "",
+ "jurisType": "STA",
+ "jurisdictionType": "State",
+ "nonTaxableAmount": 0.0,
+ "rate": 0.056,
+ "tax": 17.92,
+ "taxableAmount": 320.0,
+ "taxType": "Sales",
+ "taxSubTypeId": "S",
+ "taxName": "AZ STATE TAX",
+ "taxAuthorityTypeId": 45,
+ "taxCalculated": 17.92,
+ "rateType": "General",
+ "rateTypeCode": "G",
+ "unitOfBasis": "PerCurrencyUnit",
+ "isNonPassThru": False,
+ "isFee": False,
+ "reportingTaxableUnits": 320.0,
+ "reportingNonTaxableUnits": 0.0,
+ "reportingExemptUnits": 0.0,
+ "reportingTax": 17.92,
+ "reportingTaxCalculated": 17.92,
+ "liabilityType": "Seller",
+ "chargedTo": "Buyer",
+ },
+ {
+ "id": 0,
+ "transactionLineId": 0,
+ "transactionId": 0,
+ "country": "US",
+ "region": "AZ",
+ "exemptAmount": 0.0,
+ "jurisCode": "019",
+ "jurisName": "PIMA",
+ "stateAssignedNo": "PMA",
+ "jurisType": "CTY",
+ "jurisdictionType": "County",
+ "nonTaxableAmount": 0.0,
+ "rate": 0.005,
+ "tax": 1.6,
+ "taxableAmount": 320.0,
+ "taxType": "Sales",
+ "taxSubTypeId": "S",
+ "taxName": "AZ COUNTY TAX",
+ "taxAuthorityTypeId": 45,
+ "taxCalculated": 1.6,
+ "rateType": "General",
+ "rateTypeCode": "G",
+ "unitOfBasis": "PerCurrencyUnit",
+ "isNonPassThru": False,
+ "isFee": False,
+ "reportingTaxableUnits": 320.0,
+ "reportingNonTaxableUnits": 0.0,
+ "reportingExemptUnits": 0.0,
+ "reportingTax": 1.6,
+ "reportingTaxCalculated": 1.6,
+ "liabilityType": "Seller",
+ "chargedTo": "Buyer",
+ },
+ ],
+ "nonPassthroughDetails": [],
+ "hsCode": "",
+ "costInsuranceFreight": 0.0,
+ "vatCode": "",
+ "vatNumberTypeId": 0,
+ "rate": 6.1,
+ }
+ ],
+ "addresses": [
+ {
+ "id": 0,
+ "transactionId": 0,
+ "boundaryLevel": "Address",
+ "line1": "13035 N TEAL BLUE TRL",
+ "line2": "",
+ "line3": "",
+ "city": "TUCSON",
+ "region": "AZ",
+ "postalCode": "85742-8879",
+ "country": "US",
+ "taxRegionId": 1234,
+ "latitude": "32.442129",
+ "longitude": "-111.033853",
+ },
+ {
+ "id": 0,
+ "transactionId": 0,
+ "boundaryLevel": "Address",
+ "line1": "250 Executive Park Blvd, Suite 3400",
+ "line2": "",
+ "line3": "",
+ "city": "San Francisco",
+ "region": "CA",
+ "postalCode": "94134",
+ "country": "US",
+ "taxRegionId": 1234,
+ "latitude": "37.71116",
+ "longitude": "-122.391717",
+ },
+ ],
+ "summary": [
+ {
+ "country": "US",
+ "region": "AZ",
+ "jurisType": "State",
+ "jurisCode": "04",
+ "jurisName": "ARIZONA",
+ "taxAuthorityType": 45,
+ "stateAssignedNo": "",
+ "taxType": "Sales",
+ "taxSubType": "S",
+ "taxName": "AZ STATE TAX",
+ "rateType": "General",
+ "taxable": 320.0,
+ "rate": 0.056,
+ "tax": 17.92,
+ "taxCalculated": 17.92,
+ "nonTaxable": 0.0,
+ "exemption": 0.0,
+ },
+ {
+ "country": "US",
+ "region": "AZ",
+ "jurisType": "County",
+ "jurisCode": "019",
+ "jurisName": "PIMA",
+ "taxAuthorityType": 45,
+ "stateAssignedNo": "PMA",
+ "taxType": "Sales",
+ "taxSubType": "S",
+ "taxName": "AZ COUNTY TAX",
+ "rateType": "General",
+ "taxable": 320.0,
+ "rate": 0.005,
+ "tax": 1.6,
+ "taxCalculated": 1.6,
+ "nonTaxable": 0.0,
+ "exemption": 0.0,
+ },
+ ],
+ }
+ with Form(
+ self.env["repair.order"].with_context(lineNumber=999)
+ ) as repair_form:
+ repair_form.name = "PC Assemble + Custom (PC on Demand)"
+ repair_form.product_id = product_to_repair
+ repair_form.partner_id = partner
+ repair_form.invoice_method = "b4repair"
+ repair_form.location_id = self.stock_warehouse.lot_stock_id
+ with repair_form.operations.new() as repair_line:
+ repair_line.product_id = product_to_add
+ repair_line.product_uom_qty = 1
+ repair = repair_form.save()
+ repair.action_repair_confirm()
+ tax = repair.operations.tax_id.filtered(lambda t: t.is_avatax)
+ self.assertEqual(tax.amount, 6.1)
+ repair.action_repair_invoice_create()
+ self.assertEqual(
+ len(repair.invoice_id), 1, "No invoice exists for this repair order"
+ )
+ self.assertEqual(repair.invoice_id.exemption_code, "111")
diff --git a/account_avatax_repair_oca/views/avalara_salestax_view.xml b/account_avatax_repair_oca/views/avalara_salestax_view.xml
new file mode 100644
index 000000000..f3ead1dc2
--- /dev/null
+++ b/account_avatax_repair_oca/views/avalara_salestax_view.xml
@@ -0,0 +1,15 @@
+
+
+
+ avalara.salestax.inherit
+ avalara.salestax
+
+
+
+
+
+
+
+
+
+
diff --git a/account_avatax_repair_oca/views/partner_view.xml b/account_avatax_repair_oca/views/partner_view.xml
new file mode 100644
index 000000000..de57645a0
--- /dev/null
+++ b/account_avatax_repair_oca/views/partner_view.xml
@@ -0,0 +1,18 @@
+
+
+ Partner Form: add Exempt Country Wide
+ res.partner
+
+
+
+
+
+
+
+
diff --git a/account_avatax_repair_oca/views/repair_order_view.xml b/account_avatax_repair_oca/views/repair_order_view.xml
new file mode 100644
index 000000000..e3f21ad59
--- /dev/null
+++ b/account_avatax_repair_oca/views/repair_order_view.xml
@@ -0,0 +1,73 @@
+
+
+ repair.order.update.form.view
+ repair.order
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Update taxes with AvaTax
+
+
+ code
+ records.avalara_compute_taxes()
+
+
From c1b7b0e46908e2a888a53b9405a9591f1683de8e Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Tue, 10 Oct 2023 16:10:25 +0000
Subject: [PATCH 2/4] [UPD] Update account_avatax_repair_oca.pot
---
.../i18n/account_avatax_repair_oca.pot | 228 ++++++++++++++++++
1 file changed, 228 insertions(+)
create mode 100644 account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot
diff --git a/account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot b/account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot
new file mode 100644
index 000000000..caa45b012
--- /dev/null
+++ b/account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot
@@ -0,0 +1,228 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_avatax_repair_oca
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 14.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__repair_calculate_tax
+msgid "Auto Calculate Tax on Repair Save"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_avalara_salestax__repair_calculate_tax
+msgid ""
+"Automatically triggers API to calculate tax If changes made onSO's "
+"warehouse_id, tax_on_shipping_address, SO line's price_unit, discount, "
+"product_uom_qty"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_fee__tax_amt_avatax
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_line__tax_amt_avatax
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__amount_tax_avatax
+msgid "AvaTax"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model,name:account_avatax_repair_oca.model_avalara_salestax
+msgid "AvaTax Configuration"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__avatax_request_log
+msgid "Avatax API Request Log"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__avatax_response_log
+msgid "Avatax API Response Log"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model_terms:ir.ui.view,arch_db:account_avatax_repair_oca.repair_order_update_form_view
+msgid "Avatax Log"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__calculate_tax_on_save
+msgid "Calculate Tax On Save"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model_terms:ir.ui.view,arch_db:account_avatax_repair_oca.repair_order_update_form_view
+msgid "Compute Taxes"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model,name:account_avatax_repair_oca.model_res_partner
+msgid "Contact"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_account_move__display_name
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__display_name
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_fee__display_name
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_line__display_name
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__display_name
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_partner__display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: code:addons/account_avatax_repair_oca/models/partner.py:0
+#, python-format
+msgid ""
+"Enabling the exemption status for all states may have tax compliance risks, and should be carefully considered.\n"
+"\n"
+" Please ensure that your tax advisor was consulted and the necessary tax exemption documentation was obtained for every state this Partner may have transactions."
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_partner__property_exemption_country_wide
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_users__property_exemption_country_wide
+msgid "Exemption Applies Country Wide"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__exemption_code_id
+msgid "Exemption Code"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__exemption_code
+msgid "Exemption Number"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__hide_exemption
+msgid "Hide Exemption & Tax Based on shipping address"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_account_move__id
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__id
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_fee__id
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_line__id
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__id
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_partner__id
+msgid "ID"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__is_avatax
+msgid "Is Avatax"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_repair_order__exemption_code_id
+msgid "It show the customer exemption code"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_repair_order__exemption_code
+msgid "It show the customer exemption number"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model,name:account_avatax_repair_oca.model_account_move
+msgid "Journal Entry"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_account_move____last_update
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax____last_update
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_fee____last_update
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_line____last_update
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order____last_update
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_partner____last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__location_code
+msgid "Location Code"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_repair_order__location_code
+msgid "Origin address location code"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__override_line_taxes
+msgid "Override Line Taxes"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model,name:account_avatax_repair_oca.model_repair_fee
+msgid "Repair Fees"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model,name:account_avatax_repair_oca.model_repair_line
+msgid "Repair Line (parts)"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model,name:account_avatax_repair_oca.model_repair_order
+msgid "Repair Order"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__tax_address_id
+msgid "Tax Address"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: code:addons/account_avatax_repair_oca/models/partner.py:0
+#, python-format
+msgid "Tax Compliance Risk"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_repair_order__hide_exemption
+msgid ""
+"Uncheck the this field to show exemption fields on SO/Invoice form view. "
+"Also, it will show Tax based on shipping address button"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.actions.server,name:account_avatax_repair_oca.action_repair_order_compute_taxes
+msgid "Update taxes with AvaTax"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__use_partner_invoice_id
+msgid "Use Invoice partner's customer code in SO"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_avalara_salestax__use_partner_invoice_id
+msgid "Use Sales Order's Invoice Address field to determine TaxableStatus"
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_avalara_salestax__override_line_taxes
+msgid ""
+"When checked, the Avatax computed tax will replace any other taxes that may "
+"exist in the document line."
+msgstr ""
+
+#. module: account_avatax_repair_oca
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_res_partner__property_exemption_country_wide
+#: model:ir.model.fields,help:account_avatax_repair_oca.field_res_users__property_exemption_country_wide
+msgid ""
+"When enabled, the delivery address State is irrelevant when looking up the "
+"exemption status, meaning that the exemption is considered applicable for "
+"all states"
+msgstr ""
From 3bb05d93326566f2b476224c9247c9aef311460e Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Tue, 10 Oct 2023 16:16:29 +0000
Subject: [PATCH 3/4] [BOT] post-merge updates
---
account_avatax_repair_oca/README.rst | 64 ++-
.../static/description/icon.png | Bin 0 -> 9455 bytes
.../static/description/index.html | 477 ++++++++++++++++++
3 files changed, 533 insertions(+), 8 deletions(-)
create mode 100644 account_avatax_repair_oca/static/description/icon.png
create mode 100644 account_avatax_repair_oca/static/description/index.html
diff --git a/account_avatax_repair_oca/README.rst b/account_avatax_repair_oca/README.rst
index 13c2d44b2..58503131e 100644
--- a/account_avatax_repair_oca/README.rst
+++ b/account_avatax_repair_oca/README.rst
@@ -1,13 +1,32 @@
-=====================================================
-Avalara Avatax Certified Connector for Repairs Orders
-=====================================================
-
+====================================================
+Avalara Avatax Certified Connector for Repair Orders
+====================================================
+
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! This file is generated by oca-gen-addon-readme !!
+ !! changes will be overwritten. !!
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:2416d2c62ed385c5f83423a256cb672d4377b35ee302007dc735f048f4a756ea
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
+ :target: https://odoo-community.org/page/development-status
+ :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
-
-
-|badge2|
+.. |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
+ :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
+ :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
+ :alt: Try me on Runboat
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
This module is a component of the Avatax Integration with odoo app.
Please refer to the corresponding documentation.
@@ -26,6 +45,8 @@ Repairs order transactions do not appear in the in the AvaTax interface.
The information placed in the repair order will automatically pass to the invoice
on the Avalara server and can be viewed in the AvaTax control panel.
+They will be reported as a net deduction on the line item cost.
+
Create New Repair Order
- Navigate to: Repairs
@@ -49,7 +70,7 @@ Compute Taxes with AvaTax
but can be modified if needed.
- Hide Exemption & Tax Based on shipping address -- this will provide this
- feature support at repair order level.
+ feature support at sale order level.
Tax Exemption Status
@@ -77,6 +98,16 @@ Tax Exemption Status
be used for delivery addresses in any state. Using this option has compliance risks, so
plase use it with care.
+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 `_.
+
+Do not contact contributors directly about support or help with technical issues.
+
Credits
=======
@@ -92,3 +123,20 @@ Contributors
* ForgeFlow (https://www.forgeflow.com)
* Alex Paris
+
+Maintainers
+~~~~~~~~~~~
+
+This module is maintained by the OCA.
+
+.. image:: https://odoo-community.org/logo.png
+ :alt: Odoo Community Association
+ :target: https://odoo-community.org
+
+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 `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/account_avatax_repair_oca/static/description/icon.png b/account_avatax_repair_oca/static/description/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d
GIT binary patch
literal 9455
zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~!
zVpnB`o+K7|Al`Q_U;eD$B
zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA
z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__
zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_
zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I
z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&q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Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov
zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22
zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq
zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t<
z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k
z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp
z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{}
zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N
Xviia!U7SGha1wx#SCgwmn*{w2TRX*I
literal 0
HcmV?d00001
diff --git a/account_avatax_repair_oca/static/description/index.html b/account_avatax_repair_oca/static/description/index.html
new file mode 100644
index 000000000..613491647
--- /dev/null
+++ b/account_avatax_repair_oca/static/description/index.html
@@ -0,0 +1,477 @@
+
+
+
+
+
+
+Avalara Avatax Certified Connector for Repair Orders
+
+
+
+
+
Avalara Avatax Certified Connector for Repair Orders
+
+
+
+
This module is a component of the Avatax Integration with odoo app.
+Please refer to the corresponding documentation.
+
Table of contents
+
+
+
+
The AvaTax module is integrated into Repair Orders and allows computation of taxes.
+Repairs order transactions do not appear in the in the AvaTax interface.
+
The information placed in the repair order will automatically pass to the invoice
+on the Avalara server and can be viewed in the AvaTax control panel.
+
They will be reported as a net deduction on the line item cost.
+
Create New Repair Order
+
+Navigate to: Repairs
+Click Create button
+
+
Compute Taxes with AvaTax
+
+The module will calculate tax when the repair order is confirmed,
+when the changes made to a repair order are saved, by navigating to Compute Taxes
+or by navigating to Action >> Update taxes with Avatax.
+At this step, the repair 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 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.
+
+
+
+
+
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 .
+
Do not contact contributors directly about support or help with technical issues.
+
+
+
+
+
+
+
+
This module is maintained by the OCA.
+
+
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 project on GitHub.
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute .
+
+
+
+
+
From 2b1aeb105039e518e18f76b109249faf44f71dcb Mon Sep 17 00:00:00 2001
From: kobros-tech
Date: Fri, 6 Dec 2024 19:42:35 +0300
Subject: [PATCH 4/4] [16.0][MIG] account_avatax_repair_oca: Migration to 16.0
---
account_avatax_repair_oca/README.rst | 15 +-
account_avatax_repair_oca/__manifest__.py | 2 +-
.../i18n/account_avatax_repair_oca.pot | 228 ------------------
.../models/repair_fee.py | 7 +-
.../models/repair_line.py | 7 +-
.../models/repair_order.py | 10 +-
account_avatax_repair_oca/pyproject.toml | 3 +
.../readme/CONTRIBUTORS.rst | 3 +
.../static/description/index.html | 24 +-
.../tests/test_repair_order.py | 5 +-
.../views/avalara_salestax_view.xml | 31 ++-
.../views/repair_order_view.xml | 8 +-
.../odoo/addons/account_avatax_repair_oca | 1 +
setup/account_avatax_repair_oca/setup.py | 6 +
14 files changed, 82 insertions(+), 268 deletions(-)
delete mode 100644 account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot
create mode 100644 account_avatax_repair_oca/pyproject.toml
create mode 120000 setup/account_avatax_repair_oca/odoo/addons/account_avatax_repair_oca
create mode 100644 setup/account_avatax_repair_oca/setup.py
diff --git a/account_avatax_repair_oca/README.rst b/account_avatax_repair_oca/README.rst
index 58503131e..d4282a4b8 100644
--- a/account_avatax_repair_oca/README.rst
+++ b/account_avatax_repair_oca/README.rst
@@ -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
@@ -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|
@@ -104,7 +104,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.
@@ -123,6 +123,9 @@ Contributors
* ForgeFlow (https://www.forgeflow.com)
* Alex Paris
+* Kencove (https://www.kencove.com)
+
+ * Mohamed Alkobrosli
Maintainers
~~~~~~~~~~~
@@ -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 `_ 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_repair_oca/__manifest__.py b/account_avatax_repair_oca/__manifest__.py
index b727f03fd..982b18e4a 100644
--- a/account_avatax_repair_oca/__manifest__.py
+++ b/account_avatax_repair_oca/__manifest__.py
@@ -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",
diff --git a/account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot b/account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot
deleted file mode 100644
index caa45b012..000000000
--- a/account_avatax_repair_oca/i18n/account_avatax_repair_oca.pot
+++ /dev/null
@@ -1,228 +0,0 @@
-# Translation of Odoo Server.
-# This file contains the translation of the following modules:
-# * account_avatax_repair_oca
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: Odoo Server 14.0\n"
-"Report-Msgid-Bugs-To: \n"
-"Last-Translator: \n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__repair_calculate_tax
-msgid "Auto Calculate Tax on Repair Save"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_avalara_salestax__repair_calculate_tax
-msgid ""
-"Automatically triggers API to calculate tax If changes made onSO's "
-"warehouse_id, tax_on_shipping_address, SO line's price_unit, discount, "
-"product_uom_qty"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_fee__tax_amt_avatax
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_line__tax_amt_avatax
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__amount_tax_avatax
-msgid "AvaTax"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model,name:account_avatax_repair_oca.model_avalara_salestax
-msgid "AvaTax Configuration"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__avatax_request_log
-msgid "Avatax API Request Log"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__avatax_response_log
-msgid "Avatax API Response Log"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model_terms:ir.ui.view,arch_db:account_avatax_repair_oca.repair_order_update_form_view
-msgid "Avatax Log"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__calculate_tax_on_save
-msgid "Calculate Tax On Save"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model_terms:ir.ui.view,arch_db:account_avatax_repair_oca.repair_order_update_form_view
-msgid "Compute Taxes"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model,name:account_avatax_repair_oca.model_res_partner
-msgid "Contact"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_account_move__display_name
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__display_name
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_fee__display_name
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_line__display_name
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__display_name
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_partner__display_name
-msgid "Display Name"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: code:addons/account_avatax_repair_oca/models/partner.py:0
-#, python-format
-msgid ""
-"Enabling the exemption status for all states may have tax compliance risks, and should be carefully considered.\n"
-"\n"
-" Please ensure that your tax advisor was consulted and the necessary tax exemption documentation was obtained for every state this Partner may have transactions."
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_partner__property_exemption_country_wide
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_users__property_exemption_country_wide
-msgid "Exemption Applies Country Wide"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__exemption_code_id
-msgid "Exemption Code"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__exemption_code
-msgid "Exemption Number"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__hide_exemption
-msgid "Hide Exemption & Tax Based on shipping address"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_account_move__id
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__id
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_fee__id
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_line__id
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__id
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_partner__id
-msgid "ID"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__is_avatax
-msgid "Is Avatax"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_repair_order__exemption_code_id
-msgid "It show the customer exemption code"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_repair_order__exemption_code
-msgid "It show the customer exemption number"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model,name:account_avatax_repair_oca.model_account_move
-msgid "Journal Entry"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_account_move____last_update
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax____last_update
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_fee____last_update
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_line____last_update
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order____last_update
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_res_partner____last_update
-msgid "Last Modified on"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__location_code
-msgid "Location Code"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_repair_order__location_code
-msgid "Origin address location code"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__override_line_taxes
-msgid "Override Line Taxes"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model,name:account_avatax_repair_oca.model_repair_fee
-msgid "Repair Fees"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model,name:account_avatax_repair_oca.model_repair_line
-msgid "Repair Line (parts)"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model,name:account_avatax_repair_oca.model_repair_order
-msgid "Repair Order"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_repair_order__tax_address_id
-msgid "Tax Address"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: code:addons/account_avatax_repair_oca/models/partner.py:0
-#, python-format
-msgid "Tax Compliance Risk"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_repair_order__hide_exemption
-msgid ""
-"Uncheck the this field to show exemption fields on SO/Invoice form view. "
-"Also, it will show Tax based on shipping address button"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.actions.server,name:account_avatax_repair_oca.action_repair_order_compute_taxes
-msgid "Update taxes with AvaTax"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,field_description:account_avatax_repair_oca.field_avalara_salestax__use_partner_invoice_id
-msgid "Use Invoice partner's customer code in SO"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_avalara_salestax__use_partner_invoice_id
-msgid "Use Sales Order's Invoice Address field to determine TaxableStatus"
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_avalara_salestax__override_line_taxes
-msgid ""
-"When checked, the Avatax computed tax will replace any other taxes that may "
-"exist in the document line."
-msgstr ""
-
-#. module: account_avatax_repair_oca
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_res_partner__property_exemption_country_wide
-#: model:ir.model.fields,help:account_avatax_repair_oca.field_res_users__property_exemption_country_wide
-msgid ""
-"When enabled, the delivery address State is irrelevant when looking up the "
-"exemption status, meaning that the exemption is considered applicable for "
-"all states"
-msgstr ""
diff --git a/account_avatax_repair_oca/models/repair_fee.py b/account_avatax_repair_oca/models/repair_fee.py
index c830a5a07..c42d25bcf 100644
--- a/account_avatax_repair_oca/models/repair_fee.py
+++ b/account_avatax_repair_oca/models/repair_fee.py
@@ -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.
@@ -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
@@ -71,3 +69,4 @@ def _compute_amount(self):
"price_total": line.price_subtotal + line.tax_amt_avatax,
}
line.update(vals)
+ return
diff --git a/account_avatax_repair_oca/models/repair_line.py b/account_avatax_repair_oca/models/repair_line.py
index 61ce3b409..5b175e338 100644
--- a/account_avatax_repair_oca/models/repair_line.py
+++ b/account_avatax_repair_oca/models/repair_line.py
@@ -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.
@@ -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
@@ -71,3 +69,4 @@ def _compute_amount(self):
"price_total": line.price_subtotal + line.tax_amt_avatax,
}
line.update(vals)
+ return
diff --git a/account_avatax_repair_oca/models/repair_order.py b/account_avatax_repair_oca/models/repair_order.py
index dfa5113fc..693953cc6 100644
--- a/account_avatax_repair_oca/models/repair_order.py
+++ b/account_avatax_repair_oca/models/repair_order.py
@@ -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
@@ -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,
}
@@ -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
@@ -165,7 +165,7 @@ def _avatax_compute_tax(self):
avatax_config = self.company_id.get_avatax_config_company()
if not avatax_config:
return False
- 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
diff --git a/account_avatax_repair_oca/pyproject.toml b/account_avatax_repair_oca/pyproject.toml
new file mode 100644
index 000000000..4231d0ccc
--- /dev/null
+++ b/account_avatax_repair_oca/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["whool"]
+build-backend = "whool.buildapi"
diff --git a/account_avatax_repair_oca/readme/CONTRIBUTORS.rst b/account_avatax_repair_oca/readme/CONTRIBUTORS.rst
index 4a2b38303..3ef259005 100644
--- a/account_avatax_repair_oca/readme/CONTRIBUTORS.rst
+++ b/account_avatax_repair_oca/readme/CONTRIBUTORS.rst
@@ -2,3 +2,6 @@
* ForgeFlow (https://www.forgeflow.com)
* Alex Paris
+* Kencove (https://www.kencove.com)
+
+ * Mohamed Alkobrosli
diff --git a/account_avatax_repair_oca/static/description/index.html b/account_avatax_repair_oca/static/description/index.html
index 613491647..e044e46df 100644
--- a/account_avatax_repair_oca/static/description/index.html
+++ b/account_avatax_repair_oca/static/description/index.html
@@ -1,4 +1,3 @@
-
@@ -9,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.
@@ -275,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 }
@@ -301,7 +301,7 @@
span.pre {
white-space: pre }
-span.problematic {
+span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -367,9 +367,9 @@ 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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module is a component of the Avatax Integration with odoo app.
Please refer to the corresponding documentation.
Table of contents
@@ -441,7 +441,7 @@
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.
This module is maintained by the OCA.
-
+
+
+
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 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_repair_oca/tests/test_repair_order.py b/account_avatax_repair_oca/tests/test_repair_order.py
index 4f08128b6..f4383d2e8 100644
--- a/account_avatax_repair_oca/tests/test_repair_order.py
+++ b/account_avatax_repair_oca/tests/test_repair_order.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
from odoo.tests import Form, tagged
@@ -321,7 +321,6 @@ def test_00_repair(self):
with Form(
self.env["repair.order"].with_context(lineNumber=999)
) as repair_form:
- repair_form.name = "PC Assemble + Custom (PC on Demand)"
repair_form.product_id = product_to_repair
repair_form.partner_id = partner
repair_form.invoice_method = "b4repair"
@@ -332,7 +331,7 @@ def test_00_repair(self):
repair = repair_form.save()
repair.action_repair_confirm()
tax = repair.operations.tax_id.filtered(lambda t: t.is_avatax)
- self.assertEqual(tax.amount, 6.1)
+ self.assertEqual(round(tax.amount, 2), 6.1)
repair.action_repair_invoice_create()
self.assertEqual(
len(repair.invoice_id), 1, "No invoice exists for this repair order"
diff --git a/account_avatax_repair_oca/views/avalara_salestax_view.xml b/account_avatax_repair_oca/views/avalara_salestax_view.xml
index f3ead1dc2..d1fa6cdcd 100644
--- a/account_avatax_repair_oca/views/avalara_salestax_view.xml
+++ b/account_avatax_repair_oca/views/avalara_salestax_view.xml
@@ -5,11 +5,32 @@
avalara.salestax
-
-
-
-
-
+
diff --git a/account_avatax_repair_oca/views/repair_order_view.xml b/account_avatax_repair_oca/views/repair_order_view.xml
index e3f21ad59..bcb7b4be4 100644
--- a/account_avatax_repair_oca/views/repair_order_view.xml
+++ b/account_avatax_repair_oca/views/repair_order_view.xml
@@ -5,6 +5,9 @@
form
+
+
+
@@ -43,7 +44,7 @@
expr="//field[@name='operations']//form//field[@name='product_id']"
position="after"
>
-
+
@@ -63,6 +64,7 @@
+
Update taxes with AvaTax
diff --git a/setup/account_avatax_repair_oca/odoo/addons/account_avatax_repair_oca b/setup/account_avatax_repair_oca/odoo/addons/account_avatax_repair_oca
new file mode 120000
index 000000000..e30fa21c3
--- /dev/null
+++ b/setup/account_avatax_repair_oca/odoo/addons/account_avatax_repair_oca
@@ -0,0 +1 @@
+../../../../account_avatax_repair_oca
\ No newline at end of file
diff --git a/setup/account_avatax_repair_oca/setup.py b/setup/account_avatax_repair_oca/setup.py
new file mode 100644
index 000000000..28c57bb64
--- /dev/null
+++ b/setup/account_avatax_repair_oca/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)