OCA / hr-holidays

Human Resources Holidays OCA modules for Odoo
GNU Affero General Public License v3.0
35 stars 106 forks source link

[14.0][FW] [13.0][IMP] hr_holidays_credit: add unit in form selection widget & plurals management #125

Open maisim opened 3 months ago

maisim commented 3 months ago

Port of #124 from 13.0 to 14.0.

maisim commented 3 months ago

Maybe not directly related with this module but,

On form loading, the quantity available miss in the input: image

it's ok in the choices: image

and once we click on the select and choose an entry, it's ok in the input image

An idea ?

edit : The problem is not present on 13.0

maisim commented 3 months ago

The field definition in 13.0:

    holiday_status_id = fields.Many2one(
        "hr.leave.type", string="Time Off Type", required=True, readonly=True,
        states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]},
        domain=[('valid', '=', True)])

in 14:

    holiday_status_id = fields.Many2one(
        "hr.leave.type", compute='_compute_from_employee_id', store=True, string="Time Off Type", required=True, readonly=False,
        states={'cancel': [('readonly', True)], 'refuse': [('readonly', True)], 'validate1': [('readonly', True)], 'validate': [('readonly', True)]},
        domain=[('valid', '=', True)])
    validation_type = fields.Selection(string='Validation Type', related='holiday_status_id.leave_validation_type', readonly=False)
    # HR data

I also realize that we completely replace the name_get method, which may not always be desirable, let's dig deeper.