跳至内容
菜单
此问题已终结

Hello Everyone!

I have migrated Odoo 18 to another server running same Odoo 18, soon I started encontering an Error: "res.partner"."vat_label" field is undefined. I have even tried adding the field to the res.partner model but nothing seems to work.  Please have anyone encounter such an error?
Full error code below:

UncaughtPromiseError > OwlError

Uncaught Promise > An error occured in the owl lifecycle (see this Error's "cause" property)

Occured on mydomain.com on 2025-05-26 03:22:40 GMT

OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)

Error: An error occured in the owl lifecycle (see this Error's "cause" property)

at handleError (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:947:101)

at App.handleError (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:1579:29)

at ComponentNode.initiateRender (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:1037:19)

Caused by: Error: "res.partner"."vat_label" field is undefined.

at Field.parseFieldNode (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:7592:330)

at https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:8506:927

at visit (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:4652:51)

at visitChildren (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:4651:171)

at visit (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:4652:129)

at visitChildren (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:4651:171)

at visit (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:4652:129)

at visitChildren (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:4651:171)

at visit (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:4652:129)

at visitXML (https://mydomain.com/web/assets/cc8f8e6/web.assets_web.min.js:4652:202)

形象
丢弃
最佳答案

Go to Debug Mode
In Odoo, activate Developer (Debug) Mode.

Go to:
SettingsTechnicalViews

Search:
In the search bar, type:

vat_label

Open each view found and remove this line if present:
<field name="vat_label"/>

Save the view. Repeat for all views that use vat_label.

A view is trying to show a field vat_label that no longer exists. Removing it from the view stops the error.

形象
丢弃
最佳答案

Hi,



The error comes because the field doesn't load into the model 'res.partner'

* Check whether the model is inherited correctly

* Check the init file.

* Check the view that is inherited.


You can try something like this.


Python 


from odoo import models, fields

class ResPartner(models.Model):

    _inherit = 'res.partner'


    vat_label = fields.Char(string="Vat Label")



Init 


from . import res_partner



XML



<record id="res_partner_view_form" model="ir.ui.view">

    <field name="name">res.partner.view.form.inherit</field>

    <field name="model">res.partner</field>

    <field name="inherit_id" ref="base.view_partner_form"/>

    <field name="arch" type="xml">

         <xpath expr="//field[@name='vat']" position="after">

            <field name="vat_label"/>

        </xpath>

    </field>

</record



Manifest


'data': [

    'views/res_partner_views.xml',

],



Hope it helps

形象
丢弃
最佳答案

Have you tried to update base to resolve the issue

形象
丢弃
编写者

If you click to update the base module, it will still popup the same error message, therefore you cannot update

相关帖文 回复 查看 活动
2
2月 20
4195
1
9月 18
7646
0
3月 15
4778
2
3月 15
6802
1
5月 25
2214