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
1=== modified file 'account/account.py'
2--- account/account.py 2014-04-24 13:45:33 +0000
3+++ account/account.py 2014-05-12 04:46:05 +0000
4@@ -925,7 +925,9 @@
5 ids = self.search(cr, uid, args, context=context)
6 if not ids:
7 if exception:
8- raise osv.except_osv(_('Error!'), _('There is no fiscal year defined for this date.\nPlease create one from the configuration of the accounting menu.'))
9+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_fiscalyear')
10+ msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods and configure a fiscal year.') % dt
11+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
12 else:
13 return []
14 return ids
15@@ -1015,10 +1017,9 @@
16 if not result:
17 result = self.search(cr, uid, args, context=context)
18 if not result:
19- model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_fiscalyear')
20- msg = _('There is no period defined for this date: %s.\nPlease, go to Configuration/Periods and configure a fiscal year.') % dt
21+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_period')
22+ msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods.') % dt
23 raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
24-
25 return result
26
27 def action_draft(self, cr, uid, ids, *args):
28
29=== modified file 'account/account_invoice.py'
30--- account/account_invoice.py 2014-05-07 17:01:12 +0000
31+++ account/account_invoice.py 2014-05-12 04:46:05 +0000
32@@ -470,7 +470,7 @@
33 return True
34
35 def onchange_partner_id(self, cr, uid, ids, type, partner_id,\
36- date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
37+ date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False, context=None):
38 partner_payment_term = False
39 acc_id = False
40 bank_id = False
41@@ -495,8 +495,9 @@
42 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
43 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
44 if not rec_res_id and not pay_res_id:
45- raise osv.except_osv(_('Configuration Error!'),
46- _('Cannot find a chart of accounts for this company, you should create one.'))
47+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_config')
48+ msg = _('Cannot find a chart of accounts for this company, You should configure it. \nPlease go to Account Configuration.')
49+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
50 account_obj = self.pool.get('account.account')
51 rec_obj_acc = account_obj.browse(cr, uid, [rec_res_id])
52 pay_obj_acc = account_obj.browse(cr, uid, [pay_res_id])
53@@ -606,8 +607,9 @@
54 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
55
56 if not rec_res_id and not pay_res_id:
57- 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)
58-
59+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_config')
60+ msg = _('Cannot find a chart of accounts for this company, You should configure it. \nPlease go to Account Configuration.')
61+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
62 if type in ('out_invoice', 'out_refund'):
63 acc_id = rec_res_id
64 else:
65@@ -622,8 +624,9 @@
66 if line.account_id.company_id.id != company_id:
67 result_id = account_obj.search(cr, uid, [('name','=',line.account_id.name),('company_id','=',company_id)])
68 if not result_id:
69- raise osv.except_osv(_('Configuration Error!'),
70- _('Cannot find a chart of account, you should create one from Settings\Configuration\Accounting menu.'))
71+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_config')
72+ msg = _('Cannot find a chart of accounts for this company, You should configure it. \nPlease go to Account Configuration.')
73+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
74 inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[-1]})
75 else:
76 if invoice_line:
77@@ -651,12 +654,9 @@
78 if r[1] == 'journal_id' and r[2] in journal_ids:
79 val['journal_id'] = r[2]
80 if not val.get('journal_id', False):
81- journal_type_map = dict(obj_journal._columns['type'].selection)
82- journal_type_label = self.pool['ir.translation']._get_source(cr, uid, None, ('code','selection'),
83- context.get('lang'),
84- journal_type_map.get(journal_type))
85- raise osv.except_osv(_('Configuration Error!'),
86- _('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))
87+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_journal_form')
88+ 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()
89+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
90 dom = {'journal_id': [('id', 'in', journal_ids)]}
91 else:
92 journal_ids = obj_journal.search(cr, uid, [])
93
94=== modified file 'account/account_move_line.py'
95--- account/account_move_line.py 2014-05-07 17:01:12 +0000
96+++ account/account_move_line.py 2014-05-12 04:46:05 +0000
97@@ -31,6 +31,7 @@
98 from openerp.tools.translate import _
99 import openerp.addons.decimal_precision as dp
100 from openerp import tools
101+import openerp
102
103 class account_move_line(osv.osv):
104 _name = "account.move.line"
105@@ -548,7 +549,9 @@
106 if context.get('journal_type', False):
107 jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))])
108 if not jids:
109- 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'))
110+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_journal_form')
111+ 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()
112+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
113 journal_id = jids[0]
114 return journal_id
115
116
117=== modified file 'account_voucher/account_voucher.py'
118--- account_voucher/account_voucher.py 2014-05-02 13:03:52 +0000
119+++ account_voucher/account_voucher.py 2014-05-12 04:46:05 +0000
120@@ -27,6 +27,7 @@
121 from openerp.tools.translate import _
122 from openerp.tools import float_compare
123 from openerp.report import report_sxw
124+import openerp
125
126 class res_currency(osv.osv):
127 _inherit = "res.currency"
128@@ -1098,11 +1099,15 @@
129 if amount_residual > 0:
130 account_id = line.voucher_id.company_id.expense_currency_exchange_account_id
131 if not account_id:
132- 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."))
133+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_form')
134+ msg = _("You should configure the 'Loss Exchange Rate Account' to manage automatically the booking of accounting entries related to differences between exchange rates.")
135+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
136 else:
137 account_id = line.voucher_id.company_id.income_currency_exchange_account_id
138 if not account_id:
139- 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."))
140+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'account', 'action_account_form')
141+ msg = _("You should configure the 'Gain Exchange Rate Account' to manage automatically the booking of accounting entries related to differences between exchange rates.")
142+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
143 # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise
144 # the receivable/payable account may have a secondary currency, which render this field mandatory
145 if line.account_id.currency_id:
146
147=== modified file 'google_drive/google_drive.py'
148--- google_drive/google_drive.py 2014-01-29 12:13:16 +0000
149+++ google_drive/google_drive.py 2014-05-12 04:46:05 +0000
150@@ -27,6 +27,7 @@
151 import urllib2
152 import json
153 import re
154+import openerp
155
156 _logger = logging.getLogger(__name__)
157
158@@ -63,7 +64,9 @@
159 user_is_admin = self.pool['res.users'].has_group(cr, uid, 'base.group_erp_manager')
160 if not google_drive_refresh_token:
161 if user_is_admin:
162- 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)
163+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base_setup', 'action_general_configuration')
164+ msg = _("You haven't configured 'Authorization Code' generated from google, Please generate and configure it .")
165+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
166 else:
167 raise osv.except_osv(_('Error!'), _("Google Drive is not yet configured. Please contact your administrator."))
168 google_drive_client_id = ir_config.get_param(cr, SUPERUSER_ID, 'google_drive_client_id')
169@@ -81,7 +84,9 @@
170 content = urllib2.urlopen(req).read()
171 except urllib2.HTTPError:
172 if user_is_admin:
173- 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)
174+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base_setup', 'action_general_configuration')
175+ msg = _("Something went wrong during the token generation. Please request again an authorization code .")
176+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
177 else:
178 raise osv.except_osv(_('Error!'), _("Google Drive is not yet configured. Please contact your administrator."))
179 content = json.loads(content)
180@@ -98,7 +103,7 @@
181 req = urllib2.Request(request_url, None, headers)
182 parents = urllib2.urlopen(req).read()
183 except urllib2.HTTPError:
184- raise self.pool.get('res.config.settings').get_config_warning(cr, _("The Google Template cannot be found. Maybe it has been deleted."), context=context)
185+ raise osv.except_osv(_('Warning!'), _("The Google Template cannot be found. Maybe it has been deleted."))
186 parents_dict = json.loads(parents)
187
188 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)
189
190=== modified file 'hr_timesheet/hr_timesheet.py'
191--- hr_timesheet/hr_timesheet.py 2014-04-14 11:56:04 +0000
192+++ hr_timesheet/hr_timesheet.py 2014-05-12 04:46:05 +0000
193@@ -24,6 +24,7 @@
194 from openerp.osv import fields
195 from openerp.osv import osv
196 from openerp.tools.translate import _
197+import openerp
198
199 class hr_employee(osv.osv):
200 _name = "hr.employee"
201@@ -147,7 +148,9 @@
202 else:
203 emp_id = emp_obj.search(cr, uid, [('user_id','=',context.get('user_id') or uid)], limit=1, context=context)
204 if not emp_id:
205- raise osv.except_osv(_('Warning!'), _('Please create an employee for this user, using the menu: Human Resources > Employees.'))
206+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'hr', 'open_view_employee_list_my')
207+ msg = _("Employee is not created for this user. Please create one from configuration panel.")
208+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
209 emp = emp_obj.browse(cr, uid, emp_id[0], context=context)
210 if emp.journal_id:
211 return emp.journal_id.id
212
213=== modified file 'mail/res_users.py'
214--- mail/res_users.py 2014-04-14 07:18:01 +0000
215+++ mail/res_users.py 2014-05-12 04:46:05 +0000
216@@ -22,6 +22,7 @@
217 from openerp.osv import fields, osv
218 from openerp import SUPERUSER_ID
219 from openerp.tools.translate import _
220+import openerp
221
222
223 class res_users(osv.Model):
224@@ -68,7 +69,9 @@
225
226 def create(self, cr, uid, data, context=None):
227 if not data.get('login', False):
228- raise osv.except_osv(_('Invalid Action!'), _('You may not create a user. To create new users, you should use the "Settings > Users" menu.'))
229+ model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base', 'action_res_users')
230+ msg = _("You cannot create a new user from here.\n To create new user please go to configuration panel.")
231+ raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))
232 if context is None:
233 context = {}
234

Subscribers

People subscribed via source and target branches

to all changes: