Skip to content
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

[16.0][MIG] account_invoice_change_currency #1261

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6081b4b
[ADD] Add module account_invoice_change_currency
Jun 24, 2018
dd2c5c0
[MIG] account_invoice_change_currency: Migration to 11.0
Jun 28, 2018
5b2e01f
[12.0] account_invoice_change_currency migrate to v12.0
hugho-ad Oct 18, 2018
2e70b1b
[REF] Move change currency button to a better place inside the invoic…
hugho-ad Oct 24, 2018
73bd4a9
[IMP] Avoid open extra_view
hugho-ad Nov 5, 2018
2e73259
[IMP]account_invoice_change_currency: Allow use a custom rate at conv…
hugho-ad Nov 7, 2018
10cd3b3
[FIX] account_invoice_change_currency: the custom_rate field has a ba…
hugho-ad Dec 10, 2018
ae4d350
Added translation using Weblate (Spanish)
pedrobaeza Dec 19, 2018
b785648
Added translation using Weblate (Spanish (Mexico))
pedrobaeza Dec 19, 2018
a290648
[FIX] Fixed performance problem when search tracking values by subtyp…
hugho-ad Jan 7, 2019
7e88edc
[FIX] account_invoice_change_currency: Failing when new invoice
hugho-ad Jan 11, 2019
64ea4d7
Translated using Weblate (Spanish)
mvrodriguez Feb 4, 2019
d82a4f3
[ADD] icon.png
OCA-git-bot Apr 3, 2019
3b1438d
Translated using Weblate (Spanish)
BECJIE32 May 5, 2019
35d23b7
Translated using Weblate (Spanish)
BECJIE32 May 6, 2019
47a476e
Added translation using Weblate (German)
marylla Jul 16, 2019
7927d1d
Translated using Weblate (German)
marylla Jul 17, 2019
00a64b0
Translated using Weblate (Spanish)
josepmy Jul 22, 2019
3048f17
Translated using Weblate (German)
marylla Aug 23, 2019
239862d
[FIX] Check if 'tracking_disable' is in context
MiquelRForgeFlow Oct 9, 2019
3d562c5
[REF] account_invoice_change_currency: Fixed get rate at first currency
hugho-ad Mar 13, 2019
b0aa202
Added translation using Weblate (Croatian)
badbole Mar 5, 2020
9952e62
Translated using Weblate (Croatian)
badbole Mar 5, 2020
e766701
[FIX] account_invoice_change_currency: Rounding price_unit & tax amou…
hugho-ad May 26, 2020
77e09c5
account_invoice_change_currency 12.0.1.1.0
OCA-git-bot May 27, 2020
d26e3bf
Translated using Weblate (German)
marylla Jun 12, 2020
2e61b84
[IMP] account_invoice_change_currency: black, isort, prettier
Saran440 Aug 25, 2020
a1ae702
[13.0][MIG] account_invoice_change_currency
Saran440 Aug 25, 2020
8cdbe7c
[MIG] account_invoice_change_currency: Migration to 14.0
rolandojduartem Feb 2, 2022
22f9267
[MIG] account_invoice_change_currency: Migration to 15.0
rolandojduartem May 17, 2022
3b6a1b2
[UPD] README.rst
OCA-git-bot May 19, 2022
d2ae3be
[IMP] account_invoice_change_currency: Speed up module installation. …
rolandojduartem Jun 20, 2022
5834b1c
[UPD] Update account_invoice_change_currency.pot
Jun 29, 2022
5fb9cdc
Update translation files
oca-transbot Jun 29, 2022
db5e9aa
Added translation using Weblate (Catalan)
jabelchi Aug 9, 2022
8f2b793
Translated using Weblate (Catalan)
jabelchi Aug 9, 2022
3331af5
[MIG] account_invoice_change_currency: Migration to 16.0
ljsalvatierra-factorlibre Dec 21, 2022
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
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