ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

"Represents Company Must be Unique

bug
customerstory

#1

I can’t create a New Customer. When I enter basic information (customer name, customer group, type and territory. Everything else is blank) I get the following error message “Represents Company must be unique”.

I’ve created over 500 Customers and never had an issue. Has anyone else had this problem.

Thanks
Joe


#2

I believe some info about the version u are using may be helpful


#3

Thank you
Installed Apps
ERPNext: v11.1.13 (master)
Frappe Framework: v11.1.13 (master)


#4

the same for me:


#5

Yes I now have the same problem. ERPNext: v11.1.10

Chris
It appears to be something to do with “Is internal customer”.
There is a new field in there when you check it “represents company”
Edited doctype customer so “represents customer” id no longer unique. now works OK.


#6

so should that be reported as a bug on github?


#7

so now, as we have figured out after quite a while where it should have been part of the initial post, it is clear that this happens for “internal customers” I’d say … this is how it is designed, and completely makes sense.

Unless anybody gives me a good reason why there should be more then 1 internal Customer representing your own “Company A” towards your other own “Company B”.


#8

i’m not sure if i get you right. do you mean it’s not a bug, it’s a feature?

because the internal customer field is not checked in my case and i still receivce this message. can you explain why that should be designed in?


#9

ok, that is a bug. I didn’t catch the “is internal customer” being unchecked part


seems you guys are pretty new to ERPNext, so this guide on how to post an issue on github may be worth a read


#10

Yes it definitely come up when internal customer is Unchecked.

The work around I did was create internal customer then update to remove internal customer. Not ideal but it worked.

This is definitely a bug.


#11

thanks for the analysis. then it should be reported. are you going to open an issue for that?


[v11.1.13] Error while creating a customer
#12

I have a very similar issue. I create customers programmatically. Even if I set ‘is_internal_customer’ to 0 and ‘represents_company’ to “” or None, the created customer - calling frappe.get_doc({dictionary of values}) - has a represents_company value set to the only Company that we have set up. The workaround is to immediately set:
frappe.db.set_value(‘Customer’, docname, ‘represents_company’, None)
after creating the Customer. Setting it to “” causes the same problem (the next Customer has a non-unique represents_company of “”, with MySQL and MariaDB treating NULL as a special case for UNIQUE I think).


#13

Tried your work around, but it doesn’t work for me, I get the same error whether I try to create an internal customer or not…

Anyone else found a workaround ? This is clearly annoying and needs to be solved pretty fast…


#14

Problem resolved: I had another look at my privileges. Click in your User Name top righthand side of screen > My Settings > Check Customer box.


Unable to create sales order from quotation
[v11.1.13] Error while creating a customer
#15

That’s right. It’s empty.


#16