I have this columns:
_columns = {
'pos_name': fields.many2one('pos.config', 'Point of Sale', required=True),
'session_master_ids': fields.many2many('pos.session', 'pos_gta_session_rel', 'export_id', 'session_id', string='POS Sessions', readonly=True),
}
And this function:
def on_change_pos_name(self, cr, uid, ids, pos_name, context=None):
val = {}
if pos_name:
session_ids = self.pool.get('pos.session').search(cr, uid, [('config_id', '=', pos_name)], context=context)
val = {
'session_master_ids': session_ids
}
return {'value': val}
I konw that it is not sotred in the database becaus of the parameter "readonly=True".
It would help me a lot if create="false" delete="false" in tree would work, but it does't.
<field name="session_master_ids" widget="many2many">
<tree create="false" delete="false">
<field name="name"/>
<field name="user_id"/>
<field name="state"/>
<field name="create_date"/>
<field name="write_date"/>
<field name="start_at"/>
<field name="stop_at"/>
</tree>
</field>