Delivery Note Did Not Save

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/50F382A4-FF54-4469-B3DF-26AA646D7EAC%40gmail.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/DE3F19C5-4932-49DC-B739-EC7B97777880%40gmail.com.

    For more options, visit https://groups.google.com/groups/opt_out.
I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/0D808652-5294-46B1-B43F-2C30029283D7%40gmail.com.

    For more options, visit https://groups.google.com/groups/opt_out.
http://pastebin.com/6cgfrXrZ
http://pastebin.com/NBNDYcGk


On Sunday, 16 February 2014 20:37:51 UTC+8, Nabin Hait wrote:
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/688f23c3-cd4f-45c0-9d0c-88a43f5fea8e%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Can you share the script by which you are pushing the doclist? Or the doclist that is generated from your script?

On Sunday, February 16, 2014 6:38:22 PM UTC+5:30, CJ wrote:



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/0bfc5b61-1e72-434c-92f3-6912b081cec0%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Certainly I would love too but pardon me how do I need to do to retrieve the doclist?

On Monday, 17 February 2014 13:21:59 UTC+8, rushabh wrote:
Can you share the script by which you are pushing the doclist? Or the doclist that is generated from your script?

On Sunday, February 16, 2014 6:38:22 PM UTC+5:30, CJ wrote:



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/4cc582ec-b7ea-42a4-891a-f821eb85fc09%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
It must print gl_entries value in the console. Can you check again? The print should appear before the traceback message.

On 16-Feb-2014, at 6:38 PM, CJ wrote:

http://pastebin.com/NBNDYcGk


On Sunday, 16 February 2014 20:37:51 UTC+8, Nabin Hait wrote:
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/688f23c3-cd4f-45c0-9d0c-88a43f5fea8e%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/00B3577F-F438-4DDA-B964-7E1A8F43762B%40gmail.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Nabin,

I added that line in 

if self.doc.docstatus==1:
gl_entries = self.get_gl_entries(warehouse_account)
webnotes.errprint(["gl entries: ", gl_entries])
make_gl_entries(gl_entries)

but the console didn't print the value but it print the line. I was wonder is that a type in my statement or do I need to restart the machine/clear cache or something?

File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    webnotes.errprint(["gl entries: ", gl_entries])
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)


On Monday, 17 February 2014 13:32:24 UTC+8, Nabin Hait wrote:
It must print gl_entries value in the console. Can you check again? The print should appear before the traceback message.

On 16-Feb-2014, at 6:38 PM, CJ wrote:

http://pastebin.com/NBNDYcGk


On Sunday, 16 February 2014 20:37:51 UTC+8, Nabin Hait wrote:
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/688f23c3-cd4f-45c0-9d0c-88a43f5fea8e%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/98a5d325-5d4e-4a48-ab50-39473610a565%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
I restarted the server and now I saw this: "File "app/controllers/stock_controller.py", line 23 webnotes.errprint(["gl entries: ", gl_entries])"  SyntaxError: invalid syntax

I guess that is a good sign it is trying to execute. Why is there syntax error?

On Monday, 17 February 2014 13:37:57 UTC+8, CJ wrote:
Hi Nabin,

I added that line in 

if self.doc.docstatus==1:
gl_entries = self.get_gl_entries(warehouse_account)
webnotes.errprint(["gl entries: ", gl_entries])
make_gl_entries(gl_entries)

but the console didn't print the value but it print the line. I was wonder is that a type in my statement or do I need to restart the machine/clear cache or something?

File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    webnotes.errprint(["gl entries: ", gl_entries])
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)


On Monday, 17 February 2014 13:32:24 UTC+8, Nabin Hait wrote:
It must print gl_entries value in the console. Can you check again? The print should appear before the traceback message.

On 16-Feb-2014, at 6:38 PM, CJ wrote:

http://pastebin.com/NBNDYcGk


On Sunday, 16 February 2014 20:37:51 UTC+8, Nabin Hait wrote:
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/688f23c3-cd4f-45c0-9d0c-88a43f5fea8e%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/7d994a7f-2f38-429b-bfd0-d0e245b877ce%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi, I am able to print now.

[u'gl entries: ', [{u'aging_date': u'2014-02-15', u'company': u'Graphical Application', u'is_opening': u'No', u'fiscal_year': u'2013-2014', u'against': u'Finished Goods - GA', u'voucher_type': u'Delivery Note', u'credit': 0.0, u'debit': 0.0, u'remarks': u'Accounting Entry for Stock', u'posting_date': u'2014-02-15', u'voucher_no': u'DN00001', u'account': u'Finished Goods - GA', u'cost_center': u'Main - GA'}]]

Means anything for debugging?

On Monday, 17 February 2014 13:37:57 UTC+8, CJ wrote:
Hi Nabin,

I added that line in 

if self.doc.docstatus==1:
gl_entries = self.get_gl_entries(warehouse_account)
webnotes.errprint(["gl entries: ", gl_entries])
make_gl_entries(gl_entries)

but the console didn't print the value but it print the line. I was wonder is that a type in my statement or do I need to restart the machine/clear cache or something?

File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    webnotes.errprint(["gl entries: ", gl_entries])
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)


On Monday, 17 February 2014 13:32:24 UTC+8, Nabin Hait wrote:
It must print gl_entries value in the console. Can you check again? The print should appear before the traceback message.

On 16-Feb-2014, at 6:38 PM, CJ wrote:

http://pastebin.com/NBNDYcGk


On Sunday, 16 February 2014 20:37:51 UTC+8, Nabin Hait wrote:
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/688f23c3-cd4f-45c0-9d0c-88a43f5fea8e%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/81d9e180-3af1-47db-ac7e-1f7613f49bb8%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Looking like you have selected "Finished Goods - GA" as "Difference Account" in Delivery Note item table, which is same as account for the warehouse. In delivery note, the difference account should be an expense account.


On 17-Feb-2014, at 11:39 AM, CJ wrote:

Hi, I am able to print now.

[u'gl entries: ', [{u'aging_date': u'2014-02-15', u'company': u'Graphical Application', u'is_opening': u'No', u'fiscal_year': u'2013-2014', u'against': u'Finished Goods - GA', u'voucher_type': u'Delivery Note', u'credit': 0.0, u'debit': 0.0, u'remarks': u'Accounting Entry for Stock', u'posting_date': u'2014-02-15', u'voucher_no': u'DN00001', u'account': u'Finished Goods - GA', u'cost_center': u'Main - GA'}]]

Means anything for debugging?

On Monday, 17 February 2014 13:37:57 UTC+8, CJ wrote:
Hi Nabin,

I added that line in 

if self.doc.docstatus==1:
gl_entries = self.get_gl_entries(warehouse_account)
webnotes.errprint(["gl entries: ", gl_entries])
make_gl_entries(gl_entries)

but the console didn't print the value but it print the line. I was wonder is that a type in my statement or do I need to restart the machine/clear cache or something?

File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    webnotes.errprint(["gl entries: ", gl_entries])
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)


On Monday, 17 February 2014 13:32:24 UTC+8, Nabin Hait wrote:
It must print gl_entries value in the console. Can you check again? The print should appear before the traceback message.

On 16-Feb-2014, at 6:38 PM, CJ wrote:

http://pastebin.com/NBNDYcGk


On Sunday, 16 February 2014 20:37:51 UTC+8, Nabin Hait wrote:
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/688f23c3-cd4f-45c0-9d0c-88a43f5fea8e%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/81d9e180-3af1-47db-ac7e-1f7613f49bb8%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/030AAC4C-51B6-4A53-BA49-C53A751F12FF%40gmail.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Nabit, I want to thank you. That is the cause the the error.
Can I request the such error to be such clearer or offer more clues to user what is wrong other than "Do not saved"?

On Monday, 17 February 2014 14:20:52 UTC+8, Nabin Hait wrote:
Looking like you have selected "Finished Goods - GA" as "Difference Account" in Delivery Note item table, which is same as account for the warehouse. In delivery note, the difference account should be an expense account.


On 17-Feb-2014, at 11:39 AM, CJ wrote:

Hi, I am able to print now.

[u'gl entries: ', [{u'aging_date': u'2014-02-15', u'company': u'Graphical Application', u'is_opening': u'No', u'fiscal_year': u'2013-2014', u'against': u'Finished Goods - GA', u'voucher_type': u'Delivery Note', u'credit': 0.0, u'debit': 0.0, u'remarks': u'Accounting Entry for Stock', u'posting_date': u'2014-02-15', u'voucher_no': u'DN00001', u'account': u'Finished Goods - GA', u'cost_center': u'Main - GA'}]]

Means anything for debugging?

On Monday, 17 February 2014 13:37:57 UTC+8, CJ wrote:
Hi Nabin,

I added that line in 

if self.doc.docstatus==1:
gl_entries = self.get_gl_entries(warehouse_account)
webnotes.errprint(["gl entries: ", gl_entries])
make_gl_entries(gl_entries)

but the console didn't print the value but it print the line. I was wonder is that a type in my statement or do I need to restart the machine/clear cache or something?

File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    webnotes.errprint(["gl entries: ", gl_entries])
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)


On Monday, 17 February 2014 13:32:24 UTC+8, Nabin Hait wrote:
It must print gl_entries value in the console. Can you check again? The print should appear before the traceback message.

On 16-Feb-2014, at 6:38 PM, CJ wrote:

http://pastebin.com/NBNDYcGk


On Sunday, 16 February 2014 20:37:51 UTC+8, Nabin Hait wrote:
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/688f23c3-cd4f-45c0-9d0c-88a43f5fea8e%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/81d9e180-3af1-47db-ac7e-1f7613f49bb8%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2e1a47eb-7895-474c-b20f-b7eb3b3ad96d%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Sure, I will add a validation message for that.

On 17-Feb-2014, at 12:08 PM, CJ wrote:

Hi Nabit, I want to thank you. That is the cause the the error.
Can I request the such error to be such clearer or offer more clues to user what is wrong other than "Do not saved"?

On Monday, 17 February 2014 14:20:52 UTC+8, Nabin Hait wrote:
Looking like you have selected "Finished Goods - GA" as "Difference Account" in Delivery Note item table, which is same as account for the warehouse. In delivery note, the difference account should be an expense account.


On 17-Feb-2014, at 11:39 AM, CJ wrote:

Hi, I am able to print now.

[u'gl entries: ', [{u'aging_date': u'2014-02-15', u'company': u'Graphical Application', u'is_opening': u'No', u'fiscal_year': u'2013-2014', u'against': u'Finished Goods - GA', u'voucher_type': u'Delivery Note', u'credit': 0.0, u'debit': 0.0, u'remarks': u'Accounting Entry for Stock', u'posting_date': u'2014-02-15', u'voucher_no': u'DN00001', u'account': u'Finished Goods - GA', u'cost_center': u'Main - GA'}]]

Means anything for debugging?

On Monday, 17 February 2014 13:37:57 UTC+8, CJ wrote:
Hi Nabin,

I added that line in 

if self.doc.docstatus==1:
gl_entries = self.get_gl_entries(warehouse_account)
webnotes.errprint(["gl entries: ", gl_entries])
make_gl_entries(gl_entries)

but the console didn't print the value but it print the line. I was wonder is that a type in my statement or do I need to restart the machine/clear cache or something?

File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    webnotes.errprint(["gl entries: ", gl_entries])
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)


On Monday, 17 February 2014 13:32:24 UTC+8, Nabin Hait wrote:
It must print gl_entries value in the console. Can you check again? The print should appear before the traceback message.

On 16-Feb-2014, at 6:38 PM, CJ wrote:

http://pastebin.com/NBNDYcGk


On Sunday, 16 February 2014 20:37:51 UTC+8, Nabin Hait wrote:
Share the code through pastebin.com, after adding the line

On 16-Feb-2014, at 5:56 PM, CJ wrote:

I added the line but I didn't see any printed value, maybe I did not do it correctly?

Traceback (innermost last): File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range
Traceback (innermost last): File "lib/webnotes/handler.py", line 78, in handle execute_cmd(cmd) File "lib/webnotes/handler.py", line 118, in execute_cmd ret = call(method, webnotes.form_dict) File "lib/webnotes/handler.py", line 140, in call return fn(**newargs) File "lib/webnotes/widgets/form/save.py", line 18, in savedocs getattr(wrapper, action.lower())() File "lib/webnotes/model/bean.py", line 321, in submit self.run_method('on_submit') File "lib/webnotes/model/bean.py", line 239, in run_method getattr(self.controller, method)(*args, **kwargs) File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit self.make_gl_entries() File "app/controllers/stock_controller.py", line 23, in make_gl_entries webnotes.errprint(["gl entries: ", gl_entries]) File "app/accounts/general_ledger.py", line 18, in make_gl_entries save_entries(gl_map, adv_adj, update_outstanding) File "app/accounts/general_ledger.py", line 63, in save_entries validate_account_for_auto_accounting_for_stock(gl_map) File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock if gl_map[0].voucher_type=="Journal Voucher": IndexError: list index out of range



On Sunday, 16 February 2014 20:08:55 UTC+8, Nabin Hait wrote:
Add `webnotes.errprint(["gl entries: ", gl_entries])` before the line `make_gl_entries(gl_entries)`.

Then try to submit the delivery note, after getting error message, check browser's console. You will find the values of gl_entries printed in the console.

On 16-Feb-2014, at 5:33 PM, CJ wrote:

Hi. I am just doing normal PO -> Purchase Receipt -> Delivery Note.
No custom script or any thing. Line 23? It says "self.update_gl_entries_after(warehouse_account)

Do you mean executing command to get this value? How do I do it?

On Sunday, 16 February 2014 19:54:59 UTC+8, Nabin Hait wrote:
Are you inserting Delivery Note through API? In that case, I think doclist is not properly created and hence gl_map values are not coming properly. 

To debug, you should print "gl_entries" at line 23 in app/controllers/stock_cotrollers.py. The expected value should be type of list of dictionary.


On 15-Feb-2014, at 4:38 AM, CJ wrote:

Why am I always facing this error? Is there something in the master setting or account I did incorrectly or some kind of wrong procedure?
I saw some kind of mentioning regarding Journal Voucher, I didn't key anything about JV.

Error log.

Traceback (innermost last):
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range
Traceback (innermost last):
  File "lib/webnotes/handler.py", line 78, in handle
    execute_cmd(cmd)
  File "lib/webnotes/handler.py", line 118, in execute_cmd
    ret = call(method, webnotes.form_dict)
  File "lib/webnotes/handler.py", line 140, in call
    return fn(**newargs)
  File "lib/webnotes/widgets/form/save.py", line 18, in savedocs
    getattr(wrapper, action.lower())()
  File "lib/webnotes/model/bean.py", line 321, in submit
    self.run_method('on_submit')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "app/stock/doctype/delivery_note/delivery_note.py", line 163, in on_submit
    self.make_gl_entries()
  File "app/controllers/stock_controller.py", line 23, in make_gl_entries
    make_gl_entries(gl_entries)
  File "app/accounts/general_ledger.py", line 18, in make_gl_entries
    save_entries(gl_map, adv_adj, update_outstanding)
  File "app/accounts/general_ledger.py", line 63, in save_entries
    validate_account_for_auto_accounting_for_stock(gl_map)
  File "app/accounts/general_ledger.py", line 92, in validate_account_for_auto_accounting_for_stock
    if gl_map[0].voucher_type=="Journal Voucher":
 IndexError: list index out of range



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5a4ff0ed-6270-47df-90a7-25a1ca2c7f98%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ddbfebfb-5603-44e1-b803-4f42b63ac4e3%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f2f74475-28cc-4172-9ac6-62c3c4b8756c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/688f23c3-cd4f-45c0-9d0c-88a43f5fea8e%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/81d9e180-3af1-47db-ac7e-1f7613f49bb8%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.




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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2e1a47eb-7895-474c-b20f-b7eb3b3ad96d%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.



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-forum+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/6ED12677-DFFA-485A-AE4B-D2AA6923C18D%40gmail.com.

    For more options, visit https://groups.google.com/groups/opt_out.