This commit is contained in:
2026-06-15 20:04:37 +02:00
parent 3a0edea8cd
commit 07e48944b6
7 changed files with 8 additions and 38 deletions

View File

@@ -2,9 +2,4 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//page[@id='costs']" position="inside">
<field name="before_carriages" colspan="4"/>
<field name="after_carriages" colspan="4"/>
</xpath>
</data>

View File

@@ -2,14 +2,4 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//page[@id='other']" position="before">
<page id="costs" string="Costs">
<label name="cost_used"/>
<group id="cost_used" col="-1" colspan="3">
<field name="cost_used" xexpand="0"/>
<field name="cost_currency_used"/>
<field name="cost_edit" xexpand="0" xalign="0"/>
</group>
</page>
</xpath>
</data>

View File

@@ -541,10 +541,11 @@ class Sale(metaclass=PoolMeta):
return lines[0]
@staticmethod
def _format_report_number(value, digits='0.0000', keep_trailing_decimal=False,
strip_trailing_zeros=True):
def _format_report_number(value, digits='0.0000',
keep_trailing_decimal=False, strip_trailing_zeros=True,
use_grouping=False):
value = Decimal(str(value or 0)).quantize(Decimal(digits))
text = format(value, 'f')
text = format(value, ',f' if use_grouping else 'f')
if strip_trailing_zeros:
text = text.rstrip('0').rstrip('.')
if keep_trailing_decimal and '.' not in text:
@@ -1268,7 +1269,8 @@ class Sale(metaclass=PoolMeta):
'amount': amount,
'amount_text': self._format_report_number(
amount, digits='0.01',
strip_trailing_zeros=False),
strip_trailing_zeros=False,
use_grouping=True),
})
return lines

View File

@@ -5072,12 +5072,12 @@ class PurchaseTradeTestCase(ModuleTestCase):
{
'label': 'FOB value in EUR',
'amount': Decimal('2500'),
'amount_text': '2500.00',
'amount_text': '2,500.00',
},
{
'label': 'FREIGHT value in EUR',
'amount': Decimal('59993.75'),
'amount_text': '59993.75',
'amount_text': '59,993.75',
},
])

View File

@@ -2,11 +2,4 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//group[@id='cost_used']" position="after">
<label name="cost_sale_used"/>
<group id="cost_sale_used" col="-1" colspan="3">
<field name="cost_sale_used" xexpand="0"/>
<field name="cost_sale_currency_used"/>
</group>
</xpath>
</data>

View File

@@ -6,14 +6,4 @@ this repository contains the full copyright notices and license terms. -->
<label name="carrier"/>
<field name="carrier"/>
</xpath>
<xpath expr="//page[@id='other']" position="before">
<page id="costs" string="Costs">
<label name="cost_used"/>
<group id="cost_used" col="-1" colspan="3">
<field name="cost_used" xexpand="0"/>
<field name="cost_currency_used"/>
<field name="cost_edit" xexpand="0" xalign="0"/>
</group>
</page>
</xpath>
</data>