diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 78ee2f6edc9..bbe44eb877a 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -249,7 +249,7 @@ class AccountBankStatement(models.Model): is_valid_balance_start = fields.Boolean(string="Is Valid Balance Start", store=True, compute="_compute_is_valid_balance_start", help="Technical field to display a warning message in case starting balance is different than previous ending balance") - country_code = fields.Char(related='company_id.country_id.code') + country_code = fields.Char(related='company_id.account_fiscal_country_id.code') def write(self, values): res = super(AccountBankStatement, self).write(values) @@ -549,7 +549,7 @@ class AccountBankStatementLine(models.Model): compute='_compute_is_reconciled', help="Technical field indicating if the statement line is already reconciled.") state = fields.Selection(related='statement_id.state', string='Status', readonly=True) - country_code = fields.Char(related='company_id.country_id.code') + country_code = fields.Char(related='company_id.account_fiscal_country_id.code') # ------------------------------------------------------------------------- # HELPERS diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 152ab075121..2bb565b9a32 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -118,7 +118,7 @@ class AccountJournal(models.Model): currency_id = fields.Many2one('res.currency', help='The currency used to enter statement', string="Currency") company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True, index=True, default=lambda self: self.env.company, help="Company related to this journal") - country_code = fields.Char(related='company_id.country_id.code', readonly=True) + country_code = fields.Char(related='company_id.account_fiscal_country_id.code', readonly=True) refund_sequence = fields.Boolean(string='Dedicated Credit Note Sequence', help="Check this box if you don't want to share the same sequence for invoices and credit notes made from this journal", default=False) sequence_override_regex = fields.Text(help="Technical field used to enforce complex sequence composition that the system would normally misunderstand.\n"\ diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index a599d5e63d1..5f365b4d833 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -184,7 +184,7 @@ class AccountMove(models.Model): string='Partner', change_default=True) commercial_partner_id = fields.Many2one('res.partner', string='Commercial Entity', store=True, readonly=True, compute='_compute_commercial_partner_id') - country_code = fields.Char(related='company_id.country_id.code', readonly=True) + country_code = fields.Char(related='company_id.account_fiscal_country_id.code', readonly=True) user_id = fields.Many2one(string='User', related='invoice_user_id', help='Technical field used to fit the generic behavior in mail templates.') is_move_sent = fields.Boolean( diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 992b0d322ee..b409b5a7247 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -129,7 +129,7 @@ class AccountPayment(models.Model): require_partner_bank_account = fields.Boolean( compute='_compute_show_require_partner_bank', help="Technical field used to know whether the field `partner_bank_id` needs to be required or not in the payments form views") - country_code = fields.Char(related='company_id.country_id.code') + country_code = fields.Char(related='company_id.account_fiscal_country_id.code') _sql_constraints = [ ( diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index 7eb1564da42..2ae789a5327 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -61,7 +61,7 @@ class AccountFiscalPosition(models.Model): raise ValidationError(_("You cannot create a fiscal position within your fiscal country with the same VAT number as the main one set on your company.")) if not record.state_ids: - if record.company_id.country_id.state_ids: + if record.company_id.account_fiscal_country_id.state_ids: raise ValidationError(_("You cannot create a fiscal position with a foreign VAT within your fiscal country without assigning it a state.")) else: raise ValidationError(_("You cannot create a fiscal position with a foreign VAT within your fiscal country.")) diff --git a/addons/account/models/res_config_settings.py b/addons/account/models/res_config_settings.py index a6efcb1ac34..88c746172b0 100644 --- a/addons/account/models/res_config_settings.py +++ b/addons/account/models/res_config_settings.py @@ -134,7 +134,7 @@ class ResConfigSettings(models.TransientModel): config_parameter='account.use_invoice_terms') # Technical field to hide country specific fields from accounting configuration - country_code = fields.Char(related='company_id.country_id.code', readonly=True) + country_code = fields.Char(related='company_id.account_fiscal_country_id.code', readonly=True) def set_values(self): super(ResConfigSettings, self).set_values() diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 0cd4d19becf..df7f244ef6a 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -8,7 +8,7 @@
- + Tax ID:
diff --git a/addons/account/wizard/account_payment_register.py b/addons/account/wizard/account_payment_register.py index ce94197e7d4..84117880c67 100644 --- a/addons/account/wizard/account_payment_register.py +++ b/addons/account/wizard/account_payment_register.py @@ -103,7 +103,7 @@ class AccountPaymentRegister(models.TransientModel): require_partner_bank_account = fields.Boolean( compute='_compute_show_require_partner_bank', help="Technical field used to know whether the field `partner_bank_id` needs to be required or not in the payments form views") - country_code = fields.Char(related='company_id.country_id.code', readonly=True) + country_code = fields.Char(related='company_id.account_fiscal_country_id.code', readonly=True) # ------------------------------------------------------------------------- # HELPERS @@ -353,12 +353,12 @@ class AccountPaymentRegister(models.TransientModel): # ------------------------------------------------------------------------- # LOW-LEVEL METHODS # ------------------------------------------------------------------------- - + @api.model def default_get(self, fields_list): # OVERRIDE res = super().default_get(fields_list) - + if 'line_ids' in fields_list and 'line_ids' not in res: # Retrieve moves to pay from the context. @@ -397,7 +397,7 @@ class AccountPaymentRegister(models.TransientModel): raise UserError(_("You can't register payments for journal items being either all inbound, either all outbound.")) res['line_ids'] = [(6, 0, available_lines.ids)] - + return res # ------------------------------------------------------------------------- diff --git a/addons/account_edi/models/account_journal.py b/addons/account_edi/models/account_journal.py index a40a90b27bd..20f03b380ba 100644 --- a/addons/account_edi/models/account_journal.py +++ b/addons/account_edi/models/account_journal.py @@ -37,7 +37,7 @@ class AccountJournal(models.Model): else: return super().write(vals) - @api.depends('type', 'company_id', 'company_id.country_id') + @api.depends('type', 'company_id', 'company_id.account_fiscal_country_id') def _compute_compatible_edi_ids(self): edi_formats = self.env['account.edi.format'].search([]) @@ -45,7 +45,7 @@ class AccountJournal(models.Model): compatible_edis = edi_formats.filtered(lambda e: e._is_compatible_with_journal(journal)) journal.compatible_edi_ids += compatible_edis - @api.depends('type', 'company_id', 'company_id.country_id') + @api.depends('type', 'company_id', 'company_id.account_fiscal_country_id') def _compute_edi_format_ids(self): edi_formats = self.env['account.edi.format'].search([]) diff --git a/addons/l10n_ae/views/report_invoice_templates.xml b/addons/l10n_ae/views/report_invoice_templates.xml index 0018bc69a62..cfa40cca539 100644 --- a/addons/l10n_ae/views/report_invoice_templates.xml +++ b/addons/l10n_ae/views/report_invoice_templates.xml @@ -2,16 +2,16 @@