diff --git a/account_chart_update/__manifest__.py b/account_chart_update/__manifest__.py
index ed520b215..17214bf34 100644
--- a/account_chart_update/__manifest__.py
+++ b/account_chart_update/__manifest__.py
@@ -7,13 +7,14 @@
{
"name": "Detect changes and update the Account Chart from a template",
"summary": "Wizard to update a company's account chart from a template",
- "version": "13.0.1.0.5",
+ "version": "14.0.1.0.0",
"author": "Tecnativa, BCIM, Okia, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-financial-tools",
"depends": ["account"],
"category": "Accounting",
"license": "AGPL-3",
"data": [
+ "security/ir.model.access.csv",
"wizard/wizard_chart_update_view.xml",
"views/account_config_settings_view.xml",
],
diff --git a/account_chart_update/security/ir.model.access.csv b/account_chart_update/security/ir.model.access.csv
new file mode 100644
index 000000000..a9789aa7e
--- /dev/null
+++ b/account_chart_update/security/ir.model.access.csv
@@ -0,0 +1,9 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_wizard_update_charts_accounts,wizard.update.charts.accounts,model_wizard_update_charts_accounts,,1,1,1,1
+access_wizard_update_charts_accounts_account,wizard.update.charts.accounts.account,model_wizard_update_charts_accounts_account,,1,1,1,1
+access_wizard_tax_matching,wizard.tax.matching,model_wizard_tax_matching,,1,1,1,1
+access_wizard_fp_matching,wizard.fp.matching,model_wizard_fp_matching,,1,1,1,1
+access_wizard_account_matching,wizard.account.matching,model_wizard_account_matching,,1,1,1,1
+access_wizard_update_charts_accounts_tax,wizard.update.charts.accounts.tax,model_wizard_update_charts_accounts_tax,,1,1,1,1
+access_wizard_matching,wizard.matching,model_wizard_matching,,1,1,1,1
+access_wizard_update_charts_accounts_fiscal_position,wizard.update.charts.accounts.fiscal.position,model_wizard_update_charts_accounts_fiscal_position,,1,1,1,1
diff --git a/account_chart_update/tests/test_account_chart_update.py b/account_chart_update/tests/test_account_chart_update.py
index deaa074fd..5e64e8f1c 100644
--- a/account_chart_update/tests/test_account_chart_update.py
+++ b/account_chart_update/tests/test_account_chart_update.py
@@ -126,7 +126,7 @@ class TestAccountChartUpdate(common.HttpCase):
)
company_user = self.env.user.copy({"company_id": self.company.id})
chart_by_company_user = self.chart_template.with_user(company_user)
- chart_by_company_user.try_loading_for_current_company()
+ chart_by_company_user.try_loading()
self.tax = self.env["account.tax"].search(
[
@@ -324,7 +324,7 @@ class TestAccountChartUpdate(common.HttpCase):
self.env["account.move"].create(
{
"name": "Test move",
- "type": "entry",
+ "move_type": "entry",
"journal_id": self.env["account.journal"]
.search([("company_id", "=", self.company.id)], limit=1)
.id,
diff --git a/account_chart_update/wizard/wizard_chart_update.py b/account_chart_update/wizard/wizard_chart_update.py
index 0c95dee6d..5a5ec1a42 100644
--- a/account_chart_update/wizard/wizard_chart_update.py
+++ b/account_chart_update/wizard/wizard_chart_update.py
@@ -55,7 +55,6 @@ class WizardUpdateChartsAccounts(models.TransientModel):
lang = fields.Selection(
lambda self: self._get_lang_selection_options(),
"Language",
- size=5,
required=True,
help="For records searched by name (taxes, fiscal "
"positions), the template name will be matched against the "
@@ -87,7 +86,6 @@ class WizardUpdateChartsAccounts(models.TransientModel):
recreate_xml_ids = fields.Boolean(string="Recreate missing XML-IDs")
tax_ids = fields.One2many(
comodel_name="wizard.update.charts.accounts.tax",
- ondelete="cascade",
inverse_name="update_chart_wizard_id",
string="Taxes",
)
@@ -95,13 +93,11 @@ class WizardUpdateChartsAccounts(models.TransientModel):
comodel_name="wizard.update.charts.accounts.account",
inverse_name="update_chart_wizard_id",
string="Accounts",
- ondelete="cascade",
)
fiscal_position_ids = fields.One2many(
comodel_name="wizard.update.charts.accounts.fiscal.position",
inverse_name="update_chart_wizard_id",
string="Fiscal positions",
- ondelete="cascade",
)
new_taxes = fields.Integer(string="New taxes", compute="_compute_new_taxes_count")
new_accounts = fields.Integer(
@@ -1101,7 +1097,7 @@ class WizardUpdateChartsAccountsTax(models.TransientModel):
("deleted", "Tax to deactivate"),
],
string="Type",
- readonly=True,
+ readonly=False,
)
type_tax_use = fields.Selection(related="tax_id.type_tax_use", readonly=True)
update_tax_id = fields.Many2one(
@@ -1111,6 +1107,10 @@ class WizardUpdateChartsAccountsTax(models.TransientModel):
ondelete="set null",
)
notes = fields.Text("Notes", readonly=True)
+ recreate_xml_ids = fields.Boolean(
+ string="Recreate missing XML-IDs",
+ related="update_chart_wizard_id.recreate_xml_ids",
+ )
class WizardUpdateChartsAccountsAccount(models.TransientModel):
@@ -1133,7 +1133,7 @@ class WizardUpdateChartsAccountsAccount(models.TransientModel):
type = fields.Selection(
selection=[("new", "New template"), ("updated", "Updated template")],
string="Type",
- readonly=True,
+ readonly=False,
)
update_account_id = fields.Many2one(
comodel_name="account.account",
@@ -1142,6 +1142,10 @@ class WizardUpdateChartsAccountsAccount(models.TransientModel):
ondelete="set null",
)
notes = fields.Text("Notes", readonly=True)
+ recreate_xml_ids = fields.Boolean(
+ string="Recreate missing XML-IDs",
+ related="update_chart_wizard_id.recreate_xml_ids",
+ )
class WizardUpdateChartsAccountsFiscalPosition(models.TransientModel):
@@ -1164,8 +1168,7 @@ class WizardUpdateChartsAccountsFiscalPosition(models.TransientModel):
type = fields.Selection(
selection=[("new", "New template"), ("updated", "Updated template")],
string="Type",
- readonly=True,
- required=True,
+ readonly=False,
)
update_fiscal_position_id = fields.Many2one(
comodel_name="account.fiscal.position",
@@ -1174,6 +1177,10 @@ class WizardUpdateChartsAccountsFiscalPosition(models.TransientModel):
ondelete="set null",
)
notes = fields.Text("Notes", readonly=True)
+ recreate_xml_ids = fields.Boolean(
+ string="Recreate missing XML-IDs",
+ related="update_chart_wizard_id.recreate_xml_ids",
+ )
class WizardMatching(models.TransientModel):
diff --git a/account_chart_update/wizard/wizard_chart_update_view.xml b/account_chart_update/wizard/wizard_chart_update_view.xml
index 3d94d4cbc..1066e8398 100644
--- a/account_chart_update/wizard/wizard_chart_update_view.xml
+++ b/account_chart_update/wizard/wizard_chart_update_view.xml
@@ -211,6 +211,27 @@