[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 |
pedrobaeza
left a comment
There was a problem hiding this comment.
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. |
pedrobaeza
left a comment
There was a problem hiding this comment.
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
marielejeune
left a comment
There was a problem hiding this comment.
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_searchmethod overproduct.product. Currently, this search is not retrieving all matching results.This issue occurs because the parameters for the
_name_searchmethod 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_searchmethod to match the new method signature in Odoo v17 and properly handle thelimitparameter. This ensures that all matching products are returned during the search.