99This module allows to show an x2many field with 3-tuples
1010($x_value, $y_value, $value) in a table
1111
12- ========= =========== ===========
13- \ $x_value1 $x_value2
14- ========= =========== ===========
15- $y_value1 $value(1/1) $value(2/1)
16- $y_value2 $value(1/2) $value(2/2)
17- ========= =========== ===========
12+ +-----------+-------------+-------------+
13+ | | $x_value1 | $x_value2 |
14+ +===========+=============+=============+
15+ | $y_value1 | $value(1/1) | $value(2/1) |
16+ +-----------+-------------+-------------+
17+ | $y_value2 | $value(1/2) | $value(2/2) |
18+ +-----------+-------------+-------------+
1819
1920where `value(n/n) ` is editable.
2021
@@ -92,7 +93,7 @@ data model and point to it from our wizard. The crucial part is that we fill
9293the field in the default function::
9394
9495 from odoo import fields, models
95-
96+
9697 class MyWizard(models.TransientModel):
9798 _name = 'my.wizard'
9899
@@ -105,8 +106,8 @@ the field in the default function::
105106 return [
106107 (0, 0, {
107108 'name': 'Sample task name',
108- 'project_id': p.id,
109- 'user_id': u.id,
109+ 'project_id': p.id,
110+ 'user_id': u.id,
110111 'planned_hours': 0,
111112 'message_needaction': False,
112113 'date_deadline': fields.Date.today(),
@@ -140,18 +141,8 @@ field.
140141Known issues / Roadmap
141142======================
142143
143- * It would be worth trying to instantiate the proper field widget and let it render the input
144- * Let the widget deal with the missing values of the full Cartesian product,
145- instead of being forced to pre-fill all the possible values.
146- * If you pass values with an onchange, you need to overwrite the model's method
147- `onchange ` for making the widget work::
148-
149- @api.multi
150- def onchange(self, values, field_name, field_onchange):
151- if "one2many_field" in field_onchange:
152- for sub in [<field_list>]:
153- field_onchange.setdefault("one2many_field." + sub, u"")
154- return super(model, self).onchange(values, field_name, field_onchange)
144+ * Let the widget deal with the missing values of the full Cartesian product,
145+ instead of being forced to pre-fill all the possible values.
155146
156147Bug Tracker
157148===========
@@ -170,6 +161,9 @@ Contributors
170161* Holger Brunn <hbrunn@therp.nl>
171162* Pedro M. Baeza <pedro.baeza@tecnativa.com>
172163* Artem Kostyuk <a.kostyuk@mobilunity.com>
164+ * Simone Orsi <simone.orsi@camptocamp.com>
165+ * Timon Tschanz <timon.tschanz@camptocamp.com>
166+
173167
174168Maintainer
175169----------
0 commit comments