@pratu16x7 sure i will …
i was thinking something like Select options, kind of:
Question is, how can i get values from Options in field definition?
@pratu16x7 sure i will …
i was thinking something like Select options, kind of:
Question is, how can i get values from Options in field definition?
Excellent! That would be perfect for setting the type (you wouldn’t need the "type: ", just EAN13
). Every control object has an options
property that receives whatever you set in there. There’s width
as well, but not height
as far as I’ve seen. For all these JsBarcode properties you can’t map this cleanly, we’d have to think creatively.
that’s why i was thinking having kind of property: value
, is not clean?
The options
field is of type small text
and not code
, so it’s not standard to use it to parse complex strings like key value pairs, but it is possible. We’ve so far used it to parse single values or list of options at the most
i see, if you consider the pair property: value
as string:
format: "EAN13"
font: "OCR-B"
and convert \n
into ,
. At that point could be possible to set option into JSBarcode, like:
JsBarcode(svg, value).options({format: "EAN13", font: "OCR-B"})
Could be a solution?
Sure, as I mentioned, it is possible. Send in a PR for this, and if this is not the only use case, we’ll see if options
can be a code
field as well.
I’ll try to send a PR …can u just let me know how to get options inside ControlBarcode
So in ControlBarcode
you can access it as this.options
Oh ok …stupid me … i’ll try to send a PR
Yippee!!!
Finally we are close to having a native barcode printing solution in ERPNext.
I look forward to having a chance to test this. I print several hundred barcode labels per day already and I really want to get rid of the clunky 3rd party printing software.
I am not a developer or coder, but if there is anything I can do to help you can count on my support!
BKM
You can already test in develop branch …i’m going to send a PR to have more options …
Got it !!
Will set up a developer server this afternoon. I will populate it with a copy of my live data and test over the weekend.
Thanks!
BKM
here it comes:
@pratu16x7 seems there is some problem when saving doc with Barcode Field, see gif at:
Edit:
I’m still getting black square once doc is saved, any hint on how to fix it?
You need to enable the Ignore XSS Filter
in the field to make sure the svg data is saved as is in db.
@pratu16x7 probably it’s needed to show Ignore XSS Filter
in Customize Form
if Field Type
is Barcode
or set it by default
Edit: it works! Thx