Add packing list in account invoice

This commit is contained in:
2026-04-22 20:36:14 +02:00
parent d09d183cdc
commit 99782b5b0e
6 changed files with 1567 additions and 4 deletions

View File

@@ -941,6 +941,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
invoice_report_template='invoice_melya.fodt',
invoice_cndn_report_template='invoice_ict_final.fodt',
invoice_prepayment_report_template='prepayment.fodt',
invoice_packing_list_report_template='packing_list.fodt',
invoice_payment_order_report_template='payment_order.fodt',
purchase_report_template='purchase_melya.fodt',
)
@@ -975,6 +976,12 @@ class PurchaseTradeTestCase(ModuleTestCase):
'report': 'account_invoice/payment_order.fodt',
}),
'account_invoice/payment_order.fodt')
self.assertEqual(
report_class._resolve_configured_report_path({
'name': 'Packing List',
'report': 'account_invoice/packing_list.fodt',
}),
'account_invoice/packing_list.fodt')
def test_invoice_report_raises_when_template_is_missing(self):
'invoice report must fail clearly when no template is configured'
@@ -985,6 +992,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
invoice_report_template='',
invoice_cndn_report_template='',
invoice_prepayment_report_template='',
invoice_packing_list_report_template='',
invoice_payment_order_report_template='',
)
]
@@ -1003,6 +1011,11 @@ class PurchaseTradeTestCase(ModuleTestCase):
'name': 'Payment Order',
'report': 'account_invoice/payment_order.fodt',
})
with self.assertRaises(UserError):
report_class._resolve_configured_report_path({
'name': 'Packing List',
'report': 'account_invoice/packing_list.fodt',
})
def test_sale_report_uses_templates_from_configuration(self):
'sale report paths are resolved from purchase_trade configuration'
@@ -1107,6 +1120,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
invoice_report_label='',
invoice_cndn_report_label='',
invoice_prepayment_report_label='',
invoice_packing_list_report_label='Packing Slip',
invoice_payment_order_report_label='Wire Order',
purchase_report_label='',
shipment_shipping_report_label='',
@@ -1125,6 +1139,8 @@ class PurchaseTradeTestCase(ModuleTestCase):
action_prepayment.name = 'Prepayment'
action_payment_order = Mock(spec=['name'])
action_payment_order.name = 'Payment Order'
action_invoice_packing = Mock(spec=['name'])
action_invoice_packing.name = 'Packing List'
action_purchase = Mock(spec=['name'])
action_purchase.name = 'Purchase'
action_shipping = Mock(spec=['name'])
@@ -1140,10 +1156,11 @@ class PurchaseTradeTestCase(ModuleTestCase):
4: action_cndn,
5: action_prepayment,
6: action_payment_order,
7: action_purchase,
8: action_shipping,
9: action_insurance,
10: action_packing,
7: action_invoice_packing,
8: action_purchase,
9: action_shipping,
10: action_insurance,
11: action_packing,
}
model_data = Mock()
@@ -1169,6 +1186,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
(
[actions[1]], {'name': 'Offer'},
[actions[2]], {'name': 'Draft'},
[actions[7]], {'name': 'Packing Slip'},
[actions[6]], {'name': 'Wire Order'},
))