Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Address block on invoices to the left (about QWeb inheritance and xpath position attributes)

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
qweblayoutinvoicesxpathOdoo13.0
3 Odpowiedzi
13836 Widoki
Awatar
Jürgen Bereuter

Hi, i like to change the layout of invoices in Odoo 13. The address field should be on the left side. I know, that i had to change some reports or views, but i dont know which one exactly, now it is trial and error (with more error than success). thanks!

0
Awatar
Odrzuć
Jürgen Bereuter
Autor

Because my karma is too low i write this comment to myself - now its easier to look into the right fields, not just playing around with more created errors.. thank you all and merci vielmol, jürgen

Ermin Trevisan

My pleasure, but an upvote is very welcome :-)

Jürgen Bereuter
Autor

sorry - not enough karma points for upvoting. But all answers helped a lot!

Awatar
Ermin Trevisan
Najlepsza odpowiedź

In order to manipulate the position of such content elements, you need to understand Bootstrap's grid system and use the corresponding classes. You should create a module and inherit the corresponding QWeb view using xpath expressions to amend the corresponding classes.

The following example is for Odoo 9.0 and does not exactly what you want, but it shows a good part of manipulating QWeb views according to your custom requirements, you'll get the idea:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<template id="tw_twanda_reportdesign.report_invoice_document" name="tw_twanda_design_invoice" inherit_id="account.report_invoice_document" active="True" priority="17">

<xpath expr="//div[@class='page']" position="attributes">
<attribute name="style">font-family: 'Ubuntu', sans-serif;</attribute>
</xpath>

<xpath expr="//div[@class='col-xs-5 col-xs-offset-7']" position="attributes">
<attribute name="style">margin-top: 10mm; margin-bottom: 25mm</attribute>
</xpath>

<xpath expr="//h2" position="attributes">
<attribute name="style">font-size: 24px; color: #e4677f; margin-top: 10mm; margin-bottom: 25mm</attribute>
<attribute name="class">text-epsilon</attribute>
</xpath>

<xpath expr="//div[@t-if='o.date_invoice']" position="attributes">
<attribute name="class">col-xs-3</attribute>
</xpath>

<xpath expr="//span[@t-field='l.quantity']" position="replace">
<t>
<t t-set="mod_qty">
formatLang(l.quantity, digit=0)
</t>
<t t-if="mod_qty == l.quantity">
<span><t t-esc="mod_qty"/></span>
</t>
<t t-if="mod_qty != l.quantity">
<span><t t-esc="('%.0f'% l.quantity * 1)"/></span>
</t>
</t>

</xpath>

</template>

</data>
</odoo>

Recommended reading:

- Yenthe's famous tutorial: https://www.odoo.yenthevg.com/inheriting-and-modifying-qweb-reports/

- Bootstrap grid system: https://getbootstrap.com/docs/4.0/layout/grid/

- Really really helpful for testing your xpath-expressions: https://codebeautify.org/Xpath-Tester

- View Inheritance and xpath locators (position attribute): http://learnopenerp.blogspot.com/2018/01/inheritance-in-models-and-views.html (please be aware that since Odoo 12 there is a new position attribute available: "move", see https://github.com/odoo/odoo/pull/23877)


2
Awatar
Odrzuć
Sehrish

nice sharing

Ermin Trevisan

Also your upvote is welcome.

Awatar
Paresh Wagh
Najlepsza odpowiedź

Hi Jurgen:

To make changes to the location of the address field, you will need to customize one of the web.external_layout_xxxx views depending on which document layout you are using at your site. Note that this change will reflect in all the documents that use this layout. If you need to make the change for just one document, you will need to define a custom layout and use that instead for your document.

0
Awatar
Odrzuć
Awatar
Jürgen Bereuter
Autor Najlepsza odpowiedź

Hello Paresh, thank you for the hint. I am going to change the whole layout (the envelopes have the windows for the address on the left side).
I found a short-link to edit the layout (as you mentioned): in developer mode, go to settings, there is a edit-link to the layout. There are to possible lines to achieve my goal - i am grateful for an idea, how and where i need to change the code (add a row or column, new class or whatever..):

external_layout_standard:

....
 <div class="article o_report_layout_standard" 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"/>

            <t t-raw="0"/>

        </div>
....​

or in address_layout

<t t-name="web.address_layout">
        <t t-set="colclass" t-value="('col-md-5' if report_type == 'html' else 'col-5') + ' ml-auto'"/>
        <t t-if="address">
            <div class="address row">
                <t t-if="information_block">
                    <t t-set="colclass" t-value="'col-5 offset-1'"/>
                    <div name="information_block" class="col-6">
                        <t t-raw="information_block"/>
                    </div>
                </t>
                <div name="address" t-att-class="colclass">
                    <t t-raw="address"/>
                </div>
            </div>
        </t>
    </t>

0
Awatar
Odrzuć
Paresh Wagh

You may need to make changes within the <t t-if="address">....</t> block to get what you need.

Just to throw some light on this issue since it is a bit complex....The "address" variable is composed and set in the account.report_invoice_document view and used in web.address_layout. If you are not able to achieve the result you desire, you may need to look at the way web.external_layout_standard, web.address_layout and account.report_invoice_document work together to decide where the changes need to be made.

Ermin has provided a good set of links that describe how the Bootstrap grid system works. As mentioned by him, one needs to understand this to ensure that the reports are designed to work as expected.

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ść
multiple invoice layout Rozwiązane
layout invoices
Awatar
Awatar
Awatar
Awatar
Awatar
43
kwi 23
48792
How to sum lines in a QWEB report (Odoo 13)? Rozwiązane
qweb Odoo13.0
Awatar
Awatar
1
mar 22
5416
Hidding <p> tag from account.invoice Rozwiązane
xpath Odoo13.0
Awatar
Awatar
1
paź 20
3320
odoo xpath add existing element inside element Rozwiązane
qweb xpath website
Awatar
Awatar
Awatar
Awatar
3
sty 25
15897
Xpath problems...Help me write this xpath
views qweb xpath
Awatar
Awatar
1
sie 24
3257
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now