You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.3 KiB

10 years ago
  1. 2D matrix for x2many fields
  2. ===========================
  3. This module allows to show an x2many field with 3-tuples
  4. ($x_value, $y_value, $value) in a table
  5. $x_value1 $x_value2
  6. ========= =========== ===========
  7. $y_value1 $value(1/1) $value(2/1)
  8. $y_value2 $value(1/2) $value(2/2)
  9. ========= =========== ===========
  10. where `value(n/n)` is editable.
  11. An example use case would be: Select some projects and some employees so that
  12. a manager can easily fill in the planned_hours for one task per employee. The
  13. result could look like this:
  14. .. image:: /web_widget_x2many_2d_matrix/static/description/screenshot.png
  15. :alt: Screenshot
  16. 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.
  17. Usage
  18. =====
  19. Use this widget by saying::
  20. <field name="my_field" widget="x2many_2d_matrix" />
  21. This assumes that my_field refers to a model with the fields `x`, `y` and
  22. `value`. If your fields are named differently, pass the correct names as
  23. attributes::
  24. <field name="my_field" widget="x2many_2d_matrix" field_x_axis="my_field1" field_y_axis="my_field2" field_value="my_field3" />
  25. You can pass the following parameters:
  26. field_x_axis
  27. The field that indicates the x value of a point
  28. field_y_axis
  29. The field that indicates the y value of a point
  30. field_label_x_axis
  31. Use another field to display in the table header
  32. field_label_y_axis
  33. Use another field to display in the table header
  34. field_value
  35. Show this field as value
  36. show_row_totals
  37. If field_value is a numeric field, calculate row totals
  38. show_column_totals
  39. If field_value is a numeric field, calculate column totals
  40. Known issues / Roadmap
  41. ======================
  42. * it would be worth trying to instantiate the proper field widget and let it render the input
  43. Credits
  44. =======
  45. Contributors
  46. ------------
  47. * Holger Brunn <hbrunn@therp.nl>
  48. Maintainer
  49. ----------
  50. .. image:: http://odoo-community.org/logo.png
  51. :alt: Odoo Community Association
  52. :target: http://odoo-community.org
  53. This module is maintained by the OCA.
  54. OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
  55. To contribute to this module, please visit http://odoo-community.org.