summaryrefslogtreecommitdiff
path: root/addons/account/models/company.py
diff options
context:
space:
mode:
authorRavi Gohil <rgo@odoo.com>2020-03-24 06:23:07 +0000
committerRavi Gohil <rgo@odoo.com>2020-03-24 06:51:22 +0000
commitd2bd6d69d647777fffe51c22cbb324e6d27a950f (patch)
treeb93922ddda29752723c2f0c20cc3b43e0ebfafa2 /addons/account/models/company.py
parentfd9b2590261e6caf4a8952d17db6e1ca06778140 (diff)
[IMP] account{_check_printing}: Added 'Country Code' field
Many localization modules adds field 'l10n_xx_country_code' on Company/Settings views with the purpose of using it to hide that particular localization's fields from other country's users. So, it is better to add a common field in account module so that other localization can use that field instead of adding a new one where ever it is required. Also, one such field was already added from account_check_printing module, so we removed it from there as it is not needed anymore. Task: 2049977 Closes: #35755 Related: odoo/enterprise#5158
Diffstat (limited to 'addons/account/models/company.py')
-rw-r--r--addons/account/models/company.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/account/models/company.py b/addons/account/models/company.py
index 49623dde125..c7289b0e2c2 100644
--- a/addons/account/models/company.py
+++ b/addons/account/models/company.py
@@ -107,6 +107,9 @@ class ResCompany(models.Model):
domain="[('internal_group', '=', 'asset'), ('internal_type', 'not in', ('receivable', 'payable')), ('reconcile', '=', True), ('company_id', '=', id)]")
accrual_default_journal_id = fields.Many2one('account.journal', help="Journal used by default for moving the period of an entry", domain="[('type', '=', 'general')]")
+ # Technical field to hide country specific fields in company form view
+ country_code = fields.Char(related='country_id.code')
+
@api.constrains('account_opening_move_id', 'fiscalyear_last_day', 'fiscalyear_last_month')
def _check_fiscalyear_last_day(self):
# if the user explicitly chooses the 29th of February we allow it: