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.

168 lines
4.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. Partner Changesets
  6. ==================
  7. This module extends the functionality of partners. It allows to create
  8. changesets that must be validated when a partner is modified instead of direct
  9. modifications. Rules allow to configure which field must be validated.
  10. Configuration
  11. =============
  12. Access Rights
  13. -------------
  14. The changesets rules must be edited by users with the group ``Changesets
  15. Configuration``. The changesets can be applied or canceled only by users
  16. with the group ``Changesets Validations``
  17. Changesets Rules
  18. ----------------
  19. The changesets rules can be configured in ``Sales > Configuration >
  20. Partner Changesets > Fields Rules``. For each partner field, an
  21. action can be defined:
  22. * Auto: the changes made on this field are always applied
  23. * Validate: the changes made on this field must be manually confirmed by
  24. a 'Changesets User' user
  25. * Never: the changes made on this field are always refused
  26. In any case, all the changes made by the users are always applied
  27. directly on the users, but a 'validated' changeset is created for the
  28. history.
  29. The supported fields are:
  30. * Char
  31. * Text
  32. * Date
  33. * Datetime
  34. * Integer
  35. * Float
  36. * Boolean
  37. * Many2one
  38. Rules can be global (no source model) or configured by source model.
  39. Rules by source model have the priority. If a field is not configured
  40. for the source model, it will use the global rule (if existing).
  41. If a field has no rule, it is written to the partner without changeset.
  42. Usage
  43. =====
  44. General case
  45. ------------
  46. The first step is to create the changeset rules, once that done, writes on
  47. partners will be created as changesets.
  48. Finding changesets
  49. ------------------
  50. A menu lists all the changesets in ``Sales > Configuration > Partner
  51. Changesets > Changesets``.
  52. However, it is more convenient to access them directly from the
  53. partners. Pending changesets can be accessed directly from the top right
  54. of the partners' view. A new filter on the partners shows the partners
  55. having at least one pending changeset.
  56. Handling changesets
  57. -------------------
  58. A changeset shows the list of the changes made on a partner. Some of the
  59. changes may be 'Pending', some 'Accepted' or 'Rejected' according to the
  60. changeset rules. The only changes that need an action from the user are
  61. 'Pending' changes. When a change is accepted, the value is written on
  62. the user.
  63. The changes view shows the name of the partner's field, the Origin value
  64. and the New value alongside the state of the change. By clicking on the
  65. change in some cases a more detailed view is displayed, for instance,
  66. links for relations can be clicked on.
  67. A button on a changeset allows to apply or reject all the changes at
  68. once.
  69. Custom source rules in your addon
  70. ---------------------------------
  71. Addons wanting to create changeset with their own rules should pass the
  72. following keys in the context when they write on the partner:
  73. * ``__changeset_rules_source_model``: name of the model which asks for
  74. the change
  75. * ``__changeset_rules_source_id``: id of the record which asks for the
  76. change
  77. Also, they should extend the selection in
  78. ``ChangesetFieldRule._domain_source_models`` to add their model (the
  79. same that is passed in ``__changeset_rules_source_model``).
  80. The source is used for the application of the rules, allowing to have a
  81. different rule for a different source. It is also stored on the changeset for
  82. information.
  83. Screenshot:
  84. -----------
  85. * Configuration of rules
  86. .. image:: partner_changeset/static/src/img/rules.png
  87. * Changeset waiting for validation
  88. .. image:: partner_changeset/static/src/img/changeset.png
  89. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  90. :alt: Try me on Runbot
  91. :target: https://runbot.odoo-community.org/runbot/134/9.0
  92. Known issues / Roadmap
  93. ======================
  94. * Only a subset of the type of fields is actually supported
  95. Bug Tracker
  96. ===========
  97. Bugs are tracked on `GitHub Issues
  98. <https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please
  99. check there if your issue has already been reported. If you spotted it first,
  100. help us smash it by providing detailed and welcomed feedback.
  101. Credits
  102. =======
  103. Images
  104. ------
  105. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  106. Contributors
  107. ------------
  108. * Guewen Baconnier <guewen.baconnier@camptocamp.com>
  109. * Denis Leemann <denis.leemann@camptocamp.com>
  110. Maintainer
  111. ----------
  112. .. image:: https://odoo-community.org/logo.png
  113. :alt: Odoo Community Association
  114. :target: https://odoo-community.org
  115. This module is maintained by the OCA.
  116. OCA, or the Odoo Community Association, is a nonprofit organization whose
  117. mission is to support the collaborative development of Odoo features and
  118. promote its widespread use.
  119. To contribute to this module, please visit https://odoo-community.org.