[FIX] account,mail: fix no depends not computing field

Computed fields with no depends are not computed before record creation
rendering those fields empty instead of being computed on the first
request.
By adding a depends (the field does not actually depend on it) the field
is computed correctly and may be used directly.

TaskId-2647225

closes odoo/odoo#76744

X-original-commit: f03e74317a40957a355235b92dacff6310fbdd5b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
William Braeckman
2021-09-17 18:52:49 +00:00
parent 4dcd29284d
commit 13084f0faa
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -323,6 +323,7 @@ class AccountJournal(models.Model):
else:
journal.suspense_account_id = False
@api.depends('name')
def _compute_alias_domain(self):
self.alias_domain = self.env["ir.config_parameter"].sudo().get_param("mail.catchall.domain")
+1
View File
@@ -93,6 +93,7 @@ class Alias(models.Model):
alias.alias_name,
))
@api.depends('alias_name')
def _compute_alias_domain(self):
self.alias_domain = self.env["ir.config_parameter"].sudo().get_param("mail.catchall.domain")