kernel,base: allow to specify in the context to not use the default test on field active

bzr revid: ced-d28a0a444b59bf5b673b6b74eb61d46d6ab4a0a5
This commit is contained in:
ced 2007-07-26 08:32:15 +00:00
parent 793f579077
commit c4f3e062eb
2 changed files with 4 additions and 4 deletions

View File

@ -877,9 +877,10 @@
<field name="name">Scheduled Actions</field>
<field name="res_model">ir.cron</field>
<field name="view_type">form</field>
<field name="context">{'active_test': False}</field>
<field name="view_id" ref="ir_cron_view_tree"/>
</record>
<menuitem name="Administration/Custom/Low level/Base/Actions/Scheduled Actions"
<menuitem name="Administration/Custom/Scheduler/Scheduled Actions"
action="ir_cron_act" id="menu_ir_cron_act"/>

View File

@ -1428,13 +1428,12 @@ class orm(object):
args = args[:]
# if the object has a field named 'active', filter out all inactive
# records unless they were explicitely asked for
if 'active' in self._columns and active_test:
if 'active' in self._columns and (active_test and context.get('active_test', True)):
i = 0
active_found = False
while i<len(args):
if args[i][0]=='active':
if not args[i][2]:
active_found = True
active_found = True
i += 1
if not active_found:
args.append(('active', '=', 1))