Siirry sisältöön
Odoo Menu
  • Kirjaudu sisään
  • Kokeile ilmaiseksi
  • Sovellukset
    Talous
    • Kirjanpito
    • Laskutus
    • Kulut
    • Datataulukot (BI)
    • Asiakirjat
    • Allekirjoita
    Myynti
    • CRM
    • Myynti
    • Kassajärjestelmä myymälään
    • Kassajärjestelmä ravintolaan
    • Tilaukset
    • Vuokraus
    Verkkosivut
    • Verkkosivun Rakennustyökalu
    • Verkkokauppa
    • Blogi
    • Foorumi
    • Livechat
    • Verkko-oppiminen
    Toimitusketju
    • Varastointi
    • Tuotanto
    • Tuotteen elinkaaren hallinta (PLM)
    • Ostot
    • Huolto
    • Laatu
    Henkilöstöhallinto
    • Työntekijät
    • Rekrytointi
    • Vapaat
    • Arvioinnit
    • Suositukset
    • Kuljetuskalusto
    Markkinointi
    • Somemarkkinointi
    • Sähköpostimarkkinointi
    • Tekstiviestimarkkinointi
    • Tapahtumat
    • Markkinoinnin automaatio
    • Kyselyt
    Palvelut
    • Projekti
    • Työaikakirjaukset
    • Kenttähuolto
    • Asiakaspalvelu
    • Suunnittelu
    • Ajanvaraukset
    Tuottavuus
    • Viestintä
    • Hyväksynnät
    • IoT
    • IP-puhe
    • Tietokirjasto
    • WhatsApp
    Kolmannen osapuolen sovellukset Odoo-Studio Odoo-Pilvialusta
  • Toimialat
    Vähittäiskauppa
    • Kirjakauppa
    • Vaatekauppa
    • Huonekaluliike
    • Ruokakauppa
    • Laitteistokauppa
    • Lelukauppa
    Ruoka & Majoitus
    • Baari ja Pubi
    • Ravintola
    • Pikaruoka
    • Majatalo
    • Juomien jakelija
    • Hotelli
    Kiinteistöt
    • Kiinteistönvälitystoimisto
    • Arkkitehtitoimisto
    • Rakentaminen
    • Kiinteistönhallinta
    • Puutarhanhoito
    • Kiinteistön omistajien yhdistys
    Konsultointi
    • Tilitoimisto
    • Odoo-kumppani
    • Markkinointitoimisto
    • Lakitoimisto
    • Osaajahankinta
    • Tilintarkastus & sertifiointi
    Tuotanto
    • Tekstiili
    • Metalli
    • Huonekalut
    • Ruoka
    • Panimo
    • Yrityslahjat
    Terveys & Liikunta
    • Urheiluseura
    • Silmälasiliike
    • Kuntokeskus
    • Hyvinvointialan ammattilaiset
    • Apteekki
    • Kampaamo
    Kaupat
    • Handyman
    • IT-laitteisto & Tuki
    • Aurinkoenergiajärjestelmät
    • Suutari
    • Siivoustarvikkeet
    • LVI-palvelut
    Muut
    • Voittoa tavoittelematon järjestö
    • Ympäristötoimisto
    • Mainostaulujen vuokraus  
    • Valokuvaus
    • Leasing-pyörät
    • Ohjelmistojen jälleenmyyjä
    Selaa kaikkia toimialoja
  • Yhteisö
    Opi
    • Tutoriaalit
    • Dokumentaatio
    • Todistukset
    • Koulutus
    • Blogi
    • Podcast
    Kannusta kouluttautumaan
    • Koulutusohjelmat
    • Scale Up! Liiketoimintapeli
    • Vieraile Odoolla
    Hanki ohjelmisto
    • Lataa
    • Vertaile versioita
    • Julkaisut
    Tee yhteistyötä
    • Github
    • Foorumi
    • Tapahtumat
    • Käännökset
    • Ryhdy kumppaniksi
    • Kumppanipalvelut
    • Rekisteröi tilitoimistosi
    Hanki palveluja
    • Löydä kumppani
    • Löydä kirjanpitäjä
    • Varaa asiantuntijatapaaminen
    • Implementaatiopalvelut
    • Asiakasreferenssit
    • Tuki
    • Versionkorotukset
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Varaa demo
  • Hinnoittelu
  • Asiakaspalvelu

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

  • CRM
  • e-Commerce
  • Kirjanpito
  • Varastointi
  • PoS
  • Projekti
  • MRP
All apps
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Apua

Change the Position of field in Xpath

Tilaa

Saat ilmoituksen, kun tähän viestiin ilmaantuu aktiviteettia

Tämä kysymys on merkitty
viewsinheritance
5 Vastaukset
95589 Näkymät
Avatar
Rajiv

Hi

I want to change the position of Field in the Form View (Parent) to the new Position (In my In herited view). Is there any way.

Example:

Parent View:

<record id="1" model="1">

<field name="arch" type="xml">

<group>

<field name="X"/>

</group>

.....

.....

<group>

<field name="Y"/>

</group>

</field>

</record>

So I want to move the field Y to inside the group X. Not only field. Also I need to move the any other tags like <div> or <group> itself as bunch.

Is there any Xpath which is like below.

<xpath expr="//form/sheet/group/group/field[@name='email']" position="move">

Please help...

 

 

2
Avatar
Hylkää
Avatar
Ajay Kumar
Paras vastaus

Hello,

we can one more thing instead of "replace". Because in case of replace first we have to  remove the field and then add it to new position which will take one more step extra. So better we can use position="move"

<xpath expr="//field[@name='phone']" position="after">
<xpath expr="//field[@name='tag_ids']" position="move"/>
</xpath>
it will simply move the position of tag_ids field to after phone field. Which will save our extra line of code that we are writing in case of replace.
5
Avatar
Hylkää
Vyshnav A

Its worked.

Nomadoo

Hi,
I have tried your code but what I need is to move the industry_id after phone field, However after I update the module, the field is gone. It is not visible at all. I have tested with another field 'barcode' and same result. Is this xpath expression support v16 ?

thanks

Nomadoo

then I have done a test like this

<xpath expr="//field[@name='category_id']" position="after">
<xpath expr="//field[@name='mobile']" position="move"/>
</xpath>
this gives me two mobile fields, one in old position and other in new position

Dimas Aditya Kristianto

Hi @Nomadoo,
I don't know what's wrong with your code. make sure you inherit the correct id.
I test @Ajay Kumar answer in odoo 16 and it's working

<record id="change_field_product_template_tree_view" model="ir.ui.view">
<field name="name">product.template.common.tree.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<xpath expr="//field[@name='list_price']" position="move"/>
</xpath>
</field>

Avatar
Mansi Kariya (mka)
Paras vastaus

Hello,

There is no such value allowed like move in xpath. Values allowed are

  • inside (default): your values will be appended inside the tag

  • after: add the content after the tag

  • before: add the content before the tag

  • replace: replace the content of the tag.

You have to simply replace that field. and put it to new position. For more details, You can refer Doc or can ask me too.

<xpath expr="//group/field[@name='X']" position="replace"/>

This will remove field from that position. Now you can put it to other place you want. Suppose you want to place it after field "Y". Example -

<xpath expr="//group/field[@name='Y']" position="after">
<field name="X"/>
</xpath>

This way, You can change postion of any field, group etc.

Hope this will help you.

8
Avatar
Hylkää
Mohit Kotak (MK)

Hello @Mansi, I want to add new boolean filed after supplier boolean field in res.partner form inside sale & purchase tab. Can you help me.! Thanks in advance.

Mansi Kariya (mka)

Inherit view_partner_form and then givve xpath like //page[@string='Sales & Purchases']/group/group/field[@name='supplier'] and give position to after

Avatar
Baiju KS
Paras vastaus

Hi Rajiv,,

Here you can use position=replace

you can select the code or block you want to replace

0
Avatar
Hylkää
Avatar
legland
Paras vastaus

I have the same issue, the view field is not visible.

'data': [

        'views/stock_production_lot_views.xml',

        # 'security/ir.model.access.csv',


    ],

https://www.odoo.com/fr_FR/forum/aide-1/question/odoo-v12-xpath-not-visible-145057


0
Avatar
Hylkää
Avatar
William Brugger
Paras vastaus

Move has been added to xpath:

https://github.com/odoo/odoo/pull/23877

0
Avatar
Hylkää
Nautitko keskustelusta? Älä vain lue, vaan osallistu!

Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!

Rekisteröidy
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
View inheritance hiding a field
views inheritance
Avatar
Avatar
1
marrask. 24
2496
How to extend a base template for a specific page only, without affecting other pages that use the same base template?
views inheritance
Avatar
Avatar
1
jouluk. 23
3924
removing elements from an inherited view
views inheritance
Avatar
Avatar
1
toukok. 22
4945
I am building a custom module that has a dependent module that has extended the base view of res_partner. In my custom module I also have an inherited view of the base res_partner view. In it how do I hide the inherited view of my dependent module?
views inheritance
Avatar
0
tammik. 20
3473
Modifying an inherited view : replace does not work Odoo 11
views inheritance
Avatar
Avatar
1
elok. 19
3719
Yhteisö
  • Tutoriaalit
  • Dokumentaatio
  • Foorumi
Avoin lähdekoodi
  • Lataa
  • Github
  • Runbot
  • Käännökset
Palvelut
  • Odoo.sh hosting
  • Tuki
  • Versionkorotus
  • Räätälöidyt kehitykset
  • Koulutus
  • Löydä kirjanpitäjä
  • Löydä kumppani
  • Ryhdy kumppaniksi
Meistä
  • Yrityksemme
  • Tavaramerkki
  • Ota yhteyttä
  • Työpaikat
  • Tapahtumat
  • Podcast
  • Blogi
  • Asiakkaat
  • Oikeudellinen ilmoitus • Yksityisyys
  • Tietoturva
الْعَرَبيّة 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 on kokoelma avoimen lähdekoodin yrityssovelluksia, jotka kattavat kaikki yrityksesi tarpeet: asiakkuudenhallinta eli CRM, verkkokauppa, kirjanpito, varastointi, kassajärjestelmä, projektinhallinta, jne.

Odoon uniikki arvolupaus on olla samanaikaisesti erittäin helppokäyttöinen ja täysin integroitu.

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