Before this fix, the search on the supplierinfo had
an undeterministic result.
When testing odoo/addons/purchase_stock/tests/test_reordering_rule.py:66
`def test_procure_not_default_partner`, it may fail at line 120.
It sets 2 suppliers:
- Firstly, the `default_vendor` (let's assume id=120)
- Then, the `secondary_vendor` (let's assume id=121)
It then runs a procurement without setting the supplier and assert
that the partner of the resulting PO line should be `default_vendor`.
The return of
odoo/addons/product/models/product.py:574
`def _prepare_sellers` depends on Postgres when the supplierinfo
sequence, min_qty and price are the same for multiple records.
By adding the `id` to the `.sorted`, the result will order correctly in that
case.
opws-2272627
-2282081
-2287079
And PS-BE via CSC reported more cases without opw.
closesodoo/odoo#53951
X-original-commit: a733feb8e022084148685599840fe542ee9dafd1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>