@@ -508,20 +508,24 @@ 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 ):
514515 line_vals = self ._get_manual_reconcile_vals ()
516+
515517 line_vals ["kind" ] = (
516518 line ["kind" ] if line ["kind" ] != "suspense" else "other"
517519 )
518520 line .update (line_vals )
519- if line ["kind" ] == "liquidity" :
521+
522+ edited_is_liquidity = line .get ("kind" ) == "liquidity"
523+ if edited_is_liquidity :
520524 self ._update_move_partner ()
525+
521526 if self .manual_line_id and self .manual_line_id .id == line .get (
522527 "original_exchange_line_id"
523528 ):
524- # Now, we should edit the amount of the exchange rate
525529 amount = self ._get_exchange_rate_amount (
526530 self .manual_amount ,
527531 self .manual_amount_in_currency ,
@@ -544,6 +548,30 @@ def _onchange_manual_reconcile_vals(self):
544548 )
545549 self .can_reconcile = self .reconcile_data_info .get ("can_reconcile" , False )
546550
551+ # Ensure the UI shows consistent partner across all displayed lines:
552+ # only when editing liquidity line
553+ if not edited_is_liquidity :
554+ return
555+ partner_value = (
556+ [self .manual_partner_id .id , self .manual_partner_id .display_name ]
557+ if self .manual_partner_id
558+ else False
559+ )
560+ info = dict (self .reconcile_data_info or {})
561+ reconcile_lines = list (info .get ("data" ) or [])
562+ if not reconcile_lines :
563+ self .reconcile_data_info = info
564+ return
565+ updated_lines = []
566+ for line in reconcile_lines :
567+ new_line = dict (line )
568+ # Update only the "other" displayed line(s)
569+ if new_line .get ("kind" ) != "liquidity" :
570+ new_line ["partner_id" ] = partner_value
571+ updated_lines .append (new_line )
572+ info ["data" ] = updated_lines
573+ self .reconcile_data_info = info
574+
547575 def _update_move_partner (self ):
548576 if self .partner_id == self .manual_partner_id :
549577 return
0 commit comments