Document module migration of "url" attachments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP R&D Addons Team 1 |
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=
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=
Thanks
Regards
Guewen
Related branches
- Bhumika Shrimali (community): Approve
-
Diff: 11 lines (+1/-1)1 file modifieddocument/document.py (+1/-1)
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
status: | Fix Committed → Fix Released |
Hello Guewen,
I have checked your bug report as well as your patch.
you patch seems good.
you have described ERROR: null value in column "file_size" violates not-null constraint which is I am not able to reproduce at my end.
So would you please provide me the proper example or proper steps to reproduce it.
Thanks and waiting for your reply!