-
-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG]crm_lead_product: Migration to 14.0
- Loading branch information
1 parent
9161649
commit 028e705
Showing
19 changed files
with
157 additions
and
113 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
================= | ||
Lead Line Product | ||
================= | ||
================ | ||
CRM Lead Product | ||
================ | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
@@ -17,26 +17,26 @@ Lead Line Product | |
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html | ||
:alt: License: LGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github | ||
:target: https://github.com/OCA/crm/tree/13.0/crm_lead_product | ||
:target: https://github.com/OCA/crm/tree/14.0/crm_lead_product | ||
:alt: OCA/crm | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/crm-13-0/crm-13-0-crm_lead_product | ||
:target: https://translation.odoo-community.org/projects/crm-14-0/crm-14-0-crm_lead_product | ||
: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/crm&target_branch=13.0 | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=14.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
|
||
This module allows the user to link multiple products, product categories or product templates to a lead or an opportunity | ||
in order to be able to do a product demand forecasting taking into account the leads and opportunities defined in odoo. | ||
Included in the product line there are two computed fields, the planned revenue and expected revenue. On one hand, the | ||
planned revenue is computed as the selling price times the quantity. On the other hand, the expected revenue takes into account | ||
in order to be able to do a product demand forecasting taking into account the leads and opportunities defined in Odoo. | ||
|
||
Included in the product line there are two computed fields, the expected revenue and prorated revenue. On one hand, the | ||
expected revenue is computed as the selling price times the quantity. On the other hand, the prorated revenue takes into account | ||
the probability of the opportunity and is computed as the planned revenue times the probability. | ||
|
||
The module also includes a reporting section where the user can easily see in a pivot and graph view the relationship | ||
between products, stage of the lead/opportunity and the planned or expected revenue for that product. | ||
between products, stage of the lead/opportunity and the expected or prorated revenue for that product. | ||
|
||
**Table of contents** | ||
|
||
|
@@ -46,24 +46,22 @@ between products, stage of the lead/opportunity and the planned or expected reve | |
Configuration | ||
============= | ||
|
||
|
||
To configure this module to be available for the Leads the user needs to activate the Leads option in CRM settings | ||
|
||
Usage | ||
===== | ||
|
||
|
||
* Go to menu **CRM > Lead** and create or edit a Lead adding all the products associated to it. | ||
* Go to menu **CRM > My Pipeline** and create or edit an Opportunity adding all the products associated to it. | ||
* Go to menu **CRM > Reporting > Pipeline by Product** to run the report that relates product to planned and expected revenue per stage | ||
* Go to menu **CRM > Reporting > Pipeline by Product** to run the report that relates product to expected and prorated revenue per stage | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/crm/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/crm/issues/new?body=module:%20crm_lead_product%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
`feedback <https://github.com/OCA/crm/issues/new?body=module:%20crm_lead_product%0Aversion:%2014.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. | ||
|
||
|
@@ -78,8 +76,8 @@ Authors | |
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
|
||
* Adria Gil Sorribes <[email protected]> | ||
* Guillem Casassas <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
@@ -94,6 +92,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/crm <https://github.com/OCA/crm/tree/13.0/crm_lead_product>`_ project on GitHub. | ||
This module is part of the `OCA/crm <https://github.com/OCA/crm/tree/14.0/crm_lead_product>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
# Copyright (C) 2017-2024 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) | ||
from . import models | ||
from . import report |
This file contains 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
This file contains 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,59 @@ | ||
# Copyright (C) 2017-2024 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) | ||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
if openupgrade.column_exists( | ||
env.cr, "crm_lead_line", "expected_revenue" | ||
) and not openupgrade.column_exists(env.cr, "crm_lead_line", "prorated_revenue"): | ||
env.cr.execute( | ||
""" | ||
ALTER TABLE crm_lead_line | ||
ADD COLUMN prorated_revenue NUMERIC; | ||
COMMENT ON COLUMN crm_lead_line.prorated_revenue | ||
IS 'Prorated Revenue'; | ||
""" | ||
) | ||
# PostgreSQL already automatically truncates from `double_precision` type to | ||
# `numeric` type, this is needed as we are converting from Float Odoo field | ||
# to Monetary Odoo field | ||
env.cr.execute( | ||
""" | ||
UPDATE crm_lead_line | ||
SET prorated_revenue = expected_revenue; | ||
""" | ||
) | ||
env.cr.execute( | ||
""" | ||
ALTER TABLE crm_lead_line | ||
DROP COLUMN expected_revenue; | ||
""" | ||
) | ||
if openupgrade.column_exists( | ||
env.cr, "crm_lead_line", "planned_revenue" | ||
) and not openupgrade.column_exists(env.cr, "crm_lead_line", "expected_revenue"): | ||
env.cr.execute( | ||
""" | ||
ALTER TABLE crm_lead_line | ||
ADD COLUMN expected_revenue NUMERIC; | ||
COMMENT ON COLUMN crm_lead_line.expected_revenue | ||
IS 'Expected Revenue'; | ||
""" | ||
) | ||
# PostgreSQL already automatically truncates from `double_precision` type to | ||
# `numeric` type, this is needed as we are converting from Float Odoo field | ||
# to Monetary Odoo field | ||
env.cr.execute( | ||
""" | ||
UPDATE crm_lead_line | ||
SET expected_revenue = planned_revenue; | ||
""" | ||
) | ||
env.cr.execute( | ||
""" | ||
ALTER TABLE crm_lead_line | ||
DROP COLUMN planned_revenue; | ||
""" | ||
) |
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
|
||
# Copyright (C) 2017-2024 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) | ||
from . import crm_lead_line | ||
from . import crm_lead |
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,2 +1 @@ | ||
|
||
To configure this module to be available for the Leads the user needs to activate the Leads option in CRM settings |
This file contains 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
* Adria Gil Sorribes <[email protected]> | ||
* Guillem Casassas <[email protected]> |
This file contains 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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
This module allows the user to link multiple products, product categories or product templates to a lead or an opportunity | ||
in order to be able to do a product demand forecasting taking into account the leads and opportunities defined in odoo. | ||
Included in the product line there are two computed fields, the planned revenue and expected revenue. On one hand, the | ||
planned revenue is computed as the selling price times the quantity. On the other hand, the expected revenue takes into account | ||
in order to be able to do a product demand forecasting taking into account the leads and opportunities defined in Odoo. | ||
|
||
Included in the product line there are two computed fields, the expected revenue and prorated revenue. On one hand, the | ||
expected revenue is computed as the selling price times the quantity. On the other hand, the prorated revenue takes into account | ||
the probability of the opportunity and is computed as the planned revenue times the probability. | ||
|
||
The module also includes a reporting section where the user can easily see in a pivot and graph view the relationship | ||
between products, stage of the lead/opportunity and the planned or expected revenue for that product. | ||
between products, stage of the lead/opportunity and the expected or prorated revenue for that product. |
This file contains 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
* Go to menu **CRM > Lead** and create or edit a Lead adding all the products associated to it. | ||
* Go to menu **CRM > My Pipeline** and create or edit an Opportunity adding all the products associated to it. | ||
* Go to menu **CRM > Reporting > Pipeline by Product** to run the report that relates product to planned and expected revenue per stage | ||
* Go to menu **CRM > Reporting > Pipeline by Product** to run the report that relates product to expected and prorated revenue per stage |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
# Copyright (C) 2017-2024 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) | ||
from . import crm_product_report |
Oops, something went wrong.