unable to load module error

12 views
Skip to first unread message

gangadhar kadam

unread,
Apr 23, 2013, 12:44:50 AM4/23/13
to erpnext-dev...@googlegroups.com
Hello All,
   I have created a cgi fun  doctype ( is Single)  in selling module and wrote some code . I have create one cgi.  from that cgi i call method in cgi fun doctype. when i call cgi with mozila firefox poster  receives following error

Traceback (most recent call last):
  File "/var/www/sites/mtnadvantage.xbs360.com/public/status.cgi", line 26, in <module>
    m=get_obj('cgi fun').cstatus(argjson['ponumber'],argjson['status'])
  File "../lib/webnotes/model/code.py", line 161, in get_obj
    return get_server_obj(doclist[0], doclist)
  File "../lib/webnotes/model/code.py", line 107, in get_server_obj
    DocType = get_doctype_class(doc.doctype, module)
  File "../lib/webnotes/model/code.py", line 129, in get_doctype_class
    raise Exception, "Unable to load module for :" + doctype
Exception: Unable to load module for :cgi fun

what should i do?

Thank you

Rushabh Mehta

unread,
Apr 23, 2013, 12:48:41 AM4/23/13
to erpnext-dev...@googlegroups.com
Gangadhar,

Please paste your code along with the exception. Otherwise we have no idea what you are doing. Ideally use gist or pastebin for the same.

Any special reason you are using get_obj? You can directly call the python method.

- Rushabh


W: https://erpnext.com
T: @rushabh_mehta

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/npqS3JAogbEJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

गंगाधर कदम

unread,
Apr 23, 2013, 1:14:19 AM4/23/13
to erpnext-dev...@googlegroups.com
Hello Sir,
I have pasted my code on  http://pastebin.com/0Vbevc7S
Thank you sir
--
Thanks & Regards,
Mr.Gangadhar N.Kadam.
Cell: +91 9960066444

Software Engineer,
New Indictrans Technologies Pvt. Ltd., Pune


SAVE TREES - Please consider the environment before printing this email.

SAVE ENERGY - My monitor is off whenever I am away from my desk. I am helping  prevent global warming by reducing consumption of power... ARE YOU?

Rushabh Mehta

unread,
Apr 23, 2013, 1:57:17 AM4/23/13
to erpnext-dev...@googlegroups.com
Why do you need the DocType "cgi fun"? You can add the function in your file itself.

- Rushabh

(please don't address as "sir")


W: https://erpnext.com
T: @rushabh_mehta

गंगाधर कदम

unread,
Apr 23, 2013, 2:07:33 AM4/23/13
to erpnext-dev...@googlegroups.com
         I have to synchronize two databases. in one database i call cgi with post parameters in other database, the cgi call the method of same database having code to synchronize status of sales order.
   can i create an instance of doctype in cgi  like

s=Document('Sales Order',SO00001)
s.status='test'
s.save()

Thank you

Rushabh Mehta

unread,
Apr 23, 2013, 2:16:28 AM4/23/13
to erpnext-dev...@googlegroups.com

         I have to synchronize two databases. in one database i call cgi with post parameters in other database, the cgi call the method of same database having code to synchronize status of sales order.
   can i create an instance of doctype in cgi  like

Please feel free to try :)


s=Document('Sales Order',SO00001)
s.status='test'
s.save()

better to use the "bean" function

s = webnotes.bean("Sales Order", "SO00001")
s.doc.status = "test"
s.save()

(this will call validate, on_update etc)
Reply all
Reply to author
Forward
0 new messages