[MERGE] merged trunk.
bzr revid: vmt@openerp.com-20110909074820-o89mwdulwx8an13m
This commit is contained in:
commit
9ca78ea013
|
@ -252,6 +252,11 @@ if __name__ == "__main__":
|
||||||
import_translation()
|
import_translation()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
if not config["stop_after_init"]:
|
||||||
|
# Some module register themselves when they are loaded so we need the
|
||||||
|
# services to be running before loading any registry.
|
||||||
|
start_services()
|
||||||
|
|
||||||
if config['db_name']:
|
if config['db_name']:
|
||||||
for dbname in config['db_name'].split(','):
|
for dbname in config['db_name'].split(','):
|
||||||
preload_registry(dbname)
|
preload_registry(dbname)
|
||||||
|
@ -273,7 +278,6 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
setup_pid_file()
|
setup_pid_file()
|
||||||
setup_signal_handlers()
|
setup_signal_handlers()
|
||||||
start_services()
|
|
||||||
logger = logging.getLogger('server')
|
logger = logging.getLogger('server')
|
||||||
logger.info('OpenERP server is running, waiting for connections...')
|
logger.info('OpenERP server is running, waiting for connections...')
|
||||||
quit_on_signals()
|
quit_on_signals()
|
||||||
|
|
|
@ -111,7 +111,8 @@
|
||||||
<group colspan="4" col="6">
|
<group colspan="4" col="6">
|
||||||
<field name="name" select="1"/>
|
<field name="name" select="1"/>
|
||||||
<field name="login" select="1"/>
|
<field name="login" select="1"/>
|
||||||
<field name="new_password" password="True"/>
|
<field name="id" invisible="1"/>
|
||||||
|
<field name="new_password" password="True" attrs="{'required': [('id','=',False)]}"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
</group>
|
</group>
|
||||||
<notebook colspan="4">
|
<notebook colspan="4">
|
||||||
|
|
|
@ -7,14 +7,14 @@ msgstr ""
|
||||||
"Project-Id-Version: openobject-server\n"
|
"Project-Id-Version: openobject-server\n"
|
||||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||||
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
|
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
|
||||||
"PO-Revision-Date: 2011-08-13 17:34+0000\n"
|
"PO-Revision-Date: 2011-09-08 12:09+0000\n"
|
||||||
"Last-Translator: Jiří Hajda <robie@centrum.cz>\n"
|
"Last-Translator: Jiří Hajda <robie@centrum.cz>\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: 2011-09-01 04:40+0000\n"
|
"X-Launchpad-Export-Date: 2011-09-09 04:37+0000\n"
|
||||||
"X-Generator: Launchpad (build 13827)\n"
|
"X-Generator: Launchpad (build 13900)\n"
|
||||||
"X-Poedit-Language: Czech\n"
|
"X-Poedit-Language: Czech\n"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
|
@ -174,7 +174,7 @@ msgstr "ir.ui.view.custom"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.sz
|
#: model:res.country,name:base.sz
|
||||||
msgid "Swaziland"
|
msgid "Swaziland"
|
||||||
msgstr "Švýcarsko"
|
msgstr "Svazijsko"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: code:addons/orm.py:1993
|
#: code:addons/orm.py:1993
|
||||||
|
@ -1876,7 +1876,7 @@ msgstr "Slovinsko"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.pk
|
#: model:res.country,name:base.pk
|
||||||
msgid "Pakistan"
|
msgid "Pakistan"
|
||||||
msgstr "Pakistán"
|
msgstr "Pákistán"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: code:addons/orm.py:1350
|
#: code:addons/orm.py:1350
|
||||||
|
@ -3532,7 +3532,7 @@ msgstr "Pobřeží slonoviny (Cote D'Ivoire)"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.kz
|
#: model:res.country,name:base.kz
|
||||||
msgid "Kazakhstan"
|
msgid "Kazakhstan"
|
||||||
msgstr "Kazakstán"
|
msgstr "Kazachstán"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: view:res.lang:0
|
#: view:res.lang:0
|
||||||
|
@ -3896,7 +3896,7 @@ msgstr "Měsíc"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.my
|
#: model:res.country,name:base.my
|
||||||
msgid "Malaysia"
|
msgid "Malaysia"
|
||||||
msgstr "Malaysie"
|
msgstr "Malajsie"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: view:base.language.install:0
|
#: view:base.language.install:0
|
||||||
|
@ -4059,7 +4059,7 @@ msgstr "Pravidlo musí mít alespoň jedno aktivní přístupové právo !"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.fj
|
#: model:res.country,name:base.fj
|
||||||
msgid "Fiji"
|
msgid "Fiji"
|
||||||
msgstr "Fiji"
|
msgstr "Fidži"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: field:ir.model.fields,size:0
|
#: field:ir.model.fields,size:0
|
||||||
|
@ -4069,7 +4069,7 @@ msgstr "Velikost"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.sd
|
#: model:res.country,name:base.sd
|
||||||
msgid "Sudan"
|
msgid "Sudan"
|
||||||
msgstr "Sudan"
|
msgstr "Súdán"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.fm
|
#: model:res.country,name:base.fm
|
||||||
|
@ -4118,7 +4118,7 @@ msgstr "Formát času"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: view:ir.module.module:0
|
#: view:ir.module.module:0
|
||||||
msgid "Defined Reports"
|
msgid "Defined Reports"
|
||||||
msgstr "Definoavné výkazy"
|
msgstr "Definované výkazy"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: view:ir.actions.report.xml:0
|
#: view:ir.actions.report.xml:0
|
||||||
|
@ -4617,7 +4617,7 @@ msgstr "Přístup k nabídce"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.na
|
#: model:res.country,name:base.na
|
||||||
msgid "Namibia"
|
msgid "Namibia"
|
||||||
msgstr "Nambie"
|
msgstr "Namibie"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.mn
|
#: model:res.country,name:base.mn
|
||||||
|
@ -4800,7 +4800,7 @@ msgstr "Adresy"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.mm
|
#: model:res.country,name:base.mm
|
||||||
msgid "Myanmar"
|
msgid "Myanmar"
|
||||||
msgstr "Barma"
|
msgstr "Myanmar"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: selection:base.language.install,lang:0
|
#: selection:base.language.install,lang:0
|
||||||
|
@ -5476,12 +5476,12 @@ msgstr "Globální"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.mp
|
#: model:res.country,name:base.mp
|
||||||
msgid "Northern Mariana Islands"
|
msgid "Northern Mariana Islands"
|
||||||
msgstr "Severní Mariánské ostrovy"
|
msgstr "Severní Mariany"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.sb
|
#: model:res.country,name:base.sb
|
||||||
msgid "Solomon Islands"
|
msgid "Solomon Islands"
|
||||||
msgstr "Šalamounovy Ostrovy"
|
msgstr "Šalamounovy ostrovy"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: code:addons/base/ir/ir_model.py:490
|
#: code:addons/base/ir/ir_model.py:490
|
||||||
|
@ -5682,7 +5682,7 @@ msgstr "Jazyk"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.gm
|
#: model:res.country,name:base.gm
|
||||||
msgid "Gambia"
|
msgid "Gambia"
|
||||||
msgstr "Gambia"
|
msgstr "Gambie"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:ir.actions.act_window,name:base.action_res_company_form
|
#: model:ir.actions.act_window,name:base.action_res_company_form
|
||||||
|
@ -6443,7 +6443,7 @@ msgstr "Mongolština / монгол"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.mr
|
#: model:res.country,name:base.mr
|
||||||
msgid "Mauritania"
|
msgid "Mauritania"
|
||||||
msgstr "Mauretánie"
|
msgstr "Mauritánie"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:ir.model,name:base.model_ir_translation
|
#: model:ir.model,name:base.model_ir_translation
|
||||||
|
@ -7649,7 +7649,7 @@ msgstr "Změnit heslo"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.nl
|
#: model:res.country,name:base.nl
|
||||||
msgid "Netherlands"
|
msgid "Netherlands"
|
||||||
msgstr "Nizozemí"
|
msgstr "Nizozemsko"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:ir.ui.menu,name:base.next_id_4
|
#: model:ir.ui.menu,name:base.next_id_4
|
||||||
|
@ -8137,7 +8137,7 @@ msgstr "Asociace"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.cl
|
#: model:res.country,name:base.cl
|
||||||
msgid "Chile"
|
msgid "Chile"
|
||||||
msgstr "Čile"
|
msgstr "Chile"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:ir.ui.menu,name:base.menu_address_book
|
#: model:ir.ui.menu,name:base.menu_address_book
|
||||||
|
@ -8185,7 +8185,7 @@ msgstr "Popisek pole"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.dj
|
#: model:res.country,name:base.dj
|
||||||
msgid "Djibouti"
|
msgid "Djibouti"
|
||||||
msgstr "Djibouti"
|
msgstr "Džibutsko"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: field:ir.translation,value:0
|
#: field:ir.translation,value:0
|
||||||
|
@ -8364,7 +8364,7 @@ msgstr "Chyba"
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.pm
|
#: model:res.country,name:base.pm
|
||||||
msgid "Saint Pierre and Miquelon"
|
msgid "Saint Pierre and Miquelon"
|
||||||
msgstr "Saint Pierre a Miquelon"
|
msgstr "Svatý Pierre a Miquelon"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: help:ir.actions.report.xml,header:0
|
#: help:ir.actions.report.xml,header:0
|
||||||
|
@ -8540,7 +8540,7 @@ msgstr ""
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.sa
|
#: model:res.country,name:base.sa
|
||||||
msgid "Saudi Arabia"
|
msgid "Saudi Arabia"
|
||||||
msgstr "Saudská Arábie"
|
msgstr "Saúdská Arábie"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: help:res.partner,supplier:0
|
#: help:res.partner,supplier:0
|
||||||
|
@ -8637,7 +8637,7 @@ msgstr ""
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.sv
|
#: model:res.country,name:base.sv
|
||||||
msgid "El Salvador"
|
msgid "El Salvador"
|
||||||
msgstr "El Salvador"
|
msgstr "Salvador"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: field:res.bank,phone:0
|
#: field:res.bank,phone:0
|
||||||
|
@ -8937,7 +8937,7 @@ msgstr "Pracovní postup, který má být spuštěn pro tento model."
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:res.country,name:base.jm
|
#: model:res.country,name:base.jm
|
||||||
msgid "Jamaica"
|
msgid "Jamaica"
|
||||||
msgstr "Jamaika"
|
msgstr "Jamajka"
|
||||||
|
|
||||||
#. module: base
|
#. module: base
|
||||||
#: model:ir.actions.act_window,help:base.action_partner_category_form
|
#: model:ir.actions.act_window,help:base.action_partner_category_form
|
||||||
|
|
|
@ -241,7 +241,7 @@
|
||||||
<field name="view_id" ref="sequence_view_tree"/>
|
<field name="view_id" ref="sequence_view_tree"/>
|
||||||
<field name="context">{'active_test': False}</field>
|
<field name="context">{'active_test': False}</field>
|
||||||
</record>
|
</record>
|
||||||
<menuitem id="next_id_5" name="Sequences" parent="base.menu_config"/>
|
<menuitem id="next_id_5" name="Sequences & Identifiers" parent="base.menu_config"/>
|
||||||
<menuitem action="ir_sequence_form" id="menu_ir_sequence_form" parent="next_id_5"/>
|
<menuitem action="ir_sequence_form" id="menu_ir_sequence_form" parent="next_id_5"/>
|
||||||
|
|
||||||
<!-- Sequences Types -->
|
<!-- Sequences Types -->
|
||||||
|
@ -1221,7 +1221,7 @@
|
||||||
<field name="model">ir.model.data</field>
|
<field name="model">ir.model.data</field>
|
||||||
<field name="type">form</field>
|
<field name="type">form</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Object Identifiers">
|
<form string="External Identifiers">
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="module"/>
|
<field name="module"/>
|
||||||
<field name="model"/>
|
<field name="model"/>
|
||||||
|
@ -1239,7 +1239,7 @@
|
||||||
<field name="model">ir.model.data</field>
|
<field name="model">ir.model.data</field>
|
||||||
<field name="type">tree</field>
|
<field name="type">tree</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Object Identifiers">
|
<tree string="External Identifiers">
|
||||||
<field name="module"/>
|
<field name="module"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="model"/>
|
<field name="model"/>
|
||||||
|
@ -1253,7 +1253,7 @@
|
||||||
<field name="model">ir.model.data</field>
|
<field name="model">ir.model.data</field>
|
||||||
<field name="type">search</field>
|
<field name="type">search</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Object Identifiers">
|
<search string="External Identifiers">
|
||||||
<filter icon="terp-camera_test"
|
<filter icon="terp-camera_test"
|
||||||
string="Updatable"
|
string="Updatable"
|
||||||
domain="[('noupdate', '=', False)]"/>
|
domain="[('noupdate', '=', False)]"/>
|
||||||
|
@ -1293,7 +1293,7 @@
|
||||||
<menuitem action="action_model_fields" id="ir_model_model_fields" parent="base.next_id_9"/>
|
<menuitem action="action_model_fields" id="ir_model_model_fields" parent="base.next_id_9"/>
|
||||||
|
|
||||||
<record id="action_model_data" model="ir.actions.act_window">
|
<record id="action_model_data" model="ir.actions.act_window">
|
||||||
<field name="name">Object Identifiers</field>
|
<field name="name">External Identifiers</field>
|
||||||
<field name="res_model">ir.model.data</field>
|
<field name="res_model">ir.model.data</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_id" ref="view_model_data_list"/>
|
<field name="view_id" ref="view_model_data_list"/>
|
||||||
|
|
|
@ -561,14 +561,27 @@ class ir_model_access(osv.osv):
|
||||||
ir_model_access()
|
ir_model_access()
|
||||||
|
|
||||||
class ir_model_data(osv.osv):
|
class ir_model_data(osv.osv):
|
||||||
|
"""Holds external identifier keys for records in the database.
|
||||||
|
This has two main uses:
|
||||||
|
|
||||||
|
* allows easy data integration with third-party systems,
|
||||||
|
making import/export/sync of data possible, as records
|
||||||
|
can be uniquely identified across multiple systems
|
||||||
|
* allows tracking the origin of data installed by OpenERP
|
||||||
|
modules themselves, thus making it possible to later
|
||||||
|
update them seamlessly.
|
||||||
|
"""
|
||||||
_name = 'ir.model.data'
|
_name = 'ir.model.data'
|
||||||
__logger = logging.getLogger('addons.base.'+_name)
|
__logger = logging.getLogger('addons.base.'+_name)
|
||||||
_order = 'module,model,name'
|
_order = 'module,model,name'
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('XML Identifier', required=True, size=128, select=1),
|
'name': fields.char('External Identifier', required=True, size=128, select=1,
|
||||||
'model': fields.char('Object', required=True, size=64, select=1),
|
help="External Key/Identifier that can be used for "
|
||||||
|
"data integration with third-party systems"),
|
||||||
|
'model': fields.char('Model Name', required=True, size=64, select=1),
|
||||||
'module': fields.char('Module', required=True, size=64, select=1),
|
'module': fields.char('Module', required=True, size=64, select=1),
|
||||||
'res_id': fields.integer('Resource ID', select=1),
|
'res_id': fields.integer('Record ID', select=1,
|
||||||
|
help="ID of the target record in the database"),
|
||||||
'noupdate': fields.boolean('Non Updatable'),
|
'noupdate': fields.boolean('Non Updatable'),
|
||||||
'date_update': fields.datetime('Update Date'),
|
'date_update': fields.datetime('Update Date'),
|
||||||
'date_init': fields.datetime('Init Date')
|
'date_init': fields.datetime('Init Date')
|
||||||
|
@ -580,7 +593,7 @@ class ir_model_data(osv.osv):
|
||||||
'module': ''
|
'module': ''
|
||||||
}
|
}
|
||||||
_sql_constraints = [
|
_sql_constraints = [
|
||||||
('module_name_uniq', 'unique(name, module)', 'You cannot have multiple records with the same id for the same module !'),
|
('module_name_uniq', 'unique(name, module)', 'You cannot have multiple records with the same external ID in the same module!'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, pool, cr):
|
def __init__(self, pool, cr):
|
||||||
|
|
|
@ -59,7 +59,7 @@ class ir_translation(osv.osv):
|
||||||
# These two columns map to ir_model_data.module and ir_model_data.name.
|
# These two columns map to ir_model_data.module and ir_model_data.name.
|
||||||
# They are used to resolve the res_id above after loading is done.
|
# They are used to resolve the res_id above after loading is done.
|
||||||
'module': fields.char('Module', size=64, help='Maps to the ir_model_data for which this translation is provided.'),
|
'module': fields.char('Module', size=64, help='Maps to the ir_model_data for which this translation is provided.'),
|
||||||
'xml_id': fields.char('XML Id', size=128, help='Maps to the ir_model_data for which this translation is provided.'),
|
'xml_id': fields.char('External ID', size=128, help='Maps to the ir_model_data for which this translation is provided.'),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _auto_init(self, cr, context={}):
|
def _auto_init(self, cr, context={}):
|
||||||
|
@ -177,7 +177,8 @@ class ir_translation(osv.osv):
|
||||||
if not context:
|
if not context:
|
||||||
context = {}
|
context = {}
|
||||||
ids = super(ir_translation, self).create(cr, uid, vals, context=context)
|
ids = super(ir_translation, self).create(cr, uid, vals, context=context)
|
||||||
self._get_source.clear_cache(self, vals.get('name',0), vals.get('type',0), vals.get('lang',0), vals.get('src',0))
|
self._get_source.clear_cache(self, uid, vals.get('name',0), vals.get('type',0), vals.get('lang',0), vals.get('src',0))
|
||||||
|
self._get_ids.clear_cache(self, uid, vals.get('name',0), vals.get('type',0), vals.get('lang',0), vals.get('res_id',0))
|
||||||
return ids
|
return ids
|
||||||
|
|
||||||
def write(self, cursor, user, ids, vals, context=None):
|
def write(self, cursor, user, ids, vals, context=None):
|
||||||
|
@ -186,8 +187,8 @@ class ir_translation(osv.osv):
|
||||||
if isinstance(ids, (int, long)):
|
if isinstance(ids, (int, long)):
|
||||||
ids = [ids]
|
ids = [ids]
|
||||||
result = super(ir_translation, self).write(cursor, user, ids, vals, context=context)
|
result = super(ir_translation, self).write(cursor, user, ids, vals, context=context)
|
||||||
self._get_source.clear_cache(self, user, trans_obj['name'], trans_obj['type'], trans_obj['lang'], source=trans_obj['src'])
|
|
||||||
for trans_obj in self.read(cursor, user, ids, ['name','type','res_id','src','lang'], context=context):
|
for trans_obj in self.read(cursor, user, ids, ['name','type','res_id','src','lang'], context=context):
|
||||||
|
self._get_source.clear_cache(self, user, trans_obj['name'], trans_obj['type'], trans_obj['lang'], trans_obj['src'])
|
||||||
self._get_ids.clear_cache(self, user, trans_obj['name'], trans_obj['type'], trans_obj['lang'], [trans_obj['res_id']])
|
self._get_ids.clear_cache(self, user, trans_obj['name'], trans_obj['type'], trans_obj['lang'], [trans_obj['res_id']])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ class ir_ui_menu(osv.osv):
|
||||||
|
|
||||||
field = model_field.get(menu.action._name)
|
field = model_field.get(menu.action._name)
|
||||||
if field and data[field]:
|
if field and data[field]:
|
||||||
if not modelaccess.check(cr, uid, data[field], False):
|
if not modelaccess.check(cr, uid, data[field], 'read', False):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
# if there is no action, it's a 'folder' menu
|
# if there is no action, it's a 'folder' menu
|
||||||
|
|
|
@ -73,11 +73,12 @@ class view(osv.osv):
|
||||||
('calendar', 'Calendar'),
|
('calendar', 'Calendar'),
|
||||||
('diagram','Diagram'),
|
('diagram','Diagram'),
|
||||||
('gantt', 'Gantt'),
|
('gantt', 'Gantt'),
|
||||||
|
('kanban', 'Kanban'),
|
||||||
('search','Search')), 'View Type', required=True, select=True),
|
('search','Search')), 'View Type', required=True, select=True),
|
||||||
'arch': fields.text('View Architecture', required=True),
|
'arch': fields.text('View Architecture', required=True),
|
||||||
'inherit_id': fields.many2one('ir.ui.view', 'Inherited View', ondelete='cascade', select=True),
|
'inherit_id': fields.many2one('ir.ui.view', 'Inherited View', ondelete='cascade', select=True),
|
||||||
'field_parent': fields.char('Child Field',size=64),
|
'field_parent': fields.char('Child Field',size=64),
|
||||||
'xml_id': fields.function(osv.osv.get_xml_id, type='char', size=128, string="XML ID",
|
'xml_id': fields.function(osv.osv.get_xml_id, type='char', size=128, string="External ID",
|
||||||
method=True, help="ID of the view defined in xml file"),
|
method=True, help="ID of the view defined in xml file"),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
|
|
|
@ -221,8 +221,8 @@ class users(osv.osv):
|
||||||
'password': fields.char('Password', size=64, invisible=True, help="Keep empty if you don't want the user to be able to connect on the system."),
|
'password': fields.char('Password', size=64, invisible=True, help="Keep empty if you don't want the user to be able to connect on the system."),
|
||||||
'new_password': fields.function(_get_password, method=True, type='char', size=64,
|
'new_password': fields.function(_get_password, method=True, type='char', size=64,
|
||||||
fnct_inv=_set_new_password,
|
fnct_inv=_set_new_password,
|
||||||
string='Change password', help="Only specify a value if you want to change the user password. "
|
string='Set password', help="Specify a value only when creating a user or if you're changing the user's password, "
|
||||||
"This user will have to logout and login again!"),
|
"otherwise leave empty. After a change of password, the user has to login again."),
|
||||||
'user_email': fields.char('Email', size=64),
|
'user_email': fields.char('Email', size=64),
|
||||||
'signature': fields.text('Signature', size=64),
|
'signature': fields.text('Signature', size=64),
|
||||||
'active': fields.boolean('Active'),
|
'active': fields.boolean('Active'),
|
||||||
|
|
|
@ -111,6 +111,19 @@
|
||||||
</rng:element>
|
</rng:element>
|
||||||
</rng:define>
|
</rng:define>
|
||||||
|
|
||||||
|
<rng:define name="kanban">
|
||||||
|
<rng:element name="kanban">
|
||||||
|
<rng:zeroOrMore>
|
||||||
|
<rng:ref name="field"/>
|
||||||
|
</rng:zeroOrMore>
|
||||||
|
<rng:element name="templates">
|
||||||
|
<rng:oneOrMore>
|
||||||
|
<rng:ref name="any"/>
|
||||||
|
</rng:oneOrMore>
|
||||||
|
</rng:element>
|
||||||
|
</rng:element>
|
||||||
|
</rng:define>
|
||||||
|
|
||||||
<rng:define name="tree">
|
<rng:define name="tree">
|
||||||
<rng:element name="tree">
|
<rng:element name="tree">
|
||||||
<rng:ref name="overload"/>
|
<rng:ref name="overload"/>
|
||||||
|
@ -460,6 +473,7 @@
|
||||||
<rng:zeroOrMore>
|
<rng:zeroOrMore>
|
||||||
<rng:choice>
|
<rng:choice>
|
||||||
<rng:ref name="diagram"/>
|
<rng:ref name="diagram"/>
|
||||||
|
<rng:ref name="kanban"/>
|
||||||
<rng:ref name="form"/>
|
<rng:ref name="form"/>
|
||||||
<rng:ref name="data"/>
|
<rng:ref name="data"/>
|
||||||
<rng:ref name="tree"/>
|
<rng:ref name="tree"/>
|
||||||
|
@ -618,6 +632,7 @@
|
||||||
<rng:start>
|
<rng:start>
|
||||||
<rng:choice>
|
<rng:choice>
|
||||||
<rng:ref name="diagram" />
|
<rng:ref name="diagram" />
|
||||||
|
<rng:ref name="kanban" />
|
||||||
<rng:ref name="form" />
|
<rng:ref name="form" />
|
||||||
<rng:ref name="search" />
|
<rng:ref name="search" />
|
||||||
<rng:ref name="group" />
|
<rng:ref name="group" />
|
||||||
|
|
|
@ -32,7 +32,9 @@
|
||||||
* size
|
* size
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import base64
|
||||||
import datetime as DT
|
import datetime as DT
|
||||||
|
import re
|
||||||
import string
|
import string
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
|
@ -727,34 +729,41 @@ def get_nice_size(value):
|
||||||
size = len(value)
|
size = len(value)
|
||||||
return tools.human_size(size)
|
return tools.human_size(size)
|
||||||
|
|
||||||
|
# See http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
|
||||||
|
# and http://bugs.python.org/issue10066
|
||||||
|
invalid_xml_low_bytes = re.compile(r'[\x00-\x08\x0b-\x0c\x0e-\x1f]')
|
||||||
|
|
||||||
def sanitize_binary_value(value):
|
def sanitize_binary_value(value):
|
||||||
# binary fields should be 7-bit ASCII base64-encoded data,
|
# binary fields should be 7-bit ASCII base64-encoded data,
|
||||||
# but we do additional sanity checks to make sure the values
|
# but we do additional sanity checks to make sure the values
|
||||||
# are not something else that won't pass via xmlrpc
|
# are not something else that won't pass via XML-RPC
|
||||||
if isinstance(value, (xmlrpclib.Binary, tuple, list, dict)):
|
if isinstance(value, (xmlrpclib.Binary, tuple, list, dict)):
|
||||||
# these builtin types are meant to pass untouched
|
# these builtin types are meant to pass untouched
|
||||||
return value
|
return value
|
||||||
|
|
||||||
# For all other cases, handle the value as a binary string:
|
# Handle invalid bytes values that will cause problems
|
||||||
# it could be a 7-bit ASCII string (e.g base64 data), but also
|
# for XML-RPC. See for more info:
|
||||||
# any 8-bit content from files, with byte values that cannot
|
|
||||||
# be passed inside XML!
|
|
||||||
# See for more info:
|
|
||||||
# - http://bugs.python.org/issue10066
|
# - http://bugs.python.org/issue10066
|
||||||
# - http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
|
# - http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
|
||||||
#
|
|
||||||
# One solution is to convert the byte-string to unicode,
|
# Coercing to unicode would normally allow it to properly pass via
|
||||||
# so it gets serialized as utf-8 encoded data (always valid XML)
|
# XML-RPC, transparently encoded as UTF-8 by xmlrpclib.
|
||||||
# If invalid XML byte values were present, tools.ustr() uses
|
# (this works for _any_ byte values, thanks to the fallback
|
||||||
# the Latin-1 codec as fallback, which converts any 8-bit
|
# to latin-1 passthrough encoding when decoding to unicode)
|
||||||
# byte value, resulting in valid utf-8-encoded bytes
|
value = tools.ustr(value)
|
||||||
# in the end:
|
|
||||||
# >>> unicode('\xe1','latin1').encode('utf8') == '\xc3\xa1'
|
# Due to Python bug #10066 this could still yield invalid XML
|
||||||
# Note: when this happens, decoding on the other endpoint
|
# bytes, specifically in the low byte range, that will crash
|
||||||
# is not likely to produce the expected output, but this is
|
# the decoding side: [\x00-\x08\x0b-\x0c\x0e-\x1f]
|
||||||
# just a safety mechanism (in these cases base64 data or
|
# So check for low bytes values, and if any, perform
|
||||||
# xmlrpc.Binary values should be used instead)
|
# base64 encoding - not very smart or useful, but this is
|
||||||
return tools.ustr(value)
|
# our last resort to avoid crashing the request.
|
||||||
|
if invalid_xml_low_bytes.search(value):
|
||||||
|
# b64-encode after restoring the pure bytes with latin-1
|
||||||
|
# passthrough encoding
|
||||||
|
value = base64.b64encode(value.encode('latin-1'))
|
||||||
|
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue