diff --git a/trytond/init.sql b/trytond/init.sql index 8305e362e5..817784fbfc 100644 --- a/trytond/init.sql +++ b/trytond/init.sql @@ -74,41 +74,15 @@ CREATE TABLE ir_act_window ( ) INHERITS (ir_actions); -CREATE TABLE ir_act_report_xml ( +CREATE TABLE ir_act_report ( model varchar(64) NOT NULL, report_name varchar(64) NOT NULL, - report_xsl varchar(64), - report_xml varchar(64), + report_odt varchar(64), auto boolean default true, primary key(id) ) INHERITS (ir_actions); -create table ir_act_report_custom ( - report_id int, --- report_id int references ir_report_custom - primary key(id) -) -INHERITS (ir_actions); - -CREATE TABLE ir_act_group ( - exec_type varchar(64) DEFAULT 'serial'::varchar NOT NULL, - primary key(id) -) -INHERITS (ir_actions); - -CREATE TABLE ir_act_group_link ( - aid integer NOT NULL, - gid integer NOT NULL -); - -CREATE TABLE ir_act_execute ( - func_name varchar(64) NOT NULL, - func_arg varchar(64), - primary key(id) -) -INHERITS (ir_actions); - CREATE TABLE ir_act_wizard ( wiz_name varchar(64) NOT NULL, primary key(id) diff --git a/trytond/ir/actions.py b/trytond/ir/actions.py index 2cded78570..548fb011cb 100644 --- a/trytond/ir/actions.py +++ b/trytond/ir/actions.py @@ -20,65 +20,8 @@ class Actions(OSV): Actions() -class ActionsExecute(OSV): - "Actions execute" - _name = 'ir.actions.execute' - _table = 'ir_act_execute' - _sequence = 'ir_actions_id_seq' - _description = __doc__ - _columns = { - 'name': fields.char('name', size=64, required=True, translate=True), - 'type': fields.char('type', size=32, required=True), - 'func_name': fields.char('Function Name', size=64, required=True), - 'func_arg': fields.char('Function Argument', size=64), - 'usage': fields.char('Action Usage', size=32) - } - -ActionsExecute() - - -class ActionsGroup(OSV): - "Actions group" - _name = 'ir.actions.group' - _table = 'ir_act_group' - _sequence = 'ir_actions_id_seq' - _description = __doc__ - _columns = { - 'name': fields.char('Group Name', size=64, required=True), - 'type': fields.char('Action Type', size=32, required=True), - 'exec_type': fields.char('Execution sequence', size=64, required=True), - 'usage': fields.char('Action Usage', size=32) - } - -ActionsGroup() - - -class ActionsReportCustom(OSV): - "Actions report custom" - _name = 'ir.actions.report.custom' - _table = 'ir_act_report_custom' - _sequence = 'ir_actions_id_seq' - _description = __doc__ - _columns = { - 'name': fields.char('Report Name', size=64, required=True, - translate=True), - 'type': fields.char('Report Type', size=32, required=True), - 'model':fields.char('Model', 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 views.") - } - _defaults = { - 'multi': lambda *a: False, - } - -ActionsReportCustom() - - -class ActionsReportXML(OSV): - "Actions report xml" +class ActionsReport(OSV): + "Actions report" def _report_content(self, cursor, user, ids, name, arg, context=None): res = {} @@ -96,17 +39,8 @@ class ActionsReportXML(OSV): context=None): self.write(cursor, user, obj_id, {name+'_data': value}, context=context) - def _report_sxw(self, cursor, user, ids, name, arg, context=None): - res = {} - for report in self.browse(cursor, user, ids, context=context): - if report.report_rml: - res[report.id] = report.report_rml.replace('.rml', '.sxw') - else: - res[report.id] = False - return res - - _name = 'ir.actions.report.xml' - _table = 'ir_act_report_xml' + _name = 'ir.actions.report' + _table = 'ir_act_report' _sequence = 'ir_actions_id_seq' _description = __doc__ _columns = { @@ -114,38 +48,24 @@ class ActionsReportXML(OSV): 'type': fields.char('Report Type', size=32, required=True), 'model': fields.char('Model', size=64, required=True), 'report_name': fields.char('Internal Name', size=64, required=True), - 'report_xsl': fields.char('XSL path', size=256), - 'report_xml': fields.char('XML path', size=256), - 'report_rml': fields.char('RML path', size=256, - help="The .rml path of the file or NULL \n" \ - "if the content is in report_rml_content"), - 'report_sxw': fields.function(_report_sxw, method=True, type='char', - string='SXW path'), - 'report_sxw_content_data': fields.binary('SXW content'), - 'report_rml_content_data': fields.binary('RML content'), - 'report_sxw_content': fields.function(_report_content, + 'report_odt': fields.Char('ODT path', size=128), + 'report_odt_content_data': fields.binary('ODT content'), + 'report_odt_content': fields.function(_report_content, fnct_inv=_report_content_inv, method=True, - type='binary', string='SXW content',), - 'report_rml_content': fields.function(_report_content, - fnct_inv=_report_content_inv, method=True, - type='binary', string='RML content'), - 'auto': fields.boolean('Automatic XSL:RML', required=True), - 'usage': fields.char('Action Usage', size=32), - 'header': fields.boolean('Add RML header', - help="Add or not the coporate RML header"), + type='binary', string='ODT content',), + 'auto': fields.boolean('Automatic', required=True), 'multi': fields.boolean('On multiple doc.', help="If set to true, the action will not be displayed " \ "on the right toolbar of a form views.") } _defaults = { - 'type': lambda *a: 'ir.actions.report.xml', + 'type': lambda *a: 'ir.actions.report', 'multi': lambda *a: False, 'auto': lambda *a: True, - 'header': lambda *a: True, - 'report_sxw_content': lambda *a: False, + 'report_odt_content': lambda *a: False, } -ActionsReportXML() +ActionsReport() class ActionsActWindow(OSV): diff --git a/trytond/ir/actions.xml b/trytond/ir/actions.xml index 91e0c76d36..6ec69c73ff 100644 --- a/trytond/ir/actions.xml +++ b/trytond/ir/actions.xml @@ -46,165 +46,23 @@ - - ir.actions.execute.form - ir.actions.execute + + ir.actions.report.form + ir.actions.report form -
- - - - - - - -
- - ir.actions.execute.tree - ir.actions.execute - tree - - - - - - - - - Execute - ir.actions.act_window - ir.actions.execute - form - - - - tree - - - - - - form - - - - - - ir.actions.group.form - ir.actions.group - form - -
- - - - -
- - ir.actions.group.tree - ir.actions.group - tree - - - - - - - - - Groups - ir.actions.act_window - ir.actions.group - form - - - - tree - - - - - - form - - - - - - ir.actions.report.custom.form - ir.actions.report.custom - form - -
- - - - - - -
- - ir.actions.report.custom.tree - ir.actions.report.custom - tree - - - - - - - - - Reports Customs - ir.actions.act_window - ir.actions.report.custom - form - - - - tree - - - - - - form - - - - - - ir.actions.report.xml - ir.actions.report.xml - form - -
+ - - - + - -
- - ir.actions.report.xml.tree - ir.actions.report.xml + + ir.actions.report.tree + ir.actions.report tree @@ -214,28 +72,28 @@ - - Reports XML + + Reports ir.actions.act_window - ir.actions.report.xml + ir.actions.report form + id="act_actions_report_form_view1"> tree - - + + + id="act_actions_report_form_view2"> form - - + + + action="act_actions_report_form" id="menu_actions_report_form"/> ir.actions.act_window.form ir.actions.act_window diff --git a/trytond/trytond.py b/trytond/trytond.py index 543636319b..b11b76ded6 100644 --- a/trytond/trytond.py +++ b/trytond/trytond.py @@ -94,11 +94,7 @@ class TrytonServer(object): "'ir_model_fields', " "'ir_actions', " "'ir_act_window', " - "'ir_act_report_xml', " - "'ir_act_report_custom', " - "'ir_act_group', " - "'ir_act_group_link', " - "'ir_act_execute', " + "'ir_act_report', " "'ir_act_wizard', " "'ir_act_url', " "'ir_ui_view', "