diff --git a/addons/account/models/company.py b/addons/account/models/company.py index e21642423195952682056dea6ee9fb4246124378..07ff9102e67d8c232b46627fa398b96c61c1cb2d 100644 --- a/addons/account/models/company.py +++ b/addons/account/models/company.py @@ -363,6 +363,8 @@ class ResCompany(models.Model): def _get_user_fiscal_lock_date(self): """Get the fiscal lock date for this company depending on the user""" + if not self: + return date.min self.ensure_one() lock_date = max(self.period_lock_date or date.min, self.fiscalyear_lock_date or date.min) if self.user_has_groups('account.group_account_manager'): diff --git a/addons/account/wizard/account_payment_register.py b/addons/account/wizard/account_payment_register.py index 0357a87c70337e2f2b0b8e227362afd403950bc0..ea768e9ca3dae7f0819004eb293640925fdc3c98 100644 --- a/addons/account/wizard/account_payment_register.py +++ b/addons/account/wizard/account_payment_register.py @@ -523,7 +523,7 @@ class AccountPaymentRegister(models.TransientModel): @api.depends('can_edit_wizard', 'payment_date', 'currency_id', 'amount') def _compute_early_payment_discount_mode(self): for wizard in self: - if wizard.can_edit_wizard: + if wizard.can_edit_wizard and wizard.currency_id: batch_result = wizard._get_batches()[0] total_amount_residual_in_wizard_currency, mode = wizard._get_total_amount_in_wizard_currency_to_full_reconcile(batch_result) wizard.early_payment_discount_mode = \