Remove active from timesheet work as it is not needed
issue7223 review287851002
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
* Use window domain to show "open" and "closed" timesheet works
|
||||
* Remove active from timesheet work
|
||||
|
||||
Version 5.8.0 - 2020-11-02
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
* Remove support for Python 3.5
|
||||
|
||||
@@ -10,11 +10,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="name"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
<label name="active"/>
|
||||
<field name="active"/>
|
||||
<label name="company"/>
|
||||
<field name="company"/>
|
||||
<newline/>
|
||||
<label name="timesheet_start_date"/>
|
||||
<field name="timesheet_start_date"/>
|
||||
<label name="timesheet_end_date"/>
|
||||
|
||||
@@ -7,9 +7,8 @@ from sql import Literal
|
||||
from sql.aggregate import Sum
|
||||
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, ModelStorage, DeactivableMixin, fields, Unique)
|
||||
from trytond.pyson import Not, Bool, Eval, If
|
||||
from trytond.model import ModelView, ModelSQL, ModelStorage, fields, Unique
|
||||
from trytond.pyson import Bool, Eval, If
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.tools import reduce_ids, grouped_slice
|
||||
@@ -17,7 +16,7 @@ from trytond.tools import reduce_ids, grouped_slice
|
||||
from .exceptions import CompanyValidationError
|
||||
|
||||
|
||||
class Work(DeactivableMixin, ModelSQL, ModelView):
|
||||
class Work(ModelSQL, ModelView):
|
||||
'Work'
|
||||
__name__ = 'timesheet.work'
|
||||
name = fields.Char('Name',
|
||||
@@ -57,10 +56,6 @@ class Work(DeactivableMixin, ModelSQL, ModelView):
|
||||
select=True, help="Make the work belong to the company.")
|
||||
timesheet_lines = fields.One2Many('timesheet.line', 'work',
|
||||
'Timesheet Lines',
|
||||
depends=['active'],
|
||||
states={
|
||||
'readonly': Not(Bool(Eval('active'))),
|
||||
},
|
||||
help="Spend time on this work.")
|
||||
# Self referring field to use for aggregation in graph view
|
||||
work = fields.Function(fields.Many2One('timesheet.work', 'Work'),
|
||||
|
||||
@@ -42,6 +42,21 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="view" ref="work_view_form"/>
|
||||
<field name="act_window" ref="act_work_list"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.domain" id="act_work_list_domain_open">
|
||||
<field name="name">Open</field>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="domain"
|
||||
eval="['OR', ('timesheet_end_date', '=', None), ('timesheet_end_date', '>', Date())]"
|
||||
pyson="1"/>
|
||||
<field name="count" eval="True"/>
|
||||
<field name="act_window" ref="act_work_list"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.domain" id="act_work_list_domain_all">
|
||||
<field name="name">All</field>
|
||||
<field name="sequence" eval="9999"/>
|
||||
<field name="domain"></field>
|
||||
<field name="act_window" ref="act_work_list"/>
|
||||
</record>
|
||||
<menuitem
|
||||
parent="menu_configuration"
|
||||
action="act_work_list"
|
||||
|
||||
Reference in New Issue
Block a user