diff options
| author | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2014-02-03 18:30:00 +0100 |
|---|---|---|
| committer | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2014-02-03 18:30:00 +0100 |
| commit | 753f7541db67d03e85bde6eb1c56ef2bb7468c7f (patch) | |
| tree | ef621e6370d1c6b6ce3f60f990c5b03cbe086d60 /addons/document_page/wizard | |
| parent | 3d392cab4ec961b9d5d3e65f79f146d0bc5e1aa6 (diff) | |
| parent | c25827f84544b6ea3004c7a354122284310c528b (diff) | |
[MERGE] main trunk
bzr revid: qdp-launchpad@openerp.com-20140203173000-mk092iw2wz3y0e3e
Diffstat (limited to 'addons/document_page/wizard')
5 files changed, 0 insertions, 244 deletions
diff --git a/addons/document_page/wizard/__init__.py b/addons/document_page/wizard/__init__.py deleted file mode 100644 index e24534647f4..00000000000 --- a/addons/document_page/wizard/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# 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 <http://www.gnu.org/licenses/>. -# -############################################################################## - -import document_page_create_menu -import document_page_show_diff - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_page/wizard/document_page_create_menu.py b/addons/document_page/wizard/document_page_create_menu.py deleted file mode 100644 index 9f20fab0d99..00000000000 --- a/addons/document_page/wizard/document_page_create_menu.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# 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 <http://www.gnu.org/licenses/>. -# -############################################################################## - -from openerp.osv import fields, osv - -class document_page_create_menu(osv.osv_memory): - """ Create Menu """ - _name = "document.page.create.menu" - _description = "Wizard Create Menu" - - _columns = { - 'menu_name': fields.char('Menu Name', size=256, required=True), - 'menu_parent_id': fields.many2one('ir.ui.menu', 'Parent Menu', required=True), - } - - def default_get(self, cr, uid, fields, context=None): - if context is None: - context = {} - res = super(document_page_create_menu,self).default_get(cr, uid, fields, context=context) - page_id = context.get('active_id') - obj_page = self.pool.get('document.page') - page = obj_page.browse(cr, uid, page_id, context=context) - res['menu_name'] = page.name - return res - - def document_page_menu_create(self, cr, uid, ids, context=None): - if context is None: - context = {} - obj_page = self.pool.get('document.page') - obj_view = self.pool.get('ir.ui.view') - obj_menu = self.pool.get('ir.ui.menu') - obj_action = self.pool.get('ir.actions.act_window') - page_id = context.get('active_id', False) - page = obj_page.browse(cr, uid, page_id, context=context) - - datas = self.browse(cr, uid, ids, context=context) - data = False - if datas: - data = datas[0] - if not data: - return {} - value = { - 'name': 'Document Page', - 'view_type': 'form', - 'view_mode': 'form,tree', - 'res_model': 'document.page', - 'view_id': False, - 'type': 'ir.actions.act_window', - 'target': 'inlineview', - } - value['domain'] = "[('parent_id','=',%d)]" % (page.id) - value['res_id'] = page.id - - action_id = obj_action.create(cr, uid, value) - menu_id = obj_menu.create(cr, uid, { - 'name': data.menu_name, - 'parent_id':data.menu_parent_id.id, - 'icon': 'STOCK_DIALOG_QUESTION', - 'action': 'ir.actions.act_window,'+ str(action_id), - }, context) - obj_page.write(cr, uid, [page_id], {'menu_id':menu_id}) - return { - 'type': 'ir.actions.client', - 'tag': 'reload', - } - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_page/wizard/document_page_create_menu_view.xml b/addons/document_page/wizard/document_page_create_menu_view.xml deleted file mode 100644 index e4647179ad2..00000000000 --- a/addons/document_page/wizard/document_page_create_menu_view.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<openerp> - <data> - <!-- Create Menu From view --> - <record id="view_wiki_create_menu" model="ir.ui.view"> - <field name="name">Create Menu</field> - <field name="model">document.page.create.menu</field> - <field name="arch" type="xml"> - <form string="Create Menu" version="7.0"> - <group string="Menu Information"> - <field name="menu_name" /> - <field name="menu_parent_id" /> - </group> - <footer> - <button name="document_page_menu_create" string="Create Menu" type="object" class="oe_highlight"/> - or - <button string="Cancel" class="oe_link" special="cancel" /> - </footer> - </form> - </field> - </record> - <!-- Create Menu Action --> - <record id="action_wiki_create_menu" model="ir.actions.act_window"> - <field name="name">Create Menu</field> - <field name="type">ir.actions.act_window</field> - <field name="res_model">document.page.create.menu</field> - <field name="view_type">form</field> - <field name="view_mode">form</field> - <field name="target">new</field> - </record> - - </data> -</openerp> diff --git a/addons/document_page/wizard/document_page_show_diff.py b/addons/document_page/wizard/document_page_show_diff.py deleted file mode 100644 index 0c20ee79c74..00000000000 --- a/addons/document_page/wizard/document_page_show_diff.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). -# -# 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 <http://www.gnu.org/licenses/>. -# -############################################################################## - -from openerp.osv import fields, osv -from openerp.tools.translate import _ -import base64 - -class showdiff(osv.osv_memory): - """ Disp[ay Difference for History """ - - _name = 'wizard.document.page.history.show_diff' - - def get_diff(self, cr, uid, context=None): - if context is None: - context = {} - history = self.pool.get('document.page.history') - ids = context.get('active_ids', []) - - diff = "" - if len(ids) == 2: - if ids[0] > ids[1]: - diff = history.getDiff(cr, uid, ids[1], ids[0]) - else: - diff = history.getDiff(cr, uid, ids[0], ids[1]) - - elif len(ids) == 1: - old = history.browse(cr, uid, ids[0]) - nids = history.search(cr, uid, [('page_id', '=', old.page_id.id)]) - nids.sort() - diff = history.getDiff(cr, uid, ids[0], nids[-1]) - else: - raise osv.except_osv(_('Warning!'), _('You need to select minimum one or maximum two history revisions!')) - return diff - - _columns = { - 'diff': fields.text('Diff', readonly=True), - } - - _defaults = { - 'diff': get_diff - } - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_page/wizard/document_page_show_diff_view.xml b/addons/document_page/wizard/document_page_show_diff_view.xml deleted file mode 100644 index e2d5ef1af4b..00000000000 --- a/addons/document_page/wizard/document_page_show_diff_view.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<openerp> - <data> - - <!-- Create Index Form view --> - <record id="view_wiki_show_diff" model="ir.ui.view"> - <field name="name">Show Difference</field> - <field name="model">wizard.document.page.history.show_diff</field> - <field name="arch" type="xml"> - <form string="Difference" version="7.0"> - <field name="diff" widget="html" options='{"safe": True}'/> - <footer> - <button string="Cancel" class="oe_link" special="cancel" /> - </footer> - </form> - </field> - </record> - <!-- Create Index Action --> - <record id="action_view_wiki_show_diff" model="ir.actions.act_window"> - <field name="name">Difference</field> - <field name="type">ir.actions.act_window</field> - <field name="res_model">wizard.document.page.history.show_diff</field> - <field name="view_type">form</field> - <field name="view_mode">form</field> - <field name="target">new</field> - </record> - <!-- Create Index Action Window --> - <act_window - id="action_view_wiki_show_diff_values" - key2="client_action_multi" - name="Difference" - res_model="wizard.document.page.history.show_diff" - src_model="document.page.history" - view_mode="form" - target="new" - view_type="form"/> - - </data> -</openerp> |
