Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

how to replace one field with two field using xpath odoo10

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
odoo10
6 Răspunsuri
11845 Vizualizări
Imagine profil
Zue

I has a moudle that inherit stock.packing and also has a custom field name cw_inventory_ref.

if I write my code like this,

<xpath expr="//field[@name='partner_id']" position="after">
                      <field name="cw_inventory_ref"/>

</xpath>  

the cw_inventory_ref is appeared after parent_id.

I don't want like this.

I want cw_inventory_ref to appeared in front of parent_id.

for example, [data of cw_inventory_ref]data of parent_id.

So, I write my code as following but it doesn't work,

in xml file:

        <record id="cw_stock_picking_tree_view" model="ir.ui.view">
                <field name="name">cw_stock_picking_tree_view</field>
                <field name="model">stock.picking</field>
                <field name="inherit_id" ref="stock.vpicktree"></field>
                <field name="arch" type="xml">                 
                    <xpath expr="//field[@name='partner_id']" position="replace">
                      [<field name="cw_inventory_ref"/>]<field name="partner_id"/>
                    </xpath>                                     
                </field>
        </record>

In .py file:

# -*- coding: utf-8 -*-

from odoo import models, fields, api

class cw_update(models.Model):
    _inherit = 'stock.picking'
    cw_inventory_ref = fields.Char(string=' Internal Reference ',related = "partner_id.ref",readonly=True)  
How can I fix this?Thank you.
 

0
Imagine profil
Abandonează
Sudhir Arya (ERP Harbor Consulting Services)

Why don't you use position="before" ??

Zue
Autor

If I used before and after, I will show one line per data.

I want to shown like this [partner_ref]partner in position of partner_id.

Imagine profil
Priya K
Cel mai bun răspuns

Try this


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

    <div>

        [<field name="cw_inventory_ref" style="width: 50%%"/>]

        <field name="partner_id" style="width: 60%%"/> 

    </div>

</xpath>


or else 

Try this


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

    <group>

<group>

        [<field name="cw_inventory_ref"/>]

</group>

<group>        

<field name="partner_id"/> 

<group>    

</group>

</xpath>



0
Imagine profil
Abandonează
Zue
Autor

Thank you for your reply but not ok.I got Invaild view definition error.

Imagine profil
Hilar Andikkadavath
Cel mai bun răspuns

try this

        <record id="cw_stock_picking_tree_view" model="ir.ui.view">
                <field name="name">cw_stock_picking_tree_view</field>
                <field name="model">stock.picking</field>
                <field name="inherit_id" ref="stock.vpicktree"></field>
                <field name="arch" type="xml">
                       <xpath expr="//field[@name='partner_id']" position="replace">
                          [<field name="cw_inventory_ref" class="oe_inline"/>]
                            <field name="partner_id" class="oe_inline"/>
                       </xpath>
                 </field>
        </record>


I didn't tested, have a try

0
Imagine profil
Abandonează
Zue
Autor

Thank you for your replay.But not okey.

I got TypeError: field.attrs is undefined error.

Hilar Andikkadavath

Then there will be problem with your previous views that is inherited here

Imagine profil
Kevin
Cel mai bun răspuns

Try this

<xpath expr="//field[@name='partner_id']" position="before">
                      <field name="cw_inventory_ref"/>
  </xpath>    


0
Imagine profil
Abandonează
Zue
Autor

I want to show cw_inventory_ref data and partner_id together in the position of partner_id with square bracket.If I used before, It will show one data per line.I want my data like this [partner_ref]partner44 where

partner_ref is data of cw_inventory_ref

and

partner44 is data of partner_id.

Thank You.

Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Create schedule action For sending emails
odoo10
Imagine profil
Imagine profil
Imagine profil
2
iul. 25
6750
How to send messages that are not shown in chatter? Rezolvat
odoo10
Imagine profil
Imagine profil
Imagine profil
2
oct. 25
8930
How to ORDER BY? [Odoo 10] Rezolvat
odoo10
Imagine profil
Imagine profil
2
nov. 24
29877
Dynamic domain functionality - possible to change domain of a field in another model with onchange? (Odoo 10) Rezolvat
odoo10
Imagine profil
Imagine profil
Imagine profil
2
mai 24
8490
Change state of other module
odoo10
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
mar. 24
7928
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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