Please enter Lead / Customer / Supplier first

I am getting this error right after selecting a Supplier in Purchase order form.

I could not find the source of the error. Upon scanning/searching the code, I found this was coded in party.js line 317.

But I could not trace the source.
The error pops up right after selecting any supplier in PO.

Check video:
Recording2024-11-14211223-ezgif.com-optimize

Also I got this in console:

Can anyone help me solve this please ? How do I identify the source of this error ?

Which version?

We tested in the latest v15 and v14 but we haven’t found the issue.

I am on v15 latest.
This problem is not global. I have tested in fresh installations. This must have occured due to some customizations we have made to Purchase order. We are not sure which one.

But when we removed all customizations, the problem disappeared. Nevertheless, some form-level customizations should not have given such a problem.

I thought, if such error is occuring, it must be a bug.