Sequence on ir.values

Registered by Xavier Fernandez http://www.smile.fr

Adding a sequence on ir.values would enable to specify the order in which we want the Links/Reports/Actions (right panel in form/list view) to show.

And the change is quite light...

=== modified file 'bin/addons/base/ir/ir_values.py'
--- bin/addons/base/ir/ir_values.py 2010-12-06 13:19:28 +0000
+++ bin/addons/base/ir/ir_values.py 2011-03-23 16:26:16 +0000
@@ -30,6 +30,7 @@

 class ir_values(osv.osv):
     _name = 'ir.values'
+ _order = 'sequence, id'

     def _value_unpickle(self, cursor, user, ids, name, arg, context=None):
         res = {}
@@ -85,7 +86,8 @@
             method=True, type='text', string='Metadata'),
         'res_id': fields.integer('Object ID', help="Keep 0 if the action must appear on all resources.", select=True),
         'user_id': fields.many2one('res.users', 'User', ondelete='cascade', select=True),
- 'company_id': fields.many2one('res.company', 'Company', select=True)
+ 'company_id': fields.many2one('res.company', 'Company', select=True),
+ 'sequence': fields.integer('Sequence'),
     }
     _defaults = {
         'key': lambda *a: 'action',
@@ -173,7 +175,7 @@
                     where.append('res_id=%s')
                     params.append(res_id)

- where.append('(user_id=%s or (user_id IS NULL)) order by id')
+ where.append('(user_id=%s or (user_id IS NULL)) order by ' + self._order)
             params.append(uid)
             clause = ' and '.join(where)
             cr.execute('select id,name,value,object,meta, key from ir_values where ' + clause, params)

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.