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

Product forecast report does not open from product form view, when warehouse has been used as search term in the list view #165330

Closed
juppe opened this issue May 14, 2024 · 1 comment
Labels
16.0 Logistics about stock, mrp, delivery, purchase

Comments

@juppe
Copy link
Contributor

juppe commented May 14, 2024

Impacted versions:
16.0

Steps to reproduce:

  1. Navigate to Product Variants list view in the Inventory module
  2. Search for a warehouse e.g. "My Company" in the list view
  3. Click on any storable product e.g. DESK0005
  4. In the product form view click on the "Forecasted" (action_product_forecast_report) button

Tested on Runbot 14.5.2024

Current behavior:

Odoo dumps stack trace:

Traceback (most recent call last):
  File "/data/build/odoo/odoo/api.py", line 997, in get
    cache_value = field_cache[record._ids[0]]
KeyError: 'your company'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/build/odoo/odoo/fields.py", line 1161, in __get__
    value = env.cache.get(record, self)
  File "/data/build/odoo/odoo/api.py", line 1004, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: "stock.warehouse('your company',).view_location_id"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/build/odoo/odoo/http.py", line 1638, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/data/build/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/data/build/odoo/odoo/http.py", line 1665, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/data/build/odoo/odoo/http.py", line 1869, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/data/build/odoo/addons/website/models/ir_http.py", line 237, in _dispatch
    response = super()._dispatch(endpoint)
  File "/data/build/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/data/build/odoo/odoo/http.py", line 700, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/data/build/odoo/addons/web/controllers/dataset.py", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/data/build/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/data/build/odoo/odoo/api.py", line 464, in call_kw
    result = _call_kw_model(method, model, args, kwargs)
  File "/data/build/odoo/odoo/api.py", line 435, in _call_kw_model
    result = method(recs, *args, **kwargs)
  File "/data/build/odoo/addons/stock/report/stock_forecasted.py", line 120, in get_report_values
    docs = self._get_report_data(product_variant_ids=docids)
  File "/data/build/odoo/addons/stock/report/stock_forecasted.py", line 141, in _get_report_data
    [('id', 'child_of', warehouse.view_location_id.id)],
  File "/data/build/odoo/odoo/fields.py", line 2804, in __get__
    return super().__get__(records, owner)
  File "/data/build/odoo/odoo/fields.py", line 1187, in __get__
    recs._fetch_field(self)
  File "/data/build/odoo/odoo/models.py", line 3201, in _fetch_field
    self._read(fnames)
  File "/data/build/odoo/odoo/models.py", line 3278, in _read
    cr.execute(query_str, params + [sub_ids])
  File "/data/build/odoo/odoo/sql_db.py", line 321, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type integer: "your company"
LINE 1: ..."company_id" in (1)) AND "stock_warehouse".id IN ('your comp...
                                                             ^


The above server error caused the following client error:
OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
    at handleError (https://62431332-16-0-all.runbot184.odoo.com/web/assets/2278-0e03c8f/web.assets_common.min.js:1472:101)
    at owl.App.handleError (https://62431332-16-0-all.runbot184.odoo.com/web/assets/2278-0e03c8f/web.assets_common.min.js:2098:29)
    at ComponentNode.initiateRender (https://62431332-16-0-all.runbot184.odoo.com/web/assets/2278-0e03c8f/web.assets_common.min.js:1562:19)

Caused by: RPC_ERROR: Odoo Server Error
    at makeErrorFromResponse (https://62431332-16-0-all.runbot184.odoo.com/web/assets/2275-a139f63/web.assets_backend.min.js:993:163)
    at XMLHttpRequest.<anonymous> (https://62431332-16-0-all.runbot184.odoo.com/web/assets/2275-a139f63/web.assets_backend.min.js:1001:13)

Expected behavior:

Odoo should show the forecasted report with the correct warehouse context.

vava-odoo added a commit to odoo-dev/odoo that referenced this issue May 17, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context is the
name and not the id.

Fixes odoo#165330
@vava-odoo vava-odoo added Logistics about stock, mrp, delivery, purchase 16.0 labels May 17, 2024
vava-odoo added a commit to odoo-dev/odoo that referenced this issue May 21, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context is the
name and not the id if the filter is on the warehouse.

Fixes odoo#165330
vava-odoo added a commit to odoo-dev/odoo that referenced this issue May 22, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330
vava-odoo added a commit to odoo-dev/odoo that referenced this issue May 23, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330
vava-odoo added a commit to odoo-dev/odoo that referenced this issue May 28, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330
robodoo pushed a commit that referenced this issue May 29, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes #165330

closes #165934

Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue May 29, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330

X-original-commit: fb34900
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue May 29, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330

X-original-commit: fb34900
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue May 29, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330

X-original-commit: fb34900
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue May 29, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330

X-original-commit: fb34900
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue May 29, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330

X-original-commit: fb34900
fw-bot pushed a commit to odoo-dev/odoo that referenced this issue May 29, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes odoo#165330

X-original-commit: fb34900
vava-odoo added a commit to odoo-dev/odoo that referenced this issue May 30, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse_id' in the context may be
the name and not the id.

Fixes odoo#165330

X-original-commit: fb34900
robodoo pushed a commit that referenced this issue May 30, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes #165330

closes #167239

X-original-commit: fb34900
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
robodoo pushed a commit that referenced this issue May 30, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes #165330

closes #167251

X-original-commit: fb34900
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
robodoo pushed a commit that referenced this issue May 30, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes #165330

closes #167268

X-original-commit: fb34900
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
robodoo pushed a commit that referenced this issue May 30, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse' in the context may be the
name and not the id.

Fixes #165330

closes #167278

X-original-commit: fb34900
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
@vava-odoo
Copy link
Contributor

Hi @juppe
Thanks for reporting. This was fixed with the mentioned commit(s) in 16.0 (and more recent versions).
Cheers

robodoo pushed a commit that referenced this issue May 30, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse_id' in the context may be
the name and not the id.

Fixes #165330

closes #167283

X-original-commit: fb34900
Related: odoo/enterprise#63495
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
robodoo pushed a commit that referenced this issue May 30, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse_id' in the context may be
the name and not the id.

Fixes #165330

closes #167283

X-original-commit: fb34900
Related: odoo/enterprise#63495
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
HANNICHE-Walid pushed a commit to odoo-dev/odoo that referenced this issue May 31, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse_id' in the context may be
the name and not the id.

Fixes odoo#165330

closes odoo#167283

X-original-commit: fb34900
Related: odoo/enterprise#63495
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
HANNICHE-Walid pushed a commit to odoo-dev/odoo that referenced this issue May 31, 2024
Steps to reproduce:

- Navigate to Product Variants list view in the Inventory module
- Search for a warehouse e.g. "My Company" in the list view
- Click on any storable product e.g. DESK0005
- In the product form view click on the "Forecasted" button

This gives a traceback because the 'warehouse_id' in the context may be
the name and not the id.

Fixes odoo#165330

closes odoo#167283

X-original-commit: fb34900
Related: odoo/enterprise#63495
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
16.0 Logistics about stock, mrp, delivery, purchase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants