Hello, I would like to print the name and phone number of a contact on a Zebra printer (ZPL). Can you give me the QWEB code to use? Thank you.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
Here's a simple QWeb report snippet that generates ZPL code to print a contact's name and phone number on a Zebra printer:
<t t-name="your_module.zpl_contact_label">
<t t-foreach="docs" t-as="doc">
<![CDATA[
^XA
^CF0,30
^FO50,50^FDName: <t t-esc="doc.name"/ >^FS
^FO50,100^FDPhone: <t t-esc="doc.phone"/ >^FS
^XZ
]]>
</t>
</t>
Replace your_module.zpl_contact_label with your actual report name.
Pass the contact record(s) as docs when rendering the report.
This will print the contact's name and phone at positions (50,50) and (50,100) on the label.
You can adjust the font size (^CF0,30) and coordinates (^FOx,y) as needed.
i hope it is help full
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
2
lip 25
|
801 | ||
|
0
maj 25
|
748 | ||
|
2
kwi 25
|
660 | ||
|
0
kwi 25
|
727 | ||
|
1
kwi 25
|
1350 |
Hello, Thank you for your reply.
I created the report called "Contact Label (ZPL)."
I specified the template name "product.contact" and the report name "stock.label_product_contact_view."
The QWEB code is as follows:
<t t-name="stock.label_product_contact_view">
<t t-foreach="docs" t-as="doc">
^XA
^CF0.30
^FO50.50^FDName: <t t-esc="doc.name"/ >^FS
^FO50.100^FDPhone: <t t-esc="doc.phone"/ >^FS
^XZ
</t>
</t>
How do I activate this report? For example, with a button. I don't see this in Studio.
Thank you for your help.