[IMP] Improved warning messages for project* modules
bzr revid: pso@tinyerp.com-20120725121605-rvid4ebeomtr0zzo
This commit is contained in:
parent
25d650e96e
commit
c7060ffa18
|
@ -26,13 +26,13 @@ msgstr ""
|
||||||
#. module: project_timesheet
|
#. module: project_timesheet
|
||||||
#: code:addons/project_timesheet/project_timesheet.py:55
|
#: code:addons/project_timesheet/project_timesheet.py:55
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "No employee defined for user \"%s\". You must create one."
|
msgid "Please define employee for user \"%s\". You must create one."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: project_timesheet
|
#. module: project_timesheet
|
||||||
#: code:addons/project_timesheet/project_timesheet.py:63
|
#: code:addons/project_timesheet/project_timesheet.py:63
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "No journal defined on the related employee.\n"
|
msgid "Please define journal on the related employee.\n"
|
||||||
"Fill in the timesheet tab of the employee form."
|
"Fill in the timesheet tab of the employee form."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ msgstr ""
|
||||||
#. module: project_timesheet
|
#. module: project_timesheet
|
||||||
#: code:addons/project_timesheet/project_timesheet.py:59
|
#: code:addons/project_timesheet/project_timesheet.py:59
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "No product defined on the related employee.\n"
|
msgid "Please define product on the related employee.\n"
|
||||||
"Fill in the timesheet tab of the employee form."
|
"Fill in the timesheet tab of the employee form."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ msgstr ""
|
||||||
#. module: project_timesheet
|
#. module: project_timesheet
|
||||||
#: code:addons/project_timesheet/project_timesheet.py:70
|
#: code:addons/project_timesheet/project_timesheet.py:70
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "No product and product category property account defined on the related employee.\n"
|
msgid "Please define product and product category property account on the related employee.\n"
|
||||||
"Fill in the timesheet tab of the employee form."
|
"Fill in the timesheet tab of the employee form."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
@ -78,22 +78,22 @@ class project_work(osv.osv):
|
||||||
if not emp_id:
|
if not emp_id:
|
||||||
user_name = self.pool.get('res.users').read(cr, uid, [user_id], ['name'])[0]['name']
|
user_name = self.pool.get('res.users').read(cr, uid, [user_id], ['name'])[0]['name']
|
||||||
raise osv.except_osv(_('Bad Configuration !'),
|
raise osv.except_osv(_('Bad Configuration !'),
|
||||||
_('No employee defined for user "%s". You must create one.')% (user_name,))
|
_('Please define employee for user "%s". You must create one.')% (user_name,))
|
||||||
emp = self.pool.get('hr.employee').browse(cr, uid, emp_id[0])
|
emp = self.pool.get('hr.employee').browse(cr, uid, emp_id[0])
|
||||||
if not emp.product_id:
|
if not emp.product_id:
|
||||||
raise osv.except_osv(_('Bad Configuration !'),
|
raise osv.except_osv(_('Bad Configuration !'),
|
||||||
_('No product defined on the related employee.\nFill in the timesheet tab of the employee form.'))
|
_('Please define product on the related employee.\nFill in the timesheet tab of the employee form.'))
|
||||||
|
|
||||||
if not emp.journal_id:
|
if not emp.journal_id:
|
||||||
raise osv.except_osv(_('Bad Configuration !'),
|
raise osv.except_osv(_('Bad Configuration !'),
|
||||||
_('No journal defined on the related employee.\nFill in the timesheet tab of the employee form.'))
|
_('Please define journal on the related employee.\nFill in the timesheet tab of the employee form.'))
|
||||||
|
|
||||||
a = emp.product_id.product_tmpl_id.property_account_expense.id
|
a = emp.product_id.product_tmpl_id.property_account_expense.id
|
||||||
if not a:
|
if not a:
|
||||||
a = emp.product_id.categ_id.property_account_expense_categ.id
|
a = emp.product_id.categ_id.property_account_expense_categ.id
|
||||||
if not a:
|
if not a:
|
||||||
raise osv.except_osv(_('Bad Configuration !'),
|
raise osv.except_osv(_('Bad Configuration !'),
|
||||||
_('No product and product category property account defined on the related employee.\nFill in the timesheet tab of the employee form.'))
|
_('Please define product and product category property account on the related employee.\nFill in the timesheet tab of the employee form.'))
|
||||||
res['product_id'] = emp.product_id.id
|
res['product_id'] = emp.product_id.id
|
||||||
res['journal_id'] = emp.journal_id.id
|
res['journal_id'] = emp.journal_id.id
|
||||||
res['general_account_id'] = a
|
res['general_account_id'] = a
|
||||||
|
|
Loading…
Reference in New Issue