Inheritance concept in ERPNext

How can we inherit the base module and add new functionalities according to our requirements in ERPNext.

We want to run multi site on single server and every site will have ERPNext and in ERPNext like invoice we need every invoice to customize according to client and the data must be according to client.

For example: suppose A client need A1 field in invoice and B need B1 in invoice as well, then he want to get that column in report from database, now the core file of model get data from DB to browser, but we have 2 different need of two client now, then if we do change it for one client it will go to another as well.

Hi there,

you’ve to create:

site1 for client A
site2 for client B

each site will have his own database so customization will be held per site.

We have two clients A&B, DB for these client ADB , BDB , we will add field from frontend , it will work fine and A1 field will be added to ADB and B1 field will be added to BDB

But when we get data from database it work through .py file and there is one method work for both DB…
but we need A1 field in ADB and B1 field in BDB, in that case there will be always error in the code … not find column B1 in ADB or A1 column in BDB.

u should write a custom app …one for A and one for B client

1 Like

Can you please give me an example of inheritance there so that I can inherit the class or method and add new functionalities there.

have a look at:

http://frappe.github.io/frappe/user/en/

http://frappe.github.io/frappe/user/en/videos/

http://frappe.github.io/erpnext/user/manual/en/

1 Like

@tanveer also refer https://frappe.github.io/frappe/user/en/guides/basics/hooks

frappe.ui.form.on('Sales Order, {
refresh: function(frm) {
// unnamed
let Rectangle = class {
constructor(height, width) {
this.height = height;
this.width = width;
}
};
console.log(Rectangle.name);
}
});
Sample Class Example.

1 Like