Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
1e22870d
Commit
1e22870d
authored
8 years ago
by
Nicolas Martinelli
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] product_margin: crash of read_group
Introduced by
9a479e65
parent
3667516a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/product_margin/models/product_product.py
+2
-2
2 additions, 2 deletions
addons/product_margin/models/product_product.py
with
2 additions
and
2 deletions
addons/product_margin/models/product_product.py
+
2
−
2
View file @
1e22870d
...
...
@@ -50,7 +50,7 @@ class ProductProduct(models.Model):
"""
Inherit read_group to calculate the sum of the non-stored fields, as it is not automatically done anymore through the XML.
"""
res
=
super
(
ProductProduct
,
self
).
read_group
(
fields
,
groupby
,
offset
=
offset
,
limit
=
limit
,
orderby
=
orderby
,
lazy
=
lazy
)
res
=
super
(
ProductProduct
,
self
).
read_group
(
domain
,
fields
,
groupby
,
offset
=
offset
,
limit
=
limit
,
orderby
=
orderby
,
lazy
=
lazy
)
fields_list
=
[
'
turnover
'
,
'
sale_avg_price
'
,
'
sale_purchase_price
'
,
'
sale_num_invoiced
'
,
'
purchase_num_invoiced
'
,
'
sales_gap
'
,
'
purchase_gap
'
,
'
total_cost
'
,
'
sale_expected
'
,
'
normal_cost
'
,
'
total_margin
'
,
'
expected_margin
'
,
'
total_margin_rate
'
,
'
expected_margin_rate
'
]
...
...
@@ -66,7 +66,7 @@ class ProductProduct(models.Model):
for
prod
in
products
:
prod_re
[
prod
]
=
re_ind
re_ind
+=
1
res_val
=
tot_products
.
_compute_product_margin_fields_values
([
x
for
x
in
fields
if
fields
in
fields_list
]
,
''
)
res_val
=
tot_products
.
_compute_product_margin_fields_values
(
field_names
=
[
x
for
x
in
fields
if
fields
in
fields_list
])
for
key
in
res_val
.
keys
():
for
l
in
res_val
[
key
].
keys
():
re
=
res
[
prod_re
[
key
]]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment