From e63aa02ac4bd6ef77c975adfdc677fbe49bcdcc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matja=C5=BE=20Mozeti=C4=8D?= Date: Wed, 23 Sep 2015 06:57:02 +0200 Subject: [PATCH] Module base_module_doc_rst migrated from version 6.1 --- base_module_doc_rst/README.rst | 60 ++ base_module_doc_rst/__init__.py | 8 + base_module_doc_rst/__openerp__.py | 43 ++ base_module_doc_rst/base_module_doc_rst.py | 180 ++++++ .../base_module_doc_rst_view.xml | 25 + .../i18n/base_module_doc_rst.pot | 114 ++++ base_module_doc_rst/i18n/it.po | 125 +++++ base_module_doc_rst/i18n/sl.po | 119 ++++ base_module_doc_rst/module_report.xml | 9 + base_module_doc_rst/report/__init__.py | 23 + .../report/ir_module_reference_graph.rml | 270 +++++++++ .../report/ir_module_reference_graph.sxw | Bin 0 -> 12733 bytes .../report/ir_module_reference_print_graph.py | 94 ++++ .../report/report_proximity_graph.py | 118 ++++ base_module_doc_rst/wizard/__init__.py | 23 + .../wizard/generate_relation_graph.py | 45 ++ .../wizard/generate_relation_graph_view.xml | 28 + .../wizard/tech_guide_rst_view.xml | 28 + base_module_doc_rst/wizard/tech_rst_guide.py | 523 ++++++++++++++++++ 19 files changed, 1835 insertions(+) create mode 100644 base_module_doc_rst/README.rst create mode 100644 base_module_doc_rst/__init__.py create mode 100644 base_module_doc_rst/__openerp__.py create mode 100644 base_module_doc_rst/base_module_doc_rst.py create mode 100644 base_module_doc_rst/base_module_doc_rst_view.xml create mode 100644 base_module_doc_rst/i18n/base_module_doc_rst.pot create mode 100644 base_module_doc_rst/i18n/it.po create mode 100644 base_module_doc_rst/i18n/sl.po create mode 100644 base_module_doc_rst/module_report.xml create mode 100644 base_module_doc_rst/report/__init__.py create mode 100644 base_module_doc_rst/report/ir_module_reference_graph.rml create mode 100644 base_module_doc_rst/report/ir_module_reference_graph.sxw create mode 100644 base_module_doc_rst/report/ir_module_reference_print_graph.py create mode 100644 base_module_doc_rst/report/report_proximity_graph.py create mode 100644 base_module_doc_rst/wizard/__init__.py create mode 100644 base_module_doc_rst/wizard/generate_relation_graph.py create mode 100644 base_module_doc_rst/wizard/generate_relation_graph_view.xml create mode 100644 base_module_doc_rst/wizard/tech_guide_rst_view.xml create mode 100644 base_module_doc_rst/wizard/tech_rst_guide.py diff --git a/base_module_doc_rst/README.rst b/base_module_doc_rst/README.rst new file mode 100644 index 000000000..75519016a --- /dev/null +++ b/base_module_doc_rst/README.rst @@ -0,0 +1,60 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License AGPL-3 + +================================================================================================= +This module generates the Technical Guides of selected modules in Restructured Text format (RST). +================================================================================================= + +Originally developed by OpenERP SA, migrated from the OpenERP version 6.1 to Odoo version 8.0 +by the Odoo Community Association. + + * It uses the Sphinx (http://sphinx.pocoo.org) implementation of RST + * It creates a tarball (.tgz file suffix) containing an index file and one file per module + * Generates Relationship Graph + +It performs its actions only on the modules that are actually installed in the same database +(being available in the module list is not enough). + +Installation +============ + +* The module automatically takes care of its dependencies and is ready for use after the installation + +TODO +======= + * Hide "Relationship Graph" page if module not installed. + * Raise an exception when clicking on "Generate Relationship..." if the module is not installed. + + +Credits +======= + +Contributors +------------ + +* OpenERP SA +* Matjaž Mozetič + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. \ No newline at end of file diff --git a/base_module_doc_rst/__init__.py b/base_module_doc_rst/__init__.py new file mode 100644 index 000000000..b5cfe36f1 --- /dev/null +++ b/base_module_doc_rst/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +# © 2004-2009 Tiny SPRL (original author) +# +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import base_module_doc_rst +from . import wizard +from . import report diff --git a/base_module_doc_rst/__openerp__.py b/base_module_doc_rst/__openerp__.py new file mode 100644 index 000000000..0ec966d87 --- /dev/null +++ b/base_module_doc_rst/__openerp__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 . +# +############################################################################## + +{ + "name": "Generate Docs of Modules", + "version": "1.0", + "category": "Tools", + "summary": "Modules Technical Guides in RST and Relationship Graphs", + "website": "https://odoo-community.org/", + "author": "OpenERP SA,Odoo Community Association (OCA)", + "contributors": [ + "OpenERP SA ", + "Matjaž Mozetič ", + ], + "license": "AGPL-3", + "depends": ["base"], + "data": [ + "base_module_doc_rst_view.xml", + "wizard/generate_relation_graph_view.xml", + "wizard/tech_guide_rst_view.xml", + "module_report.xml", + ], + "demo": [], + "installable": True, +} diff --git a/base_module_doc_rst/base_module_doc_rst.py b/base_module_doc_rst/base_module_doc_rst.py new file mode 100644 index 000000000..021a07796 --- /dev/null +++ b/base_module_doc_rst/base_module_doc_rst.py @@ -0,0 +1,180 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 os +import base64 +import openerp.modules.registry +from openerp import models, fields + + +class Module(models.Model): + _inherit = 'ir.module.module' + _description = 'Module With Relationship Graph' + + file_graph = fields.Binary('Relationship Graph') + + def _get_graphical_representation( + self, cr, uid, model_ids, level=1, context=None + ): + obj_model = self.pool.get('ir.model') + if level == 0: + return tuple() + relation = [] + for id in model_ids: + model_data = obj_model.browse(cr, uid, id, context=context) + for field in ( + f for f in model_data.field_id if f.ttype in ( + 'many2many', 'many2one', 'one2many' + ) + ): + relation.append( + ( + model_data.model, + field.name, + field.ttype, + field.relation, + field.field_description + ) + ) + new_model_ids = obj_model.search( + cr, + uid, + [('model', '=', field.relation)], + context=context + ) + if new_model_ids: + model = obj_model.read( + cr, + uid, + new_model_ids, + ['id', 'name'], + context=context + )[0] + relation.extend( + self._get_graphical_representation( + cr, uid, model['id'], level - 1 + ) + ) + return tuple(relation) + + def _get_structure(self, relations, main_element): + res = {} + for rel in relations: + # if we have to display the string along with field name, + # then uncomment the first line n comment the second line + res.setdefault(rel[0], set()).add(rel[1]) + res.setdefault(rel[3], set()) + val = [] + for obj, fieldsx in res.items(): + val.append('"%s" [%s label="{%s|%s}"];' % ( + obj, + obj in + main_element and + 'fillcolor=yellow, style="filled,rounded"' or + "", + obj, + "|".join(["<%s> %s" % (fn, fn) for fn in fieldsx]) + )) + return "\n".join(val) + + def _get_arrow(self, field_type='many2one'): + return { + 'many2one': ( + 'arrowtail="none" arrowhead="normal" color="red" label="m2o"' + ), + 'many2many': ( + 'arrowtail="crow" arrowhead="crow" color="green" label="m2m"' + ), + 'one2many': ( + 'arrowtail="none" arrowhead="crow" color="blue" label="o2m"' + ), + }[field_type] + + def get_graphical_representation(self, cr, uid, model_ids, context=None): + obj_model = self.pool.get('ir.model') + if context is None: + context = {} + res = {} + models = [] + for obj in obj_model.browse(cr, uid, model_ids, context=context): + models.append(obj.model) + relations = set( + self._get_graphical_representation( + cr, uid, model_ids, context.get('level', 1) + ) + ) + res[obj.model] = ( + "digraph G {\nnode [style=rounded, shape=record];\n%s\n%s }" % ( + self._get_structure(relations, models), + ''.join('"%s":%s -> "%s":id:n [%s]; // %s\n' % ( + m, fn, fr, self._get_arrow(ft), ft + ) for m, fn, ft, fr, fl in relations), + ) + ) + return res + + def _get_module_objects(self, cr, uid, module, context=None): + obj_model = self.pool.get('ir.model') + obj_mod_data = self.pool.get('ir.model.data') + obj_ids = [] + model_data_ids = obj_mod_data.search( + cr, uid, + [('module', '=', module), ('model', '=', 'ir.model')], + context=context + ) + model_ids = [] + for mod in obj_mod_data.browse( + cr, uid, model_data_ids, context=context + ): + model_ids.append(mod.res_id) + models = obj_model.browse(cr, uid, model_ids, context=context) + map(lambda x: obj_ids.append(x.id), models) + return obj_ids + + def get_relation_graph(self, cr, uid, module_name, context=None): + if context is None: + context = {} + object_ids = self._get_module_objects( + cr, uid, module_name, context=context + ) + if not object_ids: + return {'module_file': False} + # context.update({'level': 1}) + dots = self.get_graphical_representation( + cr, uid, object_ids, context=context + ) + # todo: use os.realpath + file_path = openerp.modules.module.get_module_path( + 'base_module_doc_rst' + ) + path_png = file_path + "/module.png" + for key, val in dots.items(): + path_dotfile = file_path + "/%s.dot" % (key,) + fp = file(path_dotfile, "w") + fp.write(val) + fp.close() + os.popen( + 'dot -Tpng' + ' ' + path_dotfile + ' ' + '-o' + ' ' + path_png + ) + fp = file(path_png, "r") + x = fp.read() + fp.close() + os.popen('rm ' + path_dotfile + ' ' + path_png) + return {'module_file': base64.encodestring(x)} diff --git a/base_module_doc_rst/base_module_doc_rst_view.xml b/base_module_doc_rst/base_module_doc_rst_view.xml new file mode 100644 index 000000000..2fa4e220d --- /dev/null +++ b/base_module_doc_rst/base_module_doc_rst_view.xml @@ -0,0 +1,25 @@ + + + + + + + + ir.module.module.form.graph + ir.module.module + + form + + + + + + + + + + + + diff --git a/base_module_doc_rst/i18n/base_module_doc_rst.pot b/base_module_doc_rst/i18n/base_module_doc_rst.pot new file mode 100644 index 000000000..d4f226367 --- /dev/null +++ b/base_module_doc_rst/i18n/base_module_doc_rst.pot @@ -0,0 +1,114 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * base_module_doc_rst +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-17 11:49+0000\n" +"PO-Revision-Date: 2015-09-17 11:49+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Cancel" +msgstr "" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Create Graphs" +msgstr "" + +#. module: base_module_doc_rst +#: model:ir.actions.act_window,name:base_module_doc_rst.wiz_tech_guide_rst +msgid "Create RST Technical Guide2" +msgstr "" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Create Technical Guide in rst format" +msgstr "" + +#. module: base_module_doc_rst +#: field:create.relation.graph,create_uid:0 +#: field:tech.guide.rst,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: base_module_doc_rst +#: field:create.relation.graph,create_date:0 +#: field:tech.guide.rst,create_date:0 +msgid "Created on" +msgstr "" + +#. module: base_module_doc_rst +#: field:tech.guide.rst,rst_file:0 +msgid "File" +msgstr "" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +#: model:ir.actions.act_window,name:base_module_doc_rst.generate_relationship_graph_values +msgid "Generate Relationship Graph" +msgstr "" + +#. module: base_module_doc_rst +#: field:create.relation.graph,id:0 +#: field:tech.guide.rst,id:0 +msgid "ID" +msgstr "" + +#. module: base_module_doc_rst +#: field:create.relation.graph,write_uid:0 +#: field:tech.guide.rst,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: base_module_doc_rst +#: field:create.relation.graph,write_date:0 +#: field:tech.guide.rst,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: base_module_doc_rst +#: model:ir.model,name:base_module_doc_rst.model_ir_module_module +msgid "Module" +msgstr "" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Please choose a file where the Technical Guide will be written." +msgstr "" + +#. module: base_module_doc_rst +#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph +msgid "Proximity graph" +msgstr "" + +#. module: base_module_doc_rst +#: view:ir.module.module:base_module_doc_rst.view_module_module_graph +#: field:ir.module.module,file_graph:0 +msgid "Relationship Graph" +msgstr "" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Relationship Graphs" +msgstr "" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Technical Guide in rst format" +msgstr "" + +#. module: base_module_doc_rst +#: view:ir.module.module:base_module_doc_rst.view_module_module_graph +msgid "You can save this image as .png file" +msgstr "" + diff --git a/base_module_doc_rst/i18n/it.po b/base_module_doc_rst/i18n/it.po new file mode 100644 index 000000000..fcbc09d24 --- /dev/null +++ b/base_module_doc_rst/i18n/it.po @@ -0,0 +1,125 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_module_doc_rst +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0dev\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-17 13:51+0200\n" +"PO-Revision-Date: 2015-09-17 13:52+0200\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-05-29 06:51+0000\n" +"X-Generator: Poedit 1.8.4\n" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Cancel" +msgstr "Cancella" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Create Graphs" +msgstr "Creazione dei grafici" + +#. module: base_module_doc_rst +#: model:ir.actions.act_window,name:base_module_doc_rst.wiz_tech_guide_rst +msgid "Create RST Technical Guide2" +msgstr "Creazione della Guida Tecnica in 'rst'" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Create Technical Guide in rst format" +msgstr "Creazione della Guida Tecnica nel formato 'rst'" + +#. module: base_module_doc_rst +#: field:create.relation.graph,create_uid:0 field:tech.guide.rst,create_uid:0 +msgid "Created by" +msgstr "Creato da" + +#. module: base_module_doc_rst +#: field:create.relation.graph,create_date:0 field:tech.guide.rst,create_date:0 +msgid "Created on" +msgstr "Creato il" + +#. module: base_module_doc_rst +#: field:tech.guide.rst,rst_file:0 +msgid "File" +msgstr "File" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +#: model:ir.actions.act_window,name:base_module_doc_rst.generate_relationship_graph_values +msgid "Generate Relationship Graph" +msgstr "Genera grafici relazioni" + +#. module: base_module_doc_rst +#: field:create.relation.graph,id:0 field:tech.guide.rst,id:0 +msgid "ID" +msgstr "ID" + +#. module: base_module_doc_rst +#: field:create.relation.graph,write_uid:0 field:tech.guide.rst,write_uid:0 +msgid "Last Updated by" +msgstr "Ultimo aggiornamento da" + +#. module: base_module_doc_rst +#: field:create.relation.graph,write_date:0 field:tech.guide.rst,write_date:0 +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: base_module_doc_rst +#: model:ir.model,name:base_module_doc_rst.model_ir_module_module +msgid "Module" +msgstr "Modulo" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Please choose a file where the Technical Guide will be written." +msgstr "Selezionare un file dove la Guida Tecnica potrebbe essere scritta." + +#. module: base_module_doc_rst +#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph +msgid "Proximity graph" +msgstr "Grafico prossimità" + +#. module: base_module_doc_rst +#: view:ir.module.module:base_module_doc_rst.view_module_module_graph +#: field:ir.module.module,file_graph:0 +msgid "Relationship Graph" +msgstr "Grafico relazioni" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Relationship Graphs" +msgstr "Grafico relazioni" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Technical Guide in rst format" +msgstr "Guida tecnica nel formato 'rst'" + +#. module: base_module_doc_rst +#: view:ir.module.module:base_module_doc_rst.view_module_module_graph +msgid "You can save this image as .png file" +msgstr "E' possibile salvare questa immagine come file .PNG" + +#~ msgid "Ok" +#~ msgstr "Ok" + +#~ msgid "(Relationship Graphs generated)" +#~ msgstr "(Grafici relazioni generati)" + +#~ msgid "filename" +#~ msgstr "nome file" + +#~ msgid "file" +#~ msgstr "file" + +#~ msgid "Close" +#~ msgstr "Chiudi" diff --git a/base_module_doc_rst/i18n/sl.po b/base_module_doc_rst/i18n/sl.po new file mode 100644 index 000000000..857a3d9fe --- /dev/null +++ b/base_module_doc_rst/i18n/sl.po @@ -0,0 +1,119 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_module_doc_rst +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0dev\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-17 13:50+0200\n" +"PO-Revision-Date: 2015-09-17 13:51+0200\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: \n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-05-29 06:51+0000\n" +"X-Generator: Poedit 1.8.4\n" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Cancel" +msgstr "Preklic" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Create Graphs" +msgstr "Ustvari grafe" + +#. module: base_module_doc_rst +#: model:ir.actions.act_window,name:base_module_doc_rst.wiz_tech_guide_rst +msgid "Create RST Technical Guide2" +msgstr "Izdelaj RST tehnična navodila" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Create Technical Guide in rst format" +msgstr "Izdelaj tehnična navodila v formatu rst" + +#. module: base_module_doc_rst +#: field:create.relation.graph,create_uid:0 field:tech.guide.rst,create_uid:0 +msgid "Created by" +msgstr "Ustvaril" + +#. module: base_module_doc_rst +#: field:create.relation.graph,create_date:0 field:tech.guide.rst,create_date:0 +msgid "Created on" +msgstr "Ustvarjeno" + +#. module: base_module_doc_rst +#: field:tech.guide.rst,rst_file:0 +msgid "File" +msgstr "Datoteka" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +#: model:ir.actions.act_window,name:base_module_doc_rst.generate_relationship_graph_values +msgid "Generate Relationship Graph" +msgstr "Ustvari relacijski diagram" + +#. module: base_module_doc_rst +#: field:create.relation.graph,id:0 field:tech.guide.rst,id:0 +msgid "ID" +msgstr "ID" + +#. module: base_module_doc_rst +#: field:create.relation.graph,write_uid:0 field:tech.guide.rst,write_uid:0 +msgid "Last Updated by" +msgstr "Zadnjič posodobil" + +#. module: base_module_doc_rst +#: field:create.relation.graph,write_date:0 field:tech.guide.rst,write_date:0 +msgid "Last Updated on" +msgstr "Zadnjič posodobljeno" + +#. module: base_module_doc_rst +#: model:ir.model,name:base_module_doc_rst.model_ir_module_module +msgid "Module" +msgstr "Modul" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Please choose a file where the Technical Guide will be written." +msgstr "Prosimo, izberite datoteko, v katero se bodo zapisala tehnična navodila" + +#. module: base_module_doc_rst +#: model:ir.actions.report.xml,name:base_module_doc_rst.report_proximity_graph +msgid "Proximity graph" +msgstr "Graf bližine" + +#. module: base_module_doc_rst +#: view:ir.module.module:base_module_doc_rst.view_module_module_graph +#: field:ir.module.module,file_graph:0 +msgid "Relationship Graph" +msgstr "Relacijski diagram" + +#. module: base_module_doc_rst +#: view:create.relation.graph:base_module_doc_rst.view_relationship_graph +msgid "Relationship Graphs" +msgstr "Relacijski diagrami" + +#. module: base_module_doc_rst +#: view:tech.guide.rst:base_module_doc_rst.view_technical_guide +msgid "Technical Guide in rst format" +msgstr "Tehnična navodila v rst formatu" + +#. module: base_module_doc_rst +#: view:ir.module.module:base_module_doc_rst.view_module_module_graph +msgid "You can save this image as .png file" +msgstr "To sliko lahko shranite kot .png datoteko." + +#~ msgid "filename" +#~ msgstr "ime datoteke" + +#~ msgid "file" +#~ msgstr "datoteka" + +#~ msgid "Close" +#~ msgstr "Zapri" diff --git a/base_module_doc_rst/module_report.xml b/base_module_doc_rst/module_report.xml new file mode 100644 index 000000000..e3d4e3424 --- /dev/null +++ b/base_module_doc_rst/module_report.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/base_module_doc_rst/report/__init__.py b/base_module_doc_rst/report/__init__.py new file mode 100644 index 000000000..741758c3d --- /dev/null +++ b/base_module_doc_rst/report/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 . import ir_module_reference_print_graph +from . import report_proximity_graph diff --git a/base_module_doc_rst/report/ir_module_reference_graph.rml b/base_module_doc_rst/report/ir_module_reference_graph.rml new file mode 100644 index 000000000..40f631fc9 --- /dev/null +++ b/base_module_doc_rst/report/ir_module_reference_graph.rml @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Introspection report on objects + + + + + + + + + + + + + + +
+ [[ repeatIn(objects,'module') ]] + + + + Module + + + Name + + + Version + + + Directory + + + Web + + + + + + + [[ module.name ]] + + + [[ module.shortdesc]] + + + [[module.latest_version]] + + + [[ module.name ]] + + + [[ module.website ]] + + + + + + + [[ module.description ]] + + + + Reports : + [[ format(module.reports_by_module) ]] + + + + Menu : + [[ format(module.menus_by_module) ]] + + + + View : + [[ format(module.views_by_module) ]] + + + + + + + Dependencies : + + + + + [[ repeatIn(module.dependencies_id,'dependencies_id') ]] + [[ dependencies_id.name ]] - [[ dependencies_id.state ]] + + + +
+ + + + [[ repeatIn(findobj(module.name) ,'object') ]] + + + + + + + Object: [[ object.model ]] [[ objdoc(object.model) ]] + + + + + [[ repeatIn(objdoc2(object.model) or [], 'sline') ]] + [[ sline ]] + + + +
+ + + +
+
+ [[ repeatIn(findflds(object.model), 'field') ]] + + + + [[ field[0] ]] + + + [[ field[1].get('string', 'Unknown') ]], [[ field[1]['type'] ]] [[field[1].get('required',False) and ', required']] [[field[1].get('readonly',False) and ', readonly']] + [[ field[1].get('help', '') ]] + + + + + + +
+
+ + [[ module.file_graph and setTag('para','image', {'width':'300.0','height':'250.0'}) ]][[ module.file_graph ]] +
+
+
diff --git a/base_module_doc_rst/report/ir_module_reference_graph.sxw b/base_module_doc_rst/report/ir_module_reference_graph.sxw new file mode 100644 index 0000000000000000000000000000000000000000..77052af5e4f140fb7ab9854e8d1f78d049e28f40 GIT binary patch literal 12733 zcma)j1#le6vaKv;vMgqnr4cjOVhb#0)`%HLY%!C?U|Gz}%*@Qp7BjQHeeb)^d-v~d zyqxHX>X<&KvO0S*GO|v~NOhJZrvj4^L6ZXG``*S2@ZDnL?>|pmVv^_I}JqQSL zu-60HG5i|``*WsWbN?^s=YZ-ja6o;1Lkq*7G}d+u`VMw>hE||oK0tuUO2Yi|6%72> z*H8O9J8NS*L;F80 z|F35JD?fit_WP#&Ur``yYm0wI5&eairj|fsLwg26Q;;Rl#{M7Tg!mI|0d%o;00H!Y z`X+|@2D%2+>-xI7u=G!>*pI81m{yydiKY!J?wgUZ6TxT>at(Q2_ zUs~G)&)x)r>hDlBW8ppu$4CvPxe!F}URzH3NKN5>NA+rB>EQL0r^s9i`# zTY1lu1a<|oj3EvHZ?4Bs-qglNG7EQd0P0pu)flgWB0BHC&nAqW9s>_|i-@#i77$%* zj@~jL>-Jkl_-TGo*8}zUHr`5^cet=R;-h!Sa@4@3@T^GZZSAdT7=dk>YXZv1(QT25 zoO7x%#QZxz5mppYL5~>4?{jjz%0)>(k`-K;)tHsJN=y=ji;fc25vAPvK@;~}c*)(B zC~9BlayBc{htMd?x9;*I=5&19s@0;3LL!EVOU&UX#qaIFm^`2WN4A4D9&$l5JN{;9 zhG6~1q((osyLXz;GorxFqfxXSiy|J6nAT4YT$nKznUxC7 z@k9|I27ir*aBV`)g{&*anGj?_C2k(QH3W&pGgIH4>9VXGDvq7=bW8R}!8qp4gN`T8 zF>QNkAib~O$?LB8L^d=Xyugumdc2REA!slZ4ss(kiuWRo+em`owDREVP3=OJC&wO9 z4yw>c)$aP(F;|bRT3ZI+m1K*J53$Lj8kyccA^tcK!vh7$Aw|5ShulG_Q6ToM%)=@J zV{sYu-dFAvG>{(@vMtEvGaOVB$q-Y_V-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7N-Yd$T)J2F&2izLu6nv?JoQj%%J@v2()Ld35>N^S*%j6}va!7+`-d!2TJ)KiGfd z*ndX-;S#W4YUST1{B!tc#q%Ep*#DmWj}q+vsHlHQuz%Z^pTj@%{EZ;{pPc*E$p39q zKZk!N{Vm7-?;G(Bmenu{88@xpHTk?`A6Z^ zFFE&bv-yeC|1IwRGw_dFfxmQFzis{J>2HBMwhjM` z`eW(%-;oQ&{QHfjKePNX1^@SL>Y@DaqVvzlKPG@*Df+i{(f&=smX(Bp{&gAZ&kyy_ LyzdG4b@u-NR2`jG literal 0 HcmV?d00001 diff --git a/base_module_doc_rst/report/ir_module_reference_print_graph.py b/base_module_doc_rst/report/ir_module_reference_print_graph.py new file mode 100644 index 000000000..2f101a629 --- /dev/null +++ b/base_module_doc_rst/report/ir_module_reference_print_graph.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 time +from openerp.report import report_sxw + + +class IrModuleReferencePrintGraph(report_sxw.rml_parse): + def __init__(self, cr, uid, name, context): + super(IrModuleReferencePrintGraph, self).__init__( + cr, uid, name, context=context + ) + self.localcontext.update({ + 'time': time, + 'findobj': self._object_find, + 'objdoc': self._object_doc, + 'objdoc2': self._object_doc2, + 'findflds': self._fields_find, + }) + + def _object_doc(self, obj): + modobj = self.pool.get(obj) + strdocs = modobj.__doc__ + if not strdocs: + return None + else: + strdocs = strdocs.strip().splitlines(True) + res = '' + for stre in strdocs: + if not stre or stre.isspace(): + break + res += stre + return res + + def _object_doc2(self, obj): + modobj = self.pool.get(obj) + strdocs = modobj.__doc__ + if not strdocs: + return None + else: + strdocs = strdocs.strip().splitlines(True) + res = [] + fou = False + for stre in strdocs: + if fou: + res.append(stre.strip()) + elif not stre or stre.isspace(): + fou = True + return res + + def _object_find(self, module): + ids2 = self.pool.get('ir.model.data').search( + self.cr, self.uid, [ + ('module', '=', module), ('model', '=', 'ir.model') + ] + ) + ids = [] + for mod in self.pool.get('ir.model.data').browse( + self.cr, self.uid, ids2 + ): + ids.append(mod.res_id) + modobj = self.pool.get('ir.model') + return modobj.browse(self.cr, self.uid, ids) + + def _fields_find(self, obj): + modobj = self.pool.get(obj) + res = modobj.fields_get(self.cr, self.uid).items() + return res + +report_sxw.report_sxw( + 'report.ir.module.reference.graph', + 'ir.module.module', + 'addons/base_module_doc_rst/report/ir_module_reference_graph.rml', + parser=IrModuleReferencePrintGraph, + header=False +) diff --git a/base_module_doc_rst/report/report_proximity_graph.py b/base_module_doc_rst/report/report_proximity_graph.py new file mode 100644 index 000000000..1fb81556c --- /dev/null +++ b/base_module_doc_rst/report/report_proximity_graph.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 os +import pydot + +from openerp import report +from openerp import pooler +from openerp import tools + + +class ReportGraph(report.interface.report_int): + def __init__(self, name, table): + report.interface.report_int.__init__(self, name) + self.table = table + + def get_proximity_graph(self, cr, uid, module_id, context=None): + pool_obj = pooler.get_pool(cr.dbname) + module_obj = pool_obj.get('ir.module.module') + nodes = [('base', 'unknown')] + edges = [] + + def get_depend_module(module_id): + module_record = module_obj.browse( + cr, uid, module_id, context=context + ) + if module_record.name not in nodes: + # Add new field ir.module.module object in server side. + # field name = module_type/ + nodes.append((module_record.name, "unknown")) + if module_record.dependencies_id: + for depen in module_record.dependencies_id: + if (module_record.name, depen.name) not in edges: + edges.append((module_record.name, depen.name)) + if depen.name == "base": + continue + id = module_obj.browse(cr, uid, module_obj.search( + cr, uid, [('name', '=', depen.name)]), context=context + ) + if id: + get_depend_module(id[0].id) + get_depend_module(module_id) + graph = pydot.Dot( + graph_type='digraph', + fontsize='10', + label=""" + Proximity Graph. + Gray Color-Official Modules, + Red Color-Extra Addons Modules, + Blue Color-Community Modules, + Purple Color-Unknow Modules + """, + center='1' + ) + for node in nodes: + if node[1] == "official": + graph.add_node( + pydot.Node( + node[0], style="filled", fillcolor="lightgray" + ) + ) + elif node[1] == "extra_addons": + graph.add_node( + pydot.Node( + node[0], style="filled", fillcolor="red" + ) + ) + elif node[1] == "community": + graph.add_node( + pydot.Node( + node[0], style="filled", fillcolor="#000FFF" + ) + ) + elif node[1] == "unknown": + graph.add_node( + pydot.Node( + node[0], style="filled", fillcolor="purple" + ) + ) + for edge in edges: + graph.add_edge(pydot.Edge(edge[0], edge[1])) + + ps_string = graph.create(prog='dot', format='ps') + if os.name == "nt": + prog = 'ps2pdf.bat' + else: + prog = 'ps2pdf' + + args = (prog, '-', '-') + input, output = tools.exec_command_pipe(*args) + input.write(ps_string) + input.close() + return output.read() + + def create(self, cr, uid, ids, data, context=None): + pdf_string = self.get_proximity_graph( + cr, uid, context.get('active_id') + ) + return (pdf_string, 'pdf') + +ReportGraph('report.proximity.graph', 'ir.module.module') diff --git a/base_module_doc_rst/wizard/__init__.py b/base_module_doc_rst/wizard/__init__.py new file mode 100644 index 000000000..f5c85a654 --- /dev/null +++ b/base_module_doc_rst/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 . import tech_rst_guide +from . import generate_relation_graph diff --git a/base_module_doc_rst/wizard/generate_relation_graph.py b/base_module_doc_rst/wizard/generate_relation_graph.py new file mode 100644 index 000000000..52c64efc7 --- /dev/null +++ b/base_module_doc_rst/wizard/generate_relation_graph.py @@ -0,0 +1,45 @@ +# -*- 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 openerp.osv import orm + + +class CreateGraph(orm.TransientModel): + _name = "create.relation.graph" + + def get_graph(self, cr, uid, datas, context=None): + mod_obj = self.pool.get('ir.module.module') + modules = mod_obj.browse( + cr, uid, context['active_ids'], context=context + ) + for module in modules: + module_data = mod_obj.get_relation_graph( + cr, uid, module.name, context=context + ) + if module_data['module_file']: + mod_obj.write( + cr, + uid, + [module.id], + {'file_graph': module_data['module_file']}, + context=context + ) + return {'type': 'ir.actions.act_window_close'} diff --git a/base_module_doc_rst/wizard/generate_relation_graph_view.xml b/base_module_doc_rst/wizard/generate_relation_graph_view.xml new file mode 100644 index 000000000..4712ac2ca --- /dev/null +++ b/base_module_doc_rst/wizard/generate_relation_graph_view.xml @@ -0,0 +1,28 @@ + + + + + + create.relation.graph.form + create.relation.graph + form + +
+ +