Print Node Integration for Frappe Framework

Hello @max_morais_dmm

I was referring to printing Barcode Label tags.

If you use zebra Printers for barcodes, printnode is able to print.

The new PR that I make into the project, Batch printing in ListViews · techmaxsolucoes/printnode-integration@87e3163 · GitHub, allow you to send printing in batch mode.

Can you please share the script used to design the print format…

I dont use any script, what I use is the designer from zebra

hi , anyone please help me remove print node app.

@Mohd_Rizal_sharif

just run

bench uninstall-app printnode_integration

bench uninstall-app printnode_integration
All doctypes (including custom), modules related to this app will be deleted. Are you sure you want to continue (y/n) ? y
Backing up…
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 330, in uninstall
remove_app(app, dry_run, yes)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 192, in remove_app
for module_name in frappe.get_module_list(app_name):
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 746, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).file), “modules.txt”))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 704, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named printnode_integration

i get this error.

You only get this kind of error, when the application is not installed yet!

Do something

bench console
>>> frappe.get_installed_apps()

If print node is installed, you should get something like this:

['frappe', 'erpnext', 'printnode_integration']

yes printnode on the listed. now server shows “internal server error”

this show while i try to bench update.

Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 27, in run_all
for patch in get_all_patches():
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 48, in get_all_patches
patches.extend(frappe.get_file_items(frappe.get_pymodule_path(app, “patches.txt”)))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 742, in get_pymodule_path
return os.path.join(os.path.dirname(get_module(scrub(modulename)).file), *joins)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 704, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named printnode_integration

try this

cd frappe-bench
bench --site {site-name-here} console
>>> import printnode_integration

If you are unable to import the printnode_integration, or you got an import-error, do

./env/bin/pip install -e apps/printnode_integration

And ensure that printnode_integration exists into sites/apps.txt

It may will solve your issues, including to uninstall printnode_integration

1 Like

still get error .

/home/frappe/frappe-bench$ sudo bench uninstall-app printnode_integration
All doctypes (including custom), modules related to this app will be deleted. Are you sure you want to continue (y/n) ? y
Backing up…
removing DocType Print Node Settings…
removing DocType Print Node Action…
removing DocType Print Node Job…
removing DocType Print Node Hardware…
removing Module Printnode Integration…
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 330, in uninstall
remove_app(app, dry_run, yes)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 212, in remove_app
frappe.delete_doc(“Module Def”, module_name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 673, in delete_doc
ignore_permissions, flags, ignore_on_trash, ignore_missing)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 78, in delete_doc
doc.run_method(“on_trash”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 758, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1027, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1012, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/printnode_integration/printnode_integration/events.py”, line 37, in on_trash
settings = frappe.get_doc(‘Print Node Settings’, ‘Print Node Settings’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 638, in get_doc
return frappe.model.document.get_doc(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 66, in get_doc
controller = get_controller(doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 36, in get_controller
module = load_doctype_module(doctype, module_name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 187, in load_doctype_module
raise ImportError(‘Module import failed for {0} ({1})’.format(doctype, module_name + ’ Error: ’ + str(e)))
ImportError: Module import failed for Print Node Settings (frappe.core.doctype.print_node_settings.print_node_settings Error: No module named print_node_settings.print_node_settings)

@Mohd_Rizal_sharif, run

bench --site {site-name-here} migrate
bench uninstall-app printnode_integration

still get same error.

ImportError: Module import failed for Print Node Settings (frappe.core.doctype.print_node_settings.print_node_settings Error: No module named print_node_settings.print_node_settings)

bench remove-from-installed-apps printnode_integration

1 Like

thank you its remove now

Hello @max_morais_dmm
In Point of sales, if we have multiple printers and each printer located in a place (like in restaurant, one printer at certain food and another printer at another food), depending on the ordered items, so it will print specific food at specific printer and all the items will be printed at the printer which is located at the point of sale computer.
In other words: how can we do a mapping between the items and the printer?

Regards
Bilal

@bghayad you need to create one “Print Format” per job type, eg:

  • Kitchen
  • Restaurant
  • POS

The major limitation of Print Node Integration is that works into the server side, so, POS only will works in online mode, not offline.

You can bind one Action to one Print Format and one Printer, trought events, eg: Submit.
So you can have multiple actions, that will be fired, on one event, and each action handle one print format.

In that way, when the Sales Invoice is submitted, it can print multiple documents into multiple printers.
But I didnt think this approach is good!

Cause Orders are much more likely “Sales Orders” than “Sales Invoices”, due the fact that one table can order multiple times, and be billed on the end, into a single invoice.

Thank you a lot @max_morais_dmm

And what about items?
Because it is required to print at printer 1 only the items that will be prepared by kitchen 1 and to print at printer 2 only the items that will be prepared by kitchen 2.
How this to be done?

Regards
Bilal

@bghayad you can use a custom field, to relate, items and printers, and feth this and apply as filter into the print format.

Dear max_morais_dmm,

thank you for your contribution, it seems very good.

Do you think can we print automatically our sales orders and/or sales invoice somehow?

Thank you for your help