-
-
Notifications
You must be signed in to change notification settings - Fork 794
[ADD] product_abc_classification_finance: Classification by cost and sale price #2002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AJamal13
wants to merge
10
commits into
OCA:16.0
Choose a base branch
from
AJamal13:16.0
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8082462
Adding classification by Cost/Sale Price/Sale Margin
AJamal13 46950db
Update __manifest__.py
AJamal13 6b01962
Merge branch 'OCA:16.0' into 16.0
AJamal13 fd51b29
Add demo data and tests for finance ABC classification
AJamal13 0d86ee5
fix checks
AJamal13 5ca0af0
Add tests for finance profile validation and margin exclusion
AJamal13 e1d7e1e
Add tests for finance profile validation and margin exclusion
AJamal13 f77be24
Revert "Add tests for finance profile validation and margin exclusion"
AJamal13 80c175d
Merge branch '16.0' of https://github.com/AJamal13/product-attribute …
AJamal13 9581799
product_abc_classification_finance
AJamal13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| ================================== | ||
| Product ABC Classification Finance | ||
| ================================== | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:0ec73bee1065a082a937419d6b736faeedfa1e9e4e0cde1147cc746d17b65c90 | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Beta | ||
| .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
| :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_finance | ||
| :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_finance | ||
| :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 | ||
| :alt: Try me on Runboat | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This modules includes an ABC analysis computation profile based | ||
| on the cost and sale price of sale order lines delivered from a given date by product. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| 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. The sum of all levels in the profile should equal 100 and all | ||
| levels must be unique. | ||
|
|
||
| #. Assign the profile to product variants. The cron job will automatically | ||
| classify these products into one of the profile's levels based on the total | ||
| cost and total sales of delivered products. | ||
|
|
||
| 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_finance%0Aversion:%2016.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 | ||
| ~~~~~~~ | ||
|
|
||
| * AJamal13 | ||
|
|
||
| Contributors | ||
| ~~~~~~~~~~~~ | ||
|
|
||
| * Ahmed Jamal <[email protected]> | ||
|
|
||
| Maintainers | ||
| ~~~~~~~~~~~ | ||
|
|
||
| This module is maintained by the OCA. | ||
|
|
||
| .. image:: https://odoo-community.org/logo.png | ||
| :alt: Odoo Community Association | ||
| :target: https://odoo-community.org | ||
|
|
||
| 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. | ||
|
|
||
| .. |maintainer-AJamal13| image:: https://github.com/AJamal13.png?size=40px | ||
| :target: https://github.com/AJamal13 | ||
| :alt: AJamal13 | ||
|
|
||
| Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
|
||
| |maintainer-AJamal13| | ||
|
|
||
| This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/16.0/product_abc_classification_finance>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "name": "Product ABC Classification Finance", | ||
| "summary": "Financial ABC analysis for products (cost, sale price)", | ||
| "version": "16.0.1.0.2", | ||
| "category": "Inventory/Inventory", | ||
| "author": "AJamal13,Odoo Community Association (OCA)", | ||
| "license": "AGPL-3", | ||
| "website": "https://github.com/OCA/product-attribute", | ||
| "depends": ["product_abc_classification_sale_stock", "sale_margin"], | ||
| "data": [ | ||
| "security/ir.model.access.csv", | ||
| "views/abc_finance_sale_level_history_views.xml", | ||
| "views/abc_classification_product_level_views.xml", | ||
| "views/abc_classification_profile.xml", | ||
| ], | ||
| "demo": [ | ||
| "data/abc_classification_finance_demo.xml", | ||
| ], | ||
| "maintainers": ["AJamal13"], | ||
| "installable": True, | ||
| "application": False, | ||
| } | ||
34 changes: 34 additions & 0 deletions
34
product_abc_classification_finance/data/abc_classification_finance_demo.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <!-- Demo data for product_abc_classification_finance --> | ||
| <odoo> | ||
| <!-- Classification Levels (copy from sale_stock for consistency) --> | ||
| <record id="abc_classification_level_a_fin" model="abc.classification.level"> | ||
| <field name="name">A</field> | ||
| <field name="percentage">80</field> | ||
| <field name="percentage_products">20</field> | ||
| </record> | ||
| <record id="abc_classification_level_b_fin" model="abc.classification.level"> | ||
| <field name="name">B</field> | ||
| <field name="percentage">15</field> | ||
| <field name="percentage_products">30</field> | ||
| </record> | ||
| <record id="abc_classification_level_c_fin" model="abc.classification.level"> | ||
| <field name="name">C</field> | ||
| <field name="percentage">5</field> | ||
| <field name="percentage_products">50</field> | ||
| </record> | ||
|
|
||
| <record | ||
| id="abc_classification_profile_finance_cost" | ||
| model="abc.classification.profile" | ||
| > | ||
| <field name="name">Finance Cost Profile</field> | ||
| <field name="profile_type">cost</field> | ||
| <field name="warehouse_id" ref="stock.warehouse0" /> | ||
| <field name="period">365</field> | ||
| <field | ||
| name="level_ids" | ||
| eval="[(6,0,[ref('abc_classification_level_a_fin'), ref('abc_classification_level_b_fin'), ref('abc_classification_level_c_fin')])]" | ||
| /> | ||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from . import abc_classification_profile | ||
| from . import abc_classification_product_level | ||
| from . import abc_finance_sale_level_history |
10 changes: 10 additions & 0 deletions
10
product_abc_classification_finance/models/abc_classification_product_level.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class AbcClassificationProductLevel(models.Model): | ||
| _inherit = "abc.classification.product.level" | ||
|
|
||
| finance_sale_level_history_ids = fields.One2many( | ||
| comodel_name="abc.finance.sale.level.history", | ||
| inverse_name="product_level_id", | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AJamal13 you should add yourself as the official maintainers 😏