solve partially problem of menu items (migration)[cls]

module reference: add header in rml

bzr revid: nel@tinyerp.com-20081230130829-y35p0e90k39m6y12
This commit is contained in:
Najlaâ EL KHAYAT 2008-12-30 14:08:29 +01:00
parent 356bd16a14
commit 870fc3bab5
5 changed files with 18 additions and 6424 deletions

1
.bzrignore Normal file
View File

@ -0,0 +1 @@
st

View File

@ -595,10 +595,10 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
cr.commit()
if update_module:
cr.execute("select id,name from ir_module_module where state in ('to remove')")
cr.execute("select id,name from ir_module_module where state=%s", ('to remove',))
for mod_id, mod_name in cr.fetchall():
pool = pooler.get_pool(cr.dbname)
cr.execute('select model,res_id from ir_model_data where not noupdate and module=%s order by id desc', (mod_name,))
cr.execute('select model,res_id from ir_model_data where noupdate=%s and module=%s order by id desc', (False, mod_name,))
for rmod,rid in cr.fetchall():
uid = 1
pool.get(rmod).unlink(cr, uid, [rid])
@ -615,6 +615,7 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
(id not in (select res_id from ir_values where model='ir.ui.menu'))
and
(id not in (select res_id from ir_model_data where model='ir.ui.menu'))''')
cr.commit()
if not cr.rowcount:
break
else:

File diff suppressed because it is too large Load Diff

View File

@ -545,8 +545,9 @@ class ir_model_data(osv.osv):
def _process_end(self, cr, uid, modules):
if not modules:
return True
module_str = ["'%s'" % m for m in modules]
cr.execute('select id,name,model,res_id,module from ir_model_data where module in ('+','.join(module_str)+') and not noupdate')
modules = list(modules)
module_in = "%s" * len(modules)
cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False])
wkf_todo = []
for (id, name, model, res_id,module) in cr.fetchall():
if (module,name) not in self.loads:

View File

@ -3,16 +3,17 @@
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="42.0" y1="42.0" width="511" height="758"/>
<header>
<pageGraphics>
<setFont name="Helvetica-Bold" size="9"/>
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm"> Reference Guide </drawRightString>
<lineMode width="0.7"/>
<stroke color="black"/>
<lines>1cm 28cm 20cm 28cm</lines>
</pageGraphics>
</header>
<header>
<pageGraphics>
<setFont name="Helvetica-Bold" size="9"/>
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm"> Reference Guide </drawRightString>
<lineMode width="0.7"/>
<stroke color="black"/>
<lines>1cm 28cm 20cm 28cm</lines>
</pageGraphics>
</header>
</pageTemplate>
</template>
<stylesheet>