Taucher
Taucher

Reputation: 3

Can't inherit base.view_partner_form of res.partner in odoo

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.px

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=''
        )

Upvotes: -1

Views: 20

Answers (0)

Related Questions