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

[8.0][product_dimension][FIX] Fix volume being incorrectly calculated due to rounding issues. #284

Merged
merged 3 commits into from
Jul 24, 2017
Merged

Conversation

ivantodorovich
Copy link
Contributor

Without this fix, volume was being incorrectly calculated in some cases.

For instance,

UOM: cm
Length: 57.00
Height: 8.00
Width: 19.50

Resulting volume: 0.005 when it should be 0.009 (0.008892, if not rounded)

@ivantodorovich
Copy link
Contributor Author

ping @jjscarafia

Copy link

@lasley lasley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, otherwise 👍

@@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
'name': 'Product Dimension',
'version': '8.0.2.0.0',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only be increased a patch version. 8.0.2.0.1

@@ -83,7 +84,8 @@ def convert_to_meters(self, measure, dimensional_uom):
return self.env['product.uom']._compute_qty_obj(
from_unit=dimensional_uom,
qty=measure,
to_unit=uom_meters)
to_unit=uom_meters,
round=False)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a trailing comma & put the ) on the next line. Notice how you had to edit two lines to diff in order for one line of change? The trailing comma + ) on its own line prevents this & reduces the possibility for conflicts.

@lasley
Copy link

lasley commented Jul 24, 2017

@moylop260 - the Runbot build on this is skipping for some reason. The only way I know of to identify the reasoning for this is in the server logs themselves - is there another way?

@moylop260
Copy link
Contributor

The .travis.yml looks like as a too old version.
Could you try updating from https://github.com/OCA/maintainer-quality-tools/blob/master/sample_files/.travis.yml template?

@ivantodorovich
Copy link
Contributor Author

ivantodorovich commented Jul 24, 2017

Let me know if it's ok now, and I'll squash commits.

@lasley lasley merged commit 1c321fc into OCA:8.0 Jul 24, 2017
@lasley
Copy link

lasley commented Jul 24, 2017

Thanks @ivantodorovich. No need on the squash, it's a merge option as long as we're squashing everything 👍

pedrobaeza added a commit that referenced this pull request Mar 13, 2018
[9.0][product_dimension][FIX] Fix volume being incorrectly calculated due to rounding issues (#284)2
pedrobaeza added a commit that referenced this pull request Mar 13, 2018
[10.0][product_dimension][FIX] Fix volume being incorrectly calculated due to rounding issues (#284)
BT-rmartin referenced this pull request in brain-tec/product-attribute Apr 20, 2018
* rename product_dimensions -> product_dimension

osv -> orm

test computation of volume in same UOM

add test with conversion from cm

refactor, new API, generic UOM computation

fix wording in readme

do not use camelcase for Models

put dimensions in their own group

Otherwise they are shown as weights.

fill in placeholders in README

README is actually rst, not md

use a new-api onchange, update tests, refactor

Also, spell "height" correctly.

* Add missing default oca icons

* [ADD] Dimensions fields in product.template

FIX remove oldname in field height

ADD onchange calculate volume on product template

* [UPD] prefix versions with 8.0

* [MIG] Make modules uninstallable

* [FIX] product_dimension: Now domain on dimensional_uom_id is working also with other languages than english

* [FIX] flake 8 error on modules product_dimension, product_gtin, product_supplierinfo_tree_price_info

* ADD test case with product template

REF remove executable permission

ADD missing tag images

Conflicts:
	product_dimension/__openerp__.py

* Module structure, views & license headers

[MIG] Make modules uninstallable

[MIG] Rename manifest files

* [MIG] product_dimension: Migration to 11.0

* [9.0][product_dimension][FIX] Fix volume being incorrectly calculated due to rounding issues (#284)2

* [MIG]: Adding suggested changes
rvalyi pushed a commit to akretion/product-attribute that referenced this pull request May 25, 2019
EmailsGmails pushed a commit to avoinsystems/product-attribute that referenced this pull request Apr 15, 2020
emagdalenaC2i pushed a commit to Change2improve/product-attribute that referenced this pull request Oct 13, 2020
michotm pushed a commit to michotm/product-attribute that referenced this pull request Nov 4, 2020
celm1990 pushed a commit to celm1990/product-attribute that referenced this pull request Dec 16, 2021
ajaniszewska-dev pushed a commit to ajaniszewska-dev/product-attribute that referenced this pull request Dec 17, 2021
FrancoMaxime pushed a commit to acsone/product-attribute that referenced this pull request Oct 11, 2022
lethuthao2403 pushed a commit to lethuthao2403/product-attribute that referenced this pull request Dec 1, 2023
StefanRijnhart pushed a commit to StefanRijnhart/product-attribute that referenced this pull request Oct 10, 2024
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.

5 participants