Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Can't inherit base.view_partner_form of res.partner

Subscriure's

Get notified when there's activity on this post

This question has been flagged
inheritance
4 Respostes
4187 Vistes
Avatar
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
Avatar
Descartar
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.

Avatar
Nikul Vasar
Best Answer

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
Avatar
Descartar
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?

Avatar
Andry Ang
Best Answer

Hi Oliver,

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

0
Avatar
Descartar
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.

Avatar
Mathesh
Best Answer

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
Avatar
Descartar
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.

Avatar
Econ Odoo
Best Answer

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
Avatar
Descartar
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!

Registrar-se
Related Posts Respostes Vistes Activitat
Include in inherit from JS class
inheritance
Avatar
Avatar
1
d’ag. 24
2983
How to Override a method in parent class in JS Solved
inheritance
Avatar
Avatar
2
de nov. 24
4418
How to add a simple field to partner?
inheritance
Avatar
Avatar
Avatar
Avatar
3
d’oct. 23
15769
Do I have to create a new module to change the standard form view?
inheritance
Avatar
Avatar
2
de febr. 23
3191
inherit problem: "cannot be located in parent view " for a <p /> inherited for sale_report_templates.line line 169
inheritance
Avatar
Avatar
1
de des. 22
1371
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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