Skip to content

Commit 3121cf9

Browse files
committed
[ADD] sale_order_price_precision: set specific decimal precison for sales prices
1 parent 04d5c84 commit 3121cf9

File tree

13 files changed

+84
-0
lines changed

13 files changed

+84
-0
lines changed

sale_order_price_precision/README.rst

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright 2026 Open Source Integrators
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
from . import models
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2026 Open Source Integrators
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Sale Order Price Precision",
5+
"summary": "Add decimal precision for sale order and invoice prices",
6+
"version": "17.0.1.0.0",
7+
"author": "Open Source Integrators, Odoo Community Association (OCA)",
8+
"website": "https://github.com/OCA/sale-workflow",
9+
"category": "Sales",
10+
"depends": [
11+
"sale",
12+
"account",
13+
],
14+
"data": [
15+
"data/decimal_precision_data.xml",
16+
],
17+
"installable": True,
18+
"auto_install": False,
19+
"license": "AGPL-3",
20+
"application": False,
21+
"development_status": "Beta",
22+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo noupdate="1">
3+
<!-- Decimal Precision for Product Price Sales -->
4+
<record forcecreate="True" id="decimal_price_sales" model="decimal.precision">
5+
<field name="name">Product Price Sales</field>
6+
<field name="digits">2</field>
7+
</record>
8+
</odoo>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2026 Open Source Integrators
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
from . import account_move_line
4+
from . import sale_order
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2026 Open Source Integrators
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class AccountMoveLine(models.Model):
8+
_inherit = "account.move.line"
9+
10+
# Override price_unit to use Product Price Sales decimal precision
11+
price_unit = fields.Float(
12+
string="Unit Price",
13+
digits="Product Price Sales",
14+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2026 Open Source Integrators
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class SaleOrderLine(models.Model):
8+
_inherit = "sale.order.line"
9+
10+
# Override price_unit to use Product Price Sales decimal precision
11+
price_unit = fields.Float(
12+
string="Unit Price",
13+
digits="Product Price Sales",
14+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
To configure the decimal precision for sale order prices:
2+
3+
1. Go to Settings > Technical > Database Structure > Decimal Accuracy
4+
2. Find "Product Price Sales" in the list
5+
3. Adjust the number of decimal digits as needed (default: 2)
6+
4. Save your changes
7+
8+
The precision will apply to all sale order line prices throughout the system.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Open Source Integrators <https://opensourceintegrators.com>
2+
* Daniel Reis <dreis@opensourceintegrators.com>

0 commit comments

Comments
 (0)