-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
17.0 [FIX] auditlog: Unable to create a user session #3432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@pedrobaeza Can you check the pr, and if you can't, do you know who can? |
|
Please check module maintainers/contributors. |
|
@hbrunn Can you check the pr? |
|
What is the way to reproduce? Did you go to the user session menu item and click 'New'? |
|
@StefanRijnhart You have to go to “User Sessions” and click on the “New” button, then the error message will pop up. |
|
@david-s73 Is there a particular reason to create user sessions manually? Maybe we can improve this change by removing the ability to create new entries in that menu ( |
|
@StefanRijnhart Because if there is the option to create one manually, it is best that it does not give an error message when trying to do so. |
|
Yes, so we should keep the current change that you proposed. But I also think it does not make any sense to create user sessions manually, so the create button is simply misleading. |
|
@StefanRijnhart It's true that it's not normally used, but if it is used for some reason, the error message would pop up, and I think my change doesn't affect anything unless it's created manually, so if you agree, you can go ahead and use it. |
|
Yes, I think we should avoid the error message at all cost so I'm happy you're proposing a fix! I'm just saying we can fix a closely related usability issue at the same time by adding the |
|
@StefanRijnhart That's clear, but if I set |
|
You don't have to remove your fix. If you want to validate that your fix keeps working, you can add a small test checking |
|
@StefanRijnhart So, do I add the tests and also |
|
Yes please! |
When attempting to create a new user session, an error message popped up, so I added that it should take the current date if no date is provided.
6e4f312 to
14bb745
Compare
|
@StefanRijnhart You have already made the changes, both the tests and the modification in the tree view. |
StefanRijnhart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates!
|
@StefanRijnhart Merged? |
|
@david-s73 More approvals required, see https://odoo-community.org/resources/code |
|
@StefanRijnhart Do you know anyone else who can give the approval? |
|
@david-s73 If there people who volunteered as module maintainers, they would have been invited for review by the OCA Github bot. In this case there are none. It is not considered good practice to ask people for review unless the issue is critical. It can come across as pushy, and have the opposite result. Reviews are posted on a voluntary basis, often in people's spare time. It can help (in the long run...) to do reviews yourself to build up a reputation in the project or in the OCA. And just give it some time. |
drkpkg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great—thanks for addressing the create_date. Let’s merge this so I can rebase my branch on top of it
|
This PR has the |
|
/ocabot merge minor |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 8d7123e. Thanks a lot for contributing to OCA. ❤️ |
When attempting to create a new user session, an error message popped up, so I added that it should take the current date if no date is provided.
The error message copied from a runboat
Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 1971, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/service/model.py", line 152, in retrying
result = func()
File "/opt/odoo/odoo/http.py", line 1999, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/http.py", line 2203, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 221, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/http.py", line 786, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/addons/web/controllers/dataset.py", line 25, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/dataset.py", line 21, in _call_kw
return call_kw(Model, method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 484, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 469, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/opt/odoo/addons/web/models/models.py", line 1083, in onchange
snapshot1 = RecordSnapshot(record, fields_spec)
File "/opt/odoo/addons/web/models/models.py", line 1170, in init
self.fetch(name)
File "/opt/odoo/addons/web/models/models.py", line 1185, in fetch
self[field_name] = self.record[field_name]
File "/opt/odoo/odoo/models.py", line 6695, in getitem
return self._fields[key].get(self, self.env.registry[self._name])
File "/opt/odoo/odoo/fields.py", line 1152, in get
self.recompute(record)
File "/opt/odoo/odoo/fields.py", line 1379, in recompute
apply_except_missing(self.compute_value, recs)
File "/opt/odoo/odoo/fields.py", line 1352, in apply_except_missing
func(records)
File "/opt/odoo/odoo/fields.py", line 1401, in compute_value
records._compute_field_value(self)
File "/opt/odoo/odoo/models.py", line 4923, in _compute_field_value
fields.determine(field.compute, self)
File "/opt/odoo/odoo/fields.py", line 102, in determine
return needle(*args)
File "/mnt/data/odoo-addons-dir/auditlog/models/http_session.py", line 24, in _compute_display_name
tz_create_date = fields.Datetime.context_timestamp(httpsession, create_date)
File "/opt/odoo/odoo/fields.py", line 2269, in context_timestamp
assert isinstance(timestamp, datetime), 'Datetime instance expected'
AssertionError: Datetime instance expected
The above server error caused the following client error:
OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
Error: An error occured in the owl lifecycle (see this Error's "cause" property)
at handleError (http://oca-server-tools-17-0-013a975d296a.runboat.odoo-community.org/web/assets/083efc9/web.assets_web.min.js:938:101)
at App.handleError (http://oca-server-tools-17-0-013a975d296a.runboat.odoo-community.org/web/assets/083efc9/web.assets_web.min.js:1596:29)
at ComponentNode.initiateRender (http://oca-server-tools-17-0-013a975d296a.runboat.odoo-community.org/web/assets/083efc9/web.assets_web.min.js:1030:19)
Caused by: RPC_ERROR: Odoo Server Error
RPC_ERROR
at makeErrorFromResponse (http://oca-server-tools-17-0-013a975d296a.runboat.odoo-community.org/web/assets/083efc9/web.assets_web.min.js:2955:163)
at XMLHttpRequest. (http://oca-server-tools-17-0-013a975d296a.runboat.odoo-community.org/web/assets/083efc9/web.assets_web.min.js:2959:13)