[FIX]: document: Fixed error in document yaml

bzr revid: rpa@tinyerp.com-20100713095006-6wii7got8r4jszf1
This commit is contained in:
rpa (Open ERP) 2010-07-13 15:20:06 +05:30
parent ccaa55e712
commit 723c5df587
1 changed files with 4 additions and 3 deletions

View File

@ -45,8 +45,9 @@
-
Attach a pdf file in "My document"
-
!python {model: ir.attachment}: |
!python {model: 'ir.attachment'}: |
import tools
import base64
file = open(tools.config['addons_path'] + '/document/test/partner.pdf')
id = self.write(cr, uid, [ref("document_1")], {'datas' : base64.encodestring(file.read())}, context)
pdf_file = open(tools.config['addons_path'] + '/document/test/partner.pdf')
self.write(cr, uid, [ref("document_1")], {'datas_fname': 'partner.pdf', 'datas' : base64.encodestring(pdf_file.read())}, context)