Closed florian-dacosta closed 6 months ago
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.
I only have tested with version 16 but it probably impacts all versions.
If both
mail_environment
andmicrosoft_outlook
are installed, it is impossible to create an outgoing mail server withsmtp_authentication = 'outlook'
, unless you manage the environment dependent fields in your Odoo config files. (So it does not work with default value ordata_encryption_server_environment
module)During the creation, you will have a failure due to this constraints : https://github.com/OCA/OCB/blob/16.0/addons/microsoft_outlook/models/ir_mail_server.py#L46 The reason is, Odoo will check these constraint before the default environement value is set. Constraints are checked there https://github.com/OCA/OCB/blob/16.0/odoo/models.py#L4206 while the not stored fields with inverse method (which is the case of the environment dependent fields) are managed later on in the
create
method. During the constraint check, the value will always be False (unless defined in config file)So, the source of the problem is the fact that
server_environment
some stored fields to not stored /computed fields. Actually, I think I already met issues withserver_environment
because of this, I think required field are not anymore, fields no more searchable, stuff like that.Anyway, I have no perfect solution about this issue. For now, I intent to fix it for microsoft_outlook with the following :
It seems good enough to me and not too dangerous because specific to the constraints of
ir.mail_server
I wonder if anyone would have a better idea and/or if it was good enough to go to
mail_environment_office365
module.I guess the problem from this issue is the same as spotted here : https://github.com/OCA/server-env/pull/119#issuecomment-1407195170 Even though I did not experience this one.
Any feedback is appreciated @JordiBForgeFlow @simahawk @lmignon @StefanRijnhart