Fee report

This commit is contained in:
2026-06-17 11:25:33 +02:00
parent 02e5c43f3d
commit 8441bf98e7
5 changed files with 85 additions and 27 deletions

View File

@@ -5537,6 +5537,23 @@ class PurchaseTradeTestCase(ModuleTestCase):
self.assertEqual(Fee._get_generated_purchases_to_delete([fee]), [])
def test_fee_report_invoice_delegates_to_fee_invoice(self):
'fee report invoice button invoices the underlying fees'
FeeReport = Pool().get('fee.report')
report = FeeReport()
report.id = 10
fee_model = Mock()
fees = [Mock(id=10)]
fee_model.browse.return_value = fees
with patch('trytond.modules.purchase_trade.fee.Pool') as PoolMock:
PoolMock.return_value.get.return_value = fee_model
FeeReport.invoice([report])
fee_model.browse.assert_called_once_with([10])
fee_model.invoice.assert_called_once_with(fees)
def test_sale_report_converts_mixed_units_for_total_and_words(self):
'sale report totals prefer the virtual lot unit as common unit'
Sale = Pool().get('sale.sale')