The "Claim Car Report" action was not working as expected. Now the statbutton "Cars" will show the car history of a specific driver. closes odoo/odoo#76550 Related: odoo/upgrade#2882 Taskid: 2646113 Signed-off-by: Kevin Baptiste <kba@odoo.com>
18 lines
497 B
Python
18 lines
497 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models, fields
|
|
|
|
|
|
class User(models.Model):
|
|
_inherit = ['res.users']
|
|
|
|
employee_cars_count = fields.Integer(related='employee_id.employee_cars_count')
|
|
|
|
@property
|
|
def SELF_READABLE_FIELDS(self):
|
|
return super().SELF_READABLE_FIELDS + ['employee_cars_count']
|
|
|
|
def action_open_employee_cars(self):
|
|
return self.employee_id.action_open_employee_cars()
|