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
    • Artificial Intelligence
    • 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
    • Property 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
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

Field show_forecasted_qty_status_button does not exist in model product.template

Subscribe

Get notified when there's activity on this post

This question has been flagged
moduleinheritanceproduct.template18.0
2 Replies
690 Views
Avatar
SSSE/SIG, Luca Palo

When I try to install the module where the following inherited view is defined i get the error 

❌
Field "show_forecasted_qty_status_button" does not exist in model "product.template"

I checked 

  •     https://www.odoo.com/es_ES/forum/ayuda-1/error-partner-bank-id-cannot-be-located-in-parent-view-odoo19-292645
  • https://www.odoo.com/es_ES/forum/ayuda-1/error-msg-element-xpath-expr-cannot-be-located-in-parent-view-213940

And I verified that reference to the XML ID in my view is correct. The field show_forecasted_qty_status_button is listed from the debugger in the Product Template view.

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="product_template_procurement_form_hide_forecast" model="ir.ui.view">
        <field name="name">product.template.procurement.form.hide.forecast</field>
        <field name="model">product.template</field>
        <field name="inherit_id" ref="stock.product_template_form_view_procurement_button" />  
        <field name="priority">14</field>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='show_forecasted_qty_status_button']" position="attributes">
                <attribute name="value">0</attribute>
            </xpath>
        </field>
    </record>
</odoo> 


The other thing I tried without success was to inherit the model in order to overwrite the method of the computed field. But the log entry was not listed in the log.

class ProductTemplate( models.Model ):

    _logger = logging.getLogger(__name__)

    _inherit = ['product.template']

    """
        Removes the forecasted quantity button in product template view

        @see commit abf1ee63f41094a313ead96caccc284c0b233244
    """
    @api.depends('is_storable')
    def _compute_show_qty_status_button(self):
        self._logger.info('###################################### _compute_show_qty_status_button ########################################')
        for template in self:
            template.show_on_hand_qty_status_button = template.is_storable
            template.show_forecasted_qty_status_button = False
0
Avatar
Discard
Codesphere Tech

Hello
I've test the same scenario in my local V18 env and not getting any error while installing or upgrading the module.

Avatar
Vivek Kundaliya
Best Answer

The issue is that in Odoo 18, the field show_forecasted_qty_status_button may not be defined directly in the stock.product_template_form_view_procurement_button view - it may be added by a different inherited view layer. Here is how to debug and fix this:

Step 1: Find which view actually contains this field
With Developer Mode enabled:
1. Open a product form
2. Click the debug menu (bug icon) > Edit View
3. Look through the combined view to find which ir.ui.view ID actually renders the show_forecasted_qty_status_button field
4. Inherit THAT view instead of stock.product_template_form_view_procurement_button

Step 2: Check the field definition
In Odoo 18, check addons/stock/models/product.py for the exact field definition. The field may be defined as a computed field only available when certain conditions are met (e.g., the product must be storable). Your XPath may fail if the field is not present in the view arch at install time.

Step 3: Fix your XPath - target a different expression
Instead of targeting the field itself, try targeting the button widget directly. In the final view, look for the button that shows the forecasted qty and target its name attribute.

Step 4: Priority matters
Your view has priority 14. If the view that adds show_forecasted_qty_status_button also has a low priority, it may not have been applied yet when your view tries to reference it. Try increasing your priority to a higher number (e.g., 50) so it applies after the base views.

Most likely fix:
The field is probably added by a different stock view, not stock.product_template_form_view_procurement_button. Use the Odoo debug view inspector to find the correct inherit_id, then change your inherit_id to that view.

0
Avatar
Discard
Avatar
Zehntech Technologies Inc.
Best Answer

Hello,

It looks like the issue is not with the XML ID itself, but with the fact that the field show_forecasted_qty_status_button is probably not present in the inherited view architecture (stock.product_template_form_view_procurement_button) at the moment your XPath is applied.

In Odoo 18, some of these quantity status fields/buttons are added through layered inherited views and may not be directly available in that specific parent view.

Also, in your Python override, the compute method name should exactly match the original method definition from the source model, otherwise Odoo will not execute your custom logic.

You may want to:

  • verify the final inherited view structure using Developer Mode,
  • inherit the correct intermediate view,
  • or target the button element directly instead of the field.

Hope this works for you! If you need any help implementing this or want a more optimized approach, feel free to reach out for further discussion.

Regards,

Zehntech Technologies Inc.

santosh.sekwadia@zehntech.com

0
Avatar
Discard
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
How to change the standard "New Quotation" form? Solved
module form inheritance
Avatar
Avatar
1
Feb 23
3591
OpenERP engine modification. How?
module inheritance engine
Avatar
0
Mar 15
5214
How to remove certain columns from an inherited model? Solved
module inheritance model project.task
Avatar
Avatar
Avatar
Avatar
3
Nov 22
15012
search field value from one module to another
module fields inheritance menu
Avatar
Avatar
1
Sep 22
3392
How to move a "manual" model to a custom module? Solved
module custom studio odoo 18.0
Avatar
Avatar
1
Mar 26
1314
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 Svenska ภาษาไทย 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