Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

[Odoo 8 CE] How can I have a custom PO view without modifying the original view as well ?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
viewspurchase_order
4 Respostes
3616 Vistes
Avatar
Paraita Wohler

I've added a second Purchase Orders view in my left-side menu. The first Purchase Orders view is the default one bundled in Odoo 8. The second Purchase Orders view should have different columns. This is the xml of the second view:

<record id="view_purchase_order_with_core_product" model="ir.ui.view">
<field
name="name">my.custom.PO.view</field>
<field
name="model">purchase.order</field>
<field
name="type">tree</field>
<field
name="priority">1</field>
<field
name="arch" type="xml">
<tree>
<field
name="product_id"/>
<field
name="message_unread"/>
</tree>
</field>
</record>

<record
id="act_purchase_order_with_core_product" model="ir.actions.act_window">
<field
name="name">Second PO view</field>
<field
name="type">ir.actions.act_window</field>
<field
name="res_model">purchase.order</field>
<field
name="view_mode">tree,form</field>
<field
name="context">{}</field>
<field
name="domain">[('has_core_articles', '=', True)]</field>
<field
name="view_id" ref="view_purchase_order_with_core_product"/>
</record>


<menuitem id="menu_purchase_order_with_core_product" name="Second PO view"
parent="purchase.menu_procurement_management"
action="act_purchase_order_with_core_product" sequence="14"/>

The purpose of that second view is to display only orders which contains certain articles, display differents columns than the original view.

I've managed to do the filter using the domain field (I didn't want to use the search filter for that).

My problem is that when I modify the columns of my second views, the original view (the first view) is also modified and display the extra columns.

What am I doing wrong ?


EDIT: I've removed the priority field but I still have the same error after upgrading my module

0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

Can you remove the below line from the code and check the same:-     <field name="priority">1</field>

<record id="view_purchase_order_with_core_product" model="ir.ui.view">
<field name="name">my.custom.PO.view</field>
<field name="model">purchase.order</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree>
<field name="product_id"/>
<field name="message_unread"/>
</tree>
</field>
</record>

Thanks

1
Avatar
Descartar
Avatar
Paraita Wohler
Autor Best Answer

Thanks guys for the answers, I've removed the priority field, modified the name of the view and updated the module in my Odoo instance. However I still see the product_id and the message_unread columns in both PO views instead of just the second one. The name of the second view has been impacted as expected though.

What's strange to me is that I didn't inherit the original PO view so I don't understand how my changes on my second view is even impacting the original PO view. Is the view deduced from the model itself ?

I did try to inherit from the original PO view also, but I end up with the same results: changes in my second view are impacted in the original PO view as well...


EDIT: restarting my Odoo instance + updating the installed module didn't seem to change anything but I've retried with a brand new DB and it works as expected !

To prevent myself from running from this kind of error in the future, is there a foolproof method to update an installed module without having to restart everything from a clean DB ?

0
Avatar
Descartar
Avatar
subbarao
Best Answer

Hello Paraita,

You have done well but the mistake is priority, so remove priority and then upgrade it will work.

<field name="priority">1</field>
0
Avatar
Descartar
Cybrosys Techno Solutions Pvt.Ltd

We have mentioned the same in the above answer.

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
importing Purchase Order shown as a RFQ Solved
purchase_order
Avatar
Avatar
Avatar
2
de maig 25
3045
Create a PO without adding products to stock
purchase_order
Avatar
Avatar
Avatar
Avatar
3
de des. 24
9031
Select multiple elements with XPath Solved
views
Avatar
Avatar
Avatar
Avatar
Avatar
5
d’ag. 24
48611
How do I replace the default Purchase Order number? Solved
purchase_order
Avatar
Avatar
1
de jul. 24
4592
Purchase Product Description Incorrect Solved
purchase_order
Avatar
Avatar
1
de juny 24
2829
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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