diff --git a/addons/auth_oauth/res_users.py b/addons/auth_oauth/res_users.py index 9c1f88bd7f4..115e3136f00 100644 --- a/addons/auth_oauth/res_users.py +++ b/addons/auth_oauth/res_users.py @@ -21,7 +21,7 @@ class res_users(osv.Model): } _sql_constraints = [ - ('uniq_users_oauth_provider_oauht_uid', 'unique(auth_provider_id, auth_uid)', 'OAuth UID must be unique per provider'), + ('uniq_users_oauth_provider_oauth_uid', 'unique(oauth_provider_id, oauth_uid)', 'OAuth UID must be unique per provider'), ] def auth_oauth_rpc(self, cr, uid, endpoint, access_token, context=None): diff --git a/addons/document/document.py b/addons/document/document.py index b5d0080d816..37a0219d143 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -155,30 +155,6 @@ class document_file(osv.osv): res['value'].update({'name': datas_fname}) return res - def _check_duplication(self, cr, uid, vals, ids=[], op='create'): - name = vals.get('name', False) - parent_id = vals.get('parent_id', False) - res_model = vals.get('res_model', False) - res_id = vals.get('res_id', 0) - if op == 'write': - for file in self.browse(cr, uid, ids): # FIXME fields_only - if not name: - name = file.name - if not parent_id: - parent_id = file.parent_id and file.parent_id.id or False - if not res_model: - res_model = file.res_model and file.res_model or False - if not res_id: - res_id = file.res_id and file.res_id or 0 - res = self.search(cr, uid, [('id', '<>', file.id), ('name', '=', name), ('parent_id', '=', parent_id), ('res_model', '=', res_model), ('res_id', '=', res_id)]) - if len(res): - return False - if op == 'create': - res = self.search(cr, uid, [('name', '=', name), ('parent_id', '=', parent_id), ('res_id', '=', res_id), ('res_model', '=', res_model)]) - if len(res): - return False - return True - def check(self, cr, uid, ids, mode, context=None, values=None): """Check access wrt. res_model, relax the rule of ir.attachment parent @@ -225,8 +201,6 @@ class document_file(osv.osv): res = self.search(cr, uid, [('id', 'in', ids)]) if not len(res): return False - if not self._check_duplication(cr, uid, vals, ids, 'write'): - raise osv.except_osv(_('ValidateError'), _('File name must be unique!')) # if nodes call this write(), they must skip the code below from_node = context and context.get('__from_node', False) @@ -292,22 +266,8 @@ class document_file(osv.osv): else: if vals.get('file_size'): del vals['file_size'] - result = self._check_duplication(cr, uid, vals) - if not result: - domain = [ - ('res_id', '=', vals['res_id']), - ('res_model', '=', vals['res_model']), - ('datas_fname', '=', vals['datas_fname']), - ] - attach_ids = self.search(cr, uid, domain, context=context) - super(document_file, self).write(cr, uid, attach_ids, - {'datas' : vals['datas']}, - context=context) - result = attach_ids[0] - else: - #raise osv.except_osv(_('ValidateError'), _('File name must be unique!')) - result = super(document_file, self).create(cr, uid, vals, context) - return result + + return super(document_file, self).create(cr, uid, vals, context) def __get_partner_id(self, cr, uid, res_model, res_id, context=None): """ A helper to retrieve the associated partner from any res_model+id diff --git a/addons/edi/controllers/main.py b/addons/edi/controllers/main.py index 71560aa9e60..c62fef19cba 100644 --- a/addons/edi/controllers/main.py +++ b/addons/edi/controllers/main.py @@ -4,14 +4,8 @@ import textwrap import simplejson import werkzeug.wrappers -try: - # embedded - import openerp.addons.web.common.http as openerpweb - import openerp.addons.web.controllers.main as webmain -except ImportError: - # standalone - import web.common.http as openerpweb - import web.controllers.main as webmain +import openerp.addons.web.http as openerpweb +import openerp.addons.web.controllers.main as webmain class EDI(openerpweb.Controller): # http://hostname:8069/edi/view?db=XXXX&token=XXXXXXXXXXX diff --git a/addons/email_template/wizard/mail_compose_message_view.xml b/addons/email_template/wizard/mail_compose_message_view.xml index 8d5bc26b213..655f5b9d0c2 100644 --- a/addons/email_template/wizard/mail_compose_message_view.xml +++ b/addons/email_template/wizard/mail_compose_message_view.xml @@ -39,7 +39,7 @@ attrs="{'invisible':[('use_template','=',False)]}" on_change="onchange_template_id(use_template, template_id, composition_mode, model, res_id, context)"/> - +