Usererror message not shown on the tryton interface

Hi,

I need some help i have a condition related to a specifc field where i want to show me a usererror text if a field is not exist

here is my code >

                if not supplier_party:
                    print(f"Supplier '{supplier_name}' not found.")
                    raise UserError(gettext(
                    'operation_doc.msg_missing_supplier_party'))

These lines of codes is part of a function related to a button to press
—>i can see the print result in the terminal but the raise UserError(gettext… doesnt work because nothing appear on the tryton interface .

any help will be appreciated

Thanks

What is the result of the JSON-RPC call to the button?
Is it the error?

Hi Mr.ced Yes, when the JSON-RPC call is made to the button, I see the following result in the terminal logs:

Supplier 'developer2' not found.  
Error processing record : The supplier party is missing for the record "%(record)s".  

It does not appear on the Tryton interface. Instead, it is logged in the terminal where the server is running.

I do not understand because this does not look like JSON.