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] partner_risk_insurance: Migration to 18.0 #421

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

Conversation

ArnauCForgeFlow
Copy link

Migration to 18.0

campos and others added 30 commits January 22, 2025 16:14
[11.0][MIG] partner_risk_insurance: Migration to v11.0

[11.0][IMP] partner_risk_insurance: Fix ES translation

[UPD] README.rst

Update translation files

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

Translation: credit-control-11.0/credit-control-11.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-11-0/credit-control-11-0-partner_risk_insurance/

[UPD] README.rst

[UPD] Update partner_risk_insurance.pot

Update translation files

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

Translation: credit-control-11.0/credit-control-11.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-11-0/credit-control-11-0-partner_risk_insurance/
Update translation files

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

Translation: credit-control-12.0/credit-control-12.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-12-0/credit-control-12-0-partner_risk_insurance/
pre-commit update

Update translation files

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

Translation: credit-control-13.0/credit-control-13.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-13-0/credit-control-13-0-partner_risk_insurance/
[13.0][IMP] Add a view priority

partner_risk_insurance 13.0.1.1.0
…d insurance_credit_limit on partners

partner_risk_insurance 13.0.1.1.1
Update translation files

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

Translation: credit-control-14.0/credit-control-14.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-14-0/credit-control-14-0-partner_risk_insurance/
Currently translated at 100.0% (27 of 27 strings)

Translation: credit-control-14.0/credit-control-14.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-14-0/credit-control-14-0-partner_risk_insurance/it/
[UPD] Update partner_risk_insurance.pot

[UPD] README.rst
Currently translated at 100.0% (27 of 27 strings)

Translation: credit-control-15.0/credit-control-15.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-15-0/credit-control-15-0-partner_risk_insurance/it/
…eter tracking

That parameter is added in mail module

partner_risk_insurance 15.0.1.0.2

[UPD] README.rst

Update translation files

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

Translation: credit-control-15.0/credit-control-15.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-15-0/credit-control-15-0-partner_risk_insurance/
- Include context keys for avoiding mail operations overhead.

[BOT] post-merge updates
[UPD] Update partner_risk_insurance.pot

[BOT] post-merge updates
Currently translated at 100.0% (47 of 47 strings)

Translation: credit-control-16.0/credit-control-16.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-partner_risk_insurance/es/
mymage and others added 15 commits January 22, 2025 16:14
Currently translated at 100.0% (27 of 27 strings)

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

Translation: credit-control-16.0/credit-control-16.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-partner_risk_insurance/
In Odoo 16, upstream has already a `credit_limit` field in `res.partner`. That field is coupled with a checkbox named `use_partner_credit_limit`, which means "this partner doesn't use the default credit limit; it has a specific credit limit".

Those fields were only available to users of groups `account.group_account_invoice` and `account.group_account_readonly`, within the *Invoicing* tab in `res.partner` form.

Still there's an extra hidden `show_credit_limit` field which toggles this feature completely. It depends on wether the current company has credit limits enabled.

This module was migrated from previous versions that had none of these features. The result is that, probably by that inertia, UX ended up becoming inconsistent.

Improvements done:
- Fields are relabeled. Their names confused everybody in our UX investigation. They now reflect better their usage.
- The company default credit limit is ignored when the user sets a different credit limit. Before, it was being included in the sum to get the total credit limit for the partner, but that was contrary to the purpose of that field in upstream Odoo. When you check `use_partner_credit_limit` in upstream Odoo, you don't add an extra credit limit; instead, you *replace* the default limit by a custom one. That's what we do here now.
- Tests are rewritten because they were exercising that wrong assumption that I just explained.
- It made no sense to ask the user for total, company and insured credit limits. One of those fields could be computed. Since upstream Odoo already has a writable property field `credit_limit` (already explained), I picked up `company_credit_limit` to be the computed one.
- `company_credit_limit` is no longer stored (and therefore not tracked) because it's a company-dependant field. In multi-company partners, the logger became inconsistent otherwise.
- `use_partner_credit_limit` gets an onchange to trigger its inverse method beforehand, and make UX consistent before hitting save.
- When setting a insurance credit limit higher than the total credit limit, the total is automatically increased, and the company is automatically set to 0.
- All features are hidden if the company didn't enable credit limits. This is consistent with upstream Odoo.
- Permissions are adjusted to match those of upstream Odoo regarding these fields.
- Tests are executed with those new permissions.

Still, a good extra enhancement would be to move all this stuff to the *Invoicing* tab. But that can be done later after some more investigation.

Although this module had a lot of maintainers, it seems like it still needs more love, so we also volunteer to help with it.

@moduon MT-4827

Co-authored-by: Rafael Blasco <[email protected]>
Co-authored-by: <[email protected]>
Co-authored-by: <[email protected]>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Translation: credit-control-16.0/credit-control-16.0-partner_risk_insurance
Translate-URL: https://translation.odoo-community.org/projects/credit-control-16-0/credit-control-16-0-partner_risk_insurance/it/
Copy link

@ThiagoMForgeFlow ThiagoMForgeFlow left a comment

Choose a reason for hiding this comment

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

Code LGTM!

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.