diff --git a/employee.py b/employee.py index f69ca9d..048ce26 100644 --- a/employee.py +++ b/employee.py @@ -13,7 +13,7 @@ class Employee(metaclass=PoolMeta): help='Salary monthly of person', depends=['contract'], readonly=True), 'get_salary') contract = fields.Function(fields.Many2One('staff.contract', - 'Contract'), 'get_contract') + 'Contract'), 'get_contract', searcher='search_contract') position = fields.Function(fields.Many2One('staff.position', 'Position'), 'get_position') curses = fields.Text('Curses') career = fields.Text('Career') @@ -68,6 +68,10 @@ class Employee(metaclass=PoolMeta): if contracts: return contracts[0].id + @classmethod + def search_contract(cls, name, clause): + return + def get_salary(self, name=None): if self.contract: return self.contract.salary