call on_change method once in odoo 8

291 views Asked by At

I'm working on a new module under odoo 8

I have a class described as folowing

class Container(osv.Model):

      _name = "binpacking.container"
      _columns = {
                 'name' : fields.char('Name', size=256, required=True),
                 'boxes_ids' : fields.many2many('binpacking.box','box_id',string="boxes")
                  }

I get the box Ids from another class

class Box(osv.Model):
          _name = "binpacking.box"
          _columns = {
                     'name' : fields.char('Name', size=256, required=True),
            }

and then I try to call an onchange method when adding a box to a Container

<field name="boxes_ids" on_change="onchange_add_boxes(boxes_ids)" />

The problem is when I check multiple boxesin the wizard, I call the on_change method as many time as the number of inserted elments, and I need to call it once at the end of insertion

0

There are 0 answers