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.
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.
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”.
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).