ftp error if name field is a date

Bug #400326 reported by Ferdinand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Harry (OpenERP)

Bug Description

branch-server 1803
branch-addons official 2375
branch-addons chricar_5.0_price_unit 2376

chricar.tenant has the fields
 'name' : fields.date ('From', required=True),
 'partner_id' : fields.many2one('res.partner','Tenant', select=True, required=True),

the directory name is displayed correctly, but trying to enter the directory causes an error

btw I'd like to include the tenants name (partner_id) in the directory name
is there a special function which returns directory names or do I have to overwrite name_get ?
thank you

[2009-07-16 18:39:45,337] ERROR:FTP:[01]: Environment_Information :
[2009-07-16 18:39:45,338] ERROR:FTP:[02]: PlatForm : linux2
[2009-07-16 18:39:45,339] ERROR:FTP:[03]: Operating System : posix
[2009-07-16 18:39:45,339] ERROR:FTP:[04]: Operating System Version : [GCC 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036]]
[2009-07-16 18:39:45,339] ERROR:FTP:[05]: Operating System Locale : en_US
[2009-07-16 18:39:45,339] ERROR:FTP:[06]: Python Version : 2.5.2
[2009-07-16 18:39:45,339] ERROR:FTP:[07]: OpenERP-Server Version : 5.0.1
[2009-07-16 18:39:45,340] ERROR:FTP:[08]: Last revision Details:
[2009-07-16 18:39:45,340] ERROR:FTP:[09]: revno: 1803 [merge]
[2009-07-16 18:39:45,340] ERROR:FTP:[10]: committer: Olivier Laurent <email address hidden>
[2009-07-16 18:39:45,340] ERROR:FTP:[11]: branch nick: server
[2009-07-16 18:39:45,340] ERROR:FTP:[12]: timestamp: Thu 2009-07-09 10:39:13 +0200
[2009-07-16 18:39:45,340] ERROR:FTP:[13]: Traceback (most recent call last):
[2009-07-16 18:39:45,341] ERROR:FTP:[14]: File "/usr/lib64/python2.5/asyncore.py", line 68, in read
[2009-07-16 18:39:45,341] ERROR:FTP:[15]: obj.handle_read_event()
[2009-07-16 18:39:45,341] ERROR:FTP:[16]: File "/usr/lib64/python2.5/asyncore.py", line 390, in handle_read_event
[2009-07-16 18:39:45,341] ERROR:FTP:[17]: self.handle_read()
[2009-07-16 18:39:45,341] ERROR:FTP:[18]: File "/usr/lib64/python2.5/asynchat.py", line 137, in handle_read
[2009-07-16 18:39:45,342] ERROR:FTP:[19]: self.found_terminator()
[2009-07-16 18:39:45,342] ERROR:FTP:[20]: File "/home/terp/OpenERP/branch/server/5.0/bin/addons/document/ftpserver/ftpserver.py", line 1577, in found_terminator
[2009-07-16 18:39:45,342] ERROR:FTP:[21]: method(arg) # call the proper ftp_* method
[2009-07-16 18:39:45,342] ERROR:FTP:[22]: File "/home/terp/OpenERP/branch/server/5.0/bin/addons/document/ftpserver/ftpserver.py", line 2555, in ftp_SIZE
[2009-07-16 18:39:45,342] ERROR:FTP:[23]: path = self.fs.ftp2fs(line, datacr)
[2009-07-16 18:39:45,342] ERROR:FTP:[24]: File "/home/terp/OpenERP/branch/server/5.0/bin/addons/document/ftpserver/abstracted_fs.py", line 194, in ftp2fs
[2009-07-16 18:39:45,343] ERROR:FTP:[25]: res = pool.get('document.directory').get_object(cr, uid, path2[:])
[2009-07-16 18:39:45,343] ERROR:FTP:[26]: File "/home/terp/OpenERP/branch/server/5.0/bin/addons/document/document.py", line 367, in get_object
[2009-07-16 18:39:45,343] ERROR:FTP:[27]: node = node.child(path)
[2009-07-16 18:39:45,343] ERROR:FTP:[28]: File "/home/terp/OpenERP/branch/server/5.0/bin/addons/document/document.py", line 230, in child
[2009-07-16 18:39:45,343] ERROR:FTP:[29]: res = self._child_get(name)
[2009-07-16 18:39:45,343] ERROR:FTP:[30]: File "/home/terp/OpenERP/branch/server/5.0/bin/addons/document/document.py", line 208, in _child_get
[2009-07-16 18:39:45,344] ERROR:FTP:[31]: ids = obj.search(self.cr, self.uid, where)
[2009-07-16 18:39:45,344] ERROR:FTP:[32]: File "/home/terp/OpenERP/branch/server/5.0/bin/osv/orm.py", line 2690, in search
[2009-07-16 18:39:45,344] ERROR:FTP:[33]: cr.execute('select %s.id from ' % self._table + ','.join(tables) +qu1+' order by '+order_by+limit_str+offset_str, qu2)
[2009-07-16 18:39:45,344] ERROR:FTP:[34]: File "/home/terp/OpenERP/branch/server/5.0/bin/sql_db.py", line 76, in wrapper
[2009-07-16 18:39:45,344] ERROR:FTP:[35]: return f(self, *args, **kwargs)
[2009-07-16 18:39:45,344] ERROR:FTP:[36]: File "/home/terp/OpenERP/branch/server/5.0/bin/sql_db.py", line 120, in execute
[2009-07-16 18:39:45,345] ERROR:FTP:[37]: res = self._obj.execute(query, params)
[2009-07-16 18:39:45,345] ERROR:FTP:[38]: ProgrammingError: operator does not exist: date ~~ unknown
[2009-07-16 18:39:45,345] ERROR:FTP:[39]: LINE 1: ...r_tenant.top_id in (28)) AND (chricar_tenant.name like E'%20...
[2009-07-16 18:39:45,345] ERROR:FTP:[40]: ^
[2009-07-16 18:39:45,345] ERROR:FTP:[41]: HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

Related branches

Revision history for this message
Ferdinand (office-chricar) wrote :
Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

Thanks to reporting. It should be work. Should use '=' operator instead of 'like' operator.

Changed in openobject-addons:
assignee: nobody → Harry (Open ERP) (hmo-tinyerp)
status: New → Confirmed
Revision history for this message
Ferdinand (office-chricar) wrote :

Queestion - is there a special function which returns directory names or do I have to overwrite name_get

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

In document module, _child_get function returns directory nodes. does not have any function which returns only directory names.

and your case, you have name field as a date. so DMS try to search node with where condition : [('name','like','2009-07-17')]. and sql try to find record in database. and it see name is date field. so it give error. so I do not think, your problem will be solve after overwrite name_get method.

or
you can add one field 'dirname' (char or function field ) in your model.

but I would like to correct this problem in document module. : use '=' operator instead of 'like' operator. so sql can search record like : [('name','=','2009-07-17')]

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

revision-id: <email address hidden>
date: 2009-07-17 12:33:32 +0530
build-date: 2009-07-17 12:38:19 +0530
revno: 2382
branch-nick: 5.0

Changed in openobject-addons:
status: Confirmed → Fix Released
Revision history for this message
Ferdinand (office-chricar) wrote :

branch-server 1810
branch-addons official 2383
branch-addons chricar_5.0_price_unit 2379

sorry - I now get
<objectname><id> as directory name

Changed in openobject-addons:
status: Fix Released → New
Revision history for this message
Ferdinand (office-chricar) wrote :

only if the field is a date

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

<objectname><id>. This is possible if value of name is blank or False

Revision history for this message
Ferdinand (office-chricar) wrote :

no the field is mandatory in this case

Revision history for this message
Ferdinand (office-chricar) wrote :

and it was reported correctly BOFORE the last changes

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

hmmm... this is possible if only if name or dirname field is blank or False
has your model 'dirname' field with blank value ? can u check value of dirname or name field in your db?

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

Soory I confirm this bug.. I will resolve it soon. it's due small mistake by me

Revision history for this message
Ferdinand (office-chricar) wrote :

I'll check tomorrow

Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

revision-id: <email address hidden>
date: 2009-07-17 14:38:33 +0530
build-date: 2009-07-17 14:39:05 +0530
revno: 2384
branch-nick: 5.0

Changed in openobject-addons:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.