diff --git a/Makefile b/Makefile index b4a57c2859b..782a3d51a3f 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ module := base database := terp language := fr_FR i18n-import := bin/addons/base/i18n/fr_FR.po -interrogation_file := bin/addons/quality_integration_server/base_quality_interrogation.py +interrogation_file := bin/addons/base_quality_interrogation.py login := admin password := admin diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index bdd3da46bbf..5a08c21002a 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -41,6 +41,8 @@ import base64 from zipfile import PyZipFile, ZIP_DEFLATED from cStringIO import StringIO +import logging + logger = netsvc.Logger() @@ -89,7 +91,7 @@ class Graph(dict): ## and we update the default values with values from the database additional_data.update(dict([(x.pop('name'), x) for x in cr.dictfetchall()])) - + for package in self.values(): for k, v in additional_data[package.name].items(): setattr(package, k, v) @@ -221,7 +223,7 @@ def get_module_as_zip_from_module_directory(module_directory, b64enc=True, src=T base = os.path.basename(path) for f in tools.osutil.listdir(path, True): bf = os.path.basename(f) - if not RE_exclude.search(bf) and (src or bf == '__terp__.py' or not bf.endswith('.py')): + if not RE_exclude.search(bf) and (src or bf in ('__openerp__.py', '__terp__.py') or not bf.endswith('.py')): archive.write(os.path.join(path, f), os.path.join(base, f)) archname = StringIO() @@ -294,13 +296,24 @@ def get_modules(): plist.extend(listdir(ad)) return list(set(plist)) +def load_information_from_description_file(module): + """ + :param module: The name of the module (sale, purchase, ...) + """ + for filename in ['__openerp__.py', '__terp__.py']: + description_file = get_module_resource(module, filename) + if os.path.isfile(description_file): + return eval(tools.file_open(description_file).read()) + + logging.warning('The module %s does not contain a description file: __openerp__.py or __terp__.py (deprecated)' % module) + return {} + def get_modules_with_version(): modules = get_modules() res = {} for module in modules: - terp = get_module_resource(module, '__terp__.py') try: - info = eval(tools.file_open(terp).read()) + info = load_information_from_description_file(module) res[module] = "%s.%s" % (release.major_version, info['version']) except Exception, e: continue @@ -318,13 +331,17 @@ def upgrade_graph(graph, cr, module_list, force=None): len_graph = len(graph) for module in module_list: mod_path = get_module_path(module) - terp_file = get_module_resource(module, '__terp__.py') + terp_file = get_module_resource(module, '__openerp__.py') + if not os.path.isfile(terp_file): + terp_file = get_module_resource(module, '__terp__.py') + if not mod_path or not terp_file: global not_loaded not_loaded.append(module) logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: not installable' % (module)) raise osv.osv.except_osv('Error!',"Module '%s' was not found" % (module,)) + if os.path.isfile(terp_file) or zipfile.is_zipfile(mod_path+'.zip'): try: info = eval(tools.file_open(terp_file).read()) @@ -337,7 +354,7 @@ def upgrade_graph(graph, cr, module_list, force=None): dependencies = dict([(p, deps) for p, deps, data in packages]) current, later = set([p for p, dep, data in packages]), set() - + while packages and current > later: package, deps, data = packages[0] @@ -378,7 +395,7 @@ def init_module_objects(cr, module_name, obj_list): try: result = obj._auto_init(cr, {'module': module_name}) except Exception, e: - raise + raise if result: todo += result if hasattr(obj, 'init'): @@ -588,7 +605,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): modobj = None logger.notifyChannel('init', netsvc.LOG_DEBUG, 'loading %d packages..' % len(graph)) - + for package in graph: logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading objects' % package.name) migrations.migrate_module(package, 'pre') @@ -597,7 +614,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): init_module_objects(cr, package.name, modules) cr.commit() - + for package in graph: status['progress'] = (float(statusi)+0.1) / len(graph) m = package.name @@ -697,16 +714,14 @@ def load_modules(db, force_demo=False, status=None, update_module=False): status = {} cr = db.cursor() if cr: - cr.execute("SELECT relname FROM pg_class WHERE relkind='r' AND relname='ir_module_module'") - if len(cr.fetchall())==0: - logger.notifyChannel("init", netsvc.LOG_INFO, "init db") - tools.init_db(cr) -# cr.execute("update res_users set password=%s where id=%s",('admin',1)) - # in that case, force --init=all - tools.config["init"]["all"] = 1 - tools.config['update']['all'] = 1 - if not tools.config['without_demo']: - tools.config["demo"]['all'] = 1 + cr.execute("SELECT relname FROM pg_class WHERE relkind='r' AND relname='ir_module_module'") + if len(cr.fetchall())==0: + logger.notifyChannel("init", netsvc.LOG_INFO, "init db") + tools.init_db(cr) + tools.config["init"]["all"] = 1 + tools.config['update']['all'] = 1 + if not tools.config['without_demo']: + tools.config["demo"]['all'] = 1 force = [] if force_demo: force.append('demo') @@ -716,7 +731,6 @@ def load_modules(db, force_demo=False, status=None, update_module=False): # NOTE: Try to also load the modules that have been marked as uninstallable previously... STATES_TO_LOAD = ['installed', 'to upgrade', 'uninstallable'] graph = create_graph(cr, ['base'], force) - has_updates = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report) global not_loaded @@ -761,6 +775,7 @@ def load_modules(db, force_demo=False, status=None, update_module=False): if new_modules_in_graph == 0: # nothing to load break + logger.notifyChannel('init', netsvc.LOG_DEBUG, 'Updating graph with %d more modules' % (len(module_list))) r = load_module_graph(cr, graph, status, report=report) has_updates = has_updates or r diff --git a/bin/addons/base/i18n/et.po b/bin/addons/base/i18n/et.po index 81ccf3ae5ed..d4461213af4 100644 --- a/bin/addons/base/i18n/et.po +++ b/bin/addons/base/i18n/et.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2009-12-15 06:29+0000\n" -"Last-Translator: Fabien (Open ERP) \n" +"PO-Revision-Date: 2010-03-16 05:12+0000\n" +"Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-01-14 04:45+0000\n" +"X-Launchpad-Export-Date: 2010-03-17 04:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base @@ -46,7 +46,7 @@ msgstr "Vaata Ülesehitust" #: code:addons/base/ir/ir_model.py:0 #, python-format msgid "You can not create this kind of document! (%s)" -msgstr "" +msgstr "Sa ei saa luua seda tüüpi dokumenti! (%s)" #. module: base #: wizard_field:module.lang.import,init,code:0 diff --git a/bin/addons/base/i18n/fi.po b/bin/addons/base/i18n/fi.po index 554dc2dfb21..d76791b3541 100644 --- a/bin/addons/base/i18n/fi.po +++ b/bin/addons/base/i18n/fi.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2009-12-15 06:31+0000\n" -"Last-Translator: mra (Open ERP) \n" +"PO-Revision-Date: 2010-03-13 05:29+0000\n" +"Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-01-14 04:45+0000\n" +"X-Launchpad-Export-Date: 2010-03-14 05:02+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base @@ -7547,7 +7547,7 @@ msgstr "keskitetty" #. module: base #: field:maintenance.contract.wizard,state:0 msgid "States" -msgstr "Osavaltiot" +msgstr "Tilat" #. module: base #: view:multi_company.default:0 diff --git a/bin/addons/base/i18n/hr.po b/bin/addons/base/i18n/hr.po index 195bcca96f7..897cc4ed51c 100644 --- a/bin/addons/base/i18n/hr.po +++ b/bin/addons/base/i18n/hr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-03-11 05:23+0000\n" +"PO-Revision-Date: 2010-03-16 05:10+0000\n" "Last-Translator: goranc \n" "Language-Team: openerp-translators\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-03-12 04:50+0000\n" +"X-Launchpad-Export-Date: 2010-03-17 04:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Language: hr\n" diff --git a/bin/addons/base/i18n/it.po b/bin/addons/base/i18n/it.po index acca5687353..ed9e2a191a3 100644 --- a/bin/addons/base/i18n/it.po +++ b/bin/addons/base/i18n/it.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-03-11 11:29+0000\n" +"PO-Revision-Date: 2010-03-12 05:20+0000\n" "Last-Translator: Maurizio.Colella \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-03-12 04:50+0000\n" +"X-Launchpad-Export-Date: 2010-03-13 04:50+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/ja.po b/bin/addons/base/i18n/ja.po index 7edaec05ea2..8721b79b2c4 100644 --- a/bin/addons/base/i18n/ja.po +++ b/bin/addons/base/i18n/ja.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-server\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-03-11 05:20+0000\n" +"PO-Revision-Date: 2010-03-16 05:09+0000\n" "Last-Translator: Harry (Open ERP) \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-03-12 04:50+0000\n" +"X-Launchpad-Export-Date: 2010-03-17 04:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/ro.po b/bin/addons/base/i18n/ro.po index cd94fb57e9f..f2d25122948 100644 --- a/bin/addons/base/i18n/ro.po +++ b/bin/addons/base/i18n/ro.po @@ -7,19 +7,19 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2009-12-21 06:09+0000\n" +"PO-Revision-Date: 2010-03-16 16:14+0000\n" "Last-Translator: Valentin Caragea \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-01-14 04:47+0000\n" +"X-Launchpad-Export-Date: 2010-03-17 04:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base #: model:res.country,name:base.sh msgid "Saint Helena" -msgstr "Sfanta Elena" +msgstr "Sfânta Elena" #. module: base #: wizard_view:res.partner.sms_send,init:0 @@ -29,12 +29,12 @@ msgstr "SMS - Gateway: clickatell" #. module: base #: view:res.lang:0 msgid "%j - Day of the year as a decimal number [001,366]." -msgstr "%j - Ziua anului ca numar zecimal [001,366]" +msgstr "%j - Ziua anului ca numar zecimal [001,366]." #. module: base #: field:ir.values,meta_unpickle:0 msgid "Metadata" -msgstr "Metadata" +msgstr "Metadate" #. module: base #: field:ir.ui.view,arch:0 @@ -313,50 +313,50 @@ msgstr "Nume cimp" #: model:ir.actions.act_window,name:base.open_module_tree_uninstall #: model:ir.ui.menu,name:base.menu_module_tree_uninstall msgid "Uninstalled modules" -msgstr "" +msgstr "Module neinstalate" #. module: base #: selection:ir.actions.report.xml,report_type:0 msgid "txt" -msgstr "" +msgstr "txt" #. module: base #: wizard_view:server.action.create,init:0 #: wizard_field:server.action.create,init,type:0 msgid "Select Action Type" -msgstr "" +msgstr "Selectare tip acţiune" #. module: base #: selection:ir.actions.todo,type:0 msgid "Configure" -msgstr "" +msgstr "Configurare" #. module: base #: model:res.country,name:base.tv msgid "Tuvalu" -msgstr "" +msgstr "Tuvalu" #. module: base #: selection:ir.model,state:0 #: selection:ir.model.grid,state:0 msgid "Custom Object" -msgstr "" +msgstr "Obiect personalizat" #. module: base #: field:res.lang,date_format:0 msgid "Date Format" -msgstr "" +msgstr "Formatul Datei" #. module: base #: field:res.bank,email:0 #: field:res.partner.address,email:0 msgid "E-Mail" -msgstr "" +msgstr "E-mail" #. module: base #: model:res.country,name:base.an msgid "Netherlands Antilles" -msgstr "" +msgstr "Antilele Olandeze" #. module: base #: code:addons/base/res/res_user.py:0 @@ -365,21 +365,23 @@ msgid "" "You can not remove the admin user as it is used internally for resources " "created by OpenERP (updates, module installation, ...)" msgstr "" +"Nu puteti sterge utilizatorul 'admin' deoarece este utilizat intern pentru " +"resursele create de OpenERP (actualizari, instalare de module,...)" #. module: base #: model:res.country,name:base.gf msgid "French Guyana" -msgstr "" +msgstr "Guyana Franceza" #. module: base #: field:ir.ui.view.custom,ref_id:0 msgid "Original View" -msgstr "" +msgstr "Vedere Originala" #. module: base #: selection:module.lang.install,init,lang:0 msgid "Bosnian / bosanski jezik" -msgstr "" +msgstr "Bosniaca / bosanski jezik" #. module: base #: help:ir.actions.report.xml,attachment_use:0 @@ -387,21 +389,23 @@ msgid "" "If you check this, then the second time the user prints with same attachment " "name, it returns the previous report." msgstr "" +"Dacă bifaţi, atunci când utilizatorul va tipări pentru a doua oară cu " +"acelaşi nume de ataşament, va primi , de fapt, raportul anterior." #. module: base #: help:res.lang,iso_code:0 msgid "This ISO code is the name of po files to use for translations" -msgstr "" +msgstr "Codul ISO este numele fisierelor po folosite in traduceri" #. module: base #: selection:ir.ui.menu,icon:0 msgid "STOCK_MEDIA_REWIND" -msgstr "" +msgstr "STOCK_MEDIA_REWIND" #. module: base #: field:ir.actions.todo,note:0 msgid "Text" -msgstr "" +msgstr "Text" #. module: base #: field:res.country,name:0 @@ -411,12 +415,12 @@ msgstr "Nume tara" #. module: base #: model:res.country,name:base.coreturn msgid "Colombia" -msgstr "" +msgstr "Columbia" #. module: base #: view:ir.module.module:0 msgid "Schedule Upgrade" -msgstr "" +msgstr "Planificare actualizare" #. module: base #: field:ir.actions.report.custom,report_id:0 @@ -429,133 +433,136 @@ msgid "" "The ISO country code in two chars.\n" "You can use this field for quick search." msgstr "" +"Codul ISO de tara din doua caractere.\n" +"Puteti utiliza acest camp pentru cautari rapide." #. module: base #: selection:workflow.activity,join_mode:0 #: selection:workflow.activity,split_mode:0 msgid "Xor" -msgstr "" +msgstr "Xor" #. module: base #: view:res.partner:0 msgid "Sales & Purchases" -msgstr "" +msgstr "Vânzări şi achiziţii" #. module: base #: view:ir.actions.wizard:0 #: field:wizard.ir.model.menu.create.line,wizard_id:0 msgid "Wizard" -msgstr "" +msgstr "Asistent" #. module: base #: selection:ir.ui.menu,icon:0 msgid "STOCK_CUT" -msgstr "" +msgstr "STOCK_CUT" #. module: base #: model:ir.actions.act_window,name:base.ir_action_wizard #: view:ir.actions.wizard:0 #: model:ir.ui.menu,name:base.menu_ir_action_wizard msgid "Wizards" -msgstr "" +msgstr "Asistenti" #. module: base #: selection:res.config.view,view:0 msgid "Extended Interface" -msgstr "" +msgstr "Interfata Extinsa" #. module: base #: code:addons/base/ir/ir_model.py:0 #, python-format msgid "Custom fields must have a name that starts with 'x_' !" -msgstr "" +msgstr "Câmpurile client trebuie să aibă la inceputul numelui 'x_' !" #. module: base #: help:ir.actions.server,action_id:0 msgid "Select the Action Window, Report, Wizard to be executed." msgstr "" +"Selectati fereastra de actiune, raportul sau asistentul care va fi executat." #. module: base #: view:wizard.module.lang.export:0 msgid "Export done" -msgstr "" +msgstr "Export finalizat" #. module: base #: view:ir.model:0 msgid "Model Description" -msgstr "" +msgstr "Descriere Model" #. module: base #: field:workflow.transition,trigger_expr_id:0 msgid "Trigger Expression" -msgstr "" +msgstr "Expresie Declansator" #. module: base #: model:res.country,name:base.jo msgid "Jordan" -msgstr "" +msgstr "Iordania" #. module: base #: code:addons/base/ir/ir_model.py:0 #, python-format msgid "You can not remove the model '%s' !" -msgstr "" +msgstr "Nu puteti inlatura modelul '%s' !" #. module: base #: model:res.country,name:base.er msgid "Eritrea" -msgstr "" +msgstr "Eritreea" #. module: base #: view:res.config.view:0 msgid "Configure simple view" -msgstr "" +msgstr "Configurare view simplu" #. module: base #: selection:module.lang.install,init,lang:0 msgid "Bulgarian / български" -msgstr "" +msgstr "Bulgara / български" #. module: base #: model:ir.model,name:base.model_ir_actions_actions msgid "ir.actions.actions" -msgstr "" +msgstr "ir.actions.actions" #. module: base #: model:ir.actions.act_window,name:base.action_report_custom #: view:ir.report.custom:0 msgid "Custom Report" -msgstr "" +msgstr "Raport Personalizat" #. module: base #: selection:ir.report.custom,type:0 msgid "Bar Chart" -msgstr "" +msgstr "Grafic bare" #. module: base #: selection:ir.ui.menu,icon:0 msgid "STOCK_DIALOG_ERROR" -msgstr "" +msgstr "STOCK_DIALOG_ERROR" #. module: base #: selection:ir.ui.menu,icon:0 msgid "STOCK_INDEX" -msgstr "" +msgstr "STOCK_INDEX" #. module: base #: model:res.country,name:base.rs msgid "Serbia" -msgstr "" +msgstr "Serbia" #. module: base #: selection:ir.translation,type:0 msgid "Wizard View" -msgstr "" +msgstr "View asistent" #. module: base #: model:res.country,name:base.kh msgid "Cambodia, Kingdom of" -msgstr "" +msgstr "Cambodia, Regatul" #. module: base #: model:ir.actions.act_window,name:base.ir_sequence_form @@ -563,43 +570,43 @@ msgstr "" #: model:ir.ui.menu,name:base.menu_ir_sequence_form #: model:ir.ui.menu,name:base.next_id_5 msgid "Sequences" -msgstr "" +msgstr "Secvenţe" #. module: base #: selection:ir.ui.menu,icon:0 msgid "STOCK_DIALOG_QUESTION" -msgstr "" +msgstr "STOCK_DIALOG_QUESTION" #. module: base #: model:res.country,name:base.pg msgid "Papua New Guinea" -msgstr "" +msgstr "Papua Noua Guinee" #. module: base #: model:res.partner.category,name:base.res_partner_category_4 msgid "Basic Partner" -msgstr "" +msgstr "Partener de bază" #. module: base #: rml:ir.module.reference:0 msgid "," -msgstr "" +msgstr "," #. module: base #: view:res.partner:0 msgid "My Partners" -msgstr "" +msgstr "Partenerii Mei" #. module: base #: model:res.country,name:base.es msgid "Spain" -msgstr "" +msgstr "Spania" #. module: base #: wizard_view:module.upgrade,end:0 #: wizard_view:module.upgrade,start:0 msgid "You may have to reinstall some language pack." -msgstr "" +msgstr "Ar putea fi nevoie sa reinstalati cateva pachete de traduceri" #. module: base #: field:res.partner.address,mobile:0 @@ -609,65 +616,67 @@ msgstr "GSM" #. module: base #: model:res.country,name:base.om msgid "Oman" -msgstr "" +msgstr "Oman" #. module: base #: model:ir.actions.act_window,name:base.action_payterm_form #: model:ir.model,name:base.model_res_payterm msgid "Payment term" -msgstr "" +msgstr "Termen de Plata" #. module: base #: model:res.country,name:base.nu msgid "Niue" -msgstr "" +msgstr "Niue" #. module: base #: selection:ir.cron,interval_type:0 msgid "Work Days" -msgstr "" +msgstr "Zile lucratoare" #. module: base #: help:ir.values,action_id:0 msgid "This field is not used, it only helps you to select the right action." msgstr "" +"Câmpul nu este utilizat, există doar pentru a vă ajuta să selectaţi acţiunea " +"potrivită." #. module: base #: model:ir.actions.act_window,name:base.act_menu_create #: view:wizard.ir.model.menu.create:0 msgid "Create Menu" -msgstr "" +msgstr "Creare Meniu" #. module: base #: model:res.country,name:base.in msgid "India" -msgstr "" +msgstr "India" #. module: base #: model:ir.model,name:base.model_maintenance_contract_module msgid "maintenance contract modules" -msgstr "" +msgstr "Module ale contractului de mentenanta" #. module: base #: view:ir.values:0 msgid "client_action_multi, client_action_relate" -msgstr "" +msgstr "client_action_multi, client_action_relate" #. module: base #: model:res.country,name:base.ad msgid "Andorra, Principality of" -msgstr "" +msgstr "Andorra, Principatul" #. module: base #: field:ir.module.category,child_ids:0 #: field:res.partner.category,child_ids:0 msgid "Child Categories" -msgstr "" +msgstr "Categorii subordonate" #. module: base #: selection:wizard.module.lang.export,format:0 msgid "TGZ Archive" -msgstr "" +msgstr "Arhivă TGZ" #. module: base #: field:res.partner.som,factor:0 @@ -677,7 +686,7 @@ msgstr "Factor(Postas)" #. module: base #: view:res.lang:0 msgid "%B - Full month name." -msgstr "" +msgstr "%B - Denumirea completa a lunii." #. module: base #: field:ir.actions.report.xml,report_type:0 @@ -687,59 +696,59 @@ msgstr "" #: field:ir.values,key:0 #: view:res.partner:0 msgid "Type" -msgstr "" +msgstr "Tip" #. module: base #: selection:ir.ui.menu,icon:0 msgid "STOCK_FILE" -msgstr "" +msgstr "STOCK_FILE" #. module: base #: model:res.country,name:base.gu msgid "Guam (USA)" -msgstr "" +msgstr "Guam (SUA)" #. module: base #: model:ir.model,name:base.model_ir_model_grid msgid "Objects Security Grid" -msgstr "" +msgstr "Grila de Securitate a Obiectelor" #. module: base #: selection:ir.ui.menu,icon:0 msgid "STOCK_GO_DOWN" -msgstr "" +msgstr "STOCK_GO_DOWN" #. module: base #: selection:ir.ui.menu,icon:0 msgid "STOCK_OK" -msgstr "" +msgstr "STOCK_OK" #. module: base #: selection:ir.actions.server,state:0 #: selection:workflow.activity,kind:0 msgid "Dummy" -msgstr "" +msgstr "Dummy" #. module: base #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" -msgstr "" +msgstr "Fișierul XML pentru arhitectura planului vizual nu este valid!" #. module: base #: model:res.country,name:base.ky msgid "Cayman Islands" -msgstr "" +msgstr "Insulele Cayman" #. module: base #: model:res.country,name:base.ir msgid "Iran" -msgstr "" +msgstr "Iran" #. module: base #: model:ir.actions.act_window,name:base.res_request-act #: model:ir.ui.menu,name:base.menu_res_request_act msgid "My Requests" -msgstr "" +msgstr "Cererile mele" #. module: base #: field:ir.sequence,name:0 @@ -750,17 +759,17 @@ msgstr "Nume numerotare" #. module: base #: model:res.country,name:base.td msgid "Chad" -msgstr "" +msgstr "Ciad" #. module: base #: selection:module.lang.install,init,lang:0 msgid "Spanish (AR) / Español (AR)" -msgstr "" +msgstr "Spaniola (AR) / Español (AR)" #. module: base #: model:res.country,name:base.ug msgid "Uganda" -msgstr "" +msgstr "Uganda" #. module: base #: model:res.country,name:base.ne diff --git a/bin/addons/base/i18n/sv.po b/bin/addons/base/i18n/sv.po index 3f0e1872dab..d2b3d972b83 100644 --- a/bin/addons/base/i18n/sv.po +++ b/bin/addons/base/i18n/sv.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-03-11 05:02+0000\n" +"PO-Revision-Date: 2010-03-16 05:11+0000\n" "Last-Translator: Anders Wallenquist \n" "Language-Team: <>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-03-12 04:51+0000\n" +"X-Launchpad-Export-Date: 2010-03-17 04:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/uk.po b/bin/addons/base/i18n/uk.po index 2e9caa02d93..10a8a3edf9f 100644 --- a/bin/addons/base/i18n/uk.po +++ b/bin/addons/base/i18n/uk.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-03-11 05:11+0000\n" +"PO-Revision-Date: 2010-03-16 05:11+0000\n" "Last-Translator: Fabien (Open ERP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-03-12 04:51+0000\n" +"X-Launchpad-Export-Date: 2010-03-17 04:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/zh_CN.po b/bin/addons/base/i18n/zh_CN.po index b3f0c8573fd..8e6c890c2d9 100644 --- a/bin/addons/base/i18n/zh_CN.po +++ b/bin/addons/base/i18n/zh_CN.po @@ -7,19 +7,19 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-01-24 05:45+0000\n" -"Last-Translator: Wei \"oldrev\" Li \n" +"PO-Revision-Date: 2010-03-16 05:12+0000\n" +"Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-01-25 04:48+0000\n" +"X-Launchpad-Export-Date: 2010-03-17 04:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base #: model:res.country,name:base.sh msgid "Saint Helena" -msgstr "圣赫勒拿岛" +msgstr "圣赫勒拿" #. module: base #: wizard_view:res.partner.sms_send,init:0 @@ -34,13 +34,13 @@ msgstr "%j - 十进制表示的该年中的天数 [001,366]." #. module: base #: field:ir.values,meta_unpickle:0 msgid "Metadata" -msgstr "元数据" +msgstr "Metadata" #. module: base #: field:ir.ui.view,arch:0 #: field:ir.ui.view.custom,arch:0 msgid "View Architecture" -msgstr "视图结构" +msgstr "视图数据" #. module: base #: code:addons/base/ir/ir_model.py:0 @@ -68,7 +68,7 @@ msgstr "要浏览官方翻译,请访问此链接: " #. module: base #: selection:module.lang.install,init,lang:0 msgid "Hungarian / Magyar" -msgstr "匈牙利语 / 马札儿语" +msgstr "匈牙利/匈牙利语" #. module: base #: field:ir.actions.server,wkf_model_id:0 @@ -83,7 +83,7 @@ msgstr "已创建的视图" #. module: base #: view:workflow.activity:0 msgid "Outgoing transitions" -msgstr "传出转换" +msgstr "传出节点" #. module: base #: selection:ir.report.custom,frequency:0 @@ -113,7 +113,7 @@ msgstr "" #. module: base #: field:ir.rule,operand:0 msgid "Operand" -msgstr "操作数" +msgstr "操作符" #. module: base #: model:res.country,name:base.kr @@ -130,7 +130,7 @@ msgstr "转换" #. module: base #: model:ir.model,name:base.model_ir_ui_view_custom msgid "ir.ui.view.custom" -msgstr "ir.ui.view.custom" +msgstr "自定义视图" #. module: base #: model:res.country,name:base.sz @@ -141,7 +141,7 @@ msgstr "斯威士兰" #: model:ir.model,name:base.model_ir_actions_report_custom #: selection:ir.ui.menu,action:0 msgid "ir.actions.report.custom" -msgstr "ir.actions.report.custom" +msgstr "自定义报表" #. module: base #: selection:ir.ui.menu,icon:0 @@ -167,7 +167,7 @@ msgstr "公司结构" #. module: base #: model:ir.model,name:base.model_ir_report_custom_fields msgid "ir.report.custom.fields" -msgstr "ir.report.custom.fields" +msgstr "自定义报表字段" #. module: base #: view:res.partner:0 @@ -199,12 +199,12 @@ msgstr "模块数" #. module: base #: field:res.partner.bank.type.field,size:0 msgid "Max. Size" -msgstr "最大尺寸" +msgstr "" #. module: base #: field:res.partner.address,name:0 msgid "Contact Name" -msgstr "联系人名称" +msgstr "联系人姓名" #. module: base #: code:addons/base/module/wizard/wizard_export_lang.py:0 @@ -229,7 +229,7 @@ msgstr "密码不符合!" #: code:addons/base/module/module.py:0 #, python-format msgid "This url '%s' must provide an html file with links to zip modules" -msgstr "这个 URL '%s' 必须提供一个链接到 zip 模块文件的 HTML 页面" +msgstr "" #. module: base #: selection:res.request,state:0 diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index a474866f885..e11b4964471 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -64,15 +64,13 @@ class module(osv.osv): _description = "Module" def get_module_info(self, name): + info = {} try: - f = tools.file_open(os.path.join(name, '__terp__.py')) - data = f.read() - info = eval(data) + info = addons.load_information_from_description_file(name) if 'version' in info: info['version'] = release.major_version + '.' + info['version'] - f.close() except: - return {} + pass return info def _get_latest_version(self, cr, uid, ids, field_name=None, arg=None, context={}): diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/base_quality_interrogation.py similarity index 100% rename from bin/addons/quality_integration_server/base_quality_interrogation.py rename to bin/addons/base_quality_interrogation.py diff --git a/bin/addons/module_graph.py b/bin/addons/module_graph.py index 74d4115a086..edd7f6f947e 100755 --- a/bin/addons/module_graph.py +++ b/bin/addons/module_graph.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -16,7 +16,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -32,7 +32,8 @@ if len(sys.argv) == 2 and (sys.argv[1] in ['-h', '--help']): modules = sys.argv[1:] if not len(modules): - modules = map(os.path.dirname, glob.glob(os.path.join('*', '__terp__.py'))) + modules = map(os.path.dirname, glob.glob(os.path.join('*', '__openerp__.py'))) + modules += map(os.path.dirname, glob.glob(os.path.join('*', '__terp__.py'))) done = [] @@ -40,15 +41,14 @@ print 'digraph G {' while len(modules): f = modules.pop(0) done.append(f) - if os.path.isfile(os.path.join(f,"__terp__.py")): - info=eval(file(os.path.join(f,"__terp__.py")).read()) - if info.get('installable', True): - for name in info['depends']: - if name not in done+modules: - modules.append(name) - if not os.path.exists(name): - print '\t%s [color=red]' % (name,) - print '\t%s -> %s;' % (f, name) + info = addons.load_information_from_description_file(f) + if info.get('installable', True): + for name in info['depends']: + if name not in done+modules: + modules.append(name) + if not os.path.exists(name): + print '\t%s [color=red]' % (name,) + print '\t%s -> %s;' % (f, name) print '}' # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 15effe8b84d..47e2f3bfb05 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -3009,7 +3009,7 @@ class orm(orm_template): if self._inherits[v] not in vals: tocreate[v] = {} else: - tocreate[v] = {self._inherits[v]:vals[self._inherits[v]]} + tocreate[v] = {'id' : vals[self._inherits[v]]} (upd0, upd1, upd2) = ('', '', []) upd_todo = [] for v in vals.keys(): @@ -3033,10 +3033,17 @@ class orm(orm_template): for table in tocreate: if self._inherits[table] in vals: del vals[self._inherits[table]] - id = self.pool.get(table).create(cr, user, tocreate[table]) + + record_id = tocreate[table].pop('id', None) + + if record_id is None: + record_id = self.pool.get(table).create(cr, user, tocreate[table], context=context) + else: + self.pool.get(table).write(cr, user, [record_id], tocreate[table], context=context) + upd0 += ','+self._inherits[table] upd1 += ',%s' - upd2.append(id) + upd2.append(record_id) #Start : Set bool fields to be False if they are not touched(to make search more powerful) bool_fields = [x for x in self._columns.keys() if self._columns[x]._type=='boolean'] diff --git a/bin/tools/config.py b/bin/tools/config.py index bc4aa98b77e..670c20af1af 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . +# along with this program. If not, see . # ############################################################################## @@ -83,7 +83,7 @@ class configmanager(object): 'list_db' : True, 'timezone' : False, # to override the default TZ } - + self.misc = {} hasSSL = check_ssl() @@ -103,8 +103,8 @@ class configmanager(object): parser.add_option("-p", "--port", dest="port", help="specify the TCP port", type="int") parser.add_option("--net_interface", dest="netinterface", help="specify the TCP IP address for netrpc") parser.add_option("--net_port", dest="netport", help="specify the TCP port for netrpc", type="int") - parser.add_option("--no-netrpc", dest="netrpc", action="store_false", default=True, help="disable netrpc") - parser.add_option("--no-xmlrpc", dest="xmlrpc", action="store_false", default=True, help="disable xmlrpc") + parser.add_option("--no-netrpc", dest="netrpc", action="store_false", help="disable netrpc") + parser.add_option("--no-xmlrpc", dest="xmlrpc", action="store_false", help="disable xmlrpc") parser.add_option("-i", "--init", dest="init", help="init a module (use \"all\" for all modules)") parser.add_option("--without-demo", dest="without_demo", help="load demo data for a module (use \"all\" for all modules)", default=False) @@ -234,7 +234,7 @@ class configmanager(object): keys = ['interface', 'port', 'db_name', 'db_user', 'db_password', 'db_host', 'db_port', 'list_db', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout', 'email_from', 'smtp_server', 'smtp_user', 'smtp_password', 'price_accuracy', - 'netinterface', 'netport', 'db_maxconn', 'import_partial', 'addons_path', + 'netinterface', 'netport', 'db_maxconn', 'import_partial', 'addons_path', 'netrpc', 'xmlrpc', 'syslog', 'without_demo', 'timezone',] if hasSSL: @@ -278,7 +278,7 @@ class configmanager(object): self.options['translate_modules'].sort() if self.options['timezone']: - # If an explicit TZ was provided in the config, make sure it is known + # If an explicit TZ was provided in the config, make sure it is known try: import pytz tz = pytz.timezone(self.options['timezone']) @@ -352,17 +352,21 @@ class configmanager(object): res = os.path.abspath(os.path.expanduser(value)) if not os.path.exists(res): raise optparse.OptionValueError("option %s: no such directory: %r" % (opt, value)) + contains_addons = False for f in os.listdir(res): modpath = os.path.join(res, f) - if os.path.isdir(modpath) and os.path.exists(os.path.join(modpath, '__init__.py')) and \ - os.path.exists(os.path.join(modpath, '__terp__.py')): + if os.path.isdir(modpath) and \ + os.path.exists(os.path.join(modpath, '__init__.py')) and \ + (os.path.exists(os.path.join(modpath, '__openerp__.py')) or \ + os.path.exists(os.path.join(modpath, '__terp__.py'))): + contains_addons = True break if not contains_addons: raise optparse.OptionValueError("option %s: The addons-path %r does not seem to a be a valid Addons Directory!" % (opt, value)) - + setattr(parser.values, option.dest, res) def load(self): @@ -403,7 +407,7 @@ class configmanager(object): p.set('options', opt, loglevelnames.get(self.options[opt], self.options[opt])) else: p.set('options', opt, self.options[opt]) - + for sec in self.misc.keys(): for opt in self.misc[sec].keys(): p.set(sec,opt,self.misc[sec][opt]) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index f105cd81256..284324873de 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -50,63 +50,63 @@ def init_db(cr): cr.commit() for i in addons.get_modules(): - terp_file = addons.get_module_resource(i, '__terp__.py') mod_path = addons.get_module_path(i) if not mod_path: continue - info = False - if os.path.isfile(terp_file) or os.path.isfile(mod_path+'.zip'): - info = eval(file_open(terp_file).read()) - if info: - categs = info.get('category', 'Uncategorized').split('/') - p_id = None - while categs: - if p_id is not None: - cr.execute('select id \ - from ir_module_category \ - where name=%s and parent_id=%s', (categs[0], p_id)) - else: - cr.execute('select id \ - from ir_module_category \ - where name=%s and parent_id is NULL', (categs[0],)) - c_id = cr.fetchone() - if not c_id: - cr.execute('select nextval(\'ir_module_category_id_seq\')') - c_id = cr.fetchone()[0] - cr.execute('insert into ir_module_category \ - (id, name, parent_id) \ - values (%s, %s, %s)', (c_id, categs[0], p_id)) - else: - c_id = c_id[0] - p_id = c_id - categs = categs[1:] - active = info.get('active', False) - installable = info.get('installable', True) - if installable: - if active: - state = 'to install' - else: - state = 'uninstalled' + info = addons.load_information_from_description_file(i) + + if not info: + continue + categs = info.get('category', 'Uncategorized').split('/') + p_id = None + while categs: + if p_id is not None: + cr.execute('select id \ + from ir_module_category \ + where name=%s and parent_id=%s', (categs[0], p_id)) else: - state = 'uninstallable' - cr.execute('select nextval(\'ir_module_module_id_seq\')') - id = cr.fetchone()[0] - cr.execute('insert into ir_module_module \ - (id, author, website, name, shortdesc, description, \ - category_id, state, certificate) \ - values (%s, %s, %s, %s, %s, %s, %s, %s, %s)', ( - id, info.get('author', ''), - info.get('website', ''), i, info.get('name', False), - info.get('description', ''), p_id, state, info.get('certificate'))) - cr.execute('insert into ir_model_data \ - (name,model,module, res_id, noupdate) values (%s,%s,%s,%s,%s)', ( - 'module_meta_information', 'ir.module.module', i, id, True)) - dependencies = info.get('depends', []) - for d in dependencies: - cr.execute('insert into ir_module_module_dependency \ - (module_id,name) values (%s, %s)', (id, d)) - cr.commit() + cr.execute('select id \ + from ir_module_category \ + where name=%s and parent_id is NULL', (categs[0],)) + c_id = cr.fetchone() + if not c_id: + cr.execute('select nextval(\'ir_module_category_id_seq\')') + c_id = cr.fetchone()[0] + cr.execute('insert into ir_module_category \ + (id, name, parent_id) \ + values (%s, %s, %s)', (c_id, categs[0], p_id)) + else: + c_id = c_id[0] + p_id = c_id + categs = categs[1:] + + active = info.get('active', False) + installable = info.get('installable', True) + if installable: + if active: + state = 'to install' + else: + state = 'uninstalled' + else: + state = 'uninstallable' + cr.execute('select nextval(\'ir_module_module_id_seq\')') + id = cr.fetchone()[0] + cr.execute('insert into ir_module_module \ + (id, author, website, name, shortdesc, description, \ + category_id, state, certificate) \ + values (%s, %s, %s, %s, %s, %s, %s, %s, %s)', ( + id, info.get('author', ''), + info.get('website', ''), i, info.get('name', False), + info.get('description', ''), p_id, state, info.get('certificate'))) + cr.execute('insert into ir_model_data \ + (name,model,module, res_id, noupdate) values (%s,%s,%s,%s,%s)', ( + 'module_meta_information', 'ir.module.module', i, id, True)) + dependencies = info.get('depends', []) + for d in dependencies: + cr.execute('insert into ir_module_module_dependency \ + (module_id,name) values (%s, %s)', (id, d)) + cr.commit() def find_in_path(name): if os.name == "nt": diff --git a/debian/po/nb.po b/debian/po/nb.po index 05f376bee05..decd2ada0fd 100644 --- a/debian/po/nb.po +++ b/debian/po/nb.po @@ -8,20 +8,20 @@ msgstr "" "Project-Id-Version: openobject-server\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-08-24 22:41+0300\n" -"PO-Revision-Date: 2010-03-10 14:03+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2010-03-16 05:12+0000\n" +"Last-Translator: OpenERP Administrators \n" "Language-Team: Norwegian Bokmal \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-03-12 04:51+0000\n" +"X-Launchpad-Export-Date: 2010-03-17 04:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. Type: string #. Description #: ../openerp-server.templates:1001 msgid "Dedicated system account for the Open ERP server:" -msgstr "" +msgstr "Dedikert systemkonto for Open ERP:" #. Type: string #. Description @@ -31,6 +31,8 @@ msgid "" "the system's security is not compromised by running it with superuser " "privileges." msgstr "" +"Open ERP må av hensyn til sikkerhet kjøre som en egen bruker i stedet for " +"systemets superbruker." #. Type: string #. Description diff --git a/setup.py b/setup.py index 9d7a735d2f6..2e004e713df 100755 --- a/setup.py +++ b/setup.py @@ -77,7 +77,7 @@ def check_modules(): def find_addons(): for root, _, names in os.walk(join('bin', 'addons')): - if '__terp__.py' in names: + if '__openerp__.py' in names or '__terp__.py' in names: yield basename(root), root #look for extra modules try: @@ -86,7 +86,12 @@ def find_addons(): mname = mname.strip() if not mname: continue - if os.path.exists(join(empath, mname, '__terp__.py')): + + terp = join(empath, mname, '__openerp__.py') + if not os.path.exists(terp): + terp = join(empath, mname, '__terp__.py') + + if os.path.exists(terp): yield mname, join(empath, mname) else: print "Module %s specified, but no valid path." % mname