[MERGE]Merge lp:openobject-addons.

bzr revid: bth@tinyerp.com-20130213093050-ulsn51coqmtxsblq
This commit is contained in:
Bhumi Thakkar (Open ERP) 2013-02-13 15:00:50 +05:30
commit 9f182085e9
10 changed files with 3188 additions and 495 deletions

View File

@ -20,7 +20,7 @@
##############################################################################
from openerp.osv import fields, osv
from openerp.osv.osv import object_proxy
import openerp.service.model
from openerp.tools.translate import _
from openerp import pooler
import time
@ -171,355 +171,360 @@ class audittrail_log_line(osv.osv):
'field_description': fields.char('Field Description', size=64),
}
class audittrail_objects_proxy(object_proxy):
""" Uses Object proxy for auditing changes on object of subscribed Rules"""
# Monkeypatch the model RPC endpoint for auditing changes.
def get_value_text(self, cr, uid, pool, resource_pool, method, field, value):
"""
Gets textual values for the fields.
If the field is a many2one, it returns the name.
If it's a one2many or a many2many, it returns a list of name.
In other cases, it just returns the value.
:param cr: the current row, from the database cursor,
:param uid: the current users ID for security checks,
:param pool: current db's pooler object.
:param resource_pool: pooler object of the model which values are being changed.
:param field: for which the text value is to be returned.
:param value: value of the field.
:param recursive: True or False, True will repeat the process recursively
:return: string value or a list of values(for O2M/M2M)
"""
def get_value_text(cr, uid, pool, resource_pool, method, field, value):
"""
Gets textual values for the fields.
If the field is a many2one, it returns the name.
If it's a one2many or a many2many, it returns a list of name.
In other cases, it just returns the value.
:param cr: the current row, from the database cursor,
:param uid: the current users ID for security checks,
:param pool: current db's pooler object.
:param resource_pool: pooler object of the model which values are being changed.
:param field: for which the text value is to be returned.
:param value: value of the field.
:param recursive: True or False, True will repeat the process recursively
:return: string value or a list of values(for O2M/M2M)
"""
field_obj = (resource_pool._all_columns.get(field)).column
if field_obj._type in ('one2many','many2many'):
data = pool.get(field_obj._obj).name_get(cr, uid, value)
#return the modifications on x2many fields as a list of names
res = map(lambda x:x[1], data)
elif field_obj._type == 'many2one':
#return the modifications on a many2one field as its value returned by name_get()
res = value and value[1] or value
else:
res = value
return res
field_obj = (resource_pool._all_columns.get(field)).column
if field_obj._type in ('one2many','many2many'):
data = pool.get(field_obj._obj).name_get(cr, uid, value)
#return the modifications on x2many fields as a list of names
res = map(lambda x:x[1], data)
elif field_obj._type == 'many2one':
#return the modifications on a many2one field as its value returned by name_get()
res = value and value[1] or value
else:
res = value
return res
def create_log_line(self, cr, uid, log_id, model, lines=None):
"""
Creates lines for changed fields with its old and new values
def create_log_line(cr, uid, log_id, model, lines=None):
"""
Creates lines for changed fields with its old and new values
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param model: Object which values are being changed
@param lines: List of values for line is to be created
"""
if lines is None:
lines = []
pool = pooler.get_pool(cr.dbname)
obj_pool = pool.get(model.model)
model_pool = pool.get('ir.model')
field_pool = pool.get('ir.model.fields')
log_line_pool = pool.get('audittrail.log.line')
for line in lines:
field_obj = obj_pool._all_columns.get(line['name'])
assert field_obj, _("'%s' field does not exist in '%s' model" %(line['name'], model.model))
field_obj = field_obj.column
old_value = line.get('old_value', '')
new_value = line.get('new_value', '')
search_models = [model.id]
if obj_pool._inherits:
search_models += model_pool.search(cr, uid, [('model', 'in', obj_pool._inherits.keys())])
field_id = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', search_models)])
if field_obj._type == 'many2one':
old_value = old_value and old_value[0] or old_value
new_value = new_value and new_value[0] or new_value
vals = {
"log_id": log_id,
"field_id": field_id and field_id[0] or False,
"old_value": old_value,
"new_value": new_value,
"old_value_text": line.get('old_value_text', ''),
"new_value_text": line.get('new_value_text', ''),
"field_description": field_obj.string
}
line_id = log_line_pool.create(cr, uid, vals)
return True
def log_fct(self, cr, uid_orig, model, method, fct_src, *args, **kw):
"""
Logging function: This function is performing the logging operation
@param model: Object whose values are being changed
@param method: method to log: create, read, write, unlink, action or workflow action
@param fct_src: execute method of Object proxy
@return: Returns result as per method of Object proxy
"""
pool = pooler.get_pool(cr.dbname)
resource_pool = pool.get(model)
model_pool = pool.get('ir.model')
model_ids = model_pool.search(cr, SUPERUSER_ID, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
assert model_id, _("'%s' Model does not exist..." %(model))
model = model_pool.browse(cr, SUPERUSER_ID, model_id)
# fields to log. currently only used by log on read()
field_list = []
old_values = new_values = {}
if method == 'create':
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
if res:
res_ids = [res]
new_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
elif method == 'read':
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
# build the res_ids and the old_values dict. Here we don't use get_data() to
# avoid performing an additional read()
res_ids = []
for record in res:
res_ids.append(record['id'])
old_values[(model.id, record['id'])] = {'value': record, 'text': record}
# log only the fields read
field_list = args[1]
elif method == 'unlink':
res_ids = args[0]
old_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
else: # method is write, action or workflow action
res_ids = []
if args:
res_ids = args[0]
if isinstance(res_ids, (long, int)):
res_ids = [res_ids]
if res_ids:
# store the old values into a dictionary
old_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
# process the original function, workflow trigger...
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
if method == 'copy':
res_ids = [res]
if res_ids:
# check the new values and store them into a dictionary
new_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
# compare the old and new values and create audittrail log if needed
self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
return res
def get_data(self, cr, uid, pool, res_ids, model, method):
"""
This function simply read all the fields of the given res_ids, and also recurisvely on
all records of a x2m fields read that need to be logged. Then it returns the result in
convenient structure that will be used as comparison basis.
:param cr: the current row, from the database cursor,
:param uid: the current users ID. This parameter is currently not used as every
operation to get data is made as super admin. Though, it could be usefull later.
:param pool: current db's pooler object.
:param res_ids: Id's of resource to be logged/compared.
:param model: Object whose values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:return: dict mapping a tuple (model_id, resource_id) with its value and textual value
{ (model_id, resource_id): { 'value': ...
'textual_value': ...
},
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param model: Object which values are being changed
@param lines: List of values for line is to be created
"""
if lines is None:
lines = []
pool = pooler.get_pool(cr.dbname)
obj_pool = pool.get(model.model)
model_pool = pool.get('ir.model')
field_pool = pool.get('ir.model.fields')
log_line_pool = pool.get('audittrail.log.line')
for line in lines:
field_obj = obj_pool._all_columns.get(line['name'])
assert field_obj, _("'%s' field does not exist in '%s' model" %(line['name'], model.model))
field_obj = field_obj.column
old_value = line.get('old_value', '')
new_value = line.get('new_value', '')
search_models = [model.id]
if obj_pool._inherits:
search_models += model_pool.search(cr, uid, [('model', 'in', obj_pool._inherits.keys())])
field_id = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', search_models)])
if field_obj._type == 'many2one':
old_value = old_value and old_value[0] or old_value
new_value = new_value and new_value[0] or new_value
vals = {
"log_id": log_id,
"field_id": field_id and field_id[0] or False,
"old_value": old_value,
"new_value": new_value,
"old_value_text": line.get('old_value_text', ''),
"new_value_text": line.get('new_value_text', ''),
"field_description": field_obj.string
}
"""
data = {}
resource_pool = pool.get(model.model)
# read all the fields of the given resources in super admin mode
for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids):
values = {}
values_text = {}
resource_id = resource['id']
# loop on each field on the res_ids we just have read
for field in resource:
if field in ('__last_update', 'id'):
continue
values[field] = resource[field]
# get the textual value of that field for this record
values_text[field] = self.get_value_text(cr, SUPERUSER_ID, pool, resource_pool, method, field, resource[field])
line_id = log_line_pool.create(cr, uid, vals)
return True
field_obj = resource_pool._all_columns.get(field).column
if field_obj._type in ('one2many','many2many'):
# check if an audittrail rule apply in super admin mode
if self.check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
# check if the model associated to a *2m field exists, in super admin mode
x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
field_resource_ids = list(set(resource[field]))
if model.model == x2m_model.model:
# we need to remove current resource_id from the many2many to prevent an infinit loop
if resource_id in field_resource_ids:
field_resource_ids.remove(resource_id)
data.update(self.get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method))
data[(model.id, resource_id)] = {'text':values_text, 'value': values}
return data
def log_fct(cr, uid_orig, model, method, fct_src, *args, **kw):
"""
Logging function: This function is performing the logging operation
@param model: Object whose values are being changed
@param method: method to log: create, read, write, unlink, action or workflow action
@param fct_src: execute method of Object proxy
def prepare_audittrail_log_line(self, cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=None):
"""
This function compares the old data (i.e before the method was executed) and the new data
(after the method was executed) and returns a structure with all the needed information to
log those differences.
@return: Returns result as per method of Object proxy
"""
pool = pooler.get_pool(cr.dbname)
resource_pool = pool.get(model)
model_pool = pool.get('ir.model')
model_ids = model_pool.search(cr, SUPERUSER_ID, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
assert model_id, _("'%s' Model does not exist..." %(model))
model = model_pool.browse(cr, SUPERUSER_ID, model_id)
# fields to log. currently only used by log on read()
field_list = []
old_values = new_values = {}
if method == 'create':
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
if res:
res_ids = [res]
new_values = get_data(cr, uid_orig, pool, res_ids, model, method)
elif method == 'read':
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
# build the res_ids and the old_values dict. Here we don't use get_data() to
# avoid performing an additional read()
res_ids = []
for record in res:
res_ids.append(record['id'])
old_values[(model.id, record['id'])] = {'value': record, 'text': record}
# log only the fields read
field_list = args[1]
elif method == 'unlink':
res_ids = args[0]
old_values = get_data(cr, uid_orig, pool, res_ids, model, method)
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
else: # method is write, action or workflow action
res_ids = []
if args:
res_ids = args[0]
if isinstance(res_ids, (long, int)):
res_ids = [res_ids]
if res_ids:
# store the old values into a dictionary
old_values = get_data(cr, uid_orig, pool, res_ids, model, method)
# process the original function, workflow trigger...
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
if method == 'copy':
res_ids = [res]
if res_ids:
# check the new values and store them into a dictionary
new_values = get_data(cr, uid_orig, pool, res_ids, model, method)
# compare the old and new values and create audittrail log if needed
process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
return res
def get_data(cr, uid, pool, res_ids, model, method):
"""
This function simply read all the fields of the given res_ids, and also recurisvely on
all records of a x2m fields read that need to be logged. Then it returns the result in
convenient structure that will be used as comparison basis.
:param cr: the current row, from the database cursor,
:param uid: the current users ID. This parameter is currently not used as every
operation to get data is made as super admin. Though, it could be usefull later.
:param pool: current db's pooler object.
:param model: model object which values are being changed
:param resource_id: ID of record to which values are being changed
:param res_ids: Id's of resource to be logged/compared.
:param model: Object whose values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:param old_values: dict of values read before execution of the method
:param new_values: dict of values read after execution of the method
:param field_list: optional argument containing the list of fields to log. Currently only
used when performing a read, it could be usefull later on if we want to log the write
on specific fields only.
:return: dictionary with
* keys: tuples build as ID of model object to log and ID of resource to log
* values: list of all the changes in field values for this couple (model, resource)
return {
(model.id, resource_id): []
}
The reason why the structure returned is build as above is because when modifying an existing
record, we may have to log a change done in a x2many field of that object
"""
if field_list is None:
field_list = []
key = (model.id, resource_id)
lines = {
key: []
}
# loop on all the fields
for field_name, field_definition in pool.get(model.model)._all_columns.items():
if field_name in ('__last_update', 'id'):
:return: dict mapping a tuple (model_id, resource_id) with its value and textual value
{ (model_id, resource_id): { 'value': ...
'textual_value': ...
},
}
"""
data = {}
resource_pool = pool.get(model.model)
# read all the fields of the given resources in super admin mode
for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids):
values = {}
values_text = {}
resource_id = resource['id']
# loop on each field on the res_ids we just have read
for field in resource:
if field in ('__last_update', 'id'):
continue
#if the field_list param is given, skip all the fields not in that list
if field_list and field_name not in field_list:
continue
field_obj = field_definition.column
values[field] = resource[field]
# get the textual value of that field for this record
values_text[field] = get_value_text(cr, SUPERUSER_ID, pool, resource_pool, method, field, resource[field])
field_obj = resource_pool._all_columns.get(field).column
if field_obj._type in ('one2many','many2many'):
# checking if an audittrail rule apply in super admin mode
if self.check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
# checking if the model associated to a *2m field exists, in super admin mode
# check if an audittrail rule apply in super admin mode
if check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
# check if the model associated to a *2m field exists, in super admin mode
x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
# the resource_ids that need to be checked are the sum of both old and previous values (because we
# need to log also creation or deletion in those lists).
x2m_old_values_ids = old_values.get(key, {'value': {}})['value'].get(field_name, [])
x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, [])
# We use list(set(...)) to remove duplicates.
res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
field_resource_ids = list(set(resource[field]))
if model.model == x2m_model.model:
# we need to remove current resource_id from the many2many to prevent an infinit loop
if resource_id in res_ids:
res_ids.remove(resource_id)
for res_id in res_ids:
lines.update(self.prepare_audittrail_log_line(cr, SUPERUSER_ID, pool, x2m_model, res_id, method, old_values, new_values, field_list))
# if the value value is different than the old value: record the change
if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
data = {
'name': field_name,
'new_value': key in new_values and new_values[key]['value'].get(field_name),
'old_value': key in old_values and old_values[key]['value'].get(field_name),
'new_value_text': key in new_values and new_values[key]['text'].get(field_name),
'old_value_text': key in old_values and old_values[key]['text'].get(field_name)
}
lines[key].append(data)
return lines
if resource_id in field_resource_ids:
field_resource_ids.remove(resource_id)
data.update(get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method))
def process_data(self, cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None):
"""
This function processes and iterates recursively to log the difference between the old
data (i.e before the method was executed) and the new data and creates audittrail log
accordingly.
data[(model.id, resource_id)] = {'text':values_text, 'value': values}
return data
:param cr: the current row, from the database cursor,
:param uid: the current users ID,
:param pool: current db's pooler object.
:param res_ids: Id's of resource to be logged/compared.
:param model: model object which values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:param old_values: dict of values read before execution of the method
:param new_values: dict of values read after execution of the method
:param field_list: optional argument containing the list of fields to log. Currently only
used when performing a read, it could be usefull later on if we want to log the write
on specific fields only.
:return: True
"""
if field_list is None:
field_list = []
# loop on all the given ids
for res_id in res_ids:
# compare old and new values and get audittrail log lines accordingly
lines = self.prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
def prepare_audittrail_log_line(cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=None):
"""
This function compares the old data (i.e before the method was executed) and the new data
(after the method was executed) and returns a structure with all the needed information to
log those differences.
# if at least one modification has been found
for model_id, resource_id in lines:
name = pool.get(model.model).name_get(cr, uid, [resource_id])[0][1]
vals = {
'method': method,
'object_id': model_id,
'user_id': uid,
'res_id': resource_id,
'name': name,
}
if (model_id, resource_id) not in old_values and method not in ('copy', 'read'):
# the resource was not existing so we are forcing the method to 'create'
# (because it could also come with the value 'write' if we are creating
# new record through a one2many field)
vals.update({'method': 'create'})
if (model_id, resource_id) not in new_values and method not in ('copy', 'read'):
# the resource is not existing anymore so we are forcing the method to 'unlink'
# (because it could also come with the value 'write' if we are deleting the
# record through a one2many field)
vals.update({'method': 'unlink'})
# create the audittrail log in super admin mode, only if a change has been detected
if lines[(model_id, resource_id)]:
log_id = pool.get('audittrail.log').create(cr, SUPERUSER_ID, vals)
model = pool.get('ir.model').browse(cr, uid, model_id)
self.create_log_line(cr, SUPERUSER_ID, log_id, model, lines[(model_id, resource_id)])
return True
:param cr: the current row, from the database cursor,
:param uid: the current users ID. This parameter is currently not used as every
operation to get data is made as super admin. Though, it could be usefull later.
:param pool: current db's pooler object.
:param model: model object which values are being changed
:param resource_id: ID of record to which values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:param old_values: dict of values read before execution of the method
:param new_values: dict of values read after execution of the method
:param field_list: optional argument containing the list of fields to log. Currently only
used when performing a read, it could be usefull later on if we want to log the write
on specific fields only.
def check_rules(self, cr, uid, model, method):
"""
Checks if auditrails is installed for that db and then if one rule match
@param cr: the current row, from the database cursor,
@param uid: the current users ID,
@param model: value of _name of the object which values are being changed
@param method: method to log: create, read, unlink,write,actions,workflow actions
@return: True or False
"""
pool = pooler.get_pool(cr.dbname)
if 'audittrail.rule' in pool.models:
model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
if model_id:
rule_ids = pool.get('audittrail.rule').search(cr, SUPERUSER_ID, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
for rule in pool.get('audittrail.rule').read(cr, SUPERUSER_ID, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']):
if len(rule['user_id']) == 0 or uid in rule['user_id']:
if rule.get('log_'+method,0):
:return: dictionary with
* keys: tuples build as ID of model object to log and ID of resource to log
* values: list of all the changes in field values for this couple (model, resource)
return {
(model.id, resource_id): []
}
The reason why the structure returned is build as above is because when modifying an existing
record, we may have to log a change done in a x2many field of that object
"""
if field_list is None:
field_list = []
key = (model.id, resource_id)
lines = {
key: []
}
# loop on all the fields
for field_name, field_definition in pool.get(model.model)._all_columns.items():
if field_name in ('__last_update', 'id'):
continue
#if the field_list param is given, skip all the fields not in that list
if field_list and field_name not in field_list:
continue
field_obj = field_definition.column
if field_obj._type in ('one2many','many2many'):
# checking if an audittrail rule apply in super admin mode
if check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
# checking if the model associated to a *2m field exists, in super admin mode
x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
# the resource_ids that need to be checked are the sum of both old and previous values (because we
# need to log also creation or deletion in those lists).
x2m_old_values_ids = old_values.get(key, {'value': {}})['value'].get(field_name, [])
x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, [])
# We use list(set(...)) to remove duplicates.
res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
if model.model == x2m_model.model:
# we need to remove current resource_id from the many2many to prevent an infinit loop
if resource_id in res_ids:
res_ids.remove(resource_id)
for res_id in res_ids:
lines.update(prepare_audittrail_log_line(cr, SUPERUSER_ID, pool, x2m_model, res_id, method, old_values, new_values, field_list))
# if the value value is different than the old value: record the change
if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
data = {
'name': field_name,
'new_value': key in new_values and new_values[key]['value'].get(field_name),
'old_value': key in old_values and old_values[key]['value'].get(field_name),
'new_value_text': key in new_values and new_values[key]['text'].get(field_name),
'old_value_text': key in old_values and old_values[key]['text'].get(field_name)
}
lines[key].append(data)
return lines
def process_data(cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None):
"""
This function processes and iterates recursively to log the difference between the old
data (i.e before the method was executed) and the new data and creates audittrail log
accordingly.
:param cr: the current row, from the database cursor,
:param uid: the current users ID,
:param pool: current db's pooler object.
:param res_ids: Id's of resource to be logged/compared.
:param model: model object which values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:param old_values: dict of values read before execution of the method
:param new_values: dict of values read after execution of the method
:param field_list: optional argument containing the list of fields to log. Currently only
used when performing a read, it could be usefull later on if we want to log the write
on specific fields only.
:return: True
"""
if field_list is None:
field_list = []
# loop on all the given ids
for res_id in res_ids:
# compare old and new values and get audittrail log lines accordingly
lines = prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
# if at least one modification has been found
for model_id, resource_id in lines:
name = pool.get(model.model).name_get(cr, uid, [resource_id])[0][1]
vals = {
'method': method,
'object_id': model_id,
'user_id': uid,
'res_id': resource_id,
'name': name,
}
if (model_id, resource_id) not in old_values and method not in ('copy', 'read'):
# the resource was not existing so we are forcing the method to 'create'
# (because it could also come with the value 'write' if we are creating
# new record through a one2many field)
vals.update({'method': 'create'})
if (model_id, resource_id) not in new_values and method not in ('copy', 'read'):
# the resource is not existing anymore so we are forcing the method to 'unlink'
# (because it could also come with the value 'write' if we are deleting the
# record through a one2many field)
vals.update({'method': 'unlink'})
# create the audittrail log in super admin mode, only if a change has been detected
if lines[(model_id, resource_id)]:
log_id = pool.get('audittrail.log').create(cr, SUPERUSER_ID, vals)
model = pool.get('ir.model').browse(cr, uid, model_id)
create_log_line(cr, SUPERUSER_ID, log_id, model, lines[(model_id, resource_id)])
return True
def check_rules(cr, uid, model, method):
"""
Checks if auditrails is installed for that db and then if one rule match
@param cr: the current row, from the database cursor,
@param uid: the current users ID,
@param model: value of _name of the object which values are being changed
@param method: method to log: create, read, unlink,write,actions,workflow actions
@return: True or False
"""
pool = pooler.get_pool(cr.dbname)
if 'audittrail.rule' in pool.models:
model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
if model_id:
rule_ids = pool.get('audittrail.rule').search(cr, SUPERUSER_ID, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
for rule in pool.get('audittrail.rule').read(cr, SUPERUSER_ID, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']):
if len(rule['user_id']) == 0 or uid in rule['user_id']:
if rule.get('log_'+method,0):
return True
elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create', 'read_group', 'import_data'):
if rule['log_action']:
return True
elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create', 'read_group', 'import_data'):
if rule['log_action']:
return True
def execute_cr(self, cr, uid, model, method, *args, **kw):
fct_src = super(audittrail_objects_proxy, self).execute_cr
if self.check_rules(cr,uid,model,method):
return self.log_fct(cr, uid, model, method, fct_src, *args, **kw)
return fct_src(cr, uid, model, method, *args, **kw)
# Replace the openerp.service.model functions.
def exec_workflow_cr(self, cr, uid, model, method, *args, **kw):
fct_src = super(audittrail_objects_proxy, self).exec_workflow_cr
if self.check_rules(cr,uid,model,'workflow'):
return self.log_fct(cr, uid, model, method, fct_src, *args, **kw)
return fct_src(cr, uid, model, method, *args, **kw)
original_execute_cr = openerp.service.model.execute_cr
original_exec_workflow_cr = openerp.service.model.exec_workflow_cr
audittrail_objects_proxy()
def execute_cr(cr, uid, model, method, *args, **kw):
fct_src = original_execute_cr
if check_rules(cr,uid,model,method):
return log_fct(cr, uid, model, method, fct_src, *args, **kw)
return fct_src(cr, uid, model, method, *args, **kw)
def exec_workflow_cr(cr, uid, model, method, *args, **kw):
fct_src = original_exec_workflow_cr
if check_rules(cr,uid,model,'workflow'):
return log_fct(cr, uid, model, method, fct_src, *args, **kw)
return fct_src(cr, uid, model, method, *args, **kw)
openerp.service.model.execute_cr = execute_cr
openerp.service.model.exec_workflow_cr = exec_workflow_cr
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -24,12 +24,13 @@ from dateutil import parser
from dateutil import rrule
from dateutil.relativedelta import relativedelta
from openerp.osv import fields, osv
from openerp.service import web_services
from openerp.tools.translate import _
import pytz
import re
import time
from openerp import tools, SUPERUSER_ID
import openerp.service.report
months = {
1: "January", 2: "February", 3: "March", 4: "April", \
@ -1729,27 +1730,25 @@ class ir_model(osv.osv):
ir_model()
class virtual_report_spool(web_services.report_spool):
original_exp_report = openerp.service.report.exp_report
def exp_report(self, db, uid, object, ids, data=None, context=None):
"""
Export Report
@param self: The object pointer
@param db: get the current database,
@param uid: the current user's ID for security checks,
@param context: A standard dictionary for contextual values
"""
def exp_report(db, uid, object, ids, data=None, context=None):
"""
Export Report
@param db: get the current database,
@param uid: the current user's ID for security checks,
@param context: A standard dictionary for contextual values
"""
if object == 'printscreen.list':
return super(virtual_report_spool, self).exp_report(db, uid, \
object, ids, data, context)
new_ids = []
for id in ids:
new_ids.append(base_calendar_id2real_id(id))
if data.get('id', False):
data['id'] = base_calendar_id2real_id(data['id'])
return super(virtual_report_spool, self).exp_report(db, uid, object, new_ids, data, context)
if object == 'printscreen.list':
original_exp_report(db, uid, object, ids, data, context)
new_ids = []
for id in ids:
new_ids.append(base_calendar_id2real_id(id))
if data.get('id', False):
data['id'] = base_calendar_id2real_id(data['id'])
return original_exp_report(db, uid, object, new_ids, data, context)
virtual_report_spool()
openerp.service.report.exp_report = exp_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2012-12-14 22:33+0000\n"
"Last-Translator: Goran Kliska <gkliska@gmail.com>\n"
"PO-Revision-Date: 2013-02-12 22:11+0000\n"
"Last-Translator: Davor Bojkić <bole@dajmi5.com>\n"
"Language-Team: Croatian <hr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-12-22 06:07+0000\n"
"X-Generator: Launchpad (build 16378)\n"
"X-Launchpad-Export-Date: 2013-02-13 04:36+0000\n"
"X-Generator: Launchpad (build 16491)\n"
#. module: base_import
#. openerp-web
@ -29,7 +29,7 @@ msgstr "Dohvati sve moguće vrijednosti"
#: code:addons/base_import/static/src/xml/import.xml:71
#, python-format
msgid "Need to import data from an other application?"
msgstr ""
msgstr "Potreban je uvoz podataka iz druge aplikacije?"
#. module: base_import
#. openerp-web
@ -47,6 +47,15 @@ msgid ""
"give \n"
" you an example for Products and their Categories."
msgstr ""
"Kada koristite vanjske ID-eve, možete uvesti csv datoteke \n"
" sa kolonom \"External ID\" "
"definirate vanjski ID svakog zapisa \n"
" koji uvozite. Tada ćete biti "
"u mogućnosti napraviti referencu \n"
" na taj zapis sa kolonama tipa "
"\"polje/External ID\". Sljedeća dvije \n"
" csv datoteke daju primjer za "
"proizvode i njihove kategorije."
#. module: base_import
#. openerp-web
@ -56,13 +65,16 @@ msgid ""
"How to export/import different tables from an SQL \n"
" application to OpenERP?"
msgstr ""
"Kako izvesti/uvesti različite tablice iz SQL \n"
" "
"programa u OpenERP"
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/js/import.js:310
#, python-format
msgid "Relation Fields"
msgstr ""
msgstr "Relacijska polja"
#. module: base_import
#. openerp-web
@ -72,6 +84,9 @@ msgid ""
"Country/Database ID: the unique OpenERP ID for a \n"
" record, defined by the ID postgresql column"
msgstr ""
"Država/ID baze: jedinstveni OpenERP ID za \n"
" "
" zapis, definran kolonom postgres kolonom ID"
#. module: base_import
#. openerp-web
@ -87,6 +102,16 @@ msgid ""
"\n"
" have a unique Database ID)"
msgstr ""
"Korištenje \n"
" Država/ID "
"BAze : ovo bi trebali rijetko koristiti\n"
" za "
"označavanje. Ovo je većinom korišteno od strane programera\n"
" jer je "
"glavna prednost ovoga to što nikad nema konflikata \n"
" (možete "
"imati više zapisa istog naziva, ali uvjek sa jedinstvenim IDentifikatorom u "
"Bazi)"
#. module: base_import
#. openerp-web
@ -96,6 +121,9 @@ msgid ""
"For the country \n"
" Belgium, you can use one of these 3 ways to import:"
msgstr ""
"Za državu \n"
" "
" Belgiju, možete koristiti jedan od ova 3 načina uza uvoz:"
#. module: base_import
#. openerp-web
@ -121,13 +149,20 @@ msgid ""
"companies) TO \n"
" '/tmp/company.csv' with CSV HEADER;"
msgstr ""
"kopirajte \n"
" (select "
"'company_'||id as \"External ID\",company_name\n"
" as "
"\"Name\",'True' as \"Is a Company\" from companies) TO\n"
" "
"'/tmp/company.csv' with CSV HEADER;"
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/xml/import.xml:206
#, python-format
msgid "CSV file for Manufacturer, Retailer"
msgstr ""
msgstr "CSV datoteka za Proizvođače, Veletrgovce"
#. module: base_import
#. openerp-web
@ -139,6 +174,11 @@ msgid ""
"\n"
" data from a third party application."
msgstr ""
"Koristi \n"
" Država/Vanjski ID. "
"koristite vanjski ID kad uvozite \n"
" podatke iz drugih "
"aplikacija."
#. module: base_import
#. openerp-web
@ -152,7 +192,7 @@ msgstr ""
#: code:addons/base_import/static/src/xml/import.xml:80
#, python-format
msgid "XXX/External ID"
msgstr ""
msgstr "XXX/Vanjski ID"
#. module: base_import
#. openerp-web
@ -181,6 +221,14 @@ msgid ""
"\n"
" See the following question."
msgstr ""
"Primjetite da vaša csv datoteka \n"
" ima tabulator za "
"odvajanje, a OpenERP neće \n"
" primjetiti ta odvajanja. "
"Morate promjineiti format \n"
" zapisa u vašem tabličnom "
"kalkulatoru. \n"
" Vidi sljedeće pitanje."
#. module: base_import
#. openerp-web
@ -199,7 +247,7 @@ msgstr ""
#: code:addons/base_import/static/src/xml/import.xml:239
#, python-format
msgid "Can I import several times the same record?"
msgstr ""
msgstr "Mogu li isti zapis uvesti nekoliko puta?"
#. module: base_import
#. openerp-web
@ -213,7 +261,7 @@ msgstr "Potvrdi"
#: code:addons/base_import/static/src/xml/import.xml:55
#, python-format
msgid "Map your data to OpenERP"
msgstr ""
msgstr "Mapirajte vaše podatke na OpenERP"
#. module: base_import
#. openerp-web
@ -224,6 +272,10 @@ msgid ""
" the easiest way when your data come from CSV files \n"
" that have been created manually."
msgstr ""
"Korištenje Države: ovo je \n"
" najlakši način kada vaši "
"podaci dolaze iz csv datoteka\n"
" koje su sastavljene ručno."
#. module: base_import
#. openerp-web
@ -233,6 +285,8 @@ msgid ""
"What's the difference between Database ID and \n"
" External ID?"
msgstr ""
"Koja je razlika izmeži ID Baze i \n"
" vanjski ID?"
#. module: base_import
#. openerp-web
@ -244,25 +298,30 @@ msgid ""
"\n"
" you 3 different fields to import:"
msgstr ""
"Na primjer, \n"
" referenciranje države "
"kontakta, OpenERP predlaže \n"
" 3 različita polja za "
"uvoz :"
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/xml/import.xml:175
#, python-format
msgid "What can I do if I have multiple matches for a field?"
msgstr ""
msgstr "Što da radim ako imam više istih zapisa za polje?"
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/xml/import.xml:302
#, python-format
msgid "External ID,Name,Is a Company"
msgstr ""
msgstr "Vanjski ID , Naziv, Je Tvrtka"
#. module: base_import
#: field:base_import.tests.models.preview,somevalue:0
msgid "Some Value"
msgstr ""
msgstr "Neka vrijednost"
#. module: base_import
#. openerp-web
@ -272,6 +331,9 @@ msgid ""
"The following CSV file shows how to import \n"
" suppliers and their respective contacts"
msgstr ""
"Sljedeća csv datoteka pokazuje kako uvesti \n"
" "
" dobavljače i njihove pripadne kontakte"
#. module: base_import
#. openerp-web
@ -281,6 +343,9 @@ msgid ""
"How can I change the CSV file format options when \n"
" saving in my spreadsheet application?"
msgstr ""
"Kako da promijenim opcije csv formata \n"
" "
"kada spremam datoteku u tabličnom kalkulatoru?"
#. module: base_import
#. openerp-web
@ -301,6 +366,21 @@ msgid ""
"orignial \n"
" database)."
msgstr ""
"kako možete vidjeti iz ove datoteke, Fabien i Laurence \n"
" "
" rade za organizaciju Biggies (company_1), a \n"
" "
" Eric radi za Organi. Pozezivanje osoba i "
"organizacija se radi \n"
" "
" korištenjem Vanjskog ID-a organizacije. Morali smo "
"staviti prefix \n"
" "
" naziva tablice na Vanjski ID da izbjegnemo konflikt "
"istog ID-a osobe \n"
" "
" i organizacije (osoba_1 i organizacija_1 koji dijele "
"isti ID u originalnoj bazi)."
#. module: base_import
#. openerp-web
@ -315,13 +395,20 @@ msgid ""
"\n"
" '/tmp/person.csv' with CSV"
msgstr ""
"kopirajte \n"
" (select'person_'||id as \"External ID\",person_name "
"as\n"
" \"Name\",'False' as \"Is a "
"Company\",'company_'||company_id\n"
" as \"Related Company/External ID\" from persons) TO\n"
" '/tmp/person.csv' with CSV"
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/xml/import.xml:148
#, python-format
msgid "Country: Belgium"
msgstr ""
msgstr "Država : Belgija"
#. module: base_import
#: model:ir.model,name:base_import.model_base_import_tests_models_char_stillreadonly
@ -342,7 +429,7 @@ msgstr ""
#: code:addons/base_import/static/src/xml/import.xml:233
#, python-format
msgid "Suppliers and their respective contacts"
msgstr ""
msgstr "Dobavljači i njihovi pripadni kontakti"
#. module: base_import
#. openerp-web
@ -375,6 +462,11 @@ msgid ""
"\n"
" PSQL:"
msgstr ""
"Za stvaranje csv datoteke za osobe povezane sa \n"
" "
" organizacijama, koristimo ljedeću SQL naredbu u \n"
" "
" PSQL:"
#. module: base_import
#. openerp-web
@ -386,6 +478,13 @@ msgid ""
" (in 'Save As' dialog box > click 'Tools' dropdown \n"
" list > Encoding tab)."
msgstr ""
"Microsoft Excell će vam omogućiti \n"
" da promjenite kodnu stranu "
"jedino kod snimanja \n"
" (U 'Save as' dijalogu > "
"kliknite na 'Tools' padajući izbornik > \n"
" odaberite 'Encoding' "
"karticu)"
#. module: base_import
#: field:base_import.tests.models.preview,othervalue:0
@ -402,6 +501,13 @@ msgid ""
" later, it's thus good practice to specify it\n"
" whenever possible"
msgstr ""
"će također biti korišteno za ažuriranje originalnog \n"
" "
"uvoza, ako kasnije trebate ponovo uvesti \n"
" "
"izmjenjene podatke, zato se smatra dobrom praksom \n"
" "
"koristiti kad god je moguće"
#. module: base_import
#. openerp-web
@ -411,6 +517,9 @@ msgid ""
"file to import. If you need a sample importable file, you\n"
" can use the export tool to generate one."
msgstr ""
"datoteka za uvoz. Ako trebate uzorak datoteke koja se može uvesti,\n"
" možete koristiti "
"alat za izvoz da napravite jednu."
#. module: base_import
#. openerp-web
@ -419,7 +528,7 @@ msgstr ""
msgid ""
"Country/Database \n"
" ID: 21"
msgstr ""
msgstr "Država/Baza"
#. module: base_import
#: model:ir.model,name:base_import.model_base_import_tests_models_char
@ -429,14 +538,14 @@ msgstr ""
#. module: base_import
#: help:base_import.import,file:0
msgid "File to check and/or import, raw binary (not base64)"
msgstr ""
msgstr "Datoteke za provjeru i/ili uvoz, raw binary ( ne base64)"
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/xml/import.xml:230
#, python-format
msgid "Purchase orders with their respective purchase order lines"
msgstr ""
msgstr "Narudžbe i njihove pripadne stavke"
#. module: base_import
#. openerp-web
@ -448,6 +557,14 @@ msgid ""
" field corresponding to the column. This makes imports\n"
" simpler especially when the file has many columns."
msgstr ""
"Ako datoteka sadrži\n"
" nazive kolona, OpenERP može "
"pokušati \n"
" automatski odrediti polja koja "
"odgovaraju kolonama. \n"
" Ovo čini uvoz jednostavnijim "
"pogotovo ako datoteka ima \n"
" mnogo kolona."
#. module: base_import
#. openerp-web
@ -464,6 +581,8 @@ msgid ""
". The issue is\n"
" usually an incorrect file encoding."
msgstr ""
". Problem je \n"
" obično netočna kodna strana."
#. module: base_import
#: model:ir.model,name:base_import.model_base_import_tests_models_m2o_required
@ -519,7 +638,7 @@ msgstr "ID baze podataka"
#: code:addons/base_import/static/src/xml/import.xml:313
#, python-format
msgid "It will produce the following CSV file:"
msgstr ""
msgstr "Će napraviti sljedeću csv datoteku:"
#. module: base_import
#. openerp-web
@ -548,7 +667,7 @@ msgstr ""
#: code:addons/base_import/static/src/xml/import.xml:360
#, python-format
msgid "Import preview failed due to:"
msgstr ""
msgstr "Predpregled uvoza nije uspio zbog:"
#. module: base_import
#. openerp-web
@ -643,7 +762,7 @@ msgstr "Uvezi CSV datoteku"
#: code:addons/base_import/static/src/js/import.js:74
#, python-format
msgid "Quoting:"
msgstr ""
msgstr "Navođenje:"
#. module: base_import
#: model:ir.model,name:base_import.model_base_import_tests_models_m2o_required_related
@ -670,7 +789,7 @@ msgstr "Uvoz"
#: code:addons/base_import/static/src/js/import.js:407
#, python-format
msgid "Here are the possible values:"
msgstr ""
msgstr "Evo mogućih vrijednosti:"
#. module: base_import
#. openerp-web
@ -687,13 +806,15 @@ msgid ""
"A single column was found in the file, this often means the file separator "
"is incorrect"
msgstr ""
"U datoteci je nađena samo jedna kolona, to često znači da je format "
"razdjelnika neispravan."
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/xml/import.xml:293
#, python-format
msgid "dump of such a PostgreSQL database"
msgstr ""
msgstr "dump takve PostgereSQL baze"
#. module: base_import
#. openerp-web
@ -710,6 +831,9 @@ msgid ""
"The following CSV file shows how to import purchase \n"
" orders with their respective purchase order lines:"
msgstr ""
"Sljedeća csv datoteka pokazuje kako uvesti \n"
" naloge za nabavu sa "
"njihovm pripadnim stavkama :"
#. module: base_import
#. openerp-web
@ -719,6 +843,9 @@ msgid ""
"What can I do when the Import preview table isn't \n"
" displayed correctly?"
msgstr ""
"Što mogu uraditi kada se tablice Predpregleda za uvoz\n"
" "
" ne prikazuju ispravno?"
#. module: base_import
#: field:base_import.tests.models.char,value:0
@ -770,7 +897,7 @@ msgstr ""
#: code:addons/base_import/static/src/js/import.js:396
#, python-format
msgid "(%d more)"
msgstr ""
msgstr "(%d više)"
#. module: base_import
#. openerp-web
@ -829,7 +956,7 @@ msgstr ""
#: code:addons/base_import/static/src/js/import.js:373
#, python-format
msgid "Everything seems valid."
msgstr ""
msgstr "Sve se čini u redu."
#. module: base_import
#. openerp-web
@ -914,6 +1041,15 @@ msgid ""
" will set the EMPTY value in the field, instead of \n"
" assigning the default value."
msgstr ""
"Ako ne postavite sva polja u vašoj csv datoteci, \n"
" OpenERP će "
"dodijeliti zadane vrijednosti za svako \n"
" nedefinirano "
"polje, ali ako postavite polja sa praznim virjenostima u csv-u \n"
" OpenERP će "
"postaviti vrijednost tih polja na \"PRAZNO\", umjesto da im \n"
" dodijeli zadane "
"vrijednosti"
#. module: base_import
#. openerp-web
@ -930,6 +1066,9 @@ msgid ""
"What happens if I do not provide a value for a \n"
" specific field?"
msgstr ""
"Što se dešava ako ne dajem vrijednost za \n"
" "
"pojedino polje?"
#. module: base_import
#. openerp-web
@ -957,6 +1096,11 @@ msgid ""
"spreadsheet \n"
" application."
msgstr ""
"Ovo vam \n"
" omogućuje da "
"koristite alat za Uvoz/Izvoz OpenERP-a \n"
" za izmjenu serija "
"zapisa u vašem omiljenom tabličnom kalkulatoru"
#. module: base_import
#. openerp-web
@ -993,14 +1137,14 @@ msgstr ""
#: code:addons/base_import/static/src/xml/import.xml:169
#, python-format
msgid "CSV file for categories"
msgstr ""
msgstr "CSV datoteka za kategorije"
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/js/import.js:309
#, python-format
msgid "Normal Fields"
msgstr ""
msgstr "Normalna polja"
#. module: base_import
#. openerp-web
@ -1012,6 +1156,11 @@ msgid ""
" identifier from the original application and\n"
" map it to the"
msgstr ""
"kako bi ponovo napravili relacije između\n"
" "
"različitih zapisa, trebali bi koristiti jedinstveni\n"
" "
"identifikator iz originalnog zapisa i njega mapirati na"
#. module: base_import
#. openerp-web
@ -1054,7 +1203,7 @@ msgstr "Naziv"
#: code:addons/base_import/static/src/xml/import.xml:80
#, python-format
msgid "to the original unique identifier."
msgstr ""
msgstr "originalni jedinstveni identifikator"
#. module: base_import
#. openerp-web
@ -1131,14 +1280,14 @@ msgstr "Vanjski ID"
#: code:addons/base_import/static/src/xml/import.xml:39
#, python-format
msgid "File Format Options…"
msgstr ""
msgstr "Opcije Formata datoteka..."
#. module: base_import
#. openerp-web
#: code:addons/base_import/static/src/js/import.js:392
#, python-format
msgid "between rows %d and %d"
msgstr ""
msgstr "između reda %d i %d"
#. module: base_import
#. openerp-web
@ -1163,4 +1312,4 @@ msgstr ""
#. module: base_import
#: field:base_import.import,file:0
msgid "File"
msgstr ""
msgstr "Datoteka"

View File

@ -31,11 +31,11 @@ from StringIO import StringIO
import psycopg2
import openerp
from openerp import netsvc
from openerp import pooler
from openerp import tools
from openerp.osv import fields, osv
from openerp.osv.orm import except_orm
import openerp.report.interface
from openerp.tools.misc import ustr
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval
@ -456,7 +456,7 @@ class document_directory_content(osv.osv):
if node.extension != '.pdf':
raise Exception("Invalid content: %s" % node.extension)
report = self.pool.get('ir.actions.report.xml').browse(cr, uid, node.report_id, context=context)
srv = netsvc.Service._services['report.'+report.report_name]
srv = openerp.report.interface.report_int._reports['report.'+report.report_name]
ctx = node.context.context.copy()
ctx.update(node.dctx)
pdf,pdftype = srv.create(cr, uid, [node.act_id,], {}, context=ctx)

View File

@ -10,6 +10,7 @@ import glob
import fnmatch
from openerp import pooler, netsvc, sql_db
import openerp.service
from openerp.service import security
from openerp.osv import osv
@ -60,7 +61,7 @@ class abstracted_fs(object):
def db_list(self):
"""Get the list of available databases, with FTPd support
"""
s = netsvc.ExportService.getService('db')
s = openerp.service.db
result = s.exp_list(document=True)
self.db_name_list = []
for db_name in result:

View File

@ -38,6 +38,7 @@ except ImportError:
import openerp
from openerp import pooler, sql_db, netsvc
import openerp.service
from openerp.tools import misc
from cache import memoize
@ -372,7 +373,7 @@ class openerp_dav_handler(dav_interface):
@memoize(4)
def _all_db_list(self):
"""return all databases who have module document_webdav installed"""
s = netsvc.ExportService.getService('db')
s = openerp.service.db
result = s.exp_list()
self.db_name_list=[]
for db_name in result:

View File

@ -21,45 +21,46 @@
import logging
import openerp
import openerp.netsvc as netsvc
_logger = logging.getLogger(__name__)
class edi(netsvc.ExportService):
# TODO this is not needed anymore:
# - the exposed new service just forward to the model service
# - the service is called by the web controller, which can
# now directly call into openerp as the web server is always
# embedded in openerp.
def __init__(self, name="edi"):
netsvc.ExportService.__init__(self, name)
def _edi_dispatch(db_name, method_name, *method_args):
try:
registry = openerp.modules.registry.RegistryManager.get(db_name)
assert registry, 'Unknown database %s' % db_name
edi = registry['edi.edi']
cr = registry.db.cursor()
res = None
res = getattr(edi, method_name)(cr, *method_args)
cr.commit()
except Exception, e:
_logger.exception('Failed to execute EDI method %s with args %r.',
method_name, method_args)
raise
finally:
cr.close()
return res
def _edi_dispatch(self, db_name, method_name, *method_args):
try:
registry = openerp.modules.registry.RegistryManager.get(db_name)
assert registry, 'Unknown database %s' % db_name
edi = registry['edi.edi']
cr = registry.db.cursor()
res = None
res = getattr(edi, method_name)(cr, *method_args)
cr.commit()
except Exception:
_logger.exception('Failed to execute EDI method %s with args %r.', method_name, method_args)
raise
finally:
cr.close()
return res
def exp_import_edi_document(db_name, uid, passwd, edi_document, context=None):
return _edi_dispatch(db_name, 'import_edi', uid, edi_document, None)
def exp_import_edi_document(self, db_name, uid, passwd, edi_document, context=None):
return self._edi_dispatch(db_name, 'import_edi', uid, edi_document, None)
def exp_import_edi_url(db_name, uid, passwd, edi_url, context=None):
return _edi_dispatch(db_name, 'import_edi', uid, None, edi_url)
def exp_import_edi_url(self, db_name, uid, passwd, edi_url, context=None):
return self._edi_dispatch(db_name, 'import_edi', uid, None, edi_url)
@openerp.http.rpc('edi')
def dispatch(method, params):
if method in ['import_edi_document', 'import_edi_url']:
(db, uid, passwd) = params[0:3]
openerp.service.security.check(db, uid, passwd)
else:
raise KeyError("Method not found: %s." % method)
fn = globals()['exp_' + method]
return fn(*params)
def dispatch(self, method, params):
if method in ['import_edi_document', 'import_edi_url']:
(db, uid, passwd ) = params[0:3]
openerp.service.security.check(db, uid, passwd)
else:
raise KeyError("Method not found: %s." % method)
fn = getattr(self, 'exp_'+method)
return fn(*params)
edi()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -7,19 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2012-12-21 10:09+0000\n"
"Last-Translator: Herczeg Péter <hp@erp-cloud.hu>\n"
"PO-Revision-Date: 2013-02-12 17:52+0000\n"
"Last-Translator: krnkris <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-12-22 06:04+0000\n"
"X-Generator: Launchpad (build 16378)\n"
"X-Launchpad-Export-Date: 2013-02-13 04:36+0000\n"
"X-Generator: Launchpad (build 16491)\n"
#. module: mail
#: view:mail.followers:0
msgid "Followers Form"
msgstr ""
msgstr "Követők űrlapjai"
#. module: mail
#: model:ir.model,name:mail.model_publisher_warranty_contract
@ -45,7 +45,7 @@ msgstr "Üzenet címzettjei"
#. module: mail
#: help:mail.message.subtype,default:0
msgid "Activated by default when subscribing."
msgstr ""
msgstr "Alapértelmezetten aktiválva lesz a feliratkozásnál."
#. module: mail
#: view:mail.message:0
@ -70,6 +70,8 @@ msgid ""
"The name of the email alias, e.g. 'jobs' if you want to catch emails for "
"<jobs@example.my.openerp.com>"
msgstr ""
"Az e-mail álnáv neve, pl. 'állások' ha az <allasok@pelda.enyem.openerp.com> "
"helyről akarjuk az e-maileket megkapni"
#. module: mail
#: model:ir.actions.act_window,name:mail.action_email_compose_message_wizard
@ -82,7 +84,7 @@ msgstr "Email írás"
#: code:addons/mail/static/src/xml/mail.xml:132
#, python-format
msgid "Add them into recipients and followers"
msgstr ""
msgstr "A címzettekhez és a követőkhőz adja hozzá"
#. module: mail
#: view:mail.group:0
@ -111,6 +113,8 @@ msgid ""
"Email address of the sender. This field is set when no matching partner is "
"found for incoming emails."
msgstr ""
"A küldő e-mail címei. Ez a mező lesz beállítva, ha nem talált egyező "
"partnert a bejövő levelekhez."
#. module: mail
#: model:ir.model,name:mail.model_mail_compose_message
@ -122,12 +126,12 @@ msgstr "Email varázsló"
#: code:addons/mail/static/src/xml/mail_followers.xml:23
#, python-format
msgid "Add others"
msgstr ""
msgstr "Hozzáadás"
#. module: mail
#: field:mail.message.subtype,parent_id:0
msgid "Parent"
msgstr ""
msgstr "Szülő"
#. module: mail
#: field:mail.group,message_unread:0
@ -149,6 +153,9 @@ msgid ""
"Members of those groups will automatically added as followers. Note that "
"they will be able to manage their subscription manually if necessary."
msgstr ""
"Ezeknek a csoportoknak a tagjai automatikusan hozzá lesznek adva a "
"követőkhöz. Megjegyezve, hogy ha szükséges szerkeszteni tudják a "
"feliratkozásukat."
#. module: mail
#. openerp-web
@ -161,7 +168,7 @@ msgstr "Valóban törölni kívánja ezt az üzenetet?"
#: view:mail.message:0
#: field:mail.notification,read:0
msgid "Read"
msgstr ""
msgstr "Olvas"
#. module: mail
#: view:mail.group:0
@ -173,7 +180,7 @@ msgstr "Csoportok keresése"
#: code:addons/mail/static/src/js/mail_followers.js:156
#, python-format
msgid "followers"
msgstr "Követők"
msgstr "követők"
#. module: mail
#: code:addons/mail/mail_message.py:726
@ -188,18 +195,21 @@ msgid ""
"image, with aspect ratio preserved. Use this field in form views or some "
"kanban views."
msgstr ""
"Közepes méretű fotó a csoportról. Automatikusa át lesz méretezve 128x128px "
"képpé, az arányok megtartásával. Használja ezt a mezőt az osztályozott "
"nézetban és egyes kanban nézetekben."
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:194
#, python-format
msgid "Uploading error"
msgstr ""
msgstr "Feltöltési hiba"
#. module: mail
#: model:mail.group,name:mail.group_support
msgid "Support"
msgstr ""
msgstr "Támogatás"
#. module: mail
#: code:addons/mail/mail_message.py:727
@ -210,6 +220,10 @@ msgid ""
"\n"
"(Document type: %s, Operation: %s)"
msgstr ""
"Az igényelt műveletet nem lehetett végrehajtani biztonsági korlátok miatt. "
"Kérem vegye fel a kapcsolatot a rendszer adminisztrátorral.\n"
"\n"
"(Dokumentum típus: %s, Művelet: %s)"
#. module: mail
#: view:mail.mail:0
@ -227,24 +241,24 @@ msgstr "Szál"
#: code:addons/mail/static/src/xml/mail.xml:37
#, python-format
msgid "Open the full mail composer"
msgstr ""
msgstr "Nyissa meg a taljes levél szerkesztőt"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:37
#, python-format
msgid "&ograve"
msgstr ""
msgstr "&ograve"
#. module: mail
#: field:base.config.settings,alias_domain:0
msgid "Alias Domain"
msgstr ""
msgstr "Domain álnév"
#. module: mail
#: field:mail.group,group_ids:0
msgid "Auto Subscription"
msgstr ""
msgstr "Auto feliratkozás"
#. module: mail
#: field:mail.mail,references:0
@ -256,12 +270,12 @@ msgstr "Hivatkozások"
#: code:addons/mail/static/src/xml/mail.xml:188
#, python-format
msgid "No messages."
msgstr ""
msgstr "Nincs üzenet."
#. module: mail
#: model:ir.model,name:mail.model_mail_group
msgid "Discussion group"
msgstr ""
msgstr "Tárgyalási csoport"
#. module: mail
#. openerp-web
@ -276,7 +290,7 @@ msgstr "feltöltés"
#: code:addons/mail/static/src/xml/mail_followers.xml:52
#, python-format
msgid "more."
msgstr ""
msgstr "több."
#. module: mail
#: help:mail.compose.message,type:0
@ -285,6 +299,8 @@ msgid ""
"Message type: email for email message, notification for system message, "
"comment for other messages such as user replies"
msgstr ""
"Üzenet típus: email az email üzenetre, figyelmeztetés egy rendszer üzenetre, "
"hozzászólás egy másik üzenetre mint felhasználói válaszok"
#. module: mail
#: help:mail.message.subtype,relation_field:0
@ -293,6 +309,8 @@ msgid ""
"automatic subscription on a related document. The field is used to compute "
"getattr(related_document.relation_field)."
msgstr ""
"A mező az ide vonatkozó modell hivatkozására használt az altípus modellhez, "
"ha automatikus feliratkozást használ az ide vonatkozó dokumentumhoz."
#. module: mail
#: selection:mail.mail,state:0
@ -308,25 +326,25 @@ msgstr "Válaszcím"
#: code:addons/mail/wizard/invite.py:36
#, python-format
msgid "<div>You have been invited to follow %s.</div>"
msgstr ""
msgstr "<div>Önt meghívták, hogy kövesse: %s</div>"
#. module: mail
#: help:mail.group,message_unread:0
#: help:mail.thread,message_unread:0
#: help:res.partner,message_unread:0
msgid "If checked new messages require your attention."
msgstr ""
msgstr "Ha be van jelölve, akkor figyelje az új üzeneteket."
#. module: mail
#: field:mail.group,image_medium:0
msgid "Medium-sized photo"
msgstr ""
msgstr "Közepes méretű fotó"
#. module: mail
#: model:ir.actions.client,name:mail.action_mail_to_me_feeds
#: model:ir.ui.menu,name:mail.mail_tomefeeds
msgid "To: me"
msgstr ""
msgstr "Címzett: én"
#. module: mail
#: field:mail.message.subtype,name:0
@ -344,28 +362,28 @@ msgstr "Automatikus törlés"
#: view:mail.group:0
#, python-format
msgid "Unfollow"
msgstr "Követés leállításA"
msgstr "Követés leállítása"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:261
#, python-format
msgid "show one more message"
msgstr ""
msgstr "mutass még egy üzenetet"
#. module: mail
#: code:addons/mail/mail_mail.py:71
#: code:addons/mail/res_users.py:79
#, python-format
msgid "Invalid Action!"
msgstr ""
msgstr "Érvénytelen lépés!"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:25
#, python-format
msgid "User img"
msgstr ""
msgstr "Felhasználói kép"
#. module: mail
#: model:ir.actions.act_window,name:mail.action_view_mail_mail
@ -378,7 +396,7 @@ msgstr "E-mailek"
#. module: mail
#: field:mail.followers,partner_id:0
msgid "Related Partner"
msgstr ""
msgstr "Kapcsolódó partner"
#. module: mail
#: help:mail.group,message_summary:0
@ -388,6 +406,8 @@ msgid ""
"Holds the Chatter summary (number of messages, ...). This summary is "
"directly in html format in order to be inserted in kanban views."
msgstr ""
"A chettelés összegzést megállítja (üzenetek száma,...). Ez az összegzés "
"direkt HTML formátumú ahhoz hogy beilleszthető legyen a kanban nézetekbe."
#. module: mail
#: help:mail.alias,alias_model_id:0
@ -396,11 +416,14 @@ msgid ""
"incoming email that does not reply to an existing record will cause the "
"creation of a new record of this model (e.g. a Project Task)"
msgstr ""
"A modell (OpenERP Documentum féle) amivel ez az álnév összhangban van. "
"Bármely beérkező email ami nem válaszol a meglévő rekordra az egy, a "
"modellhez tartozó új rekord létrehozást okozza (pl. a Projekt feladat)"
#. module: mail
#: field:mail.message.subtype,relation_field:0
msgid "Relation field"
msgstr ""
msgstr "Reléciós/összefüggés mező"
#. module: mail
#: selection:mail.compose.message,type:0
@ -463,7 +486,7 @@ msgstr "Küldés"
#: code:addons/mail/static/src/js/mail_followers.js:152
#, python-format
msgid "No followers"
msgstr ""
msgstr "Nincs követő"
#. module: mail
#: view:mail.mail:0
@ -481,7 +504,7 @@ msgstr "Sikertelen"
#: field:res.partner,message_follower_ids:0
#, python-format
msgid "Followers"
msgstr ""
msgstr "Követők"
#. module: mail
#: model:ir.actions.client,name:mail.action_mail_archives_feeds
@ -495,7 +518,7 @@ msgstr "Archívum"
#: code:addons/mail/static/src/xml/mail.xml:94
#, python-format
msgid "Delete this attachment"
msgstr ""
msgstr "Törli ezt a mellékletet"
#. module: mail
#. openerp-web
@ -510,41 +533,41 @@ msgstr "Válasz"
#: code:addons/mail/static/src/js/mail_followers.js:154
#, python-format
msgid "One follower"
msgstr ""
msgstr "Egy követő"
#. module: mail
#: field:mail.compose.message,type:0
#: field:mail.message,type:0
msgid "Type"
msgstr ""
msgstr "Típus"
#. module: mail
#: selection:mail.compose.message,type:0
#: view:mail.mail:0
#: selection:mail.message,type:0
msgid "Email"
msgstr ""
msgstr "E-mail"
#. module: mail
#: field:ir.ui.menu,mail_group_id:0
msgid "Mail Group"
msgstr ""
msgstr "Levelezési csoport"
#. module: mail
#: selection:res.partner,notification_email_send:0
msgid "Comments and Emails"
msgstr ""
msgstr "Megjegyzések és e-mailok"
#. module: mail
#: field:mail.alias,alias_defaults:0
msgid "Default Values"
msgstr ""
msgstr "Alapértelmezett értékek"
#. module: mail
#: code:addons/mail/res_users.py:100
#, python-format
msgid "%s has joined the %s network."
msgstr ""
msgstr "%s csatlakozott a %s hálózathoz."
#. module: mail
#: help:mail.group,image_small:0
@ -553,6 +576,9 @@ msgid ""
"image, with aspect ratio preserved. Use this field anywhere a small image is "
"required."
msgstr ""
"Kis mérető fotó a csoportról. Automatikusan át lesz méretezve 64x64px képpé, "
"az arány megtartása mellett. Használja ezt a mezőt bárhol ahol kisméretű "
"képet szeretne."
#. module: mail
#: view:mail.compose.message:0
@ -565,41 +591,41 @@ msgstr "Címzettek"
#: code:addons/mail/static/src/xml/mail.xml:127
#, python-format
msgid "<<<"
msgstr ""
msgstr "<<<"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:43
#, python-format
msgid "Write to the followers of this document..."
msgstr ""
msgstr "Bejegyzés írás a dokumentum követőinek..."
#. module: mail
#: field:mail.group,group_public_id:0
msgid "Authorized Group"
msgstr ""
msgstr "Jogosult csoport"
#. module: mail
#: view:mail.group:0
msgid "Join Group"
msgstr ""
msgstr "Csatlakozás a csoporthoz"
#. module: mail
#: help:mail.mail,email_from:0
msgid "Message sender, taken from user preferences."
msgstr ""
msgstr "Üzenet küldő, a felhasználói meghatározásokból vett."
#. module: mail
#: code:addons/mail/wizard/invite.py:39
#, python-format
msgid "<div>You have been invited to follow a new document.</div>"
msgstr ""
msgstr "<div>Önt meghívták, hogy kövessen egy új dokumentumot.</div>"
#. module: mail
#: field:mail.compose.message,parent_id:0
#: field:mail.message,parent_id:0
msgid "Parent Message"
msgstr ""
msgstr "Szülő üzenet"
#. module: mail
#: field:mail.compose.message,res_id:0
@ -607,7 +633,7 @@ msgstr ""
#: field:mail.message,res_id:0
#: field:mail.wizard.invite,res_id:0
msgid "Related Document ID"
msgstr ""
msgstr "Kapcsolódó dokument azonosító ID"
#. module: mail
#: model:ir.actions.client,help:mail.action_mail_to_me_feeds
@ -619,23 +645,29 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p>\n"
"<b>Nincs privát üzenet.</b>\n"
"</p><p>\n"
"Ez a lista az önnek küldött üzeneteket tartalmazza.\n"
"</p>\n"
" "
#. module: mail
#: model:mail.group,name:mail.group_rd
msgid "R&D"
msgstr ""
msgstr "R&D"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:61
#, python-format
msgid "/web/binary/upload_attachment"
msgstr ""
msgstr "/web/binary/upload_attachment"
#. module: mail
#: model:ir.model,name:mail.model_mail_thread
msgid "Email Thread"
msgstr ""
msgstr "E-mail összafűzés"
#. module: mail
#: view:mail.mail:0
@ -647,19 +679,19 @@ msgstr "Speciális"
#: code:addons/mail/static/src/xml/mail.xml:226
#, python-format
msgid "Move to Inbox"
msgstr ""
msgstr "Bejövő üzenetekbe mozgatás"
#. module: mail
#: code:addons/mail/wizard/mail_compose_message.py:165
#, python-format
msgid "Re:"
msgstr ""
msgstr "Vissza:"
#. module: mail
#: field:mail.compose.message,to_read:0
#: field:mail.message,to_read:0
msgid "To read"
msgstr ""
msgstr "Elolvas"
#. module: mail
#: code:addons/mail/res_users.py:79
@ -668,19 +700,21 @@ msgid ""
"You may not create a user. To create new users, you should use the "
"\"Settings > Users\" menu."
msgstr ""
"Talán nem hozott létre felhasználót. Egy felhasználó létrehozásához, "
"használja a \"Beállítások > Felhasználók\" menüt."
#. module: mail
#: help:mail.followers,res_model:0
#: help:mail.wizard.invite,res_model:0
msgid "Model of the followed resource"
msgstr ""
msgstr "A követett forrás modellje"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:286
#, python-format
msgid "like"
msgstr ""
msgstr "hasonló"
#. module: mail
#: view:mail.compose.message:0
@ -694,12 +728,12 @@ msgstr "Mégsem"
#: code:addons/mail/static/src/xml/mail.xml:44
#, python-format
msgid "Share with my followers..."
msgstr ""
msgstr "Üzenet a követőimnek..."
#. module: mail
#: field:mail.notification,partner_id:0
msgid "Contact"
msgstr ""
msgstr "Kapcsolat"
#. module: mail
#: view:mail.group:0
@ -707,21 +741,23 @@ msgid ""
"Only the invited followers can read the\n"
" discussions on this group."
msgstr ""
"Csak a meghívott követők olvashatják ennek a\n"
" csoportnak a beszélgetését."
#. module: mail
#: model:ir.model,name:mail.model_ir_ui_menu
msgid "ir.ui.menu"
msgstr ""
msgstr "ir.ui.menu"
#. module: mail
#: view:mail.message:0
msgid "Has attachments"
msgstr ""
msgstr "Vannak mellékletei"
#. module: mail
#: view:mail.mail:0
msgid "on"
msgstr ""
msgstr "ezen:"
#. module: mail
#: code:addons/mail/mail_message.py:916
@ -730,6 +766,8 @@ msgid ""
"The following partners chosen as recipients for the email have no email "
"address linked :"
msgstr ""
"A következő partnerek lettek kiválasztva mint címzettek, azokhoz az e-"
"mailekhez amelyekhez nem lett kapcsolva e-mail cím :"
#. module: mail
#: help:mail.alias,alias_defaults:0
@ -737,11 +775,13 @@ msgid ""
"A Python dictionary that will be evaluated to provide default values when "
"creating new records for this alias."
msgstr ""
"Egy Python szótár aminak a kiértékelésével alapértékeket biztosít, ha ehhez "
"az álnévhez új rekordokat hoz létre."
#. module: mail
#: model:ir.model,name:mail.model_mail_message_subtype
msgid "Message subtypes"
msgstr ""
msgstr "Üzenet altípusok"
#. module: mail
#: help:mail.compose.message,notified_partner_ids:0
@ -749,13 +789,15 @@ msgstr ""
msgid ""
"Partners that have a notification pushing this message in their mailboxes"
msgstr ""
"Partnerek akiknek van egy értesítésük ennek az üzenetnek a levelező "
"ládájukba való mozgatására"
#. module: mail
#: selection:mail.compose.message,type:0
#: view:mail.mail:0
#: selection:mail.message,type:0
msgid "Comment"
msgstr ""
msgstr "Megjegyzés"
#. module: mail
#: model:ir.actions.client,help:mail.action_mail_inbox_feeds
@ -771,18 +813,28 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p>\n"
" <b>Szép munka!</b> Az ön postafiókja üres.\n"
" </p><p>\n"
" A \"Beérkezett üzenetek\" az önnek küldött privát "
"üzeneteket vagy email-eket,\n"
" továbbá az ön által követett dokumentumokhoz vagy "
"emberekhez kapcsolódó\n"
" információkat tartalmaz.\n"
" </p>\n"
" "
#. module: mail
#: field:mail.mail,notification:0
msgid "Is Notification"
msgstr ""
msgstr "Ez egy üzenet"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:170
#, python-format
msgid "Compose a new message"
msgstr ""
msgstr "Új üzenet küldés"
#. module: mail
#: view:mail.mail:0
@ -795,6 +847,7 @@ msgstr "Küldés most"
msgid ""
"Unable to send email, please configure the sender's email address or alias."
msgstr ""
"Nem tud e-mailt küldeni, kérem állítsa be a küldő e-mail címét vagy álnevet"
#. module: mail
#: help:res.users,alias_id:0
@ -802,11 +855,13 @@ msgid ""
"Email address internally associated with this user. Incoming emails will "
"appear in the user's notifications."
msgstr ""
"E-mail cím belsőleg összekapcsolva ezzel a felhasználóval. Bejövő e-mail-ok "
"megjelennek a felhasználó értesítéseinél."
#. module: mail
#: field:mail.group,image:0
msgid "Photo"
msgstr ""
msgstr "Fénykép"
#. module: mail
#. openerp-web
@ -815,13 +870,13 @@ msgstr ""
#: view:mail.wizard.invite:0
#, python-format
msgid "or"
msgstr ""
msgstr "vagy"
#. module: mail
#: help:mail.compose.message,vote_user_ids:0
#: help:mail.message,vote_user_ids:0
msgid "Users that voted for this message"
msgstr ""
msgstr "Felhasználók akik szavaztak erre az üzenetre"
#. module: mail
#: help:mail.group,alias_id:0
@ -829,6 +884,8 @@ msgid ""
"The email address associated with this group. New emails received will "
"automatically create new topics."
msgstr ""
"Az ezzel a csoporttal társított e-mail cím. Új beérkezett e-mailek "
"automatikusan új témákat hoznak létre."
#. module: mail
#: view:mail.mail:0
@ -844,7 +901,7 @@ msgstr "E-mail keresésée"
#: field:mail.compose.message,child_ids:0
#: field:mail.message,child_ids:0
msgid "Child Messages"
msgstr ""
msgstr "Alcsoportba rakott üzenetek"
#. module: mail
#: field:mail.alias,alias_user_id:0
@ -927,12 +984,12 @@ msgstr ""
#. module: mail
#: view:mail.wizard.invite:0
msgid "Add Followers"
msgstr ""
msgstr "Követők hozzáadása"
#. module: mail
#: view:mail.compose.message:0
msgid "Followers of selected items and"
msgstr ""
msgstr "A kijelölt elemek követői és"
#. module: mail
#: field:mail.alias,alias_force_thread_id:0
@ -942,7 +999,7 @@ msgstr ""
#. module: mail
#: model:ir.ui.menu,name:mail.mail_group_root
msgid "My Groups"
msgstr ""
msgstr "Saját csoportok"
#. module: mail
#: model:ir.actions.client,help:mail.action_mail_archives_feeds
@ -1063,7 +1120,7 @@ msgstr "Dátum"
#: code:addons/mail/static/src/xml/mail.xml:34
#, python-format
msgid "Post"
msgstr ""
msgstr "Elküld"
#. module: mail
#: view:mail.mail:0
@ -1075,14 +1132,14 @@ msgstr "Kiterjesztett szűrők…"
#: code:addons/mail/static/src/xml/mail.xml:107
#, python-format
msgid "To:"
msgstr ""
msgstr "Címzett:"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail.xml:175
#, python-format
msgid "Write to my followers"
msgstr ""
msgstr "Bejegyzés írás a követőimnek"
#. module: mail
#: model:ir.model,name:mail.model_res_groups
@ -1169,7 +1226,7 @@ msgstr ""
#: code:addons/mail/static/src/xml/mail_followers.xml:13
#, python-format
msgid "Following"
msgstr ""
msgstr "Követés"
#. module: mail
#: sql_constraint:mail.alias:0
@ -1257,14 +1314,14 @@ msgstr ""
#. module: mail
#: model:mail.message.subtype,name:mail.mt_comment
msgid "Discussions"
msgstr ""
msgstr "Hozzászólások"
#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/mail_followers.xml:11
#, python-format
msgid "Follow"
msgstr ""
msgstr "Követ"
#. module: mail
#: field:mail.group,name:0
@ -1413,7 +1470,7 @@ msgstr ""
#: model:ir.actions.act_window,name:mail.action_view_groups
#: model:ir.ui.menu,name:mail.mail_allgroups
msgid "Join a group"
msgstr ""
msgstr "Csoporthoz csatlakozás"
#. module: mail
#: model:ir.actions.client,help:mail.action_mail_group_feeds
@ -1492,7 +1549,7 @@ msgstr ""
#: model:ir.actions.client,name:mail.action_mail_star_feeds
#: model:ir.ui.menu,name:mail.mail_starfeeds
msgid "To-do"
msgstr ""
msgstr "Feladat"
#. module: mail
#: view:mail.alias:0
@ -1598,7 +1655,7 @@ msgstr ""
#. module: mail
#: selection:mail.group,public:0
msgid "Private"
msgstr ""
msgstr "Privát"
#. module: mail
#: model:ir.actions.client,help:mail.action_mail_star_feeds

2479
addons/product/i18n/lo.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -30,21 +30,22 @@
##############################################################################
from openerp.osv import fields, osv
from openerp import netsvc
from webkit_report import WebKitParser
import openerp.report.interface
from openerp.report.report_sxw import rml_parse
from webkit_report import WebKitParser
def register_report(name, model, tmpl_path, parser=rml_parse):
"""Register the report into the services"""
name = 'report.%s' % name
if netsvc.Service._services.get(name, False):
service = netsvc.Service._services[name]
if name in openerp.report.interface.report_int._reports:
service = openerp.report.interface.report_int[name]
if isinstance(service, WebKitParser):
#already instantiated properly, skip it
return
if hasattr(service, 'parser'):
parser = service.parser
del netsvc.Service._services[name]
del openerp.report.interface.report_int[name]
WebKitParser(name, model, tmpl_path, parser=parser)