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

How to select an element that is in xpath with xpath?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
templateecommercexpathv14
4 Odpowiedzi
35322 Widoki
Awatar
Samo Arko

I'm trying to add change the text displayed on a template. The template allready inherits the inherits the main shop template and adds a feature. I want to change the text and add a div. But I cannot get the element. It throws the cannot find element error.

Template:

<template id="products" inherit_id="website_sale.products" priority="15">
	<xpath expr="//div[hasclass('o_wsale_products_main_row')]" position="before">
		<t t-if="some condition">
			<t t-if="some condition">
				<div class="col-12">
					<h5 class="mb-3">Categories</h5>

I want to replace the h5 element:

<xpath expr="//h5[@class='mb-3']" position="replace">

Tried also with:

<xpath expr="//h5[hasclass('mb-3')]" position="replace">

But it throws the same error

Element '<xpath expr="//h5[@class='mb-3']">' cannot be located in parent view



0
Awatar
Odrzuć
Awatar
Cybrosys Techno Solutions Pvt.Ltd
Najlepsza odpowiedź

Hi,

Please try using the below line of code

example:


<template id="products" inherit_id="website_sale.products" priority="15">

    <xpatth expr = "//t[@t-if='some condition']//t[@t-if='some condition']//div[hasclass('col-12')]//h5" position="replace">


  //Your value


</xpath>



0
Awatar
Odrzuć
Awatar
Begineer
Najlepsza odpowiedź

Hi,

Sometimes its better to give the complete xpath , here you need not mention the complete path, just try giving the div class oe_website_sale  before  o_wsale_products_main_row ,

<xpath expr="//div[hasclass('oe_website_sale')]/div[hasclass('o_wsale_products_main_row')]" position="before">    
    your conditions, div,  etc

</xpath>

                                                                    or 

<xpath expr="//div[hasclass('oe_website_sale')]" position="inside"> 

    your conditions, div,  etc
</xpath>


Hope it helps,

Thanks

0
Awatar
Odrzuć
Awatar
Akshay
Najlepsza odpowiedź

Hi ,

This h5 tag is in template "products" in your custom module

so to replace or to make any changes you have to inherit "Custom_module.products".

Hope this helps

regards

0
Awatar
Odrzuć
Samo Arko
Autor

I do inherit the custom module template. But cannot even select the xpath node to replace the whole one.

Akshay

Please make sure that you have added custom_module to depends in manifest

Samo Arko
Autor

It is. Working with odoo more than 3 years so lets assume that those basic things are correct. This is the 1st time I needed to change something that is in xpath, and I thought it will be as easy like you suggested but it doesn't work

Akshay

Well that's how we make changes on an Xpath element. If you are still getting an error, then one have to look to the basics.I am sure that a person with over 3yr experience in odoo will be able to figure that out by himself.

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ść
Element '<xpath expr="//head/link[last()]">' cannot be located in parent view every time trying to extend portal.frontend_layout
portal template xpath frontend v14
Awatar
Awatar
1
mar 24
5603
How to update existing product quantity? Rozwiązane
ecommerce v14
Awatar
Awatar
1
paź 20
14295
odoo16: how to reference <t element in xpath expr
template xpath odoo16features
Awatar
Awatar
Awatar
2
mar 24
3976
Splitit payment gateway
ecommerce payments v14
Awatar
Awatar
1
sty 24
2429
ecommerce 14 ce: Disable "add to basket" etc, but show stock in physical shop
community ecommerce v14
Awatar
0
paź 23
2236
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