This question has been flagged

I just want add a simple many2many field related to Purchase Order by inheritance of an existing custom module mgmtsystem_action.  My custom module mgmtsystem_action_purchase can be installed whitout error but ... 

When i create an action, i ve got this error.

Error message

compute@http://localhost:8069/web/static/src/js/core/domain.js:68:23
evalModifier@http://localhost:8069/web/static/src/js/views/basic/basic_model.js:2213:49
_evalModifiers@http://localhost:8069/web/static/src/js/views/basic/basic_model.js:2219:39
_evalColumnInvisibleFields/<@http://localhost:8069/web/static/src/js/fields/relational_fields.js:1164:32
_.mapObject@http://localhost:8069/web/static/lib/underscore/underscore.js:962:31
_evalColumnInvisibleFields@http://localhost:8069/web/static/src/js/fields/relational_fields.js:1163:18
_render@http://localhost:8069/web/static/src/js/fields/relational_fields.js:1214:51
OdooClass.extend/</prototype[name]</<@http://localhost:8069/web/static/src/js/core/class.js:90:38
start/<@http://localhost:8069/web/static/src/js/fields/abstract_field.js:204:25

IF i remove in view  <field name="po_ids"/> everything works

models.py

# -*- coding: utf-8 -*-
from odoo import fields,models

class MgmtsystemAction(models.Model):
_inherit = ['mgmtsystem.action']

po_ids = fields.Many2many('purchase.order',
'mgmtsystem_action_po_order_rel',
'action_id',
'purchase_id',
'PO Ids')

view

<?xml version="1.0" encoding="utf-8"?>
<odoo>

        <record id="view_mgmtsystem_action_form" model="ir.ui.view">
        <field name="name">mgmtsystem.action.form</field>
        <field name="model">mgmtsystem.action</field>
        <field name="inherit_id" ref="mgmtsystem_action.view_mgmtsystem_action_form"/>
        <field name="arch" type="xml">
               <xpath expr="//notebook" position="inside">
                    <page name="purchase_orders" string="Purchase orders">
                        <field name="po_ids"/>
                    </page>
              </xpath>
        </field>
        </record>

</odoo>

Thx for your help.

Regards,


Avatar
Discard
Author

Apparently, the bug appear only with widget="many2many" or no widget define (default).

If i use widget="many2many_tags", everything seems ok