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

[MIG] account_financial_risk: Migration to 18.0 #407

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

Conversation

rjaraspearhead
Copy link

No description provided.

carlosdauden and others added 30 commits December 5, 2024 16:34
* [9.0][IMP] partner_financial_risk: Improve performance

* [9.0][IMP] partner_financial_risk: Improve tests and partner hierarchy

* [9.0][IMP] partner_stock_risk: Test
- Refunds adds partner risk instead of reduce.
- If date_maturity changes to previous today date "never" compute partner risk.
* [9.0][IMP] partner_financial_risk: Improve multicompany cron

* [9.0][IMP] partner_financial_risk: Exec with sudo

(cherry picked from commit 6590bbf)
Currently translated at 71.2% (52 of 73 strings)

Translation: credit-control-12.0/credit-control-12.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-account_financial_risk/fr/
Currently translated at 79.5% (58 of 73 strings)

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

Translation: credit-control-12.0/credit-control-12.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-account_financial_risk/es/
Currently translated at 13.7% (10 of 73 strings)

Translation: credit-control-12.0/credit-control-12.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-account_financial_risk/es_CL/
Currently translated at 76.7% (56 of 73 strings)

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

Translation: credit-control-12.0/credit-control-12.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-account_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
This commit adds an specific group for overpassing partner credit limit exceptions
In some situations, not only account managers shoud be allowed to overpass exception, depending on the company policies. Merging this code will not affect current instances, as long as account managers will be added to the new group.
Ivorra78 and others added 23 commits December 8, 2024 17:00
Currently translated at 100.0% (91 of 91 strings)

Translation: credit-control-16.0/credit-control-16.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-account_financial_risk/es/
Currently translated at 53.8% (49 of 91 strings)

Translation: credit-control-16.0/credit-control-16.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-account_financial_risk/it/
Currently translated at 53.8% (49 of 91 strings)

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

Translation: credit-control-16.0/credit-control-16.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-account_financial_risk/
… buttons

[IMP] account_financial_risk: Improve comments to make it more understandable
TT32194
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Translation: credit-control-16.0/credit-control-16.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-account_financial_risk/es/
- Include context keys for avoiding mail operations overhead.
…ecks to be not need to compute risk exception
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: credit-control-17.0/credit-control-17.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_financial_risk/
Currently translated at 52.1% (49 of 94 strings)

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

Translation: credit-control-17.0/credit-control-17.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_financial_risk/sv/
Only superadmins have access to this model, so let's do the operation
with sudo for getting the ID, which is the only intention of that code.

TT50264
Currently translated at 100.0% (92 of 92 strings)

Translation: credit-control-17.0/credit-control-17.0-account_financial_risk
Translate-URL: https://translation.odoo-community.org/projects/credit-control-17-0/credit-control-17-0-account_financial_risk/it/
@rjaraspearhead rjaraspearhead force-pushed the 18.0-mig-account_financial_risk branch 2 times, most recently from 7a97d08 to a71d543 Compare December 8, 2024 22:04
@rjaraspearhead
Copy link
Author

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

Copy link

@celm1990 celm1990 left a comment

Choose a reason for hiding this comment

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

Functionally tested, LGTM.
Just a single comment regarding companies in account.account, @carlosdauden, what do you think?
Note: Please squash the two latest commits.

+ [
("move_id.move_type", "in", ["out_invoice", "out_refund"]),
("account_type", "=", "asset_receivable"),
("parent_state", "in", ["draft", "proforma", "proforma2"]),

Choose a reason for hiding this comment

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

I think these states are obsolete and must be updated.

Suggested change
("parent_state", "in", ["draft", "proforma", "proforma2"]),
("parent_state", "=", "draft"),

@api.model
def _max_risk_date_due(self):
return fields.Date.to_string(
fields.Date.today()

Choose a reason for hiding this comment

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

Please use context_today to avoid issues with UTC. In LATAM, where UTC is often negative, this is more common.

Suggested change
fields.Date.today()
fields.Date.context_today(self)

account.company_id,
self.env.company,

Choose a reason for hiding this comment

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

I understand that account.account can now be shared across multiple companies, and the company_id field is now a many2many, according to this commit. So, I’m not sure if it’s the best approach to take the company from the environment.

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.