[FIX] account, base_setup, hr_timesheet_sheet: improve server actions: remove pointless references to self, don't access ids if they're not needed

bzr revid: xmo@openerp.com-20110912144925-xlpofswq106x3ds4
This commit is contained in:
Xavier Morel 2011-09-12 16:49:25 +02:00
parent f03892c5db
commit c02863060f
3 changed files with 6 additions and 6 deletions

View File

@ -2426,10 +2426,10 @@
<field name="model_id" ref="base.model_ir_actions_todo"/>
<field eval="5" name="sequence"/>
<field name="code">
act_window_ids = self.pool.get('ir.actions.act_window').search(cr, uid,[('name', 'in', ('Accounting Chart Configuration', 'Generate Chart of Accounts from a Chart Template'))], context=context)
todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', act_window_ids)], context=context)
self.pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
action = self.pool.get('res.config').next(cr, uid, [], context)
act_window_ids = pool.get('ir.actions.act_window').search(cr, uid,[('name', 'in', ('Accounting Chart Configuration', 'Generate Chart of Accounts from a Chart Template'))], context=context)
todo_ids = pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', act_window_ids)], context=context)
pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
action = pool.get('res.config').next(cr, uid, [], context)
</field>
<field name="name">New Company Financial Setting</field>
</record>

View File

@ -79,7 +79,7 @@
<field name="name">Start Configuration</field>
<field name="model_id" ref="base.model_ir_actions_todo"/>
<field name="state">code</field>
<field name="code" eval="'# obj is a browse_record and will provide stupid ids to method\n' 'action = obj.pool.get(\'ir.actions.todo\').action_launch(cr, uid, ' + str([ref('base_setup_installer_todo')]) + ', context=context)'"/>
<field name="code" eval="'# obj is a browse_record and will provide stupid ids to method\n' 'action = pool.get(\'ir.actions.todo\').action_launch(cr, uid, ' + str([ref('base_setup_installer_todo')]) + ', context=context)'"/>
</record>
<menuitem name="Add More Features" action="action_start_configurator" id="menu_view_base_module_configuration" parent="base.menu_config" type="server" icon="STOCK_EXECUTE" sequence="100"/>

View File

@ -7,7 +7,7 @@
<field eval="&quot;&quot;&quot;ir.actions.server&quot;&quot;&quot;" name="type"/>
<field name="model_id" ref="model_hr_timesheet_current_open"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval="&quot;&quot;&quot;action = self.pool.get('hr.timesheet.current.open').open_timesheet(cr, uid, object.id, context)&quot;&quot;&quot;" name="code"/>
<field eval="&quot;&quot;&quot;action = pool.get('hr.timesheet.current.open').open_timesheet(cr, uid, None, context)&quot;&quot;&quot;" name="code"/>
<field eval="&quot;&quot;&quot;True&quot;&quot;&quot;" name="condition"/>
<field eval="&quot;&quot;&quot;My Timesheet&quot;&quot;&quot;" name="name"/>
</record>