Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sale_order_invoice_amount/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _compute_invoice_amount(self):
and rec.currency_id != invoice.company_currency_id
):
rec.invoiced_amount += invoice.currency_id._convert(
invoice.amount_total_signed,
invoice.amount_total_in_currency_signed,
rec.currency_id,
invoice.company_id,
invoice.invoice_date or fields.Date.today(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ def test_02_sale_order_invoiced_amount_different_currencies_invoice(self):
}
)
test_invoice.action_post()
self.assertAlmostEqual(
self.assertEqual(
self.sale_order_1.invoiced_amount,
242.0,
delta=1,
242.11,
"Invoiced Amount should be 242.11.",
)
self.assertEqual(
self.sale_order_1.uninvoiced_amount,
Expand Down Expand Up @@ -311,10 +311,10 @@ def test_03_sale_order_invoiced_amount_different_currencies_sale(self):
}
)
test_invoice.action_post()
self.assertAlmostEqual(
self.assertEqual(
self.sale_order_1.invoiced_amount,
242.0,
delta=40,
242.13,
"Invoiced Amount should be 242.13.",
)
self.assertEqual(
self.sale_order_1.uninvoiced_amount,
Expand Down Expand Up @@ -387,10 +387,10 @@ def test_03_sale_order_invoiced_amount_different_currencies_sale(self):
]
)
test_invoice.action_post()
self.assertAlmostEqual(
self.assertEqual(
self.sale_order_1.invoiced_amount,
363.0,
delta=100,
363.06,
"Invoiced Amount should be 363.06.",
)
self.assertEqual(
self.sale_order_1.uninvoiced_amount,
Expand Down