[FIX] contract: subtotal miscalculated when price_unit displayed with fewer digits than actual value

This commit addresses an issue in the "contract" module where the subtotal was incorrectly calculated when the price_unit field was displayed with fewer digits than its actual value, resulting in discrepancies of a few cents.

The change made in this commit is: Adding the digits attribute with the value "Product Price" to the price_unit field, ensuring the proper display of decimal places, leading to accurate subtotal calculations and eliminating cent discrepancies.
This commit is contained in:
Eric Antones
2023-03-21 23:13:02 +01:00
parent 9e413a48fc
commit a679854853
2 changed files with 2 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ class ContractAbstractContractLine(models.AbstractModel):
string="Unit Price",
compute="_compute_price_unit",
inverse="_inverse_price_unit",
digits="Product Price",
)
price_subtotal = fields.Float(
compute="_compute_price_subtotal",

View File

@@ -14,3 +14,4 @@
* Rafael Blasco
* Víctor Martínez
* Iván Antón <ozono@ozonomultimedia.com>
* Eric Antones <eantones@nuobit.com>