mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-21 03:27:25 -06:00
[FIX] pep8
This commit is contained in:
parent
7fad9182db
commit
f387ff26e2
@ -39,7 +39,6 @@ class DocumentDirectory(Model):
|
|||||||
],
|
],
|
||||||
context=context),
|
context=context),
|
||||||
context=context):
|
context=context):
|
||||||
#TODO: add write tests
|
|
||||||
result.append(this)
|
result.append(this)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -60,6 +59,7 @@ class DocumentDirectory(Model):
|
|||||||
from openerp.addons.web.http import httprequest
|
from openerp.addons.web.http import httprequest
|
||||||
from openerp.addons.web.controllers.main import Binary
|
from openerp.addons.web.controllers.main import Binary
|
||||||
original = Binary.upload_attachment
|
original = Binary.upload_attachment
|
||||||
|
|
||||||
@httprequest
|
@httprequest
|
||||||
def upload_attachment(self, req, callback, model, id, ufile,
|
def upload_attachment(self, req, callback, model, id, ufile,
|
||||||
directory_id=None):
|
directory_id=None):
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from openerp.osv.orm import Model
|
from openerp.osv.orm import Model
|
||||||
from openerp.osv import fields
|
|
||||||
|
|
||||||
|
|
||||||
class IrAttachment(Model):
|
class IrAttachment(Model):
|
||||||
@ -28,7 +27,8 @@ class IrAttachment(Model):
|
|||||||
def _auto_init(self, cr, context=None):
|
def _auto_init(self, cr, context=None):
|
||||||
'''drop filename_unique if it exists and prevent it from being
|
'''drop filename_unique if it exists and prevent it from being
|
||||||
created'''
|
created'''
|
||||||
cr.execute('''SELECT
|
cr.execute(
|
||||||
|
'''SELECT
|
||||||
conname, pg_catalog.pg_get_constraintdef(oid, true) as condef
|
conname, pg_catalog.pg_get_constraintdef(oid, true) as condef
|
||||||
FROM pg_constraint where conname=%s''',
|
FROM pg_constraint where conname=%s''',
|
||||||
('ir_attachment_filename_unique',))
|
('ir_attachment_filename_unique',))
|
||||||
@ -51,5 +51,3 @@ class IrAttachment(Model):
|
|||||||
cr, uid, ids, fields_to_read=fields_to_read, context=context,
|
cr, uid, ids, fields_to_read=fields_to_read, context=context,
|
||||||
load=load)
|
load=load)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user