Skip to content

[19.0] [MIG] partner_rank_single : Migration to 19.0.#2369

Open
uncannycs wants to merge 8 commits into
OCA:19.0from
uncannycs:19.0-mig-partner_rank_single
Open

[19.0] [MIG] partner_rank_single : Migration to 19.0.#2369
uncannycs wants to merge 8 commits into
OCA:19.0from
uncannycs:19.0-mig-partner_rank_single

Conversation

@uncannycs
Copy link
Copy Markdown

No description provided.

yankinmax and others added 7 commits May 28, 2026 18:47
Currently translated at 100.0% (2 of 2 strings)

Translation: partner-contact-18.0/partner-contact-18.0-partner_rank_single
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-18-0/partner-contact-18-0-partner_rank_single/it/
Instead of running the constraint check on `_increase_rank`, we now avoid
increasing it if the partner is already ranked in the opposite field.

This fixes an error that occurs when installing demo data of core modules:

```python-traceback
2025-12-11 11:44:05,845 35 ERROR testdb odoo.addons.account.demo.account_demo: Error while posting demo data
Traceback (most recent call last):
  File ".../odoo/addons/account/demo/account_demo.py", line 90, in _post_load_demo_data
    move.action_post()
  File ".../odoo/addons/account/models/account_move.py", line 5426, in action_post
    self._post(soft=False)
  File ".../odoo/addons/account/models/account_move.py", line 5154, in _post
    (partner | partner.commercial_partner_id)._increase_rank('supplier_rank', count)
  File ".../partner-contact/partner_rank_single/models/res_partner.py", line 23, in _increase_rank
    "supplier_rank": "customer_rank",
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../partner-contact/partner_rank_single/models/res_partner.py", line 15, in _constrains_single_rank
    raise ValidationError(
odoo.exceptions.ValidationError: A contact cannot be both a customer and a supplier.
```
@OCA-git-bot OCA-git-bot added series:19.0 mod:partner_rank_single Module partner_rank_single labels May 28, 2026
Copy link
Copy Markdown
Contributor

@BhaveshHeliconia BhaveshHeliconia left a comment

Choose a reason for hiding this comment

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

Consider using BaseCommon instead of TransactionCase. In this case, there’s no need to redefine DISABLED_MAIL_CONTEXT.

Comment thread partner_rank_single/tests/test_partner_rank_single.py Outdated
Comment thread partner_rank_single/tests/test_partner_rank_single.py Outdated
Comment thread partner_rank_single/tests/test_partner_rank_single.py Outdated
Comment thread partner_rank_single/__manifest__.py Outdated
{
"name": "Partner Rank Single",
"summary": "Introduce single rank for partners.",
"version": "19.0.2.0.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"version": "19.0.2.0.0",
"version": "19.0.1.0.0",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Applied suggestion.

@uncannycs uncannycs force-pushed the 19.0-mig-partner_rank_single branch from 1f4efaf to 3a6cba3 Compare June 4, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:partner_rank_single Module partner_rank_single series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants