Skip to content

[MIG] partner_contact_in_several_companies: Migration to 18.0 - #2432

Open
SirPyTech wants to merge 37 commits into
OCA:18.0from
PyTech-SRL:18.0-mig-partner_contact_in_several_companies
Open

SirPyTech wants to merge 37 commits into
OCA:18.0from
PyTech-SRL:18.0-mig-partner_contact_in_several_companies

Conversation

@SirPyTech

Copy link
Copy Markdown

Supersede #2383 because the author is inactive.

I cherry-picked the author's commit because it is mostly good, I only included the typo fix suggested in #2383 (comment).

About using search_fetch (#2383 (comment)): it is used when accessing relational fields, but relational fields should always be accessible without the overridden domain so it fails the test test_10_filter_does_not_leak_into_access_checks.

Looking forward to your opinion!

Jairo Llopis and others added 30 commits September 10, 2026 15:41
- Remove nationality and birthday features.
- Move the remaining features to partner_contact_in_several_companies.
- Make base_contact a dummy module.
- Warn deprecation everywhere possible.
- Remove Domain Error on contact view.
- Additionally, improve behaviour of personal contact info page.
- Change to README.
- No longer dependent on partner_contact_personal_information_page
- Added tests for ir_actions
- Include extra demo data.
- Increase test coverage.
- Remove birthdate from demo data.
* [MIG] inital work to 10.0

* [FIX] restore computed field

- select=1 is not usable anymore ...

* [FIX] convert _fields_sync to new api

* [FIX] restore form . import statement

* [FIX] readme with last template.

* [FIX] import statement.

* [FIX] check all tests

* [FIX] Flake8 errors fixes

* [FIX] flake 8

* [FIX] wrong obj call self -> self.contact_id

* [FIX] typo

* [FIX] flake 8

* [FIX] add index on contact_type

* [fix] use in statement on test

* [FIX] update base action with new context

* [FIX] test fixes

* [FIX] test work

* [FIX] flake 8 over indent

* [FIX] fixes on lastest comments

- better readability
- remove <data></data> tags

* [FIX] model that same pattern for _fields_sync

- add test ensure_once()

* [FIX] remove last data xml tags

* [FIX] fix action test

* [FIX] typo in import statement

* [FIX] remove logger from tests

* [FIX] new flake8 compute method name for OCA

* [FIX] minor typo

* [FIX] partner_contact_in_several_companies: remove contributor key in manifest

* [FIX] partner_contact_in_several_companies: residual onchange on partner view

* Revert "[FIX] partner_contact_in_several_companies: remove contributor key in manifest"

This reverts commit 56e511a.

* [FIX] partner_contact_personal_information_page: clean manifest and authors

* [FIX] partner_contact_in_several_companies: required = True not needed
- fax field removed from res.partner
- 2to3 on all py files
- add contributor and update README
- use hasclass in place of @Class in xpath expr
- improve tests

[FIX] typo and clean README
- This is just to see all positions
- If we want to add position go to one company and add contact linked to this partner
Currently translated at 100.0% (29 of 29 strings)

Translation: partner-contact-11.0/partner-contact-11.0-partner_contact_in_several_companies
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-11-0/partner-contact-11-0-partner_contact_in_several_companies/es/
Currently translated at 100.0% (29 of 29 strings)

Translation: partner-contact-12.0/partner-contact-12.0-partner_contact_in_several_companies
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_contact_in_several_companies/de/
Currently translated at 20.6% (6 of 29 strings)

Translation: partner-contact-14.0/partner-contact-14.0-partner_contact_in_several_companies
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_contact_in_several_companies/it/
Currently translated at 100.0% (29 of 29 strings)

Translation: partner-contact-14.0/partner-contact-14.0-partner_contact_in_several_companies
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_contact_in_several_companies/fr/
Currently translated at 3.4% (1 of 29 strings)

Translation: partner-contact-14.0/partner-contact-14.0-partner_contact_in_several_companies
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_contact_in_several_companies/fr_CH/
klodr and others added 6 commits September 10, 2026 15:47
Currently translated at 77.7% (28 of 36 strings)

Translation: partner-contact-14.0/partner-contact-14.0-partner_contact_in_several_companies
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_contact_in_several_companies/fr_FR/
Currently translated at 100.0% (36 of 36 strings)

Translation: partner-contact-14.0/partner-contact-14.0-partner_contact_in_several_companies
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_contact_in_several_companies/es/
Currently translated at 100.0% (36 of 36 strings)

Translation: partner-contact-16.0/partner-contact-16.0-partner_contact_in_several_companies
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-partner_contact_in_several_companies/it/
@OCA-git-bot OCA-git-bot added series:18.0 mod:partner_contact_in_several_companies Module partner_contact_in_several_companies labels Sep 10, 2026

@HekkiMelody HekkiMelody left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code and functional review, LGTM

I'm not sure I fully understand the implications of using search_fetch but the current implementation seems fine to me, so I'd be inclined to keep it as is.

Comment thread partner_contact_in_several_companies/models/res_partner.py
Comment thread partner_contact_in_several_companies/models/res_partner.py
Comment thread partner_contact_in_several_companies/models/res_partner.py
@SirPyTech
SirPyTech force-pushed the 18.0-mig-partner_contact_in_several_companies branch from 1f3327d to 91c6304 Compare October 8, 2026 10:05
- Hide attached contacts from the Contacts kanban/list by rewriting the
  search domain in web_search_read (and search), instead of the pre-16
  public search() signature which the web client bypasses on Odoo 17+.
  The filter is deliberately kept off _search so it does not leak into
  record-rule access checks or one2many prefetches (that would raise
  AccessErrors and empty out other_contact_ids). Also drops the obsolete
  `count` search kwarg that raised TypeError on Odoo 17+.
- Adapt the views to v18: re-anchor the list inherit on display_name
  (parent_id was removed from the base partner list), rewrite the kanban
  card customisations for the new <aside>/<main> card (no kanban_color/
  kanban_image helpers, no oe_kanban_details/ul/li), use Python view
  modifiers (!= instead of <>), and use `id` instead of `active_id` in
  the Other Positions field context.
- Rename the contact_type compute method to a module-specific name so it
  no longer shadows partner_type_base's _compute_contact_type when both
  modules are installed, and add a stored other_contacts_count field for
  the kanban '+N other positions' indicator (avoids an unrendered
  one2many in the kanban that Odoo 17+ warns about).
- Add Python regression tests for the web data path and access-check
  isolation.
@SirPyTech
SirPyTech force-pushed the 18.0-mig-partner_contact_in_several_companies branch from 91c6304 to 333d4f0 Compare October 8, 2026 10:07

@SirPyTech SirPyTech left a comment

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.

I included the small proposed changes in the existing migration commit

Comment thread partner_contact_in_several_companies/models/res_partner.py
Comment thread partner_contact_in_several_companies/models/res_partner.py
Comment thread partner_contact_in_several_companies/models/res_partner.py

@BhaveshHeliconia BhaveshHeliconia left a comment

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.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.