Skip to content

Commit

Permalink
Merge PR #1261 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rafaelbn
  • Loading branch information
OCA-git-bot committed May 26, 2023
2 parents c372f3a + 3331af5 commit bbf5c7b
Show file tree
Hide file tree
Showing 25 changed files with 1,777 additions and 0 deletions.
116 changes: 116 additions & 0 deletions account_invoice_change_currency/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
=================================
Account Invoice - Change Currency
=================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/15.0/account_invoice_change_currency
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-15-0/account-invoicing-15-0-account_invoice_change_currency
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/95/15.0
:alt: Try me on Runbot

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

==================================
Update currency of Account Invoice
==================================

This module allows users to update the currency of Invoices (in draft state) by
a button Update Currency at the invoice form.
After update to new currency, all the unit prices of invoice lines will be
recomputed to new currency, thus the Total amounts (tax and without tax) of
Invoice will be in the new currency also

Also this module allows user to set a custom rate that will be take to recompute
all lines. By default the custom rate proposed is the rate between invoice
currency and base currency (company currency), after the first coversion the
custom rate will be proposed by default between last currency and invoice
currency.

**Table of contents**

.. contents::
:local:

Configuration
=============

The exchange rate will be configured in
Accounting > Configuration > Multi-Currencies > Currencies

Usage
=====

To use this module, the user must be in group Accounting & Finance / Adviser
to be able to update currency of Invoices

Note : you have to save new invoice before change currency

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_change_currency%0Aversion:%2015.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
~~~~~~~

* Vauxoo
* Komit Consulting

Contributors
~~~~~~~~~~~~

* Duc, Dao Dong <[email protected]> (https://komit-consulting.com)
* Hugo Adan <[email protected]>
* Saran Lim. <[email protected]>
* Rolando Duarte <[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-luisg123v| image:: https://github.com/luisg123v.png?size=40px
:target: https://github.com/luisg123v
:alt: luisg123v
.. |maintainer-rolandojduartem| image:: https://github.com/rolandojduartem.png?size=40px
:target: https://github.com/rolandojduartem
:alt: rolandojduartem

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

|maintainer-luisg123v| |maintainer-rolandojduartem|

This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/15.0/account_invoice_change_currency>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions account_invoice_change_currency/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2017 Komit <http://komit-consulting.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models
from .hooks import pre_init_hook
18 changes: 18 additions & 0 deletions account_invoice_change_currency/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2017 Komit <http://komit-consulting.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Account Invoice - Change Currency",
"version": "16.0.1.0.0",
"category": "Accounting & Finance",
"summary": "Allows to change currency of Invoice by wizard",
"author": "Vauxoo, Komit Consulting, Odoo Community Association (OCA)",
"maintainers": ["luisg123v", "rolandojduartem"],
"website": "https://github.com/OCA/account-invoicing",
"license": "AGPL-3",
"depends": ["account"],
"data": [
"views/account_move_views.xml",
],
"pre_init_hook": "pre_init_hook",
"installable": True,
}
29 changes: 29 additions & 0 deletions account_invoice_change_currency/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import logging

from odoo import tools

_logger = logging.getLogger(__name__)


def pre_init_hook(cr):
"""
Initializing column custom_rate on table account_move
for the improvement in performance to avoid long
duration in databases with thousand of moves
"""
_logger.info("Initializing column custom_rate on table account_move")
tools.create_column(
cr=cr,
tablename="account_move",
columnname="custom_rate",
columntype="numeric",
comment="Custom Rate",
)
cr.execute(
"""
UPDATE
account_move
SET
custom_rate = 1.0
"""
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_change_currency
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-11 06:39+0000\n"
"PO-Revision-Date: 2022-10-11 06:39+0000\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: account_invoice_change_currency
#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.view_move_form
msgid ""
"<i title=\"Update Currency: Will convert the amount lines to the new "
"currency set\" class=\"fa fa-fw fa-refresh\"/>"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_bank_statement_line__is_original_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_move__is_original_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_payment__is_original_currency
msgid ""
"Check if current currency is the original currency. This is used to hide "
"custom rate field in the form view."
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model,name:account_invoice_change_currency.model_res_currency
msgid "Currency"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_bank_statement_line__custom_rate
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_move__custom_rate
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_payment__custom_rate
#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.view_move_form
msgid "Custom Rate"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_bank_statement_line__is_original_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_move__is_original_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_payment__is_original_currency
msgid "Is Original Currency"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model,name:account_invoice_change_currency.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model,name:account_invoice_change_currency.model_account_move_line
msgid "Journal Item"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_bank_statement_line__original_currency_id
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_move__original_currency_id
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_payment__original_currency_id
msgid "Original Currency"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_move_line__original_price_unit
msgid "Original Price Unit"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_bank_statement_line__custom_rate
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_move__custom_rate
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_payment__custom_rate
msgid ""
"Set new currency rate to apply on the invoice.\n"
"This rate will be taken in order to convert amounts between the currency on the invoice and last currency"
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_move_line__original_price_unit
msgid ""
"Store price unit from every line when the invoice is created or the "
"conversion is called for the first time to use it to convert the amount in "
"the new currency."
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_bank_statement_line__original_currency_id
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_move__original_currency_id
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_payment__original_currency_id
msgid ""
"Store the original currency when the invoice is created or the conversion is"
" called for the first time. This is used to calculate conversion from this "
"currency."
msgstr ""

#. module: account_invoice_change_currency
#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.view_move_form
msgid "Update Currency"
msgstr ""
114 changes: 114 additions & 0 deletions account_invoice_change_currency/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_change_currency
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-08-09 10:06+0000\n"
"Last-Translator: jabelchi <[email protected]>\n"
"Language-Team: none\n"
"Language: ca\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.3.2\n"

#. module: account_invoice_change_currency
#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.view_move_form
msgid ""
"<i title=\"Update Currency: Will convert the amount lines to the new "
"currency set\" class=\"fa fa-fw fa-refresh\"/>"
msgstr ""
"<i title=\"Actualitza divisa: Convertirà l'import de les línies a la nova "
"divisa\" class=\"fa fa-fw fa-refresh\"/>"

#. module: account_invoice_change_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_bank_statement_line__is_original_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_move__is_original_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_payment__is_original_currency
msgid ""
"Check if current currency is the original currency. This is used to hide "
"custom rate field in the form view."
msgstr ""
"Comproveu si la divisa actual és la divisa original. Això es fa servir per a "
"ocultar el factor de conversió al formulari."

#. module: account_invoice_change_currency
#: model:ir.model,name:account_invoice_change_currency.model_res_currency
msgid "Currency"
msgstr "Divisa"

#. module: account_invoice_change_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_bank_statement_line__custom_rate
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_move__custom_rate
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_payment__custom_rate
#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.view_move_form
msgid "Custom Rate"
msgstr "Taxa de canvi"

#. module: account_invoice_change_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_bank_statement_line__is_original_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_move__is_original_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_payment__is_original_currency
msgid "Is Original Currency"
msgstr "És la divisa original"

#. module: account_invoice_change_currency
#: model:ir.model,name:account_invoice_change_currency.model_account_move
msgid "Journal Entry"
msgstr "Assentament comptable"

#. module: account_invoice_change_currency
#: model:ir.model,name:account_invoice_change_currency.model_account_move_line
msgid "Journal Item"
msgstr "Apunt comptable"

#. module: account_invoice_change_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_bank_statement_line__original_currency_id
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_move__original_currency_id
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_payment__original_currency_id
msgid "Original Currency"
msgstr "Divisa original"

#. module: account_invoice_change_currency
#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_move_line__original_price_unit
msgid "Original Price Unit"
msgstr "Preu unitari original"

#. module: account_invoice_change_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_bank_statement_line__custom_rate
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_move__custom_rate
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_payment__custom_rate
msgid ""
"Set new currency rate to apply on the invoice.\n"
"This rate will be taken in order to convert amounts between the currency on the invoice and last currency"
msgstr ""
"Estableix nova taxa de canvi a aplicar a la factura.\n"
"Aquesta taxa es farà servir per a convertir imports entre la divisa de la "
"factura i la darrera divisa"

#. module: account_invoice_change_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_move_line__original_price_unit
msgid ""
"Store price unit from every line when the invoice is created or the "
"conversion is called for the first time to use it to convert the amount in "
"the new currency."
msgstr ""

#. module: account_invoice_change_currency
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_bank_statement_line__original_currency_id
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_move__original_currency_id
#: model:ir.model.fields,help:account_invoice_change_currency.field_account_payment__original_currency_id
msgid ""
"Store the original currency when the invoice is created or the conversion is"
" called for the first time. This is used to calculate conversion from this "
"currency."
msgstr ""

#. module: account_invoice_change_currency
#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.view_move_form
msgid "Update Currency"
msgstr "Actualitzar divisa"
Loading

0 comments on commit bbf5c7b

Please sign in to comment.