AttributeError: 'module' object has no attribute 'get'

Hi There,

I have followed this link https://github.com/webnotes/erpnext/wiki/Migrating-your-erpnext-instance-to-wsgi to migrate one of our test erpnext instance to wsgi. When I ran ./lib/wnf.py --latest command I got below error:
Traceback (most recent call last):
  File "./lib/wnf.py", line 729, in <module>
    main()
  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 43, in run
    out = globals().get(fn)(**args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 289, in latest
    webnotes.modules.patch_handler.run_all()
  File "lib/webnotes/modules/patch_handler.py", line 21, in run_all
    if webnotes.conn.table_exists("__PatchLog"):
  File "lib/webnotes/db.py", line 463, in table_exists
    return tablename in [d[0] for d in self.sql("show tables")]
  File "lib/webnotes/db.py", line 104, in sql
    webnotes.log("<<<< query")
  File "lib/webnotes/__init__.py", line 141, in log
    if conf.get("logging") or False:
AttributeError: 'module' object has no attribute 'get'

Can anyone please advise me on how I can fix this error? Thanks.

Please let me know if you need any additional information from my end regarding above error.

PS: I have searched the discussion forum for a solution before posting this topic.

Kind regards,
MP



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.

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

Seems like a bug relating to the logging settings.

Can you turn off logging in conf.py and try again. We will fix it in the code.

best,
Rushabh


On Friday, November 22, 2013 5:04:44 PM UTC+5:30, MP wrote:
Hi There,

I have followed this link https://github.com/webnotes/erpnext/wiki/Migrating-your-erpnext-instance-to-wsgi to migrate one of our test erpnext instance to wsgi. When I ran ./lib/wnf.py --latest command I got below error:
Traceback (most recent call last):
  File "./lib/wnf.py", line 729, in <module>
    main()
  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 43, in run
    out = globals().get(fn)(**args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 289, in latest
    webnotes.modules.patch_handler.run_all()
  File "lib/webnotes/modules/patch_handler.py", line 21, in run_all
    if webnotes.conn.table_exists("__PatchLog"):
  File "lib/webnotes/db.py", line 463, in table_exists
    return tablename in [d[0] for d in self.sql("show tables")]
  File "lib/webnotes/db.py", line 104, in sql
    webnotes.log("<<<< query")
  File "lib/webnotes/__init__.py", line 141, in log
    if conf.get("logging") or False:
AttributeError: 'module' object has no attribute 'get'

Can anyone please advise me on how I can fix this error? Thanks.

Please let me know if you need any additional information from my end regarding above error.

PS: I have searched the discussion forum for a solution before posting this topic.

Kind regards,
MP



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.

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

I have turned the logging of in conf.py. Now I am getting  ProgrammingError: (1146, "Table 'erp_test.tabWebsite Sitemap' doesn't exist") when I ran ./lib/wnf.py --latest command. See below output for more detail.


ro...@ubuntu:/var/www/erpnext# ./lib/wnf.py --latest
Executing execute:webnotes.reload_doc('core', 'doctype', 'doctype', force=True) #2013-10-15 in erp_test
Success
Executing execute:webnotes.reload_doc('core', 'doctype', 'docfield', force=True) #2013-10-15 in erp_test
Success
Executing execute:webnotes.reload_doc('core', 'doctype', 'docperm') #2013-07-16 in erp_test
Success
Executing execute:webnotes.reload_doc('core', 'doctype', 'page') #2013-07-16 in erp_test
Success
Executing execute:webnotes.reload_doc('core', 'doctype', 'report') #2013-07-16 in erp_test
Success
Executing execute:webnotes.reload_doc('setup', 'doctype', 'sales_partner') #2013-06-25 in erp_test
Success
Executing patches.april_2013.p07_rename_cost_center_other_charges in erp_test
Success
Executing patches.may_2013.p01_selling_net_total_export in erp_test
Success
Executing patches.may_2013.p06_make_notes in erp_test
Traceback (innermost last):
  File "lib/webnotes/modules/patch_handler.py", line 58, in execute_patch
    webnotes.get_method(patchmodule + ".execute")()
  File "app/patches/may_2013/p06_make_notes.py", line 40, in execute
    webnotes.bean("Style Settings").save()
  File "lib/webnotes/model/bean.py", line 304, in save
    self.run_method('on_update')
  File "lib/webnotes/model/bean.py", line 239, in run_method
    getattr(self.controller, method)(*args, **kwargs)
  File "lib/website/doctype/style_settings/style_settings.py", line 35, in on_update
    clear_cache()
  File "lib/webnotes/webutils.py", line 194, in clear_cache
    for p in webnotes.conn.sql_list("""select name from `tabWebsite Sitemap`"""):
  File "lib/webnotes/db.py", line 146, in sql_list
    return [r[0] for r in self.sql(query, values, debug=debug)]
  File "lib/webnotes/db.py", line 108, in sql
    self._cursor.execute(query)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 201, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
 ProgrammingError: (1146, "Table 'erp_test.tabWebsite Sitemap' doesn't exist")

patches.may_2013.p06_make_notes: failed: STOPPED
Traceback (most recent call last):
  File "./lib/wnf.py", line 737, in <module>
    main()
  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 43, in run
    out = globals().get(fn)(**args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 290, in latest
    webnotes.modules.patch_handler.run_all()
  File "lib/webnotes/modules/patch_handler.py", line 30, in run_all
    raise PatchError(patch)
webnotes.modules.patch_handler.PatchError: patches.may_2013.p06_make_notes



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.

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

Before you run ./lib/wnf.py --latest try to run ./lib/wnf.py --sync_all



2013/12/17 MP <ma...@gmail.com>
Thanks Rushabh.

I have turned the logging of in conf.py. Now I am getting ProgrammingError: (1146, "Table 'erp_test.tabWebsite Sitemap' doesn't exist") when I ran ./lib/wnf.py --latest command. See below output for more detail.



ro…@ubuntu:/var/www/erpnext# ./lib/wnf.py --latest
Executing execute:webnotes.reload_doc('core', 'doctype', 'doctype', force=True) #2013-10-15 in erp_test
Success
Executing execute:webnotes.reload_doc('core', 'doctype', 'docfield', force=True) #2013-10-15 in erp_test

Success
Executing execute:webnotes.reload_doc('core', 'doctype', 'docperm') #2013-07-16 in erp_test
Success
Executing execute:webnotes.reload_doc('core', 'doctype', 'page') #2013-07-16 in erp_test

Success
Executing execute:webnotes.reload_doc('core', 'doctype', 'report') #2013-07-16 in erp_test
Success
Executing execute:webnotes.reload_doc('setup', 'doctype', 'sales_partner') #2013-06-25 in erp_test

Success
Executing patches.april_2013.p07_rename_cost_center_other_charges in erp_test
Success
Executing patches.may_2013.p01_selling_net_total_export in erp_test
Success
Executing patches.may_2013.p06_make_notes in erp_test

Traceback (innermost last):
File "lib/webnotes/modules/patch_handler.py", line 58, in execute_patch
webnotes.get_method(patchmodule + ".execute")()
File "app/patches/may_2013/p06_make_notes.py", line 40, in execute

webnotes.bean(&quot;Style Settings&quot;).save()<br>  File &quot;lib/webnotes/model/bean.py&quot;, line 304, in save<br>    self.run_method(&#39;on_update&#39;)<br>  File &quot;lib/webnotes/model/bean.py&quot;, line 239, in run_method<br>

getattr(self.controller, method)(*args, **kwargs)<br>  File &quot;lib/website/doctype/style_settings/style_settings.py&quot;, line 35, in on_update<br>    clear_cache()<br>  File &quot;lib/webnotes/webutils.py&quot;, line 194, in clear_cache<br>

for p in webnotes.conn.sql_list(&quot;&quot;&quot;select name from `tabWebsite Sitemap`&quot;&quot;&quot;):<br>  File &quot;lib/webnotes/db.py&quot;, line 146, in sql_list<br>    return [r[0] for r in self.sql(query, values, debug=debug)]<br>

File "lib/webnotes/db.py", line 108, in sql
self._cursor.execute(query)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 201, in execute
self.errorhandler(self, exc, value)

File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1146, "Table 'erp_test.tabWebsite Sitemap' doesn't exist")


patches.may_2013.p06_make_notes: failed: STOPPED


Traceback (most recent call last):
File “./lib/wnf.py”, line 737, in <module>

main()
File “./lib/wnf.py”, line 23, in main

run(fn, parsed_args)<br>  File &quot;./lib/wnf.py&quot;, line 43, in run<br>    out = globals().get(fn)(**args)<br>  File &quot;./lib/wnf.py&quot;, line 34, in new_fn<br>    return fn(*args, **new_kwargs)<br></div>  File &quot;./lib/wnf.py&quot;, line 290, in latest<br>

webnotes.modules.patch_handler.run_all()<br>  File &quot;lib/webnotes/modules/patch_handler.py&quot;, line 30, in run_all<br>    raise PatchError(patch)<br>webnotes.modules.patch_handler.PatchError: patches.may_2013.p06_make_notes<br>




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.

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




--

Maxwell Morais
Tecnologia da Informação
+55 11 3931-1412 Ramal 31

www.realizemodulados.com.br



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.

    For more options, visit https://groups.google.com/groups/opt_out.
Thanks Maxwell. Appreciate your help.

It worked.

I am getting some error when I click on any employee record. So I decided to update the code by running ./lib/wnf.py --update origin master. But I got below error message.
Traceback (most recent call last):
  File "./lib/wnf.py", line 737, in <module>

  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 41, in run
    out = globals().get(fn)(*args.get(fn), **args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 269, in update

  File "lib/webnotes/__init__.py", line 16, in <module>
    import semantic_version
ImportError: No module named semantic_version

How do I fix it?

Kind regards,
MP



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.

    For more options, visit https://groups.google.com/groups/opt_out.
Installing semantic_version fixed it. pip install semantic_version

Not sure why it was mentioned in lib/requirements.txt

Kind regards,
MP

On Tuesday, 17 December 2013 17:09:25 UTC, MP wrote:
Thanks Maxwell. Appreciate your help.

It worked.

I am getting some error when I click on any employee record. So I decided to update the code by running ./lib/wnf.py --update origin master. But I got below error message.
Traceback (most recent call last):
  File "./lib/wnf.py", line 737, in <module>

  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 41, in run
    out = globals().get(fn)(*args.get(fn), **args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 269, in update

  File "lib/webnotes/__init__.py", line 16, in <module>
    import semantic_version
ImportError: No module named semantic_version

How do I fix it?

Kind regards,
MP



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.

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

When ever I click on an employee record from employee list. I get "Not Found,Sorry we were unable to find what you were looking for." message on the browser. In the consolde log, I see below error message.

"Traceback (innermost last):
  File "lib/webnotes/widgets/form/load.py", line 30, in getdoc
    bean.run_method("onload")
  File "lib/webnotes/model/bean.py", line 236, in run_method
    self.make_controller()
  File "lib/webnotes/model/bean.py", line 101, in make_controller
    self.obj = webnotes.get_obj(doc=self.doc, doclist=self.doclist)
  File "lib/webnotes/__init__.py", line 393, in get_obj
    return get_obj(dt, dn, doc, doclist, with_children)
  File "lib/webnotes/model/code.py", line 92, in get_obj
    return get_server_obj(doc, doclist)
  File "lib/webnotes/model/code.py", line 37, in get_server_obj
    get_code_and_execute(module, "DocType", doc.doctype, namespace=namespace)
  File "lib/webnotes/plugins.py", line 9, in get_code_and_execute
    return exec_code(code, namespace)
  File "lib/webnotes/plugins.py", line 15, in exec_code
    exec code in namespace
  File "<string>", line 8, in <module>
  File "<string>", line 9, in CustomDocType
 NameError: name 'self' is not defined
" all-app.min.js:331
17:26:25.151 "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/load.py", line 30, in getdoc
    bean.run_method("onload")
  File "lib/webnotes/model/bean.py", line 236, in run_method
    self.make_controller()
  File "lib/webnotes/model/bean.py", line 101, in make_controller
    self.obj = webnotes.get_obj(doc=self.doc, doclist=self.doclist)
  File "lib/webnotes/__init__.py", line 393, in get_obj
    return get_obj(dt, dn, doc, doclist, with_children)
  File "lib/webnotes/model/code.py", line 92, in get_obj
    return get_server_obj(doc, doclist)
  File "lib/webnotes/model/code.py", line 37, in get_server_obj
    get_code_and_execute(module, "DocType", doc.doctype, namespace=namespace)
  File "lib/webnotes/plugins.py", line 9, in get_code_and_execute
    return exec_code(code, namespace)
  File "lib/webnotes/plugins.py", line 15, in exec_code
    exec code in namespace
  File "<string>", line 8, in <module>
  File "<string>", line 9, in CustomDocType
 NameError: name 'self' is not defined
"

Kind regards,
MP



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.

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

It is used check if your framework version and erpnext version are compatible.


On Tue, Dec 17, 2013 at 10:44 PM, MP <ma...@gmail.com> wrote:
Installing semantic_version fixed it. pip install semantic_version

Not sure why it was mentioned in lib/requirements.txt

Kind regards,
MP


On Tuesday, 17 December 2013 17:09:25 UTC, MP wrote:
Thanks Maxwell. Appreciate your help.

It worked.

I am getting some error when I click on any employee record. So I decided to update the code by running ./lib/wnf.py --update origin master. But I got below error message.
Traceback (most recent call last):
File "./lib/wnf.py", line 737, in <module>

File "./lib/wnf.py", line 23, in main
run(fn, parsed_args)
File "./lib/wnf.py", line 41, in run
out = globals().get(fn)(*args.get(fn), **args)
File "./lib/wnf.py", line 34, in new_fn
return fn(*args, **new_kwargs)
File "./lib/wnf.py", line 269, in update

File "lib/webnotes/__init__.py", line 16, in <module>
import semantic_version
ImportError: No module named semantic_version

How do I fix it?

Kind regards,
MP



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.

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




--
Pratik
erpnext
Do you have a custom script?


On Tue, Dec 17, 2013 at 10:58 PM, MP <ma...@gmail.com> wrote:

When ever I click on an employee record from employee list. I get "Not Found,Sorry we were unable to find what you were looking for." message on the browser. In the consolde log, I see below error message.

"Traceback (innermost last):
File "lib/webnotes/widgets/form/load.py", line 30, in getdoc
bean.run_method("onload")
File "lib/webnotes/model/bean.py", line 236, in run_method
self.make_controller()
File "lib/webnotes/model/bean.py", line 101, in make_controller
self.obj = webnotes.get_obj(doc=self.doc, doclist=self.doclist)
File "lib/webnotes/__init__.py", line 393, in get_obj
return get_obj(dt, dn, doc, doclist, with_children)
File "lib/webnotes/model/code.py", line 92, in get_obj
return get_server_obj(doc, doclist)
File "lib/webnotes/model/code.py", line 37, in get_server_obj
get_code_and_execute(module, "DocType", doc.doctype, namespace=namespace)
File "lib/webnotes/plugins.py", line 9, in get_code_and_execute
return exec_code(code, namespace)
File "lib/webnotes/plugins.py", line 15, in exec_code
exec code in namespace
File "<string>", line 8, in <module>
File "<string>", line 9, in CustomDocType
NameError: name 'self' is not defined
" all-app.min.js:331
17:26:25.151 "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/load.py", line 30, in getdoc
bean.run_method("onload")
File "lib/webnotes/model/bean.py", line 236, in run_method
self.make_controller()
File "lib/webnotes/model/bean.py", line 101, in make_controller
self.obj = webnotes.get_obj(doc=self.doc, doclist=self.doclist)
File "lib/webnotes/__init__.py", line 393, in get_obj
return get_obj(dt, dn, doc, doclist, with_children)
File "lib/webnotes/model/code.py", line 92, in get_obj
return get_server_obj(doc, doclist)
File "lib/webnotes/model/code.py", line 37, in get_server_obj
get_code_and_execute(module, "DocType", doc.doctype, namespace=namespace)
File "lib/webnotes/plugins.py", line 9, in get_code_and_execute
return exec_code(code, namespace)
File "lib/webnotes/plugins.py", line 15, in exec_code
exec code in namespace
File "<string>", line 8, in <module>
File "<string>", line 9, in CustomDocType
NameError: name 'self' is not defined
"

Kind regards,
MP



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.

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




--
Pratik
erpnext
You have custom code, for Customer?


2013/12/17 Pratik Vyas <pd...@gmail.com>
Hi Mayur,

It is used check if your framework version and erpnext version are compatible.


On Tue, Dec 17, 2013 at 10:44 PM, MP <ma...@gmail.com> wrote:
Installing semantic_version fixed it. pip install semantic_version

Not sure why it was mentioned in lib/requirements.txt


Kind regards,
MP



On Tuesday, 17 December 2013 17:09:25 UTC, MP wrote:

Thanks Maxwell. Appreciate your help.

It worked.

I am getting some error when I click on any employee record. So I decided to update the code by running ./lib/wnf.py --update origin master. But I got below error message.

Traceback (most recent call last):
File "./lib/wnf.py", line 737, in <module>

File "./lib/wnf.py", line 23, in main
run(fn, parsed_args)
File "./lib/wnf.py", line 41, in run

out = globals().get(fn)(*args.get(<u></u>fn), **args)<br>  File &quot;./lib/wnf.py&quot;, line 34, in new_fn<br>    return fn(*args, **new_kwargs)<br>  File &quot;./lib/wnf.py&quot;, line 269, in update<br><br>  File &quot;lib/webnotes/__init__.py&quot;, line 16, in &lt;module&gt;<br>


import semantic_version<br>ImportError: No module named semantic_version<br><br>How do I fix it?<br><br>Kind regards,<br>MP<br><font color="blue" face="SAPDings"><span style="font-size:11pt;font-family:SAPDings;color:blue"></span></font><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">



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.

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




--
Pratik
erpnext



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.

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




--

Maxwell Morais
Tecnologia da Informação
+55 11 3931-1412 Ramal 31

www.realizemodulados.com.br



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.

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

Custom Server Scripts have been moved to files in the plugins folder. Hence, the patch to migrate custom server script might have caused some problems in the way you had written the code.

Please check the plugins folder that would've been created besides app and lib folders.

Thanks,
Anand.


On Tue, Dec 17, 2013 at 10:59 PM, Maxwell Morais <ma…@gmail.com> wrote:

You have custom code, for Customer?


2013/12/17 Pratik Vyas <pd…@gmail.com>

Hi Mayur,

It is used check if your framework version and erpnext version are compatible.


On Tue, Dec 17, 2013 at 10:44 PM, MP <ma...@gmail.com> wrote:
Installing semantic_version fixed it. pip install semantic_version

Not sure why it was mentioned in lib/requirements.txt


Kind regards,
MP



On Tuesday, 17 December 2013 17:09:25 UTC, MP wrote:

Thanks Maxwell. Appreciate your help.

It worked.

I am getting some error when I click on any employee record. So I decided to update the code by running ./lib/wnf.py --update origin master. But I got below error message.

Traceback (most recent call last):
File "./lib/wnf.py", line 737, in <module>

File "./lib/wnf.py", line 23, in main
run(fn, parsed_args)
File "./lib/wnf.py", line 41, in run

out = globals().get(fn)(*args.get(<u></u>fn), **args)<br>  File &quot;./lib/wnf.py&quot;, line 34, in new_fn<br>    return fn(*args, **new_kwargs)<br>  File &quot;./lib/wnf.py&quot;, line 269, in update<br><br>  File &quot;lib/webnotes/__init__.py&quot;, line 16, in &lt;module&gt;<br>




import semantic_version<br>ImportError: No module named semantic_version<br><br>How do I fix it?<br><br>Kind regards,<br>MP<br><font color="blue" face="SAPDings"><span style="font-size:11pt;font-family:SAPDings;color:blue"></span></font><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">



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.

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




--
Pratik
erpnext



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.

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




--

Maxwell Morais
Tecnologia da Informação
+55 11 3931-1412 Ramal 31

www.realizemodulados.com.br



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.

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.

    For more options, visit https://groups.google.com/groups/opt_out.
Thanks Max, Pratik and Anand for your reply.

Yes, there is plugin folder. below is a content from /plugins/erpnext/hr/doctype/employee/employee.py

from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint, _

class CustomDocType(DocType):
    if self.doc.department not in webnotes.defaults.get_user_default_as_list('department',self.doc.user_id):
        webnotes.conn.add_default('department',self.doc.department,self.doc.user_id)

Note sure, how to rewrite above to make it work in the new version?

Also are there any change to custom client side script as well?

Also, are you able to point me to a link or news group topic where I can find more information about the new version and what once should be doing to migrate their erpnext instance to new version properly.

Kind regards,
Mayur Patel




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.

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

This should work for you: http://pastebin.com/KE0U5HGK

Also see: http://erpnext.org/plugins

Thanks,
Anand.


On Wed, Dec 18, 2013 at 5:16 PM, MP <ma...@gmail.com> wrote:
Thanks Max, Pratik and Anand for your reply.

Yes, there is plugin folder. below is a content from /plugins/erpnext/hr/doctype/employee/employee.py


from future import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint, _


class CustomDocType(DocType):
if self.doc.department not in webnotes.defaults.get_user_default_as_list('department',self.doc.user_id):
webnotes.conn.add_default('department',self.doc.department,self.doc.user_id)


Note sure, how to rewrite above to make it work in the new version?

Also are there any change to custom client side script as well?

Also, are you able to point me to a link or news group topic where I can find more information about the new version and what once should be doing to migrate their erpnext instance to new version properly.


Kind regards,
Mayur Patel




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.

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.

    For more options, visit https://groups.google.com/groups/opt_out.
Is this correct way to write server side custom script in the new version?

/plugins/erpnext/hr/doctype/employee/employee.py

from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint, _

class CustomDocType(DocType):
    def on_update(self):
        if self.doc.department not in webnotes.defaults.get_user_default_as_list('department',self.doc.user_id):
            webnotes.conn.add_default('department',self.doc.department,self.doc.user_id)

Kind regards,
Mayur Patel



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.

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

Hold off on this for another week. Plugins are going to be cakewalk in version 4!

best,
Rushabh

On Wednesday, December 18, 2013 9:25:32 PM UTC+5:30, MP wrote:
Is this correct way to write server side custom script in the new version?

/plugins/erpnext/hr/doctype/employee/employee.py

from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint, _

class CustomDocType(DocType):
    def on_update(self):
        if self.doc.department not in webnotes.defaults.get_user_default_as_list('department',self.doc.user_id):
            webnotes.conn.add_default('department',self.doc.department,self.doc.user_id)

Kind regards,
Mayur Patel



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.

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

Okay Rushabh.

I will wait for version 4. Few quick questions regarding plugins functionality:

-- Will there be support for declaring a custom method as @webnotes.whitelist()? For example we have custom method called get_leave_balance_to_date(employee, leave_type, fiscal_year) and we want to be able to call it from leave_application.js script or from custom client side javascript.
-- Will there be support for overriding existing function in .js file (for example we want to change cur_frm.csscript.onload method in leave_application.js to call method get_leave_balance_to_date (declare above) to display number of days accrued as of today when ever certain fields on the form get updated. 

Kind regards,
MP

On Wednesday, 18 December 2013 17:35:44 UTC, rushabh wrote:
Mayur,

Hold off on this for another week. Plugins are going to be cakewalk in version 4!

best,
Rushabh

On Wednesday, December 18, 2013 9:25:32 PM UTC+5:30, MP wrote:
Is this correct way to write server side custom script in the new version?

/plugins/erpnext/hr/doctype/employee/employee.py

from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint, _

class CustomDocType(DocType):
    def on_update(self):
        if self.doc.department not in webnotes.defaults.get_user_default_as_list('department',self.doc.user_id):
            webnotes.conn.add_default('department',self.doc.department,self.doc.user_id)

Kind regards,
Mayur Patel



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.

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


On Thursday, December 19, 2013 10:14:05 PM UTC+5:30, MP wrote:

Okay Rushabh.

I will wait for version 4. Few quick questions regarding plugins functionality:

-- Will there be support for declaring a custom method as @webnotes.whitelist()? For example we have custom method called get_leave_balance_to_date(employee, leave_type, fiscal_year) and we want to be able to call it from leave_application.js script or from custom client side javascript.

Yes!
 
-- Will there be support for overriding existing function in .js file (for example we want to change cur_frm.csscript.onload method in leave_application.js to call method get_leave_balance_to_date (declare above) to display number of days accrued as of today when ever certain fields on the form get updated. 

This one is already there - in your custom script, just add the cur_frm.cscript.onload method.
 

Kind regards,
MP

On Wednesday, 18 December 2013 17:35:44 UTC, rushabh wrote:
Mayur,

Hold off on this for another week. Plugins are going to be cakewalk in version 4!

best,
Rushabh

On Wednesday, December 18, 2013 9:25:32 PM UTC+5:30, MP wrote:
Is this correct way to write server side custom script in the new version?

/plugins/erpnext/hr/doctype/employee/employee.py

from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, flt
from webnotes.model.doc import Document
from webnotes.model.code import get_obj
from webnotes import msgprint, _

class CustomDocType(DocType):
    def on_update(self):
        if self.doc.department not in webnotes.defaults.get_user_default_as_list('department',self.doc.user_id):
            webnotes.conn.add_default('department',self.doc.department,self.doc.user_id)

Kind regards,
Mayur Patel



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.

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