How to restrict a user to create a credit invoice

Is there any way to restrict the creation of a credit invoice?

For example, a user can create an out invoice with positive total amount, but the same should not create or press the button post when the invoice has negative total amount.

Thanks!

I guess you could use a record rule for create and write access that applies on negative out invoice.

Thanks! I did it and works as expected!