@@ -820,6 +820,38 @@ def _check_rule_propositions(self, st_line, amls_values_list):
820820class AccountReconcileModelLine (models .Model ):
821821 _inherit = "account.reconcile.model.line"
822822
823+ # TODO: remove this method if option 'percentage_st_line' is implemented
824+ # in the future
825+ @api .model
826+ def fields_get (self , allfields = None , attributes = None ):
827+ """Hide 'percentage_st_line' from amount_type selection in the UI.
828+
829+ 'percentage_st_line' is not implemented, so we remove it from the selection
830+ options.
831+ """
832+ res = super ().fields_get (allfields = allfields , attributes = attributes )
833+ field_name = "amount_type"
834+
835+ if field_name in res and "selection" in res [field_name ]:
836+ res [field_name ]["selection" ] = [
837+ (key , label )
838+ for key , label in res [field_name ]["selection" ]
839+ if key != "percentage_st_line"
840+ ]
841+ return res
842+
843+ # TODO: remove this method if option 'percentage_st_line' is implemented
844+ # in the future
845+ @api .depends ("rule_type" , "model_id.counterpart_type" )
846+ def _compute_amount_type (self ):
847+ res = super ()._compute_amount_type ()
848+ # If the compute set 'percentage_st_line', change it to 'percentage'.
849+ # percentage_st_line type is not implemented.
850+ for line in self :
851+ if line .amount_type == "percentage_st_line" :
852+ line .amount_type = "percentage"
853+ return res
854+
823855 def _get_write_off_move_line_dict (self , balance , currency ):
824856 self .ensure_one ()
825857 return {
0 commit comments