Search code examples
pythonpython-3.xodooodoo-10odoo-view

I got this "LINE 1: ...partner"."picking_warn_msg" as "picking_warn_msg","res_partn..." error while inherit res.partner


my .py file is

class Suppiler(models.Model):

     _inherit = "res.partner"

     author= fields.Boolean(string='Author')

and xml file is

 <data>
    <record id="add_supplier_view_inherit" model="ir.ui.view">
        <field name="name">res.partner.form</field>
        <field name="model">res.partner</field>
        <!--<field name="priority">100</field>-->
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='user_id']" position="before">
                <field name="author"/>
            </xpath>
        </field>
    </record>
    <record id="supplier_action" model="ir.actions.act_window">
        <field name="name">inherit_id</field>
        <field name="res_model">res.partner</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="help" type="html">
            <p class="oe_view_nocontent_create">
                click here to create new item!
            </p>
        </field>
    </record>
<menuitem name="suppler_menu" id="new_supplier" parent="custom_Top_menu" action="supplier_action"/>
</data>

i got this

LINE 1: ...partner"."picking_warn_msg" as "picking_warn_msg","res_partn...

as error message and i can't move forward with my project 'odoo' is not running at all


Solution

  • That's usually a problem with Odoo opening partners on so many views. Odoo's code already knows about the new field in res.partner but the database doesn't know, until you've upgrade your app/module.

    Either you have to be on the app/modules list or form view when restarting your server (with these changes you've made), so you can upgrade your app/module instantly, or you have to restart odoo with parameter -u module_to_update.

    For the second solution there are some options, too. But it depends on your Odoo installation. If it's installed directly under debian/ubuntu, you can temporarly change the startscript under /etc/init.d/odoo with the mentioned parameter. You can also start a second Odoo instance with another port with that mentioned parameter.