Maybe, somebody could help... I am trying to get run a custom module with a new model inheriting from res_partner (example for keeping it short with only 1 additional field):
So far so good. But if I do like that to get a new page in contact form:# -*- coding: utf-8 -*-
from odoo import models, fields
class FQ_Partner(models.Model):
_name = 'fq.partner'
_inherits = {'res.partner': 'partner_id'}
partner_id = fields.Many2one('res.partner', required=True, ondelete='cascade')
fq_id = fields.Char('FQ Nr.', size=30)
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="personal_information" model="ir.ui.view">
<field name="name">Personal information page for contacts form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">2</field>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@name='internal_notes']" position="after">
<page name="personal_information_page"
string="Personal Information"
attrs="{'invisible': [('is_company','=',True)]}">
<group name="personal_information_group"/>
</page>
</xpath>
</data>
</field>
</record>
</odoo>
The new page is displayed, but if I insert my new field from my new model above, I can not access it (an error message appears that the field does not exist). If I change the model from res.partner to fq.partner (my new model), I do not get the error message any more when installing / upgrading my module, but the page does not get displayed any more. What am I doing wrong? How can I add my new data to this page keeping it displayed?