OCA / stock-logistics-warehouse

Odoo Warehouse Management Addons
https://odoo-community.org/psc-teams/logistics-18
GNU Affero General Public License v3.0
317 stars 715 forks source link

[15.0][FIX] stock_inventory: Resolve error when applying inventory with multiple adjustments in the same location for different products #2120

Closed JoanSForgeFlow closed 1 month ago

JoanSForgeFlow commented 1 month ago

[FIX] stock_inventory: Resolve error when applying inventory with multiple adjustments in the same location for different products

Error resolved:

  File "/home/joan/odoo/15.0/odoo/odoo/models.py", line 5243, in ensure_one
    raise ValueError("Expected singleton: %s" % self)
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/joan/odoo/15.0/odoo/odoo/http.py", line 658, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/joan/odoo/15.0/odoo/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Expected singleton: stock.inventory(105, 104)
rousseldenis commented 1 month ago

@JoanSForgeFlow A test case should be great in order to prevent regressions. Thanks

OCA-git-bot commented 1 month ago

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

OCA-git-bot commented 1 month ago

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

LoisRForgeFlow commented 1 month ago

/ocabot merge minor

OCA-git-bot commented 1 month ago

On my way to merge this fine PR! Prepared branch 15.0-ocabot-merge-pr-2120-by-LoisRForgeFlow-bump-minor, awaiting test results.

OCA-git-bot commented 1 month ago

Congratulations, your PR was merged at 1dfc29d0c11ccd7955ea531f9e192f7aab146183. Thanks a lot for contributing to OCA. ❤️