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

[FIX] stock: inventory value #31280

Closed
wants to merge 1 commit into
base: 10.0
from

Conversation

Projects
None yet
3 participants
@nim-odoo
Copy link
Contributor

nim-odoo commented Feb 20, 2019

  • Go to Inventory > Reports > Inventory Valuation
  • Select the pivot view

The top row (containing the Total) has an empty 'Inventory Value'.

This is because there is no domain on the line, so it is skipped.

We fall back on the global domain instead.

opw-1933191

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

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

[FIX] stock: inventory value
- Go to Inventory > Reports > Inventory Valuation
- Select the pivot view

The top row (containing the Total) has an empty 'Inventory Value'.

This is because there is no domain on the line, so it is skipped.

We fall back on the global domain instead.

opw-1933191

@robodoo robodoo added the seen 🙂 label Feb 20, 2019

@nim-odoo nim-odoo self-assigned this Feb 20, 2019

@nim-odoo nim-odoo added the OE label Feb 20, 2019

@robodoo robodoo added the CI 🤖 label Feb 20, 2019

@nim-odoo

This comment has been minimized.

Copy link
Contributor Author

nim-odoo commented Feb 21, 2019

robodoo r+

robodoo pushed a commit that referenced this pull request Feb 21, 2019

[FIX] stock: inventory value
- Go to Inventory > Reports > Inventory Valuation
- Select the pivot view

The top row (containing the Total) has an empty 'Inventory Value'.

This is because there is no domain on the line, so it is skipped.

We fall back on the global domain instead.

opw-1933191

closes #31280
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Feb 21, 2019

Staging failed: ci/runbot (view more at http://runbot.odoo.com/runbot/build/455353)

@nim-odoo

This comment has been minimized.

Copy link
Contributor Author

nim-odoo commented Feb 21, 2019

robodoo retry

inv_value = 0.0
for line2 in lines:
inv_value += line2.inventory_value
line['inventory_value'] = inv_value

This comment has been minimized.

@hbto

hbto Feb 21, 2019

Contributor

wouldn't it be shorter to write:

lines = self.search(line.get('__domain', domain))
line['inventory_value'] = sum(lines.mapped('inventory_value'))
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Feb 21, 2019

Staging failed: ci/runbot (view more at http://runbot.odoo.com/runbot/build/455534)

@nim-odoo

This comment has been minimized.

Copy link
Contributor Author

nim-odoo commented Feb 21, 2019

robodoo retry

@robodoo robodoo added merged 🎉 and removed merging 👷 labels Feb 21, 2019

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Feb 21, 2019

Merged, thanks!

@robodoo robodoo closed this Feb 21, 2019

@nim-odoo nim-odoo deleted the odoo-dev:10.0-opw-1933191-inv_value-nim branch Feb 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.