In this commit we rewrite part of alias name uniqueness check as well as
alias mixin alias creation to enable batch create of
* alias records (mail.alias);
* records using aliases through mail.alias.mixin;
See merge commit for more details.
Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
Followup of 73dc42d6d5: catchall or bounce alias reset to the same value
should not raise an UserError. This happens for example when reinitializing
mail module.
Also enable batch write again.
closesodoo/odoo#50248
X-original-commit: 00709025a9436b35744908481c5e5faa1e3ef655
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Make aliases usage more unique, prevent re-using bounce or catchall aliases
and remove auto-uniqueness of aliases.
SPECIFICATIONS
Before this commit, user could create an email alias having same name as
catchall/bounce email alias, which should not happen. Also, while creating
or duplicating alias, if the same name was already available, a new unique
name was generated by adding a sequence number to existing name.
This behavior is not considered as a good one as it magically creates aliases
different from what user expects. User could even not own the newly-created
alias, leading to a broken mail gateway.
In this commit we improve that behavior by ensuring that no duplicate alias
name should be entered while creation / updation for both catcall/bounce and
mail alias. Also, while duplicating an alias, name will now be blank by default
to force user to enter the name. Finally when creating an alias an error is
raised if the name is already taken.
Task ID 2160070