Przejdź do zawartości
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Sztuczna inteligencja
    • IoT
    • VoIP
    • Wiedza
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Field show_forecasted_qty_status_button does not exist in model product.template

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
moduleinheritanceproduct.template18.0
2 Odpowiedzi
771 Widoki
Awatar
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
Awatar
Odrzuć
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.

Awatar
Vivek Kundaliya
Najlepsza odpowiedź

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
Awatar
Odrzuć
Awatar
Zehntech Technologies Inc.
Najlepsza odpowiedź

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
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
How to change the standard "New Quotation" form? Rozwiązane
module form inheritance
Awatar
Awatar
1
lut 23
3603
OpenERP engine modification. How?
module inheritance engine
Awatar
0
mar 15
5257
How to remove certain columns from an inherited model? Rozwiązane
module inheritance model project.task
Awatar
Awatar
Awatar
Awatar
3
lis 22
15056
search field value from one module to another
module fields inheritance menu
Awatar
Awatar
1
wrz 22
3425
How to move a "manual" model to a custom module? Rozwiązane
module custom studio odoo 18.0
Awatar
Awatar
1
mar 26
1332
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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