[MERGE] merged trunk.

bzr revid: vmt@openerp.com-20120112155027-u3bagec0g9fqr0yi
bzr revid: vmt@openerp.com-20120116110434-ckhp01ze83cwm32y
This commit is contained in:
Vo Minh Thu 2012-01-16 12:04:34 +01:00
commit 0ed4377cf8
16 changed files with 551 additions and 404 deletions

1
debian/control vendored
View File

@ -35,6 +35,7 @@ Depends:
python-vobject, python-vobject,
python-webdav, python-webdav,
python-werkzeug, python-werkzeug,
python-xlwt,
python-yaml, python-yaml,
python-zsi python-zsi
Conflicts: tinyerp-server, openerp-server, openerp-web Conflicts: tinyerp-server, openerp-server, openerp-web

View File

@ -143,7 +143,6 @@ def import_translation():
cr = openerp.pooler.get_db(dbname).cursor() cr = openerp.pooler.get_db(dbname).cursor()
openerp.tools.trans_load( cr, config["translate_in"], config["language"], openerp.tools.trans_load( cr, config["translate_in"], config["language"],
context=context) context=context)
openerp.tools.trans_update_res_ids(cr)
cr.commit() cr.commit()
cr.close() cr.close()

View File

@ -231,8 +231,8 @@
<notebook colspan="4"> <notebook colspan="4">
<page string="General Information"> <page string="General Information">
<separator string="Address Information" colspan="4"/> <separator string="Address Information" colspan="4"/>
<field name="street"/> <field name="street" colspan="4"/>
<field name="street2"/> <field name="street2" invisible="1"/>
<field name="zip"/> <field name="zip"/>
<field name="city"/> <field name="city"/>
<field name="country_id"/> <field name="country_id"/>

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-server\n" "Project-Id-Version: openobject-server\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-12-22 20:22+0000\n" "POT-Creation-Date: 2011-12-22 20:22+0000\n"
"PO-Revision-Date: 2010-09-09 06:58+0000\n" "PO-Revision-Date: 2012-01-12 23:33+0000\n"
"Last-Translator: Harry (OpenERP) <hmo@tinyerp.com>\n" "Last-Translator: Akira Hiyama <Unknown>\n"
"Language-Team: Japanese <ja@li.org>\n" "Language-Team: Japanese <ja@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-01-05 05:30+0000\n" "X-Launchpad-Export-Date: 2012-01-14 05:10+0000\n"
"X-Generator: Launchpad (build 14625)\n" "X-Generator: Launchpad (build 14664)\n"
#. module: base #. module: base
#: model:res.country,name:base.sh #: model:res.country,name:base.sh
@ -25,12 +25,12 @@ msgstr "セント・ヘレナ"
#. module: base #. module: base
#: view:ir.actions.report.xml:0 #: view:ir.actions.report.xml:0
msgid "Other Configuration" msgid "Other Configuration"
msgstr "" msgstr "その他構成"
#. module: base #. module: base
#: selection:ir.property,type:0 #: selection:ir.property,type:0
msgid "DateTime" msgid "DateTime"
msgstr "" msgstr "日時"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_project_mailgate #: model:ir.module.module,shortdesc:base.module_project_mailgate
@ -49,7 +49,7 @@ msgstr ""
#: field:ir.ui.view,arch:0 #: field:ir.ui.view,arch:0
#: field:ir.ui.view.custom,arch:0 #: field:ir.ui.view.custom,arch:0
msgid "View Architecture" msgid "View Architecture"
msgstr "" msgstr "ビューアーキテクチャ"
#. module: base #. module: base
#: model:ir.module.module,description:base.module_project #: model:ir.module.module,description:base.module_project
@ -153,7 +153,7 @@ msgstr ""
#. module: base #. module: base
#: field:res.partner,ref:0 #: field:res.partner,ref:0
msgid "Reference" msgid "Reference"
msgstr "" msgstr "参照"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_l10n_be_invoice_bba #: model:ir.module.module,shortdesc:base.module_l10n_be_invoice_bba
@ -179,7 +179,7 @@ msgstr ""
#: code:addons/base/res/res_users.py:541 #: code:addons/base/res/res_users.py:541
#, python-format #, python-format
msgid "Warning!" msgid "Warning!"
msgstr "" msgstr "警告!"
#. module: base #. module: base
#: code:addons/base/ir/ir_model.py:331 #: code:addons/base/ir/ir_model.py:331
@ -193,7 +193,7 @@ msgstr ""
#: code:addons/osv.py:129 #: code:addons/osv.py:129
#, python-format #, python-format
msgid "Constraint Error" msgid "Constraint Error"
msgstr "" msgstr "制約エラー"
#. module: base #. module: base
#: model:ir.model,name:base.model_ir_ui_view_custom #: model:ir.model,name:base.model_ir_ui_view_custom
@ -227,13 +227,13 @@ msgstr ""
#. module: base #. module: base
#: field:ir.sequence,number_increment:0 #: field:ir.sequence,number_increment:0
msgid "Increment Number" msgid "Increment Number"
msgstr "" msgstr "増分値"
#. module: base #. module: base
#: model:ir.actions.act_window,name:base.action_res_company_tree #: model:ir.actions.act_window,name:base.action_res_company_tree
#: model:ir.ui.menu,name:base.menu_action_res_company_tree #: model:ir.ui.menu,name:base.menu_action_res_company_tree
msgid "Company's Structure" msgid "Company's Structure"
msgstr "" msgstr "会社組織"
#. module: base #. module: base
#: selection:base.language.install,lang:0 #: selection:base.language.install,lang:0
@ -245,7 +245,7 @@ msgstr ""
#: model:ir.module.category,name:base.module_category_sales_management #: model:ir.module.category,name:base.module_category_sales_management
#: model:ir.module.module,shortdesc:base.module_sale #: model:ir.module.module,shortdesc:base.module_sale
msgid "Sales Management" msgid "Sales Management"
msgstr "" msgstr "セールス管理"
#. module: base #. module: base
#: view:res.partner:0 #: view:res.partner:0
@ -266,7 +266,7 @@ msgstr ""
#. module: base #. module: base
#: field:ir.module.category,module_nr:0 #: field:ir.module.category,module_nr:0
msgid "Number of Modules" msgid "Number of Modules"
msgstr "" msgstr "モジュール数"
#. module: base #. module: base
#: help:multi_company.default,company_dest_id:0 #: help:multi_company.default,company_dest_id:0
@ -276,7 +276,7 @@ msgstr ""
#. module: base #. module: base
#: field:res.partner.bank.type.field,size:0 #: field:res.partner.bank.type.field,size:0
msgid "Max. Size" msgid "Max. Size"
msgstr "" msgstr "最大サイズ"
#. module: base #. module: base
#: model:ir.module.category,name:base.module_category_reporting #: model:ir.module.category,name:base.module_category_reporting
@ -289,7 +289,7 @@ msgstr ""
#: model:ir.ui.menu,name:base.next_id_73 #: model:ir.ui.menu,name:base.next_id_73
#: model:ir.ui.menu,name:base.reporting_menu #: model:ir.ui.menu,name:base.reporting_menu
msgid "Reporting" msgid "Reporting"
msgstr "" msgstr "レポート"
#. module: base #. module: base
#: view:res.partner:0 #: view:res.partner:0

File diff suppressed because it is too large Load Diff

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n" "Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n" "Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-12-22 20:22+0000\n" "POT-Creation-Date: 2011-12-22 20:22+0000\n"
"PO-Revision-Date: 2012-01-07 05:02+0000\n" "PO-Revision-Date: 2012-01-13 16:46+0000\n"
"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n" "Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-01-08 05:03+0000\n" "X-Launchpad-Export-Date: 2012-01-14 05:10+0000\n"
"X-Generator: Launchpad (build 14640)\n" "X-Generator: Launchpad (build 14664)\n"
#. module: base #. module: base
#: model:res.country,name:base.sh #: model:res.country,name:base.sh
@ -34,7 +34,7 @@ msgstr "日期时间"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_project_mailgate #: model:ir.module.module,shortdesc:base.module_project_mailgate
msgid "Tasks-Mail Integration" msgid "Tasks-Mail Integration"
msgstr "" msgstr "任务邮件集成"
#. module: base #. module: base
#: code:addons/fields.py:571 #: code:addons/fields.py:571
@ -186,7 +186,7 @@ msgstr "警告!"
msgid "" msgid ""
"Properties of base fields cannot be altered in this manner! Please modify " "Properties of base fields cannot be altered in this manner! Please modify "
"them through Python code, preferably through a custom addon!" "them through Python code, preferably through a custom addon!"
msgstr "基本字段的属性不能这样修改,请通过 Python 代码来修改它,最好是制作一个自定义模块。" msgstr "基本字段的属性不能这样修改,请通过 Python 代码来修改它们,更好的办法是通过自定义模块来修改。"
#. module: base #. module: base
#: code:addons/osv.py:129 #: code:addons/osv.py:129
@ -213,7 +213,7 @@ msgstr "已创建"
#. module: base #. module: base
#: model:ir.module.module,shortdesc:base.module_mrp_subproduct #: model:ir.module.module,shortdesc:base.module_mrp_subproduct
msgid "MRP Subproducts" msgid "MRP Subproducts"
msgstr "" msgstr "MRP 子产品"
#. module: base #. module: base
#: code:addons/base/module/module.py:379 #: code:addons/base/module/module.py:379
@ -394,7 +394,7 @@ msgstr "源对象"
#. module: base #. module: base
#: model:res.partner.bank.type,format_layout:base.bank_normal #: model:res.partner.bank.type,format_layout:base.bank_normal
msgid "%(bank_name)s: %(acc_number)s" msgid "%(bank_name)s: %(acc_number)s"
msgstr "" msgstr "%(bank_name)s%(acc_number)s"
#. module: base #. module: base
#: view:ir.actions.todo:0 #: view:ir.actions.todo:0
@ -834,7 +834,7 @@ msgstr ""
#. module: base #. module: base
#: view:res.users:0 #: view:res.users:0
msgid "Email Preferences" msgid "Email Preferences"
msgstr "Email 首选项" msgstr "电子邮件选项"
#. module: base #. module: base
#: model:ir.module.module,description:base.module_audittrail #: model:ir.module.module,description:base.module_audittrail
@ -984,7 +984,7 @@ msgstr "TGZ 压缩包"
#: view:res.groups:0 #: view:res.groups:0
msgid "" msgid ""
"Users added to this group are automatically added in the following groups." "Users added to this group are automatically added in the following groups."
msgstr "" msgstr "若有用户添加至本组时自动将用户添加到下面的组。"
#. module: base #. module: base
#: view:res.lang:0 #: view:res.lang:0
@ -3637,7 +3637,7 @@ msgstr "增值税"
#. module: base #. module: base
#: field:res.users,new_password:0 #: field:res.users,new_password:0
msgid "Set password" msgid "Set password"
msgstr "" msgstr "设置密码"
#. module: base #. module: base
#: view:res.lang:0 #: view:res.lang:0
@ -4114,7 +4114,7 @@ msgstr "必填"
#. module: base #. module: base
#: view:res.users:0 #: view:res.users:0
msgid "Default Filters" msgid "Default Filters"
msgstr "默认过滤" msgstr "默认过滤"
#. module: base #. module: base
#: field:res.request.history,name:0 #: field:res.request.history,name:0
@ -6270,7 +6270,7 @@ msgstr ""
#: view:res.users:0 #: view:res.users:0
#, python-format #, python-format
msgid "Applications" msgid "Applications"
msgstr "" msgstr "应用"
#. module: base #. module: base
#: model:ir.model,name:base.model_ir_attachment #: model:ir.model,name:base.model_ir_attachment
@ -6632,7 +6632,7 @@ msgstr ""
#: view:ir.module.module:0 #: view:ir.module.module:0
#, python-format #, python-format
msgid "Upgrade" msgid "Upgrade"
msgstr "" msgstr "升级"
#. module: base #. module: base
#: field:res.partner,address:0 #: field:res.partner,address:0
@ -7212,6 +7212,8 @@ msgid ""
"interface, which has less features but is easier to use. You can switch to " "interface, which has less features but is easier to use. You can switch to "
"the other interface from the User/Preferences menu at any time." "the other interface from the User/Preferences menu at any time."
msgstr "" msgstr ""
"OpenERP 提供了简化与扩展的用户界面。如果您是第一次使用 OpenERP "
"我们强烈建议您选择简化界面,简化界面功能较少但更易用。您以后也可以在“用户”/“首选项”菜单中切换界面形式。"
#. module: base #. module: base
#: model:res.country,name:base.cc #: model:res.country,name:base.cc

View File

@ -63,7 +63,6 @@ class base_language_import(osv.osv_memory):
fileobj.seek(0) fileobj.seek(0)
tools.trans_load_data(cr, fileobj, fileformat, import_data.code, lang_name=import_data.name, context=context) tools.trans_load_data(cr, fileobj, fileformat, import_data.code, lang_name=import_data.name, context=context)
tools.trans_update_res_ids(cr)
fileobj.close() fileobj.close()
return {} return {}

View File

@ -55,6 +55,7 @@ After importing a new module you can install it by clicking on the button "Insta
<field name="target">new</field> <field name="target">new</field>
</record> </record>
<!-- This feature is now deprecated, but may come back later.
<menuitem <menuitem
name="Import Module" name="Import Module"
action="action_view_base_module_import" action="action_view_base_module_import"
@ -62,6 +63,7 @@ After importing a new module you can install it by clicking on the button "Insta
parent="menu_management" parent="menu_management"
groups="base.group_extended" groups="base.group_extended"
sequence="1"/> sequence="1"/>
-->
</data> </data>
</openerp> </openerp>

View File

@ -47,7 +47,6 @@ class base_update_translations(osv.osv_memory):
buf=cStringIO.StringIO() buf=cStringIO.StringIO()
tools.trans_export(this.lang, ['all'], buf, 'csv', cr) tools.trans_export(this.lang, ['all'], buf, 'csv', cr)
tools.trans_load_data(cr, buf, 'csv', this.lang, lang_name=lang_name) tools.trans_load_data(cr, buf, 'csv', this.lang, lang_name=lang_name)
tools.trans_update_res_ids(cr)
buf.close() buf.close()
return {'type': 'ir.actions.act_window_close'} return {'type': 'ir.actions.act_window_close'}

View File

@ -87,6 +87,7 @@ class res_partner_category(osv.osv):
'active' : fields.boolean('Active', help="The active field allows you to hide the category without removing it."), 'active' : fields.boolean('Active', help="The active field allows you to hide the category without removing it."),
'parent_left' : fields.integer('Left parent', select=True), 'parent_left' : fields.integer('Left parent', select=True),
'parent_right' : fields.integer('Right parent', select=True), 'parent_right' : fields.integer('Right parent', select=True),
'partner_ids': fields.many2many('res.partner', 'res_partner_category_rel', 'category_id', 'partner_id', 'Partners'),
} }
_constraints = [ _constraints = [
(osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id']) (osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id'])
@ -393,13 +394,6 @@ class res_partner_address(osv.osv):
res_partner_address() res_partner_address()
class res_partner_category(osv.osv):
_inherit = 'res.partner.category'
_columns = {
'partner_ids': fields.many2many('res.partner', 'res_partner_category_rel', 'category_id', 'partner_id', 'Partners'),
}
res_partner_category()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -471,12 +471,17 @@ class users(osv.osv):
return False return False
cr = pooler.get_db(db).cursor() cr = pooler.get_db(db).cursor()
try: try:
# We autocommit: our single request will be performed atomically.
# (In this way, there is no opportunity to have two transactions
# interleaving ther cr.execute()..cr.commit() calls and have one
# of them rollbacked due to a concurrent access.)
# We effectively unconditionally write the res_users line.
cr.autocommit(True)
cr.execute("""UPDATE res_users cr.execute("""UPDATE res_users
SET date = now() AT TIME ZONE 'UTC' SET date = now() AT TIME ZONE 'UTC'
WHERE login=%s AND password=%s AND active RETURNING id""", WHERE login=%s AND password=%s AND active RETURNING id""",
(tools.ustr(login), tools.ustr(password))) (tools.ustr(login), tools.ustr(password)))
res = cr.fetchone() res = cr.fetchone()
cr.commit()
if res: if res:
return res[0] return res[0]
else: else:

View File

@ -510,11 +510,15 @@ class one2many(_column):
elif act[0] == 5: elif act[0] == 5:
reverse_rel = obj._all_columns.get(self._fields_id) reverse_rel = obj._all_columns.get(self._fields_id)
assert reverse_rel, 'Trying to unlink the content of a o2m but the pointed model does not have a m2o' assert reverse_rel, 'Trying to unlink the content of a o2m but the pointed model does not have a m2o'
# if the model has on delete cascade, just delete the rows # if the o2m has a static domain we must respect it when unlinking
extra_domain = self._domain if isinstance(getattr(self, '_domain', None), list) else []
ids_to_unlink = obj.search(cr, user, [(self._fields_id,'=',id)] + extra_domain, context=context)
# If the model has cascade deletion, we delete the rows because it is the intended behavior,
# otherwise we only nullify the reverse foreign key column.
if reverse_rel.column.ondelete == "cascade": if reverse_rel.column.ondelete == "cascade":
obj.unlink(cr, user, obj.search(cr, user, [(self._fields_id,'=',id)], context=context), context=context) obj.unlink(cr, user, ids_to_unlink, context=context)
else: else:
cr.execute('update '+_table+' set '+self._fields_id+'=null where '+self._fields_id+'=%s', (id,)) obj.write(cr, user, ids_to_unlink, {self._fields_id: False}, context=context)
elif act[0] == 6: elif act[0] == 6:
# Must use write() to recompute parent_store structure if needed # Must use write() to recompute parent_store structure if needed
obj.write(cr, user, act[2], {self._fields_id:id}, context=context or {}) obj.write(cr, user, act[2], {self._fields_id:id}, context=context or {})

View File

@ -3694,13 +3694,19 @@ class BaseModel(object):
self.check_unlink(cr, uid) self.check_unlink(cr, uid)
properties = self.pool.get('ir.property') ir_property = self.pool.get('ir.property')
# Check if the records are used as default properties.
domain = [('res_id', '=', False), domain = [('res_id', '=', False),
('value_reference', 'in', ['%s,%s' % (self._name, i) for i in ids]), ('value_reference', 'in', ['%s,%s' % (self._name, i) for i in ids]),
] ]
if properties.search(cr, uid, domain, context=context): if ir_property.search(cr, uid, domain, context=context):
raise except_orm(_('Error'), _('Unable to delete this document because it is used as a default property')) raise except_orm(_('Error'), _('Unable to delete this document because it is used as a default property'))
# Delete the records' properties.
property_ids = ir_property.search(cr, uid, [('res_id', 'in', ['%s,%s' % (self._name, i) for i in ids])], context=context)
ir_property.unlink(cr, uid, property_ids, context=context)
wf_service = netsvc.LocalService("workflow") wf_service = netsvc.LocalService("workflow")
for oid in ids: for oid in ids:
wf_service.trg_delete(uid, self._name, oid, cr) wf_service.trg_delete(uid, self._name, oid, cr)

View File

@ -30,7 +30,7 @@ RELEASE_LEVELS_DISPLAY = {ALPHA: ALPHA,
# properly comparable using normal operarors, for example: # properly comparable using normal operarors, for example:
# (6,1,0,'beta',0) < (6,1,0,'candidate',1) < (6,1,0,'candidate',2) # (6,1,0,'beta',0) < (6,1,0,'candidate',1) < (6,1,0,'candidate',2)
# (6,1,0,'candidate',2) < (6,1,0,'final',0) < (6,1,2,'final',0) # (6,1,0,'candidate',2) < (6,1,0,'final',0) < (6,1,2,'final',0)
version_info = (6,1,0,BETA,0) version_info = (6,1,0,RELEASE_CANDIDATE,1)
version = '.'.join(map(str,version_info[:2])) + RELEASE_LEVELS_DISPLAY[version_info[3]] + str(version_info[4] or '') version = '.'.join(map(str,version_info[:2])) + RELEASE_LEVELS_DISPLAY[version_info[3]] + str(version_info[4] or '')
major_version = '.'.join(map(str,version_info[:2])) major_version = '.'.join(map(str,version_info[:2]))

View File

@ -852,9 +852,7 @@ def trans_load(cr, filename, lang, verbose=True, context=None):
return None return None
def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True, context=None): def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True, context=None):
"""Populates the ir_translation table. Fixing the res_ids so that they point """Populates the ir_translation table."""
correctly to ir_model_data is done in a separate step, using the
'trans_update_res_ids' function below."""
logger = logging.getLogger('i18n') logger = logging.getLogger('i18n')
if verbose: if verbose:
logger.info('loading translation file for language %s', lang) logger.info('loading translation file for language %s', lang)

180
setup.py Normal file → Executable file
View File

@ -1,73 +1,121 @@
#!/usr/bin/env python
# -*- 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 os import glob, os, re, setuptools, sys
import re from os.path import join, isfile
import sys
from setuptools import setup, find_packages
execfile('addons/web/common/release.py') # List all data files
def data():
files = []
for root, dirnames, filenames in os.walk('openerp'):
for filename in filenames:
if not re.match(r'.*(\.pyc|\.pyo|\~)$',filename):
files.append(os.path.join(root, filename))
d = {}
for v in files:
k=os.path.dirname(v)
if k in d:
d[k].append(v)
else:
d[k]=[v]
r = d.items()
if os.name == 'nt':
r.append(("Microsoft.VC90.CRT", glob.glob('C:\Microsoft.VC90.CRT\*.*')))
return r
version_dash_incompatible = False def gen_manifest():
if 'bdist_rpm' in sys.argv: file_list="\n".join(data())
version_dash_incompatible = True open('MANIFEST','w').write(file_list)
try:
import py2exe
from py2exe_utils import opts
version_dash_incompatible = True
except ImportError:
opts = {}
if version_dash_incompatible:
version = version.split('-')[0]
FILE_PATTERNS = \ if os.name == 'nt':
r'.+\.(py|cfg|po|pot|mo|txt|rst|gif|png|jpg|ico|mako|html|js|css|htc|swf)$' sys.path.append("C:\Microsoft.VC90.CRT")
def find_data_files(source, patterns=FILE_PATTERNS):
file_matcher = re.compile(patterns, re.I)
out = []
for base, _, files in os.walk(source):
cur_files = []
for f in files:
if file_matcher.match(f):
cur_files.append(os.path.join(base, f))
if cur_files:
out.append(
(base, cur_files))
return out def py2exe_options():
if os.name == 'nt':
import py2exe
return {
"console" : [ { "script": "openerp-server", "icon_resources": [(1, join("install","openerp-icon.ico"))], }],
'options' : {
"py2exe": {
"skip_archive": 1,
"optimize": 2,
"dist_dir": 'dist',
"packages": [ "DAV", "HTMLParser", "PIL", "asynchat", "asyncore", "commands", "dateutil", "decimal", "email", "encodings", "imaplib", "lxml", "lxml._elementpath", "lxml.builder", "lxml.etree", "lxml.objectify", "mako", "openerp", "poplib", "pychart", "pydot", "pyparsing", "reportlab", "select", "simplejson", "smtplib", "uuid", "vatnumber", "vobject", "xml", "xml.dom", "yaml", ],
"excludes" : ["Tkconstants","Tkinter","tcl"],
}
}
}
else:
return {}
setup( execfile(join(os.path.dirname(__file__), 'openerp', 'release.py'))
name=name,
version=version, setuptools.setup(
description=description, name = 'openerp',
long_description=long_description, version = version,
author=author, description = description,
author_email=author_email, long_description = long_desc,
url=url, url = url,
download_url=download_url, author = author,
license=license, author_email = author_email,
install_requires=[ classifiers = filter(None, classifiers.split("\n")),
"Babel >= 0.9.6", license = license,
"simplejson >= 2.0.9", scripts = ['openerp-server'],
"python-dateutil >= 1.4.1, < 2", data_files = data(),
"pytz", packages = setuptools.find_packages(),
"werkzeug == 0.7", #include_package_data = True,
], install_requires = [
tests_require=[ # TODO the pychart package we include in openerp corresponds to PyChart 1.37.
'unittest2', # It seems there is a single difference, which is a spurious print in generate_docs.py.
'mock', # It is probably safe to move to PyChart 1.39 (the latest one).
], # (Let setup.py choose the latest one, and we should check we can remove pychart from
test_suite = 'unittest2.collector', # our tree.) http://download.gna.org/pychart/
zip_safe=False, # TODO 'pychart',
packages=find_packages(), 'babel',
classifiers=[ 'feedparser',
'Development Status :: 6 - Production/Stable', 'gdata',
'Operating System :: OS Independent', 'lxml',
'Programming Language :: Python', 'mako',
'Environment :: Web Environment', 'psycopg2',
'Topic :: Office/Business :: Financial', 'pydot',
], 'python-dateutil < 2',
scripts=['openerp-web'], 'python-ldap',
data_files=(find_data_files('addons') 'python-openid',
+ opts.pop('data_files', []) 'pytz',
), 'pywebdav',
**opts 'pyyaml',
'reportlab',
'simplejson',
'vatnumber',
'vobject',
'werkzeug',
'xlwt',
'zsi',
],
extras_require = {
'SSL' : ['pyopenssl'],
},
**py2exe_options()
) )
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: