Improve linkage report layout
This commit is contained in:
@@ -6562,7 +6562,17 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
ShipmentIn = Pool().get('stock.shipment.in')
|
||||
shipment = ShipmentIn()
|
||||
shipment.bl_date = datetime.date(2026, 4, 30)
|
||||
shipment.fees = []
|
||||
freight_product = SimpleNamespace(
|
||||
rec_name='[Maritime Freight] Maritime freight',
|
||||
name='Maritime freight')
|
||||
shipment.fees = [
|
||||
SimpleNamespace(
|
||||
id=201, product=freight_product, price=Decimal('10'),
|
||||
quantity=Decimal('1'), mode='lumpsum', p_r='pay'),
|
||||
SimpleNamespace(
|
||||
id=202, product=freight_product, price=Decimal('15'),
|
||||
quantity=Decimal('1'), mode='lumpsum', p_r='pay'),
|
||||
]
|
||||
shipment.moves = []
|
||||
shipment.lotqt = []
|
||||
|
||||
@@ -6637,6 +6647,12 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
self.assertIn('Sales', shipment.report_linkage_summary_groups)
|
||||
self.assertIn('-8,000.000', shipment.report_linkage_summary_estimated)
|
||||
self.assertIn('10,000.000', shipment.report_linkage_summary_estimated)
|
||||
summary_rows = shipment._get_report_linkage_summary_rows()
|
||||
freight_rows = [
|
||||
row for row in summary_rows
|
||||
if row[0] == 'Costs' and row[1] == 'Maritime freight']
|
||||
self.assertEqual(len(freight_rows), 1)
|
||||
self.assertEqual(freight_rows[0][2], Decimal('-25'))
|
||||
self.assertIn('P-10', shipment.report_linkage_movement_references)
|
||||
self.assertIn('S-20', shipment.report_linkage_movement_references)
|
||||
self.assertIn('100 MT', shipment.report_linkage_movement_quantities)
|
||||
|
||||
Reference in New Issue
Block a user