Error: ‘ir.mail_server’ object has no attribute ‘keep_days’ while selecting outgoing mail server in invoice template
Summary
I am trying to send invoices per email. I have 2 working outgoing email servers configured. If I try to configure the invoice email template and select the outgoing email server on advanced settings tab, I get the following error.
Error Traceback: Traceback (most recent call last): File “/usr/lib/python3/dist-packages/flectra/http.py”, line 653, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File “/usr/lib/python3/dist-packages/flectra/http.py”, line 312, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File “/usr/lib/python3/dist-packages/flectra/tools/pycompat.py”, line 87, in reraise raise value File “/usr/lib/python3/dist-packages/flectra/http.py”, line 695, in dispatch result = self._call_function(**self.params) File “/usr/lib/python3/dist-packages/flectra/http.py”, line 344, in _call_function return checked_call(self.db, *args, **kwargs) File “/usr/lib/python3/dist-packages/flectra/service/model.py”, line 97, in wrapper return f(dbname, *args, **kwargs) File “/usr/lib/python3/dist-packages/flectra/http.py”, line 337, in checked_call result = self.endpoint(*a, **kw) File “/usr/lib/python3/dist-packages/flectra/http.py”, line 939, in call return self.method(*args, **kw) File “/usr/lib/python3/dist-packages/flectra/http.py”, line 517, in response_wrap response = f(*args, **kw) File “/usr/lib/python3/dist-packages/flectra/addons/web/controllers/main.py”, line 1090, in call_kw return self._call_kw(model, method, args, kwargs) File “/usr/lib/python3/dist-packages/flectra/addons/web/controllers/main.py”, line 1082, in _call_kw return call_kw(request.env[model], method, args, kwargs) File “/usr/lib/python3/dist-packages/flectra/api.py”, line 689, in call_kw return call_kw_multi(method, model, args, kwargs) File “/usr/lib/python3/dist-packages/flectra/api.py”, line 680, in call_kw_multi result = method(recs, *args, **kwargs) File “/usr/lib/python3/dist-packages/flectra/models.py”, line 5195, in onchange record._onchange_eval(name, field_onchange[name], result) File “/usr/lib/python3/dist-packages/flectra/models.py”, line 5021, in _onchange_eval method_res = method(self) File “/usr/lib/python3/dist-packages/flectra/addons/mail/models/mail_template.py”, line 213, in onchange_mail_server_id if self.mail_server_id and self.mail_server_id.keep_days > 0 AttributeError: ‘ir.mail_server’ object has no attribute ‘keep_days’
Steps to reproduce
- Open an invoice and select "send by eMail"
- Open eMail template on the right side
- Select tab "Advanced settings"
- Select an outgoing eMail server -> above error is shown
What is the current bug behavior?
Error message shown that object ‘ir.mail_server’ has no attribute ‘keep_days’
What is the expected correct behavior?
Outgoing eMail server should be saved as default mail server.
Relevant logs and/or screenshots
see above
Possible fixes
Add attribute "keep_days" to object "ir.mail_server".
Adding a user specific attribute does not work, since user specfic attributes need to start with "x_".