OCA / account-fiscal-rule

Odoo Taxes & Fiscal Rules Management
GNU Affero General Public License v3.0
58 stars 182 forks source link

[17.0][FIX] account_avatax_oca: Install on multi-country #444

Open RLeeOSI opened 3 months ago

RLeeOSI commented 3 months ago

On install of account_avatax_oca in an environment where the main company is not in the United States, install fails with error "The tax group must have the same country_id as the tax using it.". The default tax is created in the main company, and the country_id is defined in the XML data file, but the tax group computes its country_id from the main company's country, and the SQL constraint error appears. This is true even if the active company is a USA company, and the main company is not active.

OCA-git-bot commented 3 months ago

Hi @dreispt, some modules you are maintaining are being modified, check this out!

dreispt commented 3 months ago

I'm afraid this fix is just a workaround to allow you installing the module. The country is needs to be set as US. It is just that you don't want the Fiscal Position to be created for a non-US base company.

Perhaps the proper solution is to have this config data added though the CoA Template...

RLeeOSI commented 3 months ago

I agree that this is a workaround. The ideal situation would leave you with the module data created on the US company. However, I don't see a way that would cover every scenario (e.g. US company hasn't been created yet, main company is non-US but does sales in US), so I think the best solution may be to allow install, then instruct the user to use the module data as a template and correctly create the data in whatever company they need to. Unfortunately, that's not simple either, as tax groups cannot be created/imported through the UI.