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

18.0 mig sale financial risk #408

Open
wants to merge 60 commits into
base: 18.0
Choose a base branch
from

Conversation

rjaraspearhead
Copy link

@rjaraspearhead rjaraspearhead commented Dec 10, 2024

I am working on the migration of the sale_financial_risk module to branch 18.0. Could you please help me by reviewing my work?

Depends on:

carlosdauden and others added 30 commits December 8, 2024 17:15
Currently translated at 7.7% (1 of 13 strings)

Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/fr/
Currently translated at 7.7% (1 of 13 strings)

Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/pt_BR/
Currently translated at 46.2% (6 of 13 strings)

Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/it/
Currently translated at 100.0% (13 of 13 strings)

Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/pt_BR/
Currently translated at 23.1% (3 of 13 strings)

Translation: credit-control-12.0/credit-control-12.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-sale_financial_risk/pt/
…le_financial_risk:

 - Optimize code and change stored computed fields to not store to improve multi-company support
 - Improve multi-currency support
 - Convert risk amount fields to clickable link that shows traceability of amount origin
 - New pivot views to risk amount traceability
 - Simplify class style applied on risk fields
 - Migration script to remove old stored computed fields
 - Improve tests to cover new functionallity
 - Update translation files

account_financial_risk:
 - Don't block refund invoice validation when partner has risk exception
 - Allow search partners by risk exception field
 - Remove obsolete cron

sale_financial_risk
 - Create related store commercial_partner_id field in sale order line to simplify computation
 - Rename amt_to_invoice field to risk_amount in sale order line
 - Hook and migration scripts to reduce new fields computing time

TT23765
Currently translated at 11.8% (2 of 17 strings)

Translation: credit-control-13.0/credit-control-13.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-13-0/credit-control-13-0-sale_financial_risk/fr/
Currently translated at 82.3% (14 of 17 strings)

Translation: credit-control-14.0/credit-control-14.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-14-0/credit-control-14-0-sale_financial_risk/fr/
Currently translated at 11.7% (2 of 17 strings)

Translation: credit-control-14.0/credit-control-14.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-14-0/credit-control-14-0-sale_financial_risk/nl/
`account.move` `post()` is deprecated since Odoo 14.0.
jesusVMayor and others added 24 commits December 8, 2024 17:15
Currently translated at 85.0% (17 of 20 strings)

Translation: credit-control-15.0/credit-control-15.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-15-0/credit-control-15-0-sale_financial_risk/fr/
Currently translated at 25.0% (5 of 20 strings)

Translation: credit-control-15.0/credit-control-15.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-15-0/credit-control-15-0-sale_financial_risk/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/
Currently translated at 100.0% (20 of 20 strings)

Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/es/
res.partner credit_limit field is a commercial field that triggers the
children syncronization. In partners with lots of children, those
recalculations can lead to a poor user experience when a operation that
is replicated over all the children doesn't perform fine. This is the
case with the risk_partner_id field, wich relation is recalculated a
thus as many queries as children has the contact (it can be dozens).

TT43572
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/
Currently translated at 100.0% (21 of 21 strings)

Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/es/
- Include context keys for avoiding mail operations overhead.
Currently translated at 100.0% (21 of 21 strings)

Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/es/
This issue appeared for multi-company, multi-currency configuration. Whenever risk was calculated for the partner, Sale Order amount was converted to company currency, instead of currency set on the partner.

This commit fixes the issue by converting to correct currency (set on the partner).
The test_manual_currency_risk_not_exceeded test that assesses that the
manual currency risk has not been passed fails when another module changes
the company's currency. The reason for the failure is that if the company
currency matches the currency of the sell order it does not convert
correctly and in that case it interprets the limit within the same currency.
For example, if the company currency is set as EUR and the sales order
is placed in EUR, the conversion of the 100€ is not done and therefore
exceeds the limit set to 99. To solve this, the company currency is
first checked to set a different currency in the order. On the other
hand, the tests should be frozen at a certain date to prevent the
exchange rate of the exchange currency from going up or down thus
avoiding errors when running the test, which should check that it has
not been exceeded.
Currently translated at 100.0% (21 of 21 strings)

Translation: credit-control-16.0/credit-control-16.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-sale_financial_risk/nl/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-17.0/credit-control-17.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-sale_financial_risk/
Currently translated at 100.0% (21 of 21 strings)

Translation: credit-control-17.0/credit-control-17.0-sale_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-sale_financial_risk/it/
…ax amounts.

The product product.product_product_2 does not have explicit taxes, but after this commit
odoo/odoo@2836416, an error occurs when comparing the expected amount. So, adapt the amount to compare without taxes and create a new product to avoid depending on demo data.
@rjaraspearhead rjaraspearhead force-pushed the 18.0-mig-sale_financial_risk branch from d59f76b to b6744fd Compare December 10, 2024 20:53
@rjaraspearhead rjaraspearhead mentioned this pull request Dec 10, 2024
5 tasks
@rjaraspearhead rjaraspearhead force-pushed the 18.0-mig-sale_financial_risk branch from f115a51 to 7f379d4 Compare December 11, 2024 22:49
@rjaraspearhead
Copy link
Author

@carlosdauden, Can you help me with the migration review?

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

Successfully merging this pull request may close these issues.