[IMP] l10n_{mx,ua,in,dz,ma}: activate default setting

For Mexican localization, activate by default the setting display_invoice_amount_total_words for the Mexican localization. As this localization uses its own amount to words function, the related commit enables an override of the generic function to use it correctly with Mexican localization.

For the other mentioned localizations (ua,in,dz,ma), the setting was already activated but overriding the create method was not a proper way of doing.

task - 3367243

closes odoo/odoo#124909

X-original-commit: 6ee9842764e0b1244927cb8ece1f6407ccec20d5
Related: odoo/enterprise#42510
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: hupo-odoo <hupo@odoo.com>
This commit is contained in:
hupo-odoo
2023-06-14 10:54:24 +02:00
parent 609e25521e
commit a4583a1aa6
13 changed files with 6 additions and 50 deletions
-1
View File
@@ -1,3 +1,2 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import template_dz
from . import company
-13
View File
@@ -1,13 +0,0 @@
from odoo import api, models
class ResCompany(models.Model):
_inherit = 'res.company'
@api.model_create_multi
def create(self, vals_list):
companies = super().create(vals_list)
for company in companies:
if company.account_fiscal_country_id.code == 'DZ':
company.display_invoice_amount_total_words = True
return companies
+1
View File
@@ -14,6 +14,7 @@ class AccountChartTemplate(models.AbstractModel):
'property_account_expense_categ_id': 'l10n_dz_600',
'property_account_income_categ_id': 'l10n_dz_700',
'code_digits': 6,
'display_invoice_amount_total_words': True,
}
@template('dz', 'res.company')
-8
View File
@@ -4,11 +4,3 @@ class ResCompany(models.Model):
_inherit = 'res.company'
l10n_in_upi_id = fields.Char(string="UPI Id")
@api.model_create_multi
def create(self, vals_list):
companies = super().create(vals_list)
for company in companies:
if company.account_fiscal_country_id.code == 'IN':
company.display_invoice_amount_total_words = True
return companies
+1
View File
@@ -16,6 +16,7 @@ class AccountChartTemplate(models.AbstractModel):
'property_tax_payable_account_id': 'p11239',
'property_tax_receivable_account_id': 'p10059',
'code_digits': '6',
'display_invoice_amount_total_words': True,
}
@template('in', 'res.company')
-1
View File
@@ -1,3 +1,2 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import template_ma
from . import company
-13
View File
@@ -1,13 +0,0 @@
from odoo import api, models
class ResCompany(models.Model):
_inherit = 'res.company'
@api.model_create_multi
def create(self, vals_list):
companies = super().create(vals_list)
for company in companies:
if company.account_fiscal_country_id.code == 'MA':
company.display_invoice_amount_total_words = True
return companies
+1
View File
@@ -14,6 +14,7 @@ class AccountChartTemplate(models.AbstractModel):
'property_account_payable_id': 'pcg_44111',
'property_account_income_categ_id': 'pcg_7111',
'property_account_expense_categ_id': 'pcg_6111',
'display_invoice_amount_total_words': True,
}
@template('ma', 'res.company')
+1
View File
@@ -11,6 +11,7 @@ class AccountChartTemplate(models.AbstractModel):
return {
'code_digits': '3',
'use_anglo_saxon': True,
'display_invoice_amount_total_words': True,
'property_account_receivable_id': 'cuenta105_01',
'property_account_payable_id': 'cuenta201_01',
'property_account_expense_categ_id': 'cuenta601_84',
-1
View File
@@ -1,4 +1,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import template_ua_ias
from . import template_ua_psbo
from . import company
-13
View File
@@ -1,13 +0,0 @@
from odoo import api, models
class ResCompany(models.Model):
_inherit = 'res.company'
@api.model_create_multi
def create(self, vals_list):
companies = super().create(vals_list)
for company in companies:
if company.account_fiscal_country_id.code == 'UA':
company.display_invoice_amount_total_words = True
return companies
+1
View File
@@ -20,6 +20,7 @@ class AccountChartTemplate(models.AbstractModel):
'name': 'План рахунків МСФЗ',
'code_digits': '6',
'use_storno_accounting': True,
'display_invoice_amount_total_words': True,
}
@template('ua_ias', 'res.company')
@@ -20,6 +20,7 @@ class AccountChartTemplate(models.AbstractModel):
'name': 'План рахунків ПСБО',
'code_digits': '6',
'use_storno_accounting': True,
'display_invoice_amount_total_words': True,
}
@template('ua_psbo', 'res.company')