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.

88 lines
2.8 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. Bug Tracker
  44. ===========
  45. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
  46. In case of trouble, please check there if your issue has already been reported.
  47. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
  48. `here <https://github.com/OCA/web/issues/new?body=module:%20web_widget_x2many_2d_matrix%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  49. Credits
  50. =======
  51. Contributors
  52. ------------
  53. * Holger Brunn <hbrunn@therp.nl>
  54. Maintainer
  55. ----------
  56. .. image:: http://odoo-community.org/logo.png
  57. :alt: Odoo Community Association
  58. :target: http://odoo-community.org
  59. This module is maintained by the OCA.
  60. 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.
  61. To contribute to this module, please visit http://odoo-community.org.