With https://github.com/odoo/odoo/pull/122085, we simplified the definition of display_name for `ir.department`: https://github.com/odoo/odoo/commit/3c62ca1eb96d571b2b686b5caee370324c589ab4#diff-404a1cabe61e6fcb32cc3ac3d3d36336b9313f162130c3edbe1066c130b09c0dR11 but because of https://github.com/odoo/odoo/blob/0d30cc2bc9b9cc2b805d6c2d0a440f185c648da0/odoo/models.py#L235, it overstates completely the default definition instead of merging definition as others fields. Fix the change. closes odoo/odoo#131445 X-original-commit: 17eed41b81049a25db42a3e8389bd931433b0717 Related: odoo/enterprise#45579 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com> Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
12 lines
373 B
Python
12 lines
373 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models, fields
|
|
|
|
|
|
class Department(models.Model):
|
|
_inherit = 'hr.department'
|
|
|
|
# Get department name using superuser, because model is not accessible for portal users
|
|
display_name = fields.Char(compute='_compute_display_name', compute_sudo=True)
|