Hello guys,
I am new user odoo.I don't know how to fix "Field does not exit " error.here is my code.
In model.py
from odoo import models, fields, api
class CrmnNewTask(models.Model):
_inherit = 'res.partner'
legalname=fields.Char('Legal Company Name')
In view.xml
<?xml version="1.0"?>
<odoo>
<record id="view_partner_form2" model="ir.ui.view">
<field name="name">res.partner.form2</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"></field>
<field name="arch" type="xml">
<xpath expr="//field[@name='category_id'][not(ancestor::field)]" position="after">
<field name="legalname"></field>
</xpath>
</field>
</record>
</odoo>
and I also import in __init.py__
Normaly such an error occur when a field is not defined in the model. Here in your case every thing seems fine, anyway just cross check it once more
Thank you.Yesterday nigh,I shut down the pc.Today morning,when i run pc, there is no error.
Obviously Odoo stops when you shut down your PC and it starts again, when you start your PC.