diff --git a/bin/addons/base/ir/ir.xml b/bin/addons/base/ir/ir.xml
index ee8a21d2bb7..9b4e0e3e38a 100644
--- a/bin/addons/base/ir/ir.xml
+++ b/bin/addons/base/ir/ir.xml
@@ -389,59 +389,6 @@
-
-
- ir.actions.report.custom
- ir.actions.report.custom
- form
-
-
-
-
-
- ir.actions.report.custom.tree
- ir.actions.report.custom
- tree
-
-
-
-
-
-
-
-
- ir.actions.report.custom.search
- ir.actions.report.custom
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Report Custom
- ir.actions.act_window
- ir.actions.report.custom
- form
-
-
-
-
-
ir.actions.report.xml
ir.actions.report.xml
@@ -1067,42 +1014,6 @@
-
- ir.report.custom
- ir.report.custom
- form
-
-
-
-
-
- Custom Report
- ir.actions.act_window
- ir.report.custom
- tree
-
-
-
diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py
index 4b9d59743cb..e956ee2bf59 100644
--- a/bin/addons/base/ir/ir_actions.py
+++ b/bin/addons/base/ir/ir_actions.py
@@ -44,23 +44,6 @@ class actions(osv.osv):
}
actions()
-class report_custom(osv.osv):
- _name = 'ir.actions.report.custom'
- _table = 'ir_act_report_custom'
- _sequence = 'ir_actions_id_seq'
- _columns = {
- 'name': fields.char('Report Name', size=64, required=True, translate=True),
- 'type': fields.char('Report Type', size=32, required=True),
- 'model':fields.char('Object', size=64, required=True),
- 'report_id': fields.integer('Report Ref.', required=True),
- 'usage': fields.char('Action Usage', size=32),
- 'multi': fields.boolean('On multiple doc.', help="If set to true, the action will not be displayed on the right toolbar of a form view.")
- }
- _defaults = {
- 'multi': lambda *a: False,
- 'type': lambda *a: 'ir.actions.report.custom',
- }
-report_custom()
class report_xml(osv.osv):
diff --git a/bin/addons/base/ir/ir_report_custom.py b/bin/addons/base/ir/ir_report_custom.py
index 3c7daa09d34..ff81e48ff53 100644
--- a/bin/addons/base/ir/ir_report_custom.py
+++ b/bin/addons/base/ir/ir_report_custom.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -27,127 +27,24 @@ from tools.translate import _
from tools.safe_eval import safe_eval as eval
import netsvc
-class report_custom(osv.osv):
- _name = 'ir.report.custom'
- _columns = {
- 'name': fields.char('Report Name', size=64, required=True, translate=True),
- 'model_id': fields.many2one('ir.model','Object', required=True, change_default=True),
- 'type': fields.selection([('table','Tabular'),('pie','Pie Chart'),('bar','Bar Chart'),('line','Line Plot')], "Report Type", size=64, required='True'),
- 'title': fields.char("Report Title", size=64, required='True', translate=True),
- 'print_format': fields.selection((('A4','a4'),('A5','a5')), 'Print format', required=True),
- 'print_orientation': fields.selection((('landscape','Landscape'),('portrait','Portrait')), 'Print orientation', required=True, size=16),
- 'repeat_header': fields.boolean('Repeat Header'),
- 'footer': fields.char('Report Footer', size=64, required=True),
- 'sortby': fields.char('Sorted By', size=64),
- 'fields_child0': fields.one2many('ir.report.custom.fields', 'report_id','Fields', required=True),
- 'field_parent': fields.many2one('ir.model.fields','Child Field'),
- 'state': fields.selection([('unsubscribed','Unsubscribed'),('subscribed','Subscribed')], 'State', size=64),
- 'frequency': fields.selection([('Y','Yearly'),('M','Monthly'),('D','Daily')], 'Frequency', size=64),
- 'limitt': fields.char('Limit', size=9),
- 'menu_id': fields.many2one('ir.ui.menu', 'Menu')
- }
- _defaults = {
- 'print_format': lambda *a: 'A4',
- 'print_orientation': lambda *a: 'portrait',
- 'state': lambda *a: 'unsubscribed',
- 'type': lambda *a: 'table',
- 'footer': lambda *a: 'Generated by OpenERP'
- }
-
- def onchange_model_id(self, cr, uid, ids, model_id):
- if not(model_id):
- return {}
- return {'domain': {'field_parent': [('model_id','=',model_id)]}}
-
- def unsubscribe(self, cr, uid, ids, context={}):
-#TODO: should delete the ir.actions.report.custom for these reports and do an ir_del
- self.write(cr, uid, ids, {'state':'unsubscribed'})
- return True
-
- def subscribe(self, cr, uid, ids, context={}):
- for report in self.browse(cr, uid, ids):
- report.fields_child0.sort(lambda x,y : x.sequence - y.sequence)
-
- # required on field0 does not seem to work( cause we use o2m_l ?)
- if not report.fields_child0:
- raise osv.except_osv(_('Invalid operation'), _('Enter at least one field !'))
-
- if report.type in ['pie', 'bar', 'line'] and report.field_parent:
- raise osv.except_osv(_('Invalid operation'), _('Tree can only be used in tabular reports'))
-
- # Otherwise it won't build a good tree. See level.pop in custom.py.
- if report.type == 'table' and report.field_parent and report.fields_child0 and not report.fields_child0[0].groupby:
- raise osv.except_osv('Invalid operation :', 'When creating tree (field child) report, data must be group by the first field')
-
- if report.type == 'pie':
- if len(report.fields_child0) != 2:
- raise osv.except_osv(_('Invalid operation'), _('Pie charts need exactly two fields'))
- else:
- c_f = {}
- for i in range(2):
- c_f[i] = []
- tmp = report.fields_child0[i]
- for j in range(3):
- c_f[i].append((not isinstance(eval('tmp.field_child'+str(j),{},{'tmp':tmp}), browse_null) and eval('tmp.field_child'+str(j)+'.ttype',{},{'tmp':tmp})) or None)
- if not reduce(lambda x,y : x or y, map(lambda x: x in ['integer', 'float'], c_f[1])):
- raise osv.except_osv(_('Invalid operation'), _('Second field should be figures'))
-
- if report.type == 'bar':
- if len(report.fields_child0) < 2:
- raise osv.except_osv(_('Invalid operation'), _('Bar charts need at least two fields'))
- else:
- c_f = {}
- for i in range(len(report.fields_child0)):
- c_f[i] = []
- tmp = report.fields_child0[i]
- for j in range(3):
- c_f[i].append((not isinstance(eval('tmp.field_child'+str(j),{},{'tmp':tmp}), browse_null) and eval('tmp.field_child'+str(j)+'.ttype',{},{'tmp':tmp})) or None)
-
- if i == 0:
- pass
- else:
- if not reduce(lambda x,y : x or y, map(lambda x: x in ['integer', 'float'], c_f[i])):
- raise osv.except_osv(_('Invalid operation'), _('Field %d should be a figure') %(i,))
-
- if report.state=='subscribed':
- continue
-
- name = report.name
- model = report.model_id.model
-
- action_def = {'report_id':report.id, 'type':'ir.actions.report.custom', 'model':model, 'name':name}
- id = self.pool.get('ir.actions.report.custom').create(cr, uid, action_def)
- m_id = report.menu_id.id
- action = "ir.actions.report.custom,%d" % (id,)
- if not report.menu_id:
- ir.ir_set(cr, uid, 'action', 'client_print_multi', name, [(model, False)], action, False, True)
- else:
- ir.ir_set(cr, uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(m_id))], action, False, True)
-
- self.write(cr, uid, [report.id], {'state':'subscribed'}, context)
- return True
-report_custom()
-
-
class report_custom_fields(osv.osv):
_name = 'ir.report.custom.fields'
_columns = {
'name': fields.char('Name', size=64, required=True),
- 'report_id': fields.many2one('ir.report.custom', 'Report Ref', select=True),
'field_child0': fields.many2one('ir.model.fields', 'Field child0', required=True),
- 'fc0_operande': fields.many2one('ir.model.fields', 'Constraint'),
+ 'fc0_operande': fields.many2one('ir.model.fields', 'Constraint'),
'fc0_condition': fields.char('Condition', size=64),
'fc0_op': fields.selection((('>','>'),('<','<'),('==','='),('in','in'),('gety,==','(year)=')), 'Relation'),
'field_child1': fields.many2one('ir.model.fields', 'Field child1'),
- 'fc1_operande': fields.many2one('ir.model.fields', 'Constraint'),
+ 'fc1_operande': fields.many2one('ir.model.fields', 'Constraint'),
'fc1_condition': fields.char('condition', size=64),
'fc1_op': fields.selection((('>','>'),('<','<'),('==','='),('in','in'),('gety,==','(year)=')), 'Relation'),
'field_child2': fields.many2one('ir.model.fields', 'Field child2'),
- 'fc2_operande': fields.many2one('ir.model.fields', 'Constraint'),
+ 'fc2_operande': fields.many2one('ir.model.fields', 'Constraint'),
'fc2_condition': fields.char('condition', size=64),
'fc2_op': fields.selection((('>','>'),('<','<'),('==','='),('in','in'),('gety,==','(year)=')), 'Relation'),
'field_child3': fields.many2one('ir.model.fields', 'Field child3'),
- 'fc3_operande': fields.many2one('ir.model.fields', 'Constraint'),
+ 'fc3_operande': fields.many2one('ir.model.fields', 'Constraint'),
'fc3_condition': fields.char('condition', size=64),
'fc3_op': fields.selection((('>','>'),('<','<'),('==','='),('in','in'),('gety,==','(year)=')), 'Relation'),
'alignment': fields.selection((('left','left'),('right','right'),('center','center')), 'Alignment', required=True),
@@ -180,9 +77,9 @@ class report_custom_fields(osv.osv):
if id:
return {
'domain': {
- next_level_field_name: [('model_id', '=', id)],
+ next_level_field_name: [('model_id', '=', id)],
next_level_operande: [('model_id', '=', id)]
- },
+ },
'required': {
next_level_field_name: True
}
@@ -192,13 +89,13 @@ class report_custom_fields(osv.osv):
return {'required': {next_level_field_name: True}}
else:
return {'domain': {next_level_field_name: []}}
-
+
def get_field_child_onchange_method(level):
return lambda self, cr, uid, ids, field_id: self.onchange_any_field_child(cr, uid, ids, field_id, level)
- onchange_field_child0 = get_field_child_onchange_method(0)
- onchange_field_child1 = get_field_child_onchange_method(1)
- onchange_field_child2 = get_field_child_onchange_method(2)
+ onchange_field_child0 = get_field_child_onchange_method(0)
+ onchange_field_child1 = get_field_child_onchange_method(1)
+ onchange_field_child2 = get_field_child_onchange_method(2)
report_custom_fields()
diff --git a/bin/addons/base/ir/ir_ui_menu.py b/bin/addons/base/ir/ir_ui_menu.py
index d16b4554d41..6b4d98962b4 100644
--- a/bin/addons/base/ir/ir_ui_menu.py
+++ b/bin/addons/base/ir/ir_ui_menu.py
@@ -125,7 +125,6 @@ class ir_ui_menu(osv.osv):
data = menu.action
if data:
model_field = { 'ir.actions.act_window': 'res_model',
- 'ir.actions.report.custom': 'model',
'ir.actions.report.xml': 'model',
'ir.actions.wizard': 'model',
'ir.actions.server': 'model_id',
@@ -272,7 +271,6 @@ class ir_ui_menu(osv.osv):
'action': fields.function(_action, fnct_inv=_action_inv,
method=True, type='reference', string='Action',
selection=[
- ('ir.actions.report.custom', 'ir.actions.report.custom'),
('ir.actions.report.xml', 'ir.actions.report.xml'),
('ir.actions.act_window', 'ir.actions.act_window'),
('ir.actions.wizard', 'ir.actions.wizard'),
diff --git a/bin/addons/base/security/ir.model.access.csv b/bin/addons/base/security/ir.model.access.csv
index 481007d52b2..d70c2b9bba6 100644
--- a/bin/addons/base/security/ir.model.access.csv
+++ b/bin/addons/base/security/ir.model.access.csv
@@ -19,7 +19,6 @@
"access_ir_module_module_dependency_group_system","ir_module_module_dependency group_system","model_ir_module_module_dependency","group_system",1,1,1,1
"access_ir_property_group_user","ir_property group_user","model_ir_property",,1,0,0,0
"access_ir_property_group_user_manager","ir_property group_manager","model_ir_property","base.group_partner_manager",1,1,1,0
-"access_ir_report_custom_group_system","ir_report_custom group_system","model_ir_report_custom",,1,0,0,0
"access_ir_report_custom_fields_group_system","ir_report_custom_fields group_system","model_ir_report_custom_fields",,1,0,0,0
"access_ir_rule_group_user","ir_rule group_user","model_ir_rule",,1,0,0,0
"access_ir_rule_group_erp_manager","ir_rule group_erp_manager","model_ir_rule","group_erp_manager",1,1,1,1
@@ -99,8 +98,6 @@
"access_workflow_triggers_all","workflow_triggers_all","model_workflow_triggers",,1,0,0,0
"access_workflow_triggers_group_system","workflow_triggers_group_system","model_workflow_triggers","group_system",1,1,1,1
"access_workflow_workitem_all","workflow_workitem_all","model_workflow_workitem",,1,1,1,1
-"access_actions_report_custom_all","ir_actions_report_custom_all","model_ir_actions_report_custom",,1,0,0,0
-"access_actions_report_custom_group_system","ir_actions_report_custom_group_system","model_ir_actions_report_custom","group_system",1,1,1,1
"access_ir_actions_act_window_view_all","ir_actions_act_window_view_all","model_ir_actions_act_window_view",,1,0,0,0
"access_ir_actions_act_window_view_group_system","ir_actions_act_window_view_group_system","model_ir_actions_act_window_view","group_system",1,1,1,1
"access_ir_actions_url_all","ir_actions_url_all","model_ir_actions_url",,1,0,0,0