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

[17.0][MIG] account_financial_risk: Migration to 17.0 #347

Closed

Conversation

Mat-moran
Copy link

  • Change version in manifest
  • Adapt views to version 17.0

carlosdauden and others added 30 commits December 14, 2023 11:37
* [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.
carlosdauden and others added 14 commits December 14, 2023 11:37
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
@cramosh cramosh force-pushed the 17.0-mig-account_financial_risk branch from dc58a91 to 966f63e Compare December 14, 2023 15:52
[IMP] account_financial_risk: pre-commit auto fixes

[MIG] account_financial_risk: Migration to 17.0

Refactor code for financial risk handling

Update tax_group_taxes variable and add help text to invoice_unpaid_margin and allow_overrisk_invoice_validation settings

[FIX] pre-commit

[MIG] account_financial_risk: Migration to 17.0

[MIG] account_financial_risk: Migration to 17.0

[MIG] account_financial_risk: Migration to 17.0
@cramosh cramosh force-pushed the 17.0-mig-account_financial_risk branch from 966f63e to e6354c7 Compare December 14, 2023 15:55
@Mat-moran
Copy link
Author

Hi, @pedrobaeza can you help on this? we have a problem with the field amount_residual_currency when the method_get_amount_in_risk_currency() is executed.

The field amount_residual_currency when is defined it explicetily as

amount_residual_currency = fields.Monetary(
    string='Residual Amount in Currency',
    compute='_compute_amount_residual', store=True,
    group_operator=None, # This is making the function fail
    help="The residual amount on a journal item expressed in its currency (possibly not the "
         "company currency).",
)

what do you sugest?

@pedrobaeza
Copy link
Member

Sorry, I can't say, as I haven't dug on it.

Copy link
Contributor

@carlosdauden carlosdauden left a comment

Choose a reason for hiding this comment

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

@@ -354,7 +354,6 @@ def _compute_risk_account_amount(self):
group["domain"] + [("partner_id", "in", customers.ids)],
group["fields"],
group["group_by"],
orderby="id",
Copy link
Contributor

Choose a reason for hiding this comment

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

Use _read_group to remove this

Copy link
Author

Choose a reason for hiding this comment

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

I am not sure if I am understanding.

the return of _read_group is not the same as read_group

Copy link
Contributor

Choose a reason for hiding this comment

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

Look this:
#377 (review)

<?xml version="1.0" ?>
<odoo noupdate="1">
<!-- Account Tax Group -->
<record id="tax_group_taxes" model="account.tax.group">
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this module adds new tax group?

Copy link
Author

@Mat-moran Mat-moran Dec 15, 2023

Choose a reason for hiding this comment

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

Thanks for the review,

This was in odoo account module but has been removed in v17. As it is required by the test, so we added to this module.

# before v17 this data was on -> addons/account/data/account_data.xml
<!-- Account Tax Group -->
<record id="tax_group_taxes" model="account.tax.group">
    <field name="name">Taxes</field>
    <field name="sequence">0</field>
</record>

Copy link
Member

Choose a reason for hiding this comment

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

You should fix the test, not to add useless data.

@gurneyalex
Copy link
Member

/ocabot migration account_financial_risk

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Apr 5, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Apr 5, 2024
10 tasks
@ioans73
Copy link
Member

ioans73 commented Apr 11, 2024

@Mat-moran what is the status of this?

{
"name": "Account Financial Risk",
"summary": "Manage customer risk",
"version": "17.0.1.0",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"version": "17.0.1.0",
"version": "17.0.1.0.0",

{
"name": "Account Financial Risk",
"summary": "Manage customer risk",
"version": "17.0.1.0",

Choose a reason for hiding this comment

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

Please, put the version in the correctly form
17.0.1.0.0

@pedrobaeza
Copy link
Member

Superseded by #379

@pedrobaeza pedrobaeza closed this May 23, 2024
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.