How to extend Stock - Item?

Hi all,

I presume Item is a product (after the reading the doc).

If I want to add a new row to Stock - Item (SKU or ean13 barcode), should I add directly to the Item doctype? The only concern I have is what if I trigger a bench update, which will update the core files. Wouldn’t my new row being deleted?

or should I create a new module (code wise) to extend existing Doctype?

In odoo, it’s either to write a code or use inherit (tied to database).

What’s the best way to handle such extension?

Thanks.

Use Customize Form to do this.

1 Like

If i use your way
https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/customize-form.html (believe this is the one)

how do i move that changes to a new db? i just want to move the schema or field changes, not data. is that possible?

example, when create a new doctype will auto generate .json file. Something like this way.

I’m not sure about moving to a new db, I thought you were just talking about a single installation. In that case a frappe app is probably your best bet, though I have no experience in that.

1 Like

yeah i am looking at creating an app to extend if possible. any tips ?

@ericmachine88 frappe saves most of the changes in the DB not only in the source code so when you backup and move your erpnext it will move the changes with it, that includes the written custom doctypes…

when you update erpnext will not delete your modifications, but it work like it will go to search for the modified code from erpnext team and make changes to it, but not the changes that you have made by your self, so it will not delete any thing you have customized when updating or upgrading the system…

1 Like

just wonder… in odoo, i could create a lot of custom modules, which i could pick and install for any future setup …

having it installed in DB, means limiting myself

example, create doctype & docfields in code level instead of UI if that is possible?

There is no limitations, it’s an extra bonus if you understood what I meant and the docs also explain…

When you treat a doc type in the UI it’s also made by python and frappe in source code as files not only as a db entry, and yes you can do the customizations by source code by going to
$/frappe-bench/apps/erpnext
And you will see in there all doc types including the customs apps /modules /doctypes…

1 Like

awesome :slight_smile: thanks

Hi @ramielian,
I have a question about that with a very big importance for me.
I have a custom app, and a web form for that, connected to Opportunities base doc type.
I need to customize the Opportunity base doctype, to meet my new web form needs.

My question is: if I’m updating the Opportunities base doctype, using Customize Form, when installing my custom app in a new fresh frappe, bench …and so on, a totally new and fresh frappe, my customization on the Opportunities base form will still be reflected, when installing custom app?

thank you in advance for your time?