minor fix searcher contract

This commit is contained in:
wilson gomez 2021-09-14 09:01:58 -05:00
parent e0a39863e4
commit 6dea21cafc
1 changed files with 5 additions and 1 deletions

View File

@ -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