Chen Log

陳洛格

Archive for March 2014

RML之if…else判斷

leave a comment »

可使用

[[ 資料變數 == 0 and removeParentNode(‘para’) ]]

意思是:

如果 o.amount_tax 稅額總數等於零 就移除此段落,
此判斷需放在 para 符號範圍內。

[[ o.amount_tax == 0 and removeParentNode(‘para’) ]]

 

參考資料:

http://forum.openerp.com/forum/topic20739.html

 

Advertisements

Written by chenagw

2014/03/26 at 18:46

Posted in Uncategorized

Tagged with ,

RML檔案的空白符號 rml space character

leave a comment »

在RML裡面空白的符號是:『 &#160 』; (ISO Latin-1 code) 不是html的符號!

Punctuation HTML Entity
(case sensitive)
ISO Latin-1 code name or meaning
– en dash
— em dash
¡ ¡ ¡ inverted exclamation
¿ ¿ ¿ inverted question mark
" " quotation mark
“ left double curly quote
” right double curly quote
  ' apostrophe (single quote)
‘ left single curly quote
’ right single curly quote
«


»
«


»
«


»
guillemets (used as quotation marks in some languages, e.g., French)
  
(Its there, but you can’t see it!)
    non-breaking space
Symbols  
& & & ampersand
¢ ¢ ¢ cent
© © © copyright
÷ ÷ ÷ divide
> > > greater than
< &lt; < less than
µ &micro; µ micron
· &middot; · middle dot
&para; pilcrow (paragraph sign)
± &plusmn; ± plus/minus
&euro; Euro
£ &pound; £ British Pound Sterling
® &reg; ® registered
§ &sect; § section
&trade; trademark
¥ &yen; ¥ Japanese Yen
Diacritics  
á


Á
&aacute;


&Aacute;
á


Á
lower-case “a” with acute accent


upper-case “A” with acute accent
à


À
&agrave;


&Agrave;
à


À
lower-case “a” with grave accent


upper-case “A” with grave accent
â


Â
&acirc;


&Acirc;
â


Â
lower-case “a” with circumflex


upper-case “A” with circumflex
å


Å
&aring;


&Aring;
å


Å
lower-case “a” with ring


upper-case “A” with ring
ã


Ã
&atilde;


&Atilde;
ã


Ã
lower-case “a” with tilde


upper-case “A” with tilde
ä


Ä
&auml;


&Auml;
ä


Ä
lower-case “a” with diaeresis/umlaut


upper-case “A” with diaeresis/umlaut
æ


Æ
&aelig;


&AElig;
æ


Æ
lower-case “ae” ligature


upper-case “AE” ligature
ç


Ç
&ccedil;


&Ccedil;
ç


Ç
lower-case “c” with cedilla


upper-case “C” with cedilla
é


É
&eacute;


&Eacute;
é


É
lower-case “e” with acute accent


upper-case “E” with acute accent
è


È
&egrave;


&Egrave;
è


È
lower-case “e” with grave accent


upper-case “E” with grave accent
ê


Ê
&ecirc;


&Ecirc;
ê


Ê
lower-case “e” with circumflex


upper-case “E” with circumflex
ë


Ë
&euml;


&Euml;
ë


Ë
lower-case “e” with diaeresis/umlaut


upper-case “E” with diaeresis/umlaut
í


Í
&iacute;


&Iacute;
í


Í
lower-case “i” with acute accent


upper-case “I” with acute accent
ì


Ì
&igrave;


&Igrave;
ì


Ì
lower-case “i” with grave accent


upper-case “I” with grave accent
î


Î
&icirc;


&Icirc;
î


Î
lower-case “i” with circumflex


upper-case “I” with circumflex
ï


Ï
&iuml;


&Iuml;
ï


Ï
lower-case “i” with diaeresis/umlaut


upper-case “I” with diaeresis/umlaut
ñ


Ñ
&ntilde;


&Ntilde;
ñ


Ñ
lower-case “n” with tilde


upper-case “N” with tilde
ó


Ó
&oacute;


&Oacute;
ó


Ó
lower-case “o” with acute accent


upper-case “O” with acute accent
ò


Ò
&ograve;


&Ograve;
ò


Ò
lower-case “o” with grave accent


upper-case “O” with grave accent
ô


Ô
&ocirc;


&Ocirc;
ô


Ô
lower-case “o” with circumflex


upper-case “O” with circumflex
ø


Ø
&oslash;


&Oslash;
ø


Ø
lower-case “o” with slash


upper-case “O” with slash
õ


Õ
&otilde;


&Otilde;
õ


Õ
lower-case “o” with tilde


upper-case “O” with tilde
ö


Ö
&ouml;


&Ouml;
ö


Ö
lower-case “o” with diaeresis/umlaut


upper-case “O” with diaeresis/umlaut
ß &szlig; ß ess-tsett
ú


Ú
&uacute;


&Uacute;
ú


Ú
lower-case “u” with acute accent


upper-case “U” with acute accent
ù


Ù
&ugrave;


&Ugrave;
ù


Ù
lower-case “u” with grave accent


upper-case “U” with grave accent
û


Û
&ucirc;


&Ucirc;
û


Û
lower-case “u” with circumflex


upper-case “U” with circumflex
ü


Ü
&uuml;


&Uuml;
ü


Ü
lower-case “u” with diaeresis/umlaut


upper-case “U” with diaeresis/umlaut
ÿ &yuml; ÿ lower-case “y” with diaeresis/umlaut
´


`
  ´


`
acute accent with no letter


grave accent/reversed apostrophe with no letter

請參考: 

http://www.utexas.edu/learn/html/spchar.html

Written by chenagw

2014/03/26 at 18:19

Posted in Uncategorized

Tagged with , ,

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/

Written by chenagw

2014/03/26 at 17:37

Posted in Uncategorized

Tagged with , ,

如何cd進入有空白字元的目錄

leave a comment »

舉例而言:你的目錄名稱是 “Myname Backup”

要切換進去的方法就是:
cd Myname\ Backup

就是 \斜線 + 空白

Written by chenagw

2014/03/04 at 17:28

Posted in Uncategorized

Tagged with , ,