[19.0] [MIG] partner_risk_insurance#567
Open
ThomasBinsfeld wants to merge 55 commits into
Open
Conversation
acsonefho
approved these changes
Jun 17, 2026
[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/
TT34699 partner_risk_insurance 14.0.1.1.0
[UPD] Update partner_risk_insurance.pot [UPD] README.rst
partner_risk_insurance 15.0.1.0.1
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/
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 <8736623+rafaelbn@users.noreply.github.com> Co-authored-by: <104626993+ArantxaSudon@users.noreply.github.com> Co-authored-by: <104626797+loida-vm@users.noreply.github.com>
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/
When users without accounting access are trying to access a Sale Order, they have an access error on the partner field credit_limit (standard Odoo field that is limited to Account groups), which is used when computing the SO's risk_info. Use sudo across in the financial risk modules when accessing partner.credit_limit.
When attempting to duplicate a contact (res.partner model), users with limited invoice permissions receive a permission error. The duplication is not completed because the system attempts to read the insurance_credit_limit and risk_insurance_coverage_percent fields. MT-13337
c5b0120 to
9a3502f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#510