# -*- 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 time import wizard import osv import pooler import urllib import base64 import module_zip import tools from tools.translate import _ intro_form = '''
''' intro_fields = { 'text': {'string':'Introduction', 'type':'text', 'readonly':True, 'default': lambda *args: """ This system will automatically publish the selected module to the Open ERP official website. You can use it to quickly publish a new module or update an existing one (new version). Make sure you read the publication manual and modules guidelines before continuing: http://www.openerp.com Thank you for contributing! """}, } def _get_selection(self, cr, uid, datas, *args): a = urllib.urlopen('http://www.openerp.com/mtree_interface.php') contents = a.read() content = filter(None, contents.split('\n')) result = map(lambda x:x.split('='), content) return result check_form = '''
''' check_fields = { 'name': {'string':'Name', 'type':'char', 'size':64, 'readonly':True}, 'shortdesc': {'string':'Small description', 'type':'char', 'size':200, 'readonly':True}, 'author': {'string':'Author', 'type':'char', 'size':128, 'readonly':True}, 'website': {'string':'Website', 'type':'char', 'size':200, 'readonly':True}, 'url': {'string':'Download URL', 'type':'char', 'size':200, 'readonly':True}, 'image': {'string':'Image file', 'type':'image', 'help': 'support only .png files'}, 'description': {'string':'Description', 'type':'text', 'readonly':True}, 'version': {'string':'Version', 'type':'char', 'readonly':True}, 'demourl': {'string':'Demo URL', 'type':'char', 'size':128, 'help': 'empty to keep existing value'}, 'docurl': {'string':'Documentation URL', 'type':'char', 'size':128, 'help': 'Empty to keep existing value'}, 'category': {'string':'Category', 'type':'selection', 'size':64, 'required':True, 'selection': _get_selection}, 'license': { 'string':'Licence', 'type':'selection', 'size':64, 'required':True, 'selection': [('GPL-2', 'GPL-2'), ('Other proprietary','Other proprietary')], 'default': lambda *args: 'GPL-2' }, 'include_src': {'string': 'Include source', 'type': 'boolean', 'default': lambda *a: True}, 'operation': { 'string':'Operation', 'type':'selection', 'readonly':True, 'selection':[('0','Creation'),('1','Modification')], }, 'url_download': {'string':'Download URL', 'type':'char', 'size':128, 'help': 'Keep empty for an auto upload of the module'}, } upload_info_form = '''