diff options
| author | Ysa (Open ERP) <ysa@tinyerp.co.in> | 2010-04-23 10:44:45 +0530 |
|---|---|---|
| committer | Ysa (Open ERP) <ysa@tinyerp.co.in> | 2010-04-23 10:44:45 +0530 |
| commit | bbf62704c4b23b3873704cc865cf97347f65d50b (patch) | |
| tree | 7b304248b0c19d50c43292c250db46cef24dd5f9 /addons/document/test/document_test.yml | |
| parent | 881c89b820ad41e06b0ac98aa1354afa2939cb0a (diff) | |
[ADD] add yml file for document and document_ftp module.
bzr revid: ysa@tinyerp.co.in-20100423051445-pqs46sawemex2dda
Diffstat (limited to 'addons/document/test/document_test.yml')
| -rw-r--r-- | addons/document/test/document_test.yml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/addons/document/test/document_test.yml b/addons/document/test/document_test.yml new file mode 100644 index 00000000000..fe3008d35da --- /dev/null +++ b/addons/document/test/document_test.yml @@ -0,0 +1,52 @@ +- | + In order to test the Document Management System In OpenERP. +- + In order to test behaviour of resource Directory I will make one resource Directory "Partner Labels" in OpenERP having type "Other Resources" and Directory mapped to object "Partner" +- + !record {model: 'document.directory', id: dir_partner_label}: + name : "Partner Labels" + storage_id : storage_default + type : ressource + content_ids: + - name: "Label" + report_id : base.res_partner_address_report +- + Assign "res.partner" object to ressource_type_id. +- + !python {model: document.directory}: | + ids = self.pool.get('ir.model').search(cr, uid, [('model','=','res.partner')]) + id = self.write(cr, uid, [ref("dir_partner_label")], {'ressource_type_id' : ids[0]}, context) +- + In order to check static directory in OpenERP which is the real directory just like system's local folders, + First I create a directory in OpenERP named "Directory 1" with storage as "Default File storage" and type as "Static Directory" +- + !record {model: 'document.directory', id: directory_1}: + name : "Directory 1" + storage_id : storage_default + type : directory +- + In order to make a directory hierarchy in OpenERP I will make other static directory "Directory 2" and I put its Parent Item as "Directory 1", + So I can see the directory hierarchy in OpenERP's client like :- Directory1 -> Directory2 +- + !record {model: 'document.directory', id: directory_2}: + name : "Directory 2" + storage_id : storage_default + type : directory + parent_id : directory_1 +- + I am create a one Document Attachment name "My document" and select "Directory 2" as its Directory, + And in order to put a File content. +- + When I am creating the document then "Resource Title" is filled automatic with "My document". +- + !record {model: 'ir.attachment', id: document_1}: + name : "My document" + parent_id : directory_2 +- + Attach a pdf file in "My document" +- + !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) |
