跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

C

cnkanglong

@cnkanglong
关于
帖子
11
主题
6
群组
0
粉丝
0
关注
0

帖子

最新 最佳 有争议的

  • OpenERP 关于rml报表的修改
    C cnkanglong

    再整理一下,一个rml表,主要包括以下几部分:

    第一部分:表的说明

    <br />&lt;?xml version=&quot;1.0&quot;?&gt;<br />&lt;document filename=&quot;test.pdf&quot;&gt;<br />&nbsp; &lt;template pageSize=&quot;(204.0,842.0)&quot; title=&quot;Receipt&quot; author=&quot;OpenERP S.A. ([email protected])&quot; allowSplitting=&quot;20&quot;&gt;<br />&nbsp; &nbsp; &lt;pageTemplate id=&quot;first&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;frame id=&quot;first&quot; x1=&quot;0.0&quot; y1=&quot;0.0&quot; width=&quot;204&quot; height=&quot;800&quot;/&gt;<br />&nbsp; &nbsp; &lt;/pageTemplate&gt;<br />&nbsp; &lt;/template&gt;<br />
    


    第二部分 表的格式,包括每个表的格线等

    <br />&nbsp; &lt;stylesheet&gt;<br />&nbsp; &nbsp; &lt;blockTableStyle id=&quot;Standard_Outline&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockAlignment value=&quot;LEFT&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockValign value=&quot;TOP&quot;/&gt;<br />&nbsp; &nbsp; &lt;/blockTableStyle&gt; <br />&nbsp; &nbsp; &lt;blockTableStyle id=&quot;Table10&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockAlignment value=&quot;LEFT&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockValign value=&quot;TOP&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;0,1&quot; stop=&quot;0,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;0,-1&quot; stop=&quot;0,-1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;1,1&quot; stop=&quot;1,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;1,-1&quot; stop=&quot;1,-1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;2,1&quot; stop=&quot;2,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;2,-1&quot; stop=&quot;2,-1&quot;/&gt;<br />&nbsp; &nbsp; &lt;/blockTableStyle&gt;<br />&nbsp; &nbsp; &lt;initialize&gt;<br />&nbsp; &nbsp; &nbsp; &lt;paraStyle name=&quot;all&quot; alignment=&quot;justify&quot;/&gt;<br />&nbsp; &nbsp; &lt;/initialize&gt;<br />&nbsp; &nbsp; &lt;/stylesheet&gt;<br />
    


    第三部分,表格内容

    <br /> &lt;story&gt;<br />&nbsp; &nbsp; &lt;blockTable colWidths=&quot;68.0,68.0,68.0&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Description&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Qty&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Price&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ repeatIn(o.lines,&#039;line&#039;) ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ line.product_id.name ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font color=&quot;white&quot;&gt; &lt;/font&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[o.state==&#039;cancel&#039; and o.statement_ids and &#039;-&#039; or &#039;&#039;]][&#91;&#039;%.f&#039; % line.qty ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[o.state==&#039;cancel&#039; and o.statement_ids and &#039;-&#039; or &#039;&#039;]][[ formatLang(net(line.id), currency_obj=company.currency_id) ]] &lt;font face=&quot;Helvetica&quot;&gt;[[ line and line.discount == 0.0 and removeParentNode(&#039;font&#039;) ]] ([[ formatLang(line.discount, currency_obj=company.currency_id) ]])&lt;/font&gt;&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &lt;/blockTable&gt;<br />&nbsp; &lt;/story&gt;<br />&lt;/document&gt;<br />
    


    就是以上三部分控制着一个表格


  • OpenERP 关于rml报表的修改
    C cnkanglong

    写的不对的地方,请大家指正


  • OpenERP 关于rml报表的修改
    C cnkanglong

    1.rml 报表的组成
        RML报表主要分两部分组成,第一部分是一个在打印目录里面的.py文件,还有.rml的打印文件,这两个文件共同形成了PDF文件。.这两个文件是一样的文件名,不同的扩展名。
      .py文件是一个python程序文件,由它来取数据库的值,并且进行数据计算。
      .rml文件是决定PDF的外观,表格和样式都由rml文件来生成的。一个报表的rml样式由两部分组成,一部分是表头,一部分是内容。分在两个不同的rml文件中,表头文件是一个公共文件。

    2.一个例子讲述rml文件
      下面我以一个POS单来讲述一下rml文件的组成,在代码中,我标记了,每段代码起到的是什么作用。
      为什么以POS单做为例子呢?因为POS单简单,代码少,但具有了rml打印文件的所有部分。
      这个代码已经不是原来的代码了,我已经删除了好多格式文字的代码,以便看的更清楚,事实上,这些代码,只起到装饰作用,做简单的报表,可以不用的。

    <br />&lt;?xml version=&quot;1.0&quot;?&gt;<br />&lt;document filename=&quot;test.pdf&quot;&gt;<br />&nbsp; &lt;template pageSize=&quot;(204.0,842.0)&quot; &lt;!-前面的数字代表打印纸张的大小,这个用数字表示的,也可以用cm表示,比如21cm。-&gt;title=&quot;Receipt&quot; author=&quot;OpenERP S.A. ([email protected])&quot; allowSplitting=&quot;20&quot;&gt;<br />&nbsp; &nbsp; &lt;pageTemplate id=&quot;first&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;frame id=&quot;first&quot; x1=&quot;0.0&quot; y1=&quot;0.0&quot; width=&quot;204&quot; height=&quot;800&quot;/&gt; &lt;!-这个数字代表的打印内容的大小,纸边界,起始位置,这个位置决定了生成文件后文字的位置,一般要测试才能知道具体位置-〉<br />&nbsp; &nbsp; &lt;/pageTemplate&gt;<br />&nbsp; &lt;/template&gt;<br />&nbsp; &lt;stylesheet&gt;〈!-这个标签是打印样式,表格样式 定义了表格名称,划线,文字的大小等等,可以不定义,表格没有线,文件一样大小-〉<br />&nbsp; &nbsp; &lt;blockTableStyle id=&quot;Standard_Outline&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockAlignment value=&quot;LEFT&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockValign value=&quot;TOP&quot;/&gt;<br />&nbsp; &nbsp; &lt;/blockTableStyle&gt; <br />&nbsp; &nbsp; &lt;blockTableStyle id=&quot;Table2&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockAlignment value=&quot;LEFT&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockValign value=&quot;TOP&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;1,0&quot; stop=&quot;1,0&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;!-上面的这行,kind=&quot;LINEABOVE&quot; 决定了表格划线 colorName=&quot;#000000&quot; 决定了表格线的颜色 start=&quot;1,0&quot; stop=&quot;1,0&quot;决定了划线的起止位置,没有这句,表格是没有线的 -&gt;<br />&nbsp; &nbsp; &lt;/blockTableStyle&gt;<br />&nbsp; &nbsp; &lt;blockTableStyle id=&quot;Table4&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockAlignment value=&quot;LEFT&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockValign value=&quot;TOP&quot;/&gt;<br />&nbsp; &nbsp; &lt;/blockTableStyle&gt;<br />&nbsp; &nbsp; &lt;blockTableStyle id=&quot;Table10&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockAlignment value=&quot;LEFT&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;blockValign value=&quot;TOP&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;0,1&quot; stop=&quot;0,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;0,-1&quot; stop=&quot;0,-1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;1,1&quot; stop=&quot;1,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;1,-1&quot; stop=&quot;1,-1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEABOVE&quot; colorName=&quot;#000000&quot; start=&quot;2,1&quot; stop=&quot;2,1&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &lt;lineStyle kind=&quot;LINEBELOW&quot; colorName=&quot;#e6e6e6&quot; start=&quot;2,-1&quot; stop=&quot;2,-1&quot;/&gt;<br />&nbsp; &nbsp; &lt;/blockTableStyle&gt;<br />&nbsp; &nbsp; &lt;initialize&gt;<br />&nbsp; &nbsp; &nbsp; &lt;paraStyle name=&quot;all&quot; alignment=&quot;justify&quot;/&gt;<br />&nbsp; &nbsp; &lt;/initialize&gt;<br />&nbsp; &nbsp; &lt;/stylesheet&gt;<br />&nbsp; &lt;story&gt;&lt;!-story开始就是表格的内容了,oe的数据就调用到这里-&gt;<br />&nbsp; &nbsp; &lt;para&gt;[[ repeatIn(objects,&#039;o&#039;) ]]&lt;/para&gt; &lt;!-para标签调用数据和要显示的文字,这个标签里面的内容就是表格内的内容-&gt;<br />&nbsp; &nbsp; &lt;para&gt;[[o.user_id.company_id.name]]&lt;/para&gt;<br />&nbsp; &nbsp; &lt;para&gt;[[ address and display_address(address)]]&lt;/para&gt;<br />&nbsp; &nbsp; &lt;para&gt;电话 : [[ address and address.phone ]]&lt;/para&gt;<br />&nbsp; &nbsp; &lt;para&gt;收银 : [[ o.user_id.name ]]&lt;/para&gt;<br />&nbsp; &nbsp; &lt;para&gt;超市 : [[ o.shop_id.name ]]&lt;/para&gt;<br />&nbsp; &nbsp; &lt;para&gt;时间 : [[ o.date_order ]]&lt;/para&gt;<br />&nbsp; &nbsp; &lt;para&gt;N° : [[ o.name ]]&lt;/para&gt;<br />&nbsp; &nbsp; &lt;blockTable colWidths=&quot;68.0,68.0,68.0&quot;&gt;&lt;!-一个blockTable标签就是一个表格,colWidths表格的宽度,后来字一个分号代表一个格,还有一个标签 rowHeights表格的高度-&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Description&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Qty&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Price&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;&lt;!-一个td代表一个格,一个tr代表表格的一行-&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ repeatIn(o.lines,&#039;line&#039;) ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ line.product_id.name ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;With a [[ line and line.discount == 0.0 and removeParentNode(&#039;font&#039;) ]] ([[ &#039;%.2f&#039; % line.discount ]]) % discount. &lt;!-百分号是格式化用的%.2f&#039;表示两位小数-&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font color=&quot;white&quot;&gt; &lt;/font&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[o.state==&#039;cancel&#039; and o.statement_ids and &#039;-&#039; or &#039;&#039;]][&#91;&#039;%.f&#039; % line.qty ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[o.state==&#039;cancel&#039; and o.statement_ids and &#039;-&#039; or &#039;&#039;]][[ formatLang(net(line.id), currency_obj=company.currency_id) ]] &lt;font face=&quot;Helvetica&quot;&gt;[[ line and line.discount == 0.0 and removeParentNode(&#039;font&#039;) ]] ([[ formatLang(line.discount, currency_obj=company.currency_id) ]])&lt;/font&gt;&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &lt;/blockTable&gt;<br />&nbsp; &nbsp; &lt;blockTable colWidths=&quot;136.0,68.0&quot; style=&quot;Table2&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Taxes :&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[o.state==&#039;cancel&#039; and o.statement_ids and &#039;-&#039; or &#039;&#039;]][[formatLang(o.amount_tax, currency_obj=company.currency_id)]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &lt;/blockTable&gt;<br />&nbsp; &nbsp; &lt;blockTable colWidths=&quot;136.0,68.0&quot; style=&quot;Table4&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Total :&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[o.state==&#039;cancel&#039; and o.statement_ids and &#039;-&#039; or &#039;&#039;]][[formatLang(o.amount_total, currency_obj=company.currency_id)]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &lt;/blockTable&gt;<br />&nbsp; &nbsp; &lt;blockTable colWidths=&quot;102.0,34.0,68.0&quot; style=&quot;Table10&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Payment Mode&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font&gt; &lt;/font&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;Amount&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ repeatIn(get_journal_amt(o),&#039;d&#039;) ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ d&#91;&#039;name&#039;] ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;font color=&quot;white&quot;&gt; &lt;/font&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para&gt;[[ formatLang(d&#91;&#039;amt&#039;] or 0, currency_obj=company.currency_id) ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/td&gt;<br />&nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />&nbsp; &nbsp; &lt;/blockTable&gt;<br />&nbsp; &lt;/story&gt;<br />&lt;/document&gt;<br />
    


      以上是对rml文件的分析,根据这个分析就能写出自己的rml文件了,但这只是一部分,因为你还不会调用其它数据到rml文件里面来。不过我们能够修改表格去掉不显示的东西,和完全重新画一个新样式的表格了。

    3.报表的表头
      即使这样,我们发现,如果使用系统表头的打印文件,默认的表头,在横线下面有很大一块空白。这样我们就要修改表头的rml文件,修改这个不用找到文件,在软件里就能修改。
      在设置-公司-公司-页眉页脚里时行修改。修改第一项“RML页眉”下面是我修改过的一个例子:

    <br />&lt;header&gt;<br />&nbsp; &nbsp; &lt;pageTemplate&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;frame id=&quot;first&quot; x1=&quot;1.3cm&quot; y1=&quot;3.0cm&quot; height=&quot;21.7cm&quot; width=&quot;19.0cm&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-上面这段代码表示了带表头打印的宽高,我说的那个空白是由y1=&quot;3.0cm&quot;控制的,是表的打印高度,改成6,文字就上去了,打印的位置比较合适-&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;  &lt;stylesheet&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- Set here the default font to use for all &lt;para&gt; tags --&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;paraStyle name=&#039;Normal&#039; fontName=&quot;DejaVu Sans&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;paraStyle name=&quot;main_footer&quot; fontSize=&quot;8.0&quot; alignment=&quot;CENTER&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;paraStyle name=&quot;main_header&quot; fontSize=&quot;8.0&quot; leading=&quot;10&quot; alignment=&quot;LEFT&quot; spaceBefore=&quot;0.0&quot; spaceAfter=&quot;0.0&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;  &lt;/stylesheet&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;pageGraphics&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- Set here the default font to use for all &lt;drawString&gt; tags --&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;setFont name=&quot;DejaVu Sans&quot; size=&quot;8&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- You Logo - Change X,Y,Width and Height --&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;image x=&quot;1.3cm&quot; y=&quot;27.7cm&quot; height=&quot;40.0&quot; &gt;[[ company.logo or removeParentNode(&#039;image&#039;) ]]&lt;/image&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fill color=&quot;black&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;stroke color=&quot;black&quot;/&gt;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- page header --&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;lines&gt;1.3cm 27.7cm 20cm 27.7cm&lt;/lines&gt;&lt;!-这个是表头的线,要保留-&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;drawRightString x=&quot;20cm&quot; y=&quot;27.8cm&quot;&gt;[[ company.rml_header1 ]]&lt;/drawRightString&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;drawString x=&quot;1.3cm&quot; y=&quot;27.3cm&quot;&gt;[[ company.partner_id.name ]]&lt;/drawString&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;place x=&quot;1.3cm&quot; y=&quot;25.3cm&quot; height=&quot;1.8cm&quot; width=&quot;15.0cm&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para style=&quot;main_header&quot;&gt;[[ display_address(company.partner_id) or&nbsp; &#039;&#039; ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/place&gt;&lt;!--phone这段是公司电话吧,可以删除这段话在表头里没啥用--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;drawString x=&quot;1.3cm&quot; y=&quot;25.0cm&quot;&gt;Phone:&lt;/drawString&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;drawRightString x=&quot;7cm&quot; y=&quot;25.0cm&quot;&gt;[[ company.partner_id.phone or &#039;&#039; ]]&lt;/drawRightString&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;drawString x=&quot;1.3cm&quot; y=&quot;24.6cm&quot;&gt;Mail:&lt;/drawString&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;drawRightString x=&quot;7cm&quot; y=&quot;24.6cm&quot;&gt;[[ company.partner_id.email or &#039;&#039; ]]&lt;/drawRightString&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;lines&gt;1.3cm 24.5cm 7cm 24.5cm&lt;/lines&gt;&lt;!--这个线可以不要,没啥用--&gt;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- left margin --&gt;&lt;!--这段代码是打印在底下左边的公司版权,那个90好像是文字旋转90度,改打印公司名字就在我加的**那里--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;rotate degrees=&quot;90&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fill color=&quot;grey&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;drawString x=&quot;2.65cm&quot; y=&quot;-0.4cm&quot;&gt;**power by openERP**&lt;/drawString&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fill color=&quot;black&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;rotate degrees=&quot;-90&quot;/&gt;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!--page bottom--&gt;&lt;!--这段是打印底下的页码和线,页码计算在这段代码里,自己写的rml代码可以参考这个--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;lines&gt;1.2cm 2.65cm 19.9cm 2.65cm&lt;/lines&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;place x=&quot;1.3cm&quot; y=&quot;0cm&quot; height=&quot;2.55cm&quot; width=&quot;19.0cm&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para style=&quot;main_footer&quot;&gt;[[ company.rml_footer ]]&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;para style=&quot;main_footer&quot;&gt;Contact : [[ user.name ]] - Page: &lt;pageNumber/&gt;&lt;/para&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/place&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/pageGraphics&gt;<br />&nbsp; &nbsp; &lt;/pageTemplate&gt;<br />&lt;/header&gt;<br />
    


    4.关于格式化.py文件
      这个文件我还没太弄懂,好像又称做解释器我只发我知道的,我看OE介绍,这个文件主要包括以下代码:

    <br />&nbsp;  import time<br />from report import report_sxw<br /><br />class order(report_sxw.rml_parse):<br />&nbsp; &nbsp; def __init__(self, cr, uid, name, context):<br />&nbsp; &nbsp; &nbsp; &nbsp; super(order, self).__init__(cr, uid, name, context)<br />&nbsp; &nbsp; &nbsp; &nbsp; self.localcontext.update({<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;time&#039;: time,<br />&nbsp; &nbsp; &nbsp; &nbsp; })<br /><br />report_sxw.report_sxw(&#039;report.sale.order&#039;, &#039;sale.order&#039;,<br />&nbsp; &nbsp; &nbsp; &#039;addons/sale/report/order.rml&#039;, parser=order, header=True)<br />
    


        就写到这,关于如何调用数据库数据,等我弄明白了,再给大家写出来,好像得用python代码。
        承德-至阳


  • 关于库存查询问题
    C cnkanglong

    关于打印问题,可以查询但没有打印,这个问题,是,点查询后说明前的方框,然后右面就有打印选项了。


  • 关于库存查询问题
    C cnkanglong

    我在做进销存测试中发现有如下问题:
    1.无法查看库存商品出入库流水
    2.无法查看单个商品出入库流水
    经向大家请教结果是在内部调拔中就能看到流水,可是我发现我的仓库菜单中没有这项。
    后重庆-mrshelly 告诉我,在技术项里
    我找到了,在设置-设置-仓库-库位和仓库-物流项里第一项: 管理多个地点和仓库
    英文: Manage multiple locations and warehouses 选上这个就有了
    查询时,在可追溯可以看到内部调拔,在那就会看到整个库房的,在搜索上可以看单个的
    谢谢!


  • 如何多机器布置 tinyerp
    C cnkanglong

    谢了,用你们的方法已经成功了


  • 如何多机器布置 tinyerp
    C cnkanglong

    异地客户端怎么才能连接上服务器端,比如都用windows,是不局域网,是互联网?


  • Tinyerp怎么实现产成品入库?
    C cnkanglong

    [size=99px]tinyerp怎么实现产成品入库?
    用生产模块如何实现?
    不用又如何实现?
    手册看不明白,谢谢大家了
    [/size]


  • 中文化 svn
    C cnkanglong

    我想下载我们论坛的SVN 中文翻译文件,可是提示错误,SVN的地址能不能再发一次?


  • 如何多机器布置 tinyerp
    C cnkanglong

    我在主机上安装了tinyerp,如果其它机器上,我怎么安装?只安装客户端吗?客户端怎么安装?


  • 我最近在UBUNTU8.04 下安装 TINYERP ,都没有打出PDF报表
    C cnkanglong

    我最近在UBUNTU8.04 和windows下安装 TINYERP ,都没有打出PDF报表,而且我下载界面和前面贴子所说的也不一样,能不能通过QQ传给我一下改好的版本?或者论坛出一个改好的通用版本

  • 登录

  • 没有帐号? 注册

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组