[18.0][FIX] point_of_sale: incorrect method signature - #2
Closed
yotsubasuzu wants to merge 2 commits into
Closed
yotsubasuzu wants to merge 2 commits into
yotsubasuzu wants to merge 2 commits into
Conversation
In pos.session.load_data, a fallback call inside except AccessError may raise TypeError if the user lacks read access to ir.module.module due to base_install_request not being auto-installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the issue/feature this PR addresses:
The method was first introduce from this PR
https://github.com/odoo/odoo/pull/183540.Due to this PR
https://github.com/OCA/OCB/pull/1301the modulebase_install_requestis not auto install, resulted in groupbase.group_userdo not have read access to modelir.module.module.In pos.session.load_data
https://github.com/odoo/odoo/blob/18.0/addons/point_of_sale/models/pos_session.py#L185, a fallback method call inside the except AccessError block may raise a TypeError.This occurs if the user lacks read access to the
ir.module.modulemodel, which normally should be granted by the base.group_user group when thebase_install_requestmodule is auto-installed.If the module is not installed, access rights are missing, leading to an unintended method signature mismatch.
Current behavior before PR:
base_install_requestis not installed,base.group_userusers may not have read access toir.module.module.AccessErroris correctly caught, but the fallback method call includes an argument not expected by the method, leading to aTypeError.Desired behavior after PR is merged:
TypeErroris avoided even when access toir.module.moduleis restricted due to missingbase_install_request.I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr