|
| 1 | +.. image:: https://odoo-community.org/readme-banner-image |
| 2 | + :target: https://odoo-community.org/get-involved?utm_source=readme |
| 3 | + :alt: Odoo Community Association |
| 4 | + |
| 5 | +======================= |
| 6 | +CRM - Fix lead currency |
| 7 | +======================= |
| 8 | + |
| 9 | +.. |
| 10 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 11 | + !! This file is generated by oca-gen-addon-readme !! |
| 12 | + !! changes will be overwritten. !! |
| 13 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 14 | + !! source digest: sha256:34af6785c2aaa8fa8b396b8fae36790aa96db6030caf8ac27affbdb1f14f3088 |
| 15 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 16 | +
|
| 17 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
| 18 | + :target: https://odoo-community.org/page/development-status |
| 19 | + :alt: Beta |
| 20 | +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png |
| 21 | + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html |
| 22 | + :alt: License: LGPL-3 |
| 23 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github |
| 24 | + :target: https://github.com/OCA/crm/tree/19.0/crm_lead_company_currency_fix |
| 25 | + :alt: OCA/crm |
| 26 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 27 | + :target: https://translation.odoo-community.org/projects/crm-19-0/crm-19-0-crm_lead_company_currency_fix |
| 28 | + :alt: Translate me on Weblate |
| 29 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 30 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=19.0 |
| 31 | + :alt: Try me on Runboat |
| 32 | + |
| 33 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 34 | + |
| 35 | +In Odoo standard source code, leads' currency is defined as a computed, |
| 36 | +non-stored field, which follows this workflow: |
| 37 | + |
| 38 | +- if the lead's company is set, then the company currency is used |
| 39 | + |
| 40 | +- if the lead's company is not set, then the user's company currency is |
| 41 | + used |
| 42 | + |
| 43 | +Since the field is not stored, it leads to 2 main issues: |
| 44 | + |
| 45 | +1) Changing a company's currency will change the currency on all the |
| 46 | + existing leads linked to that company, but not the amounts. Eg: |
| 47 | + |
| 48 | + - you have a lead linked to a company in EUR |
| 49 | + - the lead's expected revenue is 1000 EUR |
| 50 | + - you change the company currency to USD |
| 51 | + - the lead's expected revenue becomes 1000 USD |
| 52 | + |
| 53 | +2) If a lead is not linked to a specific company, then 2 users that are |
| 54 | + logged in with 2 different companies and different currencies will |
| 55 | + see the lead's amounts with different currencies. Eg: |
| 56 | + |
| 57 | + - you have a lead where the company is not set |
| 58 | + - accessing the lead with a user whose main company is in EUR will |
| 59 | + display an expected revenue of 1000 EUR |
| 60 | + - accessing the lead with a user whose main company is in USD will |
| 61 | + display an expected revenue of 1000 USD |
| 62 | + |
| 63 | +This module stores the field in the DB to keep data consistency, and |
| 64 | +will only update the lead's currency only if the lead's company itself |
| 65 | +is updated. The behavior for computing the lead's currency will remain |
| 66 | +the same (currency is retrieved from the lead's company or the current |
| 67 | +user's company), but the issues are fixed: |
| 68 | + |
| 69 | +1) Changing a company's currency **will not change the currency on |
| 70 | + existing leads**, only on the ones created after the currency has |
| 71 | + been updated. Eg: |
| 72 | + |
| 73 | + - you have a lead linked to a company in EUR |
| 74 | + - the lead's expected revenue is 1000 EUR |
| 75 | + - you change the company currency to USD |
| 76 | + - the lead's expected revenue is still 1000 EUR |
| 77 | + - a newly created lead's expected revenue will be in USD, not EUR |
| 78 | + |
| 79 | +2) If a lead is not linked to a specific company, then 2 users that are |
| 80 | + logged in with 2 different companies and different currencies will |
| 81 | + see the **lead's amounts with the same currency** (computed from the |
| 82 | + company of the first user that triggers the recomputation). Eg: |
| 83 | + |
| 84 | + - you have a lead where the company is not set |
| 85 | + - accessing the lead with a 1st user whose main company is in EUR |
| 86 | + will display an expected revenue of 1000 EUR |
| 87 | + - accessing the lead with a 2nd user whose main company is in USD |
| 88 | + will display an expected revenue of 1000 EUR, because the currency |
| 89 | + was set from the previous user's company |
| 90 | + |
| 91 | +**Table of contents** |
| 92 | + |
| 93 | +.. contents:: |
| 94 | + :local: |
| 95 | + |
| 96 | +Bug Tracker |
| 97 | +=========== |
| 98 | + |
| 99 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/crm/issues>`_. |
| 100 | +In case of trouble, please check there if your issue has already been reported. |
| 101 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 102 | +`feedback <https://github.com/OCA/crm/issues/new?body=module:%20crm_lead_company_currency_fix%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 103 | + |
| 104 | +Do not contact contributors directly about support or help with technical issues. |
| 105 | + |
| 106 | +Credits |
| 107 | +======= |
| 108 | + |
| 109 | +Authors |
| 110 | +------- |
| 111 | + |
| 112 | +* Camptocamp |
| 113 | + |
| 114 | +Contributors |
| 115 | +------------ |
| 116 | + |
| 117 | +- Silvio Gregorini <silviogregorini@camptocamp.com> (`Camptocamp |
| 118 | + SA <https://www.camptocamp.com/>`__) |
| 119 | + |
| 120 | +Maintainers |
| 121 | +----------- |
| 122 | + |
| 123 | +This module is maintained by the OCA. |
| 124 | + |
| 125 | +.. image:: https://odoo-community.org/logo.png |
| 126 | + :alt: Odoo Community Association |
| 127 | + :target: https://odoo-community.org |
| 128 | + |
| 129 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 130 | +mission is to support the collaborative development of Odoo features and |
| 131 | +promote its widespread use. |
| 132 | + |
| 133 | +This module is part of the `OCA/crm <https://github.com/OCA/crm/tree/19.0/crm_lead_company_currency_fix>`_ project on GitHub. |
| 134 | + |
| 135 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments