Partner Department

partner_department
REPOSITORY
REPOSITORYOCA/partner-contact
GIT
GIThttps://github.com/OCA/partner-contact.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/partner-contact/tree/19.0/partner_department
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYCustomer Relationship Management
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), ForgeFlow S.L.
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), ForgeFlow S.L.
COMMITTERS
COMMITTERSMiquel Raïch, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/partner-contact
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:40:47
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - contacts
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module adds *Department* as a native partner type in Odoo's address book.

Unlike a standalone department model, a department is a real ``res.partner``
record (``type = 'department'``) and can therefore be selected anywhere a
partner is expected — for example as the partner of a sale order.

Key features:

- Contacts (non-company partners) have a **Department** field that links them
  to a department partner.
- Opening a department partner shows a **Members** smart button and a tab
  listing all contacts assigned to it.
- Partners can be searched and grouped by department.

> **Incompatibility notice:** This module is **not compatible** with
> `partner_contact_department`. Both modules provide a *Department* field on
> contacts but use different approaches; installing both at the same time will
> cause conflicts.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_partner_form_department Partner form with department res.partner xpath Inherits base.view_partner_form
view_res_partner_filter_department Partner search with department res.partner field Inherits base.view_res_partner_filter
Models touched (1)

New fields (6)
  • department_all_member_ids Many2many → res.partner
    compute='_compute_department_all_member_ids' string='Members' args: 'res.partner'
  • department_id Many2one → res.partner
    domain=[('type', '=', 'department')] args: 'res.partner'
  • department_ids One2many → res.partner
    domain=[('type', '=', 'department')] string='Departments' args: 'res.partner', 'parent_id'
  • department_member_count Integer
    compute='_compute_department_member_count'
  • department_member_ids One2many → res.partner
    domain=[('type', '!=', 'department')] string='Direct Members' args: 'res.partner', 'department_id'
  • type Selection
    ondelete={'department': 'set default'} selection_add=[('department', 'Department')]
Public methods (1)
  • action_view_department_members(self)