From 6081b4b3d25f84c636d37f4d419045bd8dce05b4 Mon Sep 17 00:00:00 2001 From: Duc Dao Date: Sun, 24 Jun 2018 11:21:24 +0700 Subject: [PATCH 01/37] [ADD] Add module account_invoice_change_currency [UPD] Update account_invoice_change_currency.pot --- account_invoice_change_currency/README.rst | 59 ++++++++++++ account_invoice_change_currency/__init__.py | 4 + .../__manifest__.py | 20 ++++ .../i18n/account_invoice_change_currency.pot | 96 +++++++++++++++++++ .../tests/__init__.py | 4 + .../test_account_invoice_change_currency.py | 94 ++++++++++++++++++ .../views/account_invoice.xml | 28 ++++++ .../wizard/__init__.py | 4 + .../wizard/wizard_change_invoice_currency.py | 35 +++++++ .../wizard/wizard_change_invoice_currency.xml | 31 ++++++ 10 files changed, 375 insertions(+) create mode 100644 account_invoice_change_currency/README.rst create mode 100644 account_invoice_change_currency/__init__.py create mode 100644 account_invoice_change_currency/__manifest__.py create mode 100644 account_invoice_change_currency/i18n/account_invoice_change_currency.pot create mode 100644 account_invoice_change_currency/tests/__init__.py create mode 100644 account_invoice_change_currency/tests/test_account_invoice_change_currency.py create mode 100644 account_invoice_change_currency/views/account_invoice.xml create mode 100644 account_invoice_change_currency/wizard/__init__.py create mode 100644 account_invoice_change_currency/wizard/wizard_change_invoice_currency.py create mode 100644 account_invoice_change_currency/wizard/wizard_change_invoice_currency.xml diff --git a/account_invoice_change_currency/README.rst b/account_invoice_change_currency/README.rst new file mode 100644 index 00000000000..f95a428932b --- /dev/null +++ b/account_invoice_change_currency/README.rst @@ -0,0 +1,59 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +================================== +Update currency of Account Invoice +================================== + +This module allows users to update the currency of Invoices (in draft state) by wizard. +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 + +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 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Duc, Dao Dong (https://komit-consulting.com) + + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/account_invoice_change_currency/__init__.py b/account_invoice_change_currency/__init__.py new file mode 100644 index 00000000000..156c6a2951c --- /dev/null +++ b/account_invoice_change_currency/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Komit +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import wizard diff --git a/account_invoice_change_currency/__manifest__.py b/account_invoice_change_currency/__manifest__.py new file mode 100644 index 00000000000..03eae9ac6da --- /dev/null +++ b/account_invoice_change_currency/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Komit +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + 'name': 'Account Invoice - Change Currency', + 'version': '10.0.1.0.0', + 'category': 'Accounting & Finance', + 'summary': 'Allows to change currency of Invoice by wizard', + 'author': 'Komit Consulting, Odoo Community Association (OCA)', + 'website': 'https://komit-consulting.com', + 'license': 'AGPL-3', + 'depends': [ + 'account', + ], + 'data': [ + 'wizard/wizard_change_invoice_currency.xml', + 'views/account_invoice.xml', + ], + "installable": True +} diff --git a/account_invoice_change_currency/i18n/account_invoice_change_currency.pot b/account_invoice_change_currency/i18n/account_invoice_change_currency.pot new file mode 100644 index 00000000000..7db1f652f26 --- /dev/null +++ b/account_invoice_change_currency/i18n/account_invoice_change_currency.pot @@ -0,0 +1,96 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_change_currency +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.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: account_invoice_change_currency +#: model:ir.ui.view,arch_db:account_invoice_change_currency.wizard_change_currency_form_view +msgid "Cancel" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.ui.view,arch_db:account_invoice_change_currency.wizard_change_currency_form_view +msgid "Change" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.ui.view,arch_db:account_invoice_change_currency.wizard_change_currency_form_view +msgid "Change Currency" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.actions.act_window,name:account_invoice_change_currency.action_wizard_change_currency +msgid "Change currency of the Invoice" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,help:account_invoice_change_currency.field_wizard_change_invoice_currency_currency_id +msgid "Choose the currency you want to change" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_wizard_change_invoice_currency_create_uid +msgid "Created by" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_wizard_change_invoice_currency_create_date +msgid "Created on" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_wizard_change_invoice_currency_currency_id +msgid "Currency" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_wizard_change_invoice_currency_display_name +msgid "Display Name" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_wizard_change_invoice_currency_id +msgid "ID" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_wizard_change_invoice_currency___last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_wizard_change_invoice_currency_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_wizard_change_invoice_currency_write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "Update Currency" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.ui.view,arch_db:account_invoice_change_currency.wizard_change_currency_form_view +msgid "or" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model,name:account_invoice_change_currency.model_wizard_change_invoice_currency +msgid "wizard.change.invoice.currency" +msgstr "" + diff --git a/account_invoice_change_currency/tests/__init__.py b/account_invoice_change_currency/tests/__init__.py new file mode 100644 index 00000000000..8ee0512e02a --- /dev/null +++ b/account_invoice_change_currency/tests/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Komit +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import test_account_invoice_change_currency diff --git a/account_invoice_change_currency/tests/test_account_invoice_change_currency.py b/account_invoice_change_currency/tests/test_account_invoice_change_currency.py new file mode 100644 index 00000000000..9bd342a897c --- /dev/null +++ b/account_invoice_change_currency/tests/test_account_invoice_change_currency.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Komit +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import fields +import odoo.tests.common as common + + +class TestAccountInvoiceChangeCurrency(common.TransactionCase): + + def setUp(self): + super(TestAccountInvoiceChangeCurrency, self).setUp() + + # Needed to create invoice + self.account_type1 = self.env['account.account.type'].\ + create({'name': 'acc type test 1', + 'type': 'receivable', + 'include_initial_balance': True}) + self.account_type2 = self.env['account.account.type']. \ + create({'name': 'acc type test 2', + 'type': 'other', + 'include_initial_balance': True}) + self.account_account = self.env['account.account'].\ + create({'name': 'acc test', + 'code': 'X2020', + 'user_type_id': self.account_type1.id, + 'reconcile': True}) + self.account_account_line = self.env['account.account']. \ + create({'name': 'acc inv line test', + 'code': 'X2021', + 'user_type_id': self.account_type2.id, + 'reconcile': True}) + self.sequence = self.env['ir.sequence'].create( + {'name': 'Journal Sale', + 'prefix': 'SALE', 'padding': 6, + 'company_id': self.env.ref("base.main_company").id}) + self.account_journal_sale = self.env['account.journal']\ + .create({'name': 'Sale journal', + 'code': 'SALE', + 'type': 'sale', + 'sequence_id': self.sequence.id}) + self.product_1 = self.env['product.product'].create( + {'name': 'Product 1'}) + self.product_2 = self.env['product.product'].create( + {'name': 'Product 2'}) + self.analytic_account = self.env['account.analytic.account'].\ + create({'name': 'test account'}) + + def create_simple_invoice(self, date): + invoice_lines = [ + (0, 0, { + 'product_id': self.product_1.id, + 'quantity': 5.0, + 'price_unit': 142.0, + 'name': 'Product that cost 142', + 'account_id': self.account_account_line.id, + 'account_analytic_id': self.analytic_account.id, + }), + (0, 0, { + 'product_id': self.product_2.id, + 'quantity': 4.0, + 'price_unit': 213.0, + 'name': 'Product that cost 213', + 'account_id': self.account_account_line.id, + 'account_analytic_id': self.analytic_account.id, + }) + ] + invoice = self.env['account.invoice'].create({ + 'partner_id': 1, + 'account_id': self.account_account.id, + 'type': 'in_invoice', + 'journal_id': self.account_journal_sale.id, + 'date_invoice': date, + 'currency_id': self.env.ref('base.EUR').id, + 'invoice_line_ids': invoice_lines, + 'state': 'draft', + }) + + return invoice + + def test_change_invoice_currency(self): + inv = self.create_simple_invoice(fields.Date.today()) + before_curr = inv.currency_id + before_amount = inv.amount_total + after_curr = self.env.ref('base.USD') + wiz = self.env['wizard.change.invoice.currency'].\ + with_context(active_id=inv.id).create( + {'currency_id': after_curr.id}) + wiz.button_change_currency() + expected_value = before_curr.with_context(date=fields.Date.today()).\ + compute(before_amount, after_curr) + + self.assertEqual( + inv.amount_total, expected_value, + 'Total amount of invoice does not equal to expected value!!!') diff --git a/account_invoice_change_currency/views/account_invoice.xml b/account_invoice_change_currency/views/account_invoice.xml new file mode 100644 index 00000000000..a730d1b99d1 --- /dev/null +++ b/account_invoice_change_currency/views/account_invoice.xml @@ -0,0 +1,28 @@ + + + + + + account.invoice.form.inherit + account.invoice + + + + @@ -20,7 +22,9 @@ - diff --git a/account_invoice_change_currency/wizard/__init__.py b/account_invoice_change_currency/wizard/__init__.py deleted file mode 100644 index d87b00b8fac..00000000000 --- a/account_invoice_change_currency/wizard/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright 2017 Komit -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from . import wizard_change_invoice_currency diff --git a/account_invoice_change_currency/wizard/wizard_change_invoice_currency.py b/account_invoice_change_currency/wizard/wizard_change_invoice_currency.py deleted file mode 100644 index 5e14732b970..00000000000 --- a/account_invoice_change_currency/wizard/wizard_change_invoice_currency.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2018 Komit -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import api, models, fields, _ -from odoo.exceptions import UserError - - -class WizardChangeInvoiceCurrency(models.TransientModel): - - _name = 'wizard.change.invoice.currency' - _description = "Change Invoice Currency" - - currency_id = fields.Many2one( - comodel_name='res.currency', string='Currency', - help='Choose the currency you want to change', required=True) - - @api.multi - def button_change_currency(self): - self.ensure_one() - invoice = self.env['account.invoice'].browse( - self._context.get('active_id')) - if invoice and invoice.state not in ['draft', 'cancel']: - # To ensure that we can not change the currency if - # there already has some move lines - raise UserError(_("Invoice state must be in draft or cancelled " - "in order to change currency.")) - - if invoice and invoice.currency_id != self.currency_id: - from_currency = invoice.currency_id - - for line in invoice.invoice_line_ids: - line.price_unit = from_currency.with_context( - date=invoice.date_invoice).compute( - line.price_unit, self.currency_id) - - for tax in invoice.tax_line_ids: - tax.amount = from_currency.with_context( - date=invoice.date_invoice).compute( - tax.amount, self.currency_id) - - invoice.currency_id = self.currency_id - - return True diff --git a/account_invoice_change_currency/wizard/wizard_change_invoice_currency.xml b/account_invoice_change_currency/wizard/wizard_change_invoice_currency.xml deleted file mode 100644 index 71698060baf..00000000000 --- a/account_invoice_change_currency/wizard/wizard_change_invoice_currency.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - wizard.change.currency.form.view - wizard.change.invoice.currency - -
- - - - - -
-
-
-
-
- - - Change currency of the Invoice - wizard.change.invoice.currency - form - form - new - -
From 2e73259c3a032293143e84000ba732729fe67f81 Mon Sep 17 00:00:00 2001 From: Hugo Adan Date: Wed, 7 Nov 2018 15:32:04 +0000 Subject: [PATCH 06/37] [IMP]account_invoice_change_currency: Allow use a custom rate at convertion [IMP] account_invoice_change_currency: Allow set a a custom rate at currency conversion [UPD] README.rst [UPD] Update account_invoice_change_currency.pot --- account_invoice_change_currency/README.rst | 11 +- .../__manifest__.py | 1 + .../data/ir_server_actions.xml | 19 +++ .../data/message_subtype.xml | 7 + .../i18n/account_invoice_change_currency.pot | 24 +++ .../models/account_change_currency.py | 155 +++++++++++++++-- .../readme/DESCRIPTION.rst | 11 +- .../static/description/index.html | 10 +- .../test_account_invoice_change_currency.py | 161 ++++++++++++++++-- .../views/account_invoice.xml | 2 + 10 files changed, 374 insertions(+), 27 deletions(-) create mode 100644 account_invoice_change_currency/data/ir_server_actions.xml diff --git a/account_invoice_change_currency/README.rst b/account_invoice_change_currency/README.rst index 3785715abf0..c0031cf2a58 100644 --- a/account_invoice_change_currency/README.rst +++ b/account_invoice_change_currency/README.rst @@ -32,8 +32,15 @@ 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 +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** diff --git a/account_invoice_change_currency/__manifest__.py b/account_invoice_change_currency/__manifest__.py index e00d8582a78..44e90fc6f09 100644 --- a/account_invoice_change_currency/__manifest__.py +++ b/account_invoice_change_currency/__manifest__.py @@ -12,6 +12,7 @@ 'account', ], 'data': [ + 'data/ir_server_actions.xml', 'data/message_subtype.xml', 'views/account_invoice.xml', ], diff --git a/account_invoice_change_currency/data/ir_server_actions.xml b/account_invoice_change_currency/data/ir_server_actions.xml new file mode 100644 index 00000000000..5d3ebf44489 --- /dev/null +++ b/account_invoice_change_currency/data/ir_server_actions.xml @@ -0,0 +1,19 @@ + + + + Toggle custom force rate + + code + +for inv in records: + inv._toggle_forced_rate() + + + + + + + + diff --git a/account_invoice_change_currency/data/message_subtype.xml b/account_invoice_change_currency/data/message_subtype.xml index 5af3f7cf11f..7a1592d206e 100644 --- a/account_invoice_change_currency/data/message_subtype.xml +++ b/account_invoice_change_currency/data/message_subtype.xml @@ -7,4 +7,11 @@ Currency Updated + + Forced Rate + account.invoice + + + Forced Rate +
diff --git a/account_invoice_change_currency/i18n/account_invoice_change_currency.pot b/account_invoice_change_currency/i18n/account_invoice_change_currency.pot index a718332cd40..98dc907d9ef 100644 --- a/account_invoice_change_currency/i18n/account_invoice_change_currency.pot +++ b/account_invoice_change_currency/i18n/account_invoice_change_currency.pot @@ -19,6 +19,19 @@ msgstr "" msgid "Currency Updated" msgstr "" +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_invoice__custom_rate +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "Custom Rate" +msgstr "" + +#. module: account_invoice_change_currency +#: model:mail.message.subtype,description:account_invoice_change_currency.mt_force_rate +#: model:mail.message.subtype,name:account_invoice_change_currency.mt_force_rate +msgid "Forced Rate" +msgstr "" + #. module: account_invoice_change_currency #: model:ir.model,name:account_invoice_change_currency.model_account_invoice msgid "Invoice" @@ -30,3 +43,14 @@ msgstr "" msgid "Opened" msgstr "" +#. module: account_invoice_change_currency +#: model:ir.model.fields,help:account_invoice_change_currency.field_account_invoice__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.actions.server,name:account_invoice_change_currency.toggle_force_custom_rate_action +msgid "Toggle custom force rate" +msgstr "" + diff --git a/account_invoice_change_currency/models/account_change_currency.py b/account_invoice_change_currency/models/account_change_currency.py index 9ca38065e27..e8df6250b7c 100644 --- a/account_invoice_change_currency/models/account_change_currency.py +++ b/account_invoice_change_currency/models/account_change_currency.py @@ -1,32 +1,74 @@ # Copyright 2017-2018 Vauxoo # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo import fields, models, api +from odoo.tools import float_compare class AccountInvoice(models.Model): _inherit = 'account.invoice' + custom_rate = fields.Float( + digits=(12, 6), + default=1, + help="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") + + @api.model + def create(self, values): + invoice = super(AccountInvoice, self).create(values) + if self.env.context.get('force_rate'): + invoice._toggle_forced_rate() + invoice._onchange_currency_change_rate() + return invoice + @api.multi def action_account_change_currency(self): track = self.env['mail.tracking.value'] + precision = self.env['decimal.precision'].precision_get( + 'Payment Terms') today = fields.Date.today() for invoice in self.filtered(lambda x: x.state == 'draft'): from_currency = invoice.get_last_currency_id() - if not from_currency or from_currency == invoice.currency_id: + if not from_currency: continue + date_invoice = invoice.date_invoice or today ctx = {'company_id': invoice.company_id.id, - 'date': invoice.date_invoice or today} + 'date': date_invoice} currency = invoice.with_context(**ctx).currency_id - rate = self.env['res.currency'].with_context( - **ctx)._get_conversion_rate( + currency_skip = invoice.get_last_currency_id(True) + old_rate_currency, old_rate = invoice.get_last_rate() + new_rate = invoice.custom_rate + rate_skip = currency.with_context(**ctx)._get_conversion_rate( + currency_skip, currency, invoice.company_id, date_invoice) + if not invoice.custom_rate: + new_rate = rate_skip + if (old_rate_currency == currency and new_rate + and old_rate and float_compare( + new_rate, old_rate, precision_digits=precision) == 0): + if not invoice.custom_rate or old_rate == new_rate: + continue + new_rate = rate_skip + if float_compare( + new_rate, old_rate, precision_digits=precision) == 0: + continue + invoice.custom_rate = new_rate + if not old_rate_currency and currency_skip == currency: + continue + + rate = currency.with_context(**ctx)._get_conversion_rate( from_currency, currency, invoice.company_id, - invoice.date_invoice or today) + date_invoice) + if from_currency == currency and old_rate and new_rate != old_rate: + rate = new_rate / old_rate + if from_currency != currency: + rate = new_rate tracking_value_ids = [ [0, 0, track.create_tracking_values( currency, currency, 'currency_id', self.fields_get(['currency_id'])['currency_id'], 100)], [0, 0, track.create_tracking_values( - rate, rate, 'rate', + new_rate, new_rate, 'rate', currency.fields_get(['rate'])['rate'], 100)], ] self.message_post( @@ -37,11 +79,104 @@ def action_account_change_currency(self): for tax in invoice.tax_line_ids: tax.amount *= rate + @api.onchange('currency_id', 'date_invoice') + def _onchange_currency_change_rate(self): + state = self.get_force_rate_state() + if state.new_value_integer: + return + last_currency = self.get_last_currency_id() + if (last_currency == self.currency_id and + self.get_last_currency_id(True)): + last_currency = self.get_last_currency_id(True) + if last_currency == self.currency_id: + last_currency = self.get_last_rate()[0] + if not (self.currency_id and + last_currency) or self.currency_id == last_currency: + last_currency = self.company_currency_id + today = fields.Date.today() + ctx = {'company_id': self.company_id.id, + 'date': self.date_invoice or today} + self.custom_rate = last_currency.with_context( + **ctx)._get_conversion_rate( + last_currency, self.currency_id, self.company_id, + self.date_invoice or today) + @api.multi - def get_last_currency_id(self): + def get_last_currency_id(self, skip_update_currency=False): self.ensure_one() - last_value = self.env['mail.tracking.value'].sudo().search([ + subtype_id = self.env.ref( + 'account_invoice_change_currency.mt_currency_update') + subtype_create_id = self.env.ref('account.mt_invoice_created') + domain = [ ('mail_message_id', 'in', self.message_ids.ids), ('field', '=', 'currency_id'), - ], limit=1, order='write_date desc, id desc') - return self.currency_id.browse(last_value.old_value_integer) + ] + if skip_update_currency: + domain += [('mail_message_id.subtype_id', '!=', subtype_id.id)] + last_value = self.env['mail.tracking.value'].sudo().search( + domain, limit=1, order='write_date desc, id desc') + value = last_value.old_value_integer + if last_value.mail_message_id.subtype_id == subtype_create_id: + value = last_value.new_value_integer + return self.currency_id.browse(value) + + @api.multi + def get_last_rate(self): + self.ensure_one() + last_values = self.env['mail.tracking.value'].sudo().search([ + ('mail_message_id', 'in', self.message_ids.ids), + ('field', 'in', ['rate', 'currency_id']), + ], limit=2, order='write_date desc, id desc') + # if rate and currency come from same message_id + if (len(last_values) == 2 and last_values[0].mail_message_id == + last_values[1].mail_message_id): + currency_value, rate_value = sorted(last_values, + key=lambda r: r.field) + return (self.currency_id.browse(currency_value.old_value_integer), + rate_value.old_value_float) + return self.currency_id.browse(None), None + + @api.multi + def _toggle_forced_rate(self): + self.ensure_one() + state = self.get_force_rate_state() + if not state: + self._track_force_rate() + else: + force = not state.new_value_integer + self._track_force_rate(force) + + @api.multi + def get_force_rate_state(self): + self.ensure_one() + subtype_id = self.env.ref( + 'account_invoice_change_currency.mt_force_rate') + domain = [ + ('mail_message_id', 'in', self.message_ids.ids), + ('mail_message_id.subtype_id', '=', subtype_id.id), + ('field', '=', 'force_rate'), + ] + last_value = self.env['mail.tracking.value'].sudo().search( + domain, limit=1, order='write_date desc, id desc') + return last_value + + @api.multi + def _track_force_rate(self, force=True): + track = self.env['mail.tracking.value'] + force_rate_description = self.fields_get( + ['reconciled'])['reconciled'] + force_rate_description.update({'string': 'Force Rate'}) + tracking_value_ids = [ + [0, 0, track.create_tracking_values( + force, force, 'force_rate', + force_rate_description, 100)], + [0, 0, track.create_tracking_values( + self.currency_id, self.currency_id, 'currency_id', + self.fields_get(['currency_id'])['currency_id'], 100)], + [0, 0, track.create_tracking_values( + self.custom_rate, self.custom_rate, 'rate', + self.fields_get(['custom_rate'])['custom_rate'], 100)], + ] + self.message_post( + subtype='account_invoice_change_currency.mt_force_rate', + tracking_value_ids=tracking_value_ids) diff --git a/account_invoice_change_currency/readme/DESCRIPTION.rst b/account_invoice_change_currency/readme/DESCRIPTION.rst index b4a84bf215a..9eb898cc318 100644 --- a/account_invoice_change_currency/readme/DESCRIPTION.rst +++ b/account_invoice_change_currency/readme/DESCRIPTION.rst @@ -5,5 +5,12 @@ 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 +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. diff --git a/account_invoice_change_currency/static/description/index.html b/account_invoice_change_currency/static/description/index.html index 07facca6b60..20b850d84cc 100644 --- a/account_invoice_change_currency/static/description/index.html +++ b/account_invoice_change_currency/static/description/index.html @@ -375,8 +375,14 @@

Account Invoice - Change Currency

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

+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

    diff --git a/account_invoice_change_currency/tests/test_account_invoice_change_currency.py b/account_invoice_change_currency/tests/test_account_invoice_change_currency.py index 6a38779c399..5f7c9fac832 100644 --- a/account_invoice_change_currency/tests/test_account_invoice_change_currency.py +++ b/account_invoice_change_currency/tests/test_account_invoice_change_currency.py @@ -1,6 +1,7 @@ # Copyright 2018 Komit # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import fields +from odoo.tools import float_compare import odoo.tests.common as common @@ -9,6 +10,8 @@ class TestAccountInvoiceChangeCurrency(common.TransactionCase): def setUp(self): super(TestAccountInvoiceChangeCurrency, self).setUp() + self.precision = self.env['decimal.precision'].precision_get( + 'Payment Terms') res_users_account_manager = self.env.ref( 'account.group_account_manager') self.manager = self.env['res.users'].with_context({ @@ -60,7 +63,9 @@ def setUp(self): self.env.ref('account.data_account_type_current_assets').id)], limit=1) - def create_simple_invoice(self, date): + def create_simple_invoice(self, date=False, context=None, inv_type=None): + if not context: + context = {} invoice_lines = [ (0, 0, { 'product_id': self.product_1.id, @@ -79,16 +84,17 @@ def create_simple_invoice(self, date): 'account_analytic_id': self.analytic_account.id, }) ] - invoice = self.env['account.invoice'].sudo(self.manager).create({ - 'partner_id': 1, - 'account_id': self.account_account.id, - 'type': 'in_invoice', - 'journal_id': self.account_journal_sale.id, - 'date_invoice': date, - 'currency_id': self.env.ref('base.EUR').id, - 'invoice_line_ids': invoice_lines, - 'state': 'draft', - }) + invoice = self.env['account.invoice'].sudo(self.manager).with_context( + **context).create({ + 'partner_id': 1, + 'account_id': self.account_account.id, + 'type': inv_type or 'in_invoice', + 'journal_id': self.account_journal_sale.id, + 'date_invoice': date, + 'currency_id': self.env.ref('base.EUR').id, + 'invoice_line_ids': invoice_lines, + 'state': 'draft', + }) invoice_tax_line = { 'name': 'Test Tax for Customer Invoice', 'manual': 1, @@ -107,6 +113,7 @@ def test_change_invoice_currency(self): before_amount = inv.amount_total after_curr = self.env.ref('base.USD') inv.write({'currency_id': after_curr.id}) + inv._onchange_currency_change_rate() inv.action_account_change_currency() expected_value = before_curr._convert( before_amount, after_curr, inv.company_id, fields.Date.today()) @@ -121,7 +128,139 @@ def test_change_validated_invoice_currency(self): inv.action_invoice_open() # Make sure that we can not change the currency after validated: inv.write({'currency_id': self.env.ref('base.USD').id}) + inv._onchange_currency_change_rate() + inv.action_account_change_currency() + self.assertEqual( + inv.amount_total, before_amount, + 'Total amount of invoice does not equal to expected value!!!') + + def test_create_invoice_update_currency(self): + inv = self.create_simple_invoice() + before_amount = inv.amount_total + inv.action_account_change_currency() + self.assertEqual( + inv.amount_total, before_amount, + 'Amount must remain the same, because no currency changes') + + def test_custom_rate_update_currency(self): + inv = self.create_simple_invoice(fields.Date.today()) + before_amount = inv.amount_total + after_curr = self.env.ref('base.USD') + custom_rate = 1.13208 + inv.write({'currency_id': after_curr.id, 'custom_rate': custom_rate}) + inv._onchange_currency_change_rate() + inv.write({'custom_rate': custom_rate}) + inv.action_account_change_currency() + expected_value = before_amount * custom_rate + # TODO: Check float comparation, 12013.64 vs 12013.632959999999 + self.assertEqual( + float_compare(inv.amount_total, expected_value, self.precision), 1, + 'Total amount of invoice does not equal to expected value!!!') + + def test_custom_rate_zero_update_currency(self): + inv = self.create_simple_invoice() + before_amount = inv.amount_total + before_curr = inv.currency_id + custom_rate = 0.0 + usd = self.env.ref('base.USD') + eur = self.env.ref('base.EUR') + inv.write({'currency_id': usd.id, 'custom_rate': custom_rate}) + inv._onchange_currency_change_rate() + inv.write({'custom_rate': custom_rate}) + inv.action_account_change_currency() + expected_value = before_curr._convert( + before_amount, usd, inv.company_id, fields.Date.today()) + self.assertEqual( + inv.amount_total, expected_value, + 'Total amount of invoice does not equal to expected value!!!') + # Change currency and set custom rate 0 + inv.write({'currency_id': eur.id, 'custom_rate': custom_rate}) + inv._onchange_currency_change_rate() + inv.write({'custom_rate': custom_rate}) inv.action_account_change_currency() self.assertEqual( inv.amount_total, before_amount, 'Total amount of invoice does not equal to expected value!!!') + # Change Again custom rate with old_rate but now without new currency + inv.write({'custom_rate': inv.get_last_rate()[1]}) + inv.action_account_change_currency() + expected_value = before_curr._convert( + before_amount, eur, inv.company_id, fields.Date.today()) + self.assertEqual( + inv.amount_total, before_amount, + 'Total amount of invoice does not equal to expected value!!!') + # Custom rate with 0 but now without new currency + inv.write({'custom_rate': custom_rate}) + inv.action_account_change_currency() + expected_value = before_curr._convert( + before_amount, eur, inv.company_id, fields.Date.today()) + self.assertEqual( + inv.amount_total, before_amount, + 'Total amount of invoice does not equal to expected value!!!') + # keep old_rate but now we update the currency.rate + before_amount = inv.amount_total + old_rate = inv.get_last_rate()[1] + new_rate = 1.6299 + self.env['res.currency.rate'].create({ + 'name': fields.Date.today(), + 'rate': new_rate, + 'currency_id': usd.id, + 'company_id': inv.company_id.id, + }) + rate = usd._get_conversion_rate( + usd, inv.currency_id, inv.company_id, + inv.date_invoice or fields.Date.today()) + inv.write({'custom_rate': old_rate}) + inv.action_account_change_currency() + expected_value = before_amount * rate / old_rate + # TODO: Check float comparation, 9954.4 vs 9954.40628259402 + self.assertEqual(float_compare( + inv.amount_total, expected_value, self.precision), -1, + 'Total amount of invoice does not equal to expected value!!!') + # change custom rate then we trigger the conversion 2 times + # The currency.rate modification above will be ignored and keep the + # custom rate + before_amount = inv.amount_total + old_rate = inv.get_last_rate()[1] + rate = usd._get_conversion_rate( + usd, inv.currency_id, inv.company_id, + inv.date_invoice or fields.Date.today()) + inv.action_account_change_currency() + expected_value = before_amount * rate / old_rate + self.assertEqual(float_compare( + inv.amount_total, expected_value, self.precision), 0, + 'Total amount of invoice does not equal to expected value!!!') + before_amount = inv.amount_total + rate = old_rate + 1 + inv.write({'custom_rate': rate}) + inv.action_account_change_currency() + expected_value = before_amount * rate / old_rate + # TODO: Check float comparation, 26179.05 vs 26179.07656 + self.assertEqual(float_compare( + inv.amount_total, expected_value, self.precision), -1, + 'Total amount of invoice does not equal to expected value!!!') + inv.action_account_change_currency() + # TODO: Check float comparation, 26179.05 vs 26179.07656 + self.assertEqual(float_compare( + inv.amount_total, expected_value, self.precision), -1, + 'Total amount of invoice does not equal to expected value!!!') + + def test_force_custom_rate(self): + inv = self.create_simple_invoice(context={'force_rate': True}) + inv2 = self.create_simple_invoice() + self.assertNotEqual( + inv.custom_rate, inv2.custom_rate, + 'Rates must be different!') + inv._toggle_forced_rate() + inv._onchange_currency_change_rate() + self.assertEqual( + inv.custom_rate, inv2.custom_rate, + 'Amount must remain the same, because force rate was disable') + + def test_not_currency_change(self): + inv = self.create_simple_invoice(inv_type='out_invoice') + before_amount = inv.amount_total + inv.action_account_change_currency() + self.assertEqual( + inv.amount_total, before_amount, + 'Amount must remain the same, because None change was made') diff --git a/account_invoice_change_currency/views/account_invoice.xml b/account_invoice_change_currency/views/account_invoice.xml index ff6d76e1e54..cb54bef7ab8 100644 --- a/account_invoice_change_currency/views/account_invoice.xml +++ b/account_invoice_change_currency/views/account_invoice.xml @@ -9,6 +9,7 @@ + - @@ -22,6 +23,7 @@ + - From 10cd3b36d96f4984ecdc8d98c7a5a004fd922bfe Mon Sep 17 00:00:00 2001 From: "Hugo Adan [Vauxoo]" Date: Mon, 10 Dec 2018 17:49:36 -0600 Subject: [PATCH 07/37] [FIX] account_invoice_change_currency: the custom_rate field has a bad position in supplier invoices. (#458) --- .../views/account_invoice.xml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/account_invoice_change_currency/views/account_invoice.xml b/account_invoice_change_currency/views/account_invoice.xml index cb54bef7ab8..90633837099 100644 --- a/account_invoice_change_currency/views/account_invoice.xml +++ b/account_invoice_change_currency/views/account_invoice.xml @@ -22,11 +22,18 @@ account.invoice - - - - + + 1 + + + From ae4d350fc846876448724a9fc513fc16b62fb427 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 19 Dec 2018 22:34:24 +0000 Subject: [PATCH 08/37] Added translation using Weblate (Spanish) --- account_invoice_change_currency/i18n/es.po | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 account_invoice_change_currency/i18n/es.po diff --git a/account_invoice_change_currency/i18n/es.po b/account_invoice_change_currency/i18n/es.po new file mode 100644 index 00000000000..c85710bb8b7 --- /dev/null +++ b/account_invoice_change_currency/i18n/es.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_change_currency +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" + +#. module: account_invoice_change_currency +#: model:mail.message.subtype,description:account_invoice_change_currency.mt_currency_update +#: model:mail.message.subtype,name:account_invoice_change_currency.mt_currency_update +msgid "Currency Updated" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_invoice__custom_rate +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "Custom Rate" +msgstr "" + +#. module: account_invoice_change_currency +#: model:mail.message.subtype,description:account_invoice_change_currency.mt_force_rate +#: model:mail.message.subtype,name:account_invoice_change_currency.mt_force_rate +msgid "Forced Rate" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model,name:account_invoice_change_currency.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_invoice_change_currency +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "Opened" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,help:account_invoice_change_currency.field_account_invoice__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.actions.server,name:account_invoice_change_currency.toggle_force_custom_rate_action +msgid "Toggle custom force rate" +msgstr "" From b785648a8fcbf269f6df8c3c57b207357c6e5465 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 19 Dec 2018 23:33:39 +0000 Subject: [PATCH 09/37] Added translation using Weblate (Spanish (Mexico)) --- account_invoice_change_currency/i18n/es_MX.po | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 account_invoice_change_currency/i18n/es_MX.po diff --git a/account_invoice_change_currency/i18n/es_MX.po b/account_invoice_change_currency/i18n/es_MX.po new file mode 100644 index 00000000000..c8465e3bba2 --- /dev/null +++ b/account_invoice_change_currency/i18n/es_MX.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_change_currency +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es_MX\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" + +#. module: account_invoice_change_currency +#: model:mail.message.subtype,description:account_invoice_change_currency.mt_currency_update +#: model:mail.message.subtype,name:account_invoice_change_currency.mt_currency_update +msgid "Currency Updated" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_invoice__custom_rate +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "Custom Rate" +msgstr "" + +#. module: account_invoice_change_currency +#: model:mail.message.subtype,description:account_invoice_change_currency.mt_force_rate +#: model:mail.message.subtype,name:account_invoice_change_currency.mt_force_rate +msgid "Forced Rate" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model,name:account_invoice_change_currency.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_invoice_change_currency +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "Opened" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,help:account_invoice_change_currency.field_account_invoice__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.actions.server,name:account_invoice_change_currency.toggle_force_custom_rate_action +msgid "Toggle custom force rate" +msgstr "" From a290648c8c498cde0d6e291c62c33d67d637662a Mon Sep 17 00:00:00 2001 From: "Hugo Adan [Vauxoo]" Date: Mon, 7 Jan 2019 17:44:17 -0600 Subject: [PATCH 10/37] [FIX] Fixed performance problem when search tracking values by subtype (#470) id, instead search them by messages ids then filter them fix https://github.com/OCA/account-invoicing/issues/469 [REF] account_invoice_change_currency: Sql queries in order to improve performance [FIX] account_invoice_change_currency: Fixed tests --- .../models/account_change_currency.py | 28 ++++++++++++------- .../test_account_invoice_change_currency.py | 8 +++--- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/account_invoice_change_currency/models/account_change_currency.py b/account_invoice_change_currency/models/account_change_currency.py index e8df6250b7c..71452c72028 100644 --- a/account_invoice_change_currency/models/account_change_currency.py +++ b/account_invoice_change_currency/models/account_change_currency.py @@ -107,17 +107,25 @@ def get_last_currency_id(self, skip_update_currency=False): subtype_id = self.env.ref( 'account_invoice_change_currency.mt_currency_update') subtype_create_id = self.env.ref('account.mt_invoice_created') - domain = [ - ('mail_message_id', 'in', self.message_ids.ids), - ('field', '=', 'currency_id'), - ] + query = """ +SELECT mtv.old_value_integer, mtv.new_value_integer, mm.subtype_id +FROM mail_tracking_value as mtv INNER JOIN mail_message AS mm +ON mtv.mail_message_id = mm.id """ if skip_update_currency: - domain += [('mail_message_id.subtype_id', '!=', subtype_id.id)] - last_value = self.env['mail.tracking.value'].sudo().search( - domain, limit=1, order='write_date desc, id desc') - value = last_value.old_value_integer - if last_value.mail_message_id.subtype_id == subtype_create_id: - value = last_value.new_value_integer + query += " AND mm.subtype_id != %s " + params = (subtype_id.id, tuple(self.message_ids.ids)) + else: + params = (tuple(self.message_ids.ids), ) + query += """WHERE mtv.field = 'currency_id' AND +mtv.mail_message_id IN %s +ORDER BY mtv.write_date DESC, mtv.id DESC LIMIT 1""" + self.env.cr.execute(query, params) + res = self.env.cr.dictfetchone() + value = False + if res: + value = res['old_value_integer'] + if res['subtype_id'] == subtype_create_id.id: + value = res['new_value_integer'] return self.currency_id.browse(value) @api.multi diff --git a/account_invoice_change_currency/tests/test_account_invoice_change_currency.py b/account_invoice_change_currency/tests/test_account_invoice_change_currency.py index 5f7c9fac832..78199522eeb 100644 --- a/account_invoice_change_currency/tests/test_account_invoice_change_currency.py +++ b/account_invoice_change_currency/tests/test_account_invoice_change_currency.py @@ -119,7 +119,7 @@ def test_change_invoice_currency(self): before_amount, after_curr, inv.company_id, fields.Date.today()) self.assertEqual( - inv.amount_total, expected_value, + float_compare(inv.amount_total, expected_value, 1), 0, 'Total amount of invoice does not equal to expected value!!!') def test_change_validated_invoice_currency(self): @@ -171,7 +171,7 @@ def test_custom_rate_zero_update_currency(self): expected_value = before_curr._convert( before_amount, usd, inv.company_id, fields.Date.today()) self.assertEqual( - inv.amount_total, expected_value, + float_compare(inv.amount_total, expected_value, 1), 0, 'Total amount of invoice does not equal to expected value!!!') # Change currency and set custom rate 0 inv.write({'currency_id': eur.id, 'custom_rate': custom_rate}) @@ -237,12 +237,12 @@ def test_custom_rate_zero_update_currency(self): expected_value = before_amount * rate / old_rate # TODO: Check float comparation, 26179.05 vs 26179.07656 self.assertEqual(float_compare( - inv.amount_total, expected_value, self.precision), -1, + inv.amount_total, expected_value, 1), 0, 'Total amount of invoice does not equal to expected value!!!') inv.action_account_change_currency() # TODO: Check float comparation, 26179.05 vs 26179.07656 self.assertEqual(float_compare( - inv.amount_total, expected_value, self.precision), -1, + inv.amount_total, expected_value, 1), 0, 'Total amount of invoice does not equal to expected value!!!') def test_force_custom_rate(self): From 7e88edc95f6a6a5aacbf0bf74b6bc02e1dda95fb Mon Sep 17 00:00:00 2001 From: Hugo Adan Date: Fri, 11 Jan 2019 22:51:07 +0000 Subject: [PATCH 11/37] [FIX] account_invoice_change_currency: Failing when new invoice created, newid record not consider at onchange and get_last_currency method [UPD] Update account_invoice_change_currency.pot Update translation files Updated by Update PO files to match POT (msgmerge) hook in Weblate. --- .../i18n/account_invoice_change_currency.pot | 6 ++++++ account_invoice_change_currency/i18n/es.po | 16 +++++++++++++--- account_invoice_change_currency/i18n/es_MX.po | 16 +++++++++++++--- .../models/account_change_currency.py | 2 ++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/account_invoice_change_currency/i18n/account_invoice_change_currency.pot b/account_invoice_change_currency/i18n/account_invoice_change_currency.pot index 98dc907d9ef..5567eb1c1dc 100644 --- a/account_invoice_change_currency/i18n/account_invoice_change_currency.pot +++ b/account_invoice_change_currency/i18n/account_invoice_change_currency.pot @@ -13,6 +13,12 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: account_invoice_change_currency +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "" +msgstr "" + #. module: account_invoice_change_currency #: model:mail.message.subtype,description:account_invoice_change_currency.mt_currency_update #: model:mail.message.subtype,name:account_invoice_change_currency.mt_currency_update diff --git a/account_invoice_change_currency/i18n/es.po b/account_invoice_change_currency/i18n/es.po index c85710bb8b7..297f00fe8f1 100644 --- a/account_invoice_change_currency/i18n/es.po +++ b/account_invoice_change_currency/i18n/es.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_invoice_change_currency +# * account_invoice_change_currency # msgid "" msgstr "" @@ -14,6 +14,14 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +#. module: account_invoice_change_currency +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "" +"" +msgstr "" + #. module: account_invoice_change_currency #: model:mail.message.subtype,description:account_invoice_change_currency.mt_currency_update #: model:mail.message.subtype,name:account_invoice_change_currency.mt_currency_update @@ -46,8 +54,10 @@ msgstr "" #. module: account_invoice_change_currency #: model:ir.model.fields,help:account_invoice_change_currency.field_account_invoice__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" +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 diff --git a/account_invoice_change_currency/i18n/es_MX.po b/account_invoice_change_currency/i18n/es_MX.po index c8465e3bba2..6680178b863 100644 --- a/account_invoice_change_currency/i18n/es_MX.po +++ b/account_invoice_change_currency/i18n/es_MX.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_invoice_change_currency +# * account_invoice_change_currency # msgid "" msgstr "" @@ -14,6 +14,14 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +#. module: account_invoice_change_currency +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "" +"" +msgstr "" + #. module: account_invoice_change_currency #: model:mail.message.subtype,description:account_invoice_change_currency.mt_currency_update #: model:mail.message.subtype,name:account_invoice_change_currency.mt_currency_update @@ -46,8 +54,10 @@ msgstr "" #. module: account_invoice_change_currency #: model:ir.model.fields,help:account_invoice_change_currency.field_account_invoice__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" +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 diff --git a/account_invoice_change_currency/models/account_change_currency.py b/account_invoice_change_currency/models/account_change_currency.py index 71452c72028..833f3465449 100644 --- a/account_invoice_change_currency/models/account_change_currency.py +++ b/account_invoice_change_currency/models/account_change_currency.py @@ -104,6 +104,8 @@ def _onchange_currency_change_rate(self): @api.multi def get_last_currency_id(self, skip_update_currency=False): self.ensure_one() + if not self.id: + return self.currency_id subtype_id = self.env.ref( 'account_invoice_change_currency.mt_currency_update') subtype_create_id = self.env.ref('account.mt_invoice_created') From 64ea4d7d410b628aca7d651a77bddcae4fe08819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20V=C3=A1zquez=20Rodr=C3=ADguez?= Date: Mon, 4 Feb 2019 16:31:56 +0000 Subject: [PATCH 12/37] Translated using Weblate (Spanish) Currently translated at 25.0% (2 of 8 strings) Translation: account-invoicing-12.0/account-invoicing-12.0-account_invoice_change_currency Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_invoice_change_currency/es/ --- account_invoice_change_currency/i18n/es.po | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/account_invoice_change_currency/i18n/es.po b/account_invoice_change_currency/i18n/es.po index 297f00fe8f1..524dc9a48fa 100644 --- a/account_invoice_change_currency/i18n/es.po +++ b/account_invoice_change_currency/i18n/es.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2019-02-04 18:50+0000\n" +"Last-Translator: Marta Vázquez Rodríguez \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 3.4\n" #. module: account_invoice_change_currency #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit @@ -50,7 +52,7 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit msgid "Opened" -msgstr "" +msgstr "Abiertas" #. module: account_invoice_change_currency #: model:ir.model.fields,help:account_invoice_change_currency.field_account_invoice__custom_rate @@ -59,6 +61,9 @@ msgid "" ".This rate will be taken in order to convert amounts between the currency on " "the invoice and last currency" msgstr "" +"Establece una tarifa con una moneda nueva para aplicar en la factura. Esta " +"tasa se tomará para convertir cantidades entre la moneda de la factura y la " +"última moneda" #. module: account_invoice_change_currency #: model:ir.actions.server,name:account_invoice_change_currency.toggle_force_custom_rate_action From d82a4f30dee2d429b4e86f7ddd570cc1063052a3 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 3 Apr 2019 02:35:10 +0000 Subject: [PATCH 13/37] [ADD] icon.png --- .../static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 account_invoice_change_currency/static/description/icon.png diff --git a/account_invoice_change_currency/static/description/icon.png b/account_invoice_change_currency/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr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d@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 From 3b1438de185692aabf4c01c6cb2ba9453b296dc4 Mon Sep 17 00:00:00 2001 From: Katerina Katapodi Date: Sun, 5 May 2019 13:44:19 +0000 Subject: [PATCH 14/37] Translated using Weblate (Spanish) Currently translated at 87.5% (7 of 8 strings) Translation: account-invoicing-12.0/account-invoicing-12.0-account_invoice_change_currency Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_invoice_change_currency/es/ --- account_invoice_change_currency/i18n/es.po | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/account_invoice_change_currency/i18n/es.po b/account_invoice_change_currency/i18n/es.po index 524dc9a48fa..c93c89f4a2f 100644 --- a/account_invoice_change_currency/i18n/es.po +++ b/account_invoice_change_currency/i18n/es.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2019-02-04 18:50+0000\n" -"Last-Translator: Marta Vázquez Rodríguez \n" +"PO-Revision-Date: 2019-05-05 16:02+0000\n" +"Last-Translator: Katerina Katapodi \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 3.4\n" +"X-Generator: Weblate 3.5.1\n" #. module: account_invoice_change_currency #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit @@ -23,30 +23,32 @@ msgid "" "" msgstr "" +"" #. module: account_invoice_change_currency #: model:mail.message.subtype,description:account_invoice_change_currency.mt_currency_update #: model:mail.message.subtype,name:account_invoice_change_currency.mt_currency_update msgid "Currency Updated" -msgstr "" +msgstr "Moneda Actualizada" #. module: account_invoice_change_currency #: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_invoice__custom_rate #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit msgid "Custom Rate" -msgstr "" +msgstr "Tasa Personalizada" #. module: account_invoice_change_currency #: model:mail.message.subtype,description:account_invoice_change_currency.mt_force_rate #: model:mail.message.subtype,name:account_invoice_change_currency.mt_force_rate msgid "Forced Rate" -msgstr "" +msgstr "Tasa Obligatoria" #. module: account_invoice_change_currency #: model:ir.model,name:account_invoice_change_currency.model_account_invoice msgid "Invoice" -msgstr "" +msgstr "Factura" #. module: account_invoice_change_currency #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit From 35d23b78acfb64eebceb2f17f221f6a647fd427f Mon Sep 17 00:00:00 2001 From: Katerina Katapodi Date: Mon, 6 May 2019 17:56:23 +0000 Subject: [PATCH 15/37] Translated using Weblate (Spanish) Currently translated at 100.0% (8 of 8 strings) Translation: account-invoicing-12.0/account-invoicing-12.0-account_invoice_change_currency Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_invoice_change_currency/es/ --- account_invoice_change_currency/i18n/es.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_invoice_change_currency/i18n/es.po b/account_invoice_change_currency/i18n/es.po index c93c89f4a2f..e08707b6766 100644 --- a/account_invoice_change_currency/i18n/es.po +++ b/account_invoice_change_currency/i18n/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2019-05-05 16:02+0000\n" +"PO-Revision-Date: 2019-05-06 20:02+0000\n" "Last-Translator: Katerina Katapodi \n" "Language-Team: none\n" "Language: es\n" @@ -70,4 +70,4 @@ msgstr "" #. module: account_invoice_change_currency #: model:ir.actions.server,name:account_invoice_change_currency.toggle_force_custom_rate_action msgid "Toggle custom force rate" -msgstr "" +msgstr "Palanzar tasa obligatoria personalizada" From 47a476ed146f88132338f5ac907a29cce53f44ad Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Tue, 16 Jul 2019 10:30:43 +0000 Subject: [PATCH 16/37] Added translation using Weblate (German) --- account_invoice_change_currency/i18n/de.po | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 account_invoice_change_currency/i18n/de.po diff --git a/account_invoice_change_currency/i18n/de.po b/account_invoice_change_currency/i18n/de.po new file mode 100644 index 00000000000..902c2b76cd0 --- /dev/null +++ b/account_invoice_change_currency/i18n/de.po @@ -0,0 +1,62 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_change_currency +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: de\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" + +#. module: account_invoice_change_currency +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "" +msgstr "" + +#. module: account_invoice_change_currency +#: model:mail.message.subtype,description:account_invoice_change_currency.mt_currency_update +#: model:mail.message.subtype,name:account_invoice_change_currency.mt_currency_update +msgid "Currency Updated" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,field_description:account_invoice_change_currency.field_account_invoice__custom_rate +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "Custom Rate" +msgstr "" + +#. module: account_invoice_change_currency +#: model:mail.message.subtype,description:account_invoice_change_currency.mt_force_rate +#: model:mail.message.subtype,name:account_invoice_change_currency.mt_force_rate +msgid "Forced Rate" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model,name:account_invoice_change_currency.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_invoice_change_currency +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit +#: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit +msgid "Opened" +msgstr "" + +#. module: account_invoice_change_currency +#: model:ir.model.fields,help:account_invoice_change_currency.field_account_invoice__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.actions.server,name:account_invoice_change_currency.toggle_force_custom_rate_action +msgid "Toggle custom force rate" +msgstr "" From 7927d1d08efa31f5fad4b070213571f8a5c834d2 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Wed, 17 Jul 2019 10:21:28 +0000 Subject: [PATCH 17/37] Translated using Weblate (German) Currently translated at 12.5% (1 of 8 strings) Translation: account-invoicing-12.0/account-invoicing-12.0-account_invoice_change_currency Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_invoice_change_currency/de/ --- account_invoice_change_currency/i18n/de.po | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account_invoice_change_currency/i18n/de.po b/account_invoice_change_currency/i18n/de.po index 902c2b76cd0..c721e8d8e0d 100644 --- a/account_invoice_change_currency/i18n/de.po +++ b/account_invoice_change_currency/i18n/de.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2019-07-17 12:43+0000\n" +"Last-Translator: Maria Sparenberg \n" "Language-Team: none\n" "Language: de\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 3.7.1\n" #. module: account_invoice_change_currency #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit @@ -42,7 +44,7 @@ msgstr "" #. module: account_invoice_change_currency #: model:ir.model,name:account_invoice_change_currency.model_account_invoice msgid "Invoice" -msgstr "" +msgstr "Rechnung" #. module: account_invoice_change_currency #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit From 00a64b0784cc39f57328796209287118fbadd7eb Mon Sep 17 00:00:00 2001 From: Josep M Date: Mon, 22 Jul 2019 18:23:06 +0000 Subject: [PATCH 18/37] Translated using Weblate (Spanish) Currently translated at 100.0% (8 of 8 strings) Translation: account-invoicing-12.0/account-invoicing-12.0-account_invoice_change_currency Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_invoice_change_currency/es/ [UPD] README.rst --- account_invoice_change_currency/i18n/es.po | 22 +++++++++---------- .../static/description/index.html | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/account_invoice_change_currency/i18n/es.po b/account_invoice_change_currency/i18n/es.po index e08707b6766..b80f54d088b 100644 --- a/account_invoice_change_currency/i18n/es.po +++ b/account_invoice_change_currency/i18n/es.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2019-05-06 20:02+0000\n" -"Last-Translator: Katerina Katapodi \n" +"PO-Revision-Date: 2019-07-22 20:43+0000\n" +"Last-Translator: Josep M \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 3.5.1\n" +"X-Generator: Weblate 3.7.1\n" #. module: account_invoice_change_currency #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit @@ -23,8 +23,8 @@ msgid "" "" msgstr "" -"" +"" #. module: account_invoice_change_currency #: model:mail.message.subtype,description:account_invoice_change_currency.mt_currency_update @@ -37,13 +37,13 @@ msgstr "Moneda Actualizada" #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_form_inherit #: model_terms:ir.ui.view,arch_db:account_invoice_change_currency.account_invoice_supplier_form_inherit msgid "Custom Rate" -msgstr "Tasa Personalizada" +msgstr "Cambio Personalizado" #. module: account_invoice_change_currency #: model:mail.message.subtype,description:account_invoice_change_currency.mt_force_rate #: model:mail.message.subtype,name:account_invoice_change_currency.mt_force_rate msgid "Forced Rate" -msgstr "Tasa Obligatoria" +msgstr "Cambio Forzado" #. module: account_invoice_change_currency #: model:ir.model,name:account_invoice_change_currency.model_account_invoice @@ -63,11 +63,11 @@ msgid "" ".This rate will be taken in order to convert amounts between the currency on " "the invoice and last currency" msgstr "" -"Establece una tarifa con una moneda nueva para aplicar en la factura. Esta " -"tasa se tomará para convertir cantidades entre la moneda de la factura y la " -"última moneda" +"Establece el cambio de la nueva moneda para aplicar en la factura\n" +".Este cambio se usará para convertir las cantidades entre la moneda de la " +"factura y la última moneda" #. module: account_invoice_change_currency #: model:ir.actions.server,name:account_invoice_change_currency.toggle_force_custom_rate_action msgid "Toggle custom force rate" -msgstr "Palanzar tasa obligatoria personalizada" +msgstr "Activar/Desactivar forzar cambio personalizado" diff --git a/account_invoice_change_currency/static/description/index.html b/account_invoice_change_currency/static/description/index.html index 20b850d84cc..3d82fe4bd91 100644 --- a/account_invoice_change_currency/static/description/index.html +++ b/account_invoice_change_currency/static/description/index.html @@ -3,7 +3,7 @@ - + README.rst