Purchase Invoice was created even Purchase Receipt is required


I am experiencing an issue regarding with the creation of Purchase Invoice even it was set as required on Buying Settings. It seems to work on a same user with administrator access but when I use an account with specific permission, it does not work.

And also, the requiring works on an instance in which the Purchase Invoice was created without referring on created Purchase Order.

So you want when creating purchase invoice if I have not created purchase receipt before then system show message not to submit it to PI

Yes, the system will prevent the user to create Purchase Invoice when there is no Purchase Receipt associated with it.

So you have to code for this

Can you share the error message ?