diff --git a/bin/addons/base/base_data.xml b/bin/addons/base/base_data.xml
index 30b3464eb9a..e41fccfe682 100644
--- a/bin/addons/base/base_data.xml
+++ b/bin/addons/base/base_data.xml
@@ -1255,7 +1255,1393 @@
wy
+
+
+
+ Al Baḩr al Aḩmar
+ aba
+
+
+
+
+ Al Buhayrat
+ bu
+
+
+
+
+ Al Jazirah
+ aj
+
+
+
+
+ Al Khartum
+ ak
+
+
+
+
+ Al Qadarif
+ aq
+
+
+
+
+ Al Wahdah
+ aw
+
+
+
+
+ An Nil
+ an
+
+
+
+
+ An Nil al Abyad
+ ana
+
+
+
+
+ An Nil al Azraq
+ ana
+
+
+
+
+ Ash Shamaliyah
+ as
+
+
+
+
+ A ali an Nil
+ aan
+
+
+
+
+ Baḩr al Jabal
+ baj
+
+
+
+
+ Gharb al Istiwaiyah
+ gai
+
+
+
+
+ Gharb Bahr al Ghazal
+ gbg
+
+
+
+
+ Gharb Darfur
+ gd
+
+
+
+
+ Janub Darfur
+ jd
+
+
+
+
+ Janub Kurdufan
+ jk
+
+
+
+
+ Junqali
+ ju
+
+
+
+
+ Kassala
+ kas
+
+
+
+
+ Shamal Bahr al Ghazal
+ sbg
+
+
+
+
+ Shamal Darfur
+ sd
+
+
+
+
+ Shamal Kurdufan
+ sk
+
+
+
+
+ Sharq al Istiwaiyah
+ si
+
+
+
+
+ Sinnar
+ sn
+
+
+
+
+ Warab
+ war
+
+
+
+
+ Aimeliik
+ aim
+
+
+
+
+ Airai
+ air
+
+
+
+
+ Angaur
+ ang
+
+
+
+
+ Hatobohei
+ hat
+
+
+
+
+ Kayangel
+ kay
+
+
+
+
+ Koror
+ kor
+
+
+
+
+ Melekeok
+ mel
+
+
+
+
+ Ngaraard
+ ng
+
+
+
+
+ Ngarchelong
+ ngr
+
+
+
+
+ Ngardmau
+ ngr
+
+
+
+
+ Ngatpang
+ ngt
+
+
+
+
+ Ngchesar
+ ngc
+
+
+
+
+ Ngeremlengui
+ ngr
+
+
+
+
+ Ngiwal
+ ngi
+
+
+
+
+ Peleliu
+ pel
+
+
+
+
+ Sonsorol
+ son
+
+
+
+
+ Abia
+ ab
+
+
+
+
+ Adamawa
+ ad
+
+
+
+
+ Akwa Ibom
+ AK
+
+
+
+
+ Anambra
+ AN
+
+
+
+
+ Bauchi
+ BA
+
+
+
+
+ Bayelsa
+ BY
+
+
+
+
+ Benue
+ BE
+
+
+
+
+ Borno
+ BO
+
+
+
+
+ Cross River
+ CR
+
+
+
+
+ Delta
+ DE
+
+
+
+
+ Ebonyi
+ EB
+
+
+
+
+ Edo
+ ED
+
+
+
+
+ Ekiti
+ EK
+
+
+
+
+ Enugu
+ EN
+
+
+
+
+ Gombe
+ GO
+
+
+
+
+ Imo
+ IM
+
+
+
+
+ Jigawa
+ JI
+
+
+
+
+ Kaduna
+ KD
+
+
+
+
+ Kano
+ KN
+
+
+
+
+ Katsina
+ KT
+
+
+
+
+ Kebbi
+ KE
+
+
+
+
+ Kogi
+ KO
+
+
+
+
+ Kwara
+ KW
+
+
+
+
+ Lagos
+ LA
+
+
+
+
+ Nassarawa
+ NA
+
+
+
+
+ Niger
+ NI
+
+
+
+
+ Ogun
+ OG
+
+
+
+
+ Ondo
+ ON
+
+
+
+
+ Osun
+ OS
+
+
+
+
+ Oyo
+ OY
+
+
+
+
+ Plateau
+ PL
+
+
+
+
+ Rivers
+ RI
+
+
+
+
+ Sokoto
+ SO
+
+
+
+
+ Taraba
+ TA
+
+
+
+
+ Yobe
+ YO
+
+
+
+
+ Zamfara
+ ZA
+
+
+
+
+ Johor
+ jo
+
+
+
+
+ Kedah
+ ke
+
+
+
+
+ Kelantan
+ kel
+
+
+
+
+ Melaka
+ mel
+
+
+
+
+ Negeri Sembilan
+ ns
+
+
+
+
+ Pahang
+ pah
+
+
+
+
+ Perak
+ per
+
+
+
+
+ Perlis
+ per
+
+
+
+
+ Pulau Pinang
+ pp
+
+
+
+
+ Sabah
+ sab
+
+
+
+
+ Sarawak
+ sar
+
+
+
+
+ Selangor
+ sel
+
+
+
+
+ Terengganu
+ ter
+
+
+
+
+ Aguascalientes
+ AGU
+
+
+
+
+ Baja California
+ BCN
+
+
+
+
+ Baja California Sur
+ BCS
+
+
+
+
+ Campeche
+ CAM
+
+
+
+
+ Coahuila
+ COA
+
+
+
+
+ Colima
+ COL
+
+
+
+
+ Chiapas
+ CHP
+
+
+
+
+ Chihuahua
+ CHH
+
+
+
+
+ Durango
+ DUR
+
+
+
+
+ Guanajuato
+ GUA
+
+
+
+
+ Guerrero
+ GRO
+
+
+
+
+ Hidalgo
+ HID
+
+
+
+
+ Jalisco
+ JAL
+
+
+
+
+ México
+ MEX
+
+
+
+
+ Michoacán
+ MIC
+
+
+
+
+ Morelos
+ MOR
+
+
+
+
+ Nayarit
+ NAY
+
+
+
+
+ Nuevo León
+ NLE
+
+
+
+
+ Oaxaca
+ OAX
+
+
+
+
+ Puebla
+ PUE
+
+
+
+
+ Querétaro
+ QUE
+
+
+
+
+ Quintana Roo
+ ROO
+
+
+
+
+ San Luis Potosí
+ SLP
+
+
+
+
+ Sinaloa
+ SIN
+
+
+
+
+ Sonora
+ SON
+
+
+
+
+ Tabasco
+ TAB
+
+
+
+
+ Tamaulipas
+ TAM
+
+
+
+
+ Tlaxcala
+ TLA
+
+
+
+
+ Veracruz
+ VER
+
+
+
+
+ Yucatán
+ YUC
+
+
+
+
+ Zacatecas
+ ZAC
+
+
+
+
+
+
+ Chin
+ ch
+
+
+
+
+ Kachin
+ kc
+
+
+
+
+ Kayah
+ kh
+
+
+
+
+ Kayin
+ ky
+
+
+
+
+ Mon
+ mon
+
+
+
+
+ Rakhine
+ rk
+
+
+
+
+ Shan
+ sh
+
+
+
+
+
+ Saint Kitts
+ SK
+
+
+
+
+ Nevis
+ NE
+
+
+
+
+
+ Andhra Pradesh
+ AP
+
+
+
+
+ Arunachal Pradesh
+ AR
+
+
+
+
+ Assam
+ AS
+
+
+
+
+ Bihar
+ BR
+
+
+
+
+ Chhattasgarh
+ CT
+
+
+
+
+ Goa
+ GA
+
+
+
+
+ Gujarat
+ GJ
+
+
+
+
+ Haryana
+ HR
+
+
+
+
+ Himachal Pradesh
+ HP
+
+
+
+
+ Jammu and Kashmir
+ JK
+
+
+
+
+ Jharkhand
+ JH
+
+
+
+
+ Karnataka
+ KA
+
+
+
+
+ Kerala
+ KL
+
+
+
+
+ Madhya Pradesh
+ MP
+
+
+
+
+ Maharashtra
+ MH
+
+
+
+
+ Manipur
+ MN
+
+
+
+
+ Meghalaya
+ ML
+
+
+
+
+ Mizoram
+ MZ
+
+
+
+
+ Nagaland
+ NL
+
+
+
+
+ Orissa
+ OR
+
+
+
+
+ Punjab
+ PB
+
+
+
+
+ Rajasthan
+ RJ
+
+
+
+
+ Sikkim
+ SK
+
+
+
+
+ Tamilnadu
+ TN
+
+
+
+
+ Tripura
+ TR
+
+
+
+
+ Uttaranchal
+ UL
+
+
+
+
+ Uttar Pradesh
+ UP
+
+
+
+
+ West Bengal
+ WB
+
+
+
+
+
+
+ Chuuk
+ TRK
+
+
+
+
+ Kosrae
+ KSA
+
+
+
+
+ Pohnpei
+ PNI
+
+
+
+
+ Yap
+ YAP
+
+
+
+
+
+ Āfar
+ AF
+
+
+
+
+ Āmara
+ AM
+
+
+
+
+ Bīnshangul Gumuz
+ BE
+
+
+
+
+ Gambēla Hizboch
+ GA
+
+
+
+
+ Hārerī Hizb
+ HA
+
+
+
+
+ Oromīya
+ OR
+
+
+
+
+ Sumalē
+ SO
+
+
+
+
+ Tigray
+ TI
+
+
+
+
+ YeDebub Bihēroch Bihēreseboch na Hizboch
+ SN
+
+
+
+
+
+ Baden-Württemberg
+ BW
+
+
+
+
+ Bayern
+ BY
+
+
+
+
+ Bremen
+ HB
+
+
+
+
+ Hamburg
+ HH
+
+
+
+
+ Hessen
+ HE
+
+
+
+
+ Niedersachsen
+ NI
+
+
+
+
+ Nordrhein-Westfalen
+ NW
+
+
+
+
+ Rheinland-Pfalz
+ RP
+
+
+
+
+ Saarland
+ SL
+
+
+
+
+ Schleswig-Holstein
+ SH
+
+
+
+
+ Berlin
+ BE
+
+
+
+
+ Brandenburg
+ BB
+
+
+
+
+ Mecklenburg-Vorpommern
+ MV
+
+
+
+
+ Sachsen
+ SN
+
+
+
+
+ Sachsen-Anhalt
+ ST
+
+
+
+
+ Thüringen
+ TH
+
+
+
+
+
+ Acre
+ AC
+
+
+
+
+ Alagoas
+ AL
+
+
+
+
+ Amazonas
+ AM
+
+
+
+
+ Amapá
+ AP
+
+
+
+
+ Bahia
+ BA
+
+
+
+
+ Ceará
+ CE
+
+
+
+
+ Espírito Santo
+ ES
+
+
+
+
+ Fernando de Noronha
+ FN
+
+
+
+
+ Goiás
+ GO
+
+
+
+
+ Maranhão
+ MA
+
+
+
+
+ Minas Gerais
+ MG
+
+
+
+
+ Mato Grosso do Sul
+ MS
+
+
+
+
+ Mato Grosso
+ MT
+
+
+
+
+ Pará
+ PA
+
+
+
+
+ Paraíba
+ PB
+
+
+
+
+ Pernambuco
+ PE
+
+
+
+
+ Piauí
+ PI
+
+
+
+
+ Paraná
+ PR
+
+
+
+
+ Rio de Janeiro
+ RJ
+
+
+
+
+ Rio Grande do Norte
+ RN
+
+
+
+
+ Rondonia
+ RO
+
+
+
+
+ Roraima
+ RR
+
+
+
+
+ Rio Grande do Sul
+ RS
+
+
+
+
+ Santa Catarina
+ SC
+
+
+
+
+ Sergipe
+ SE
+
+
+
+
+ Sao Paulo
+ SP
+
+
+
+
+ Tocantins
+ TO
+
+
+
+ Burgenland
+ bl
+
+
+
+
+ Karnten
+ ka
+
+
+
+
+ Niederosterreich
+ ni
+
+
+
+
+ Oberosterreich
+ ob
+
+
+
+
+ Salzburg
+ sa
+
+
+
+
+ Steiermark
+ st
+
+
+
+
+ Tirol
+ ti
+
+
+
+
+ Vorarlberg
+ vb
+
+
+
+
+ Wien
+ wi
+
+
+
+
+ New South Wales
+ NSW
+
+
+
+
+ Queensland
+ QLD
+
+
+
+
+ South Australia
+ SA
+
+
+
+
+ Tasmania
+ TAS
+
+
+
+
+ Victoria
+ VIC
+
+
+
+
+ Western Australia
+ WA
+
+
+
+
+
Tiny sprl
diff --git a/bin/addons/base/i18n/fr_FR.po b/bin/addons/base/i18n/fr_FR.po
index 9c901466073..16e0647c81c 100644
--- a/bin/addons/base/i18n/fr_FR.po
+++ b/bin/addons/base/i18n/fr_FR.po
@@ -137,7 +137,7 @@ msgstr "Vous ne pouvez pas créer ce type de document! (%s)"
#. module: base
#: wizard_field:module.lang.import,init,code:0
msgid "Code (eg:en__US)"
-msgstr "Code (ex:fr_FR)"
+msgstr "Code (ex:fr__FR)"
#. module: base
#: field:res.roles,parent_id:0
diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py
index 32519086e77..a6767cd6c52 100644
--- a/bin/addons/base/module/module.py
+++ b/bin/addons/base/module/module.py
@@ -37,6 +37,7 @@ import netsvc
from tools.parse_version import parse_version
+
class module_repository(osv.osv):
_name = "ir.module.repository"
_description = "Module Repository"
@@ -208,7 +209,7 @@ class module(osv.osv):
_('You try to remove a module that is installed or will be installed'))
return super(module, self).unlink(cr, uid, ids, context=context)
- def state_update(self, cr, uid, ids, newstate, states_to_update, context={}, level=50):
+ def state_update(self, cr, uid, ids, newstate, states_to_update, context={}, level=100):
if level<1:
raise orm.except_orm(_('Error'), _('Recursion error in modules dependencies !'))
demo = False
diff --git a/bin/addons/base/security/ir.model.access.csv b/bin/addons/base/security/ir.model.access.csv
index d70a91201b9..41710001246 100644
--- a/bin/addons/base/security/ir.model.access.csv
+++ b/bin/addons/base/security/ir.model.access.csv
@@ -39,7 +39,8 @@
"access_ir_ui_view_custom_group_user","ir_ui_view_custom_group_user","model_ir_ui_view_custom",,1,0,0,0
"access_ir_ui_view_custom_group_system","ir_ui_view_custom_group_system","model_ir_ui_view_custom","group_system",1,1,1,1
"access_ir_ui_view_sc_group_user","ir_ui_view_sc group_user","model_ir_ui_view_sc",,1,1,1,1
-"access_ir_values_group_erp_manager","ir_values group_erp_manager","model_ir_values",,1,1,1,1
+"access_ir_values_group_erp_manager","ir_values group_erp_manager","model_ir_values",group_erp_manager,1,1,1,1
+"access_ir_values_group_all","ir_values group_all","model_ir_values",,1,0,0,0
"access_wizard_ir_model_menu_create_group_system","wizard_ir_model_menu_create group_system","model_wizard_ir_model_menu_create","group_system",1,1,1,1
"access_wizard_ir_model_menu_create_line_group_system","wizard_ir_model_menu_create_line group_system","model_wizard_ir_model_menu_create_line","group_system",1,1,1,1
"access_wizard_module_lang_export_group_system","wizard_module_lang_export group_system","model_wizard_module_lang_export","group_system",1,1,1,1
diff --git a/bin/osv/fields.py b/bin/osv/fields.py
index 51112a10048..e8c0c3b1ede 100644
--- a/bin/osv/fields.py
+++ b/bin/osv/fields.py
@@ -597,6 +597,9 @@ class function(_column):
self._type = type
self._fnct_search = fnct_search
self.store = store
+ if store:
+ self._classic_read = True
+ self._classic_write = True
if type == 'float':
self._symbol_c = '%f'
self._symbol_f = lambda x: __builtin__.float(x or 0.0)
diff --git a/bin/osv/orm.py b/bin/osv/orm.py
index 8a883729e79..c9c813da720 100644
--- a/bin/osv/orm.py
+++ b/bin/osv/orm.py
@@ -1433,6 +1433,7 @@ class orm(orm_template):
cr.execute("ALTER TABLE \"%s\" ALTER COLUMN \"%s\" DROP NOT NULL" % (self._table, column['attname']))
# iterate on the "object columns"
+ todo_update_store = []
for k in self._columns:
if k in ('id', 'write_uid', 'write_date', 'create_uid', 'create_date'):
continue
@@ -1474,20 +1475,9 @@ class orm(orm_template):
cr.execute("UPDATE \"%s\" SET \"%s\"=NULL" % (self._table, k))
else:
cr.execute("UPDATE \"%s\" SET \"%s\"='%s'" % (self._table, k, default))
+
if isinstance(f, fields.function):
- cr.execute('select id from '+self._table)
- ids_lst = map(lambda x: x[0], cr.fetchall())
- while ids_lst:
- iids = ids_lst[:40]
- ids_lst = ids_lst[40:]
- res = f.get(cr, self, iids, k, 1, {})
- for key,val in res.items():
- if f._multi:
- val = val[k]
- if (val<>False) or (type(val)<>bool):
- cr.execute("UPDATE \"%s\" SET \"%s\"='%s' where id=%d"% (self._table, k, val, key))
- #else:
- # cr.execute("UPDATE \"%s\" SET \"%s\"=NULL where id=%d"% (self._table, k, key))
+ todo_update_store.append((f,k))
# and add constraints if needed
if isinstance(f, fields.many2one):
@@ -1601,6 +1591,21 @@ class orm(orm_template):
cr.commit()
else:
print "ERROR"
+ for f,k in todo_update_store:
+ cr.execute('select id from '+self._table)
+ ids_lst = map(lambda x: x[0], cr.fetchall())
+ while ids_lst:
+ iids = ids_lst[:40]
+ ids_lst = ids_lst[40:]
+ res = f.get(cr, self, iids, k, 1, {})
+ for key,val in res.items():
+ if f._multi:
+ val = val[k]
+ if (val<>False) or (type(val)<>bool):
+ cr.execute("UPDATE \"%s\" SET \"%s\"='%s' where id=%d"% (self._table, k, val, key))
+ #else:
+ # cr.execute("UPDATE \"%s\" SET \"%s\"=NULL where id=%d"% (self._table, k, key))
+
else:
cr.execute("SELECT relname FROM pg_class WHERE relkind in ('r','v') AND relname='%s'" % self._table)
create = not bool(cr.fetchone())
@@ -1627,29 +1632,33 @@ class orm(orm_template):
def __init__(self, cr):
super(orm, self).__init__(cr)
self._columns = self._columns.copy()
- f = filter(lambda a: isinstance(self._columns[a], fields.function) and self._columns[a].store, self._columns)
- if f:
- list_store = []
- tuple_store = ()
- tuple_fn = ()
- for store_field in f:
- if not self._columns[store_field].store == True:
- dict_store = self._columns[store_field].store
- key = dict_store.keys()
- list_data = []
- for i in key:
- tuple_store = self._name, store_field, self._columns[store_field]._fnct.__name__, tuple(dict_store[i][0]), dict_store[i][1], i
- list_data.append(tuple_store)
- #tuple_store=self._name,store_field,self._columns[store_field]._fnct.__name__,tuple(dict_store[key[0]][0]),dict_store[key[0]][1]
- for l in list_data:
- list_store = []
- if l[5] in self.pool._store_function.keys():
- self.pool._store_function[l[5]].append(l)
- temp_list = list(set(self.pool._store_function[l[5]]))
- self.pool._store_function[l[5]] = temp_list
- else:
- list_store.append(l)
- self.pool._store_function[l[5]] = list_store
+ for store_field in self._columns:
+ f = self._columns[store_field]
+ if not isinstance(f, fields.function):
+ continue
+ if not f.store:
+ continue
+ if self._columns[store_field].store is True:
+ sm = {self._name:(lambda self,cr, uid, ids, c={}: ids, None)}
+ else:
+ sm = self._columns[store_field].store
+ for object, aa in sm.items():
+ if len(aa)==2:
+ (fnct,fields2)=aa
+ order = 1
+ elif len(aa)==3:
+ (fnct,fields2,order)=aa
+ else:
+ raise except_orm(_('Error'),
+ _('Invalid function definition %s in object %s !' % (store_field, self._name)))
+ self.pool._store_function.setdefault(object, [])
+ ok = True
+ for x,y,z,e,f in self.pool._store_function[object]:
+ if (x==self._name) and (y==store_field) and (e==fields2):
+ ok = False
+ if ok:
+ self.pool._store_function[object].append( (self._name, store_field, fnct, fields2, order))
+ self.pool._store_function[object].sort(lambda x,y: cmp(x[4],y[4]))
for (key, _, msg) in self._sql_constraints:
self.pool._sql_error[self._table+'_'+key] = msg
@@ -1978,15 +1987,10 @@ class orm(orm_template):
ids = [ids]
fn_list = []
- if self._name in self.pool._store_function.keys():
- list_store = self.pool._store_function[self._name]
- fn_data = ()
- id_change = []
- for tuple_fn in list_store:
- for id in ids:
- id_change.append(self._store_get_ids(cr, uid, id, tuple_fn, context)[0])
- fn_data = id_change, tuple_fn
- fn_list.append(fn_data)
+ for fnct in self.pool._store_function.get(self._name, []):
+ ids2 = filter(None, fnct[2](self,cr, uid, ids, context))
+ if ids2:
+ fn_list.append( (fnct[0], fnct[1], ids2) )
delta = context.get('read_delta', False)
if delta and self._log_access:
@@ -2033,10 +2037,11 @@ class orm(orm_template):
else:
cr.execute('delete from "'+self._table+'" ' \
'where id in ('+str_d+')', sub_ids)
- if fn_list:
- for ids, tuple_fn in fn_list:
- self._store_set_values(cr, uid, ids, tuple_fn, id_change, context)
+ for object,field,ids in fn_list:
+ ids = self.pool.get(object).search(cr, uid, [('id','in', ids)], context=context)
+ if ids:
+ self.pool.get(object)._store_set_values(cr, uid, ids, field, context)
return True
#
@@ -2247,22 +2252,17 @@ class orm(orm_template):
wf_service = netsvc.LocalService("workflow")
for id in ids:
wf_service.trg_write(user, self._name, id, cr)
- self._update_function_stored(cr, user, ids, context=context)
-
- if self._name in self.pool._store_function.keys():
- list_store = self.pool._store_function[self._name]
- for tuple_fn in list_store:
- flag = False
- if not tuple_fn[3]:
- flag = True
- for field in tuple_fn[3]:
- if field in vals.keys():
- flag = True
- break
- if flag:
- id_change = self._store_get_ids(cr, user, ids[0], tuple_fn, context)
- self._store_set_values(cr, user, ids[0], tuple_fn, id_change, context)
+ for fnct in self.pool._store_function.get(self._name, []):
+ ok = False
+ for key in vals.keys():
+ if (not fnct[3]) or (key in fnct[3]):
+ ok = True
+ if ok:
+ ids2 = fnct[2](self,cr, user, ids, context)
+ ids2 = filter(None, ids2)
+ if ids2:
+ self.pool.get(fnct[0])._store_set_values(cr, user, ids2, fnct[1], context)
return True
#
@@ -2369,54 +2369,32 @@ class orm(orm_template):
wf_service = netsvc.LocalService("workflow")
wf_service.trg_create(user, self._name, id_new, cr)
- self._update_function_stored(cr, user, [id_new], context=context)
- if self._name in self.pool._store_function.keys():
- list_store = self.pool._store_function[self._name]
- for tuple_fn in list_store:
- id_change = self._store_get_ids(cr, user, id_new, tuple_fn, context)
- self._store_set_values(cr, user, id_new, tuple_fn, id_change, context)
+ for fnct in self.pool._store_function.get(self._name, []):
+ ids2 = fnct[2](self,cr, user, [id_new], context)
+ ids2 = filter(None, ids2)
+ if ids2:
+ self.pool.get(fnct[0])._store_set_values(cr, user, ids2, fnct[1], context)
return id_new
- def _store_get_ids(self, cr, uid, ids, tuple_fn, context):
- parent_id = getattr(self.pool.get(tuple_fn[0]), tuple_fn[4].func_name)(cr, uid, [ids])
- return parent_id
-
- def _store_set_values(self, cr, uid, ids, tuple_fn, parent_id, context):
- name = tuple_fn[1]
- table = tuple_fn[0]
+ def _store_set_values(self, cr, uid, ids, field, context):
args = {}
- vals_tot = getattr(self.pool.get(table), tuple_fn[2])(cr, uid, parent_id, name, args, context)
- write_dict = {}
- for id in vals_tot.keys():
- write_dict[name] = vals_tot[id]
- self.pool.get(table).write(cr, uid, [id], write_dict)
- return True
-
- def _update_function_stored(self, cr, user, ids, context=None):
- if not context:
- context = {}
- f = filter(lambda a: isinstance(self._columns[a], fields.function) \
- and self._columns[a].store, self._columns)
- if f:
- result = self.read(cr, user, ids, fields=f, context=context)
- for res in result:
- upd0 = []
- upd1 = []
- for field in res:
- if field not in f:
- continue
- value = res[field]
- if self._columns[field]._type in ('many2one', 'one2one'):
- try:
- value = res[field][0]
- except:
- value = res[field]
- upd0.append('"'+field+'"='+self._columns[field]._symbol_set[0])
- upd1.append(self._columns[field]._symbol_set[1](value))
- upd1.append(res['id'])
- cr.execute('update "' + self._table + '" set ' + \
- string.join(upd0, ',') + ' where id = %d', upd1)
+ result = self._columns[field].get(cr, self, ids, field, uid, context=context)
+ for id,value in result.items():
+ upd0 = []
+ upd1 = []
+ if self._columns[field]._multi:
+ value = value[field]
+ if self._columns[field]._type in ('many2one', 'one2one'):
+ try:
+ value = value[0]
+ except:
+ pass
+ upd0.append('"'+field+'"='+self._columns[field]._symbol_set[0])
+ upd1.append(self._columns[field]._symbol_set[1](value))
+ upd1.append(id)
+ cr.execute('update "' + self._table + '" set ' + \
+ string.join(upd0, ',') + ' where id = %d', upd1)
return True
#
diff --git a/bin/service/web_services.py b/bin/service/web_services.py
index e99a7aa8ec3..69d8015f241 100644
--- a/bin/service/web_services.py
+++ b/bin/service/web_services.py
@@ -67,6 +67,7 @@ class db(netsvc.Service):
db = sql_db.db_connect('template1', serialize=1)
db.truedb.autocommit()
cr = db.cursor()
+ time.sleep(0.2)
cr.execute('CREATE DATABASE ' + db_name + ' ENCODING \'unicode\'')
cr.close()
class DBInitialize(object):