Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

How to copy the value of an attribut value to another attribut in the same node using <xpath> and <attribute>

Naroči se

Get notified when there's activity on this post

This question has been flagged
qwebxpathattributesiframecompliance
1 Odgovori
4983 Prikazi
Avatar
Stephan Becker

Hi all,

during making my odoo site fully GDPR copliant I need to modify each and every iframe (and other tags like <script> as well) on the site like this example indicates:


Required changes to Iframe tags:

1.) Change the src="…" attribute of the iframe to data-cmp-src="…"
2.) Add a new src="about:blank" attribute to the iframe
3.) If a class="…" exists, add cmplazyload to the value. If class does not exist, add the attribute including the value class="cmplazyload"
 

Example code before change:

<iframe width="300" height="250" noresize="noresize" scrolling="no" 
    frameborder="0" marginheight="0" marginwidth="0"
    src="http://adserver.de/?x=1&y=2"
    ALLOWTRANSPARENCY="true">
</iframe>
Example code after change:

Example code after change:

<iframe width="300" height="250" noresize="noresize" scrolling="no"        
    frameborder="0" marginheight="0" marginwidth="0"        
    class="cmplazyload"        
    src="about:blank"     
    data-cmp-src="http://adserver.de/?x=1&y=2" 
      
    ALLOWTRANSPARENCY="true">
</iframe>

I went with the idea of using xpath expressions with the position="attribute" action type to do these modifications to all pages page.

But I found no sulution how to assign the value of an attribute to another attribute of the same node by using the <xpath> and <attribute> tags like this:

<xpath expr="iframe" position="attributes">
  <attribute name ="data-cmp-src"> <Value of attribute src of this iframe> </attribute>
</xpath>

How could that be achieved?
Using QWeb variables seem not to work inside <xpath> ..

Any other idea how to modify tags globaly like this?


Cheers
Stephan

0
Avatar
Opusti
Avatar
Dan Mulindwa
Best Answer

This looks hacky, but I think i know it can work. Am sure there should be better ways.

<xpath expr="iframe" position="attributes">
<attribute name="t-attf-data-cmp-src" add="#{'Value of attribute src of this iframe'}" separator=" "/>
</xpath>
0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
odoo xpath add existing element inside element Solved
qweb xpath website
Avatar
Avatar
Avatar
Avatar
3
jan. 25
15896
Xpath problems...Help me write this xpath
views qweb xpath
Avatar
Avatar
1
avg. 24
3257
external_layout_header's fixed space can not be changed in PDF
qweb report xpath
Avatar
Avatar
Avatar
2
feb. 24
8342
Hide <t> element with xpath in odoo
hide xpath attributes
Avatar
Avatar
1
jun. 23
4072
Change button call using attributes Solved
button xpath attributes
Avatar
Avatar
1
jan. 22
12632
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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