When adding a new field to models such as res.partner or res.users in odoo13, clicking to restart the odoo service will report the following error;
psycopg2.errors.UndefinedColumn: column res_partner.field_name does not exist LINE 1: ...se_warn_msg","res_partner"."barcode" as "barcode","res_partn...
After searching a lot, no solution was found; later, by examining the source code, it was discovered that simply adding company_dependent=True attribute to the new field can fix it; for example:from odoo import api, fields, models, _class ZdResPartner(models.Model):_inherit = 'res.partner'zd_merchandiser_id = fields.Many2one('res.users', string="Merchandiser", copy=False, company_dependent=True)
odoo13和14如何在[res.partner]模型新增字段?
odoo14开发
登录 留下评论
