[MERGE] better HR messages

bzr revid: fp@openerp.com-20120916152319-z1trkemgvcqelfk2
This commit is contained in:
Fabien Pinckaers 2012-09-16 17:23:19 +02:00
commit f8a32421d9
3 changed files with 9 additions and 7 deletions

View File

@ -137,11 +137,13 @@ class hr_analytic_timesheet(osv.osv):
if context is None: if context is None:
context = {} context = {}
emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context) emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))], context=context)
if emp_id: if not emp_id :
emp = emp_obj.browse(cr, uid, emp_id[0], context=context) raise osv.except_osv(_('Warning!'), _('Please create an employee for this user, using the menu: Human Resources > Employees.'))
if emp.journal_id: emp = emp_obj.browse(cr, uid, emp_id[0], context=context)
return emp.journal_id.id if emp.journal_id:
return False return emp.journal_id.id
else :
raise osv.except_osv(_('Warning!'), _('No analytic journal defined for \'%s\'.\nYou should assign an analytic journal on the employee form.')%(emp.name))
_defaults = { _defaults = {

View File

@ -46,7 +46,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Timesheet" version="7.0"> <form string="Timesheet" version="7.0">
<header> <header>
<button name="button_confirm" states="draft" string="Submited to Manager" type="object" class="oe_highlight"/> <button name="button_confirm" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/>
<button name="done" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/> <button name="done" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
<button name="action_set_to_draft" states="done" string="Set to Draft" type="object" /> <button name="action_set_to_draft" states="done" string="Set to Draft" type="object" />
<button name="cancel" states="confirm" string="Refuse" type="workflow" groups="base.group_hr_user" /> <button name="cancel" states="confirm" string="Refuse" type="workflow" groups="base.group_hr_user" />

View File

@ -976,7 +976,7 @@ msgstr ""
#. module: hr_timesheet_sheet #. module: hr_timesheet_sheet
#: view:hr_timesheet_sheet.sheet:0 #: view:hr_timesheet_sheet.sheet:0
msgid "Submited to Manager" msgid "Submit to Manager"
msgstr "" msgstr ""
#. module: hr_timesheet_sheet #. module: hr_timesheet_sheet