Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Field show_forecasted_qty_status_button does not exist in model product.template

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
moduleinheritanceproduct.template18.0
2 Réponses
752 Vues
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
Ignorer
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
Meilleure réponse

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
Ignorer
Avatar
Zehntech Technologies Inc.
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
How to change the standard "New Quotation" form? Résolu
module form inheritance
Avatar
Avatar
1
févr. 23
3598
OpenERP engine modification. How?
module inheritance engine
Avatar
0
mars 15
5254
How to remove certain columns from an inherited model? Résolu
module inheritance model project.task
Avatar
Avatar
Avatar
Avatar
3
nov. 22
15044
search field value from one module to another
module fields inheritance menu
Avatar
Avatar
1
sept. 22
3414
How to move a "manual" model to a custom module? Résolu
module custom studio odoo 18.0
Avatar
Avatar
1
mars 26
1321
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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