Migration from CGI framework to frappe

Hi,

Is it possible to migrate CGI(responsive UI) framework to frappe? Or we have to migrate it first to WSGI i.e. Version 3.x.x and then to frappe? And if we need to migrate it to WSGI (3.x.x) then to which repository we need to point?

Regards,
Rohit



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/566b9e84-1c32-4012-a405-78898e8c6a14%40googlegroups.com.

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

On Thu, May 29, 2014 at 3:12 PM, Rohit Waghchaure
ro...@indictranstech.com wrote:

Hi,

Is it possible to migrate CGI(responsive UI) framework to frappe? Or we have
to migrate it first to WSGI i.e. Version 3.x.x and then to frappe? And if we
need to migrate it to WSGI (3.x.x) then to which repository we need to
point?

To migrate to version 4, all patches of version 3 have to be applied.
Version 4 doesn’t have these patches.

Regards,
Rohit


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/566b9e84-1c32-4012-a405-78898e8c6a14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pratik
erpnext

Hi Pratik,

It will be very useful if you can provide us with a step by step instruction on how to migrate from CGI version to version 4. There are lot of us who are still using CGI version. Thanks.

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e77203fe-31cc-4d76-b4bb-ea88a503e79a%40googlegroups.com.

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

On Mon, Jun 2, 2014 at 7:01 PM, MP ma...@gmail.com wrote:

Hi Pratik,

It will be very useful if you can provide us with a step by step instruction
on how to migrate from CGI version to version 4. There are lot of us who are
still using CGI version. Thanks.

Kind regards,
MP

Hi Mayur,

plus

https://github.com/frappe/frappe-bench#migrating-from-erpnext-version-3

should get you to version 4. It will have to be two step as we’ve
version 4 doesn’t have the patches. Can you try migrating your
database? We’ll be happy to help you through the errors you face.

Thanks,

Pratik
erpnext

Thanks Pratik,

I will try to migrate one of the clone site. I will let you know how I go. Thanks.

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/9dee15c6-472f-4630-8781-28a8b15f036a%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Pratik,

As per your suggestion, we have successfully migrated from CGI to WSGI using https://github.com/webnotes/erpnext/wiki/Migrating-your-erpnext-instance-to-wsgi. But we are getting below error when following instruction from https://github.com/frappe/frappe-bench#migrating-from-erpnext-version-3. When we ran ./scripts/install.sh migrate_3_to_4 /var/www/erp-prod, we got below error message half way through.

Executing frappe.patches.v4_0.update_custom_field_insert_after in erp-prod (sirius_erp_prod)
Traceback (most recent call last):
  File "scripts/3to4.py", line 32, in <module>
    migrate(args.site)
  File "scripts/3to4.py", line 26, in migrate
    latest()
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 67, in new_fn
    return fn(*args, **new_kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 417, in latest
    frappe.modules.patch_handler.run_all()
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 50, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 66, in execute_patch
    frappe.get_attr(patchmodule + ".execute")()
  File "/var/www/frappe-bench/apps/frappe/frappe/patches/v4_0/update_custom_field_insert_after.py", line 18, in execute
    cf.save()
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 194, in save
    self.run_post_save_methods()
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 414, in run_post_save_methods
    self.run_method("on_update")
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 387, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 463, in composer
    return composed(self, method, *args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 446, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 381, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/custom_field/custom_field.py", line 38, in on_update
    validate_fields_for_doctype(self.dt)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 186, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype).get("fields"))
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 244, in validate_fields
    check_unique_fieldname(d.fieldname)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 199, in check_unique_fieldname
    frappe.throw(_("Fieldname {0} appears multiple times in rows {1}").format(fieldname, ", ".join(duplicates)))
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 206, in throw
    msgprint(msg, raise_exception=exc)
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 203, in msgprint
    _raise_exception()
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 187, in _raise_exception
    raise raise_exception, msg
frappe.exceptions.ValidationError: Fieldname cost_center appears multiple times in rows 17, 41

Could you please help in resolving this error? In our existing system, we have setup cost_center custom fields for following doctypes:
- Purchase Order Item
- Purchase Receipt Item

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/d46b2321-276e-4f5b-9110-186835dd9061%40googlegroups.com.

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

Your custom fields are redundant because there are already fields with that name, so just remove them and continue the patch.


On 14-Jul-2014, at 9:41 pm, MP <ma...@gmail.com> wrote:

Hi Pratik,

As per your suggestion, we have successfully migrated from CGI to WSGI using https://github.com/webnotes/erpnext/wiki/Migrating-your-erpnext-instance-to-wsgi. But we are getting below error when following instruction from https://github.com/frappe/frappe-bench#migrating-from-erpnext-version-3. When we ran ./scripts/install.sh migrate_3_to_4 /var/www/erp-prod, we got below error message half way through.

Executing frappe.patches.v4_0.update_custom_field_insert_after in erp-prod (sirius_erp_prod)
Traceback (most recent call last):
  File "scripts/3to4.py", line 32, in <module>
    migrate(args.site)
  File "scripts/3to4.py", line 26, in migrate
    latest()
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 67, in new_fn
    return fn(*args, **new_kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 417, in latest
    frappe.modules.patch_handler.run_all()
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 50, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 66, in execute_patch
    frappe.get_attr(patchmodule + ".execute")()
  File "/var/www/frappe-bench/apps/frappe/frappe/patches/v4_0/update_custom_field_insert_after.py", line 18, in execute
    cf.save()
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 194, in save
    self.run_post_save_methods()
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 414, in run_post_save_methods
    self.run_method("on_update")
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 387, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 463, in composer
    return composed(self, method, *args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 446, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 381, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/custom_field/custom_field.py", line 38, in on_update
    validate_fields_for_doctype(self.dt)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 186, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype).get("fields"))
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 244, in validate_fields
    check_unique_fieldname(d.fieldname)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 199, in check_unique_fieldname
    frappe.throw(_("Fieldname {0} appears multiple times in rows {1}").format(fieldname, ", ".join(duplicates)))
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 206, in throw
    msgprint(msg, raise_exception=exc)
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 203, in msgprint
    _raise_exception()
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 187, in _raise_exception
    raise raise_exception, msg
frappe.exceptions.ValidationError: Fieldname cost_center appears multiple times in rows 17, 41

Could you please help in resolving this error? In our existing system, we have setup cost_center custom fields for following doctypes:
- Purchase Order Item
- Purchase Receipt Item

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/d46b2321-276e-4f5b-9110-186835dd9061%40googlegroups.com.

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



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/B9B9E560-0861-4636-911E-C63B743CB52E%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Thanks Rushabh. The reason we added these fields in our existing ERPNext system because they were not there in old version of ERPNext. I am assuming that you guys have added these fields as part of these doctypes.  I am also assuming that I won't loose any existing data stored in these custom fields.

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/195ca6f1-d993-4119-b1e8-b9a7421489f4%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Yeah - you should not lose and data - but take a backup to be safe


On 15-Jul-2014, at 4:18 pm, MP <ma...@gmail.com> wrote:

Thanks Rushabh. The reason we added these fields in our existing ERPNext system because they were not there in old version of ERPNext. I am assuming that you guys have added these fields as part of these doctypes.  I am also assuming that I won't loose any existing data stored in these custom fields.

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/195ca6f1-d993-4119-b1e8-b9a7421489f4%40googlegroups.com.

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



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/84DFEB2F-7A33-4D36-B8E6-3228016C4687%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Rushabh,

So delete these two records from 'tabCustom Field' table and then run the run ./scripts/install.sh migrate_3_to_4 /var/www/erp-prod again? I remember that last time when I try to run this script again after I got an error, it complained that 'site erp-prod already exists'. erp-prod is the name of the site. So should I delete this erp-prod folder from site directory and run the above script again? Please guide.

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/4d95236d-2d26-4fa6-a560-e335493e3174%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
@Pratik can you help.

@MP - we are putting the finishing touches on a new deployment platform.

https://github.com/frappe/bench/

Pratik will post it later today.



@rushabh_mehta

On 15-Jul-2014, at 5:18 pm, MP <ma...@gmail.com> wrote:

Hi Rushabh,

So delete these two records from 'tabCustom Field' table and then run the run ./scripts/install.sh migrate_3_to_4 /var/www/erp-prod again? I remember that last time when I try to run this script again after I got an error, it complained that 'site erp-prod already exists'. erp-prod is the name of the site. So should I delete this erp-prod folder from site directory and run the above script again? Please guide.

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/4d95236d-2d26-4fa6-a560-e335493e3174%40googlegroups.com.

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



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/60878411-7C35-441D-8184-A194A1A60572%40gmail.com.

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

Hi Mayur,

On Tue, Jul 15, 2014 at 5:18 PM, MP ma...@gmail.com wrote:

Hi Rushabh,

So delete these two records from ‘tabCustom Field’ table and then run the
run ./scripts/install.sh migrate_3_to_4 /var/www/erp-prod again? I remember
that last time when I try to run this script again after I got an error, it
complained that ‘site erp-prod already exists’. erp-prod is the name of the
site. So should I delete this erp-prod folder from site directory and run
the above script again? Please guide.

Sorry for the late reply.

You can remove the Custom Field from python shell via( frappe --ipython erp-prod) and use

frappe.delete_doc(‘Custom Field’, {name})

to remove the extra fields/

You don’t need to run the migrate script again. Instead, just run
../env/bin/frappe --latest erp-prod from the sites directory.

Thanks,

Pratik
erpnext

Thanks Pratik for your response. I have ran  ../env/bin/frappe --ipython erp-prod from inside of the site directory. I am getting below error.

Traceback (most recent call last):
  File "../env/bin/frappe", line 9, in <module>
    load_entry_point('frappe==4.1.0', 'console_scripts', 'frappe')()
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 53, in main
    return run(fn, parsed_args)
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 83, in run
    out = globals().get(fn)(**args)
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 67, in new_fn
    return fn(*args, **new_kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 765, in ipython
    import IPython
ImportError: No module named IPython

I installed ipython using "pip install ipython". But I am still getting above error. Could you please help to resolve this? Thanks.

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f5c38df6-b046-42f9-9039-cf6007f029af%40googlegroups.com.

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

On Wed, Jul 16, 2014 at 5:08 PM, MP ma...@gmail.com wrote:

Thanks Pratik for your response. I have ran …/env/bin/frappe --ipython
erp-prod from inside of the site directory. I am getting below error.

Traceback (most recent call last):
File “…/env/bin/frappe”, line 9, in
load_entry_point(‘frappe==4.1.0’, ‘console_scripts’, ‘frappe’)()
File “/var/www/frappe-bench/apps/frappe/frappe/cli.py”, line 53, in main
return run(fn, parsed_args)
File “/var/www/frappe-bench/apps/frappe/frappe/cli.py”, line 83, in run
out = globals().get(fn)(**args)

File “/var/www/frappe-bench/apps/frappe/frappe/cli.py”, line 67, in new_fn
return fn(*args, **new_kwargs)
File “/var/www/frappe-bench/apps/frappe/frappe/cli.py”, line 765, in
ipython
import IPython
ImportError: No module named IPython

I installed ipython using “pip install ipython”. But I am still getting
above error. Could you please help to resolve this? Thanks.

Hi Mayur,

You will have to install ipython in the environment,

So,

./env/bin/pip install ipython #no sudo

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/f5c38df6-b046-42f9-9039-cf6007f029af%40googlegroups.com.

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

Thanks,

Pratik
erpnext

Thanks Pratik.

I know it has been advised not to run Frappe and ERPnext as root user. But we have been running is as root for a while. Is there any reason for not running it as root?

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/579329fa-8d81-4cb4-8b1c-b5734ea52730%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Pratik,

I have installed ipython in the environment and did below.

ran ../env/bin/frappe --ipython erp-prod
frappe.delete_doc('Custome Field',{'Purchase Order Item-cost_center'})
frappe.delete_doc('Custome Field',{'Purchase Receipt Item-cost_center'});

It didn't output anything. I checked the database and I can still see these two records.
 select name, fieldname from `tabCustom Field` where name like '%cost%';

+-----------------------------------+-------------+
| name                              | fieldname   |
+-----------------------------------+-------------+
| Purchase Order Item-cost_center   | cost_center |
| Purchase Receipt Item-cost_center | cost_center |
+-----------------------------------+-------------+
2 rows in set (0.00 sec)

Is above ok?

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/fda65a29-7de0-447b-ae04-3ce166291814%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Corrected:
frappe.delete_doc('Custom Field', 'Purchase Order Item-cost_center')
frappe.delete_doc('Custom Field', 'Purchase Receipt Item-cost_center')

Thanks,
Anand.



On Wed, Jul 16, 2014 at 5:32 PM, MP <ma…@gmail.com> wrote:
Hi Pratik,

I have installed ipython in the environment and did below.

ran ../env/bin/frappe --ipython erp-prod

frappe.delete_doc('Custome Field',{'Purchase Order Item-cost_center'})
frappe.delete_doc('Custome Field',{'Purchase Receipt Item-cost_center'});

It didn't output anything. I checked the database and I can still see these two records.

select name, fieldname from tabCustom Field where name like '%cost%';

±----------------------------------±------------+
| name | fieldname |
±----------------------------------±------------+

| Purchase Order Item-cost_center | cost_center |
| Purchase Receipt Item-cost_center | cost_center |
±----------------------------------±------------+
2 rows in set (0.00 sec)

Is above ok?

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/fda65a29-7de0-447b-ae04-3ce166291814%40googlegroups.com.

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



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/CAAQzbF2oimttfst5XiXqxWm07zp1e1zdF5Lui%2B-ZA0HkTxkx8w%40mail.gmail.com.

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

On Wed, Jul 16, 2014 at 5:21 PM, MP ma...@gmail.com wrote:

Thanks Pratik.

I know it has been advised not to run Frappe and ERPnext as root user. But
we have been running is as root for a while. Is there any reason for not
running it as root?

You would not want any service to run as root. For example, if your
smtp server executed (due to a bug) every thing in the email body and
someone sends “rm -rf /”

A new and easier to use version of the bench is about to be released.
That would be a good opportunity for you to migrated your site to a
non-root user.

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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/579329fa-8d81-4cb4-8b1c-b5734ea52730%40googlegroups.com.

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

Thanks,

Pratik
erpnext

Thanks Anand. But it didn't work either. See below:

ro...@doris3to4:/var/www/frappe-bench/sites# ../env/bin/frappe --ipython erp-prod
Python 2.7.3 (default, Aug  1 2012, 05:14:39)
Type "copyright", "credits" or "license" for more information.

IPython 2.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: frappe.delete_doc('Custom Field', 'Purchase Order Item-cost_center')

In [2]: frappe.delete_doc('Custom Field', 'Purchase Receipt Item-cost_center')

In [3]: quit
ro...@doris3to4:/var/www/frappe-bench/sites# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 63
Server version: 5.5.38-MariaDB-1~precise-log mariadb.org binary distribution

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use sirius_erp_prod;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [sirius_erp_prod]> select name, fieldname from `tabCustom Field` where name like '%cost%';
+-----------------------------------+-------------+
| name                              | fieldname   |
+-----------------------------------+-------------+
| Purchase Order Item-cost_center   | cost_center |
| Purchase Receipt Item-cost_center | cost_center |
+-----------------------------------+-------------+
2 rows in set (0.00 sec)

MariaDB [sirius_erp_prod]> quit
Bye
ro...@doris3to4:/var/www/frappe-bench/sites# ../env/bin/frappe --latest erp-prod
Executing frappe.patches.v4_0.update_custom_field_insert_after in erp-prod (sirius_erp_prod)
Traceback (most recent call last):
  File "../env/bin/frappe", line 9, in <module>
    load_entry_point('frappe==4.1.0', 'console_scripts', 'frappe')()
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 53, in main
    return run(fn, parsed_args)
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 83, in run
    out = globals().get(fn)(**args)
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 67, in new_fn
    return fn(*args, **new_kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/cli.py", line 417, in latest
    frappe.modules.patch_handler.run_all()
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 50, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 66, in execute_patch
    frappe.get_attr(patchmodule + ".execute")()
  File "/var/www/frappe-bench/apps/frappe/frappe/patches/v4_0/update_custom_field_insert_after.py", line 18, in execute
    cf.save()
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 194, in save
    self.run_post_save_methods()
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 414, in run_post_save_methods
    self.run_method("on_update")
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 387, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 463, in composer
    return composed(self, method, *args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 446, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/var/www/frappe-bench/apps/frappe/frappe/model/document.py", line 381, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/custom_field/custom_field.py", line 38, in on_update
    validate_fields_for_doctype(self.dt)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 186, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype).get("fields"))
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 244, in validate_fields
    check_unique_fieldname(d.fieldname)
  File "/var/www/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 199, in check_unique_fieldname
    frappe.throw(_("Fieldname {0} appears multiple times in rows {1}").format(fieldname, ", ".join(duplicates)))
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 206, in throw
    msgprint(msg, raise_exception=exc)
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 203, in msgprint
    _raise_exception()
  File "/var/www/frappe-bench/apps/frappe/frappe/__init__.py", line 187, in _raise_exception
    raise raise_exception, msg
frappe.exceptions.ValidationError: Fieldname cost_center appears multiple times in rows 17, 41
ro...@doris3to4:/var/www/frappe-bench/sites#



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/ef9038c1-102e-4aa0-9b36-5638b576313e%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Thanks Pratik. Point taken. We will migrate it to non-root user when the new version of bench is released.

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.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/2109a592-fedf-4acc-a98d-7868b67e305a%40googlegroups.com.

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