-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
[17.0][FIX] product_supplierinfo_for_customer: fix missing products in comodel search #1725
Conversation
I explored the possibility of using the While we can use dot notation and the Given this limitation, the most effective solution is to fix the parameters of the overridden _name_search method to align with Odoo 17's changes. |
@pedrobaeza @luisg123v please review |
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.
I don't get this change, as the signature is the previous one:
https://github.com/odoo/odoo/blob/4401d4f9af7698ee79aee82bda3b240ef322bf43/odoo/models.py#L1714
The inheritance is over this one: https://github.com/odoo/odoo/blob/4401d4f9af7698ee79aee82bda3b240ef322bf43/odoo/models.py#L1750 And the change is because in the replanishment (or any other model with a field related to product.product) if you search for a product it will only take into account the first hundred products which is not expected. |
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.
OK, sorry, I lost the initial _
.
Hi @xmglord, LGTM. Could we take this chance to add myself as maintainer, please? Regards, |
aca3e4e
to
98be2f9
Compare
Done, also I test again the dot notation and the error was a typo, but it do not work using |
36147b1
to
a731c7a
Compare
…del search When searching for products in a comodel, the results are obtained via the `_name_search` method over `product.product`. Currently, this search is not retrieving all matching results. This issue occurs because the parameters for the `_name_search` method changed in Odoo v17, and during the migration, this was not adapted. As a result, when the method is called, it only retrieves 100 results due to the default limit not being handled correctly. This commit updates the overridden `_name_search` method to match the new method signature in Odoo v17 and properly handle the `limit` parameter. This ensures that all matching products are returned during
a731c7a
to
945c15c
Compare
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.
LGTM 👍
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.
LGTM.
Could we merge this so I can take it into the 18.0 migration I'm working on?
@pedrobaeza this is ready for merge |
/ocabot merge patch |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 61513e5. Thanks a lot for contributing to OCA. ❤️ |
When searching for products in a comodel, the results are obtained via the
_name_search
method overproduct.product
. Currently, this search is not retrieving all matching results.This issue occurs because the parameters for the
_name_search
method changed in Odoo v17, and during the migration, this was not adapted. As a result, when the method is called, it only retrieves 100 results due to the default limit not being handled correctly.This commit updates the overridden
_name_search
method to match the new method signature in Odoo v17 and properly handle thelimit
parameter. This ensures that all matching products are returned during the search.