~kndati/aeroo/openerp6

« back to all changes in this revision

Viewing changes to report_aeroo/report_xml.py

  • Committer: root
  • Date: 2013-05-16 15:46:46 UTC
  • Revision ID: root@erp.kndati.lv-20130516154646-5lesr8tyzl1vdc0k
1.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
##############################################################################
2
2
#
3
 
# Copyright (c) 2008-2012 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
 
3
# Copyright (c) 2008-2013 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
4
4
#                    General contacts <info@alistek.com>
5
5
#
6
6
# WARNING: This program as such is intended to be used by professional
31
31
 
32
32
from osv import osv,fields
33
33
import netsvc
34
 
from report_aeroo import Aeroo_report
 
34
from report_aeroo import Aeroo_report, aeroo_ooo_test
35
35
from report.report_sxw import rml_parse
36
36
import base64, binascii
37
37
import tools
41
41
import imp, sys, os
42
42
import zipimport
43
43
from tools.config import config
 
44
from lxml import etree
44
45
 
45
46
class report_stylesheets(osv.osv):
46
47
    '''
62
63
    _inherit = 'res.company'
63
64
 
64
65
    _columns = {
65
 
        #'report_styles' : fields.binary('Report Styles', help='OpenOffice stylesheet (.odt)'),
66
66
        'stylesheet_id':fields.many2one('report.stylesheets', 'Aeroo Global Stylesheet'),
67
67
    }
68
68
 
136
136
            print e
137
137
            return None
138
138
 
 
139
    def link_inherit_report(self, cr, uid, report, new_replace_report_id=False, context={}):
 
140
        res = {}
 
141
        if new_replace_report_id:
 
142
            inherit_report = self.browse(cr, uid, new_replace_report_id, context=context)
 
143
        else:
 
144
            inherit_report = report.replace_report_id
 
145
 
 
146
        if inherit_report:
 
147
            ir_values_obj = self.pool.get('ir.values')
 
148
            if inherit_report.report_wizard:
 
149
                src_action_type = 'ir.actions.act_window'
 
150
                action_id = report.wizard_id.id
 
151
            else:
 
152
                src_action_type = 'ir.actions.report.xml'
 
153
                action_id = inherit_report.id
 
154
            event_id = ir_values_obj.search(cr, uid, [('value','=',"%s,%s" % (src_action_type,action_id))])
 
155
            if event_id:
 
156
                event_id = event_id[0]
 
157
                if report.report_wizard:
 
158
                    dest_action_type = 'ir.actions.act_window'
 
159
                    if report.wizard_id:
 
160
                        action_id = report.wizard_id.id
 
161
                    else:
 
162
                        action_id = self._set_report_wizard(cr, uid, inherit_report.id, report.id, linked_report_id=report.id, report_name=report.name, context=context)
 
163
                        res['wizard_id'] = action_id
 
164
                else:
 
165
                    dest_action_type = 'ir.actions.report.xml'
 
166
                    action_id = report.id
 
167
                ir_values_obj.write(cr, uid, event_id, {'value':"%s,%s" % (dest_action_type,action_id)}, context=context)
 
168
        return res
 
169
 
 
170
    def unlink_inherit_report(self, cr, uid, ids, context={}):
 
171
        res = {}
 
172
        report_id = isinstance(ids, list) and ids[0] or ids
 
173
        report = self.browse(cr, uid, report_id, context=context)
 
174
        keep_wizard = context and context.get('keep_wizard') or False
 
175
 
 
176
        if report.replace_report_id:
 
177
            ir_values_obj = self.pool.get('ir.values')
 
178
            if report.report_wizard:
 
179
                src_action_type = 'ir.actions.act_window'
 
180
                action_id = report.wizard_id.id
 
181
                if not keep_wizard:
 
182
                    res['wizard_id'] = False
 
183
            else:
 
184
                src_action_type = 'ir.actions.report.xml'
 
185
                action_id = report.id
 
186
            event_id = ir_values_obj.search(cr, uid, [('value','=',"%s,%s" % (src_action_type,action_id))])
 
187
            if event_id:
 
188
                event_id = event_id[0]
 
189
                if report.replace_report_id.report_wizard:
 
190
                    dest_action_type = 'ir.actions.act_window'
 
191
                    action_id = report.wizard_id.id
 
192
                else:
 
193
                    dest_action_type = 'ir.actions.report.xml'
 
194
                    action_id = report.replace_report_id.id
 
195
                ir_values_obj.write(cr, uid, event_id, {'value':"%s,%s" % (dest_action_type,action_id)}, context=context)
 
196
 
 
197
            if not keep_wizard and report.wizard_id and not res.get('wizard_id',True):
 
198
                report.wizard_id.unlink(context=context)
 
199
        return res
 
200
 
139
201
    def delete_report_service(self, name):
140
202
        service_name = 'report.%s' % name
141
203
        if netsvc.Service.exists( service_name ):  # change for OpenERP 6.0 - Service class usage
152
214
        if netsvc.Service.exists( service_name ):
153
215
            netsvc.Service.remove( service_name )
154
216
        cr.execute("SELECT * FROM ir_act_report_xml WHERE report_name = %s and active = true ORDER BY id", (name,))
155
 
        report = cr.dictfetchall()[-1]
156
 
        parser=rml_parse
157
 
        if report['parser_state']=='loc' and report['parser_loc']:
158
 
            parser=self.load_from_file(report['parser_loc'], cr.dbname, report['id']) or parser
159
 
        elif report['parser_state']=='def' and report['parser_def']:
160
 
            parser=self.load_from_source("from report import report_sxw\n"+report['parser_def']) or parser
161
 
        self.register_report(cr, report['report_name'], report['model'], report['report_rml'], parser)
 
217
        report = cr.dictfetchall()
 
218
        if report:
 
219
            report = report[-1]
 
220
            parser=rml_parse
 
221
            if report['parser_state']=='loc' and report['parser_loc']:
 
222
                parser=self.load_from_file(report['parser_loc'], cr.dbname, report['id']) or parser
 
223
            elif report['parser_state']=='def' and report['parser_def']:
 
224
                parser=self.load_from_source("from report import report_sxw\n"+report['parser_def']) or parser
 
225
            self.register_report(cr, report['report_name'], report['model'], report['report_rml'], parser)
162
226
 
163
227
    def register_all(self, cr):
164
228
        super(report_xml, self).register_all(cr)
180
244
                OpenOffice_service(cr, host, port)
181
245
                netsvc.Logger().notifyChannel('report_aeroo', netsvc.LOG_INFO, "OpenOffice.org connection successfully established")
182
246
            except Exception, e:
 
247
                cr.rollback()
183
248
                netsvc.Logger().notifyChannel('report_aeroo', netsvc.LOG_WARNING, str(e))
184
249
        ##############################################
185
250
 
186
 
        cr.execute("SELECT * FROM ir_act_report_xml WHERE report_type = 'aeroo' ORDER BY id") # change for OpenERP 6.0
 
251
        cr.execute("SELECT * FROM ir_act_report_xml WHERE report_type = 'aeroo' and active = true ORDER BY id") # change for OpenERP 6.0
187
252
        records = cr.dictfetchall()
188
253
        for record in records:
189
254
            parser=rml_parse
193
258
                parser=self.load_from_source("from report import report_sxw\n"+record['parser_def']) or parser
194
259
            self.register_report(cr, record['report_name'], record['model'], record['report_rml'], parser)
195
260
 
196
 
 
197
261
    def _report_content(self, cursor, user, ids, name, arg, context=None):
198
262
        res = {}
199
263
        aeroo_ids = self.search(cursor, 1, [('report_type','=','aeroo'),('id','in',ids)], context=context)
206
270
                try:
207
271
                    fp = tools.file_open(report[name[:-8]], mode='rb')
208
272
                    data = report['report_type']=='aeroo' and base64.encodestring(fp.read()) or fp.read()
 
273
                except IOError, e:
 
274
                    if e.errno==13: # Permission denied on the template file
 
275
                        raise osv.except_osv(_(e.strerror), e.filename)
 
276
                    else:
 
277
                        print e
209
278
                except Exception, e:
210
279
                    print e
211
280
                    fp = False
250
319
            result[record['res_id']] = '%(module)s.%(name)s' % record
251
320
        return result
252
321
 
 
322
    def _get_extras(self, cr, uid, ids, *args, **kwargs):
 
323
        result = []
 
324
        if aeroo_ooo_test(cr):
 
325
            result.append('aeroo_ooo')
 
326
        ##### Check deferred_processing module #####
 
327
        cr.execute("SELECT id, state FROM ir_module_module WHERE name='deferred_processing'")
 
328
        deferred_proc_module = cr.dictfetchone()
 
329
        if deferred_proc_module and deferred_proc_module['state'] in ('installed', 'to upgrade'):
 
330
            result.append('deferred_processing')
 
331
        ############################################
 
332
        return dict.fromkeys(ids, ','.join(result))
 
333
 
253
334
    _columns = {
254
335
        'charset':fields.selection(_get_encodings, string='Charset', required=True),
255
336
        'content_fname': fields.char('Override Extension',size=64, help='Here you can override output file extension'),
258
339
            ('global', 'Global'),
259
340
            ('specified', 'Specified'),
260
341
            ], string='Stylesheet'),
261
 
        #'report_styles' : fields.binary('Template Styles', help='OpenOffice stylesheet (.odt)'),
262
342
        'stylesheet_id':fields.many2one('report.stylesheets', 'Template Stylesheet'),
263
343
        'preload_mode':fields.selection([
264
344
            ('static',_('Static')),
281
361
        'report_sxw_content': fields.function(_report_content,
282
362
            fnct_inv=_report_content_inv, method=True,
283
363
            type='binary', string='SXW content',),
284
 
        'active':fields.boolean('Active'),
 
364
        'active':fields.boolean('Active', help='Disables the report if unchecked.'),
285
365
        'report_wizard':fields.boolean('Report Wizard'),
286
 
        'copies': fields.integer('Number of copies'),
287
 
        'fallback_false':fields.boolean('Disable format fallback'),
 
366
        'copies': fields.integer('Number of Copies'),
 
367
        'fallback_false':fields.boolean('Disable Format Fallback'),
288
368
        'xml_id': fields.function(_get_xml_id, type='char', size=128, string="XML ID",
289
369
                                  method=True, help="ID of the report defined in xml file"),
 
370
        'extras': fields.function(_get_extras, method=True, type='char', size='256', string='Extra options'),
 
371
        'deferred':fields.selection([
 
372
            ('off',_('Off')),
 
373
            ('adaptive',_('Adaptive')),
 
374
            
 
375
        ],'Deferred', help='Deferred (aka Batch) reporting, for reporting on large amount of data.'),
 
376
        'deferred_limit': fields.integer('Deferred Records Limit', help='Records limit at which you are invited to start the deferred process.'),
 
377
        'replace_report_id':fields.many2one('ir.actions.report.xml', 'Replace Report'),
 
378
        'wizard_id':fields.many2one('ir.actions.act_window', 'Wizard Action'),
290
379
        
291
380
    }
292
381
 
 
382
    def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
 
383
        res = super(report_xml, self).fields_view_get(cr, user, view_id, view_type, context, toolbar, submenu)
 
384
        if view_type=='form':
 
385
            ##### Check deferred_processing module #####
 
386
            cr.execute("SELECT id, state FROM ir_module_module WHERE name='deferred_processing'")
 
387
            deferred_proc_module = cr.dictfetchone()
 
388
            if not (deferred_proc_module and deferred_proc_module['state'] in ('installed', 'to upgrade')):
 
389
                doc = etree.XML(res['arch'])
 
390
                deferred_node = doc.xpath("//field[@name='deferred']")
 
391
                deferred_node[0].attrib['invisible'] = '1'
 
392
                deferred_limit_node = doc.xpath("//field[@name='deferred_limit']")
 
393
                deferred_limit_node[0].attrib['invisible'] = '1'
 
394
                res['arch'] = etree.tostring(doc)
 
395
            ############################################
 
396
        return res
 
397
 
293
398
    def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'):
294
399
        ##### check new model fields, that while not exist in database #####
295
400
        cr.execute("SELECT name FROM ir_model_fields WHERE model = 'ir.actions.report.xml'")
312
417
        ####################################################################################
313
418
        return res
314
419
 
315
 
    def unlink(self, cr, uid, ids, context=None):
 
420
    def unlink(self, cr, uid, ids, context={}):
316
421
        #TODO: process before delete resource
317
422
        trans_obj = self.pool.get('ir.translation')
318
423
        act_win_obj = self.pool.get('ir.actions.act_window')
319
424
        trans_ids = trans_obj.search(cr, uid, [('type','=','report'),('res_id','in',ids)])
320
425
        trans_obj.unlink(cr, uid, trans_ids)
 
426
        self.unlink_inherit_report(cr, uid, ids, context=context)
321
427
        ####################################
322
 
        reports = self.read(cr, uid, ids, ['report_name','model','report_wizard'])
 
428
        reports = self.read(cr, uid, ids, ['report_name','model','report_wizard','replace_report_id'])
323
429
        for r in reports:
324
430
            if r['report_wizard']:
325
431
                act_win_ids = act_win_obj.search(cr, uid, [('res_model','=','aeroo.print_actions')], context=context)
330
436
            else:
331
437
                ir_value_ids = self.pool.get('ir.values').search(cr, uid, [('value','=','ir.actions.report.xml,%s' % r['id'])])
332
438
                if ir_value_ids:
333
 
                    self.pool.get('ir.values').unlink(cr, uid, ir_value_ids)
 
439
                    if not r['replace_report_id']:
 
440
                        self.pool.get('ir.values').unlink(cr, uid, ir_value_ids)
334
441
                    self.unregister_report(cr, r['report_name'])
335
442
        self.pool.get('ir.model.data')._unlink(cr, uid, 'ir.actions.report.xml', ids)
336
443
        ####################################
338
445
        return res
339
446
 
340
447
    def create(self, cr, user, vals, context={}):
341
 
        #if context and not self.pool.get('ir.model').search(cr, user, [('model','=',vals['model'])]):
342
 
        #    raise osv.except_osv(_('Object model is not correct !'),_('Please check "Object" field !') )
343
448
        if 'report_type' in vals and vals['report_type'] == 'aeroo':
344
449
            parser=rml_parse
345
450
            vals['auto'] = False
349
454
                parser=self.load_from_source("from report import report_sxw\n"+vals['parser_def']) or parser
350
455
 
351
456
            res_id = super(report_xml, self).create(cr, user, vals, context)
 
457
            if vals.get('report_wizard'):
 
458
                wizard_id = self._set_report_wizard(cr, user, vals['replace_report_id'] or res_id, \
 
459
                            res_id, linked_report_id=res_id, report_name=vals['name'], context=context)
 
460
                self.write(cr, user, res_id, {'wizard_id': wizard_id}, context)
 
461
            if vals.get('replace_report_id'):
 
462
                report = self.browse(cr, user, res_id, context=context)
 
463
                self.link_inherit_report(cr, user, report, new_replace_report_id=vals['replace_report_id'], context=context)
352
464
            try:
353
465
                if vals.get('active', False):
354
466
                    self.register_report(cr, vals['report_name'], vals['model'], vals.get('report_rml', False), parser)
358
470
            return res_id
359
471
 
360
472
        res_id = super(report_xml, self).create(cr, user, vals, context)
361
 
        if vals.get('report_type') == 'aeroo' and vals.get('report_wizard'):
362
 
            self._set_report_wizard(cr, user, res_id, context)
363
473
        return res_id
364
474
 
365
 
    def write(self, cr, user, ids, vals, context=None):
 
475
    def write(self, cr, user, ids, vals, context={}):
366
476
        if 'report_sxw_content_data' in vals:
367
477
            if vals['report_sxw_content_data']:
368
478
                try:
371
481
                    vals['report_sxw_content_data'] = False
372
482
        if type(ids)==list:
373
483
            ids = ids[0]
374
 
        record = self.read(cr, user, ids)
 
484
        record = self.browse(cr, user, ids)
375
485
        #if context and 'model' in vals and not self.pool.get('ir.model').search(cr, user, [('model','=',vals['model'])]):
376
486
        #    raise osv.except_osv(_('Object model is not correct !'),_('Please check "Object" field !') )
377
 
        if vals.get('report_type', record['report_type']) == 'aeroo':
378
 
            if vals.get('report_wizard'):
379
 
                self._set_report_wizard(cr, user, ids, context)
380
 
            elif 'report_wizard' in vals and not vals['report_wizard'] and record['report_wizard']:
 
487
        if vals.get('report_type', record.report_type) == 'aeroo':
 
488
            if vals.get('report_wizard') and vals.get('active', record.active) and \
 
489
                        (record.replace_report_id and vals.get('replace_report_id',True) or not record.replace_report_id):
 
490
                vals['wizard_id'] = self._set_report_wizard(cr, user, ids, ids, linked_report_id=vals.get('replace_report_id'), context=context)
 
491
                record.report_wizard = True
 
492
                record.wizard_id = vals['wizard_id']
 
493
            elif 'report_wizard' in vals and not vals['report_wizard'] and record.report_wizard:
381
494
                self._unset_report_wizard(cr, user, ids, context)
 
495
                vals['wizard_id'] = False
 
496
                record.report_wizard = False
 
497
                record.wizard_id = False
382
498
            parser=rml_parse
383
499
            if vals.get('parser_state', False)=='loc':
384
 
                parser = self.load_from_file(vals.get('parser_loc', False) or record['parser_loc'], cr.dbname, record['id']) or parser
 
500
                parser = self.load_from_file(vals.get('parser_loc', False) or record.parser_loc, cr.dbname, record.id) or parser
385
501
            elif vals.get('parser_state', False)=='def':
386
 
                parser = self.load_from_source("from report import report_sxw\n"+(vals.get('parser_loc', False) or record['parser_def'] or '')) or parser
 
502
                parser = self.load_from_source("from report import report_sxw\n"+(vals.get('parser_loc', False) or record.parser_def or '')) or parser
387
503
            elif vals.get('parser_state', False)=='default':
388
504
                parser = rml_parse
389
 
            elif record['parser_state']=='loc':
390
 
                parser = self.load_from_file(record['parser_loc'], cr.dbname, record['id']) or parser
391
 
            elif record['parser_state']=='def':
392
 
                parser = self.load_from_source("from report import report_sxw\n"+record['parser_def']) or parser
393
 
            elif record['parser_state']=='default':
 
505
            elif record.parser_state=='loc':
 
506
                parser = self.load_from_file(record.parser_loc, cr.dbname, record.id) or parser
 
507
            elif record.parser_state=='def':
 
508
                parser = self.load_from_source("from report import report_sxw\n"+record.parser_def) or parser
 
509
            elif record.parser_state=='default':
394
510
                parser = rml_parse
395
511
 
396
512
            if vals.get('parser_loc', False):
397
 
                parser=self.load_from_file(vals['parser_loc'], cr.dbname, record['id']) or parser
 
513
                parser=self.load_from_file(vals['parser_loc'], cr.dbname, record.id) or parser
398
514
            elif vals.get('parser_def', False):
399
515
                parser=self.load_from_source("from report import report_sxw\n"+vals['parser_def']) or parser
400
 
            if vals.get('report_name', False) and vals['report_name']!=record['report_name']:
401
 
                self.delete_report_service(record['report_name'])
 
516
            if vals.get('report_name', False) and vals['report_name']!=record.report_name:
 
517
                self.delete_report_service(record.report_name)
402
518
                report_name = vals['report_name']
403
519
            else:
404
 
                self.delete_report_service(record['report_name'])
405
 
                report_name = record['report_name']
 
520
                self.delete_report_service(record.report_name)
 
521
                report_name = record.report_name
 
522
            ##### Link / unlink inherited report #####
 
523
            link_vals = {}
 
524
            now_unlinked = False
 
525
            if 'replace_report_id' in vals and vals.get('active', record.active):
 
526
                if vals['replace_report_id']:
 
527
                    if record.replace_report_id and vals['replace_report_id']!=record.replace_report_id.id:
 
528
                        ctx = context.copy()
 
529
                        ctx['keep_wizard'] = True # keep window action for wizard, if only inherit report changed
 
530
                        link_vals.update(self.unlink_inherit_report(cr, user, ids, ctx))
 
531
                        now_unlinked = True
 
532
                    link_vals.update(self.link_inherit_report(cr, user, record, new_replace_report_id=vals['replace_report_id'], context=context))
 
533
                    self.register_report(cr, report_name, vals.get('model', record.model), vals.get('report_rml', record.report_rml), parser)
 
534
                else:
 
535
                    link_vals.update(self.unlink_inherit_report(cr, user, ids, context=context))
 
536
                    now_unlinked = True
 
537
            ##########################################
 
538
            try:
 
539
                if vals.get('active', record.active):
 
540
                    self.register_report(cr, report_name, vals.get('model', record.model), vals.get('report_rml', record.report_rml), parser)
 
541
                    if not record.active and vals.get('replace_report_id',record.replace_report_id):
 
542
                        link_vals.update(self.link_inherit_report(cr, user, record, new_replace_report_id=vals.get('replace_report_id',False), context=context))
 
543
                elif not vals.get('active', record.active):
 
544
                    self.unregister_report(cr, report_name)
 
545
                    if not now_unlinked:
 
546
                        link_vals.update(self.unlink_inherit_report(cr, user, ids, context=context))
 
547
            except Exception, e:
 
548
                print e
 
549
                raise osv.except_osv(_('Report registration error !'), _('Report was not registered in system !'))
406
550
 
 
551
            vals.update(link_vals)
407
552
            res = super(report_xml, self).write(cr, user, ids, vals, context)
408
 
            try:
409
 
                if vals.get('active', record['active']):
410
 
                    self.register_report(cr, report_name, vals.get('model', record['model']), vals.get('report_rml', record['report_rml']), parser)
411
 
                else:
412
 
                    self.unregister_report(cr, report_name)
413
 
            except Exception, e:
414
 
                print e
415
 
                raise osv.except_osv(_('Report registration error !'), _('Report was not registered in system !'))
416
553
            return res
417
554
 
418
555
        res = super(report_xml, self).write(cr, user, ids, vals, context)
427
564
        res_id = super(report_xml, self).copy(cr, uid, id, default, context)
428
565
        return res_id
429
566
 
430
 
    def _set_report_wizard(self, cr, uid, ids, context=None):
 
567
    def _set_report_wizard(self, cr, uid, ids, report_action_id, linked_report_id=False, report_name=False, context=None):
431
568
        id = isinstance(ids, list) and ids[0] or ids
 
569
        report = self.browse(cr, uid, id, context=context)
432
570
        ir_values_obj = self.pool.get('ir.values')
433
571
        trans_obj = self.pool.get('ir.translation')
434
 
        event_id = ir_values_obj.search(cr, uid, [('value','=',"ir.actions.report.xml,%s" % id)])
435
 
        name = self.read(cr, uid, id, ['name'])['name']
 
572
        if linked_report_id:
 
573
            linked_report = self.browse(cr, uid, linked_report_id, context=context)
 
574
        else:
 
575
            linked_report = report.replace_report_id
 
576
        event_id = ir_values_obj.search(cr, uid, [('value','=',"ir.actions.report.xml,%s" % report.id)])
 
577
        if not event_id:
 
578
            event_id = ir_values_obj.search(cr, uid, [('value','=',"ir.actions.report.xml,%s" % linked_report.id)])
436
579
        if event_id:
437
580
            event_id = event_id[0]
438
 
            action_data = {'name':name,
 
581
            action_data = {'name':report_name or report.name,
439
582
                           'view_mode':'form',
440
583
                           'view_type':'form',
441
584
                           'target':'new',
442
585
                           'res_model':'aeroo.print_actions',
443
 
                           'context':{'report_action_id':id}
 
586
                           'context':{'report_action_id':report_action_id}
444
587
                           }
445
588
            act_id = self.pool.get('ir.actions.act_window').create(cr, uid, action_data, context)
446
589
            ir_values_obj.write(cr, uid, event_id, {'value':"ir.actions.act_window,%s" % act_id}, context=context)
447
590
 
448
 
            translations = trans_obj.search(cr, uid, [('res_id','=',id),('src','=',name),('name','=','ir.actions.report.xml,name')])
 
591
            translations = trans_obj.search(cr, uid, [('res_id','=',report.id),('src','=',report.name),('name','=','ir.actions.report.xml,name')])
449
592
            for trans in trans_obj.browse(cr, uid, translations, context):
450
593
                trans_obj.copy(cr, uid, trans.id, default={'name':'ir.actions.act_window,name','res_id':act_id})
451
594
            return act_id
506
649
        self.localcontext.update({})""",
507
650
        'active' : True,
508
651
        'copies': 1,
 
652
        'deferred': 'off',
 
653
        'deferred_limit': 80,
509
654
    }
510
655
 
511
656
report_xml()