[MERGE] trunk-fp

bzr revid: fp@tinyerp.com-20121026094049-5vyarcp0ac6r4kcb
This commit is contained in:
Fabien Pinckaers 2012-10-26 11:40:49 +02:00
commit 53a845aaee
13 changed files with 194 additions and 223 deletions

View File

@ -28,7 +28,7 @@ class hr_config_settings(osv.osv_memory):
_columns = {
'module_hr_timesheet_sheet': fields.boolean('Allow timesheets validation by managers',
help ="""This installs the module hr_timesheet_sheet."""),
'module_hr_attendance': fields.boolean('Track attendances',
'module_hr_attendance': fields.boolean('Install attendances feature',
help ="""This installs the module hr_attendance."""),
'module_hr_timesheet': fields.boolean('Manage timesheets',
help ="""This installs the module hr_timesheet."""),
@ -42,6 +42,8 @@ class hr_config_settings(osv.osv_memory):
help ="""This installs the module hr_contract."""),
'module_hr_evaluation': fields.boolean('Organize employees periodic evaluation',
help ="""This installs the module hr_evaluation."""),
'module_account_analytic_analysis': fields.boolean('Allow invoicing based on timesheets (will install the sale application)',
help ="""This installs the module account_analytic_analysis, which will install sales management too."""),
'module_hr_payroll': fields.boolean('Manage payroll',
help ="""This installs the module hr_payroll."""),
}

View File

@ -69,6 +69,10 @@
<field name="module_hr_timesheet_sheet" class="oe_inline"/>
<label for="module_hr_timesheet_sheet"/>
</div>
<div name="account_analytic_analysis">
<field name="module_account_analytic_analysis" class="oe_inline"/>
<label for="module_account_analytic_analysis"/>
</div>
<div name="hr_attendance">
<field name="module_hr_attendance" on_change="onchange_hr_attendance(module_hr_attendance)" class="oe_inline"/>
<label for="module_hr_attendance"/>

View File

@ -25,7 +25,7 @@ class hr_attendance_config_settings(osv.osv_memory):
_inherit = 'hr.config.settings'
_columns = {
'group_hr_attendance': fields.boolean('Track attendances',
'group_hr_attendance': fields.boolean('Track attendances for all employees',
implied_group='base.group_hr_attendance',
help="Allocates attendance group to all users."),
}

View File

@ -190,17 +190,14 @@ class hr_analytic_timesheet(osv.osv):
'journal_id': self._getAnalyticJournal(cr, uid, context),
}}
hr_analytic_timesheet()
class account_analytic_account(osv.osv):
_inherit = 'account.analytic.account'
_description = 'Analytic Account'
_columns = {
'use_timesheets': fields.boolean('Timesheets', help="Check this field if this project manages timesheets"),
}
def on_change_template(self, cr, uid, ids, template_id, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context)
if template_id and 'value' in res:
@ -208,6 +205,4 @@ class account_analytic_account(osv.osv):
res['value']['use_timesheets'] = template.use_timesheets
return res
account_analytic_account()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -6,12 +6,12 @@
<field name="name">hr.analytic.timesheet.tree</field>
<field name="model">hr.analytic.timesheet</field>
<field name="arch" type="xml">
<tree editable="bottom" string="Timesheet Lines">
<tree editable="bottom" string="Timesheet Activities">
<field name="date" on_change="on_change_date(date)"/>
<field name="user_id" on_change="on_change_user_id(user_id)" required="1"/>
<field name="user_id" on_change="on_change_user_id(user_id)" required="1" options='{"no_open": True}'/>
<field name="journal_id" invisible="1"/>
<field name="name"/>
<field domain="[('type','=','normal'),('use_timesheets','=',1)]" name="account_id" context="{'default_use_timesheets': 1}"/>
<field domain="[('type','=','normal'),('use_timesheets','=',1)]" name="account_id" context="{'default_use_timesheets': 1, 'default_type': 'contract'}"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" required="1" domain="[('type','=','service')]" invisible="1"/>
<field name="unit_amount" string="Duration" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" sum="Total time" widget="float_time"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" invisible="1"/>
@ -24,7 +24,7 @@
<field name="name">hr.analytic.timesheet.form</field>
<field name="model">hr.analytic.timesheet</field>
<field name="arch" type="xml">
<form string="Timesheet Lines" version="7.0">
<form string="Timesheet Activities" version="7.0">
<sheet>
<group>
<group>
@ -107,7 +107,7 @@
</record>
<record id="act_hr_timesheet_line_evry1_all_form" model="ir.actions.act_window">
<field name="name">Timesheet Lines</field>
<field name="name">Timesheet Activities</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.analytic.timesheet</field>
<field name="view_type">form</field>
@ -116,12 +116,12 @@
<field name="search_view_id" ref="hr_timesheet_line_search"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to record your timesheets.
Click to record activities.
</p><p>
You can register and track your workings hours by project every
day. Every time spent on a project will become a cost in the
analytic accounting and can be re-invoiced to customers if
required.
analytic accounting/contract and can be re-invoiced to
customers if required.
</p>
</field>
</record>

View File

@ -34,103 +34,22 @@ class hr_timesheet_sheet(osv.osv):
_order = "id desc"
_description="Timesheet"
def _total_attendances(self, cr, uid, ids, name, args, context=None):
""" Get the total attendance for the timesheets
Returns a dict like :
{id: {'total_per_day': {day: timedelta, ...},
},
...
}
"""
context = context or {}
attendance_obj = self.pool.get('hr.attendance')
res = {}
for sheet_id in ids:
sheet = self.browse(cr, uid, sheet_id, context=context)
# field attendances_ids of hr_timesheet_sheet.sheet only
# returns attendances of timesheet's current date
attendance_ids = attendance_obj.search(cr, uid, [('sheet_id', '=', sheet_id)], context=context)
attendances = attendance_obj.browse(cr, uid, attendance_ids, context=context)
total_attendance = {}
for attendance in [att for att in attendances
if att.action in ('sign_in', 'sign_out')]:
day = attendance.name[:10]
if not total_attendance.get(day, False):
total_attendance[day] = timedelta(seconds=0)
attendance_in_time = datetime.strptime(attendance.name, '%Y-%m-%d %H:%M:%S')
attendance_interval = timedelta(hours=attendance_in_time.hour,
minutes=attendance_in_time.minute,
seconds=attendance_in_time.second)
if attendance.action == 'sign_in':
total_attendance[day] -= attendance_interval
else:
total_attendance[day] += attendance_interval
res[sheet_id] = {'total_per_day': total_attendance}
return res
def _total_timesheet(self, cr, uid, ids, name, args, context=None):
""" Get the total of analytic lines for the timesheets
Returns a dict like :
{id: {day: timedelta, ...}}
"""
context = context or {}
sheet_line_obj = self.pool.get('hr.analytic.timesheet')
res = {}
for sheet_id in ids:
# field timesheet_ids of hr_timesheet_sheet.sheet only
# returns lines of timesheet's current date
sheet_lines_ids = sheet_line_obj.search(cr, uid, [('sheet_id', '=', sheet_id)], context=context)
sheet_lines = sheet_line_obj.browse(cr, uid, sheet_lines_ids, context=context)
total_timesheet = {}
for line in sheet_lines:
day = line.date
if not total_timesheet.get(day, False):
total_timesheet[day] = timedelta(seconds=0)
total_timesheet[day] += timedelta(hours=line.unit_amount)
res[sheet_id] = total_timesheet
return res
def _total(self, cr, uid, ids, name, args, context=None):
""" Compute the attendances, analytic lines timesheets and differences between them
for all the days of a timesheet and the current day
"""
def sum_all_days(sheet_amounts):
if not sheet_amounts:
return timedelta(seconds=0)
total = reduce(lambda memo, value: memo + value, sheet_amounts.values())
return total
def timedelta_to_hours(delta):
hours = 0.0
seconds = float(delta.seconds)
if delta.microseconds:
seconds += float(delta.microseconds) / 100000
hours += delta.days * 24
if seconds:
hours += seconds / 3600
return hours
res = {}
all_timesheet_attendances = self._total_attendances(cr, uid, ids, name, args, context=context)
all_timesheet_lines = self._total_timesheet(cr, uid, ids, name, args, context=context)
for id in ids:
res[id] = {}
all_attendances_sheet = all_timesheet_attendances[id]
total_attendances_sheet = all_attendances_sheet['total_per_day']
total_attendances_all_days = sum_all_days(total_attendances_sheet)
total_timesheets_sheet = all_timesheet_lines[id]
total_timesheets_all_days = sum_all_days(total_timesheets_sheet)
total_difference_all_days = total_attendances_all_days - total_timesheets_all_days
res[id]['total_attendance'] = timedelta_to_hours(total_attendances_all_days)
res[id]['total_timesheet'] = timedelta_to_hours(total_timesheets_all_days)
res[id]['total_difference'] = timedelta_to_hours(total_difference_all_days)
for sheet in self.browse(cr, uid, ids, context=context or {}):
res.setdefault(sheet.id, {
'total_attendance': 0.0,
'total_timesheet': 0.0,
'total_difference': 0.0,
})
for period in sheet.period_ids:
res[sheet.id]['total_attendance'] += period.total_attendance
res[sheet.id]['total_timesheet'] += period.total_timesheet
res[sheet.id]['total_difference'] += period.total_attendance - period.total_timesheet
return res
def check_employee_attendance_state(self, cr, uid, sheet_id, context=None):
@ -283,8 +202,8 @@ class hr_timesheet_sheet(osv.osv):
return []
if isinstance(ids, (long, int)):
ids = [ids]
return [(r['id'], r['date_from'] + ' - ' + r['date_to']) \
for r in self.read(cr, uid, ids, ['date_from', 'date_to'],
return [(r['id'], _('Week ')+datetime.strptime(r['date_from'], '%Y-%m-%d').strftime('%U')) \
for r in self.read(cr, uid, ids, ['date_from'],
context=context, load='_classic_write')]
def unlink(self, cr, uid, ids, context=None):

View File

@ -40,6 +40,23 @@
</field>
</record>
<record model="ir.actions.act_window" id="act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet">
<field name="context">{'search_default_sheet_id': [active_id]}</field>
<field name="name">Timesheet Activities</field>
<field name="res_model">hr.analytic.timesheet</field>
<field name="src_model">hr_timesheet_sheet.sheet</field>
</record>
<record model="ir.actions.act_window" id="act_hr_timesheet_sheet_sheet_2_hr_attendance">
<field name="context">{'search_default_sheet_id': [active_id]}</field>
<field name="name">Attendances</field>
<field name="res_model">hr.attendance</field>
<field name="src_model">hr_timesheet_sheet.sheet</field>
</record>
<record id="hr_timesheet_sheet_form" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.form</field>
<field name="model">hr_timesheet_sheet.sheet</field>
@ -53,8 +70,18 @@
<field name="state" widget="statusbar" statusbar_visible="new,confirm,done"/>
</header>
<sheet>
<label for="employee_id" class="oe_edit_only"/>
<h1><field name="employee_id" on_change="onchange_employee_id(employee_id)" class="oe_inline"/></h1>
<div class="oe_right oe_button_box" name="buttons">
<button type="action"
name="%(act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet)d"
string="Timesheet Activities" />
<button type="action" groups="base.group_hr_attendance"
name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d"
string="Attendances" />
</div>
<div class="oe_title">
<label for="employee_id" class="oe_edit_only"/>
<h1><field name="employee_id" on_change="onchange_employee_id(employee_id)" class="oe_inline"/></h1>
</div>
<group>
<group>
<label for="date_from" string="Timesheet Period"/>
@ -63,10 +90,10 @@
<field name="department_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group>
<field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>
<group groups="base.group_hr_attendance">
<field name="total_attendance" widget="float_time"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
<field name="user_id" invisible="1"/>
</group>
</group>
@ -76,24 +103,8 @@
</widget>
</page>
<page string="Daily">
<group groups="base.group_hr_attendance">
<field context="{'user_id':user_id}" name="attendances_ids" nolabel="1">
<tree string="Attendances" editable="bottom">
<field name="name"/>
<field name="action"/>
<field invisible="1" name="employee_id"/>
</tree>
</field>
<group>
<field name="state_attendance" nolabel="1"/>
<div align="right" groups="base.group_hr_manager">
<button name="attendance_action_change" attrs="{'invisible': [('state_attendance', '=', 'present')]}" type="object" string="Sign In"/>
<button name="attendance_action_change" attrs="{'invisible': ['|', ('state_attendance','=',False), ('state_attendance', '=', 'absent')]}" type="object" string="Sign Out"/>
</div>
</group>
</group>
<field context="{'user_id':user_id}" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet Lines">
<tree editable="top" string="Timesheet Activities">
<field name="date"/>
<field domain="[('type','in',['normal', 'contract']), ('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
<field name="name"/>
@ -106,7 +117,7 @@
<field invisible="1" name="general_account_id"/>
<field invisible="1" name="user_id" required="1"/>
</tree>
<form string="Timesheet Lines" version="7.0">
<form string="Timesheet Activities" version="7.0">
<field name="date"/>
<field domain="[('type','=','normal'), ('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
<field name="name"/>
@ -121,7 +132,24 @@
</form>
</field>
</page>
<page string="Summary" groups="base.group_hr_attendance">
<page string="Attendances" groups="base.group_hr_attendance">
<group>
<field context="{'user_id':user_id}" name="attendances_ids" nolabel="1">
<tree string="Attendances" editable="bottom">
<field name="name"/>
<field name="action"/>
<field invisible="1" name="employee_id"/>
</tree>
</field>
<group>
<label for="state_attendance"/>
<div>
<field name="state_attendance"/>
<button name="attendance_action_change" attrs="{'invisible': [('state_attendance', '=', 'present')]}" type="object" string="Sign In" class="oe_link"/>
<button name="attendance_action_change" attrs="{'invisible': ['|', ('state_attendance','=',False), ('state_attendance', '=', 'absent')]}" type="object" string="Sign Out" class="oe_link"/>
</div>
</group>
</group>
<field name="period_ids">
<tree colors="red:total_difference&lt;0.1;blue:total_difference&gt;=0.1" string="Period">
<field name="name"/>
@ -147,8 +175,8 @@
<field name="arch" type="xml">
<search string="Search Timesheet">
<field name="date_from"/>
<filter icon="terp-document-new" string="In Draft" domain="[('state','in',('draft', 'new'))]" help="Unvalidated Timesheets"/>
<filter icon="terp-camera_test" string="To Approve" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
<filter name="new" string="In Draft" domain="[('state','in',('draft', 'new'))]" help="Unvalidated Timesheets"/>
<filter name="to_approve" string="To Approve" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
<field name="employee_id"/>
<field name="department_id"/>
<group expand="0" string="Group By...">
@ -160,23 +188,23 @@
</record>
<record id="act_hr_timesheet_sheet_form" model="ir.actions.act_window">
<field name="name">Timesheets</field>
<field name="name">Timesheets to Validate</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr_timesheet_sheet.sheet</field>
<field name="view_type">form</field>
<field name="view_id" eval="False"/>
<field name="context">{'search_default_my_timesheet':1}</field>
<field name="context">{'search_default_to_approve':1}</field>
<field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to go to your timesheet.
New timesheet to approve.
</p><p>
You must record timesheets every day and confirm at the end
of the week. Once the timesheet is confirmed, it his sent to
the manager for validation.
of the week. Once the timesheet is confirmed, it should be
validated by a manager.
</p><p>
Timesheets can also be invoiced to customers, depending on the
configuration of the project.
configuration of each project's related contract.
</p>
</field>
</record>
@ -287,22 +315,6 @@
name="Timesheet by Day"
res_model="hr_timesheet_sheet.sheet.day"
src_model="hr_timesheet_sheet.sheet"/>
<act_window
context="{'search_default_sheet_id': [active_id]}"
id="act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet"
name="Timesheet Lines"
res_model="hr.analytic.timesheet"
src_model="hr_timesheet_sheet.sheet"/>
<act_window
context="{'search_default_sheet_id': [active_id]}"
id="act_hr_timesheet_sheet_sheet_2_hr_attendance"
name="Attendances"
res_model="hr.attendance"
src_model="hr_timesheet_sheet.sheet"/>
<record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.tree</field>
<field name="model">hr_timesheet_sheet.sheet</field>
@ -312,7 +324,7 @@
<field name="employee_id"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="department_id"/>
<field name="department_id" invisible="1"/>
<field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>

View File

@ -0,0 +1,3 @@
timesheet.css: timesheet.sass
sass -t expanded timesheet.sass timesheet.css

View File

@ -1,79 +1,62 @@
@charset "utf-8";
.openerp .oe_form_readonly .oe_timesheet_button_add {
display: none;
}
.openerp .oe_timesheet_weekly {
overflow-x: auto;
overflow-x: auto;
}
.openerp .oe_timesheet_weekly table {
width: 100%;
width: 100%;
}
.openerp .oe_timesheet_weekly td {
padding-top: 15px;
padding: 3px;
text-align: right;
}
.openerp .oe_timesheet_weekly th {
text-align: right;
color: #069;
font-family: 'Helvetica Neue', Arial, Verdana, 'Nimbus Sans L', sans-serif;
font-size: 10px;
text-align: center;
color: #006699;
font-family: "Helvetica Neue", Arial, Verdana, "Nimbus Sans L", sans-serif;
font-size: 10px;
background: #eeeeee;
min-width: 47px;
}
.openerp .oe_timesheet_weekly th.oe_timesheet_weekly_date_head {
width: 60px;
.openerp .oe_timesheet_weekly .oe_timesheet_total {
background: #eeeeee;
}
.openerp .oe_timesheet_weekly td {
text-align: right;
vertical-align: middle;
}
.openerp .oe_timesheet_weekly .oe_timesheet_weekly_account {
text-align: left;
padding-right: 30px;
text-align: left;
}
.openerp .oe_timesheet_weekly .oe_timesheet_first_col {
min-width: 130px;
}
.openerp .oe_timesheet_weekly td input.oe_timesheet_weekly_input {
border: 1px solid #CCC;
padding: 5px 2px !important;
color: #666 !important;
font-size: 14px;
font-weight: bold;
width: 38px;
text-align: right;
min-width: 0 !important;
padding: 5px 2px !important;
width: 40px;
text-align: right;
min-width: 0 !important;
}
.openerp .oe_timesheet_weekly td .oe_timesheet_weekly_box {
padding: 5px 2px !important;
color: #666 !important;
font-size: 14px;
font-weight: bold;
width: 38px;
display: inline-block;
.openerp .oe_timesheet_weekly td.oe_timesheet_total {
font-weight: bold;
padding: 5px 3px !important;
}
.openerp .oe_timesheet_weekly .oe_timesheet_weekly_adding_tot {
display: table;
width: 100%;
display: table;
width: 100%;
}
.openerp .oe_timesheet_weekly .oe_timesheet_weekly_adding {
display: table-cell;
text-align: left;
display: table-cell;
text-align: left;
}
.openerp .oe_timesheet_weekly .oe_timesheet_weekly_tottot {
display: table-cell;
display: table-cell;
}
.openerp .oe_timesheet_weekly .oe_timesheet_weekly_add_row td {
text-align: left;
text-align: left;
}
.openerp .oe_timesheet_weekly .oe_timesheet_weekly_add_row .oe_form_field_many2one {
display: inline-block;
width: 200px;
display: inline-block;
width: 200px;
}
.openerp .oe_timesheet_weekly_today {
.openerp .oe_timesheet_weekly .oe_timesheet_weekly_today {
background: #ffddee;
}

View File

@ -0,0 +1,49 @@
@charset "utf-8"
.openerp
.oe_form_readonly
.oe_timesheet_button_add
display: none
.oe_timesheet_weekly
overflow-x: auto
table
width: 100%
td
padding: 3px
text-align: right
th
text-align: center
color: #069
font-family: 'Helvetica Neue', Arial, Verdana, 'Nimbus Sans L', sans-serif
font-size: 10px
background: #eee
min-width: 47px
.oe_timesheet_total
background: #eee
.oe_timesheet_weekly_account
text-align: left
.oe_timesheet_first_col
min-width: 130px
td input.oe_timesheet_weekly_input
padding: 5px 2px !important
width: 40px
text-align: right
min-width: 0 !important
td.oe_timesheet_total
font-weight: bold
padding: 5px 3px !important
.oe_timesheet_weekly_adding_tot
display: table
width: 100%
.oe_timesheet_weekly_adding
display: table-cell
text-align: left
.oe_timesheet_weekly_tottot
display: table-cell
.oe_timesheet_weekly_add_row td
text-align: left
.oe_timesheet_weekly_add_row .oe_form_field_many2one
display: inline-block
width: 200px
.oe_timesheet_weekly_today
background: #fde

View File

@ -194,6 +194,10 @@ openerp.hr_timesheet_sheet = function(instance) {
['use_timesheets','=',1],
['id', 'not in', _.pluck(self.accounts, "account")],
],
context: {
default_use_timesheets: 1,
default_type: "contract",
},
modifiers: '{"required": true}',
},
});

View File

@ -5,7 +5,7 @@
<div class="oe_timesheet_weekly">
<table>
<tr>
<th> </th>
<th class="oe_timesheet_first_col"> </th>
<t t-foreach="widget.dates" t-as="date">
<th t-att-class="'oe_timesheet_weekly_date_head' + (Date.compare(date, Date.today()) === 0 ? ' oe_timesheet_weekly_today' : '')">
<t t-esc="date.toString('ddd')"/><br />
@ -26,29 +26,29 @@
<t t-set="day_count" t-value="day_count + 1"/>
</td>
</t>
<td t-att-data-account-total="account.account"> </td>
<td t-att-data-account-total="account.account" class="oe_timesheet_total"> </td>
</tr>
<tr class="oe_timesheet_weekly_add_row" style="display: none">
<td t-att-colspan="widget.dates.length + 2">
<button>Add</button>
<button class="oe_highlight">Add</button>
</td>
</tr>
<tr>
<tr class="oe_timesheet_total">
<td>
<div class="oe_timesheet_weekly_adding_tot">
<div class="oe_timesheet_weekly_adding"><button>Add a Project</button></div>
<div class="oe_timesheet_weekly_adding"><button class="oe_timesheet_button_add">Add a Line</button></div>
<div class="oe_timesheet_weekly_tottot"><span>Total</span></div>
</div>
</td>
<t t-set="day_count" t-value="0"/>
<t t-foreach="widget.dates" t-as="date">
<td t-att-class="(Date.compare(date, Date.today()) === 0 ? 'oe_timesheet_weekly_today' : '')">
<td class="oe_timesheet_total">
<span class="oe_timesheet_weekly_box" t-att-data-day-total="day_count">
</span>
<t t-set="day_count" t-value="day_count + 1"/>
</td>
</t>
<td class="oe_timesheet_weekly_supertotal"> </td>
<td class="oe_timesheet_weekly_supertotal oe_timesheet_total"> </td>
</tr>
</table>
</div>

View File

@ -5,7 +5,7 @@
<field name="name">hr_timesheet_current_open.form</field>
<field name="model">hr.timesheet.current.open</field>
<field name="arch" type="xml">
<form string="My Current Timesheet" version="7.0">
<form string="My Timesheet" version="7.0">
<group>
<separator string="It will open your current timesheet"/>
</group>
@ -19,7 +19,7 @@
</record>
<record id="action_hr_timesheet_current_open" model="ir.actions.act_window">
<field name="name">My Current Timesheet</field>
<field name="name">My Timesheet</field>
<field name="res_model">hr.timesheet.current.open</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@ -28,7 +28,7 @@
<field name="help">My Timesheet opens your timesheet so that you can book your activities into the system. From the same form, you can register your attendances (Sign In/Out) and describe the working hours made on the different projects. At the end of the period defined in the company, the timesheet is confirmed by the user and can be validated by his manager. If required, as defined on the project, you can generate the invoices based on the timesheet.</field>
</record>
<menuitem action="action_hr_timesheet_current_open" icon="STOCK_NEW" id="menu_act_hr_timesheet_sheet_form_my_current" name="My Current Timesheet" parent="hr_attendance.menu_hr_time_tracking" sequence="1"/>
<menuitem action="action_hr_timesheet_current_open" icon="STOCK_NEW" id="menu_act_hr_timesheet_sheet_form_my_current" name="My Timesheet" parent="hr_attendance.menu_hr_time_tracking" sequence="1"/>
</data>
</openerp>