Clean actions

This commit is contained in:
ced@b2ck.com
2007-12-14 23:39:50 +01:00
parent 4707207281
commit 8b14a5caed
4 changed files with 33 additions and 285 deletions
+2 -28
View File
@@ -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)
+12 -92
View File
@@ -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):
+18 -160
View File
@@ -46,165 +46,23 @@
</record>
<menuitem name="Administration/IR/Actions/"
action="act_actions_actions_form" id="menu_actions_actions"/>
<record model="ir.ui.view" id="actions_execute_view_form">
<field name="name">ir.actions.execute.form</field>
<field name="model">ir.actions.execute</field>
<record model="ir.ui.view" id="actions_report_view_form">
<field name="name">ir.actions.report.form</field>
<field name="model">ir.actions.report</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Execute">
<field name="name" select="1"/>
<field name="type" select="1"/>
<field name="func_name"/>
<field name="func_arg"/>
<field name="usage"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="actions_execute_view_tree">
<field name="name">ir.actions.execute.tree</field>
<field name="model">ir.actions.execute</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Execute">
<field name="name"/>
<field name="type"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="act_actions_execute_form">
<field name="name">Execute</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.execute</field>
<field name="view_type">form</field>
</record>
<record model="ir.actions.act_window.view"
id="act_actions_execute_form_view1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="actions_execute_view_tree"/>
<field name="act_window_id" ref="act_actions_execute_form"/>
</record>
<record model="ir.actions.act_window.view"
id="act_actions_execute_form_view2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="actions_execute_view_form"/>
<field name="act_window_id" ref="act_actions_execute_form"/>
</record>
<menuitem name="Administration/IR/Actions/"
action="act_actions_execute_form" id="menu_actions_execute"/>
<record model="ir.ui.view" id="actions_group_view_form">
<field name="name">ir.actions.group.form</field>
<field name="model">ir.actions.group</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Group">
<field name="name" select="1"/>
<field name="type" select="1"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="actions_group_view_tree">
<field name="name">ir.actions.group.tree</field>
<field name="model">ir.actions.group</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Group">
<field name="name"/>
<field name="type"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="act_actions_group_form">
<field name="name">Groups</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.group</field>
<field name="view_type">form</field>
</record>
<record model="ir.actions.act_window.view"
id="act_actions_group_form_view1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="actions_group_view_tree"/>
<field name="act_window_id" ref="act_actions_group_form"/>
</record>
<record model="ir.actions.act_window.view"
id="act_actions_group_form_view2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="actions_group_view_form"/>
<field name="act_window_id" ref="act_actions_group_form"/>
</record>
<menuitem name="Administration/IR/Actions/"
action="act_actions_group_form" id="menu_actions_group"/>
<record model="ir.ui.view" id="actions_report_custom_view_form">
<field name="name">ir.actions.report.custom.form</field>
<field name="model">ir.actions.report.custom</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Report custom">
<field name="name" select="1"/>
<field name="type" select="1"/>
<field name="report_id"/>
<field name="usage"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="actions_report_custom_view_tree">
<field name="name">ir.actions.report.custom.tree</field>
<field name="model">ir.actions.report.custom</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Report custom">
<field name="name"/>
<field name="type"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window"
id="act_actions_report_custom_form">
<field name="name">Reports Customs</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.report.custom</field>
<field name="view_type">form</field>
</record>
<record model="ir.actions.act_window.view"
id="act_actions_report_custom_form_view1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="actions_report_custom_view_tree"/>
<field name="act_window_id" ref="act_actions_report_custom_form"/>
</record>
<record model="ir.actions.act_window.view"
id="act_actions_report_custom_form_view2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="actions_report_custom_view_form"/>
<field name="act_window_id" ref="act_actions_report_custom_form"/>
</record>
<menuitem name="Administration/IR/Actions/"
action="act_actions_report_custom_form" id="menu_actions_report_custom"/>
<record model="ir.ui.view" id="actions_report_xml_view_form">
<field name="name">ir.actions.report.xml</field>
<field name="model">ir.actions.report.xml</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Report xml">
<form string="Report">
<field name="name" select="1"/>
<field name="type" select="1"/>
<field name="report_name" select="1"/>
<field name="report_xsl"/>
<field name="report_xml"/>
<field name="report_rml"/>
<field name="report_odt"/>
<field name="auto"/>
<field name="usage"/>
<field name="header"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="actions_report_xml_view_tree">
<field name="name">ir.actions.report.xml.tree</field>
<field name="model">ir.actions.report.xml</field>
<record model="ir.ui.view" id="actions_report_view_tree">
<field name="name">ir.actions.report.tree</field>
<field name="model">ir.actions.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Report xml">
@@ -214,28 +72,28 @@
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="act_actions_report_xml_form">
<field name="name">Reports XML</field>
<record model="ir.actions.act_window" id="act_actions_report_form">
<field name="name">Reports</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.actions.report.xml</field>
<field name="res_model">ir.actions.report</field>
<field name="view_type">form</field>
</record>
<record model="ir.actions.act_window.view"
id="act_actions_report_xml_form_view1">
id="act_actions_report_form_view1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="actions_report_xml_view_tree"/>
<field name="act_window_id" ref="act_actions_report_xml_form"/>
<field name="view_id" ref="actions_report_view_tree"/>
<field name="act_window_id" ref="act_actions_report_form"/>
</record>
<record model="ir.actions.act_window.view"
id="act_actions_report_xml_form_view2">
id="act_actions_report_form_view2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="actions_report_xml_view_form"/>
<field name="act_window_id" ref="act_actions_report_xml_form"/>
<field name="view_id" ref="actions_report_view_form"/>
<field name="act_window_id" ref="act_actions_report_form"/>
</record>
<menuitem name="Administration/IR/Actions/"
action="act_actions_report_xml_form" id="menu_actions_report_xml"/>
action="act_actions_report_form" id="menu_actions_report_form"/>
<record model="ir.ui.view" id="actions_act_window_view_form">
<field name="name">ir.actions.act_window.form</field>
<field name="model">ir.actions.act_window</field>
+1 -5
View File
@@ -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', "