...
 
Commits (3)
......@@ -98,6 +98,15 @@
</div>
</div>
<div class="row" t-if="project_sheet_id.comment">
<div class="col-md-12">
<p>
<strong>Comment:</strong>
<span t-field="project_sheet_id.comment"/>
</p>
</div>
</div>
</t>
<div class="oe_structure"/>
......
......@@ -63,6 +63,7 @@ class HrTimesheetSheet(models.Model):
user_id = fields.Many2one('res.users', string='Responsible', required=False, default=lambda self: self.env.user)
contact_id = fields.Many2one('res.partner', string='Remote Contact', store=True, readonly=False)
location = fields.Char(string="Location", help="Short description describing the location of the event.", store=True, readonly=False)
comment = fields.Text('Additional Information', readonly=True, states={'draft': [('readonly', False)], 'new': [('readonly', False)]})
@api.constrains('date_to', 'date_from', 'project_id')
def _check_sheet_date(self, forced_project_id=False):
......
......@@ -4,7 +4,7 @@
<div class="oe_timesheet_weekly">
<table class="table table-condensed table-responsive">
<tr>
<th class="oe_timesheet_first_col" colspan="3"/>
<th class="oe_timesheet_first_col" colspan="2"/>
<t t-foreach="widget.dates" t-as="date">
<th t-att-class="'oe_timesheet_weekly_date_head' + (moment().format('DD-MM-YYYY') === moment(date).format('DD-MM-YYYY') ? ' oe_timesheet_weekly_today' : '')">
<t t-esc="moment(date).format('ddd')"/><br/>
......@@ -15,31 +15,20 @@
</tr>
<tr t-foreach="widget.employees" t-as="employee">
<td class="oe_timesheet_weekly_account_category" colspan="1"><a href="javascript:void(0)" t-att-data-id="JSON.stringify(employee.employee_category)"><t t-esc="widget.category_names[employee.employee_category]"/></a></td>
<td class="oe_timesheet_weekly_account" colspan="1">
<a href="javascript:void(0)" t-att-data-id="JSON.stringify(employee.user_id)" t-att-data-employee-category-employee="employee.user_id_category_id" ><t t-esc="widget.employee_names[employee.user_id]"/></a>
</td>
<td></td>
<td class="oe_timesheet_weekly_account" colspan="2"><a href="javascript:void(0)" t-att-data-id="JSON.stringify(employee.user_id)" t-att-data-employee="employee.user_id" ><t t-esc="widget.employee_names[employee.user_id]"/></a></td>
<t t-set="day_count" t-value="0"/>
<t t-foreach="employee.days" t-as="day">
<td t-att-class="moment().format('DD-MM-YYYY') === moment(day.day).format('DD-MM-YYYY') ? 'oe_timesheet_weekly_today' : ''">
<input t-if="!widget.get('effective_readonly')" class="oe_timesheet_weekly_input" t-att-data-employee-category="employee.user_id_category_id"
t-att-data-day-count="day_count" type="text"/>
<span t-if="widget.get('effective_readonly')" t-att-data-employee-category="employee.user_id_category_id"
<span t-att-data-employee="employee.user_id"
t-att-data-day-count="day_count" class="oe_timesheet_weekly_box"/>
<t t-set="day_count" t-value="day_count + 1"/>
</td>
</t>
<td t-att-data-employee-category-total="employee.user_id_category_id" class="oe_timesheet_total"/>
<td t-att-data-employee-total="employee.user_id" class="oe_timesheet_total"/>
</tr>
<tr>
<td class="o_add_timesheet_line" colspan="2">
<div>
<button t-if="!widget.get('effective_readonly')" class="btn btn-sm btn-primary oe_edit_only oe_timesheet_button_add">Add a Line</button>
</div>
</td>
<td class="oe_timesheet_total">
<td class="oe_timesheet_total" colspan="2">
Total
</td>
<t t-set="day_count" t-value="0"/>
......
......@@ -6,6 +6,9 @@
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="arch" type="xml">
<field name="user_id" position="before">
<field name="employee_category"/>
</field>
<field name="unit_amount" position="before">
<field name="time_start" widget="float_time"/>
<field name="time_stop" widget="float_time"/>
......
......@@ -74,9 +74,9 @@
<label for="date_from" string="Timesheet Period"/>
<div><field name="date_from" class="oe_inline"/> to <field name="date_to" class="oe_inline"/></div>
<field name="company_id" groups="base.group_multi_company"/>
<field name="location" />
</group>
<group>
<field name="location" />
<field name="user_id" />
<field name="contact_id" />
</group>
......@@ -115,6 +115,10 @@
</widget>
</page>
</notebook>
<div>
<label for="comment"/>
<field name="comment" placeholder="Additional notes..."/>
</div>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
......