Chen Log

陳洛格

OpenERP 編輯輸出PDF之RML檔設計參考資料

leave a comment »

  • [[ repeatIn(objects,’o’) ]] : Loop on each objects selected for the print 循環輸出

  • [[ repeatIn(o.invoice_line,’l’) ]] : Loop on every line 循環每一行

  • [[ repeatIn(o.invoice_line,’l’, ‘td’) ]] : Loop on every line and make a new table cell for each line. 循環每一行並產生新表格td

  • [[ (o.prop==’draft’)and ‘YES’ or ‘NO’ ]] : Print YES or NO according the field ‘prop’ 依據prop資料判斷是否可列印

  • [[ round(o.quantity * o.price * 0.9, 2) ]] : Operations are OK. 

  • [[ ‘%07d’ % int(o.number) ]] : Number formatting 數字格式

  • [[ reduce(lambda x, obj: x+obj.qty , list , 0 ) ]] : Total qty of list (try “objects” as list)

  • [[ user.name ]] : user name 使用者名稱

  • [[ setLang(o.partner_id.lang) ]] : Localized printings 本地化列印

  • [[ time.strftime(‘%d/%m/%Y’) ]] : Show the time in format=dd/MM/YYYY, check python doc for more about “%d”, … 自定日期

  • [[ time.strftime(time.ctime()[0:10]) ]] or [[ time.strftime(time.ctime()[-4:]) ]] : Prints only date. 列印日期

  • [[ time.ctime() ]] : Prints the actual date & time 列印日期與時間

  • [[ time.ctime().split()[3] ]] : Prints only time 單列印時間

  • [[ o.type in [‘in_invoice’, ‘out_invoice’] and ‘Invoice’ or removeParentNode(‘tr’) ]] : If the type is ‘in_invoice’ or ‘out_invoice’ then the word ‘Invoice’ is printed, if it’s neither the first node above it of type ‘tr’ will be removed.

請參考:

https://doc.openerp.com/v6.1/developer/05_reports/

Advertisements

Written by chenagw

2014/03/26 at 17:37

Posted in Uncategorized

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: