[FIX] web: correctly edit Many2ManyCheckboxes with 100+ values
The Many2ManyCheckboxes widget displays all values that could be in the many2many relation, with a checkbox indicating whether each value is in the relation or not. It is designed to be set on fields where the comodel contains a few records (typically, we don't want to see dozens of checkboxes in the form view). This widget shouldn't be used on many2manys with a large comodel, as we have better tools to handle them (like a tree view). We deal with extreme cases (when the widget is, by mistake, set on a field where the comodel is huge) by using the name_search limit of 100: at most 100 checkboxes are displayed. Before this commit, this extreme situation wasn't correctly handled. If there were in the relation records that weren't displayed (because they weren't inside the 100 limit), then, editing the value by (un)selecting a checkbox would automatically remove all non displayed values from the relation. This commit ensures that we keep in the relation all values that aren't displayed. Issue spotted when working on opw~2439041 closes odoo/odoo#67400 X-original-commit: 9e9d3aa78c42ad4ffca3b56a28382ed84078cde3 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com> Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -2469,8 +2469,11 @@ kanban.many2many_tags (KanbanFieldMany2ManyTags)
|
||||
- Supported field types: *many2many*
|
||||
|
||||
many2many_checkboxes (FieldMany2ManyCheckBoxes)
|
||||
This field displays a list of checkboxes and allow the user to select a
|
||||
subset of the choices.
|
||||
This field displays a list of checkboxes and allows the user to select a
|
||||
subset of the choices. Note that the number of displayed values is limited to
|
||||
100. This limit isn't customizable. It simply allows to handle extreme cases
|
||||
where this widget is wrongly set on a field with a huge comodel. In those
|
||||
cases, a list view is more adequate as it allows pagination and filtering.
|
||||
|
||||
- Supported field types: *many2many*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user