On 2018-09-17 01:21, Markus Bala wrote:
> Actually I have 3 questions, below is my case:
> 
> I will doing barcode label for some warehouse operation.
> 
> Case Study:
> At the receiving area, during receiving & storage, it will need to print 2 
> labels. One label is product label. One label is storage label. The different 
> between 2 labels are in the label's size.
> Product label using 5cm x 10cm. Storage label using 15cm x 10cm.
> 
> Because of this, I will  have 2 labels printer. Printer (A) for product 
> label. Printer (B) for storage Label.
> 
> Question 1: for "Direct Print", how can set when I click on print "Product 
> Label" it choose Printer (A) and vice versa.

On windows, the client use the command 'print' which let the OS decide.
So maybe you can use different file extension and configure the OS to
choose the right printer.
On MacOS, the client uses the 'open' command which just open the file.
Maybe it is possible to configure the "opener" to select the right
printer when requesting to print.
On UNIX, it uses the 'xdg-open' command. In this case, I guess you can
also customize xdg to select the right printer from the mime-type.

> Or alternative solution:
> Making the printer module. Like the link below:
> 
> https://groups.google.com/forum/#!searchin/tryton-dev/printer|sort:date/tryton-dev/1Hu0AE5bjd8/0zCHyxkPq3EJ

Not sure it is the best option because it requires a connection between
the server and the printer. Usually they are not in the same physical
area.

> Question 2: How to get "Tryton Client" IP from "Trytond"? the purpose to 
> fixed the IP/PC for the label printers so other PC do not have label printer

Since 4.8, the Transaction.context has an attribute '_request' which is
the werkzeug request object and contain the IP address of the client.
But there is no guarantee that this attribute will always be set (for
example from proteus request or cron job).

> Question 3: How to get report in byte in trytond so I can print direct to 
> printer through network. Like the link below
> 
> https://www.zebra.com/us/en/support-downloads/knowledge-articles/ait/Network-Printing-Python-Example.html

You can get the Report class from the pool and call execute on it. This
will return the bytes as second element of the response.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20180921081919.jaygesgfwrolmchi%40kei.

Reply via email to