OCA / product-attribute

Odoo Product Attribute
https://odoo-community.org/project/product-maintainers-27
GNU Affero General Public License v3.0
181 stars 693 forks source link

Product Dimension, Branch 14 not calculating inches to cubic ft (feet) or inches (in) properly #1378

Open l-arnold opened 1 year ago

l-arnold commented 1 year ago

Module

Product Dimension (Branch 14) product_dimension

Describe the bug

Inches and Ft Measures in Product Dimension are not calculating properly (at all it would seem)

To Reproduce

In Version 14

Steps to reproduce the behavior: I just did a test Enter a Box which is 48 inches Long (4 ft) 12 inches Height (1 ft) 12 inches Width (1 ft)

This should calculate as 4 cubic Ft. The calculator is giving for volume .11 Cubic Ft.

(I just changed to CM, used 100cm x 100cm x 100cm I got 1 cubic meter - so that is correct)

I then went to try 12 in x 12in x 12 in. should yield 1 cubic Ft (ft3) yields .03 cubic ft

Expected behavior Ft and Inch calculations should work as CM (and I presume MM and M) calculations do.

Additional context Add any other context about the problem here. (e.g. OS, Python version, ...)

l-arnold commented 1 year ago

For Clarity, this is error seems to be applying to Product Dimensions and not Product Packaging Dimensions. From my read of the Product Dimensions Code the calculations are focues on CM and Meters primarily. I will see what I can do to get some semblance of consistency. (sadly we work in FT, IN and LB in USA.

gdgellatly commented 1 year ago

well 4ft 1ft 1ft = 0.1135 cubic metres so the module displays cubic metres and it converts correctly. So really all you would need to do is add an option to display as cubic feet and multiply the result by 35.245.

Of course there are other ways, a kwarg to switch uom, a system parameter. Plenty of options.

github-actions[bot] commented 7 months ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

l-arnold commented 7 months ago

I will look at it again. I basically moved into metric, but best if able to work in inches as that is how we submit dimensions generally in USA.

l-arnold commented 7 months ago

@gdgellatly I just ran some simple tests. The module calculates cm and meter entries correctly to cubic meters. 50cm x 50cm x 50cm = .125 cubic M. (shows .13 with my rounding)

What appears to happen is that the calculations are always correct to Cubic Meters, so if entered in feet, inches, meters, cm, the number for the "volume" that shows is the volume in Cubic Meters. This is even if the UOM for the Volume is set to cubic Ft, cubic Inches etc.

It does well calculating to cubic Meters. I feel it would be good if it would calculate to the selected UOM.

Cubic Meters Screenshot: https://capture.dropbox.com/E6VYBTYrWJiT3fVP

19.685inches = 50 CM =which cubed = 1/8 cubic Meter. Cubic Ft Screenshot (shows the same) https://capture.dropbox.com/XLad9DLiIJ8b8u6G

So the important part is to put out dim volume in Cubic Meters, and subjects like length then in CM or Meters. That said, in the US, most parcel dimensions are listed in Inches, and normally cubic volume is seldom entered even in Cube (as a starting point) unless one is doing a pallet or container. At least in my experience anyway.

Thanks for your response above. Helpful.

github-actions[bot] commented 4 weeks ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.