bzr revid: christophe@tinyerp.com-20090828164312-x6j4etkj67b6txpi
This commit is contained in:
Christophe Simonis 2009-08-28 18:43:12 +02:00
commit c8e7057f2f
3 changed files with 6 additions and 4 deletions

View File

@ -695,8 +695,9 @@ class document_file(osv.osv):
import urllib
datas=base64.encodestring(urllib.urlopen(vals['link']).read())
else:
datas=vals.get('datas',False)
vals['file_size']= len(datas)
datas = vals.get('datas',False)
vals['file_size']= datas and len(datas) or 0
if not self._check_duplication(cr,uid,vals):
raise except_orm(_('ValidateError'), _('File name must be unique!'))
result = super(document_file,self).create(cr, uid, vals, context)

View File

@ -101,7 +101,8 @@ class report_files_partner(osv.osv):
p.name as partner
from ir_attachment f
inner join res_partner p
on (f.partner_id=p.id)
on (f.partner_id=p.id)
where f.datas_fname is not null
group by p.name
)
""")

View File

@ -275,7 +275,7 @@
</field>
</record>
<record model="ir.actions.act_window" id="action_view_files_by_partner">
<field name="name">Files Per Month</field>
<field name="name">Files Per Partner</field>
<field name="res_model">report.files.partner</field>
<field name="view_id" ref="view_files_by_partner_graph"></field>
<field name="view_type">form</field>