Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Umělá inteligence
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Field show_forecasted_qty_status_button does not exist in model product.template

Odebírat

Get notified when there's activity on this post

This question has been flagged
moduleinheritanceproduct.template18.0
2 Odpovědi
772 Zobrazení
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
Zrušit
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
Nejlepší odpověď

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
Zrušit
Avatar
Zehntech Technologies Inc.
Nejlepší odpověď

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
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How to change the standard "New Quotation" form? Vyřešeno
module form inheritance
Avatar
Avatar
1
úno 23
3603
OpenERP engine modification. How?
module inheritance engine
Avatar
0
bře 15
5257
How to remove certain columns from an inherited model? Vyřešeno
module inheritance model project.task
Avatar
Avatar
Avatar
Avatar
3
lis 22
15056
search field value from one module to another
module fields inheritance menu
Avatar
Avatar
1
zář 22
3425
How to move a "manual" model to a custom module? Vyřešeno
module custom studio odoo 18.0
Avatar
Avatar
1
bře 26
1332
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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