[IMP] web_widget_x2many_2d_matrix: New option field_att_<name>
Declare as many options prefixed with this string as you need for binding
a field value with an HTML node attribute (disabled, class, style...)
called as the `<name>` passed in the option.
NOTE: This doesn't prevent to require to fill the full matrix with
all the combination records.
The beauty of this is that you have an arbitrary amount of columns with this widget, trying to get this in standard x2many lists involves some quite agly hacks.
The beauty of this is that you have an arbitrary amount of columns with this
widget, trying to get this in standard x2many lists involves some quite ugly
hacks.
Usage
=====
@ -54,11 +58,23 @@ show_row_totals
If field_value is a numeric field, calculate row totals
show_column_totals
If field_value is a numeric field, calculate column totals
field_att_<name>
Declare as many options prefixed with this string as you need for binding
a field value with an HTML node attribute (disabled, class, style...)
You need a data structure already filled with values. Let's assume we want to use this widget in a wizard that lets the user fill in planned hours for one task per project per user. In this case, we can use ``project.task`` as our data model and point to it from our wizard. The crucial part is that we fill the field in the default function::
You need a data structure already filled with values. Let's assume we want to
use this widget in a wizard that lets the user fill in planned hours for one
task per project per user. In this case, we can use ``project.task`` as our
data model and point to it from our wizard. The crucial part is that we fill
the field in the default function::
class MyWizard(models.TransientModel):
_name = 'my.wizard'
@ -85,6 +101,11 @@ Now in our wizard, we can use::