İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
6993 Görünümler

class RUModifier(models.Model):
    _inherit = "res.users"
    __uid_cache = defaultdict(dict)
    #override
    @api.multi
    def write(self, values):
        .......

        ......

        employee = self.env['hr.employee'].search([('id', '=', self.employee_ids.id)])
        employee.sudo().write(values)
        return res

Settings -> Users & Companies -> Users

I click "inactive" -> Active, i don't get employeer ID?

How to get it?

Thanks

Avatar
Vazgeç
En İyi Yanıt

while you activate or inactive a record, the function toggle_active is triggered. so you must override the same and do the needful. here is an example.


@api.multi
def toggle_active(self):
""" Inverse the value of the field ``active`` on the records in ``self``. """
# try to get he employee with related field user_id of hr.employee


Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Kas 23
7374
0
Haz 24
1259
1
Ağu 25
3480
3
Tem 25
6746
1
May 25
1045