Barcode image

Hello All,
   Have anyone implemented the barcode image integration with ERPNext?

Thank you all



Please 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.



    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 post to this group, send email to er...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/60e5c49d-4c7e-4579-ad29-a989780fec03%40googlegroups.com.

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

     

     

Hello All,
   I have installed pyBarcode/0.7 using “pip install pyBarcode”. I have created a custom doctype for barcode and wrote following code in barcode.py
  import barcode
  from barcode.writer import ImageWriter
  EAN = barcode.get_barcode_class(‘ean13’)
  ean = EAN(u’5901234123457’, writer=ImageWriter())
  fullname = ean.save(‘ean13_kadam’)

 but got  following error

File “…/app/selling/doctype/barcode/barcode.py”, line 11, in on_update
from barcode.writer import ImageWriter
ImportError: No module named writer

same code works in python terminal and in ERPNext cgi

how to resolve this issue?


Thank you



Please 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.



    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 post to this group, send email to er...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/97312ef3-64bc-4436-8ea4-aebdf800b4b0%40googlegroups.com.

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

     

     
Hi Gangadhar,

When importing modules, python searches the local folder first and then the python path.

In this case, when executing barcode.py, python found that a module named barcode exists in the local folder i.e. app.some_module.doctype.barcode.barcode, and hence, it isn't able to find the barcode module.

You can confirm this by checking dir(barcode) after import barcode

As a workaround, you can write a function - create_barcode_image in, say, erpnext_module_name/utils.py, and use:
from erpnext_module_name.utils import create_barcode_image

-Anand.

On 08-Jul-2013, at 2:18 PM, gangadhar kadam <em...@gmail.com> wrote:

Hello All,
   I have installed pyBarcode/0.7 using "pip install pyBarcode". I have created a custom doctype for barcode and wrote following code in barcode.py
  import barcode
  from barcode.writer import ImageWriter
  EAN = barcode.get_barcode_class('ean13')
  ean = EAN(u'5901234123457', writer=ImageWriter())
  fullname = ean.save('ean13_kadam')

 but got  following error

File "../app/selling/doctype/barcode/barcode.py", line 11, in on_update
    from barcode.writer import ImageWriter
 ImportError: No module named writer

same code works in python terminal and in ERPNext cgi

how to resolve this issue?


Thank you




Please 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.



    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 post to this group, send email to er…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/97312ef3-64bc-4436-8ea4-aebdf800b4b0%40googlegroups.com.

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

     

     



Please 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.



    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 post to this group, send email to er...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/792348C1-9682-4775-8F5A-555202AD44D9%40erpnext.com.

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

     

     
Read - https://www.erpnext.com/using-barcodes-to-ease-data-entry

On 08-Jul-2013, at 2:04 PM, gangadhar kadam <em...@gmail.com> wrote:

Hello All,
   Have anyone implemented the barcode image integration with ERPNext?

Thank you all



Please 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.



    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 post to this group, send email to er…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/60e5c49d-4c7e-4579-ad29-a989780fec03%40googlegroups.com.

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

     

     



Note:

 

If you are posting an issue,

  1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

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