Skip to content

Commit

Permalink
Merge fbc405b into dffa153
Browse files Browse the repository at this point in the history
  • Loading branch information
i-vyshnevska committed Apr 3, 2019
2 parents dffa153 + fbc405b commit 6c8ffb3
Show file tree
Hide file tree
Showing 20 changed files with 796 additions and 39 deletions.
1 change: 0 additions & 1 deletion account_multicurrency_revaluation/model/__init__.py
@@ -1,4 +1,3 @@
from . import res_company
from . import account
from . import res_currency
from . import res_config
32 changes: 0 additions & 32 deletions account_multicurrency_revaluation/model/res_currency.py

This file was deleted.

Expand Up @@ -8,6 +8,8 @@


class TestCurrencyRevaluation(TransactionCase):
# Todo update cases and logic to v12
# see https://github.com/OCA/account-closing/pull/88

def test_uk_revaluation(self):
# Set accounts on company
Expand Down
Expand Up @@ -68,19 +68,15 @@ def _compute_unrealized_currency_gl(self, currency_id, balances, form):
ctx_rate['date'] = form.revaluation_date
cp_currency = form.journal_id.company_id.currency_id

currency = currency_obj.browse(currency_id)
currency = currency_obj.browse(currency_id).with_context(ctx_rate)

foreign_balance = adjusted_balance = balances.get(
'foreign_balance', 0.0)
balance = balances.get('balance', 0.0)
unrealized_gain_loss = 0.0
if foreign_balance:
ctx_rate['revaluation'] = True
adjusted_balance = currency.with_context(ctx_rate).compute(
foreign_balance, cp_currency
)
adjusted_balance = currency.compute(foreign_balance, cp_currency)
unrealized_gain_loss = adjusted_balance - balance
# revaluated_balance = balance + unrealized_gain_loss
else:
if balance:
if currency_id != cp_currency.id:
Expand Down
75 changes: 75 additions & 0 deletions account_multicurrency_revaluation_rate_type/README.rst
@@ -0,0 +1,75 @@
=====================================================
Multicurrency revaluation with monthly currency rates
=====================================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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--closing-lightgray.png?logo=github
:target: https://github.com/OCA/account-closing/tree/10.0/account_multicurrency_revaluation_rate_type
:alt: OCA/account-closing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-closing-10-0/account-closing-10-0-account_multicurrency_revaluation_rate_type
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/89/10.0
:alt: Try me on Runbot

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

This addon add possibility to choose in which currency type reevaluation would be
made. It extends account_multicurrency_revaluation behaviour to use month currency rates

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-closing/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-closing/issues/new?body=module:%20account_multicurrency_revaluation_rate_type%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Camptocamp

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

* Frederic Clementi <frederic.clementi@camptocamp.com>
* Iryna Vyshnevska <i.vyshnevska@mobilunity.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/account-closing <https://github.com/OCA/account-closing/tree/10.0/account_multicurrency_revaluation_rate_type>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions account_multicurrency_revaluation_rate_type/__init__.py
@@ -0,0 +1,2 @@
from . import model
from . import wizard
20 changes: 20 additions & 0 deletions account_multicurrency_revaluation_rate_type/__manifest__.py
@@ -0,0 +1,20 @@
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Multicurrency revaluation with monthly currency rates",
"version": "10.0.1.0.1",
"category": "Finance",
"summary": "Use monthly currency rate for multicurrency revaluation",
"author": "Camptocamp,Odoo Community Association (OCA)",
"license": 'AGPL-3',
"depends": [
"account_multicurrency_revaluation",
"currency_monthly_rate",
],
"data": [
"views/res_config_view.xml",
"wizard/wizard_currency_revaluation_view.xml",
],
'installable': True,
}
3 changes: 3 additions & 0 deletions account_multicurrency_revaluation_rate_type/model/__init__.py
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import res_company
from . import res_config
16 changes: 16 additions & 0 deletions account_multicurrency_revaluation_rate_type/model/res_company.py
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields


class ResCompany(models.Model):
_inherit = "res.company"

revaluation_rate_type = fields.Selection(
string="Rate type", selection=[
('average', 'Average'),
('daily', 'Daily'),
],
default='daily')
17 changes: 17 additions & 0 deletions account_multicurrency_revaluation_rate_type/model/res_config.py
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields


class AccountConfigSettings(models.TransientModel):
_inherit = 'account.config.settings'

revaluation_rate_type = fields.Selection(
related='company_id.revaluation_rate_type',
string='Rate type *',
help="Revaluations entries will be created "
"as \"To Be Reversed\".",
readonly=False,
)
@@ -0,0 +1,2 @@
* Frederic Clementi <frederic.clementi@camptocamp.com>
* Iryna Vyshnevska <i.vyshnevska@mobilunity.com>
@@ -0,0 +1,2 @@
This addon add possibility to choose in which currency type reevaluation would be
made. It extends account_multicurrency_revaluation behaviour to use month currency rates

0 comments on commit 6c8ffb3

Please sign in to comment.