Skip to content
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

[12.0][FIX] stock: avoid choosing inactive default location in inventory adjustment #1204

Open
wants to merge 1 commit into
base: 12.0
Choose a base branch
from

Conversation

MiquelRForgeFlow
Copy link

@MiquelRForgeFlow MiquelRForgeFlow commented Nov 6, 2023

If you try to start an inventory with an inactive location, you get an error

  File "/opt/odoo/auto/addons/stock_inventory_exclude_sublocation/models/stock_inventory.py", line 23, in _get_inventory_lines_values
    vals = super()._get_inventory_lines_values()
  File "/opt/odoo/auto/addons/stock/models/stock_inventory.py", line 280, in _get_inventory_lines_values
    GROUP BY product_id, location_id, lot_id, package_id, partner_id """ % domain, args)
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 148, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
  File "/usr/local/lib/python3.5/site-packages/newrelic/hooks/database_psycopg2.py", line 65, in execute
    **kwargs)
  File "/usr/local/lib/python3.5/site-packages/newrelic/hooks/database_dbapi2.py", line 39, in execute
    *args, **kwargs)
psycopg2.ProgrammingError: syntax error at or near ")"
LINE 5:             WHERE  location_id in () AND quantity != 0 AND a...

I will not do a PR to odoo, as they don't accept PRs for too old versions.


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant