0

I Have added check-box in one2many field. But for marking check this check-box, it takes twice click on this check-box. So, how to active this check-box in single click?

Thanks in advance.

Pawan Kumar Sharma
  • 1,168
  • 8
  • 30

2 Answers2

3

For Odoo CE v12: In the tree view, placing class="custom-control custom-checkbox" next to the One2many field enables checking the box in a single click.

Example:

<field name="your-One2many-field" class="custom-control custom-checkbox"> </field>
ryilmaz
  • 31
  • 3
1

I think I understand what you mean. To confirm, this issue is for any One2many field, which is displayed as a tree view within a form view, correct?

If that is the case, then this is, unfortunately, normal behavior. You must click the line once to place it in "edit" mode and then check or uncheck the checkbox.

I'm not aware of any existing way to override this behavior currently. I expect that changing this would require modifying at least the JavaScript code.

With that being said, you could place a <button> element somewhere on your One2many field's tree view that would toggle your checkbox field, but that's not entirely desirable.

travisw
  • 2,052
  • 1
  • 14
  • 27
  • Yes, This issue occurs in one2many field. And still i'm not able to get any solution regarding this issue. Did you found any solution? – Pawan Kumar Sharma Jul 11 '18 at 06:03
  • @PAWANSHARMA I have not found any solution except for using a `button` on your `One2many` field's tree view. Such as `` which calls a method that just does something like `for record in self: record.field = not record.field` – travisw Jul 11 '18 at 15:26