@@ -455,6 +455,18 @@ def test_riba_fatturapa(self):
455455 },
456456 )
457457 ],
458+ "related_document_ids" : [
459+ (
460+ 0 ,
461+ 0 ,
462+ {
463+ "type" : "order" ,
464+ "name" : "SO1232" ,
465+ "cig" : "7987210EG5" ,
466+ "cup" : "H71N17000690124" ,
467+ },
468+ )
469+ ],
458470 }
459471 )
460472 invoice ._onchange_riba_partner_bank_id ()
@@ -472,8 +484,12 @@ def test_riba_fatturapa(self):
472484 riba_list_id = action and action ["res_id" ] or False
473485 riba_list = self .slip_model .browse (riba_list_id )
474486 riba_list .confirm ()
487+ self .assertEqual (riba_list .line_ids [0 ].cig , "7987210EG5" )
488+ self .assertEqual (riba_list .line_ids [0 ].cup , "H71N17000690124" )
475489 wizard_riba_export = self .env ["riba.file.export" ].create ({})
476490 wizard_riba_export .with_context (active_ids = [riba_list .id ]).act_getfile ()
491+ riba_txt = base64 .decodebytes (wizard_riba_export .riba_txt )
492+ self .assertTrue (b"CIG: 7987210EG5 CUP: H71N17000690124" in riba_txt )
477493 # Assert
478494 file_content = base64 .decodebytes (wizard_riba_export .riba_txt ).decode ()
479495 self .assertNotIn ("INV/2025/00004" , file_content )
@@ -508,6 +524,18 @@ def test_riba_fatturapa_group(self):
508524 },
509525 )
510526 ],
527+ "related_document_ids" : [
528+ (
529+ 0 ,
530+ 0 ,
531+ {
532+ "type" : "order" ,
533+ "name" : "SO1232" ,
534+ "cig" : "7987210EG5" ,
535+ "cup" : "H71N17000690124" ,
536+ },
537+ )
538+ ],
511539 }
512540 )
513541 invoice ._onchange_riba_partner_bank_id ()
@@ -533,6 +561,18 @@ def test_riba_fatturapa_group(self):
533561 },
534562 )
535563 ],
564+ "related_document_ids" : [
565+ (
566+ 0 ,
567+ 0 ,
568+ {
569+ "type" : "order" ,
570+ "name" : "SO1232" ,
571+ "cig" : "7987210EG5" ,
572+ "cup" : "H71N17000690125" ,
573+ },
574+ )
575+ ],
536576 }
537577 )
538578 invoice1 ._onchange_riba_partner_bank_id ()
@@ -556,6 +596,9 @@ def test_riba_fatturapa_group(self):
556596 self .assertTrue (len (riba_list .line_ids ), 2 )
557597 wizard_riba_export = self .env ["riba.file.export" ].create ({})
558598 wizard_riba_export .with_context (active_ids = [riba_list .id ]).act_getfile ()
599+ riba_txt = base64 .decodebytes (wizard_riba_export .riba_txt )
600+ self .assertTrue (b"CIG: 7987210EG5 CUP: H71N17000690124" in riba_txt )
601+ self .assertTrue (b"CIG: 7987210EG5 CUP: H71N17000690125" in riba_txt )
559602 # Assert
560603 file_content = base64 .decodebytes (wizard_riba_export .riba_txt ).decode ()
561604 self .assertNotIn ("INV/2025/00008" , file_content )
0 commit comments