Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
viewspurchase_order
4 Replies
3610 Views
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
Discard
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
Discard
Avatar
Paraita Wohler
Author 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
Discard
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
Discard
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!

Sign up
Related Posts Replies Views Activity
importing Purchase Order shown as a RFQ Solved
purchase_order
Avatar
Avatar
Avatar
2
May 25
3044
Create a PO without adding products to stock
purchase_order
Avatar
Avatar
Avatar
Avatar
3
Dec 24
9030
Select multiple elements with XPath Solved
views
Avatar
Avatar
Avatar
Avatar
Avatar
5
Aug 24
48610
How do I replace the default Purchase Order number? Solved
purchase_order
Avatar
Avatar
1
Jul 24
4589
Purchase Product Description Incorrect Solved
purchase_order
Avatar
Avatar
1
Jun 24
2827
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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