From 60ea76e4c5b620b53177fa4404b9c3bd90ce2b9c Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 29 Jan 2009 23:22:23 +0100 Subject: [PATCH] [IMP] Integrate the headers from the old custom module bzr revid: stephane@tinyerp.com-20090129222223-ac7pa5yrq1xohbu4 --- bin/addons/base/report/corporate_defaults.xml | 23 ++ .../base/report/corporate_odt_header.xml | 248 ++++++++++++++++++ .../base/report/corporate_sxw_header.xml | 246 +++++++++++++++++ bin/addons/base/report/custom_report.xml | 6 + bin/addons/base/report/custom_view.xml | 5 + bin/addons/base/res/res_company.py | 3 +- bin/report/interface.py | 5 +- bin/report/report_sxw.py | 6 +- 8 files changed, 535 insertions(+), 7 deletions(-) create mode 100644 bin/addons/base/report/corporate_defaults.xml create mode 100644 bin/addons/base/report/corporate_odt_header.xml create mode 100644 bin/addons/base/report/corporate_sxw_header.xml create mode 100644 bin/addons/base/report/custom_report.xml create mode 100644 bin/addons/base/report/custom_view.xml diff --git a/bin/addons/base/report/corporate_defaults.xml b/bin/addons/base/report/corporate_defaults.xml new file mode 100644 index 00000000000..cef5acdd020 --- /dev/null +++ b/bin/addons/base/report/corporate_defaults.xml @@ -0,0 +1,23 @@ + + + + + + + + <name type="field" name="partner_id.name"/> + <address type="zoom" name="partner_id.address"> + <street type="field" name="street"/> + <zip type="field" name="zip"/> + <city type="field" name="city"/> + <state type="field" name="state_id.name"/> + <country type="field" name="country_id.name"/> + <phone type="field" name="phone"/> + <email type="field" name="email"/> + </address> + </corporation> + <user> + <name type="field" name="name"/> + <signature type="field" name="signature"/> + </user> +</corporate-header> diff --git a/bin/addons/base/report/corporate_odt_header.xml b/bin/addons/base/report/corporate_odt_header.xml new file mode 100644 index 00000000000..b27eeda8ccb --- /dev/null +++ b/bin/addons/base/report/corporate_odt_header.xml @@ -0,0 +1,248 @@ +<?xml version="1.0" encoding="UTF-8"?> +<office:document-styles xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" office:version="1.1"> + <office:font-face-decls> + <style:font-face style:name="Helvetica" svg:font-family="Helvetica"/> + <style:font-face style:name="Times" svg:font-family="Times"/> + <style:font-face style:name="Helvetica1" svg:font-family="Helvetica" style:font-family-generic="swiss"/> + <style:font-face style:name="Monospace" svg:font-family="Monospace" style:font-pitch="fixed"/> + <style:font-face style:name="DejaVu Sans" svg:font-family="'DejaVu Sans'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="true"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" fo:font-size="12pt" fo:language="en" fo:country="IN" style:letter-kerning="true" style:font-size-asian="10.5pt" style:language-asian="zxx" style:country-asian="none" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" style:font-name="Times" fo:font-size="12pt" fo:language="en" fo:country="IN" style:letter-kerning="true" style:font-name-asian="DejaVu Sans" style:font-size-asian="10.5pt" style:language-asian="zxx" style:country-asian="none" style:font-name-complex="DejaVu Sans" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="always"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text"> + <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/> + </style:style> + <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text"> + <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always"/> + <style:text-properties style:font-name="Helvetica" fo:font-size="14pt" style:font-name-asian="DejaVu Sans" style:font-size-asian="14pt" style:font-name-complex="DejaVu Sans" style:font-size-complex="14pt"/> + </style:style> + <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list"> + <style:text-properties style:font-name="Times" style:font-size-asian="12pt"/> + </style:style> + <style:style style:name="Header" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:paragraph-properties text:number-lines="false" text:line-number="0"> + <style:tab-stops> + <style:tab-stop style:position="8.498cm" style:type="center"/> + <style:tab-stop style:position="16.999cm" style:type="right"/> + </style:tab-stops> + </style:paragraph-properties> + <style:text-properties fo:color="#0000ff" style:font-size-asian="10.5pt"/> + </style:style> + <style:style style:name="Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:paragraph-properties text:number-lines="false" text:line-number="0"> + <style:tab-stops> + <style:tab-stop style:position="8.498cm" style:type="center"/> + <style:tab-stop style:position="16.999cm" style:type="right"/> + </style:tab-stops> + </style:paragraph-properties> + </style:style> + <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:paragraph-properties text:number-lines="false" text:line-number="0"/> + </style:style> + <style:style style:name="Table_20_Heading" style:display-name="Table Heading" style:family="paragraph" style:parent-style-name="Table_20_Contents" style:class="extra"> + <style:paragraph-properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0"/> + <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/> + </style:style> + <style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:paragraph-properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" text:number-lines="false" text:line-number="0"/> + <style:text-properties style:font-name="Times" fo:font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt" style:font-style-asian="italic" style:font-size-complex="12pt" style:font-style-complex="italic"/> + </style:style> + <style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index"> + <style:paragraph-properties text:number-lines="false" text:line-number="0"/> + <style:text-properties style:font-name="Times" style:font-size-asian="12pt"/> + </style:style> + <style:style style:name="Footnote_20_Symbol" style:display-name="Footnote Symbol" style:family="text"/> + <style:style style:name="Endnote_20_Symbol" style:display-name="Endnote Symbol" style:family="text"/> + <style:style style:name="Graphics" style:family="graphic"> + <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="dynamic" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/> + </style:style> + <text:outline-style> + <text:outline-level-style text:level="1" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="2" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="3" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="4" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="5" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="6" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="7" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="8" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="9" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="10" style:num-format=""> + <style:list-level-properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + </text:outline-style> + <text:notes-configuration text:note-class="footnote" text:citation-style-name="Footnote_20_Symbol" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/> + <text:notes-configuration text:note-class="endnote" text:citation-style-name="Endnote_20_Symbol" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/> + <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="Table2" style:family="table"> + <style:table-properties style:width="16.999cm" table:align="margins"/> + </style:style> + <style:style style:name="Table2.A" style:family="table-column"> + <style:table-column-properties style:column-width="4.235cm" style:rel-column-width="16329*"/> + </style:style> + <style:style style:name="Table2.B" style:family="table-column"> + <style:table-column-properties style:column-width="12.764cm" style:rel-column-width="49206*"/> + </style:style> + <style:style style:name="Table2.A1" style:family="table-cell"> + <style:table-cell-properties style:vertical-align="bottom" fo:padding="0.097cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.018cm solid #000000"/> + </style:style> + <style:style style:name="Table3" style:family="table"> + <style:table-properties style:width="7.936cm" table:align="left"/> + </style:style> + <style:style style:name="Table3.A" style:family="table-column"> + <style:table-column-properties style:column-width="1.933cm"/> + </style:style> + <style:style style:name="Table3.B" style:family="table-column"> + <style:table-column-properties style:column-width="6.003cm"/> + </style:style> + <style:style style:name="Table3.A1" style:family="table-cell"> + <style:table-cell-properties style:vertical-align="bottom" fo:padding="0.097cm" fo:border="none"/> + </style:style> + <style:style style:name="Table3.A2" style:family="table-cell"> + <style:table-cell-properties style:vertical-align="bottom" fo:padding="0.097cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.018cm solid #000000"/> + </style:style> + <style:style style:name="Table1" style:family="table"> + <style:table-properties style:width="16.999cm" table:align="margins"/> + </style:style> + <style:style style:name="Table1.A" style:family="table-column"> + <style:table-column-properties style:column-width="16.999cm" style:rel-column-width="65535*"/> + </style:style> + <style:style style:name="Table1.A1" style:family="table-cell"> + <style:table-cell-properties fo:background-color="transparent" fo:padding="0.097cm" fo:border-left="none" fo:border-right="none" fo:border-top="0.018cm solid #000000" fo:border-bottom="none"> + <style:background-image/> + </style:table-cell-properties> + </style:style> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Header"> + <style:text-properties fo:color="#0000ff" style:font-name="Helvetica1" fo:font-size="30pt" style:font-name-asian="Monospace" style:font-size-asian="30pt" style:font-name-complex="Monospace" style:font-size-complex="30pt"/> + </style:style> + <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Table_20_Contents"> + <style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/> + <style:text-properties fo:color="#0000ff" style:font-name="Helvetica1" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Header"> + <style:text-properties style:font-name="Monospace" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P4" style:family="paragraph" style:parent-style-name="Table_20_Contents"> + <style:text-properties fo:color="#0000ff" style:font-name="Helvetica1" fo:font-size="10pt" style:font-size-asian="8.75pt" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P5" style:family="paragraph" style:parent-style-name="Table_20_Contents"> + <style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/> + <style:text-properties fo:color="#0000ff" style:font-name="Monospace" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P6" style:family="paragraph" style:parent-style-name="Header"> + <style:text-properties style:font-name="Helvetica1" fo:font-size="10pt" style:font-size-asian="8.75pt" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P7" style:family="paragraph" style:parent-style-name="Footer"> + <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/> + <style:text-properties fo:color="#0000ff" style:font-name="Helvetica1" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style> + <style:header-footer-properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.499cm"/> + </style:header-style> + <style:footer-style> + <style:header-footer-properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm"/> + </style:footer-style> + </style:page-layout> + <style:page-layout style:name="pm2"> + <style:page-layout-properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"> + <style:header> + <table:table table:name="Table2" table:style-name="Table2"> + <table:table-column table:style-name="Table2.A"/> + <table:table-column table:style-name="Table2.B"/> + <table:table-row> + <table:table-cell table:style-name="Table2.A1" office:value-type="string"> + <text:p text:style-name="P1">Tiny sprl</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table2.A1" office:value-type="string"> + <text:p text:style-name="P2"/> + </table:table-cell> + </table:table-row> + </table:table> + <text:p text:style-name="P3"/> + <text:p text:style-name="P3">- </text:p> + <table:table table:name="Table3" table:style-name="Table3"> + <table:table-column table:style-name="Table3.A"/> + <table:table-column table:style-name="Table3.B"/> + <table:table-row> + <table:table-cell table:style-name="Table3.A1" office:value-type="string"> + <text:p text:style-name="P4">Phone :</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table3.A1" office:value-type="string"> + <text:p text:style-name="P5"/> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell table:style-name="Table3.A2" office:value-type="string"> + <text:p text:style-name="P4">Mail :</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table3.A2" office:value-type="string"> + <text:p text:style-name="P5"/> + </table:table-cell> + </table:table-row> + </table:table> + <text:p text:style-name="P6"/> + </style:header> + <style:footer> + <table:table table:name="Table1" table:style-name="Table1"> + <table:table-column table:style-name="Table1.A"/> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p text:style-name="P7"/> + <text:p text:style-name="P7"/> + <text:p text:style-name="P7">Contact : Administrator</text:p> + </table:table-cell> + </table:table-row> + </table:table> + </style:footer> + </style:master-page> + <style:master-page style:name="Endnote" style:page-layout-name="pm2"/> + </office:master-styles> +</office:document-styles> \ No newline at end of file diff --git a/bin/addons/base/report/corporate_sxw_header.xml b/bin/addons/base/report/corporate_sxw_header.xml new file mode 100644 index 00000000000..2f6f885f3ba --- /dev/null +++ b/bin/addons/base/report/corporate_sxw_header.xml @@ -0,0 +1,246 @@ +<?xml version="1.0" encoding="UTF-8"?> +<office:document-styles xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" office:version="1.0"> + <office:font-decls> + <style:font-decl style:name="Helvetica" fo:font-family="Helvetica"/> + <style:font-decl style:name="Times" fo:font-family="Times"/> + <style:font-decl style:name="Helvetica1" fo:font-family="Helvetica" style:font-family-generic="swiss"/> + <style:font-decl style:name="Monospace" fo:font-family="Monospace" style:font-pitch="fixed"/> + <style:font-decl style:name="DejaVu Sans" fo:font-family="'DejaVu Sans'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-decls> + <office:styles> + <style:default-style style:family="graphics"> + <style:properties draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false" style:use-window-font-color="true" fo:font-size="12pt" fo:language="en" fo:country="IN" style:letter-kerning="true" style:font-size-asian="10.5pt" style:language-asian="zxx" style:country-asian="none" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none"> + <style:tab-stops/> + </style:properties> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page" style:use-window-font-color="true" style:font-name="Times" fo:font-size="12pt" fo:language="en" fo:country="IN" style:letter-kerning="true" style:font-name-asian="DejaVu Sans" style:font-size-asian="10.5pt" style:language-asian="zxx" style:country-asian="none" style:font-name-complex="DejaVu Sans" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/> + </style:default-style> + <style:default-style style:family="table"> + <style:properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:properties fo:keep-together="always"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <style:style style:name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text"> + <style:properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/> + </style:style> + <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text body" style:class="text"> + <style:properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="true" style:font-name="Helvetica" fo:font-size="14pt" style:font-name-asian="DejaVu Sans" style:font-size-asian="14pt" style:font-name-complex="DejaVu Sans" style:font-size-complex="14pt"/> + </style:style> + <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text body" style:class="list"> + <style:properties style:font-name="Times" style:font-size-asian="12pt"/> + </style:style> + <style:style style:name="Header" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:properties text:number-lines="false" text:line-number="0" fo:color="#0000ff" style:font-size-asian="10.5pt"> + <style:tab-stops> + <style:tab-stop style:position="8.498cm" style:type="center"/> + <style:tab-stop style:position="16.999cm" style:type="right"/> + </style:tab-stops> + </style:properties> + </style:style> + <style:style style:name="Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:properties text:number-lines="false" text:line-number="0"> + <style:tab-stops> + <style:tab-stop style:position="8.498cm" style:type="center"/> + <style:tab-stop style:position="16.999cm" style:type="right"/> + </style:tab-stops> + </style:properties> + </style:style> + <style:style style:name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:properties text:number-lines="false" text:line-number="0"/> + </style:style> + <style:style style:name="Table Heading" style:family="paragraph" style:parent-style-name="Table Contents" style:class="extra"> + <style:properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0" fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/> + </style:style> + <style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra"> + <style:properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" text:number-lines="false" text:line-number="0" style:font-name="Times" fo:font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt" style:font-style-asian="italic" style:font-size-complex="12pt" style:font-style-complex="italic"/> + </style:style> + <style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index"> + <style:properties text:number-lines="false" text:line-number="0" style:font-name="Times" style:font-size-asian="12pt"/> + </style:style> + <style:style style:name="Footnote Symbol" style:family="text"/> + <style:style style:name="Endnote Symbol" style:family="text"/> + <style:style style:name="Graphics" style:family="graphics"> + <style:properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="dynamic" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/> + </style:style> + <text:outline-style> + <text:outline-level-style text:level="1" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="2" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="3" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="4" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="5" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="6" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="7" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="8" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="9" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + <text:outline-level-style text:level="10" style:num-format=""> + <style:properties text:min-label-distance="0.381cm"/> + </text:outline-level-style> + </text:outline-style> + <text:footnotes-configuration text:citation-style-name="Footnote Symbol" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/> + <text:endnotes-configuration text:citation-style-name="Endnote Symbol" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/> + <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="Table2" style:family="table"> + <style:properties style:width="16.999cm" table:align="margins"/> + </style:style> + <style:style style:name="Table2.A" style:family="table-column"> + <style:properties style:column-width="4.235cm" style:rel-column-width="16329*"/> + </style:style> + <style:style style:name="Table2.B" style:family="table-column"> + <style:properties style:column-width="12.764cm" style:rel-column-width="49206*"/> + </style:style> + <style:style style:name="Table2.A1" style:family="table-cell"> + <style:properties fo:vertical-align="bottom" fo:padding="0.097cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.018cm solid #000000"/> + </style:style> + <style:style style:name="Table3" style:family="table"> + <style:properties style:width="7.936cm" table:align="left"/> + </style:style> + <style:style style:name="Table3.A" style:family="table-column"> + <style:properties style:column-width="1.933cm"/> + </style:style> + <style:style style:name="Table3.B" style:family="table-column"> + <style:properties style:column-width="6.003cm"/> + </style:style> + <style:style style:name="Table3.A1" style:family="table-cell"> + <style:properties fo:vertical-align="bottom" fo:padding="0.097cm" fo:border="none"/> + </style:style> + <style:style style:name="Table3.A2" style:family="table-cell"> + <style:properties fo:vertical-align="bottom" fo:padding="0.097cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.018cm solid #000000"/> + </style:style> + <style:style style:name="Table1" style:family="table"> + <style:properties style:width="16.999cm" table:align="margins"/> + </style:style> + <style:style style:name="Table1.A" style:family="table-column"> + <style:properties style:column-width="16.999cm" style:rel-column-width="65535*"/> + </style:style> + <style:style style:name="Table1.A1" style:family="table-cell"> + <style:properties fo:background-color="transparent" fo:padding="0.097cm" fo:border-left="none" fo:border-right="none" fo:border-top="0.018cm solid #000000" fo:border-bottom="none"> + <style:background-image/> + </style:properties> + </style:style> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Header"> + <style:properties fo:color="#0000ff" style:font-name="Helvetica1" fo:font-size="30pt" style:font-name-asian="Monospace" style:font-size-asian="30pt" style:font-name-complex="Monospace" style:font-size-complex="30pt"/> + </style:style> + <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Table Contents"> + <style:properties fo:text-align="end" style:justify-single-word="false" fo:color="#0000ff" style:font-name="Helvetica1" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Header"> + <style:properties style:font-name="Monospace" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P4" style:family="paragraph" style:parent-style-name="Table Contents"> + <style:properties fo:color="#0000ff" style:font-name="Helvetica1" fo:font-size="10pt" style:font-size-asian="8.75pt" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P5" style:family="paragraph" style:parent-style-name="Table Contents"> + <style:properties fo:text-align="end" style:justify-single-word="false" fo:color="#0000ff" style:font-name="Monospace" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P6" style:family="paragraph" style:parent-style-name="Header"> + <style:properties style:font-name="Helvetica1" fo:font-size="10pt" style:font-size-asian="8.75pt" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P7" style:family="paragraph" style:parent-style-name="Footer"> + <style:properties fo:text-align="center" style:justify-single-word="false" fo:color="#0000ff" style:font-name="Helvetica1" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="P8" style:family="paragraph" style:parent-style-name="Footer"> + <style:properties fo:text-align="center" style:justify-single-word="false" style:font-name="Helvetica1" fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/> + </style:style> + <style:style style:name="T1" style:family="text"> + <style:properties fo:color="#0000ff"/> + </style:style> + <style:style style:name="T2" style:family="text"> + <style:properties fo:color="#0000ff" fo:font-size="10pt" style:font-name-asian="Monospace" style:font-size-asian="10pt" style:font-name-complex="Monospace" style:font-size-complex="10pt"/> + </style:style> + <style:page-master style:name="pm1"> + <style:properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:properties> + <style:header-style> + <style:properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.499cm"/> + </style:header-style> + <style:footer-style> + <style:properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm"/> + </style:footer-style> + </style:page-master> + <style:page-master style:name="pm2"> + <style:properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm"> + <style:footnote-sep style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:properties> + <style:header-style/> + <style:footer-style/> + </style:page-master> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-master-name="pm1"> + <style:header> + <table:table table:name="Table2" table:style-name="Table2"> + <table:table-column table:style-name="Table2.A"/> + <table:table-column table:style-name="Table2.B"/> + <table:table-row> + <table:table-cell table:style-name="Table2.A1" table:value-type="string"> + <text:p text:style-name="P1">[[ company.partner_id.name ]]</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table2.A1" table:value-type="string"> + <text:p text:style-name="P2">[[ company.rml_header1 ]]</text:p> + </table:table-cell> + </table:table-row> + </table:table> + <text:p text:style-name="P3">[[ company.partner_id.address and company.partner_id.address[0].street ]]</text:p> + <text:p text:style-name="P3">[[ company.partner_id.address and company.partner_id.address[0].zip ]] [[ company.partner_id.address and company.partner_id.address[0].city ]] - [[ company.partner_id.address and company.partner_id.address[0].country_id and company.partner_id.address[0].country_id.name ]]</text:p> + <table:table table:name="Table3" table:style-name="Table3"> + <table:table-column table:style-name="Table3.A"/> + <table:table-column table:style-name="Table3.B"/> + <table:table-row> + <table:table-cell table:style-name="Table3.A1" table:value-type="string"> + <text:p text:style-name="P4">Phone :</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table3.A1" table:value-type="string"> + <text:p text:style-name="P5">[[ company.partner_id.address and company.partner_id.address[0].phone ]]</text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell table:style-name="Table3.A2" table:value-type="string"> + <text:p text:style-name="P4">Mail :</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table3.A2" table:value-type="string"> + <text:p text:style-name="P5">[[ company.partner_id.address and company.partner_id.address[0].email ]]</text:p> + </table:table-cell> + </table:table-row> + </table:table> + <text:p text:style-name="P6"/> + </style:header> + <style:footer> + <table:table table:name="Table1" table:style-name="Table1"> + <table:table-column table:style-name="Table1.A"/> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" table:value-type="string"> + <text:p text:style-name="P7">[[ company.rml_footer1 ]]</text:p> + <text:p text:style-name="P7">[[ company.rml_footer2 ]]</text:p> + <text:p text:style-name="P7">Contact : [[ user.name ]]</text:p> + </table:table-cell> + </table:table-row> + </table:table> + </style:footer> + </style:master-page> + <style:master-page style:name="Endnote" style:page-master-name="pm2"/> + </office:master-styles> +</office:document-styles> diff --git a/bin/addons/base/report/custom_report.xml b/bin/addons/base/report/custom_report.xml new file mode 100644 index 00000000000..c7c4cedbb33 --- /dev/null +++ b/bin/addons/base/report/custom_report.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<openerp> + <data> + + </data> +</openerp> diff --git a/bin/addons/base/report/custom_view.xml b/bin/addons/base/report/custom_view.xml new file mode 100644 index 00000000000..ebc084668b7 --- /dev/null +++ b/bin/addons/base/report/custom_view.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<openerp> + <data> + </data> +</openerp> diff --git a/bin/addons/base/res/res_company.py b/bin/addons/base/res/res_company.py index 59bc0ab4ef5..2158035abb3 100644 --- a/bin/addons/base/res/res_company.py +++ b/bin/addons/base/res/res_company.py @@ -21,6 +21,7 @@ ############################################################################## from osv import fields,osv +import os import tools class res_company(osv.osv): @@ -122,7 +123,7 @@ class res_company(osv.osv): </header>""" def _get_header(self,cr,uid,ids): try : - return tools.file_open('custom/corporate_rml_header.rml').read() + return tools.file_open(os.path.join('base', 'report', 'corporate_rml_header.rml')).read() except: return """ <header> diff --git a/bin/report/interface.py b/bin/report/interface.py index e872cc77fd3..bb71f201a8d 100644 --- a/bin/report/interface.py +++ b/bin/report/interface.py @@ -20,7 +20,8 @@ # ############################################################################## -import os,re +import os +import re #Ged> Why do we use libxml2 here instead of xml.dom like in other places of the code? import libxml2 @@ -120,7 +121,7 @@ class report_rml(report_int): pos_xml = i.end() doc = print_xml.document(cr, uid, {}, {}) - tmpl_path = addons.get_module_resource('custom', 'corporate_defaults.xml') + tmpl_path = addons.get_module_resource('base', 'report', 'corporate_defaults.xml') doc.parse(tmpl_path, [uid], 'res.users', context) corporate_header = doc.xml_get() doc.close() diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index cec9e630c93..d34e0c1e2d0 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -715,10 +715,8 @@ class report_sxw(report_rml): if want_header: #Add corporate header/footer - if report_type=='odt': - rml = tools.file_open('custom/corporate_odt_header.xml').read() - if report_type=='sxw': - rml = tools.file_open('custom/corporate_sxw_header.xml').read() + if report_type in ('odt', 'sxw'): + rml = tools.file_open(os.path.join('base', 'report', 'corporate_%s_header.xml' % report_type)).read() rml_parser = self.parser(cr, uid, self.name2, context) rml_parser.parents = sxw_parents rml_parser.tag = sxw_tag