Renaming item name change submited invoices


When a rename an item name or item_code the new name is populated on old submited invoices.
is it wanted and by design ?

My thought was that an invoice should never change after submiting

Only the item name will change. The values change because it fetch data from that table accordingly. So keep the item name same, if you change it, it will change everywhere in the database.

…and the consequence of not updating being that you would break links to the product.

If you want to prevent changing item_code or item_name, make use of the “set only once” attribute… Or elevate the item_code and item_name access level so that all can only ready and only e.g. System Manager can write the values…

@shelteradmin item_code changes with a click on item_name and rename.
item_name can be changed below on field “item name” in the item form.

by default set_only_once is False in item doc.
It is really easy to change item_code / item_name
should set_only_once has to be turned on by default in erpnext?
Here in France laws and regulations impose that an invoice should not be modified after submission.

What seems logical to me is that an invoice on creation should get items name / price / description from linked order, delivery note. (and not from item directly). After that, changing an item code, name should not change invoices, orders, delivery note… @lasalesi do you mean that erpnext is not working like this?

Hi @hiousi,

I agree with you that an artifact like an invoice should not be altered after submission. Generally, this is honored by the fact that the value of each line item is copied into the respective instance of the items. However, the item_code/item_name will trace the parent item. The consequence in most other systems I know is that renaming is not permitted, which can be achieved by set_only_once in ERPNext.

I am not sure if this restriction should be applied by default on installation, as in many cases this is not handled as strictly. But certainly an input worthwile considering.

1 Like

Solution : Document archive : Once invoice posted, make a copy of the PDF of the invoice and store in a DMS for archiving. This will help archiving & compliance. As long as the numbers are the same, the “name” changes, what difference does it make? This is what I plan to do. [automated]

ERP : For small companies is for productivity a small bit of compliance. Not to make it more complex than it is.


@Not_a_countant Document archive can be done, we can also print and archive in a cupboard as we used to do before computers. In my small company my accounter wants software to be in compliance with regulations. If you are telling me that ERPnext is not the right tool for that I will stop that thread.

In the database the table “tabSales Invoice Item” as a row for each item, containing item_code, item_name, description, and more datas like price, discount and so… all copied from the linked document (sales order or delivery…). Copied is not linked right?
This database schema is looking good for me… what is wrong, is why renaming an item renames it in “tabSales Invoice Item”.

Unfortunately, I neither know your accountants requirements on the software :slight_smile: Nor am i an expert at the French law. So I cant say it complies or not :slight_smile:

Sounds about right way to deal with your local accountant ways of working & needs. (Instead of making it a burden for all). ERP software needs to be generic for all. Each user needs to find a solution for your local flavor and configure that way.

The way to think about is the following :

This ERPNext is like a 5000 volt, 25 amp. electricity grid.

Anyone who wants can plug in.

A user might need only 5V/0.25mA to charge his/her lovely shiny iPhone 10. Using a 2 pin plug only.
Perfectly OK requirement, but then you will need to design the step down transformer.
ERPNext wont send you 5V to France. Probably it wont reach anyway.
Because if we build a grid of 5V, there is no way to step it up :frowning:

ERPNext is a software as an infrastructure.
Your appliance needs to plug in.

same concern:

Already addressed with this option?

@Not_a_countant no because set_only_once will disallow renaming an item. set_only_once or elevating rights for items are a workaround, Some people (including me) would like to be able to rename items (code and name) without altering old submited documents.

My suggestion :

  • use “name” as a link between documents. That is exactly what ERPnext do.
  • hide “name”, assign a primary key upon doc creation, use it internaly only, no renaming possible.
  • on document creation copy “item_name” and “item_code” from the linked doc (as we do with prices, discount… copy items to sale orders to invoices)
  • rename “item_name” and “item_code” only on item doc.

Hi @lasalesi

Trust you’re doing great. Neither of your proposed solutions seem to work!

  • “set only once” isn’t available via Customize Form
  • “perm level” change doesn’t seem to restrict the user from renaming the doc!

For example, changing the perm level on the “title” field in a Material Request doc doesn’t seem to restrict users from renaming it. Is this a bug?

Any suggestions on how to get around the issue?


If all that did not work, this might be a nasty workaround:

  • create an additonal hidden field “old title”
  • before_save you check (custom script) if the tilte has changed (or set it in case it is empty. add your code to allow/prevent

Does that work?