mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[FIX] context=None
This commit is contained in:
@@ -188,7 +188,7 @@ printing_printer()
|
|||||||
# Actions
|
# Actions
|
||||||
#
|
#
|
||||||
|
|
||||||
def _available_action_types(self, cr, uid, context={}):
|
def _available_action_types(self, cr, uid, context=None):
|
||||||
return [
|
return [
|
||||||
('server',_('Send to Printer')),
|
('server',_('Send to Printer')),
|
||||||
('client',_('Send to Client')),
|
('client',_('Send to Client')),
|
||||||
@@ -213,7 +213,9 @@ class res_users(osv.osv):
|
|||||||
_name = "res.users"
|
_name = "res.users"
|
||||||
_inherit = "res.users"
|
_inherit = "res.users"
|
||||||
|
|
||||||
def _user_available_action_types(self, cr, uid, context={}):
|
def _user_available_action_types(self, cr, uid, context=None):
|
||||||
|
if context is None:
|
||||||
|
context={}
|
||||||
return [x for x in _available_action_types(self, cr, uid, context) if x[0] != 'user_default']
|
return [x for x in _available_action_types(self, cr, uid, context) if x[0] != 'user_default']
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
@@ -266,7 +268,9 @@ class report_xml(osv.osv):
|
|||||||
'printing_action_ids': fields.one2many('printing.report.xml.action', 'report_id', 'Actions', help='This field allows configuring action and printer on a per user basis'),
|
'printing_action_ids': fields.one2many('printing.report.xml.action', 'report_id', 'Actions', help='This field allows configuring action and printer on a per user basis'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def behaviour(self, cr, uid, ids, context={}):
|
def behaviour(self, cr, uid, ids, context=None):
|
||||||
|
if context is None:
|
||||||
|
context={}
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
# Set hardcoded default action
|
# Set hardcoded default action
|
||||||
@@ -320,7 +324,9 @@ class report_xml_action(osv.osv):
|
|||||||
'printer_id': fields.many2one('printing.printer', 'Printer'),
|
'printer_id': fields.many2one('printing.printer', 'Printer'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def behaviour(self, cr, uid, report_id, context={}):
|
def behaviour(self, cr, uid, report_id, context=None):
|
||||||
|
if context is None:
|
||||||
|
context={}
|
||||||
result = {}
|
result = {}
|
||||||
ids = self.search(cr, uid, [('report_id','=',report_id),('user_id','=',uid)], context=context)
|
ids = self.search(cr, uid, [('report_id','=',report_id),('user_id','=',uid)], context=context)
|
||||||
if not ids:
|
if not ids:
|
||||||
|
|||||||
Reference in New Issue
Block a user