2.2 KiB
2.2 KiB
Website Membership Associate
Show associate members in the public /members directory of website_membership.
Problem
The standard website_membership module builds the public members directory from
membership.membership_line records. Partners that are linked as associate
members (res.partner.associate_member) inherit the membership status of their
host partner and do not own a membership line, so they are not shown in the
public directory even when they are published.
Solution
The module follows the same pattern as OCA's
website_membership_non_paid_member:
- The
members()controller injects the context keyinclude_associate_members=Trueand delegates pagination, grouping and search to the standardwebsite_membershipcontroller. membership.membership_line._search()detects that context key and widens the domain so that a host is returned when the active country or search filters match one of its published associates.- The inherited controller post-processes the rendered context to add the current page's associates under the same membership group (or under "Free Members") as their host, keep associates under their own country in the country sidebar, hide hosts that only appear because an associate matched the active country/search filter, and include published associate companies in the Google Map markers.
No fake membership lines are created and no core or OCA addon is modified.
Supported features
- Pagination over hosts (
_references_per_page) with associates rendered on the same page. - Grouping by membership product and "Free Members".
- Country grouping and filtering (associates are counted under their own country).
- Name / website description search.
- Google Map markers (when the optional view is enabled).
Configuration
No configuration is required. Install the module and publish the partners that must appear on the website.
Development notes
- All business logic is in Python controllers/models; no QWeb logic is added.
- No source code of
website_membership,membershipor other core/OCA addons is modified. - No fake membership lines are created for associate members.
- Only one level of association (
associate_member) is supported.