Extend ERPNext 4.0

200 views
Skip to first unread message

Nguyen Do Le Bao

unread,
May 6, 2014, 5:39:38 AM5/6/14
to erpnext-dev...@googlegroups.com
Hi, 

Last time on ERPNext website, there was a link for tutorial on creating plugins (for example a custom DocType, or a custom Report). 
With ERPNext 4.0, i supposed we should do it as an app like what was told here:
But the tutorial seems to be about create a totally new app, not extend or customise ERPNext. 
Do you guys know of any pointer for me to create a plugins or customise ERPNext ?

Thank you!

Pratik Vyas

unread,
May 6, 2014, 6:03:37 AM5/6/14
to erpnext-dev...@googlegroups.com
Hi Nguyen,
We're working on the docs at the moment. We'll release it on frappe.io
and annoince on the mailing list when done.

> Thank you!
>
> --
> Note:
>
> If you are posting an issue,
> 1. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 2. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 3. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/58803461-5454-4be5-acfc-e4b0efd62e3b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


Thanks,
--
Pratik
erpnext

Nguyen Do Le Bao

unread,
May 23, 2014, 6:15:21 AM5/23/14
to erpnext-dev...@googlegroups.com
Hi Pratik, 

Is there any update on this ? 
I am customising the ERPNext version 3 latest but i am worried without using plugins if I upgrade to 4, everything will be overwritten. 
Is there a way ? Any direction separate the custom code ?

Like in version 3, i can use command to create a script @ erpnext/stock/doctype/stock_entry/stock_entry.py. Its content will be 

from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint, _
class CustomDocType(DocType):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist

Not sure how i go from here to extend the DocType's functionality. For example:
- on_submit of stock_entry I need to do some extra stuffs ... 
- can i make a normal @webnotes.whitelist() function to expose to client ? 

Of course, change the code directly to app/stock/doctype/stock_entry/stock_entry.py works as well but not safe for upgrading I supposed. 
Really appreciate any pointers! Thank you!

Rushabh Mehta

unread,
May 23, 2014, 6:18:55 AM5/23/14
to erpnext-dev...@googlegroups.com
On 23-May-2014, at 3:45 pm, Nguyen Do Le Bao <natha...@gmail.com> wrote:

Hi Pratik, 

Is there any update on this ? 
I am customising the ERPNext version 3 latest but i am worried without using plugins if I upgrade to 4, everything will be overwritten. 
Is there a way ? Any direction separate the custom code ?

Like in version 3, i can use command to create a script @ erpnext/stock/doctype/stock_entry/stock_entry.py. Its content will be 

from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint, _
class CustomDocType(DocType):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist

Not sure how i go from here to extend the DocType's functionality. For example:
- on_submit of stock_entry I need to do some extra stuffs ... 
- can i make a normal @webnotes.whitelist() function to expose to client ? 

In version 4, you make an app for your customizations.


and plug in your server-side events via hooks.py file in your app


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8048810f-64c3-424c-ba6b-b8f21ae32943%40googlegroups.com.

Nguyen Do Le Bao

unread,
May 28, 2014, 12:15:39 PM5/28/14
to erpnext-dev...@googlegroups.com
Hi, 

Thank you for this!!!

I tried out ERPNext 4, failed to install at first with root user (probably because of permission issue). 
After that I create separate user 'erpnext', it works! 

I know this was mentioned in ERPNext 3's installation Note but in the current instruction using frappe-bench, I don't think it's highlighted anywhere. 
Also as I follow the instruction in https://frappe.io/apps/frappe-framework/developers/guide, sometimes it causes some permission problem if using root as well. 

Maybe it should be added to frappe-bench's installation instruction ?

Pratik Vyas

unread,
May 28, 2014, 12:20:52 PM5/28/14
to erpnext-dev...@googlegroups.com
Hi Nguyen,

On Wed, May 28, 2014 at 9:45 PM, Nguyen Do Le Bao <natha...@gmail.com> wrote:
> Hi,
>
> Thank you for this!!!
>
> I tried out ERPNext 4, failed to install at first with root user (probably
> because of permission issue).
> After that I create separate user 'erpnext', it works!
>
> I know this was mentioned in ERPNext 3's installation Note but in the
> current instruction using frappe-bench, I don't think it's highlighted
> anywhere.
> Also as I follow the instruction in
> https://frappe.io/apps/frappe-framework/developers/guide, sometimes it
> causes some permission problem if using root as well.
>

I updated it in the README, forgot to update on the website. Thanks
for reporting!


--
Pratik
erpnext
Reply all
Reply to author
Forward
0 new messages