[MERGE] latest 6.0 fixes

bzr revid: odo@openerp.com-20110719113630-dvhg0cvh59r0oiiq
This commit is contained in:
Olivier Dony
2011-07-19 13:36:30 +02:00
6 changed files with 14 additions and 19 deletions
+3 -3
View File
@@ -75,15 +75,15 @@ class ir_sequence(osv.osv):
def get_id(self, cr, uid, sequence_id, test='id', context=None):
assert test in ('code','id')
company_id = self.pool.get('res.users').read(cr, uid, uid, ['company_id'], context=context)['company_id'][0] or None
company_ids = self.pool.get('res.company').search(cr, uid, [], context=context)
cr.execute('''SELECT id, number_next, prefix, suffix, padding
FROM ir_sequence
WHERE %s=%%s
AND active=true
AND (company_id = %%s or company_id is NULL)
AND (company_id in %%s or company_id is NULL)
ORDER BY company_id, id
FOR UPDATE NOWAIT''' % test,
(sequence_id, company_id))
(sequence_id, tuple(company_ids)))
res = cr.dictfetchone()
if res:
cr.execute('UPDATE ir_sequence SET number_next=number_next+number_increment WHERE id=%s AND active=true', (res['id'],))
+4 -2
View File
@@ -222,8 +222,10 @@ class res_partner(osv.osv):
return True
def address_get(self, cr, uid, ids, adr_pref=['default']):
cr.execute('select type,id from res_partner_address where partner_id IN %s',(tuple(ids),))
res = cr.fetchall()
address_obj = self.pool.get('res.partner.address')
address_ids = address_obj.search(cr, uid, [('partner_id', '=', ids)])
address_rec = address_obj.read(cr, uid, address_ids, ['type'])
res = list(tuple(addr.values()) for addr in address_rec)
adr = dict(res)
# get the id of the (first) default address if there is one,
# otherwise get the id of the first address in the list
@@ -79,6 +79,7 @@
<form string="Address">
<group colspan="4" col="6">
<field name="partner_id" colspan="2"/>
<field name="active"/>
<field name="company_id" groups="base.group_multi_company" widget="selection" colspan="2"/>
<newline/>
<field name="name"/>
+4 -2
View File
@@ -16,6 +16,9 @@
<field eval="[(6,0,[ref('group_partner_manager')])]" name="groups_id"/>
</record>
</data>
<data noupdate="1">
<!-- Record Rule For Company -->
@@ -34,7 +37,6 @@
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
</record>
</data>
</openerp>
+2 -2
View File
@@ -56,15 +56,15 @@ class report_printscreen_list(report_int):
if not context:
context={}
datas['ids'] = ids
model = pool.get(datas['model'])
pool = pooler.get_pool(cr.dbname)
model = pool.get(datas['model'])
# title come from description of model which are specified in py file.
self.title = model._description
result = model.fields_view_get(cr, uid, view_type='form', context=context)
fields_order = self._parse_string(result['arch'])
rows = model.read(cr, uid, datas['ids'], result['fields'].keys() )
res = self._create_table(uid, datas['ids'], result['fields'], fields_order, rows, context, model._description)
self._create_table(uid, datas['ids'], result['fields'], fields_order, rows, context, model._description)
return (self.obj.get(), 'pdf')
-10
View File
@@ -231,16 +231,6 @@ class rml_parse(object):
self.lang_dict_called = False
for obj in self.objects:
obj._context['lang'] = lang
for table in obj._cache:
for id in obj._cache[table]:
self._lang_cache.setdefault(obj._context['lang'], {}).setdefault(table,
{}).update(obj._cache[table][id])
if lang in self._lang_cache \
and table in self._lang_cache[lang] \
and id in self._lang_cache[lang][table]:
obj._cache[table][id] = self._lang_cache[lang][table][id]
else:
obj._cache[table][id] = {'id': id}
def _get_lang_dict(self):
pool_lang = self.pool.get('res.lang')