تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (BI)
    • المستندات
    • توقيع إلكتروني
    المبيعات
    • إدارة علاقات العملاء
    • المبيعات
    • نقطة البيع للمتاجر
    • نقطة البيع للمطاعم
    • الاشتراكات
    • تأجير
    المواقع الإلكترونية
    • أداة بناء المواقع الإلكترونية
    • متاجر إلكترونية
    • مدونة
    • المنتدى
    • دردشة مباشرة
    • التعليم الإلكتروني
    سلسلة التوريد
    • المستودعات
    • التصنيع
    • إدارة دورة حياة المنتج
    • المشتريات
    • الصيانة
    • الجودة
    الموارد البشرية
    • موظفون
    • التوظيف
    • إجازة عمل
    • التقييمات
    • الإحالات
    • تطبيق الأسطول
    التسويق
    • التسويق الإجتماعي
    • التسويق عبر البريد الإلكتروني
    • التسويق عبر الرسائل النصية
    • فعاليات
    • أتمتة التسويق
    • الاستطلاعات
    الخدمات
    • المشاريع
    • الجداول الزمنية
    • الخدمة الميدانية
    • مكتب المساعدة
    • التخطيط
    • مواعيد
    اﻹنتاجية
    • مناقشة
    • الموافقات
    • إنترنت الأشياء "IoT"
    • بروتوكول ربط المحادثات الصوتية عبر الإنترنت
    • المعرفة
    • WhatsApp
    التطبيقات الخارجية ستوديو أودو منصة أودو السحابية
  • قطاعات الأعمال
    البيع بالتجزئة
    • متجر كتب
    • متجر ملابس
    • متجر أثاث
    • متجر بقالة
    • متجر معدات
    • متجر ألعاب
    الطعام والضيافة
    • بار وحانة
    • المطعم
    • مطعم للوجبات السريعة
    • نزل للضيوف
    • موزّع مشروبات
    • فندق
    العقارات
    • وكالة عقارات
    • شركة هندسة معمارية
    • البناء
    • إدارة العقارات
    • العناية بالحدائق
    • اتحاد مُلاّك العقارات
    استشارة
    • مؤسسة محاسبية
    • شريك أودو
    • وكالة تسويقية
    • منشأة قانونية
    • استقطاب المواهب
    • التدقيق والتوثيق
    التصنيع
    • الأقمشة
    • معدني
    • الأثاث
    • الطعام
    • مصنع خمور
    • هدايا الشركات
    الصحة واللياقة البدنية
    • نادي رياضي
    • متجر نظارات
    • مركز لياقة بدنية
    • الممارسون الصحيون
    • صيدلية
    • صالون تصفيف الشعر
    التجارة
    • عامل صيانة
    • الأجهزة والمعدات التقنية ودعمها
    • أنظمة الطاقة الشمسية
    • صانع أحذية
    • خدمات التنظيف
    • خدمات التكييف (HVAC)
    غير ذلك
    • منظمة غير ربحية
    • وكالة بيئية
    • تأجير لوحات إعلانية
    • تصوير
    • تأجير دراجات
    • بائع وسيط للبرمجيات
    تصفح كافة قطاعات الأعمال
  • مجتمع أودو
    تعلم
    • دروس
    • التوثيق
    • شهادات
    • التدريب
    • مدونة
    • بودكاست
    قم بتعزيز التعليم
    • برنامج تعليم
    • Scale UP! لعبة الأعمال
    • قم بزيارة أودو
    احصل على البرنامج
    • تحميل
    • قارنْ الإصدارات
    • إطلاق
    تعاون
    • جيت هاب "Github"
    • المنتدى
    • فعاليات
    • الترجمات
    • كنْ شريكاً
    • خدمات الشركاء
    • سجل مكتب المحاسبة الخاص بك
    احصل على الخدمات
    • اعثر على شريك
    • اعثر على محاسب
    • قابل أحد مرشدي الأعمال
    • خدمات التنفيذ
    • مراجع العملاء
    • الدعم
    • الترقيات
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    الحصول على عرض توضيحي
  • الأسعار
  • المساعدة

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

  • إدارة علاقات العملاء
  • e-Commerce
  • المحاسبة
  • المخزون
  • PoS
  • المشروع
  • MRP
All apps
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
المساعدة

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

اشتراك

تسلم الإشعارات عندما يكون هناك نشاط في هذا المنشور

لقد تم الإبلاغ عن هذا السؤال
qweblayoutinvoicesxpathOdoo13.0
3 الردود
13830 أدوات العرض
الصورة الرمزية
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
الصورة الرمزية
إهمال
Jürgen Bereuter
الكاتب

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
الكاتب

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

الصورة الرمزية
Ermin Trevisan
أفضل إجابة

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
الصورة الرمزية
إهمال
Sehrish

nice sharing

Ermin Trevisan

Also your upvote is welcome.

الصورة الرمزية
Paresh Wagh
أفضل إجابة

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
الصورة الرمزية
إهمال
الصورة الرمزية
Jürgen Bereuter
الكاتب أفضل إجابة

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
الصورة الرمزية
إهمال
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.

هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
multiple invoice layout تم الحل
layout invoices
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
43
أبريل 23
48790
How to sum lines in a QWEB report (Odoo 13)? تم الحل
qweb Odoo13.0
الصورة الرمزية
الصورة الرمزية
1
مارس 22
5415
Hidding <p> tag from account.invoice تم الحل
xpath Odoo13.0
الصورة الرمزية
الصورة الرمزية
1
أكتوبر 20
3320
odoo xpath add existing element inside element تم الحل
qweb xpath website
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
3
يناير 25
15896
Xpath problems...Help me write this xpath
views qweb xpath
الصورة الرمزية
الصورة الرمزية
1
أغسطس 24
3257
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "Github"
  • المشغل الآلي رنبوت
  • الترجمات
خدماتنا
  • استضافة أودو إس إتش
  • الدعم
  • الترقية
  • التطويرات المخصصة
  • التعليم
  • اعثر على محاسب
  • اعثر على شريك
  • كنْ شريكاً
معلومات عنا
  • شركتنا
  • أصول العلامة التجارية
  • اتصلْ بنا
  • الوظائف
  • فعاليات
  • بودكاست
  • مدونة
  • عملاء
  • قانوني • الخصوصية
  • الحماية
الْعَرَبيّة 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

أودو هو عبارة عن مجموعة من تطبيقات الأعمال مفتوحة المصدر التي تغطي جميع احتياجات شركتك، مثل: إدارة علاقات العملاء والتجارة الإلكترونية والمحاسبة والمخزون ونقاط البيع وإدارة المشاريع وما إلى ذلك.

ما يجعل من أودو مميزاً هو هدفه بأن يكون سهل الاستخدام للغاية ومتكاملاً تمامًا في الوقت ذاته.

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