00001 ############################################################################## 00002 # 00003 # Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. 00004 # Fabien Pinckaers <fp@tiny.Be> 00005 # Copyright (c) 2007-2008 Albert Cervera i Areny <albert@nan-tic.com> 00006 # 00007 # WARNING: This program as such is intended to be used by professional 00008 # programmers who take the whole responsability of assessing all potential 00009 # consequences resulting from its eventual inadequacies and bugs 00010 # End users who are looking for a ready-to-use solution with commercial 00011 # garantees and support are strongly adviced to contract a Free Software 00012 # Service Company 00013 # 00014 # This program is Free Software; you can redistribute it and/or 00015 # modify it under the terms of the GNU General Public License 00016 # as published by the Free Software Foundation; either version 2 00017 # of the License, or (at your option) any later version. 00018 # 00019 # This program is distributed in the hope that it will be useful, 00020 # but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 # GNU General Public License for more details. 00023 # 00024 # You should have received a copy of the GNU General Public License 00025 # along with this program; if not, write to the Free Software 00026 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00027 # 00028 ############################################################################## 00029 00030 from Koo.Common import Api 00031 from Koo.Common import Common 00032 from Koo.Plugins import Plugins 00033 from Koo import Rpc 00034 00035 ## @brief Opens a new window that allows setting the rating for the current document. 00036 def semantic(model, id, ids, context): 00037 model_id = Rpc.session.execute( '/object', 'execute', 'ir.model', 'search', [('model','=',model)], 0, 0, False, context ) 00038 ctx = context.copy() 00039 ctx['subject_model'] = model 00040 ctx['subject_id'] = id 00041 domain = [ 00042 ('subject_model','=',model_id), 00043 ('subject_id','=', id) 00044 ] 00045 Api.instance.createWindow( None, 'nan.semantic.triple', mode='tree,form', domain=domain, context=ctx ) 00046 00047 if Common.isKdeAvailable: 00048 Plugins.register( 'Semantic', '.*', _('Semantic Info'), semantic )