Merge lp:~openerp-dev/openobject-addons/trunk-improve-configuration-warnings-tpa into lp:openobject-addons

Proposed by Chirag Dodiya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-improve-configuration-warnings-tpa
Merge into: lp:openobject-addons
Diff against target: 233 lines (+45/-25)
7 files modified
account/account.py (+5/-4)
account/account_invoice.py (+13/-13)
account/account_move_line.py (+4/-1)
account_voucher/account_voucher.py (+7/-2)
google_drive/google_drive.py (+8/-3)
hr_timesheet/hr_timesheet.py (+4/-1)
mail/res_users.py (+4/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-improve-configuration-warnings-tpa
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+217238@code.launchpad.net

Description of the change

Hello,

       improved warning messages by using get_config_warning. the menu related to the config option mentioned in the warning message can be open from button in message.

Thanks,
cod.

To post a comment you must log in.
9382. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9383. By Jaydeep Barot(OpenERP)

[MERGE][IMP] account (partner view): hide accounting settings to users that have no accounting access rights

9384. By van der Essen Frédéric (OpenERP)

[MERGE] hw_scale: a mettler toledo scale driver for the point of sale

9385. By Jaydeep Barot(OpenERP)

[MERGE][IMP]
stock: more explicit error message for product scraping
account/mail: typos

9386. By Richard Mathot (Odoo, formerly OpenERP)

[MERGE][IMP] account/account_voucher: new filters and usability minor fixes

9387. By Randhir Mayatra (OpenERP)

[MERGE][REM] List views removed in reporting menu (from membership and project_timesheet) as new graph view is now self-sufficient

9388. By Christophe Matthieu (OpenERP)

Tour Re-factoring.
Only one tour running; remove bootstrap tour; Simplify creation of tour; can choose test or tutorial mode with run method; can work without qweb and without EditorBar

9389. By Antony Lesuisse (OpenERP)

[FIX] base_import remove useless test

9390. By Randhir Mayatra (OpenERP)

[MERGE] [REM] Removal of every pre-made dashboard. Only "My Dashboard" has been kept.
Modules descriptions have been updated accordingly and some screenshots have been removed.
(affects: account, crm, event, fleet, hr, hr_evaluation, hr_expense, hr_holidays, hr_recruitment, hr_timesheet_sheet, mrp, procurement, project, purchase, sale, stock)

9391. By van der Essen Frédéric (OpenERP)

[MERGE] point_of_sale: make the kg unit precise up to grams, and use the unit's rounding factor on the scale screen

9392. By sle-openerp

[MERGE][IMP] hr_timesheet: remove unattainable reports; hr_attendance: replace reports by a graphview

9393. By Darshan Kalola(OpenERP)

[MERGE][REM] Removal of "process" module and its avatars in others modules

9394. By Richard Mathot (Odoo, formerly OpenERP)

[FIX][REM] hr_timesheet: removed reports mistakenly reintroduced

9395. By sle-openerp

[MERGE][IMP] Point of Sales: reports converted to QWeb (but removed useless ones); removed dead code in wizard folder; folder; Adapted /report/download route to serialize and return osv_exception in order to be handled in core.js get_file

9396. By sle-openerp

[MERGE][IMP] l10n_* reports converted to QWeb

9397. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9398. By Olivier Dony (Odoo)

[I18N] remove i18n files for deleted modules after disabled translation templates

9399. By Olivier Dony (Odoo)

[IMP] purchase: invoice creation more modular/extensible through the introduction of a _prepare_invoice method()

This is similar to what was previously done for Sales Orders.

9400. By Fabien Meghazi (OpenERP)

[MERGE] Web assets moved from manifests to ir.ui.view bundles

9401. By Fabien (Open ERP)

[IMP] website images: allow no max_width (default), faster loading if no resize

9402. By Antony Lesuisse (OpenERP)

[MERGE] saas-4 up to 9398 <email address hidden>

9403. By Antony Lesuisse (OpenERP)

[MERGE] saas-4 report_webkit missing dependency on report

9404. By Fabien (Open ERP)

[IMP] Lossless PNG compression. Reduced size by 3 with pngquant

9405. By Antony Lesuisse (OpenERP)

[FIX] website controller, correctly resolve last merge about images
fix fp commit to use debian compatible werkzeug api data instead of set_data

9406. By Antony Lesuisse (OpenERP)

[FIX] website_event missing javascript asset

9407. By Fabien Meghazi (OpenERP)

[FIX] edi, calendar webclient bootstrap

9408. By Géry Debongnie

[MERGE] converts buttons in form views into 'stat buttons'

This branch converts pretty much every buttons in 'stat buttons',
which means buttons that can display any kind of information. Right
now, it is mostly used to display a numerical information (such as a
number, for example 9 Calls). Also, look at the invoices button in
Customers form view for an example of a functional field, displaying
the total amount invoiced.

The stat buttons also supports sub widgets, for example a mini pie chart
or a mini bar chart. Examples of such sub widgets can be found in
marketing/mass mailings form views (not ready yet)

9409. By Fabien (Open ERP)

[IMP] Certification Template

9410. By Raphael Collet (OpenERP)

[FIX] event: move definition of fields track_ids and count_tracks to the right module

9411. By Fabien Meghazi (OpenERP)

[IMP] website: load website.xml templates only in editable mode

9412. By Fabien Meghazi (OpenERP)

[ADD] base_import_module test module, static asset in backend bundle

9413. By jke-openerp

[MERGE] Merge with trunk-cal-V8-jke. - Change field datetime into date or datetime according to that event type is in all day or not...

9414. By Fabien Meghazi (OpenERP)

[REM] preprocess_request from website

The method is still there with only a pass statement
Will completetly remove once chm merges his branch

9415. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9416. By Fabien Meghazi (OpenERP)

[FIX] jQuery.ui - boostrap conflict

9417. By Fabien Meghazi (OpenERP)

[REM] Removed addons.web#html_template usage

9418. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9419. By Xavier (Open ERP)

[IMP] mail: type fixes

* _get_tracked_fields should return a dict even when there's no tracked field
  (return an empty dict)

* in write, only call _get_tracked_fields once, initialize to None instead of
  a list (especially since it should be a dict in the first place)

9420. By Géry Debongnie

Large cleanups in addons

The code I merged in my branch stat buttons was sadly not up to our
standing... This branch improves the situation by removing harmful
try/excpet/pass statements, by using search_count when appropriate, by
removing unused one2many fields and by correcting some bugs

9421. By Antony Lesuisse (OpenERP)

[MERGE] trunk-websit-al-refactor by chm
- allow fiscal position change on sale orders
- public user on website
- simplify website_sale sale.order and shopping cart code
- remove preprocess_request

9422. By Fabien Meghazi (OpenERP)

[REM] QWeb does not self close empty divs anymore

See web Rev#4011

9423. By Christophe Simonis (OpenERP)

[MERGE] forward port of branch saas-4 up to revid 9410 <email address hidden>

9424. By Fabien Meghazi (OpenERP)

[REM] completetly removed website#preprocess_request()

9425. By Quentin (OpenERP) <email address hidden>

[REV] partial revert of revision 9408 <email address hidden> where we wrongly beleive than stock depends on crm_claim... :( That code will probably be back _in the right module_

9426. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9427. By Géry Debongnie

[MERGE] merge trunk-claimcount-fix-ged

Add the claim_count_out field to its correct place (in addon claim_from_delivery). The field was removed because it was incorrectly added to stock.py instead of the addon claim_from_delivery. (note: it was renamed from claim_count to claim_count_out)

9428. By Sunil Sharma(OpenERP)

[Merge]: Merged with trunk

9429. By Sunil Sharma(OpenERP)

[mrg]:lp:openobject-addons

9430. By Sunil Sharma(OpenERP)

[mrg]:lp:openobject-addons

Unmerged revisions

9430. By Sunil Sharma(OpenERP)

[mrg]:lp:openobject-addons

9429. By Sunil Sharma(OpenERP)

[mrg]:lp:openobject-addons

9428. By Sunil Sharma(OpenERP)

[Merge]: Merged with trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account.py'
--- account/account.py 2014-04-24 13:45:33 +0000
+++ account/account.py 2014-05-12 04:46:05 +0000
@@ -925,7 +925,9 @@
925 ids = self.search(cr, uid, args, context=context)925 ids = self.search(cr, uid, args, context=context)
926 if not ids:926 if not ids:
927 if exception:927 if exception:
928 raise osv.except_osv(_('Error!'), _('There is no fiscal year defined for this date.\nPlease create one from the configuration of the accounting menu.'))928 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_fiscalyear')
929 msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods and configure a fiscal year.') % dt
930 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
929 else:931 else:
930 return []932 return []
931 return ids933 return ids
@@ -1015,10 +1017,9 @@
1015 if not result:1017 if not result:
1016 result = self.search(cr, uid, args, context=context)1018 result = self.search(cr, uid, args, context=context)
1017 if not result:1019 if not result:
1018 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_fiscalyear')1020 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_period')
1019 msg = _('There is no period defined for this date: %s.\nPlease, go to Configuration/Periods and configure a fiscal year.') % dt1021 msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods.') % dt
1020 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))1022 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
1021
1022 return result1023 return result
10231024
1024 def action_draft(self, cr, uid, ids, *args):1025 def action_draft(self, cr, uid, ids, *args):
10251026
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2014-05-07 17:01:12 +0000
+++ account/account_invoice.py 2014-05-12 04:46:05 +0000
@@ -470,7 +470,7 @@
470 return True470 return True
471471
472 def onchange_partner_id(self, cr, uid, ids, type, partner_id,\472 def onchange_partner_id(self, cr, uid, ids, type, partner_id,\
473 date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):473 date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False, context=None):
474 partner_payment_term = False474 partner_payment_term = False
475 acc_id = False475 acc_id = False
476 bank_id = False476 bank_id = False
@@ -495,8 +495,9 @@
495 rec_res_id = rec_line_data and rec_line_data[0].get('value_reference',False) and int(rec_line_data[0]['value_reference'].split(',')[1]) or False495 rec_res_id = rec_line_data and rec_line_data[0].get('value_reference',False) and int(rec_line_data[0]['value_reference'].split(',')[1]) or False
496 pay_res_id = pay_line_data and pay_line_data[0].get('value_reference',False) and int(pay_line_data[0]['value_reference'].split(',')[1]) or False496 pay_res_id = pay_line_data and pay_line_data[0].get('value_reference',False) and int(pay_line_data[0]['value_reference'].split(',')[1]) or False
497 if not rec_res_id and not pay_res_id:497 if not rec_res_id and not pay_res_id:
498 raise osv.except_osv(_('Configuration Error!'),498 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_config')
499 _('Cannot find a chart of accounts for this company, you should create one.'))499 msg = _('Cannot find a chart of accounts for this company, You should configure it. \nPlease go to Account Configuration.')
500 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
500 account_obj = self.pool.get('account.account')501 account_obj = self.pool.get('account.account')
501 rec_obj_acc = account_obj.browse(cr, uid, [rec_res_id])502 rec_obj_acc = account_obj.browse(cr, uid, [rec_res_id])
502 pay_obj_acc = account_obj.browse(cr, uid, [pay_res_id])503 pay_obj_acc = account_obj.browse(cr, uid, [pay_res_id])
@@ -606,8 +607,9 @@
606 pay_res_id = pay_line_data and pay_line_data[0].get('value_reference',False) and int(pay_line_data[0]['value_reference'].split(',')[1]) or False607 pay_res_id = pay_line_data and pay_line_data[0].get('value_reference',False) and int(pay_line_data[0]['value_reference'].split(',')[1]) or False
607608
608 if not rec_res_id and not pay_res_id:609 if not rec_res_id and not pay_res_id:
609 raise self.pool.get('res.config.settings').get_config_warning(cr, _('Cannot find any chart of account: you can create a new one from %(menu:account.menu_account_config)s.'), context=context)610 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_config')
610611 msg = _('Cannot find a chart of accounts for this company, You should configure it. \nPlease go to Account Configuration.')
612 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
611 if type in ('out_invoice', 'out_refund'):613 if type in ('out_invoice', 'out_refund'):
612 acc_id = rec_res_id614 acc_id = rec_res_id
613 else:615 else:
@@ -622,8 +624,9 @@
622 if line.account_id.company_id.id != company_id:624 if line.account_id.company_id.id != company_id:
623 result_id = account_obj.search(cr, uid, [('name','=',line.account_id.name),('company_id','=',company_id)])625 result_id = account_obj.search(cr, uid, [('name','=',line.account_id.name),('company_id','=',company_id)])
624 if not result_id:626 if not result_id:
625 raise osv.except_osv(_('Configuration Error!'),627 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_config')
626 _('Cannot find a chart of account, you should create one from Settings\Configuration\Accounting menu.'))628 msg = _('Cannot find a chart of accounts for this company, You should configure it. \nPlease go to Account Configuration.')
629 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
627 inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[-1]})630 inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[-1]})
628 else:631 else:
629 if invoice_line:632 if invoice_line:
@@ -651,12 +654,9 @@
651 if r[1] == 'journal_id' and r[2] in journal_ids:654 if r[1] == 'journal_id' and r[2] in journal_ids:
652 val['journal_id'] = r[2]655 val['journal_id'] = r[2]
653 if not val.get('journal_id', False):656 if not val.get('journal_id', False):
654 journal_type_map = dict(obj_journal._columns['type'].selection)657 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_journal_form')
655 journal_type_label = self.pool['ir.translation']._get_source(cr, uid, None, ('code','selection'),658 msg = _("""Cannot find any account journal of type "%s" for this company, You should create one.\n Please go to Journal Configuration""") % journal_type.replace('_', ' ').title()
656 context.get('lang'),659 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
657 journal_type_map.get(journal_type))
658 raise osv.except_osv(_('Configuration Error!'),
659 _('Cannot find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Journals\Journals.') % ('"%s"' % journal_type_label))
660 dom = {'journal_id': [('id', 'in', journal_ids)]}660 dom = {'journal_id': [('id', 'in', journal_ids)]}
661 else:661 else:
662 journal_ids = obj_journal.search(cr, uid, [])662 journal_ids = obj_journal.search(cr, uid, [])
663663
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2014-05-07 17:01:12 +0000
+++ account/account_move_line.py 2014-05-12 04:46:05 +0000
@@ -31,6 +31,7 @@
31from openerp.tools.translate import _31from openerp.tools.translate import _
32import openerp.addons.decimal_precision as dp32import openerp.addons.decimal_precision as dp
33from openerp import tools33from openerp import tools
34import openerp
3435
35class account_move_line(osv.osv):36class account_move_line(osv.osv):
36 _name = "account.move.line"37 _name = "account.move.line"
@@ -548,7 +549,9 @@
548 if context.get('journal_type', False):549 if context.get('journal_type', False):
549 jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))])550 jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))])
550 if not jids:551 if not jids:
551 raise osv.except_osv(_('Configuration Error!'), _('Cannot find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration/Journals/Journals.') % context.get('journal_type'))552 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_journal_form')
553 msg = _("""Cannot find any account journal of "%s" type for this company, You should create one.\n Please go to Journal Configuration""") % context.get('journal_type').replace('_', ' ').title()
554 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
552 journal_id = jids[0]555 journal_id = jids[0]
553 return journal_id556 return journal_id
554557
555558
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2014-05-02 13:03:52 +0000
+++ account_voucher/account_voucher.py 2014-05-12 04:46:05 +0000
@@ -27,6 +27,7 @@
27from openerp.tools.translate import _27from openerp.tools.translate import _
28from openerp.tools import float_compare28from openerp.tools import float_compare
29from openerp.report import report_sxw29from openerp.report import report_sxw
30import openerp
3031
31class res_currency(osv.osv):32class res_currency(osv.osv):
32 _inherit = "res.currency"33 _inherit = "res.currency"
@@ -1098,11 +1099,15 @@
1098 if amount_residual > 0:1099 if amount_residual > 0:
1099 account_id = line.voucher_id.company_id.expense_currency_exchange_account_id1100 account_id = line.voucher_id.company_id.expense_currency_exchange_account_id
1100 if not account_id:1101 if not account_id:
1101 raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Loss Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))1102 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_form')
1103 msg = _("You should configure the 'Loss Exchange Rate Account' to manage automatically the booking of accounting entries related to differences between exchange rates.")
1104 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
1102 else:1105 else:
1103 account_id = line.voucher_id.company_id.income_currency_exchange_account_id1106 account_id = line.voucher_id.company_id.income_currency_exchange_account_id
1104 if not account_id:1107 if not account_id:
1105 raise osv.except_osv(_('Insufficient Configuration!'),_("You should configure the 'Gain Exchange Rate Account' in the accounting settings, to manage automatically the booking of accounting entries related to differences between exchange rates."))1108 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_form')
1109 msg = _("You should configure the 'Gain Exchange Rate Account' to manage automatically the booking of accounting entries related to differences between exchange rates.")
1110 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
1106 # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise1111 # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise
1107 # the receivable/payable account may have a secondary currency, which render this field mandatory1112 # the receivable/payable account may have a secondary currency, which render this field mandatory
1108 if line.account_id.currency_id:1113 if line.account_id.currency_id:
11091114
=== modified file 'google_drive/google_drive.py'
--- google_drive/google_drive.py 2014-01-29 12:13:16 +0000
+++ google_drive/google_drive.py 2014-05-12 04:46:05 +0000
@@ -27,6 +27,7 @@
27import urllib227import urllib2
28import json28import json
29import re29import re
30import openerp
3031
31_logger = logging.getLogger(__name__)32_logger = logging.getLogger(__name__)
3233
@@ -63,7 +64,9 @@
63 user_is_admin = self.pool['res.users'].has_group(cr, uid, 'base.group_erp_manager')64 user_is_admin = self.pool['res.users'].has_group(cr, uid, 'base.group_erp_manager')
64 if not google_drive_refresh_token:65 if not google_drive_refresh_token:
65 if user_is_admin:66 if user_is_admin:
66 raise self.pool.get('res.config.settings').get_config_warning(cr, _("You haven't configured 'Authorization Code' generated from google, Please generate and configure it in %(menu:base_setup.menu_general_configuration)s."), context=context)67 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base_setup', 'action_general_configuration')
68 msg = _("You haven't configured 'Authorization Code' generated from google, Please generate and configure it .")
69 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
67 else:70 else:
68 raise osv.except_osv(_('Error!'), _("Google Drive is not yet configured. Please contact your administrator."))71 raise osv.except_osv(_('Error!'), _("Google Drive is not yet configured. Please contact your administrator."))
69 google_drive_client_id = ir_config.get_param(cr, SUPERUSER_ID, 'google_drive_client_id')72 google_drive_client_id = ir_config.get_param(cr, SUPERUSER_ID, 'google_drive_client_id')
@@ -81,7 +84,9 @@
81 content = urllib2.urlopen(req).read()84 content = urllib2.urlopen(req).read()
82 except urllib2.HTTPError:85 except urllib2.HTTPError:
83 if user_is_admin:86 if user_is_admin:
84 raise self.pool.get('res.config.settings').get_config_warning(cr, _("Something went wrong during the token generation. Please request again an authorization code in %(menu:base_setup.menu_general_configuration)s."), context=context)87 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base_setup', 'action_general_configuration')
88 msg = _("Something went wrong during the token generation. Please request again an authorization code .")
89 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
85 else:90 else:
86 raise osv.except_osv(_('Error!'), _("Google Drive is not yet configured. Please contact your administrator."))91 raise osv.except_osv(_('Error!'), _("Google Drive is not yet configured. Please contact your administrator."))
87 content = json.loads(content)92 content = json.loads(content)
@@ -98,7 +103,7 @@
98 req = urllib2.Request(request_url, None, headers)103 req = urllib2.Request(request_url, None, headers)
99 parents = urllib2.urlopen(req).read()104 parents = urllib2.urlopen(req).read()
100 except urllib2.HTTPError:105 except urllib2.HTTPError:
101 raise self.pool.get('res.config.settings').get_config_warning(cr, _("The Google Template cannot be found. Maybe it has been deleted."), context=context)106 raise osv.except_osv(_('Warning!'), _("The Google Template cannot be found. Maybe it has been deleted."))
102 parents_dict = json.loads(parents)107 parents_dict = json.loads(parents)
103108
104 record_url = "Click on link to open Record in OpenERP\n %s/?db=%s#id=%s&model=%s" % (google_web_base_url, cr.dbname, res_id, res_model)109 record_url = "Click on link to open Record in OpenERP\n %s/?db=%s#id=%s&model=%s" % (google_web_base_url, cr.dbname, res_id, res_model)
105110
=== modified file 'hr_timesheet/hr_timesheet.py'
--- hr_timesheet/hr_timesheet.py 2014-04-14 11:56:04 +0000
+++ hr_timesheet/hr_timesheet.py 2014-05-12 04:46:05 +0000
@@ -24,6 +24,7 @@
24from openerp.osv import fields24from openerp.osv import fields
25from openerp.osv import osv25from openerp.osv import osv
26from openerp.tools.translate import _26from openerp.tools.translate import _
27import openerp
2728
28class hr_employee(osv.osv):29class hr_employee(osv.osv):
29 _name = "hr.employee"30 _name = "hr.employee"
@@ -147,7 +148,9 @@
147 else:148 else:
148 emp_id = emp_obj.search(cr, uid, [('user_id','=',context.get('user_id') or uid)], limit=1, context=context)149 emp_id = emp_obj.search(cr, uid, [('user_id','=',context.get('user_id') or uid)], limit=1, context=context)
149 if not emp_id:150 if not emp_id:
150 raise osv.except_osv(_('Warning!'), _('Please create an employee for this user, using the menu: Human Resources > Employees.'))151 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'hr', 'open_view_employee_list_my')
152 msg = _("Employee is not created for this user. Please create one from configuration panel.")
153 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
151 emp = emp_obj.browse(cr, uid, emp_id[0], context=context)154 emp = emp_obj.browse(cr, uid, emp_id[0], context=context)
152 if emp.journal_id:155 if emp.journal_id:
153 return emp.journal_id.id156 return emp.journal_id.id
154157
=== modified file 'mail/res_users.py'
--- mail/res_users.py 2014-04-14 07:18:01 +0000
+++ mail/res_users.py 2014-05-12 04:46:05 +0000
@@ -22,6 +22,7 @@
22from openerp.osv import fields, osv22from openerp.osv import fields, osv
23from openerp import SUPERUSER_ID23from openerp import SUPERUSER_ID
24from openerp.tools.translate import _24from openerp.tools.translate import _
25import openerp
2526
2627
27class res_users(osv.Model):28class res_users(osv.Model):
@@ -68,7 +69,9 @@
6869
69 def create(self, cr, uid, data, context=None):70 def create(self, cr, uid, data, context=None):
70 if not data.get('login', False):71 if not data.get('login', False):
71 raise osv.except_osv(_('Invalid Action!'), _('You may not create a user. To create new users, you should use the "Settings > Users" menu.'))72 model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base', 'action_res_users')
73 msg = _("You cannot create a new user from here.\n To create new user please go to configuration panel.")
74 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
72 if context is None:75 if context is None:
73 context = {}76 context = {}
7477

Subscribers

People subscribed via source and target branches

to all changes: