mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[FIX] user browse was incorrect and never returned records. Fix based on the patch from Egor Tsinko (etsinko)
This commit is contained in:
committed by
Guewen Baconnier
commit
585a10e9d1
@@ -47,7 +47,6 @@ class report_xml(orm.Model):
|
||||
return options
|
||||
|
||||
def print_direct(self, cr, uid, report_id, result, format, printer, context=None):
|
||||
user_obj = self.pool.get('res.users')
|
||||
fd, file_name = mkstemp()
|
||||
try:
|
||||
os.write(fd, base64.decodestring(result))
|
||||
@@ -85,8 +84,8 @@ class report_xml(orm.Model):
|
||||
|
||||
def behaviour(self, cr, uid, ids, context=None):
|
||||
result = {}
|
||||
printer_obj = self.pool.get('printing.printer')
|
||||
printing_act_obj = self.pool.get('printing.report.xml.action')
|
||||
printer_obj = self.pool['printing.printer']
|
||||
printing_act_obj = self.pool['printing.report.xml.action']
|
||||
# Set hardcoded default action
|
||||
default_action = 'client'
|
||||
# Retrieve system wide printer
|
||||
@@ -94,9 +93,8 @@ class report_xml(orm.Model):
|
||||
if default_printer:
|
||||
default_printer = printer_obj.browse(cr, uid, default_printer, context=context)
|
||||
|
||||
|
||||
# Retrieve user default values
|
||||
user = self.pool.get('res.users').browse(cr, uid, context)
|
||||
user = self.pool['res.users'].browse(cr, uid, uid, context=context)
|
||||
if user.printing_action:
|
||||
default_action = user.printing_action
|
||||
if user.printing_printer_id:
|
||||
|
||||
Reference in New Issue
Block a user