Set different naming series for each company ​

If you run many companies in one ERPNext site, you can give each company its own series of IDs. For example, Sales Invoices of Company A get SINV-A-0001, and those of Company B get SINV-B-0001.

Prerequisites ​

  • The System Manager role.
  • An abbreviation for each company, in the Abbr field of the Company.

Use the company abbreviation in the series ​

The .ABBR. part of a naming series gives the abbreviation of the document's company.

  1. Open Document Naming Settings.
  2. In Select Transaction, select the DocType, for example Sales Invoice.
  3. In Series List for this Transaction, add SINV-.ABBR.-.####. To make it the default, put it on the first line.
  4. Select Update.
  5. Repeat for each DocType that needs company-wise IDs.

Create a Sales Invoice, and select the company. When you save, the ID uses the company's abbreviation, for example SINV-A-0001. Each company gets its own numbering, because each prefix is a separate series.

Use another company field ​

To use another value of the company, for example a short code that you keep in a custom field, fetch the value into the document:

  1. Open Customize Form for Sales Invoice.
  2. Below the Company field, add a Data field with Fetch From set to company.<field name>. Select Hidden if users do not need to see it.
  3. Note its field name, for example custom_company_code.
  4. Select Update.
  5. In Document Naming Settings, add the series SINV-.custom_company_code.-.####.