merging from the trunk
bzr revid: mga@tinyerp.com-20081121122253-2kkyy8r74wokwd32
This commit is contained in:
+14
-11
@@ -152,12 +152,15 @@ def get_module_resource(module, *args):
|
||||
def get_modules():
|
||||
"""Returns the list of module names
|
||||
"""
|
||||
def listdir(dir):
|
||||
def clean(name):
|
||||
name = os.path.basename(name)
|
||||
if name[-4:] == '.zip':
|
||||
name = name[:-4]
|
||||
return name
|
||||
return map(clean, os.listdir(dir))
|
||||
|
||||
module_list = os.listdir(ad)
|
||||
module_names = [os.path.basename(m) for m in module_list]
|
||||
module_list += [m for m in os.listdir(_ad) if m not in module_names]
|
||||
|
||||
return module_list
|
||||
return list(set(listdir(ad) + listdir(_ad)))
|
||||
|
||||
def create_graph(module_list, force=None):
|
||||
if not force:
|
||||
@@ -166,8 +169,6 @@ def create_graph(module_list, force=None):
|
||||
packages = []
|
||||
|
||||
for module in module_list:
|
||||
if module[-4:]=='.zip':
|
||||
module = module[:-4]
|
||||
try:
|
||||
mod_path = get_module_path(module)
|
||||
if not mod_path:
|
||||
@@ -184,8 +185,9 @@ def create_graph(module_list, force=None):
|
||||
raise
|
||||
if info.get('installable', True):
|
||||
packages.append((module, info.get('depends', []), info))
|
||||
|
||||
current,later = Set([p for p, dep, data in packages]), Set()
|
||||
|
||||
dependencies = dict([(p, deps) for p, deps, data in packages])
|
||||
current, later = Set([p for p, dep, data in packages]), Set()
|
||||
while packages and current > later:
|
||||
package, deps, datas = packages[0]
|
||||
|
||||
@@ -206,9 +208,10 @@ def create_graph(module_list, force=None):
|
||||
later.add(package)
|
||||
packages.append((package, deps, datas))
|
||||
packages.pop(0)
|
||||
|
||||
|
||||
for package in later:
|
||||
logger.notifyChannel('init', netsvc.LOG_ERROR, 'addon:%s:Unmet dependency' % package)
|
||||
unmet_deps = filter(lambda p: p not in graph, dependencies[package])
|
||||
logger.notifyChannel('init', netsvc.LOG_ERROR, 'addon:%s:Unmet dependencies: %s' % (package, ', '.join(unmet_deps)))
|
||||
|
||||
return graph
|
||||
|
||||
|
||||
@@ -220,10 +220,15 @@
|
||||
<field name="name">Costa Rica</field>
|
||||
<field name="code">cr</field>
|
||||
</record>
|
||||
<record id="cs" model="res.country">
|
||||
<field name="name">Serbia and Montenegro</field>
|
||||
<field name="code">cs</field>
|
||||
<record id="rs" model="res.country">
|
||||
<field name="name">Serbia</field>
|
||||
<field name="code">rs</field>
|
||||
</record>
|
||||
<record id="me" model="res.country">
|
||||
<field name="name">Montenegro</field>
|
||||
<field name="code">me</field>
|
||||
</record>
|
||||
|
||||
<record id="cu" model="res.country">
|
||||
<field name="name">Cuba</field>
|
||||
<field name="code">cu</field>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P6">[[ module.description ]]</para>
|
||||
<para style="P6">[[ format(module.description or '') ]]</para>
|
||||
<section>
|
||||
<para style="Standard">[[ repeatIn(findobj(module.name) ,'object') ]]</para>
|
||||
<blockTable colWidths="510.0" repeatRows="1" style="Tableau3">
|
||||
@@ -144,14 +144,14 @@
|
||||
<td>
|
||||
<para style="P10">Object: [[ object.model ]]</para>
|
||||
<para style="P11">Description : [[ object.name ]]</para>
|
||||
<para style="P5">[[ objdoc(object.model) ]]</para>
|
||||
<para style="P5">[[ format(objdoc(object.model)) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="113.0,397.0" repeatRows="1" style="Tableau4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P7">[[ repeatIn(findflds(object.model), 'field') ]] [[ field[0] ]]</para>
|
||||
<para style="P7">[[ repeatIn(findflds(object.model), 'field') ]] <i>[[ field[0] ]]</i></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ field[1].get('string', 'Unknown') ]], [[ field[1]['type'] ]] [[field[1].get('required',False) and ', required']] [[field[1].get('readonly',False) and ', readonly']] </para>
|
||||
|
||||
@@ -37,12 +37,11 @@ class ir_module_reference_print(report_sxw.rml_parse):
|
||||
return modobj.__doc__
|
||||
|
||||
def _object_find(self, module):
|
||||
ids2 = self.pool.get('ir.model.data').search(self.cr, self.uid, [('module','=',module), ('model','=','ir.model')])
|
||||
ids = []
|
||||
for mod in self.pool.get('ir.model.data').browse(self.cr, self.uid, ids2):
|
||||
ids.append(mod.res_id)
|
||||
modobj = self.pool.get('ir.model')
|
||||
if module=='base':
|
||||
ids = modobj.search(self.cr, self.uid, [('model','=like','res%')])
|
||||
ids += modobj.search(self.cr, self.uid, [('model','=like','ir%')])
|
||||
else:
|
||||
ids = modobj.search(self.cr, self.uid, [('model','=like',module+'%')])
|
||||
return modobj.browse(self.cr, self.uid, ids)
|
||||
|
||||
def _fields_find(self, obj):
|
||||
|
||||
@@ -34,8 +34,10 @@ view_form="""<?xml version="1.0"?>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="data" colspan="3"/>
|
||||
<label string="You have to import a .CSV file wich is encoded in UTF-8.\nPlease check that the first line of your file is:" colspan="4" align="0.0"/>
|
||||
<label string="You have to import a .CSV file wich is encoded in UTF-8.\n
|
||||
Please check that the first line of your file is:" colspan="4" align="0.0"/>
|
||||
<label string="type,name,res_id,src,value" colspan="4"/>
|
||||
<label string="You can also import .po files." colspan="4" align="0.0"/>
|
||||
</group>
|
||||
</form>"""
|
||||
|
||||
|
||||
@@ -14,19 +14,21 @@
|
||||
|
||||
<xsl:template name="stylesheet">
|
||||
<paraStyle name="title" fontName="Helvetica-Bold" fontSize="22" alignment="center"/>
|
||||
|
||||
|
||||
<blockTableStyle id="products">
|
||||
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
|
||||
<!--<blockBackground colorName="grey" start="0,0" stop="-1,0"/> -->
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
|
||||
<!-- <lineStyle kind="GRID" colorName="black"/> -->
|
||||
</blockTableStyle>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="story">
|
||||
<xsl:apply-templates select="report"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="report">
|
||||
<xsl:apply-templates select="config"/>
|
||||
<!--<setNextTemplate name="other_pages"/>-->
|
||||
@@ -36,7 +38,7 @@
|
||||
<xsl:value-of select="./config/tableSize"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
|
||||
|
||||
<xsl:apply-templates select="header"/>
|
||||
<xsl:apply-templates select="lines"/>
|
||||
</blockTable>
|
||||
@@ -53,8 +55,8 @@
|
||||
<tr>
|
||||
<xsl:for-each select="field">
|
||||
<td>
|
||||
<para>
|
||||
<xsl:value-of select="."/>
|
||||
<para><font fontName="Helvetica-Bold" fontSize="9">
|
||||
<xsl:value-of select="."/></font>
|
||||
</para>
|
||||
</td>
|
||||
</xsl:for-each>
|
||||
@@ -79,12 +81,16 @@
|
||||
<xsl:when test="@tree='yes'">
|
||||
<para>
|
||||
<xsl:attribute name="leftIndent"><xsl:value-of select="@space"/></xsl:attribute>
|
||||
<font fontName="Helvetica" fontSize="9">
|
||||
<xsl:value-of select="."/>
|
||||
</font>
|
||||
</para>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<para>
|
||||
<font fontName="Helvetica" fontSize="9">
|
||||
<xsl:value-of select="."/>
|
||||
</font>
|
||||
</para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
@@ -96,7 +96,7 @@ class users(osv.osv):
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True, select=True),
|
||||
'login': fields.char('Login', size=64, required=True),
|
||||
'password': fields.char('Password', size=64, invisible=True),
|
||||
'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."),
|
||||
'signature': fields.text('Signature', size=64),
|
||||
'address_id': fields.many2one('res.partner.address', 'Address'),
|
||||
'active': fields.boolean('Active'),
|
||||
@@ -138,6 +138,10 @@ class users(osv.osv):
|
||||
ids = self.pool.get('ir.actions.act_window').search(cr, uid, [('usage','=','menu')])
|
||||
return ids and ids[0] or False
|
||||
|
||||
def _get_group(self,cr, uid, context={}):
|
||||
ids = self.pool.get('res.groups').search(cr, uid, [('name','=','Employee')])
|
||||
return ids or False
|
||||
|
||||
_defaults = {
|
||||
'password' : lambda obj,cr,uid,context={} : '',
|
||||
'context_lang': lambda *args: 'en_US',
|
||||
@@ -145,6 +149,7 @@ class users(osv.osv):
|
||||
'menu_id': _get_menu,
|
||||
'action_id': _get_menu,
|
||||
'company_id': _get_company,
|
||||
'groups_id': _get_group,
|
||||
}
|
||||
def company_get(self, cr, uid, uid2):
|
||||
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
|
||||
|
||||
@@ -385,7 +385,7 @@ class rml_parse(object):
|
||||
def _eval(self, expr):
|
||||
try:
|
||||
res = eval(expr, self.localcontext)
|
||||
if not res:
|
||||
if (res is None) or (res=='') or (res is False):
|
||||
res = ''
|
||||
except Exception,e:
|
||||
import traceback, sys
|
||||
|
||||
+10
-2
@@ -1,7 +1,7 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# $Id$
|
||||
#
|
||||
@@ -375,6 +375,14 @@ form: module.record_id""" % (xml_id,)
|
||||
and rec.getAttribute('auto_refresh').encode('utf-8')
|
||||
# groups_id = rec.hasAttribute('groups') and rec.getAttribute('groups').encode('utf-8')
|
||||
|
||||
# def ref() added because , if context has ref('id') eval wil use this ref
|
||||
|
||||
active_id=str("active_id") # for further reference in client/bin/tools/__init__.py
|
||||
|
||||
def ref(str_id):
|
||||
return self.id_get(cr, None, str_id)
|
||||
context=eval(context)
|
||||
|
||||
res = {
|
||||
'name': name,
|
||||
'type': type,
|
||||
@@ -582,7 +590,7 @@ form: module.record_id""" % (xml_id,)
|
||||
rec_src = rec.getAttribute("search").encode('utf8')
|
||||
rec_src_count = rec.getAttribute("count")
|
||||
|
||||
severity = rec.getAttribute("severity").encode('ascii') or netsvc.LOG_ERROR
|
||||
severity = rec.getAttribute("severity").encode('ascii') or netsvc.LOG_ERROR
|
||||
|
||||
rec_string = rec.getAttribute("string").encode('utf8') or 'unknown'
|
||||
|
||||
|
||||
@@ -659,6 +659,7 @@ def get_languages():
|
||||
'ro_RO': 'Romanian',
|
||||
'ru_RU': 'Russian',
|
||||
'sv_SE': 'Swedish',
|
||||
'ca_ES': 'Català',
|
||||
}
|
||||
return languages
|
||||
|
||||
|
||||
Reference in New Issue
Block a user