[MERGE]
bzr revid: uco@uco-20100624044444-neqc1qtzttfo0oos
This commit is contained in:
@@ -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-06-22 04:26+0000\n"
|
||||
"PO-Revision-Date: 2010-06-23 04:21+0000\n"
|
||||
"Last-Translator: Goran Kliska <gkliska@gmail.com>\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-06-23 03:50+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-24 03:46+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
"Language: hr\n"
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-server\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-12-18 08:39+0000\n"
|
||||
"PO-Revision-Date: 2010-06-22 04:25+0000\n"
|
||||
"PO-Revision-Date: 2010-06-23 04:19+0000\n"
|
||||
"Last-Translator: Harry (Open ERP) <hmo@tinyerp.com>\n"
|
||||
"Language-Team: Japanese <ja@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-23 03:49+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-24 03:45+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base
|
||||
|
||||
@@ -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-06-22 04:24+0000\n"
|
||||
"PO-Revision-Date: 2010-06-23 04:18+0000\n"
|
||||
"Last-Translator: Anders Wallenquist <anders.wallenquist@vertel.se>\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-06-23 03:51+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-24 03:46+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base
|
||||
|
||||
@@ -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-06-22 04:27+0000\n"
|
||||
"PO-Revision-Date: 2010-06-23 04:22+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\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-06-23 03:51+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-24 03:46+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base
|
||||
|
||||
@@ -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-06-22 04:25+0000\n"
|
||||
"PO-Revision-Date: 2010-06-23 04:19+0000\n"
|
||||
"Last-Translator: Eleanor Chen <chenyueg@gmail.com>\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-06-23 03:52+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-24 03:46+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base
|
||||
|
||||
@@ -256,7 +256,8 @@ class act_window(osv.osv):
|
||||
'auto_search':fields.boolean('Auto Search'),
|
||||
'default_user_ids': fields.many2many('res.users', 'ir_act_window_user_rel', 'act_id', 'uid', 'Users'),
|
||||
'search_view' : fields.function(_search_view, type='text', method=True, string='Search View'),
|
||||
'menus': fields.char('Menus', size=4096)
|
||||
'menus': fields.char('Menus', size=4096),
|
||||
'help': fields.text('Action description')
|
||||
}
|
||||
_defaults = {
|
||||
'type': lambda *a: 'ir.actions.act_window',
|
||||
|
||||
@@ -68,17 +68,10 @@ class ir_ui_menu(osv.osv):
|
||||
self._cache = {}
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
context=None, count=False):
|
||||
context=None, count=False):
|
||||
|
||||
super_offset = cond(uid == 1, offset, 0)
|
||||
super_limit = cond(uid == 1, limit, None)
|
||||
super_count = cond(uid == 1, count, False)
|
||||
|
||||
ids = super(ir_ui_menu, self).search(cr, uid, args, super_offset,
|
||||
super_limit, order, context=context, count=super_count)
|
||||
|
||||
#if uid == 1:
|
||||
# return ids
|
||||
ids = super(ir_ui_menu, self).search(cr, uid, args, offset=0,
|
||||
limit=None, order=order, context=context, count=False)
|
||||
|
||||
if not ids:
|
||||
if count:
|
||||
|
||||
@@ -138,17 +138,14 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state=='to upgrade' or state=='to install';red:state=='uninstalled';grey:state=='uninstallable';black:state=='installed'" string="Modules">
|
||||
<button name="button_install" states="uninstalled" string="Schedule for Installation" icon="terp-gtk-jump-to-ltr" type="object" help="Schedule for Installation"/>
|
||||
<button name="button_install_cancel" states="to install" string="Cancel Install" icon="gtk-cancel" type="object" help="Cancel Install"/>
|
||||
<button name="button_uninstall" states="installed" string="Uninstall (beta)" icon="terp-dialog-close" type="object" help="Uninstall"/>
|
||||
<button name="button_upgrade" states="installed" string="Schedule Upgrade" icon="terp-gtk-go-back-rtl" type="object" help="Schedule Upgrade"/>
|
||||
<button name="button_upgrade_cancel" states="to upgrade" string="Cancel Upgrade" icon="gtk-cancel" type="object" help="Cancel Upgrade"/>
|
||||
<field name="name"/>
|
||||
<field name="shortdesc"/>
|
||||
<field name="author"/>
|
||||
<field name="installed_version"/>
|
||||
<field name="latest_version"/>
|
||||
<field name="state"/>
|
||||
<button name="button_install" states="uninstalled" string="Schedule for Installation" icon="terp-gtk-jump-to-ltr" type="object" help="Schedule for Installation"/>
|
||||
<button name="button_upgrade" states="installed" string="Schedule Upgrade" icon="terp-gtk-go-back-rtl" type="object" help="Schedule Upgrade"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
+52
-29
@@ -3863,7 +3863,6 @@ class orm(orm_template):
|
||||
data = self.read(cr, uid, [id], context=context_wo_lang)[0]
|
||||
|
||||
fields = self.fields_get(cr, uid, context=context)
|
||||
trans_data=[]
|
||||
for f in fields:
|
||||
ftype = fields[f]['type']
|
||||
|
||||
@@ -3882,40 +3881,68 @@ class orm(orm_template):
|
||||
elif ftype in ('one2many', 'one2one'):
|
||||
res = []
|
||||
rel = self.pool.get(fields[f]['relation'])
|
||||
if data[f] != False:
|
||||
if data[f]:
|
||||
# duplicate following the order of the ids
|
||||
# because we'll rely on it later for copying
|
||||
# translations in copy_translation()!
|
||||
data[f].sort()
|
||||
for rel_id in data[f]:
|
||||
# the lines are first duplicated using the wrong (old)
|
||||
# parent but then are reassigned to the correct one thanks
|
||||
# to the (4, ...)
|
||||
d,t = rel.copy_data(cr, uid, rel_id, context=context)
|
||||
# to the (0, 0, ...)
|
||||
d = rel.copy_data(cr, uid, rel_id, context=context)
|
||||
res.append((0, 0, d))
|
||||
trans_data += t
|
||||
data[f] = res
|
||||
elif ftype == 'many2many':
|
||||
data[f] = [(6, 0, data[f])]
|
||||
|
||||
trans_obj = self.pool.get('ir.translation')
|
||||
#TODO: optimize translations
|
||||
for f in fields:
|
||||
trans_name = ''
|
||||
if f in self._columns and self._columns[f].translate:
|
||||
trans_name = self._name+","+f
|
||||
elif f in self._inherit_fields and self._inherit_fields[f][2].translate:
|
||||
trans_name = self._inherit_fields[f][0] + "," + f
|
||||
|
||||
if trans_name:
|
||||
trans_ids = trans_obj.search(cr, uid, [
|
||||
('name', '=', trans_name),
|
||||
('res_id','=',data['id'])
|
||||
])
|
||||
|
||||
trans_data.extend(trans_obj.read(cr,uid,trans_ids,context=context))
|
||||
|
||||
del data['id']
|
||||
|
||||
# make sure we don't break the current parent_store structure and
|
||||
# force a clean recompute!
|
||||
for parent_column in ['parent_left', 'parent_right']:
|
||||
data.pop(parent_column, None)
|
||||
|
||||
for v in self._inherits:
|
||||
del data[self._inherits[v]]
|
||||
return data, trans_data
|
||||
return data
|
||||
|
||||
def copy_translations(self, cr, uid, old_id, new_id, context=None):
|
||||
trans_obj = self.pool.get('ir.translation')
|
||||
fields = self.fields_get(cr, uid, context=context)
|
||||
|
||||
translation_records = []
|
||||
for field_name, field_def in fields.items():
|
||||
# we must recursively copy the translations for o2o and o2m
|
||||
if field_def['type'] in ('one2one', 'one2many'):
|
||||
target_obj = self.pool.get(field_def['relation'])
|
||||
old_record, new_record = self.read(cr, uid, [old_id, new_id], [field_name], context=context)
|
||||
# here we rely on the order of the ids to match the translations
|
||||
# as foreseen in copy_data()
|
||||
old_childs = sorted(old_record[field_name])
|
||||
new_childs = sorted(new_record[field_name])
|
||||
for (old_child, new_child) in zip(old_childs, new_childs):
|
||||
# recursive copy of translations here
|
||||
target_obj.copy_translations(cr, uid, old_child, new_child, context=context)
|
||||
# and for translatable fields we keep them for copy
|
||||
elif field_def.get('translate'):
|
||||
trans_name = ''
|
||||
if field_name in self._columns:
|
||||
trans_name = self._name + "," + field_name
|
||||
elif field_name in self._inherit_fields:
|
||||
trans_name = self._inherit_fields[field_name][0] + "," + field_name
|
||||
if trans_name:
|
||||
trans_ids = trans_obj.search(cr, uid, [
|
||||
('name', '=', trans_name),
|
||||
('res_id','=', old_id)
|
||||
])
|
||||
translation_records.extend(trans_obj.read(cr,uid,trans_ids,context=context))
|
||||
|
||||
for record in translation_records:
|
||||
del record['id']
|
||||
record['res_id'] = new_id
|
||||
trans_obj.create(cr, uid, record, context=context)
|
||||
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
"""
|
||||
@@ -3930,13 +3957,9 @@ class orm(orm_template):
|
||||
:return: True
|
||||
|
||||
"""
|
||||
trans_obj = self.pool.get('ir.translation')
|
||||
data, trans_data = self.copy_data(cr, uid, id, default, context)
|
||||
data = self.copy_data(cr, uid, id, default, context)
|
||||
new_id = self.create(cr, uid, data, context)
|
||||
for record in trans_data:
|
||||
del record['id']
|
||||
record['res_id'] = new_id
|
||||
trans_obj.create(cr, uid, record, context)
|
||||
self.copy_translations(cr, uid, id, new_id, context)
|
||||
return new_id
|
||||
|
||||
def exists(self, cr, uid, ids, context=None):
|
||||
|
||||
Reference in New Issue
Block a user