diff options
| author | Goffin Simon <sig@odoo.com> | 2020-09-01 07:41:28 +0000 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2020-09-03 09:33:09 +0000 |
| commit | 45ba62817d8a82129a2bae44cae9e3757529bdce (patch) | |
| tree | d13fbebd8acc705880b95dd23e19699d7f9eaf1d | |
| parent | 6be2fe2015309805dc8930a4ecd3b7ded702dc20 (diff) | |
[FIX] account: Error message creating journal
- Let's create a new company C with the name = "Company.name"
- Create a new journal in C
Bug:
A UserError was raised saying:
You cannot use anything else than unaccented latin characters in the alias address.
opw:2321023
closes odoo/odoo#57005
X-original-commit: 953389546f191e3fdb5e9dd994ab663ea9228b5d
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
| -rw-r--r-- | addons/account/models/account_journal.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 0bab630145f..7ac3dc485f4 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -3,6 +3,7 @@ from odoo import api, fields, models, _ from odoo.osv import expression from odoo.exceptions import UserError, ValidationError from odoo.addons.base.models.res_bank import sanitize_account_number +import re class AccountJournalGroup(models.Model): @@ -356,7 +357,7 @@ class AccountJournal(models.Model): if not alias_name: alias_name = self.name if self.company_id != self.env.ref('base.main_company'): - alias_name += '-' + str(self.company_id.name) + alias_name += '-' + re.sub("[^\w!#$%&'*+/=?^`{|}~\-]", '', str(self.company_id.name)) return { 'alias_defaults': {'move_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, |
