c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #28437
[Bug 809745] [NEW] Document module migration of "url" attachments
Public bug reported:
Hello,
On trunk (same problem in stable 6):
In the document module, in document.py there is a method _attach_parent_id to migrate documents on the installation of the module.
The query :
cr.execute("UPDATE ir_attachment SET file_size=length(db_datas) WHERE file_size = 0;")
will work only for attachments of type "binary", for those one of type "url" it will raise a not null constraint error and block the module installation :
ERROR: null value in column "file_size" violates not-null constraint
Because length() of an empty column returns null.
To fix, replace the query by:
cr.execute("UPDATE ir_attachment SET file_size=length(db_datas) WHERE file_size = 0 and type = 'binary';")
Thanks
Regards
Guewen
** Affects: openobject-addons
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/809745
Title:
Document module migration of "url" attachments
Status in OpenERP Modules (addons):
New
Bug description:
Hello,
On trunk (same problem in stable 6):
In the document module, in document.py there is a method _attach_parent_id to migrate documents on the installation of the module.
The query :
cr.execute("UPDATE ir_attachment SET file_size=length(db_datas) WHERE file_size = 0;")
will work only for attachments of type "binary", for those one of type "url" it will raise a not null constraint error and block the module installation :
ERROR: null value in column "file_size" violates not-null constraint
Because length() of an empty column returns null.
To fix, replace the query by:
cr.execute("UPDATE ir_attachment SET file_size=length(db_datas) WHERE file_size = 0 and type = 'binary';")
Thanks
Regards
Guewen
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/809745/+subscriptions
Follow ups
-
[Bug 809745] Re: Document module migration of "url" attachments
From: qdp (OpenERP), 2011-09-19
-
[Bug 809745] Re: Document module migration of "url" attachments
From: Fabien (Open ERP), 2011-09-17
-
[Bug 809745] Re: Document module migration of "url" attachments
From: Devishree Brahmbhatt (OpenERP), 2011-08-09
-
[Bug 809745] Re: Document module migration of "url" attachments
From: Launchpad Bug Tracker, 2011-08-09
-
[Bug 809745] Re: Document module migration of "url" attachments
From: Devishree Brahmbhatt (OpenERP), 2011-08-09
-
[Bug 809745] Re: Document module migration of "url" attachments
From: Amit Parik (OpenERP), 2011-08-09
-
[Bug 809745] Re: Document module migration of "url" attachments
From: Guewen Baconnier @ Camptocamp, 2011-08-09
-
[Bug 809745] Re: Document module migration of "url" attachments
From: Amit Parik (OpenERP), 2011-07-29
-
[Bug 809745] Re: Document module migration of "url" attachments
From: Guewen Baconnier @ Camptocamp, 2011-07-13
-
[Bug 809745] [NEW] Document module migration of "url" attachments
From: Guewen Baconnier @ Camptocamp, 2011-07-13
References