Hello Everyone!
I'm trying to Modify Odoo 18 Community Document Layout of Invoices as appeared on the image below to look like that of standard POS paper size: 50mm/80mm.
How can I go about that?
Thanks in anticipation!

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I'm trying to Modify Odoo 18 Community Document Layout of Invoices as appeared on the image below to look like that of standard POS paper size: 50mm/80mm.
How can I go about that?
Thanks in anticipation!

Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Ol| İlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
|---|---|---|---|---|
|
change between 2 Invoice formats
Çözüldü
|
1
Tem 25
|
1720 | ||
|
2
Tem 25
|
2055 | |||
|
1
Tem 25
|
3012 | |||
|
3
Nis 25
|
2913 | |||
|
3
Nis 25
|
3888 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
Hello,
If you want to customize the layout then Settings -> General Settings-> Companies -> Edit Layout.
Or if you want to add fields inside this layout then go with this- "view_base_document_layout"
@Codesphere Tech
Do you have Idea about the exact code? I know where to drop that.
Thanks!
It depends what you want to customize.. tell me what you want to change?
I just want it to appear in one tiny column so as to use a POS printer for printing the pages.
Thanks!
You can create a paper format for your custom size and then select here in Paper Format.
How please?
You check this blog from Cybrosys:
https://www.cybrosys.com/blog/overview-of-paper-format-in-odoo-18
Thanks for your reply, article on the link seems to be for paper size but not actually recoding them to be in a single column using the Qweb format.
<t t-name="web.external_layout_standard">
<div t-attf-class="header o_company_#{company.id}_layout">
<div class="d-flex justify-content-between align-items-center mb-2">
<img t-if="company.logo" class="o_company_logo_small" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
<div t-if="company.report_header" t-field="company.report_header" class="o_company_tagline mw-50 fw-bold">Company tagline</div>
</div>
<div class="row">
<div class="col-6" name="company_address">
<ul class="list-unstyled" name="company_address_list">
<li t-if="company.is_company_details_empty"><span t-field="company.partner_id" t-options="{"widget": "contact", "fields": ["address", "name"], "no_marker": true}">
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
<strong>Company address block</strong>
<div>Contains the company address.</div>
</div>
</span></li>
<li t-else="">
<span t-field="company.company_details">
<div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
<strong>Company details block</strong>
<div>Contains the company details.</div>
</div>
</span>
</li>
<li t-if="not forced_vat"/>
<li t-else="">
<t t-esc="company.country_id.vat_label or 'Tax ID'">Tax ID</t>:
<span t-esc="forced_vat">US12345671</span>
</li>
</ul>
</div>
</div>
</div>
<div t-attf-class="article o_report_layout_standard o_table_standard o_company_#{company.id}_layout o_snail_mail {{'o_report_layout_background' if company.layout_background != 'Blank' else ''}}" t-attf-style="background-image: url({{ 'data:image/png;base64,%s' % company.layout_background_image.decode('utf-8') if company.layout_background_image and company.layout_background == 'Custom' else '/base/static/img/demo_logo_report.png' if company.layout_background == 'Demo logo' else ''}});" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-call="web.address_layout"/>
<h2 t-out="layout_document_title"/>
<t t-out="0"/>
</div>
<div t-attf-class="footer o_company_#{company.id}_layout {{report_type != 'pdf' and 'mt-auto'}}">
<div class="o_footer_content d-flex border-top pt-2">
<div class="flex-grow-1 text-start me-2" t-field="company.report_footer"/>
<div class="text-end text-muted">
<div t-if="report_type == 'pdf' and display_name_in_footer" t-out="o.name">(document name)</div>
<div t-if="report_type == 'pdf'">Page <span class="page"/> / <span class="topage"/></div>
</div>
</div>
</div>
</t>
I think the code above is generating the invoice, how to exactly customize the above to render a single column to fit my tiny paper size is the problem.
Can you provide an example that what you want to update in this layout?
Thanks for your assistance.
The image below demonstrate exactly what I want to achieve.
http://account.servercrib.com/preview_external_report.png
First you need to create custom paper format with 50 * 80 size.. then you need to set this paper format in document layout and also you need customize report layout based on your needs.. If you want then I will share the screenshot here for paper format.
I have set the paper size as I said before, what I need is to customize the report layout based on the last image I shared. Thanks!
Yes, But I can't provide the code for your custom report, It is solved by the set paper format with size and rest of things you have to manage by yourself.
Thanks for all the guidance so far! I understand that setting the custom paper format is necessary, but my main challenge is adjusting the QWeb report layout itself to render everything in a single narrow column for the POS printer.
If anyone has experience restructuring the <div> and <t> elements in web.external_layout_standard for a very narrow width like 50mm, some tips or examples would be really helpful. Even suggestions on which elements to remove or stack differently would save a lot of trial and error.
Appreciate any insights!
Hello Chijioke & Piers,
This article is helpful for you:
https://www.odoo.com/forum/help-1/print-invoice-payment-receipt-as-a-ticket-and-not-as-a4-272474