Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Can't inherit base.view_partner_form of res.partner

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
inheritance
4 Răspunsuri
4290 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
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.

Imagine profil
Nikul Vasar
Cel mai bun răspuns

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
Imagine profil
Abandonează
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?

Imagine profil
Andry Ang
Cel mai bun răspuns

Hi Oliver,

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

0
Imagine profil
Abandonează
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.

Imagine profil
Mathesh
Cel mai bun răspuns

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
Imagine profil
Abandonează
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.

Imagine profil
Econ Odoo
Cel mai bun răspuns

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
Imagine profil
Abandonează
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.

Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Include in inherit from JS class
inheritance
Imagine profil
Imagine profil
1
aug. 24
3012
How to Override a method in parent class in JS Rezolvat
inheritance
Imagine profil
Imagine profil
2
nov. 24
4483
How to add a simple field to partner?
inheritance
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
oct. 23
15817
Do I have to create a new module to change the standard form view?
inheritance
Imagine profil
Imagine profil
2
feb. 23
3228
inherit problem: "cannot be located in parent view " for a <p /> inherited for sale_report_templates.line line 169
inheritance
Imagine profil
Imagine profil
1
dec. 22
1371
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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