diff --git a/addons/mail_gateway/__init__.py b/addons/mail_gateway/__init__.py index 6526541a068..100cb5023b7 100644 --- a/addons/mail_gateway/__init__.py +++ b/addons/mail_gateway/__init__.py @@ -21,6 +21,7 @@ import mail_gateway import res_partner +import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mail_gateway/__openerp__.py b/addons/mail_gateway/__openerp__.py index 961f16f541f..62b02aa52c6 100644 --- a/addons/mail_gateway/__openerp__.py +++ b/addons/mail_gateway/__openerp__.py @@ -31,9 +31,11 @@ 'depends': ['base'], 'init_xml': [], 'update_xml': [ + 'wizard/mail_gateway_document_view.xml', "mail_gateway_view.xml", "res_partner_view.xml", 'security/ir.model.access.csv' + ], 'demo_xml': [], 'installable': True, diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index c775b97d520..a06297fa2d9 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -542,3 +542,5 @@ class mailgate_tool(osv.osv_memory): return res mailgate_tool() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/mail_gateway/mail_gateway_view.xml b/addons/mail_gateway/mail_gateway_view.xml index de1a88c34c7..26a26980bea 100644 --- a/addons/mail_gateway/mail_gateway_view.xml +++ b/addons/mail_gateway/mail_gateway_view.xml @@ -2,11 +2,11 @@ - mailgate.message.form + mailgate.message.form mailgate.message form -
+ @@ -66,12 +66,12 @@ - + - - + + @@ -191,7 +191,6 @@ view_id="view_mailgate_message_tree" /> - @@ -201,6 +200,11 @@ action="mail_gateway.action_view_mailgate_message" /> + diff --git a/addons/mail_gateway/wizard/__init__.py b/addons/mail_gateway/wizard/__init__.py new file mode 100644 index 00000000000..fe5faaa7254 --- /dev/null +++ b/addons/mail_gateway/wizard/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import mail_gateway_document + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/mail_gateway/wizard/mail_gateway_document.py b/addons/mail_gateway/wizard/mail_gateway_document.py new file mode 100644 index 00000000000..6fdf6d48be0 --- /dev/null +++ b/addons/mail_gateway/wizard/mail_gateway_document.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## +from osv import fields, osv + +class mail_gateway_document(osv.osv_memory): + """ Mail Gateway Document """ + _name = "mail.gateway.document" + _description = "Mail Gateway Document" + + + def open_document(self, cr, uid, ids, context): + """ To Open Document + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param ids: the ID or list of IDs if we want more than one + @param context: A standard dictionary + """ + result = [] + document_id = context.get('active_id', False) + mailgate_obj = self.pool.get('mailgate.message') + mod_obj = self.pool.get('ir.model.data') + act_obj = self.pool.get('ir.actions.act_window') + mailgate_data = mailgate_obj.browse(cr, uid, document_id) + model = mailgate_data.model + res_id = mailgate_data.res_id + + view_obj = self.pool.get('ir.ui.view') + view_id = view_obj.search(cr, uid, [('model', '=', model),('type','=','tree')]) + return { + 'domain' : "[('id','=',%d)]"%(res_id), + 'view_mode': 'tree,form', + 'view_type': 'form', + 'view_id': view_id or False, + 'res_model': model, + 'res_id': res_id, + 'context': context, + 'type': 'ir.actions.act_window', + } + +mail_gateway_document() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mail_gateway/wizard/mail_gateway_document_view.xml b/addons/mail_gateway/wizard/mail_gateway_document_view.xml new file mode 100644 index 00000000000..13dc97b9fa8 --- /dev/null +++ b/addons/mail_gateway/wizard/mail_gateway_document_view.xml @@ -0,0 +1,38 @@ + + + + + + + Open Document + mail.gateway.document + form + + +