mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[IMP] Use short notation for browse and use pool[] instead of pool.get() as suggested by Pedro Manuel Baeza
This commit is contained in:
@@ -84,8 +84,8 @@ class report_xml(orm.Model):
|
|||||||
|
|
||||||
def behaviour(self, cr, uid, ids, context=None):
|
def behaviour(self, cr, uid, ids, context=None):
|
||||||
result = {}
|
result = {}
|
||||||
printer_obj = self.pool.get('printing.printer')
|
printer_obj = self.pool['printing.printer']
|
||||||
printing_act_obj = self.pool.get('printing.report.xml.action')
|
printing_act_obj = self.pool['printing.report.xml.action']
|
||||||
# Set hardcoded default action
|
# Set hardcoded default action
|
||||||
default_action = 'client'
|
default_action = 'client'
|
||||||
# Retrieve system wide printer
|
# Retrieve system wide printer
|
||||||
@@ -94,8 +94,7 @@ class report_xml(orm.Model):
|
|||||||
default_printer = printer_obj.browse(cr, uid, default_printer, context=context)
|
default_printer = printer_obj.browse(cr, uid, default_printer, context=context)
|
||||||
|
|
||||||
# Retrieve user default values
|
# Retrieve user default values
|
||||||
user = self.pool.get('res.users').browse(
|
user = self.pool['res.users'].browse(cr, uid, uid, context=context)
|
||||||
cr, uid, [uid], context=context)[0]
|
|
||||||
if user.printing_action:
|
if user.printing_action:
|
||||||
default_action = user.printing_action
|
default_action = user.printing_action
|
||||||
if user.printing_printer_id:
|
if user.printing_printer_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user