i
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index bf6790c6be3..de0ccd3893c 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -95,6 +95,7 @@ class hr_timesheet_sheet(osv.osv):
if (abs(sheet.total_difference) < di) or not di:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr)
+ self.confirm_send_note(cr, uid, ids, context)
else:
raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,))
return True
@@ -169,7 +170,8 @@ class hr_timesheet_sheet(osv.osv):
'date_to' : _default_date_to,
'state': 'new',
'employee_id': _default_employee,
- 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c)
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c),
+ 'user_id': _default_employee
}
def _sheet_date(self, cr, uid, ids, forced_user_id=False, context=None):
@@ -221,6 +223,20 @@ class hr_timesheet_sheet(osv.osv):
department_id = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).department_id.id
return {'value': {'department_id': department_id}}
+ # ------------------------------------------------
+ # OpenChatter methods and notifications
+ # ------------------------------------------------
+
+ def needaction_domain_get(self, cr, uid, ids, context=None):
+ emp_obj = self.pool.get('hr.employee')
+ empids = emp_obj.search(cr, uid, [('parent_id.user_id', '=', uid)], context=context)
+ dom = ['&', ('state', '=', 'confirm'), ('employee_id', 'in', empids)]
+ return dom
+
+ def confirm_send_note(self, cr, uid, ids, context=None):
+ for obj in self.browse(cr, uid, ids, context=context):
+ self.message_post(cr, uid, [obj.id], body=_("Timesheet has been submitted by %s.") % (obj.employee_id.name), context=context)
+
hr_timesheet_sheet()
class account_analytic_line(osv.osv):
diff --git a/addons/survey/report/survey_form.py b/addons/survey/report/survey_form.py
index f5f459f12f0..1af142cb1df 100644
--- a/addons/survey/report/survey_form.py
+++ b/addons/survey/report/survey_form.py
@@ -135,7 +135,7 @@ class survey_form(report_rml):
-
+
@@ -165,7 +165,7 @@ class survey_form(report_rml):
seq += 1
rml += """
- | """+ tools.ustr(seq) + """. """ + to_xml(tools.ustr(page.title)) + """ |
+ | """+ tools.ustr(seq) + """. """ + to_xml(tools.ustr(page.title)) + """ |
"""
if page.note:
rml += """
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index f6920c68d34..3c2e6055416 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -45,8 +45,8 @@
+
-
diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py
index 17253447c4f..a1b17a76c29 100644
--- a/addons/survey/wizard/survey_answer.py
+++ b/addons/survey/wizard/survey_answer.py
@@ -185,8 +185,9 @@ class survey_question_wiz(osv.osv_memory):
etree.SubElement(xml_form, 'field', {'invisible':'1','name': "wizardid_" + str(wiz_id),'default':str(lambda *a: 0),'modifiers':'{"invisible":true}'})
if note:
+ xml_group_note = etree.SubElement(xml_form, 'group', {'col': '1','colspan': '4'})
for que_test in note.split('\n'):
- etree.SubElement(xml_form, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"})
+ etree.SubElement(xml_group_note, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"})
que_ids = question_ids
qu_no = 0