[FIX] account_facturx: gross price must be subtotal not unit price

Facturx expects line price to be subtotal, not unit price. Odoo parser
is also dividing the gross price by quantity. So before this commit,
importing PDF invoice rendered by Odoo, results in: unit price / quantity.

The bug was introduced in odoo/odoo#53894

closes odoo/odoo#77527

X-original-commit: 3769a6cdda259a839f00267d99a57f2aa3d89aa1
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
Uku Lagle
2021-10-04 07:56:54 +00:00
committed by qdp-odoo
parent 1b0f165a2f
commit a9f19d09dd
2 changed files with 3 additions and 3 deletions
@@ -29,7 +29,7 @@
<ram:GrossPriceProductTradePrice>
<ram:ChargeAmount
t-att-currencyID="record.currency_id.name"
t-esc="format_monetary(line.price_unit, record.currency_id)"/>
t-esc="format_monetary(line.price_subtotal, record.currency_id)"/>
<!-- Discount. -->
<ram:AppliedTradeAllowanceCharge t-if="line.discount">
@@ -82,7 +82,7 @@ class TestAccountEdiFacturx(AccountEdiTestCommon):
</SpecifiedTradeProduct>
<SpecifiedLineTradeAgreement>
<GrossPriceProductTradePrice>
<ChargeAmount currencyID="Gol">275.000</ChargeAmount>
<ChargeAmount currencyID="Gol">1100.000</ChargeAmount>
<AppliedTradeAllowanceCharge>
<ChargeIndicator>
<Indicator>true</Indicator>
@@ -164,7 +164,7 @@ class TestAccountEdiFacturx(AccountEdiTestCommon):
applied_xpath = '''
<xpath expr="//GrossPriceProductTradePrice/ChargeAmount" position="replace">
<ChargeAmount currencyID="Gol">275.000</ChargeAmount>
<ChargeAmount currencyID="Gol">1000.000</ChargeAmount>
</xpath>
<xpath expr="//SpecifiedLineTradeSettlement" position="replace">
<SpecifiedLineTradeSettlement>