Skip to Content
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
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • 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

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
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

Can't inherit base.view_partner_form of res.partner

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
inheritance
4 Odpowiedzi
4028 Widoki
Awatar
Oliver

Hello all,


i have an own module but i have a Problem with inherit the view base.view_partner_form from res.partner and adding a new field in an environment where a another company used odoo and manipulate res.partner too.

I have installed odoo17 on my local machine and the inheritance worked fine without problems.

But if i try to use the same module to the environment where share to work with another company they manipulate/use the res.partner too, it doesn't works.

By installing the module there are no error in the log file, but if i wanna open a contact it shows me the error message: Error: child.attrs is undefined.

Then i go back to the apps to update my module, i get the error message: The Field `sale_warn_msg` doesn't exist. The view was shown in the error message is my view.

The environment where the other company works too is odoo13.


I do not understand why it doesn't works. Is it possible that the other company manipulate a file (maybe renamed class or module name or other things) to get this exception?

I don't know where i should to look for and what i should to look for to solve this problem.


In the following my Python and Xml files.

__manifest__.py

{

    'name': 'Heinzmann',

    'category': 'Uncategorized',

    'version': '0.1',

    'license': 'Other proprietary',

    'depends': ['base'],

    'data': [

        'views/res_partner.xml',

    ],

}

res_partner.xml

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <record id="heinzmann_res_partner_view_form" model="ir.ui.view">

        <field name="name">res.partner.form</field>

        <field name="model">res.partner</field>

        <field name="type">form</field>

        <field name="inherit_id" ref="base.view_partner_form"/>

        <field name="arch" type="xml">

            <xpath expr="//field[@name='category_id']" position="after">

                Anzahl neuer Kundenkarten:<field name="x_customer_card_selection"/>

            </xpath>

        </field>

    </record>

</odoo>

res_partner.py

class ResPartner(models.Model):

    _inherit = 'res.partner'


    #x_auto_invoice_at_end_of_month = fields.Boolean()


    x_customer_card_selection = fields.Selection(

        [('1', 1),('2', 2),('3',3)]

        ,'Anzahl neuer Kundenkarten',default=''

        )



0
Awatar
Odrzuć
Sunny Sheth

Hi Oliver,

Have you tried to give an priority to your custom/inherited XML view?
you can try below one if not used.

<field name="priority" eval="999"/>

Thanks & Regards,
Sunny Sheth

Oliver
Autor

> Sunny Sheth
Yes i have set the priority to 1. And i added _name = 'res.partner' in the python file. Nothing works.

Sunny Sheth

Hi Oliver,

set priority higher not "1" to that view as i mentioned if not.

and add _inherit = 'res.partner'

Thanks

Oliver
Autor

Setting the priority to 999 doesn't work too. And _inherit = 'res.partner' already exists.

Awatar
Nikul Vasar
Najlepsza odpowiedź

Whenever you are adding new field in object like res.partner and res.company you need to install that module or increase manifest version simple upgrade module wan't work. 

0
Awatar
Odrzuć
Oliver
Autor

I don't think so because in the clear installation of odoo 17 it works fine without reinstall the module res.partner. Or behaves odoo 13 different?

Awatar
Andry Ang
Najlepsza odpowiedź

Hi Oliver,

Do you mind to test to upgrade "base" and "sale" module?

0
Awatar
Odrzuć
Oliver
Autor

Hello Andry,
updating base and sale module doesn't help.

Andry Ang

Thanks for confirming.
I believe the field is there (you can double check the database), so it left with views sequence, seems like you need to trace whether there is any Studio customized.
You can start to trace the "inherit views", try to delete some default views and upgrade the modules related again to create the deleted default views and align the sequences.

I wish I can help further.

Oliver
Autor

Thank you for your answer. I try to analyse the views.

Awatar
Mathesh
Najlepsza odpowiedź

Hello Oliver,

To add a new field to the res.partner model, which is part of the base module, you can't do it directly. First, you need to create a custom module, then add the field to that module. After creating and adding the field, you can install the module, and it should work properly. Your code looks valid; just try creating a new module and include your code there.

Thanks.

0
Awatar
Odrzuć
Oliver
Autor

Hello Mathesh,
i have done it like your description. In the clear installation of odoo 17 it works fine but not in the other environment.

Awatar
Econ Odoo
Najlepsza odpowiedź

sale_warn_msg is actually implemented in sale module (as the name suggests and I did check the code). Though it is displayed in the base.view_partner_form, the base module has no idea about it.

So you need to add sale to your dependency I guess

0
Awatar
Odrzuć
Oliver
Autor

Hello Exon Odoo,
i don't think so because in the clear installation of odoo 17 it works fine but not in the other environment. But i have try your suggestion but it doesn't works.

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ść
Include in inherit from JS class
inheritance
Awatar
Awatar
1
sie 24
2906
How to Override a method in parent class in JS Rozwiązane
inheritance
Awatar
Awatar
2
lis 24
4331
How to add a simple field to partner?
inheritance
Awatar
Awatar
Awatar
Awatar
3
paź 23
15681
Do I have to create a new module to change the standard form view?
inheritance
Awatar
Awatar
2
lut 23
3137
inherit problem: "cannot be located in parent view " for a <p /> inherited for sale_report_templates.line line 169
inheritance
Awatar
Awatar
1
gru 22
1371
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 ภาษาไทย 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