Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions crm_multicompany_reporting_currency/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===================================
CRM Multicompany Reporting Currency
===================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:78bf368fdccb7c191b50fbb1ab671d9a9b703eaebdcdcf4333234269de2d92d0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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%2Fcrm-lightgray.png?logo=github
:target: https://github.com/OCA/crm/tree/19.0/crm_multicompany_reporting_currency
:alt: OCA/crm
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/crm-19-0/crm-19-0-crm_multicompany_reporting_currency
: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=19.0
:alt: Try me on Runboat

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

This Module adds Amount in multicompany reporting currency to CRM Lead
which can be used as a reporting tool. You can then compare Expected
Revenue in company currency to amount in multicompany reporting
currency. Multicompany reporting currency is installed from dependent
https://github.com/OCA/sale-reporting/tree/19.0/base_multicompany_reporting_currency
module.

**Table of contents**

.. contents::
:local:

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_multicompany_reporting_currency%0Aversion:%2019.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
-------

* Camptocamp

Contributors
------------

- [Camptocamp SA](https://www.camptocamp.com):

- Maksym Yankin <maksym.yankin@camptocamp.com>
- Silvio Gregorini <silvio.gregorini@camptocamp.com>

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-yankinmax| image:: https://github.com/yankinmax.png?size=40px
:target: https://github.com/yankinmax
:alt: yankinmax

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-yankinmax|

This module is part of the `OCA/crm <https://github.com/OCA/crm/tree/19.0/crm_multicompany_reporting_currency>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions crm_multicompany_reporting_currency/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions crm_multicompany_reporting_currency/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "CRM Multicompany Reporting Currency",
"summary": "Adds Amount in multicompany reporting currency to CRM Lead",
"version": "19.0.1.0.0",
"category": "Sales",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
# OCA/crm
"crm_lead_company_currency_fix",
# OCA/sale-reporting
"base_multicompany_reporting_currency",
],
"website": "https://github.com/OCA/crm",
"data": [
# Views
"views/crm_lead.xml"
],
"installable": True,
"maintainers": ["yankinmax"],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_multicompany_reporting_currency
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__amount_multicompany_reporting_currency
msgid "Amount Multicompany Reporting Currency"
msgstr ""

#. module: crm_multicompany_reporting_currency
#: model:ir.model,name:crm_multicompany_reporting_currency.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__currency_rate
msgid "Currency Rate"
msgstr ""

#. module: crm_multicompany_reporting_currency
#: model:ir.model,name:crm_multicompany_reporting_currency.model_crm_lead
msgid "Lead/Opportunity"
msgstr ""

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__multicompany_reporting_currency_id
msgid "Multicompany Reporting Currency"
msgstr ""

#. module: crm_multicompany_reporting_currency
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_case_tree_view_oppor
msgid "Total"
msgstr ""

#. module: crm_multicompany_reporting_currency
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_case_tree_view_oppor
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_lead_view_form
msgid "Total (Multicompany Reporting Currency)"
msgstr ""
53 changes: 53 additions & 0 deletions crm_multicompany_reporting_currency/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_multicompany_reporting_currency
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-09-26 14:18+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__amount_multicompany_reporting_currency
msgid "Amount Multicompany Reporting Currency"
msgstr "Importe Divisa de referencia multicompañía"

#. module: crm_multicompany_reporting_currency
#: model:ir.model,name:crm_multicompany_reporting_currency.model_res_config_settings
msgid "Config Settings"
msgstr "Configuración de Ajustes"

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__currency_rate
msgid "Currency Rate"
msgstr "Tipo de divisa"

#. module: crm_multicompany_reporting_currency
#: model:ir.model,name:crm_multicompany_reporting_currency.model_crm_lead
msgid "Lead/Opportunity"
msgstr "Iniciativa/Oportundad"

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__multicompany_reporting_currency_id
msgid "Multicompany Reporting Currency"
msgstr "Divisa de referencia de varias compañías"

#. module: crm_multicompany_reporting_currency
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_case_tree_view_oppor
msgid "Total"
msgstr "Total"

#. module: crm_multicompany_reporting_currency
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_case_tree_view_oppor
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_lead_view_form
msgid "Total (Multicompany Reporting Currency)"
msgstr "Total (divisa de referencia de varias compañías)"
53 changes: 53 additions & 0 deletions crm_multicompany_reporting_currency/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_multicompany_reporting_currency
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-13 12:36+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__amount_multicompany_reporting_currency
msgid "Amount Multicompany Reporting Currency"
msgstr "Valuta resoconto valore multiazienda"

#. module: crm_multicompany_reporting_currency
#: model:ir.model,name:crm_multicompany_reporting_currency.model_res_config_settings
msgid "Config Settings"
msgstr "Impostazioni configurazione"

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__currency_rate
msgid "Currency Rate"
msgstr "Tasso di cambio"

#. module: crm_multicompany_reporting_currency
#: model:ir.model,name:crm_multicompany_reporting_currency.model_crm_lead
msgid "Lead/Opportunity"
msgstr "Contatto/Opportunità"

#. module: crm_multicompany_reporting_currency
#: model:ir.model.fields,field_description:crm_multicompany_reporting_currency.field_crm_lead__multicompany_reporting_currency_id
msgid "Multicompany Reporting Currency"
msgstr "Valuta resoconto multi azienda"

#. module: crm_multicompany_reporting_currency
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_case_tree_view_oppor
msgid "Total"
msgstr "Totale"

#. module: crm_multicompany_reporting_currency
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_case_tree_view_oppor
#: model_terms:ir.ui.view,arch_db:crm_multicompany_reporting_currency.crm_lead_view_form
msgid "Total (Multicompany Reporting Currency)"
msgstr "Totale (valuta resoconto multi azienda)"
1 change: 1 addition & 0 deletions crm_multicompany_reporting_currency/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import crm_lead
40 changes: 40 additions & 0 deletions crm_multicompany_reporting_currency/models/crm_lead.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import api, fields, models


class CrmLead(models.Model):
_name = "crm.lead"
_inherit = ["crm.lead", "multicompany.reporting.currency.mixin"]

amount_multicompany_reporting_currency = fields.Monetary(
currency_field="multicompany_reporting_currency_id",
compute="_compute_amount_multicompany_reporting_currency",
store=True,
)

@api.depends(
"create_date",
"expected_revenue",
# Dependency on ``crm_lead_company_currency_fix`` grants this field is stored
"company_currency",
# Inherited from ``multicompany.reporting.currency.mixin``
"multicompany_reporting_currency_id",
)
def _compute_amount_multicompany_reporting_currency(self):
for lead in self:
amount = lead.expected_revenue
from_curr = lead.company_currency
to_curr = lead.multicompany_reporting_currency_id
if from_curr != to_curr:
amount = from_curr._convert(
from_amount=amount,
to_currency=to_curr,
# Let ``res.currency._convert()`` handle company and date if empty
company=lead.company_id or None,
date=lead.create_date or None,
# Leave roundings to field's ``convert_to_[cache|column_insert]()``
round=False,
)
lead.amount_multicompany_reporting_currency = amount
3 changes: 3 additions & 0 deletions crm_multicompany_reporting_currency/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions crm_multicompany_reporting_currency/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- \[Camptocamp SA\](<https://www.camptocamp.com>):
- Maksym Yankin \<<maksym.yankin@camptocamp.com>\>
- Silvio Gregorini \<<silvio.gregorini@camptocamp.com>\>
6 changes: 6 additions & 0 deletions crm_multicompany_reporting_currency/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This Module adds Amount in multicompany reporting currency to CRM Lead
which can be used as a reporting tool. You can then compare Expected
Revenue in company currency to amount in multicompany reporting
currency. Multicompany reporting currency is installed from dependent
<https://github.com/OCA/sale-reporting/tree/19.0/base_multicompany_reporting_currency>
module.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading