[IMP] todos: rename 'special' type to 'automatic', remove 'recurring' type, remove 'hidden' state, fix relevant code sections

bzr revid: xmo@openerp.com-20110729142622-yxvi33planv3m5a0
This commit is contained in:
Xavier Morel 2011-07-29 16:26:22 +02:00
parent ce4d05a29c
commit f723234f4d
4 changed files with 10 additions and 19 deletions

View File

@ -306,7 +306,7 @@
<record id="config_wizard_simple_view" model="ir.actions.todo">
<field name="action_id" ref="action_config_simple_view_form"/>
<field name="category_id" ref="category_administration_config"/>
<field name="type">special</field>
<field name="type">automatic</field>
<field name="sequence">1</field>
</record>

View File

@ -1889,7 +1889,7 @@
<field name="type"/>
<field name="state" readonly="1"/>
<button name="action_launch" states="open" string="Launch" type="object" icon="gtk-execute" help="Launch Configuration Wizard"/>
<button name="action_open" states="cancel,skip,done"
<button name="action_open" states="done"
string="Todo" type="object" help="Set as Todo"
icon="gtk-convert"/>
</tree>
@ -1913,7 +1913,7 @@
<group colspan="4" col="4">
<field name="state" colspan="2" readonly="1"/>
<button name="action_launch" states="open" string="Launch" type="object" icon="gtk-execute" help="Launch Configuration Wizard"/>
<button name="action_open" states="cancel,skip,done"
<button name="action_open" states="done"
string="Set as Todo" type="object"
icon="gtk-convert"/>
</group>

View File

@ -817,11 +817,9 @@ ir_actions_todo_category()
# This model use to register action services.
TODO_STATES = [('open', 'To Do'),
('done', 'Done'),
('hidden', 'Hidden')]
TODO_TYPES = [('special', 'Special'),
('normal', 'Normal'),
('recurring', 'Recurring')]
('done', 'Done')]
TODO_TYPES = [('manual', 'Launch Manually'),
('automatic', 'Launch Automatically')]
class ir_actions_todo(osv.osv):
"""
Configuration Wizards
@ -846,7 +844,7 @@ Recurring: the wizard is visible in the configuration panel regardless of its st
_defaults={
'state': 'open',
'sequence': 10,
'type': 'special',
'type': 'manual',
}
_order="sequence,name,id"
@ -854,8 +852,6 @@ Recurring: the wizard is visible in the configuration panel regardless of its st
""" Launch Action of Wizard"""
wizard_id = ids and ids[0] or False
wizard = self.browse(cr, uid, wizard_id, context=context)
# mark todo as done immediately
wizard.write({'state': 'done'})
res = self.pool.get('ir.actions.act_window').read(cr, uid, wizard.action_id.id, [], context=context)
res['nodestroy'] = True
@ -896,13 +892,13 @@ Recurring: the wizard is visible in the configuration panel regardless of its st
done = filter(
groups_match,
self.browse(cr, uid,
self.search(cr, uid, ['&', ('state', '!=', 'open'), ('type', '!=', 'special')], context=context),
self.search(cr, uid, ['&', ('state', '!=', 'open'), ('type', '=', 'manual')], context=context),
context=context))
total = filter(
groups_match,
self.browse(cr, uid,
self.search(cr, uid, [('type', '!=', 'special')], context=context),
self.search(cr, uid, [('type', '=', 'manual')], context=context),
context=context))
return {

View File

@ -65,7 +65,7 @@ class res_config_configurable(osv.osv_memory):
self.__logger.info('getting next %s', Todos)
active_todos = Todos.browse(cr, uid,
Todos.search(cr, uid, ['&', ('type', '=', 'special'), ('state','=','open')]),
Todos.search(cr, uid, ['&', ('type', '=', 'automatic'), ('state','=','open')]),
context=context)
user_groups = set(map(
@ -98,11 +98,6 @@ class res_config_configurable(osv.osv_memory):
return self.pool.get(current_user_menu.type).read(cr, uid, current_user_menu.id)
def start(self, cr, uid, ids, context=None):
todo_pool = self.pool.get('ir.actions.todo')
ids2 = todo_pool.search(cr, uid, [], context=context)
for todo in todo_pool.browse(cr, uid, ids2, context=context):
if todo.type == 'recurring':
todo.write({'state':'open'})
return self.next(cr, uid, ids, context)
def next(self, cr, uid, ids, context=None):