Insert a custom document (DocType) in Stock module

126 views
Skip to first unread message

Luis Fernandes

unread,
Sep 22, 2014, 3:36:50 PM9/22/14
to erpnext-dev...@googlegroups.com
I.

I need, for what i'm doing, to add a custom doctype in Stock module (Is what is more obvious). I try to create my custom doctype and in the module field i put Stock.

It is ok and in a doctype folder of stock module was created one folder with my custom doctype name.

1. The problem is that the name of my custom doctype doesn't show in Stock Documents (see image below).
2. What if i update erpnext?
3. This method create a controller file in doctype folder of Stock module . How to write code for the diferents methods (validate, on_update, etc.) in my module?


If this sound complicate, then i just need to put an entry in the stock module document (see the following image), so i need to create a doctype in Stock module, and i need that doctype to show in the Stock module but i want to control validation, updates and inserts in my new module. 

Thanks.

Nabin Hait

unread,
Sep 23, 2014, 12:10:12 AM9/23/14
to erpnext-dev...@googlegroups.com

To show your custom doctype in stock module home page,  put an entry in stock.py file.

And for controller methods, check existing controllers, it will give you a fair idea.

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
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/7a4ed92e-76df-410b-b6d9-52eb9b7b20dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luis Fernandes

unread,
Sep 23, 2014, 4:03:29 AM9/23/14
to erpnext-dev...@googlegroups.com
I thanks for your answer. But sorry i don't know how to do what you are saying.

What do you mean by put an entry in stock.py. Did you mean make in my module one file called stock.py? And do what?


Thanks.


Terça-feira, 23 de Setembro de 2014 5:10:12 UTC+1, Nabin Hait escreveu:

To show your custom doctype in stock module home page,  put an entry in stock.py file.

And for controller methods, check existing controllers, it will give you a fair idea.

On 23 Sep 2014 01:06, "Luis Fernandes" <luisfmf...@gmail.com> wrote:
I.

I need, for what i'm doing, to add a custom doctype in Stock module (Is what is more obvious). I try to create my custom doctype and in the module field i put Stock.

It is ok and in a doctype folder of stock module was created one folder with my custom doctype name.

1. The problem is that the name of my custom doctype doesn't show in Stock Documents (see image below).
2. What if i update erpnext?
3. This method create a controller file in doctype folder of Stock module . How to write code for the diferents methods (validate, on_update, etc.) in my module?


If this sound complicate, then i just need to put an entry in the stock module document (see the following image), so i need to create a doctype in Stock module, and i need that doctype to show in the Stock module but i want to control validation, updates and inserts in my new module. 

Thanks.

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
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-forum+unsub...@googlegroups.com.

Luis Fernandes

unread,
Sep 23, 2014, 4:45:54 AM9/23/14
to erpnext-dev...@googlegroups.com
I. Thanks you for your answer.

Sorry, but i don't know what do you mean by put an entry in stock.py.

1. stock.py is a file i have to created in my module?
2. what do you mean by put an entry?

Thanks.


Terça-feira, 23 de Setembro de 2014 5:10:12 UTC+1, Nabin Hait escreveu:

To show your custom doctype in stock module home page,  put an entry in stock.py file.

And for controller methods, check existing controllers, it will give you a fair idea.

On 23 Sep 2014 01:06, "Luis Fernandes" <luisfmf...@gmail.com> wrote:
I.

I need, for what i'm doing, to add a custom doctype in Stock module (Is what is more obvious). I try to create my custom doctype and in the module field i put Stock.

It is ok and in a doctype folder of stock module was created one folder with my custom doctype name.

1. The problem is that the name of my custom doctype doesn't show in Stock Documents (see image below).
2. What if i update erpnext?
3. This method create a controller file in doctype folder of Stock module . How to write code for the diferents methods (validate, on_update, etc.) in my module?


If this sound complicate, then i just need to put an entry in the stock module document (see the following image), so i need to create a doctype in Stock module, and i need that doctype to show in the Stock module but i want to control validation, updates and inserts in my new module. 

Thanks.

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
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-forum+unsub...@googlegroups.com.

Nabin Hait

unread,
Sep 23, 2014, 4:52:26 AM9/23/14
to erpnext-dev...@googlegroups.com

Rushabh Mehta

unread,
Sep 23, 2014, 4:57:13 AM9/23/14
to erpnext-dev...@googlegroups.com
On 23-Sep-2014, at 2:22 pm, Nabin Hait <nabi...@gmail.com> wrote:

Check https://github.com/frappe/erpnext/blob/develop/erpnext/config/stock.py


On Sep 23, 2014, at 2:15 PM, Luis Fernandes <luisfmf...@gmail.com> wrote:

I. Thanks you for your answer.

Sorry, but i don't know what do you mean by put an entry in stock.py.

1. stock.py is a file i have to created in my module?

Create a stock.py in the config folder of your app and add your list.

Luis Fernandes

unread,
Sep 23, 2014, 5:04:49 AM9/23/14
to erpnext-dev...@googlegroups.com
Thank you both.

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
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-forum+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages