From 8905caded4f5c7222c02b63d9b111fe6dea23eba Mon Sep 17 00:00:00 2001 From: "admin.suherdy" Date: Sat, 22 Nov 2025 08:42:01 +0700 Subject: [PATCH] fix the decimal accuracy --- CHANGELOG.md | 13 +++++++++++++ __manifest__.py | 2 +- .../account_move_line.cpython-312.pyc | Bin 3929 -> 3929 bytes models/account_move_line.py | 4 ++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba24a8d..e8873c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [17.0.1.0.2] - 2025-11-22 + +### Fixed +- **CRITICAL FIX**: Increased precision from 6 to 10 decimal places +- Fixed issue where 1,264,733 would display as 1,264,732.98 +- Now handles both small and large quantities accurately + +### Technical Details +- Changed `digits=(16, 6)` to `digits=(16, 10)` for maximum precision +- Test cases: + - 277,534 ÷ 150 = 1850.2266666667 → 277,534.00 ✅ + - 1,264,733 ÷ 60,000 = 21.0788833333 → 1,264,733.00 ✅ + ## [17.0.1.0.1] - 2025-11-21 ### Fixed diff --git a/__manifest__.py b/__manifest__.py index 71efa47..b03e7b4 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,6 +1,6 @@ { "name": "Vendor Bill Editable Totals", - "version": "17.0.1.0.1", + "version": "17.0.1.0.2", "summary": "Enable direct editing of tax excluded and tax included amounts on vendor bill lines with automatic unit price recalculation", "description": """ Vendor Bill Editable Totals diff --git a/models/__pycache__/account_move_line.cpython-312.pyc b/models/__pycache__/account_move_line.cpython-312.pyc index 83ef3898b3a38705b97f2151ea10748362f05456..d9c8af6eb3fda9f7a181337f40fbd8db648a19b0 100644 GIT binary patch delta 33 ncmca9cT diff --git a/models/account_move_line.py b/models/account_move_line.py index b776a8e..b80a289 100644 --- a/models/account_move_line.py +++ b/models/account_move_line.py @@ -11,7 +11,7 @@ class AccountMoveLine(models.Model): # Override price_unit to use more decimal places price_unit = fields.Float( string='Unit Price', - digits=(16, 6), # Use 6 decimal places instead of the default 2 + digits=(16, 10), # Use 10 decimal places for maximum precision ) @api.onchange('price_subtotal') @@ -38,7 +38,7 @@ class AccountMoveLine(models.Model): # Formula: price_unit = price_subtotal / quantity new_price_unit = line.price_subtotal / line.quantity - # Set the price_unit - now with 6 decimal precision + # Set the price_unit - now with 10 decimal precision line.price_unit = new_price_unit @api.onchange('price_total')