I have two Module
----------------------------------------------------------------
Module 1
name = fields.Char()
isactive=fields.Boolean(default=True)
---------------------------------------------------------------
Module 2
name=fields.Char()
fromModule1=fields.Many2many('module1.module1')
-----------
Module 2 XML = <group><field name="fromModule1" domain="[('isactive', '=',True)]"/></group>
-----------
Question
from Module2 how to update the ( isactive ) in Module1 to make it 'FALSE' using button?
--------------------------------------------------------------------------------------------------------------------------------------
Module2
<header><button name="button_False" string="Update" type="object"/></header>
.py
@api.multi
def button_False(self):
self.Count = len(self.fromModule1)
for x in self.Count:
self.fromModule1.isactive[x] = False
--------------------------------------------------------------------------------------------------------------------------------------------
# I try this rookie code, well you know it, it is not working.....
Odoo12 CE
Custom Module
your_object.write({'isactive': False})