Reputation: 127
This is the on change function of one of my models in my odoo14 module:
@api.onchange('staende', 'name', 'length', 'height')
def change(self):
print("\033[92m +++ DEBUG#ONCHANGE +++")
print(self)
print("\033[93m", end="")
weirdly enough, the method only gets called when I change the name of the model but not when I change the length or height nor the staende attribute
this is what the model looks like:
class Halle(models.Model):
_name = 'rectanglemaps.halle'
_inherit = 'mail.thread'
_description = 'desc'
active = fields.Boolean('Active', default=True)
name = fields.Char(string="Name", required=True)
length = fields.Float(string="Länge", required=True)
height = fields.Float(string="Tiefe", required=True)
measurehalle = fields.Float(string="Rastermaß")
plan = fields.Image(string="Plan")
messe_id = fields.Many2one('rectanglemaps.messe', string="Messe")
staende = fields.One2many('rectanglemaps.stand', 'halle_id', string="Stände")
Upvotes: 0
Views: 81
Reputation: 127
It appears, it was only a problem with hot module reloading. Restarting odoo with the flag -u MODULENAME solved the problem.
Upvotes: 1