@@ -508,6 +508,7 @@ def _onchange_manual_reconcile_vals(self):
508508 in_currency_date ,
509509 )
510510 self .previous_manual_amount_in_currency = self .manual_amount_in_currency
511+ edited_is_liquidity = False
511512 for line in data :
512513 if line ["reference" ] == self .manual_reference :
513514 if self ._check_line_changed (line ):
@@ -516,7 +517,8 @@ def _onchange_manual_reconcile_vals(self):
516517 line ["kind" ] if line ["kind" ] != "suspense" else "other"
517518 )
518519 line .update (line_vals )
519- if line ["kind" ] == "liquidity" :
520+ edited_is_liquidity = line .get ("kind" ) == "liquidity"
521+ if edited_is_liquidity :
520522 self ._update_move_partner ()
521523 if self .manual_line_id and self .manual_line_id .id == line .get (
522524 "original_exchange_line_id"
@@ -544,6 +546,30 @@ def _onchange_manual_reconcile_vals(self):
544546 )
545547 self .can_reconcile = self .reconcile_data_info .get ("can_reconcile" , False )
546548
549+ # Ensure the UI shows consistent partner across all displayed lines:
550+ # only when editing liquidity line
551+ if not edited_is_liquidity :
552+ return
553+ partner_value = (
554+ [self .manual_partner_id .id , self .manual_partner_id .display_name ]
555+ if self .manual_partner_id
556+ else False
557+ )
558+ info = dict (self .reconcile_data_info or {})
559+ reconcile_lines = list (info .get ("data" ) or [])
560+ if not reconcile_lines :
561+ self .reconcile_data_info = info
562+ return
563+ updated_lines = []
564+ for line in reconcile_lines :
565+ new_line = dict (line )
566+ # Update only the "other" displayed line(s)
567+ if new_line .get ("kind" ) != "liquidity" :
568+ new_line ["partner_id" ] = partner_value
569+ updated_lines .append (new_line )
570+ info ["data" ] = updated_lines
571+ self .reconcile_data_info = info
572+
547573 def _update_move_partner (self ):
548574 if self .partner_id == self .manual_partner_id :
549575 return
0 commit comments