Merge origin/5.0.4 into xrg

Conflicts:
	bin/addons/base/i18n/base.pot

bzr revid: p_christ@hol.gr-20090828180203-xbavbj02nas6f0qy
This commit is contained in:
P. Christeas 2009-08-28 21:02:03 +03:00
commit 6e6329bb7d
46 changed files with 26956 additions and 9546 deletions

View File

@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: OpenERP
Version: 5.0.3
Version: 5.0.4
Author: Tiny.be
Author-email: fp at tiny be
Maintainer: Tiny.be

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1040,8 +1040,8 @@
<page string="Technical Data" groups="base.group_extended">
<separator string="Action to Trigger" colspan="4"/>
<field name="model" groups="base.group_extended"/>
<field name="function" readonly="base.group_extended"/>
<field colspan="4" name="args" readonly="base.group_extended"/>
<field name="function"/>
<field colspan="4" name="args"/>
</page>
</notebook>
</form>

View File

@ -17,11 +17,11 @@
<fill color="black"/>
<stroke color="black"/>
<drawString x="1cm" y="27.6cm"><xsl:value-of select="//corporate-header/corporation/name"/></drawString>
<lines>1cm 25.4cm 20cm 25.4cm</lines>
<!-- <lines>1cm 25.7cm 7cm 25.7cm</lines>-->
<lines>1cm 28.4cm 20cm 28.4cm</lines>
<lines>1cm 25.4cm 7cm 25.4cm</lines>
<setFont name="Helvetica" size="10"/>
<drawRightString x="1cm" y="27.5cm"><xsl:value-of select="//corporate-header/corporation/rml_header1"/></drawRightString>
<drawRightString x="20cm" y="28.5cm"><xsl:value-of select="//corporate-header/corporation/rml_header1"/></drawRightString>
<drawString x="1cm" y="27cm"><xsl:value-of select="//corporate-header/corporation/address/street"/></drawString>
<drawString x="1cm" y="26.5cm">
<xsl:value-of select="//corporate-header/corporation/address/zip"/>
@ -34,17 +34,17 @@
<drawRightString x="7cm" y="26cm"><xsl:value-of select="//corporate-header/corporation/address/phone"/></drawRightString>
<drawString x="1cm" y="25.5cm">Mail:</drawString>
<drawRightString x="7cm" y="25.5cm"><xsl:value-of select="//corporate-header/corporation/address/email"/></drawRightString>
<!--page bottom-->
<lines>1.5cm 1.2cm 19.9cm 1.2cm</lines>
<lines>1.5cm 2.2cm 19.9cm 2.2cm</lines>
<drawCentredString x="10.5cm" y="1.7cm"><xsl:value-of select="//corporate-header/corporation/rml_footer1"/></drawCentredString>
<drawCentredString x="10.5cm" y="1.25cm"><xsl:value-of select="//corporate-header/corporation/rml_footer2"/></drawCentredString>
<drawCentredString x="10.5cm" y="0.8cm">Your contact : <xsl:value-of select="//corporate-header/user/name"/></drawCentredString>
</xsl:template>
<xsl:template name="other_pages_graphics_corporation">
<!--logo-->
@ -71,7 +71,7 @@
<drawRightString x="7cm" y="25.5cm"><xsl:value-of select="//corporate-header/corporation/address/email"/></drawRightString>
<!--page bottom-->
<lines>1.5cm 1.2cm 19.9cm 1.2cm</lines>
<drawCentredString x="10.5cm" y="1.7cm"><xsl:value-of select="//corporate-header/corporation/rml_footer1"/></drawCentredString>
<drawCentredString x="10.5cm" y="1.25cm"><xsl:value-of select="//corporate-header/corporation/rml_footer2"/></drawCentredString>

View File

@ -141,10 +141,10 @@
<field eval="[(6, 0, [ref('res_partner_category_1')])]" name="category_id"/>
</record>
<record id="res_partner_9" model="res.partner">
<field name="website">http://opensides.be</field>
<field name="name">Opensides sprl</field>
<field name="website">http://www.openroad.be</field>
<field name="name">OpenRoad</field>
<field eval="12000.00" name="credit_limit"/>
<field name="ref">os</field>
<field name="ref">or</field>
<field name="user_id" ref="user_demo"/>
<field eval="[(6, 0, [ref('res_partner_category_1')])]" name="category_id"/>
</record>
@ -181,12 +181,12 @@
<record id="res_partner_address_1" model="res.partner.address">
<field name="city">Bruxelles</field>
<field name="name">Benoit Mortier</field>
<field name="zip">1030</field>
<field name="name">Michel Schumacher</field>
<field name="zip">1000</field>
<field model="res.country" name="country_id" search="[('name','=','Belgium')]"/>
<field name="email">info@opensides.be</field>
<field name="phone">(+32)2 211 34 83</field>
<field name="street">Rue des Palais 44, bte 33</field>
<field name="email">info@openroad.be</field>
<field name="phone">(+32) 2 123 456</field>
<field name="street">Rue du flash 50</field>
<field name="type">default</field>
<field name="partner_id" ref="res_partner_9"/>
</record>

View File

@ -260,6 +260,8 @@ class OpenERPDispatcher:
Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg))
def dispatch(self, service_name, method, params):
if service_name not in GROUPS['web-services']:
raise Exception('AccessDenied')
try:
self.log('service', service_name)
self.log('method', method)
@ -306,7 +308,7 @@ class SSLSocket(object):
return getattr(self.socket, name)
class SimpleXMLRPCRequestHandler(GenericXMLRPCRequestHandler, SimpleXMLRPCServer.SimpleXMLRPCRequestHandler):
rpc_paths = map(lambda s: '/xmlrpc/%s' % s, SERVICES.keys())
rpc_paths = map(lambda s: '/xmlrpc/%s' % s, GROUPS.get('web-services', {}).keys())
class SecureXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
def setup(self):

View File

@ -641,6 +641,17 @@ class function(_column):
else:
res = self._fnct(cr, obj._table, ids, name, self._arg, context)
if self._type == "many2one" :
# Filtering only integer/long values if passed
res_ids = [x for x in res.values() if x and isinstance(x, (int,long))]
if res_ids:
obj_model = obj.pool.get(self._obj)
dict_names = dict(obj_model.name_get(cr, user, res_ids, context))
for r in res.keys():
if res[r] and res[r] in dict_names:
res[r] = (res[r], dict_names[res[r]])
if self._type == 'binary' and context.get('bin_size', False):
# convert the data returned by the function with the size of that data...
res = dict(map(lambda (x, y): (x, tools.human_size(len(y or ''))), res.items()))

View File

@ -533,7 +533,7 @@ class orm_template(object):
warning = ''
warning_fields = []
for field in fields_export:
if imp_comp and len(field)>1:
if imp_comp and len(field)>1:
warning_fields.append('/'.join(map(lambda x:x in cols and cols[x].string or x,field)))
elif len (field) <=1:
if imp_comp and cols.get(field and field[0],False):
@ -556,12 +556,20 @@ class orm_template(object):
fields = map(lambda x: x.split('/'), fields)
logger = netsvc.Logger()
ir_model_data_obj = self.pool.get('ir.model.data')
def _check_db_id(self, model_name, db_id):
obj_model = self.pool.get(model_name)
ids = obj_model.search(cr, uid, [('id','=',int(db_id))])
if not len(ids):
raise Exception(_("Database ID doesn't exist: %s : %s") %(model_name, db_id))
return True
def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0):
line = datas[position]
row = {}
translate = {}
todo = []
warning = ''
warning = []
data_id = False
data_res_id = False
is_xml_id = False
@ -575,7 +583,37 @@ class orm_template(object):
raise Exception(_('Please check that all your lines have %d columns.') % (len(fields),))
if not line[i]:
continue
field = fields[i]
field = fields[i]
if (len(field)==len(prefix)+1) and field[len(prefix)].endswith(':db_id'):
# Database ID
res = False
if line[i]:
field_name = field[0].split(':')[0]
model_rel = fields_def[field_name]['relation']
if fields_def[field[len(prefix)][:-6]]['type']=='many2many':
res_id = []
for db_id in line[i].split(config.get('csv_internal_sep')):
try:
_check_db_id(self, model_rel, db_id)
res_id.append(db_id)
except Exception,e:
warning += [tools.exception_to_unicode(e)]
logger.notifyChannel("import", netsvc.LOG_ERROR,
tools.exception_to_unicode(e))
if len(res_id):
res = [(6, 0, res_id)]
else:
try:
_check_db_id(self, model_rel, line[i])
res = line[i]
except Exception,e:
warning += [tools.exception_to_unicode(e)]
logger.notifyChannel("import", netsvc.LOG_ERROR,
tools.exception_to_unicode(e))
row[field_name] = res or False
continue
if (len(field)==len(prefix)+1) and field[len(prefix)].endswith(':id'):
res_id = False
if line[i]:
@ -630,30 +668,21 @@ class orm_template(object):
ir_model_data_obj.create(cr, uid, {'module':module, 'model':model_name, 'name':name, 'res_id':is_db_id})
db_id = is_db_id
if is_db_id and int(db_id) != int(is_db_id):
warning += ("Id is not the same than existing one: " + str(is_db_id) + " !\n")
warning += [_("Id is not the same than existing one: %s")%(is_db_id)]
logger.notifyChannel("import", netsvc.LOG_ERROR,
"Id is not the same than existing one: " + str(is_db_id) + ' !\n')
_("Id is not the same than existing one: %s")%(is_db_id))
continue
if field[len(prefix)] == "db_id":
# Database ID
try:
line[i]= int(line[i])
except Exception, e:
warning += (str(e) + "!\n")
try:
_check_db_id(self, model_name, line[i])
data_res_id = is_db_id = int(line[i])
except Exception,e:
warning += [tools.exception_to_unicode(e)]
logger.notifyChannel("import", netsvc.LOG_ERROR,
str(e) + '!\n')
tools.exception_to_unicode(e))
continue
is_db_id = line[i]
obj_model = self.pool.get(model_name)
ids = obj_model.search(cr, uid, [('id','=',line[i])])
if not len(ids):
warning += ("Database ID doesn't exist: " + model_name + ": " + str(line[i]) + " !\n")
logger.notifyChannel("import", netsvc.LOG_ERROR,
"Database ID doesn't exist: " + model_name + ": " + str(line[i]) + ' !\n')
continue
else:
data_res_id = ids[0]
data_ids = ir_model_data_obj.search(cr, uid, [('model','=',model_name),('res_id','=',line[i])])
if len(data_ids):
d = ir_model_data_obj.read(cr, uid, data_ids, ['name','module'])[0]
@ -665,9 +694,9 @@ class orm_template(object):
if is_xml_id and not data_id:
data_id = is_xml_id
if is_xml_id and is_xml_id!=data_id:
warning += ("Id is not the same than existing one: " + str(line[i]) + " !\n")
warning += [_("Id is not the same than existing one: %s")%(line[i])]
logger.notifyChannel("import", netsvc.LOG_ERROR,
"Id is not the same than existing one: " + str(line[i]) + ' !\n')
_("Id is not the same than existing one: %s")%(line[i]))
continue
if fields_def[field[len(prefix)]]['type'] == 'integer':
@ -690,10 +719,10 @@ class orm_template(object):
break
if line[i] and not res:
logger.notifyChannel("import", netsvc.LOG_WARNING,
"key '%s' not found in selection field '%s'" % \
_("key '%s' not found in selection field '%s'") % \
(line[i], field[len(prefix)]))
warning += "Key/value '"+ str(line[i]) +"' not found in selection field '"+str(field[len(prefix)])+"'"
warning += [_("Key/value '%s' not found in selection field '%s'")%(line[i],field[len(prefix)])]
elif fields_def[field[len(prefix)]]['type']=='many2one':
res = False
@ -703,11 +732,9 @@ class orm_template(object):
line[i], [], operator='=', context=context)
res = (res2 and res2[0][0]) or False
if not res:
warning += ('Relation not found: ' + line[i] + \
' on ' + relation + ' !\n')
warning += [_("Relation not found: %s on '%s'")%(line[i],relation)]
logger.notifyChannel("import", netsvc.LOG_WARNING,
'Relation not found: ' + line[i] + \
' on ' + relation + ' !\n')
_("Relation not found: %s on '%s'")%(line[i],relation))
elif fields_def[field[len(prefix)]]['type']=='many2many':
res = []
if line[i]:
@ -717,12 +744,10 @@ class orm_template(object):
uid, word, [], operator='=', context=context)
res3 = (res2 and res2[0][0]) or False
if not res3:
warning += ('Relation not found: ' + \
line[i] + ' on '+relation + ' !\n')
warning += [_("Relation not found: %s on '%s'")%(line[i],relation)]
logger.notifyChannel("import",
netsvc.LOG_WARNING,
'Relation not found: ' + line[i] + \
' on '+relation + ' !\n')
_("Relation not found: %s on '%s'")%(line[i],relation))
else:
res.append(res3)
if len(res):
@ -787,9 +812,9 @@ class orm_template(object):
#try:
(res, other, warning, translate, data_id, res_id) = \
process_liness(self, datas, [], current_module, self._name, fields_def)
if warning:
if len(warning):
cr.rollback()
return (-1, res, 'Line ' + str(counter) +' : ' + warning, '')
return (-1, res, 'Line ' + str(counter) +' : ' + '!\n'.join(warning), '')
try:
id = ir_model_data_obj._update(cr, uid, self._name,
@ -798,7 +823,7 @@ class orm_template(object):
except Exception, e:
import psycopg2
if isinstance(e,psycopg2.IntegrityError):
msg= 'Insertion Failed!'
msg= _('Insertion Failed!')
for key in self.pool._sql_error.keys():
if key in e[0]:
msg = self.pool._sql_error[key]

View File

@ -86,7 +86,6 @@ class osv_pool(netsvc.Service):
self._init = True
self._init_parent = {}
netsvc.Service.__init__(self, 'object_proxy', audience='')
self.joinGroup('web-services')
self.exportMethod(self.obj_list)
self.exportMethod(self.exec_workflow)
self.exportMethod(self.execute)

View File

@ -22,7 +22,7 @@
##############################################################################
name = 'openerp-server'
version = '5.0.3'
version = '5.0.4'
major_version = '5.0'
description = 'OpenERP Server'
long_desc = '''\

View File

@ -209,7 +209,6 @@ class document(object):
args = [self.eval(browser, arg) for arg in attrs['args'].split(',')]
else:
args = []
# get the object
if attrs.has_key('model'):
obj = self.pool.get(attrs['model'])
@ -232,6 +231,7 @@ class document(object):
newdatas = getattr(obj, attrs['name'])(self.cr, self.uid, ids, *args)
def parse_result_tree(node, parent, datas):
if not node.tag == etree.Comment:
el = etree.Element(node.tag)
parent.append(el)
atr = self.node_attrs_get(node)
@ -251,7 +251,6 @@ class document(object):
elif attrs['type']=='zoom':
value = self.get_value(browser, attrs['name'])
if value:
if not isinstance(value, list):
v_list = [value]
@ -264,12 +263,16 @@ class document(object):
self.parse_node(el_cld, el, v)
else:
# if there is no "type" attribute in the node, copy it to the xml data and parse its childs
for el_cld in node:
self.parse_node(el_cld, parent, browser)
if not node.tag == etree.Comment:
if node.tag == parent.tag:
el = parent
else:
el = etree.Element(node.tag)
parent.append(el)
for el_cld in node:
self.parse_node(el_cld,el, browser)
def xml_get(self):
#return self.doc.toxml('utf-8')
return etree.tostring(self.doc,encoding="utf-8",xml_declaration=True)
return etree.tostring(self.doc,encoding="utf-8",xml_declaration=True,pretty_print=True)
def parse_tree(self, ids, model, context=None):
if not context:
@ -282,7 +285,6 @@ class document(object):
context={}
# parses the xml template to memory
self.dom = etree.XML(xml)
# create the xml data from the xml template
self.parse_tree(ids, model, context)

View File

@ -785,12 +785,12 @@ class _rml_template(object):
r = _rml_flowable(self.doc,self.localcontext, images=self.images, path=self.path, title=self.title)
story_cnt = 0
for node_story in node_stories:
if story_cnt > 0:
fis.append(platypus.PageBreak())
fis += r.render(node_story)
if self.localcontext:
story_cnt += 1
if story_cnt == len(self.localcontext['objects']):
fis.append(PageCount())
fis.append(platypus.PageBreak())
story_cnt += 1
if self.localcontext:
fis.append(PageCount())
self.doc_tmpl.build(fis)
def parseNode(rml, localcontext = {},fout=None, images={}, path='.',title=None):

View File

@ -97,7 +97,7 @@ def _child_get(node, self=None, tagname=None):
def _process_text(self, txt):
if not self.localcontext:
return txt
return str2xml(txt)
if not txt:
return ''
result = ''

View File

@ -796,6 +796,7 @@ def get_languages():
'es_AR': u'Spanish (AR) / Español (AR)',
'es_ES': u'Spanish / Español',
'et_EE': u'Estonian / Eesti keel',
'fi_FI': u'Finland / Suomi',
'fr_BE': u'French (BE) / Français (BE)',
'fr_CH': u'French (CH) / Français (CH)',
'fr_FR': u'French / Français',
@ -812,12 +813,14 @@ def get_languages():
'ro_RO': u'Romanian / limba română',
'ru_RU': u'Russian / русский язык',
'sl_SL': u'Slovenian / slovenščina',
'sq_AL': u'Albanian / Shqipëri',
'sv_SE': u'Swedish / svenska',
'tr_TR': u'Turkish / Türkçe',
'vi_VN': u'Vietnam / Cộng hòa xã hội chủ nghĩa Việt Nam',
'uk_UA': u'Ukrainian / украї́нська мо́ва',
'zh_CN': u'Chinese (CN) / 简体中文' ,
'zh_CN': u'Chinese (CN) / 简体中文',
'zh_TW': u'Chinese (TW) / 正體字',
"th_TH": u"Thai / ภาษาไทย"
'th_TH': u'Thai / ภาษาไทย',
}
return languages

View File

@ -1,4 +1,62 @@
2009-08-21: 5.0.2
2009-08-28: 5.0.4
=================
Bugfixes (server)
-----------------
* Not linked to a bug report:
* no traceback when access denied
* Security fix
* remove bad translation files (bad name)
* Pagecount problem while all objects print on same page and printing special character on xsl report
* https://launchpad.net/bugs/415973
* import: support "<rel_field>:db_id" , better warning message
* https://launchpad.net/bugs/415391
* Functional fields with M2O relation can be printed on print screen now
* https://launchpad.net/bugs/415334
* ir_cron :function and its arguements are now editable
Improvements (server)
---------------------
* replace partner name and address in demo
* add translation names
* update translations files
* new translations
Bugfixes (addons)
-----------------
* Not linked to a bug report:
* Document : error on create if attachment not specified
* report_dcoument : changed the misleading name of action
* point_of_sale: fixed a wrong domain
* sale: bad indentation
* https://launchpad.net/bugs/416807
* report_document : Dashboard should not display partner with no files
* https://launchpad.net/bugs/401110
* Audittrail : Logs set in descending order
* https://launchpad.net/bugs/418541
* Project : Delegated tasks from O2M didnt have project_id
* https://launchpad.net/bugs/416767
* Account_tax_include : onchange of product on invoice line price type issue
Improvements (addons)
---------------------
* update translations
* base_module_quality: make minimal score for all test, add message if the score is below limit,varible for whether to activate the test or not
* process view node now links to parent document directory if no record selected.
* purchase: Merge purchases wizard: added keyword='client_action_multi'
* Auction : improved code
* Auction : improved auction reports
* Age Partner Balance report executed 7 queries per partner, reduced this a total of 7 queries in total.
2009-08-21: 5.0.3
=================
Bugfixes (server)
@ -15,7 +73,6 @@ Bugfixes (server)
* security issue: avoid access to inactive users
* security issue: avoid access with 'None' password (Thanks to P. Christeas for the bug report)
* avoid a bug when look in stack when translate code strings
* https://launchpad.net/bugs/415257
* import of boolean fields in csv files.
* https://launchpad.net/bugs/415014
@ -55,7 +112,6 @@ Bugfixes (addons)
* Module:account Fix keyerror in general_ledger report
* Access rules stock / worker
* mrp: fr_FR.po file had a duplicate message definition
* https://launchpad.net/bugs/413699
* https://launchpad.net/bugs/415014
* report_task: regenerate translations files
@ -123,7 +179,6 @@ Bugfixes (server)
* expression: correct the generated sql in case of _inherits
* the <delete> tag doesn't crash if the referenced id does not exists
* closed file pointer
* https://launchpad.net/bugs/380221
* https://launchpad.net/bugs/403652
* https://launchpad.net/bugs/369947
@ -288,7 +343,6 @@ Bugfixes (addons)
* account_balance Module : Fix the Total problem and Put Indentation in Reports.C
* onchange of product_id on stock move corrected
* correct display of pyflakes result quality module
* https://launchpad.net/bugs/310458
* Simplify Migrations
* https://launchpad.net/bugs/382641