Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Can't inherit base.view_partner_form of res.partner

Subscribe

Get notified when there's activity on this post

This question has been flagged
inheritance
4 Replies
4238 Views
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
Discard
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
Author

> 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
Author

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
Discard
Oliver
Author

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
Discard
Oliver
Author

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
Author

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
Discard
Oliver
Author

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
Discard
Oliver
Author

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!

Sign up
Related Posts Replies Views Activity
Include in inherit from JS class
inheritance
Avatar
Avatar
1
Aug 24
2991
How to Override a method in parent class in JS Solved
inheritance
Avatar
Avatar
2
Nov 24
4447
How to add a simple field to partner?
inheritance
Avatar
Avatar
Avatar
Avatar
3
Oct 23
15789
Do I have to create a new module to change the standard form view?
inheritance
Avatar
Avatar
2
Feb 23
3206
inherit problem: "cannot be located in parent view " for a <p /> inherited for sale_report_templates.line line 169
inheritance
Avatar
Avatar
1
Dec 22
1371
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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