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.

57 lines
1.9 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. Configuration Helper
  6. ====================
  7. *This module is intended for developer only. It does nothing used alone.*
  8. It helps to create `config.settings` by providing an abstract Class.
  9. This class:
  10. * creates automatically related fields in 'whatiwant.config.settings'
  11. using those defined in 'res.company': it avoids duplicated field definitions.
  12. * company_id field with default value is created
  13. * onchange_company_id is defined to update all related fields
  14. * supported fields: char, text, integer, float, datetime, date, boolean, m2o
  15. How to use
  16. ----------
  17. .. code-block:: python
  18. from . company import ResCompany
  19. class WhatiwantClassSettings(orm.TransientModel):
  20. _inherit = ['res.config.settings', 'abstract.config.settings']
  21. _name = 'whatiwant.config.settings'
  22. # fields must be defined in ResCompany class
  23. # related fields are automatically generated from previous definitions
  24. _companyObject = ResCompany
  25. # all prefixed field with _prefix in res.company, will be available in 'whatiwant.config.settings' model
  26. _prefix = 'prefixyouchoose_'
  27. Roadmap
  28. -------
  29. * support (or check support) for these field types : o2m, m2m, reference, property, selection
  30. * automatically generate a default view for 'whatiwant.config.settings' (in --debug ?)
  31. Bug Tracker
  32. ===========
  33. Bugs are tracked on `GitHub Issues
  34. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  35. check there if your issue has already been reported. If you spotted it first,
  36. help us smashing it by providing a detailed and welcomed feedback.
  37. Contributors
  38. ------------
  39. * Yannick Vaucher <yannick.vaucher@camptocamp.com>
  40. * David BEAL <david.beal@akretion.com>
  41. * Sébastien BEAU <sebastien.beau@akretion.com>