[FIX] account: set default journal_id on email alias entries

PURPOSE:

Journal entries created through an email alias should go in that
journal.

linked to task-2067097

closes odoo/odoo#36836

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit is contained in:
Samuel Degueldre
2019-09-13 08:51:57 +00:00
parent acf82a8ceb
commit 2b22c2c888
+1 -1
View File
@@ -777,7 +777,7 @@ class AccountJournal(models.Model):
if self.company_id != self.env.ref('base.main_company'):
alias_name += '-' + str(self.company_id.name)
return {
'alias_defaults': {'type': type == 'purchase' and 'in_invoice' or 'out_invoice', 'company_id': self.company_id.id},
'alias_defaults': {'type': type == 'purchase' and 'in_invoice' or 'out_invoice', 'company_id': self.company_id.id, 'journal_id': self.id},
'alias_parent_thread_id': self.id,
'alias_name': re.sub(r'[^\w]+', '-', alias_name)
}