Add start and end dates on employee

issue4435
review21181002
This commit is contained in:
Xavier Codinas committed 2016-10-19 23:07:20 +02:00
1 parent 754589865d
commit e72fdb1995
4 files changed
+23

No files matched your search

+2
View File
@@ -1,3 +1,5 @@
* Add start and end dates on employee
Version 4.0.0 - 2016-05-02
* Bug fixes (see mercurial logs for details)
* Add Python3 support
+15
View File
@@ -1,6 +1,7 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import copy
from trytond.model import ModelView, ModelSQL, fields
from trytond.wizard import Wizard, StateView, Button, StateTransition
from trytond.report import Report
@@ -61,6 +62,20 @@ class Employee(ModelSQL, ModelView):
_rec_name = 'party'
party = fields.Many2One('party.party', 'Party', required=True)
company = fields.Many2One('company.company', 'Company', required=True)
start_date = fields.Date('Start Date',
domain=[If((Eval('start_date')) & (Eval('end_date')),
('start_date', '<=', Eval('end_date')),
(),
)
],
depends=['end_date'])
end_date = fields.Date('End Date',
domain=[If((Eval('start_date')) & (Eval('end_date')),
('end_date', '>=', Eval('start_date')),
(),
)
],
depends=['start_date'])
@staticmethod
def default_company():
+4
View File
@@ -6,4 +6,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="party"/>
<label name="company"/>
<field name="company"/>
<label name="start_date"/>
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
</form>
+2
View File
@@ -4,4 +4,6 @@ this repository contains the full copyright notices and license terms. -->
<tree>
<field name="party"/>
<field name="company"/>
<field name="start_date"/>
<field name="end_date"/>
</tree>