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_multicurrency_revaluation (good branch) #263

Merged

Conversation

MiquelRForgeFlow
Copy link
Contributor

Supersedes #250, in order to include last commits from #259.

hbto and others added 30 commits September 13, 2023 10:21
- getting rid of validation because rate will always be at least '1.0' because
of (res.currency)_get_rates query

- create just one Journal Entry per Currency Revaluation run depending the
account type
Currently translated at 98.8% (80 of 81 strings)

Translation: account-closing-12.0/account-closing-12.0-account_multicurrency_revaluation
Translate-URL: https://translation.odoo-community.org/projects/account-closing-12-0/account-closing-12-0-account_multicurrency_revaluation/es/
Currently translated at 100.0% (81 of 81 strings)

Translation: account-closing-12.0/account-closing-12.0-account_multicurrency_revaluation
Translate-URL: https://translation.odoo-community.org/projects/account-closing-12-0/account-closing-12-0-account_multicurrency_revaluation/es/
The override of res.currency _get_conversion_rate did return 1.0 / from_currency.rate
when 'revaluation' was True in context.
However, as res.currency.rate is defined per company and the context is only
used for a computation to the company currency, the std method from odoo will also
return 1.0 / from_currency.rate, because to_currency is the company currency.
(https://github.com/odoo/odoo/blob/11.0/odoo/addons/base/res/res_currency.py#L179)
Therefore, we do not need this override.
This line was already commented in v7.0, so we do not need to keep it across all versions
Currently translated at 100.0% (81 of 81 strings)

Translation: account-closing-12.0/account-closing-12.0-account_multicurrency_revaluation
Translate-URL: https://translation.odoo-community.org/projects/account-closing-12-0/account-closing-12-0-account_multicurrency_revaluation/fr/
Currently translated at 100.0% (80 of 80 strings)

Translation: account-closing-13.0/account-closing-13.0-account_multicurrency_revaluation
Translate-URL: https://translation.odoo-community.org/projects/account-closing-13-0/account-closing-13-0-account_multicurrency_revaluation/es_AR/
Currently translated at 7.5% (6 of 80 strings)

Translation: account-closing-13.0/account-closing-13.0-account_multicurrency_revaluation
Translate-URL: https://translation.odoo-community.org/projects/account-closing-13-0/account-closing-13-0-account_multicurrency_revaluation/zh_CN/
Currently translated at 100.0% (82 of 82 strings)

Translation: account-closing-13.0/account-closing-13.0-account_multicurrency_revaluation
Translate-URL: https://translation.odoo-community.org/projects/account-closing-13-0/account-closing-13-0-account_multicurrency_revaluation/es_AR/
* Odoo 14.0 changes that impact this module are in below commit.
    * odoo/odoo@caeb782
    * `process_reconciliation` has been changed to `reconcile`, and
      `balance` (positive for debit > credit) is used instead of debit+credit;
    * Bank Journal should have suspense account.
Currently translated at 4.8% (4 of 82 strings)

Translation: account-closing-15.0/account-closing-15.0-account_multicurrency_revaluation
Translate-URL: https://translation.odoo-community.org/projects/account-closing-15-0/account-closing-15-0-account_multicurrency_revaluation/it/
Currently translated at 4.8% (4 of 82 strings)

Translation: account-closing-15.0/account-closing-15.0-account_multicurrency_revaluation
Translate-URL: https://translation.odoo-community.org/projects/account-closing-15-0/account-closing-15-0-account_multicurrency_revaluation/it/
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 16.0-mig-account_multicurrency_revaluation branch 2 times, most recently from 979933b to 49abaf3 Compare September 13, 2023 09:29
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 16.0-mig-account_multicurrency_revaluation branch from 49abaf3 to 1beb4c3 Compare September 13, 2023 09:37
Copy link
Contributor

@GuillemCForgeFlow GuillemCForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍🏽

Copy link

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing the tests?

@MiquelRForgeFlow
Copy link
Contributor Author

MiquelRForgeFlow commented Sep 13, 2023

Why changing the tests?

It's a partial revert of 084fd02. It has to do with Odoo and how it handles things and reconciliation, I won't try to fully analyze why.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@AaronHForgeFlow
Copy link

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-263-by-AaronHForgeFlow-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit b3e5026 into OCA:16.0 Nov 7, 2023
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at c47ae67. Thanks a lot for contributing to OCA. ❤️

@MiquelRForgeFlow MiquelRForgeFlow deleted the 16.0-mig-account_multicurrency_revaluation branch November 7, 2023 14:53
@lk-eska
Copy link

lk-eska commented Nov 9, 2023

is it only me who is getting this error:

Traceback (most recent call last):
File "/opt/odoo/odoo/http.py", line 1589, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/opt/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/opt/odoo/odoo/http.py", line 1616, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/opt/odoo/odoo/http.py", line 1820, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/opt/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "/opt/odoo/odoo/http.py", line 697, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/opt/odoo/addons/web/controllers/dataset.py", line 46, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/opt/odoo/addons/web/controllers/dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/opt/odoo/odoo/api.py", line 466, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/opt/odoo/odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/mnt/data/odoo-addons-dir/account_multicurrency_revaluation/wizard/wizard_currency_revaluation.py", line 330, in revaluate_currency
revaluations = account_ids.compute_revaluations(
File "/mnt/data/odoo-addons-dir/account_multicurrency_revaluation/model/account.py", line 251, in compute_revaluations
self.env.cr.execute(query, params)
File "/opt/odoo/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedTable: invalid reference to FROM-clause entry for table "account_account"
LINE 43: AND ("account_account"."company_id" IS NULL OR ...
^
HINT: Perhaps you meant to reference the table alias "acc".

@MiquelRForgeFlow
Copy link
Contributor Author

@lk-eska it should be fixed in #282.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.