Merge lp:~openerp-dev/openobject-addons/trunk-improve-configuration-warnings-tpa into lp:openobject-addons
- trunk-improve-configuration-warnings-tpa
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email: mp+217238@code.launchpad.net |
Commit message
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.
- 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-claimcoun
t-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
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 | 925 | ids = self.search(cr, uid, args, context=context) | 925 | ids = self.search(cr, uid, args, context=context) |
6 | 926 | if not ids: | 926 | if not ids: |
7 | 927 | if exception: | 927 | if exception: |
9 | 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') |
10 | 929 | msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods and configure a fiscal year.') % dt | ||
11 | 930 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
12 | 929 | else: | 931 | else: |
13 | 930 | return [] | 932 | return [] |
14 | 931 | return ids | 933 | return ids |
15 | @@ -1015,10 +1017,9 @@ | |||
16 | 1015 | if not result: | 1017 | if not result: |
17 | 1016 | result = self.search(cr, uid, args, context=context) | 1018 | result = self.search(cr, uid, args, context=context) |
18 | 1017 | if not result: | 1019 | if not result: |
21 | 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') |
22 | 1019 | msg = _('There is no period defined for this date: %s.\nPlease, go to Configuration/Periods and configure a fiscal year.') % dt | 1021 | msg = _('There is no period defined for this date: %s.\nPlease go to Configuration/Periods.') % dt |
23 | 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')) |
24 | 1021 | |||
25 | 1022 | return result | 1023 | return result |
26 | 1023 | 1024 | ||
27 | 1024 | def action_draft(self, cr, uid, ids, *args): | 1025 | def action_draft(self, cr, uid, ids, *args): |
28 | 1025 | 1026 | ||
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 | 470 | return True | 470 | return True |
34 | 471 | 471 | ||
35 | 472 | def onchange_partner_id(self, cr, uid, ids, type, partner_id,\ | 472 | def onchange_partner_id(self, cr, uid, ids, type, partner_id,\ |
37 | 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): |
38 | 474 | partner_payment_term = False | 474 | partner_payment_term = False |
39 | 475 | acc_id = False | 475 | acc_id = False |
40 | 476 | bank_id = False | 476 | bank_id = False |
41 | @@ -495,8 +495,9 @@ | |||
42 | 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 False | 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 False |
43 | 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 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 False |
44 | 497 | if not rec_res_id and not pay_res_id: | 497 | if not rec_res_id and not pay_res_id: |
47 | 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') |
48 | 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.') |
49 | 500 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
50 | 500 | account_obj = self.pool.get('account.account') | 501 | account_obj = self.pool.get('account.account') |
51 | 501 | rec_obj_acc = account_obj.browse(cr, uid, [rec_res_id]) | 502 | rec_obj_acc = account_obj.browse(cr, uid, [rec_res_id]) |
52 | 502 | pay_obj_acc = account_obj.browse(cr, uid, [pay_res_id]) | 503 | pay_obj_acc = account_obj.browse(cr, uid, [pay_res_id]) |
53 | @@ -606,8 +607,9 @@ | |||
54 | 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 False | 607 | 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 | 607 | 608 | ||
56 | 608 | if not rec_res_id and not pay_res_id: | 609 | if not rec_res_id and not pay_res_id: |
59 | 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') |
60 | 610 | 611 | msg = _('Cannot find a chart of accounts for this company, You should configure it. \nPlease go to Account Configuration.') | |
61 | 612 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
62 | 611 | if type in ('out_invoice', 'out_refund'): | 613 | if type in ('out_invoice', 'out_refund'): |
63 | 612 | acc_id = rec_res_id | 614 | acc_id = rec_res_id |
64 | 613 | else: | 615 | else: |
65 | @@ -622,8 +624,9 @@ | |||
66 | 622 | if line.account_id.company_id.id != company_id: | 624 | if line.account_id.company_id.id != company_id: |
67 | 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)]) |
68 | 624 | if not result_id: | 626 | if not result_id: |
71 | 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') |
72 | 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.') |
73 | 629 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
74 | 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]}) |
75 | 628 | else: | 631 | else: |
76 | 629 | if invoice_line: | 632 | if invoice_line: |
77 | @@ -651,12 +654,9 @@ | |||
78 | 651 | if r[1] == 'journal_id' and r[2] in journal_ids: | 654 | if r[1] == 'journal_id' and r[2] in journal_ids: |
79 | 652 | val['journal_id'] = r[2] | 655 | val['journal_id'] = r[2] |
80 | 653 | if not val.get('journal_id', False): | 656 | if not val.get('journal_id', False): |
87 | 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') |
88 | 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() |
89 | 656 | context.get('lang'), | 659 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) |
84 | 657 | journal_type_map.get(journal_type)) | ||
85 | 658 | raise osv.except_osv(_('Configuration Error!'), | ||
86 | 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)) | ||
90 | 660 | dom = {'journal_id': [('id', 'in', journal_ids)]} | 660 | dom = {'journal_id': [('id', 'in', journal_ids)]} |
91 | 661 | else: | 661 | else: |
92 | 662 | journal_ids = obj_journal.search(cr, uid, []) | 662 | journal_ids = obj_journal.search(cr, uid, []) |
93 | 663 | 663 | ||
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 | 31 | from openerp.tools.translate import _ | 31 | from openerp.tools.translate import _ |
99 | 32 | import openerp.addons.decimal_precision as dp | 32 | import openerp.addons.decimal_precision as dp |
100 | 33 | from openerp import tools | 33 | from openerp import tools |
101 | 34 | import openerp | ||
102 | 34 | 35 | ||
103 | 35 | class account_move_line(osv.osv): | 36 | class account_move_line(osv.osv): |
104 | 36 | _name = "account.move.line" | 37 | _name = "account.move.line" |
105 | @@ -548,7 +549,9 @@ | |||
106 | 548 | if context.get('journal_type', False): | 549 | if context.get('journal_type', False): |
107 | 549 | jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))]) | 550 | jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))]) |
108 | 550 | if not jids: | 551 | if not jids: |
110 | 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') |
111 | 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() | ||
112 | 554 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
113 | 552 | journal_id = jids[0] | 555 | journal_id = jids[0] |
114 | 553 | return journal_id | 556 | return journal_id |
115 | 554 | 557 | ||
116 | 555 | 558 | ||
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 | 27 | from openerp.tools.translate import _ | 27 | from openerp.tools.translate import _ |
122 | 28 | from openerp.tools import float_compare | 28 | from openerp.tools import float_compare |
123 | 29 | from openerp.report import report_sxw | 29 | from openerp.report import report_sxw |
124 | 30 | import openerp | ||
125 | 30 | 31 | ||
126 | 31 | class res_currency(osv.osv): | 32 | class res_currency(osv.osv): |
127 | 32 | _inherit = "res.currency" | 33 | _inherit = "res.currency" |
128 | @@ -1098,11 +1099,15 @@ | |||
129 | 1098 | if amount_residual > 0: | 1099 | if amount_residual > 0: |
130 | 1099 | account_id = line.voucher_id.company_id.expense_currency_exchange_account_id | 1100 | account_id = line.voucher_id.company_id.expense_currency_exchange_account_id |
131 | 1100 | if not account_id: | 1101 | if not account_id: |
133 | 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') |
134 | 1103 | msg = _("You should configure the 'Loss Exchange Rate Account' to manage automatically the booking of accounting entries related to differences between exchange rates.") | ||
135 | 1104 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
136 | 1102 | else: | 1105 | else: |
137 | 1103 | account_id = line.voucher_id.company_id.income_currency_exchange_account_id | 1106 | account_id = line.voucher_id.company_id.income_currency_exchange_account_id |
138 | 1104 | if not account_id: | 1107 | if not account_id: |
140 | 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') |
141 | 1109 | msg = _("You should configure the 'Gain Exchange Rate Account' to manage automatically the booking of accounting entries related to differences between exchange rates.") | ||
142 | 1110 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
143 | 1106 | # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise | 1111 | # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise |
144 | 1107 | # the receivable/payable account may have a secondary currency, which render this field mandatory | 1112 | # the receivable/payable account may have a secondary currency, which render this field mandatory |
145 | 1108 | if line.account_id.currency_id: | 1113 | if line.account_id.currency_id: |
146 | 1109 | 1114 | ||
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 | 27 | import urllib2 | 27 | import urllib2 |
152 | 28 | import json | 28 | import json |
153 | 29 | import re | 29 | import re |
154 | 30 | import openerp | ||
155 | 30 | 31 | ||
156 | 31 | _logger = logging.getLogger(__name__) | 32 | _logger = logging.getLogger(__name__) |
157 | 32 | 33 | ||
158 | @@ -63,7 +64,9 @@ | |||
159 | 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') |
160 | 64 | if not google_drive_refresh_token: | 65 | if not google_drive_refresh_token: |
161 | 65 | if user_is_admin: | 66 | if user_is_admin: |
163 | 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') |
164 | 68 | msg = _("You haven't configured 'Authorization Code' generated from google, Please generate and configure it .") | ||
165 | 69 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
166 | 67 | else: | 70 | else: |
167 | 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.")) |
168 | 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') |
169 | @@ -81,7 +84,9 @@ | |||
170 | 81 | content = urllib2.urlopen(req).read() | 84 | content = urllib2.urlopen(req).read() |
171 | 82 | except urllib2.HTTPError: | 85 | except urllib2.HTTPError: |
172 | 83 | if user_is_admin: | 86 | if user_is_admin: |
174 | 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') |
175 | 88 | msg = _("Something went wrong during the token generation. Please request again an authorization code .") | ||
176 | 89 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
177 | 85 | else: | 90 | else: |
178 | 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.")) |
179 | 87 | content = json.loads(content) | 92 | content = json.loads(content) |
180 | @@ -98,7 +103,7 @@ | |||
181 | 98 | req = urllib2.Request(request_url, None, headers) | 103 | req = urllib2.Request(request_url, None, headers) |
182 | 99 | parents = urllib2.urlopen(req).read() | 104 | parents = urllib2.urlopen(req).read() |
183 | 100 | except urllib2.HTTPError: | 105 | except urllib2.HTTPError: |
185 | 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.")) |
186 | 102 | parents_dict = json.loads(parents) | 107 | parents_dict = json.loads(parents) |
187 | 103 | 108 | ||
188 | 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) |
189 | 105 | 110 | ||
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 | 24 | from openerp.osv import fields | 24 | from openerp.osv import fields |
195 | 25 | from openerp.osv import osv | 25 | from openerp.osv import osv |
196 | 26 | from openerp.tools.translate import _ | 26 | from openerp.tools.translate import _ |
197 | 27 | import openerp | ||
198 | 27 | 28 | ||
199 | 28 | class hr_employee(osv.osv): | 29 | class hr_employee(osv.osv): |
200 | 29 | _name = "hr.employee" | 30 | _name = "hr.employee" |
201 | @@ -147,7 +148,9 @@ | |||
202 | 147 | else: | 148 | else: |
203 | 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) |
204 | 149 | if not emp_id: | 150 | if not emp_id: |
206 | 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') |
207 | 152 | msg = _("Employee is not created for this user. Please create one from configuration panel.") | ||
208 | 153 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
209 | 151 | emp = emp_obj.browse(cr, uid, emp_id[0], context=context) | 154 | emp = emp_obj.browse(cr, uid, emp_id[0], context=context) |
210 | 152 | if emp.journal_id: | 155 | if emp.journal_id: |
211 | 153 | return emp.journal_id.id | 156 | return emp.journal_id.id |
212 | 154 | 157 | ||
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 | 22 | from openerp.osv import fields, osv | 22 | from openerp.osv import fields, osv |
218 | 23 | from openerp import SUPERUSER_ID | 23 | from openerp import SUPERUSER_ID |
219 | 24 | from openerp.tools.translate import _ | 24 | from openerp.tools.translate import _ |
220 | 25 | import openerp | ||
221 | 25 | 26 | ||
222 | 26 | 27 | ||
223 | 27 | class res_users(osv.Model): | 28 | class res_users(osv.Model): |
224 | @@ -68,7 +69,9 @@ | |||
225 | 68 | 69 | ||
226 | 69 | def create(self, cr, uid, data, context=None): | 70 | def create(self, cr, uid, data, context=None): |
227 | 70 | if not data.get('login', False): | 71 | if not data.get('login', False): |
229 | 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') |
230 | 73 | msg = _("You cannot create a new user from here.\n To create new user please go to configuration panel.") | ||
231 | 74 | raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel')) | ||
232 | 72 | if context is None: | 75 | if context is None: |
233 | 73 | context = {} | 76 | context = {} |
234 | 74 | 77 |