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.

82 lines
2.2 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ===========================
  5. Hide measures in pivot view
  6. ===========================
  7. This module allows to hide measures in pivot view
  8. Installation
  9. ============
  10. It was tested on Odoo 10.0 branch.
  11. Usage
  12. =====
  13. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  14. :alt: Try me on Runbot
  15. :target: https://runbot.odoo-community.org/runbot/162/10.0
  16. Add this method in the res model of the pivot view, where the list named 'fields_to hide'
  17. id a comma separated list of the measures to hide
  18. ```python
  19. @api.model
  20. def fields_get(self, fields=None, attributes=None):
  21. fields_to_hide = [
  22. 'field1', 'field2', 'field3'
  23. ]
  24. res = super(ModelName, self).fields_get(
  25. fields, attributes)
  26. for field in fields_to_hide:
  27. res[field]['selectable'] = False
  28. return res
  29. ```
  30. Known issues
  31. ============
  32. This module depends on the 'dirty' flag that Odoo sets on modified forms. Odoo
  33. only sets this flag when the focus is changed, so if you modified only one
  34. field and the focus is still on that field, you won't be prevented from closing
  35. the browser window.
  36. Bug Tracker
  37. ===========
  38. Bugs are tracked on `GitHub Issues
  39. <https://github.com/OCA/web/issues>`_. In case of trouble, please
  40. check there if your issue has already been reported. If you spotted it first,
  41. help us smash it by providing detailed and welcomed feedback.
  42. Credits
  43. =======
  44. Images
  45. ------
  46. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  47. Contributors
  48. ------------
  49. * Janire Olagibel <janolabil@gmail.com>
  50. Maintainer
  51. ----------
  52. .. image:: https://odoo-community.org/logo.png
  53. :alt: Odoo Community Association
  54. :target: https://odoo-community.org
  55. This module is maintained by the OCA.
  56. OCA, or the Odoo Community Association, is a nonprofit organization whose
  57. mission is to support the collaborative development of Odoo features and
  58. promote its widespread use.
  59. To contribute to this module, please visit https://odoo-community.org.