From efb04bdaba184fbbe30e6301a793ec7d35357cab Mon Sep 17 00:00:00 2001 From: fka-odoo Date: Mon, 13 Apr 2015 18:35:17 +0530 Subject: [PATCH] [REM] ir_ui_menu: remove icon attribute --- .../account/views/account_analytic_view.xml | 1 - .../hr_timesheet_analytic_profit_view.xml | 2 +- .../wizard/hr_timesheet_current_view.xml | 2 +- addons/mrp_operations/mrp_operations_view.xml | 7 +--- addons/point_of_sale/point_of_sale_view.xml | 2 +- openerp/addons/base/ir/ir_model.py | 3 +- openerp/addons/base/ir/ir_ui_menu.py | 13 ------ openerp/addons/test_exceptions/view.xml | 2 +- openerp/addons/test_new_api/views.xml | 2 +- openerp/addons/test_workflow/data.xml | 2 +- .../addons/test_translation_import/view.xml | 2 +- openerp/tools/misc.py | 42 ------------------- openerp/tools/yaml_import.py | 19 --------- 13 files changed, 9 insertions(+), 90 deletions(-) diff --git a/addons/account/views/account_analytic_view.xml b/addons/account/views/account_analytic_view.xml index c0bec16c78b..ec8c6949166 100644 --- a/addons/account/views/account_analytic_view.xml +++ b/addons/account/views/account_analytic_view.xml @@ -98,7 +98,6 @@ parent="menu_finance_entries" action="analytic.action_account_analytic_chart" id="menu_action_analytic_account_tree2" - icon="STOCK_INDENT" sequence="30" groups="analytic.group_analytic_accounting"/> + parent="hr_timesheet.menu_timesheets_reports" sequence="3"/> diff --git a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml index 196bc846bc7..2563bbfed05 100644 --- a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml +++ b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current_view.xml @@ -28,7 +28,7 @@ My Timesheet opens your timesheet so that you can book your activities into the system. From the same form, you can register your attendances (Sign In/Out) and describe the working hours made on the different projects. At the end of the period defined in the company, the timesheet is confirmed by the user and can be validated by his manager. If required, as defined on the project, you can generate the invoices based on the timesheet. - + diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index 043b0487cbd..850f80ed4d7 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -263,12 +263,7 @@ - + sequence="2"/> diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 70a5dbdb55f..1a70cccb767 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -613,7 +613,7 @@ [('origin','like','POS')] - diff --git a/openerp/addons/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py index 6120c671235..f7fea3a28fd 100644 --- a/openerp/addons/base/ir/ir_model.py +++ b/openerp/addons/base/ir/ir_model.py @@ -1254,7 +1254,6 @@ class wizard_model_menu(osv.osv_memory): self.pool.get('ir.ui.menu').create(cr, uid, { 'name': menu.name, 'parent_id': menu.menu_id.id, - 'action': 'ir.actions.act_window,%d' % (action_id,), - 'icon': 'STOCK_INDENT' + 'action': 'ir.actions.act_window,%d' % (action_id,) }, context) return {'type':'ir.actions.act_window_close'} diff --git a/openerp/addons/base/ir/ir_ui_menu.py b/openerp/addons/base/ir/ir_ui_menu.py index 23db483fcca..b73139a4a83 100644 --- a/openerp/addons/base/ir/ir_ui_menu.py +++ b/openerp/addons/base/ir/ir_ui_menu.py @@ -213,17 +213,6 @@ class ir_ui_menu(osv.osv): # value is False, remove existing binding ir_values_obj.unlink(cursor, user, values_ids, context=ctx) - def _get_icon_pict(self, cr, uid, ids, name, args, context): - res = {} - for m in self.browse(cr, uid, ids, context=context): - res[m.id] = ('stock', (m.icon,'ICON_SIZE_MENU')) - return res - - def onchange_icon(self, cr, uid, ids, icon): - if not icon: - return {} - return {'type': {'icon_pict': 'picture'}, 'value': {'icon_pict': ('stock', (icon,'ICON_SIZE_MENU'))}} - def read_image(self, path): if not path: return False @@ -399,7 +388,6 @@ class ir_ui_menu(osv.osv): 'complete_name': fields.function(_get_full_name, string='Full Path', type='char', size=128), 'icon': fields.char('Icon', size=64), - 'icon_pict': fields.function(_get_icon_pict, type='char', size=32), 'web_icon': fields.char('Web Icon File'), 'web_icon_hover': fields.char('Web Icon File (hover)'), 'web_icon_data': fields.function(_get_image_icon, string='Web Icon Image', type='binary', readonly=True, store=True, multi='icon'), @@ -428,7 +416,6 @@ class ir_ui_menu(osv.osv): (osv.osv._check_recursion, _rec_message, ['parent_id']) ] _defaults = { - 'icon_pict': ('stock', ('STOCK_OPEN', 'ICON_SIZE_MENU')), 'sequence': 10, } _order = "sequence,id" diff --git a/openerp/addons/test_exceptions/view.xml b/openerp/addons/test_exceptions/view.xml index 35ba1e6fc20..e8f5bd1c507 100644 --- a/openerp/addons/test_exceptions/view.xml +++ b/openerp/addons/test_exceptions/view.xml @@ -118,7 +118,7 @@ new - + diff --git a/openerp/addons/test_new_api/views.xml b/openerp/addons/test_new_api/views.xml index 294f7ccd207..935723818b6 100644 --- a/openerp/addons/test_new_api/views.xml +++ b/openerp/addons/test_new_api/views.xml @@ -1,6 +1,6 @@ - + diff --git a/openerp/addons/test_workflow/data.xml b/openerp/addons/test_workflow/data.xml index bfedd28ded3..5a592836554 100644 --- a/openerp/addons/test_workflow/data.xml +++ b/openerp/addons/test_workflow/data.xml @@ -25,7 +25,7 @@ tree,form - + diff --git a/openerp/tests/addons/test_translation_import/view.xml b/openerp/tests/addons/test_translation_import/view.xml index f19a6baf9fc..87d7f47a100 100644 --- a/openerp/tests/addons/test_translation_import/view.xml +++ b/openerp/tests/addons/test_translation_import/view.xml @@ -11,7 +11,7 @@ current - + diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index 36240d1470c..ef84a0ab45d 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -608,48 +608,6 @@ class profile(object): return wrapper -__icons_list = ['STOCK_ABOUT', 'STOCK_ADD', 'STOCK_APPLY', 'STOCK_BOLD', -'STOCK_CANCEL', 'STOCK_CDROM', 'STOCK_CLEAR', 'STOCK_CLOSE', 'STOCK_COLOR_PICKER', -'STOCK_CONNECT', 'STOCK_CONVERT', 'STOCK_COPY', 'STOCK_CUT', 'STOCK_DELETE', -'STOCK_DIALOG_AUTHENTICATION', 'STOCK_DIALOG_ERROR', 'STOCK_DIALOG_INFO', -'STOCK_DIALOG_QUESTION', 'STOCK_DIALOG_WARNING', 'STOCK_DIRECTORY', 'STOCK_DISCONNECT', -'STOCK_DND', 'STOCK_DND_MULTIPLE', 'STOCK_EDIT', 'STOCK_EXECUTE', 'STOCK_FILE', -'STOCK_FIND', 'STOCK_FIND_AND_REPLACE', 'STOCK_FLOPPY', 'STOCK_GOTO_BOTTOM', -'STOCK_GOTO_FIRST', 'STOCK_GOTO_LAST', 'STOCK_GOTO_TOP', 'STOCK_GO_BACK', -'STOCK_GO_DOWN', 'STOCK_GO_FORWARD', 'STOCK_GO_UP', 'STOCK_HARDDISK', -'STOCK_HELP', 'STOCK_HOME', 'STOCK_INDENT', 'STOCK_INDEX', 'STOCK_ITALIC', -'STOCK_JUMP_TO', 'STOCK_JUSTIFY_CENTER', 'STOCK_JUSTIFY_FILL', -'STOCK_JUSTIFY_LEFT', 'STOCK_JUSTIFY_RIGHT', 'STOCK_MEDIA_FORWARD', -'STOCK_MEDIA_NEXT', 'STOCK_MEDIA_PAUSE', 'STOCK_MEDIA_PLAY', -'STOCK_MEDIA_PREVIOUS', 'STOCK_MEDIA_RECORD', 'STOCK_MEDIA_REWIND', -'STOCK_MEDIA_STOP', 'STOCK_MISSING_IMAGE', 'STOCK_NETWORK', 'STOCK_NEW', -'STOCK_NO', 'STOCK_OK', 'STOCK_OPEN', 'STOCK_PASTE', 'STOCK_PREFERENCES', -'STOCK_PRINT', 'STOCK_PRINT_PREVIEW', 'STOCK_PROPERTIES', 'STOCK_QUIT', -'STOCK_REDO', 'STOCK_REFRESH', 'STOCK_REMOVE', 'STOCK_REVERT_TO_SAVED', -'STOCK_SAVE', 'STOCK_SAVE_AS', 'STOCK_SELECT_COLOR', 'STOCK_SELECT_FONT', -'STOCK_SORT_ASCENDING', 'STOCK_SORT_DESCENDING', 'STOCK_SPELL_CHECK', -'STOCK_STOP', 'STOCK_STRIKETHROUGH', 'STOCK_UNDELETE', 'STOCK_UNDERLINE', -'STOCK_UNDO', 'STOCK_UNINDENT', 'STOCK_YES', 'STOCK_ZOOM_100', -'STOCK_ZOOM_FIT', 'STOCK_ZOOM_IN', 'STOCK_ZOOM_OUT', -'terp-account', 'terp-crm', 'terp-mrp', 'terp-product', 'terp-purchase', -'terp-sale', 'terp-tools', 'terp-administration', 'terp-hr', 'terp-partner', -'terp-project', 'terp-report', 'terp-stock', 'terp-calendar', 'terp-graph', -'terp-check','terp-go-month','terp-go-year','terp-go-today','terp-document-new','terp-camera_test', -'terp-emblem-important','terp-gtk-media-pause','terp-gtk-stop','terp-gnome-cpu-frequency-applet+', -'terp-dialog-close','terp-gtk-jump-to-rtl','terp-gtk-jump-to-ltr','terp-accessories-archiver', -'terp-stock_align_left_24','terp-stock_effects-object-colorize','terp-go-home','terp-gtk-go-back-rtl', -'terp-gtk-go-back-ltr','terp-personal','terp-personal-','terp-personal+','terp-accessories-archiver-minus', -'terp-accessories-archiver+','terp-stock_symbol-selection','terp-call-start','terp-dolar', -'terp-face-plain','terp-folder-blue','terp-folder-green','terp-folder-orange','terp-folder-yellow', -'terp-gdu-smart-failing','terp-go-week','terp-gtk-select-all','terp-locked','terp-mail-forward', -'terp-mail-message-new','terp-mail-replied','terp-rating-rated','terp-stage','terp-stock_format-scientific', -'terp-dolar_ok!','terp-idea','terp-stock_format-default','terp-mail-','terp-mail_delete' -] - -def icons(*a, **kw): - global __icons_list - return [(x, x) for x in __icons_list ] - def detect_ip_addr(): """Try a very crude method to figure out a valid external IP or hostname for the current machine. Don't rely on this diff --git a/openerp/tools/yaml_import.py b/openerp/tools/yaml_import.py index c7bdc8c5375..126c7843db2 100644 --- a/openerp/tools/yaml_import.py +++ b/openerp/tools/yaml_import.py @@ -715,13 +715,6 @@ class YamlInterpreter(object): if node.action: action_type = node.type or 'act_window' - icons = { - "act_window": 'STOCK_NEW', - "report.xml": 'STOCK_PASTE', - "wizard": 'STOCK_EXECUTE', - "url": 'STOCK_JUMP_TO', - } - values['icon'] = icons.get(action_type, 'STOCK_NEW') if action_type == 'act_window': action_id = self.get_id(node.action) self.cr.execute('select view_type,view_mode,name,view_id,target from ir_act_window where id=%s', (action_id,)) @@ -736,16 +729,6 @@ class YamlInterpreter(object): self.cr.execute('SELECT view_mode FROM ir_act_window_view WHERE act_window_id=%s ORDER BY sequence LIMIT 1', (action_id,)) if self.cr.rowcount: action_mode = self.cr.fetchone() - if action_type == 'tree': - values['icon'] = 'STOCK_INDENT' - elif action_mode and action_mode.startswith('tree'): - values['icon'] = 'STOCK_JUSTIFY_FILL' - elif action_mode and action_mode.startswith('graph'): - values['icon'] = 'terp-graph' - elif action_mode and action_mode.startswith('calendar'): - values['icon'] = 'terp-calendar' - if target == 'new': - values['icon'] = 'STOCK_EXECUTE' if not values.get('name', False): values['name'] = action_name elif action_type == 'wizard': @@ -758,8 +741,6 @@ class YamlInterpreter(object): raise YamlImportException("Unsupported type '%s' in menuitem tag." % action_type) if node.sequence: values['sequence'] = node.sequence - if node.icon: - values['icon'] = node.icon self._set_group_values(node, values)