Skip to content

Commit

Permalink
[IMP] partner_tier_validation: pre-commit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rven committed Jul 19, 2024
1 parent 53c01aa commit 928e118
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 112 deletions.
77 changes: 38 additions & 39 deletions partner_tier_validation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ Partner Tier Validation
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github
:target: https://github.com/OCA/partner-contact/tree/16.0/partner_tier_validation
:target: https://github.com/OCA/partner-contact/tree/17.0/partner_tier_validation
:alt: OCA/partner-contact
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-partner_tier_validation
:target: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_tier_validation
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Adds an approval workflow to Partners.
The default rule requires new company Contacts to be approved
before they can be used.
Adds an approval workflow to Partners. The default rule requires new
company Contacts to be approved before they can be used.

The rule can be extended to new non-company contact,
but beware that may cause issues with automatically created new contacts,
such as the ones generated when processing incoming emails.
The rule can be extended to new non-company contact, but beware that may
cause issues with automatically created new contacts, such as the ones
generated when processing incoming emails.

If the 'Is Company' or 'Parent' field changes then the contact is Request
for approval.
If the 'Is Company' or 'Parent' field changes then the contact is
Request for approval.

For this, the new Contact record is kept as "Archived" until it is approved.
For this, the new Contact record is kept as "Archived" until it is
approved.

**Table of contents**

Expand All @@ -50,65 +50,64 @@ Installation
============

This module depends on ``base_tier_validation``. You can find it at
`OCA/server-ux <https://github.com/OCA/server-ux>`_
`OCA/server-ux <https://github.com/OCA/server-ux>`__

Usage
=====

Before using, check Contact Stages configuration,
to ensure that the default stage has the "Related State" field
set to "To Approve".
For example, having the "Draft" stage the default ensures this.
Before using, check Contact Stages configuration, to ensure that the
default stage has the "Related State" field set to "To Approve". For
example, having the "Draft" stage the default ensures this.

A regular user creates a new Contact and sends it for approval:

#. Create a Contact triggering at least one "Tier Definition".
The Contact will be in Draft state and marked as Archived until approved.
#. Click on *Request Validation* button.
#. In the *Reviews* section, at the bottom of the form, inspect the pending reviews and their status.

1. Create a Contact triggering at least one "Tier Definition". The
Contact will be in Draft state and marked as Archived until approved.
2. Click on *Request Validation* button.
3. In the *Reviews* section, at the bottom of the form, inspect the
pending reviews and their status.

The approver reviews Contacts to approve:

#. Navigate to the Contacts app, and select the filter "Needs my Approval"
#. Open the Contact form to approve. It will display a
"This Records needs to be validated" banner, with "Validate" and "Reject" options.
#. The approver can change the state to "Active".
This will automatically unarchive the record and make it available to be used.

1. Navigate to the Contacts app, and select the filter "Needs my
Approval"
2. Open the Contact form to approve. It will display a "This Records
needs to be validated" banner, with "Validate" and "Reject" options.
3. The approver can change the state to "Active". This will
automatically unarchive the record and make it available to be used.

The Approve/Reject actions do not automatically change the State.
This could be a future improvement.
The Approve/Reject actions do not automatically change the State. This
could be a future improvement.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_tier_validation%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_tier_validation%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~
-------

* Open Source Integrators

Contributors
~~~~~~~~~~~~
------------

* `Open Source Integrators <https://opensourceintegrators.com>`_.
- `Open Source Integrators <https://opensourceintegrators.com>`__.

* Antonio Yamuta <ayamuta@opensourceintegrators.com>
* Daniel Reis <dreis@opensourceintegrators.com>
* Urvisha Desai <udesai@opensourceintegrators.com>
- Antonio Yamuta <ayamuta@opensourceintegrators.com>
- Daniel Reis <dreis@opensourceintegrators.com>
- Urvisha Desai <udesai@opensourceintegrators.com>

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -128,6 +127,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-dreispt|

This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/16.0/partner_tier_validation>`_ project on GitHub.
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/17.0/partner_tier_validation>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions partner_tier_validation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions partner_tier_validation/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [Open Source Integrators](https://opensourceintegrators.com).
- Antonio Yamuta \<<ayamuta@opensourceintegrators.com>\>
- Daniel Reis \<<dreis@opensourceintegrators.com>\>
- Urvisha Desai \<<udesai@opensourceintegrators.com>\>
5 changes: 0 additions & 5 deletions partner_tier_validation/readme/CONTRIBUTORS.rst

This file was deleted.

12 changes: 12 additions & 0 deletions partner_tier_validation/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Adds an approval workflow to Partners. The default rule requires new
company Contacts to be approved before they can be used.

The rule can be extended to new non-company contact, but beware that may
cause issues with automatically created new contacts, such as the ones
generated when processing incoming emails.

If the 'Is Company' or 'Parent' field changes then the contact is
Request for approval.

For this, the new Contact record is kept as "Archived" until it is
approved.
12 changes: 0 additions & 12 deletions partner_tier_validation/readme/DESCRIPTION.rst

This file was deleted.

2 changes: 2 additions & 0 deletions partner_tier_validation/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module depends on `base_tier_validation`. You can find it at
[OCA/server-ux](https://github.com/OCA/server-ux)
2 changes: 0 additions & 2 deletions partner_tier_validation/readme/INSTALL.rst

This file was deleted.

24 changes: 24 additions & 0 deletions partner_tier_validation/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Before using, check Contact Stages configuration, to ensure that the
default stage has the "Related State" field set to "To Approve". For
example, having the "Draft" stage the default ensures this.

A regular user creates a new Contact and sends it for approval:

1. Create a Contact triggering at least one "Tier Definition". The
Contact will be in Draft state and marked as Archived until
approved.
2. Click on *Request Validation* button.
3. In the *Reviews* section, at the bottom of the form, inspect the
pending reviews and their status.

The approver reviews Contacts to approve:

1. Navigate to the Contacts app, and select the filter "Needs my
Approval"
2. Open the Contact form to approve. It will display a "This Records
needs to be validated" banner, with "Validate" and "Reject" options.
3. The approver can change the state to "Active". This will
automatically unarchive the record and make it available to be used.

The Approve/Reject actions do not automatically change the State. This
could be a future improvement.
24 changes: 0 additions & 24 deletions partner_tier_validation/readme/USAGE.rst

This file was deleted.

64 changes: 34 additions & 30 deletions partner_tier_validation/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -368,16 +369,16 @@ <h1 class="title">Partner Tier Validation</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:930cc26243226cbf43d923b5d31be3b293d7e95643548c905d2dbe109a5116f1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/partner-contact/tree/16.0/partner_tier_validation"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-partner_tier_validation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Adds an approval workflow to Partners.
The default rule requires new company Contacts to be approved
before they can be used.</p>
<p>The rule can be extended to new non-company contact,
but beware that may cause issues with automatically created new contacts,
such as the ones generated when processing incoming emails.</p>
<p>If the ‘Is Company’ or ‘Parent’ field changes then the contact is Request
for approval.</p>
<p>For this, the new Contact record is kept as “Archived” until it is approved.</p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/partner-contact/tree/17.0/partner_tier_validation"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_tier_validation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Adds an approval workflow to Partners. The default rule requires new
company Contacts to be approved before they can be used.</p>
<p>The rule can be extended to new non-company contact, but beware that may
cause issues with automatically created new contacts, such as the ones
generated when processing incoming emails.</p>
<p>If the ‘Is Company’ or ‘Parent’ field changes then the contact is
Request for approval.</p>
<p>For this, the new Contact record is kept as “Archived” until it is
approved.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -399,34 +400,35 @@ <h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>Before using, check Contact Stages configuration,
to ensure that the default stage has the “Related State” field
set to “To Approve”.
For example, having the “Draft” stage the default ensures this.</p>
<p>Before using, check Contact Stages configuration, to ensure that the
default stage has the “Related State” field set to “To Approve”. For
example, having the “Draft” stage the default ensures this.</p>
<p>A regular user creates a new Contact and sends it for approval:</p>
<ol class="arabic simple">
<li>Create a Contact triggering at least one “Tier Definition”.
The Contact will be in Draft state and marked as Archived until approved.</li>
<li>Create a Contact triggering at least one “Tier Definition”. The
Contact will be in Draft state and marked as Archived until approved.</li>
<li>Click on <em>Request Validation</em> button.</li>
<li>In the <em>Reviews</em> section, at the bottom of the form, inspect the pending reviews and their status.</li>
<li>In the <em>Reviews</em> section, at the bottom of the form, inspect the
pending reviews and their status.</li>
</ol>
<p>The approver reviews Contacts to approve:</p>
<ol class="arabic simple">
<li>Navigate to the Contacts app, and select the filter “Needs my Approval”</li>
<li>Open the Contact form to approve. It will display a
“This Records needs to be validated” banner, with “Validate” and “Reject” options.</li>
<li>The approver can change the state to “Active”.
This will automatically unarchive the record and make it available to be used.</li>
<li>Navigate to the Contacts app, and select the filter “Needs my
Approval”</li>
<li>Open the Contact form to approve. It will display a “This Records
needs to be validated” banner, with “Validate” and “Reject” options.</li>
<li>The approver can change the state to “Active”. This will
automatically unarchive the record and make it available to be used.</li>
</ol>
<p>The Approve/Reject actions do not automatically change the State.
This could be a future improvement.</p>
<p>The Approve/Reject actions do not automatically change the State. This
could be a future improvement.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/partner-contact/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_tier_validation%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_tier_validation%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -451,13 +453,15 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/dreispt"><img alt="dreispt" src="https://github.com/dreispt.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner-contact/tree/16.0/partner_tier_validation">OCA/partner-contact</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner-contact/tree/17.0/partner_tier_validation">OCA/partner-contact</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down

0 comments on commit 928e118

Please sign in to comment.