Hi all,
V 10.0
I have a situation where two m2m fields are shown on a model.
Records from the second m2m field (displayed as kanban) have to be added or removed from the first m2m (displayed as a tree).
I am confused as to how to define the "add_record_to_m2m_1" action (see below).
Does it have to be defined at the "test.model" level or at the "product.template" level ?
When calling the action is "self" the "test.model" record or the "product.template" record ?
and how to refer to the other one ? context ? records ? uid ? .. is it even possible ?
Thanks for the input.
Model :
Class TestModel(models.Model):
_name = "test.model"
m2m_1 =fields.Many2many(comodel_name="product.template")
m2m_2 =fields.Many2many(comodel_name="product.template")
View :
<form>
<field name="m2m_1">
<tree>
<field name="name"/>
</tree>
</field>
<field name="m2m_2" widget="many2many_kanban">
<kanban>
<field name="name"/>
<button action="add_record_to_m2m_1"/>
</kanban>
</field>
<form>
You must know how to do customization in odoo, reference: https://www.scoop.it/t/learn-openerp