Skip to content

Commit

Permalink
[IMP] product_abc_classification: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fgaviiria committed Jul 17, 2024
1 parent 6ff79a3 commit 958aa35
Show file tree
Hide file tree
Showing 18 changed files with 108 additions and 97 deletions.
55 changes: 29 additions & 26 deletions product_abc_classification/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,29 @@ Product Abc Classification
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
:target: https://github.com/OCA/product-attribute/tree/16.0/product_abc_classification
:target: https://github.com/OCA/product-attribute/tree/17.0/product_abc_classification
:alt: OCA/product-attribute
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_abc_classification
:target: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_abc_classification
: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/product-attribute&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=17.0
:alt: Try me on Runboat

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

This modules provides the bases to build ABC analysis (or ABC classification)
addons. These classification are used by inventory management teams to help
identify the most important products in their portfolio and ensure they
prioritize managing them above those less valuable.
This modules provides the bases to build ABC analysis (or ABC
classification) addons. These classification are used by inventory
management teams to help identify the most important products in their
portfolio and ensure they prioritize managing them above those less
valuable.

Managers will create a profile with several levels (percentages) and then the
profiled products will automatically get a corresponding level using the
ABC classification.
Managers will create a profile with several levels (percentages) and
then the profiled products will automatically get a corresponding level
using the ABC classification.

The addon *product_abc_classification_sale_stock* defines a computation profile
based on the number of sale order line delivered by product.
The addon *product_abc_classification_sale_stock* defines a computation
profile based on the number of sale order line delivered by product.

**Table of contents**

Expand All @@ -50,12 +51,14 @@ Usage

To use this module, you need to:

#. Go to Sales or Inventory menu, then to Configuration/Products/ABC Classification Profile
and create a profile with levels, knowing that the sum of all levels in the profile
should sum 100 and all the levels should be different.
#. Go to Sales or Inventory menu, then to Configuration/Products/ABC
Classification Profile and create a profile with levels, knowing that
the sum of all levels in the profile should sum 100 and all the levels
should be different.

#. Later you should go to product categories or product variants, and assign them a profile.
Then the cron classification will proceed to assign to these products one of the profile's levels.
#. Later you should go to product categories or product variants, and
assign them a profile. Then the cron classification will proceed to
assign to these products one of the profile's levels.

NOTE: If you profile (or unprofile) a product category, then all its
child categories and products will be profiled (or unprofiled).
Expand All @@ -66,29 +69,29 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/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/product-attribute/issues/new?body=module:%20product_abc_classification%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_abc_classification%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
~~~~~~~
-------

* ACSONE SA/NV
* ForgeFlow

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

* Miquel Raïch <miquel.raich@eficent.com>
* Lindsay Marion <lindsay.marion@acsone.eu>
* Laurent Mignon <laurent.mignon@acsone.eu>
* Denis Roussel <denis.roussel@acsone.eu>
- Miquel Raïch <miquel.raich@eficent.com>
- Lindsay Marion <lindsay.marion@acsone.eu>
- Laurent Mignon <laurent.mignon@acsone.eu>
- Denis Roussel <denis.roussel@acsone.eu>

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

This module is maintained by the OCA.

Expand All @@ -100,6 +103,6 @@ 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.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion product_abc_classification/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Product Abc Classification",
"summary": """
ABC classification for sales and warehouse management""",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class AbcClassificationLevel(models.Model):

_name = "abc.classification.level"
_description = "ABC Classification Level"
_order = "percentage desc, id desc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ def _onchange_product_tmpl_id(self):
@api.depends("level_id", "profile_id")
def _compute_display_name(self):
for record in self:
record.display_name = "{profile_name}: {level_name}".format(
profile_name=record.profile_id.name,
level_name=record.level_id.name,
)
record.display_name = f"{record.profile_id.name}: {record.level_id.name}"

Check warning on line 112 in product_abc_classification/models/abc_classification_product_level.py

View check run for this annotation

Codecov / codecov/patch

product_abc_classification/models/abc_classification_product_level.py#L112

Added line #L112 was not covered by tests

@api.depends("manual_level_id", "computed_level_id")
def _compute_level_id(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class AbcClassificationProfile(models.Model):

_name = "abc.classification.profile"
_description = "Abc Classification Profile"
_rec_name = "name"
Expand Down Expand Up @@ -106,7 +105,7 @@ def _cron_compute_abc_classification(self):
self.search([])._compute_abc_classification()

Check warning on line 105 in product_abc_classification/models/abc_classification_profile.py

View check run for this annotation

Codecov / codecov/patch

product_abc_classification/models/abc_classification_profile.py#L105

Added line #L105 was not covered by tests

def write(self, vals):
res = super(AbcClassificationProfile, self).write(vals)
res = super().write(vals)
if "auto_apply_computed_value" in vals and vals["auto_apply_computed_value"]:
self._auto_apply_computed_value_for_product_levels()
return res
Expand Down
1 change: 0 additions & 1 deletion product_abc_classification/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class ProductProduct(models.Model):

_inherit = "product.product"

abc_classification_product_level_ids = fields.One2many(
Expand Down
3 changes: 3 additions & 0 deletions product_abc_classification/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 product_abc_classification/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Miquel Raïch \<<miquel.raich@eficent.com>\>
- Lindsay Marion \<<lindsay.marion@acsone.eu>\>
- Laurent Mignon \<<laurent.mignon@acsone.eu>\>
- Denis Roussel \<<denis.roussel@acsone.eu>\>
4 changes: 0 additions & 4 deletions product_abc_classification/readme/CONTRIBUTORS.rst

This file was deleted.

12 changes: 12 additions & 0 deletions product_abc_classification/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This modules provides the bases to build ABC analysis (or ABC
classification) addons. These classification are used by inventory
management teams to help identify the most important products in their
portfolio and ensure they prioritize managing them above those less
valuable.

Managers will create a profile with several levels (percentages) and
then the profiled products will automatically get a corresponding level
using the ABC classification.

The addon *product_abc_classification_sale_stock* defines a computation
profile based on the number of sale order line delivered by product.
11 changes: 0 additions & 11 deletions product_abc_classification/readme/DESCRIPTION.rst

This file was deleted.

13 changes: 13 additions & 0 deletions product_abc_classification/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
To use this module, you need to:

#\. Go to Sales or Inventory menu, then to Configuration/Products/ABC
Classification Profile and create a profile with levels, knowing that
the sum of all levels in the profile should sum 100 and all the levels
should be different.

#\. Later you should go to product categories or product variants, and
assign them a profile. Then the cron classification will proceed to
assign to these products one of the profile's levels.

NOTE: If you profile (or unprofile) a product category, then all its
child categories and products will be profiled (or unprofiled).
11 changes: 0 additions & 11 deletions product_abc_classification/readme/USAGE.rst

This file was deleted.

48 changes: 27 additions & 21 deletions product_abc_classification/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,17 @@ <h1 class="title">Product Abc Classification</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:209970214efa683a12df028e3d3383e7755db563920eb48184380087a6b3e5c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/product-attribute/tree/16.0/product_abc_classification"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_abc_classification"><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/product-attribute&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>This modules provides the bases to build ABC analysis (or ABC classification)
addons. These classification are used by inventory management teams to help
identify the most important products in their portfolio and ensure they
prioritize managing them above those less valuable.</p>
<p>Managers will create a profile with several levels (percentages) and then the
profiled products will automatically get a corresponding level using the
ABC classification.</p>
<p>The addon <em>product_abc_classification_sale_stock</em> defines a computation profile
based on the number of sale order line delivered by product.</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/product-attribute/tree/17.0/product_abc_classification"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_abc_classification"><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/product-attribute&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>This modules provides the bases to build ABC analysis (or ABC
classification) addons. These classification are used by inventory
management teams to help identify the most important products in their
portfolio and ensure they prioritize managing them above those less
valuable.</p>
<p>Managers will create a profile with several levels (percentages) and
then the profiled products will automatically get a corresponding level
using the ABC classification.</p>
<p>The addon <em>product_abc_classification_sale_stock</em> defines a computation
profile based on the number of sale order line delivered by product.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -394,11 +396,13 @@ <h1 class="title">Product Abc Classification</h1>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>To use this module, you need to:</p>
<p>#. Go to Sales or Inventory menu, then to Configuration/Products/ABC Classification Profile
and create a profile with levels, knowing that the sum of all levels in the profile
should sum 100 and all the levels should be different.</p>
<p>#. Later you should go to product categories or product variants, and assign them a profile.
Then the cron classification will proceed to assign to these products one of the profile’s levels.</p>
<p>#. Go to Sales or Inventory menu, then to Configuration/Products/ABC
Classification Profile and create a profile with levels, knowing that
the sum of all levels in the profile should sum 100 and all the levels
should be different.</p>
<p>#. Later you should go to product categories or product variants, and
assign them a profile. Then the cron classification will proceed to
assign to these products one of the profile’s levels.</p>
<p>NOTE: If you profile (or unprofile) a product category, then all its
child categories and products will be profiled (or unprofiled).</p>
</div>
Expand All @@ -407,7 +411,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-attribute/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/product-attribute/issues/new?body=module:%20product_abc_classification%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/product-attribute/issues/new?body=module:%20product_abc_classification%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 @@ -431,11 +435,13 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">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>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/16.0/product_abc_classification">OCA/product-attribute</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/17.0/product_abc_classification">OCA/product-attribute</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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div
class="alert alert-danger"
role="alert"
attrs="{'invisible': [('flag','=',False)]}"
invisible="not flag"
>Computed level differs from the specified level</div>
<group name="main_info">
<field name="display_name" />
Expand Down Expand Up @@ -45,11 +45,11 @@
<field name="model">abc.classification.product.level</field>
<field name="arch" type="xml">
<tree decoration-danger="flag == True" editable="bottom">
<field name="profile_id" invisible="1" />
<field name="profile_id" column_invisible="1" />
<field name="product_id" />
<field name="manual_level_id" />
<field name="computed_level_id" />
<field name="flag" invisible="1" />
<field name="flag" column_invisible="1" />
</tree>
</field>
</record>
Expand Down
Loading

0 comments on commit 958aa35

Please sign in to comment.