bzr revid: fp@tinyerp.com-20081010172318-3d179wh1zai3t9rb
This commit is contained in:
Fabien Pinckaers 2008-10-10 19:23:18 +02:00
commit 1606b963db
33 changed files with 1277 additions and 453 deletions

View File

@ -16,5 +16,6 @@
<menuitem id="menu_finance_periodical_processing" name="Periodical Processing" parent="account.menu_finance" sequence="3"/>
<menuitem id="menu_account_end_year_treatments" name="End of Year Treatments" parent="account.menu_finance_periodical_processing" sequence="20"/>
<menuitem id="menu_generic_report" name="Generic Reports" parent="account.menu_finance" sequence="8"/>
</data>
</openerp>

View File

@ -78,5 +78,14 @@
<!-- account.invoice -->
<wizard string="Open State" model="account.invoice" name="account.wizard_paid_open" menu="False" id="wizard_paid_open"/>
<!-- generic report wizard -->
<wizard id="wizard_account_balance_report" menu="False" model="account.account" name="account.account.balance.report" string="Account balance"/>
<menuitem icon="STOCK_PRINT" action="wizard_account_balance_report" id="menu_account_balance_report" parent="account.menu_generic_report" type="wizard"/>
<wizard id="wizard_general_ledger" menu="False" model="account.account" name="account.general.ledger.report" string="General ledger"/>
<menuitem icon="STOCK_PRINT" action="wizard_general_ledger" id="menu_general_ledger" parent="account.menu_generic_report" type="wizard"/>
</data>
</openerp>

View File

@ -3,6 +3,30 @@
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
<header>
<pageGraphics>
<setFont name="Helvetica-Bold" size="9"/>
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Cost Ledger-[[ company.currency_id.name ]]</drawRightString>
<!-- Header -->
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</header>
</pageTemplate>
</template>
<stylesheet>
@ -10,75 +34,71 @@
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
<blockBackground colorName="#e6e6e6" start="0,1" stop="0,1"/>
<blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
<blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
</blockTableStyle>
<blockTableStyle id="Tableau3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
<blockTableStyle id="Tableau2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
</blockTableStyle>
<blockTableStyle id="Tableau4">
<blockTableStyle id="Table_Heading_Content">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau7">
<blockTableStyle id="Table_Date_Sub_detail">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Tableau6">
<blockTableStyle id="Table_Sub_Content">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Tableau5">
<blockTableStyle id="Table_Header_Title">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
<blockBackground colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Tableau10">
<blockTableStyle id="Table_Grant_Total">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="GRID" colorName="black"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Account_Detail">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="Table_Move_Line_Detail">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,0" stop="1,1"/>
<lineStyle kind="LINEBELOW" colorName="white" start="0,1" stop="-1,1"/>
</blockTableStyle>
<blockTableStyle id="Table_Move_Line_Content">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="white" start="0,0" stop="1,1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P2" fontName="Times-Bold" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P4" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P5" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P6" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P7" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P8" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P9" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Times-Roman"/>
<paraStyle name="P11" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="P12" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P13" fontName="Times-Roman" fontSize="3.0" leading="4" alignment="LEFT"/>
<paraStyle name="P14" fontName="Times-Roman" fontSize="6.0" leading="8" alignment="LEFT"/>
<paraStyle name="P15" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P16" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="CENTER"/>
<paraStyle name="P17" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P18" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P19" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P20" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P21" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
@ -86,195 +106,217 @@
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="RIGHT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_Default_Bold_Right_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_Default_Bold_Right_9_U" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_Default_Right_9_U" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9_Italic" fontName="Times-Italic" fontSize="9.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9_italic_Rignt" fontName="Times-Italic" fontSize="9.0" leading="7" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
</stylesheet>
<images/>
<story>
<blockTable colWidths="161.0,161.0,161.0" repeatRows="1" style="Tableau1">
<!--blockTable colWidths="161.0,161.0,161.0" repeatRows="1" style="Table_Heading_Content">
<tr>
<td>
<para style="P1">
<para style="terp_default_9">[[ company.name ]]</para>
</td>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P2">Cost Ledger</para>
</td>
<td>
<para style="P3">
<font color="white"> </font>
</para>
<para style="P6">
<font color="white"> </font>
</para>
<para style="terp_header_Right">Cost Ledger-[[ company.currency_id.name ]]</para>
</td>
</tr>
</blockTable-->
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="161.0,161.0,161.0" style="Table_Date_Sub_detail">
<tr>
<td>
<para style="P1">[[ company.name ]]</para>
<para style="terp_tblheader_General_Centre">Period from </para>
</td>
<td>
<para style="P21">Period from [[ data['form']['date1'] ]] </para>
<para style="P21">
<font face="Times-Roman" size="10.0">to [[ data['form']['date2'] ]]</font>
</para>
<para style="terp_tblheader_General_Centre">Period to</para>
</td>
<td>
<para style="P6">Currency: [[ company.currency_id.name ]]</para>
<para style="terp_tblheader_General_Centre">Printing date</para>
</td>
</tr>
</blockTable>
<para style="P10">
<font color="white"> </font>
</para>
<para style="P11">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
<para style="P11">
<font color="white"> </font>
</para>
<blockTable colWidths="57.0,28.0,43.0,184.0,57.0,57.0,56.0" style="Tableau3">
<blockTable colWidths="161.0,161.0,161.0" style="Table_Sub_Content">
<tr>
<td>
<para style="P4">Date</para>
<para style="terp_tblheader_General_Centre">[[ data['form']['date1'] ]]</para>
</td>
<td>
<para style="P4">J.C.</para>
<para style="terp_tblheader_General_Centre">[[ data['form']['date2'] ]]</para>
</td>
<td>
<para style="P4">Code</para>
</td>
<td>
<para style="P4">Move name</para>
</td>
<td>
<para style="P4">Debit </para>
</td>
<td>
<para style="P4">Credit</para>
</td>
<td>
<para style="P4">Balance</para>
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
</td>
</tr>
</blockTable>
<para style="P13">
<para style="terp_default_8">
<font color="white"> </font>
</para>
<section>
<para style="P12">[[ repeatIn(objects,'o') ]]</para>
<para style="P14">
<font color="white"> </font>
</para>
<blockTable colWidths="482.0" style="Tableau2">
<tr>
<td>
<para style="P17">[[ o.code ]]<font face="Times-Roman" size="10.0"> [[ o.complete_name ]]</font></para>
</td>
</tr>
</blockTable>
<para style="P13">
<font color="white"> </font>
</para>
<section>
<para style="P12">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
<para style="P13">
<font color="white"> </font>
</para>
<blockTable colWidths="482.0" style="Tableau4">
<tr>
<td>
<para style="P5">[[ move_g['code'] ]] <font face="Times-Bold" size="10.0">[[ move_g['name'] ]]</font></para>
</td>
</tr>
</blockTable>
<blockTable colWidths="57.0,28.0,42.0,184.0,57.0,57.0,56.0" style="Tableau7">
<tr>
<td>
<para style="P8">[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
<para style="P8">[[ move_a['date'] ]]</para>
</td>
<td>
<para style="P8">[[ move_a['cj'] ]]</para>
</td>
<td>
<para style="P8">[[ move_a['code'] ]]</para>
</td>
<td>
<para style="P9">[[ move_a['name'] ]]</para>
</td>
<td>
<para style="P8">[[ '%.2f' % move_a['debit'] ]]</para>
</td>
<td>
<para style="P8">[[ '%.2f' % move_a['credit'] ]]</para>
</td>
<td>
<para style="P8">[[ '%.2f' % move_a['balance'] ]]</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="312.0,57.0,57.0,57.0" style="Tableau6">
<tr>
<td>
<para style="P7">Total ([[ move_g['code'] ]])</para>
</td>
<td>
<para style="P7">[[ '%.2f' % move_g['debit'] ]]</para>
</td>
<td>
<para style="P7">[[ '%.2f' % move_g['credit'] ]]</para>
</td>
<td>
<para style="P7">[[ '%.2f' % move_g['balance'] ]]</para>
</td>
</tr>
</blockTable>
<para style="P13">
<font color="white"> </font>
</para>
</section>
<para style="P13">
<font color="white"> </font>
</para>
<blockTable colWidths="312.0,57.0,57.0,56.0" style="Tableau5">
<tr>
<td>
<para style="P3">Total ([[ o.code ]])</para>
</td>
<td>
<para style="P6">[[ '%.2f' % (account_sum_debit(o.id,data['form']['date1'],data['form']['date2']) or 0.0) ]]</para>
</td>
<td>
<para style="P6">[[ '%.2f' % (account_sum_credit(o.id,data['form']['date1'],data['form']['date2']) or 0.0) ]]</para>
</td>
<td>
<para style="P6">[[ '%.2f' % (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']) or 0.0)]]</para>
</td>
</tr>
</blockTable>
<para style="P14">
<font color="white"> </font>
</para>
</section>
<para style="P16">
<font color="white"> </font>
</para>
<blockTable colWidths="312.0,57.0,57.0,57.0" style="Tableau10">
<blockTable colWidths="67.0,245.0,59.0,59.0,58.0" style="Table_Header_Title" repeatRows="1">
<tr>
<td>
<para style="P3">Total</para>
<para style="terp_tblheader_Details">Code / Date</para>
</td>
<td>
<para style="P3">[[ '%.2f' % (sum_debit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]]</para>
<para style="terp_tblheader_Details">J.C. / Move name</para>
</td>
<td>
<para style="P3">[[ '%.2f' % (sum_credit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]]</para>
<para style="terp_tblheader_Details_Right">Debit </para>
</td>
<td>
<para style="P3">[[ '%.2f' % (sum_balance(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]]</para>
<para style="terp_tblheader_Details_Right">Credit</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
</blockTable>
<para style="P15">
<tr>
<td>
<blockTable colWidths="62.0,249.0,57.0,57.0,57.0" style="Table_Grant_Total">
<tr>
<td>
<para style="terp_Default_Bold_Right_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U"><u>[[ '%.2f' % (sum_debit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]]</u></para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U"><u>[[ '%.2f' % (sum_credit(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]]</u></para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U"><u>[[ '%.2f' % (sum_balance(objects,data['form']['date1'],data['form']['date2']) or 0.0) ]]</u></para>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>
<td>
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
<blockTable colWidths="62.0,249.0,57.0,57.0,57.0" style="Table_Account_Detail">
<tr>
<td>
<para style="terp_default_Bold_9">[[ o.code ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">[[ o.complete_name ]]</para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U"><u>[[ '%.2f' % (account_sum_debit(o.id,data['form']['date1'],data['form']['date2']) or 0.0) ]]</u></para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U"><u>[[ '%.2f' % (account_sum_credit(o.id,data['form']['date1'],data['form']['date2']) or 0.0) ]]</u></para>
</td>
<td>
<para style="terp_Default_Bold_Right_9_U"><u>[[ '%.2f' % (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']) or 0.0)]]</u></para>
</td>
</tr>
<tr>
<td>
<para style="Standard">[[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2']),'move_g') ]]</para>
<blockTable colWidths="55.0,249.0,58.0,56.0,57.0" style="Table_Move_Line_Detail">
<tr>
<td>
<para style="terp_default_9">[[ move_g['code'] ]]</para>
</td>
<td>
<para style="terp_default_9">[[ move_g['name'] ]]</para>
</td>
<td>
<para style="terp_Default_Right_9_U"><u>[[ '%.2f' % move_g['debit'] ]]</u></para>
</td>
<td>
<para style="terp_Default_Right_9_U"><u>[[ '%.2f' % move_g['credit'] ]]</u></para>
</td>
<td>
<para style="terp_Default_Right_9_U"><u>[[ '%.2f' % move_g['balance'] ]]</u></para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9">[[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
<blockTable colWidths="47.0,46.0,204.0,59.0,55.0,58.0" style="Table_Move_Line_Content">
<tr>
<td>
<para style="terp_default_9_Italic">[[ move_a['date'] ]]</para>
</td>
<td>
<para style="terp_default_9_Italic">[[ move_a['cj'] ]]</para>
</td>
<td>
<para style="terp_default_9_Italic">[[ move_a['name'] ]]</para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ '%.2f' % move_a['debit'] ]]</para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ '%.2f' % move_a['credit'] ]]</para>
</td>
<td>
<para style="terp_default_9_italic_Rignt">[[ '%.2f' % move_a['balance'] ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</td>
</tr>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</blockTable>
</section>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</story>
</document>

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ import datetime
from report import report_sxw
class account_balance(report_sxw.rml_parse):
_name = 'report.account.account.balance'
def __init__(self, cr, uid, name, context):
super(account_balance, self).__init__(cr, uid, name, context)
@ -53,20 +53,20 @@ class account_balance(report_sxw.rml_parse):
'get_periods':self.get_periods,
})
self.context = context
def get_fiscalyear(self, form):
res=[]
if form.has_key('fiscalyear'):
if form.has_key('fiscalyear'):
fisc_id = form['fiscalyear']
if not (fisc_id):
return ''
self.cr.execute("select name from account_fiscalyear where id = %d" %(int(fisc_id)))
res=self.cr.fetchone()
return res and res[0] or ''
def get_periods(self, form):
result=''
if form.has_key('periods'):
if form.has_key('periods'):
period_ids = ",".join([str(x) for x in form['periods'][0][2] if x])
self.cr.execute("select name from account_period where id in (%s)" % (period_ids))
res=self.cr.fetchall()
@ -76,7 +76,7 @@ class account_balance(report_sxw.rml_parse):
else:
result+=r[0]+", "
return str(result and result[:-1]) or ''
def lines(self, form, ids={}, done=None, level=1):
if not ids:
ids = self.ids
@ -84,10 +84,13 @@ class account_balance(report_sxw.rml_parse):
return []
if not done:
done={}
if form.has_key('Account_list') and form['Account_list']:
ids = [form['Account_list']]
del form['Account_list']
res={}
result_acc=[]
ctx = self.context.copy()
if form.has_key('fiscalyear'):
if form.has_key('fiscalyear'):
self.transform_period_into_date_array(form)
ctx['fiscalyear'] = form['fiscalyear']
ctx['periods'] = form['periods'][0][2]
@ -95,7 +98,7 @@ class account_balance(report_sxw.rml_parse):
self.transform_date_into_date_array(form)
ctx['date_from'] = form['date_from']
ctx['date_to'] = form['date_to']
accounts = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx)
def cmp_code(x, y):
return cmp(x.code, y.code)
@ -103,7 +106,7 @@ class account_balance(report_sxw.rml_parse):
for account in accounts:
if account.id in done:
continue
done[account.id] = 1
done[account.id] = 1
res = {
'lid' :'',
'date':'',
@ -140,7 +143,7 @@ class account_balance(report_sxw.rml_parse):
if form['display_account'] == 'bal_mouvement':
if res['credit'] <> 0 or res['debit'] <> 0 or res['balance'] <> 0:
result_acc.append(res)
elif form['display_account'] == 'bal_solde':
elif form['display_account'] == 'bal_solde':
if res['balance'] <> 0:
result_acc.append(res)
else:
@ -156,7 +159,7 @@ class account_balance(report_sxw.rml_parse):
ids2.sort()
result_acc += self.lines(form, [x[1] for x in ids2], done, level+1)
return result_acc
def moveline(self,form,ids,level):
res={}
self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\''
@ -168,7 +171,7 @@ class account_balance(report_sxw.rml_parse):
"WHERE l.account_id = '"+str(ids)+"' " \
"AND l.date IN (" + self.date_lst_string + ") " \
"ORDER BY l.id")
res = self.cr.dictfetchall()
res = self.cr.dictfetchall()
sum = 0.0
for r in res:
sum = r['debit1'] - r['credit1']
@ -186,7 +189,7 @@ class account_balance(report_sxw.rml_parse):
else:
r['bal_type']=" Cr."
return res or ''
def date_range(self,start,end):
start = datetime.date.fromtimestamp(time.mktime(time.strptime(start,"%Y-%m-%d")))
end = datetime.date.fromtimestamp(time.mktime(time.strptime(end,"%Y-%m-%d")))
@ -198,7 +201,7 @@ class account_balance(report_sxw.rml_parse):
for date in date_array:
full_str_date.append(str(date))
return full_str_date
#
def transform_period_into_date_array(self,form):
## Get All Period Date
@ -206,23 +209,23 @@ class account_balance(report_sxw.rml_parse):
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',form['fiscalyear'])])
else:
periods_id = form['periods'][0][2]
date_array = []
date_array = []
for period_id in periods_id:
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
self.date_lst = date_array
self.date_lst.sort()
def transform_date_into_date_array(self,form):
return_array = self.date_range(form['date_from'],form['date_to'])
self.date_lst = return_array
self.date_lst.sort()
def _sum_credit(self):
return self.sum_credit
return self.sum_credit
def _sum_debit(self):
return self.sum_debit
return self.sum_debit
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)

View File

@ -40,7 +40,7 @@ dates_form = '''<?xml version="1.0"?>
<field name="date_from" colspan="4"/>
<field name="date_to" colspan="4"/>
<field name="display_account" colspan="4"/>
</form>'''
dates_fields = {
@ -55,7 +55,7 @@ period_form = '''<?xml version="1.0"?>
<field name="fiscalyear" colspan="4"/>
<field name="periods" colspan="4"/>
<field name="display_account" colspan="4"/>
</form>'''
@ -73,7 +73,7 @@ account_form = '''<?xml version="1.0"?>
</form>'''
account_fields = {
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True},
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
}
@ -97,7 +97,7 @@ class wizard_report(wizard.interface):
else:
return 'account_selection'
def _check_date(self, cr, uid, data, context):
sql = """
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date_from'])
@ -108,12 +108,12 @@ class wizard_report(wizard.interface):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
else:
return 'report'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
states = {
'init': {
'actions': [],
'result': {'type':'choice','next_state':_check_path}

View File

@ -61,7 +61,7 @@ account_form = '''<?xml version="1.0"?>
</form>'''
account_fields = {
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True},
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
}
@ -110,7 +110,7 @@ def _check_date(self, cr, uid, data, context):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
else:
return 'checkreport'
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
@ -119,13 +119,13 @@ class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
data['form']['sortbydate'] = 'sort_date'
data['form']['sortbydate'] = 'sort_date'
data['form']['display_account']='bal_all'
data['form']['landscape']=True
data['form']['amount_currency'] = True
return data['form']
def _get_defaults_fordate(self, cr, uid, data, context):
data['form']['sortbydate'] = 'sort_date'
data['form']['sortbydate'] = 'sort_date'
data['form']['display_account']='bal_all'
data['form']['landscape']=True
data['form']['amount_currency'] = True

View File

@ -30,6 +30,7 @@
import account
import report
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -40,6 +40,7 @@
"security/ir.model.access.csv",
"account_view.xml",
"account_report.xml",
"account_wizard.xml",
],
# "translations" : {
# "fr": "i18n/french_fr.csv"

View File

@ -210,6 +210,9 @@ class account_report_history(osv.osv):
def init(self, cr):
cr.execute('''create or replace view account_report as (select ar.id as tmp,((pr.id*100000)+ar.id) as id,ar.id as name,pr.id as period_id,pr.fiscalyear_id as fiscalyear_id from account_report_report as ar cross join account_period as pr group by ar.id,pr.id,pr.fiscalyear_id)''')
def unlink(self, cr, uid, ids, context={}):
raise osv.except_osv(_('Error !'), _('You can not delete an indicator history record. You may have to delete the concerned Indicator!'))
account_report_history()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -2,5 +2,8 @@
<openerp>
<data>
<report auto="False" id="fiscal_statements" model="account.report.report" name="accounting.report" rml="account_report/report/accounting_report.rml" string="Fiscal Statements"/>
<report auto="False" id="report_print_indicators" model="account.report.report" name="report.print.indicators" rml="account_report/report/report_print_indicators.rml" string="Indicators"/>
</data>
</openerp>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<wizard id="wizard_print_indicators" name="print.indicators" string="Print Indicators"/>
<menuitem action="wizard_print_indicators" type="wizard" parent="account_report.menu_action_account_report_tree_view" id="menu_wizard_print_indicators"/>
</data>
</openerp>

View File

@ -0,0 +1,33 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import wizard_print_indicators
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,81 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import wizard
import pooler
form = '''<?xml version="1.0"?>
<form string="Print Indicators">
<field name="indicator_id"/>
<field name="select_base"/>
</form>'''
fields = {
'indicator_id': {'string':'Choose Indicator', 'type':'many2one', 'relation': 'account.report.report','required':True,},
'select_base': {'string':'Choose Criteria', 'type':'selection','selection':[('year','Based On Fiscal Years'),('periods','Based on Fiscal Periods')],'required':True,},
}
next_form = '''<?xml version="1.0"?>
<form string="Print Indicators">
<field name="base_selection"/>
</form>'''
next_fields = {
'base_selection': {'string':'Select Criteria', 'type':'many2many','required':True,},
}
def _load(self, cr, uid, data, context):
data['form']['select_base'] = 'year'
return data['form']
def _load_base(self, cr, uid, data, context):
next_fields['base_selection']['relation']='account.fiscalyear'
if data['form']['select_base']=='periods':
next_fields['base_selection']['relation']='account.period'
return data['form']
class wizard_print_indicators(wizard.interface):
states = {
'init': {
'actions': [_load],
'result': {'type': 'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('next','Next')]}
},
'next': {
'actions': [_load_base],
'result': {'type':'form', 'arch':next_form, 'fields':next_fields, 'state':[('end','Cancel'),('print','Print')]}
},
'print': {
'actions':[],
'result' :{'type':'print','report':'report.print.indicators', 'state':'end'}
}
}
wizard_print_indicators('print.indicators')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -60,7 +60,7 @@ priorities = {
class rpc_proxy(object):
def __init__(self, uid, passwd, host='localhost', port=8069, path='object', dbname='terp'):
self.rpc = xmlrpclib.ServerProxy('http://%s:%s/%s' % (host, port, path))
self.rpc = xmlrpclib.ServerProxy('http://%s:%s/xmlrpc/%s' % (host, port, path))
self.user_id = uid
self.passwd = passwd
self.dbname = dbname

View File

@ -47,7 +47,8 @@
* Cost method by product: standard price, average price
* Easy analysis of troubles or needs
* Very flexible
* Allows to browse Bill of Materials in complete structure
that include child and phantom BoMs
It supports complete integration and planification of stockable goods,
consumable of services. Services are completly integrated with the rest
of the software. For instance, you can set up a sub-contracting service

View File

@ -39,7 +39,7 @@ from mx import DateTime
#----------------------------------------------------------
# Workcenters
#----------------------------------------------------------
# capacity_hour : capacity per hour. default: 1.0.
# capacity_hour : capacity per hour. default: 1.0.
# Eg: If 5 concurrent operations at one time: capacity = 5 (because 5 employees)
# unit_per_cycle : how many units are produced for one cycle
#
@ -115,7 +115,7 @@ class mrp_routing(osv.osv):
'note': fields.text('Description'),
'workcenter_lines': fields.one2many('mrp.routing.workcenter', 'routing_id', 'Workcenters'),
'location_id': fields.many2one('stock.location', 'Production Location',
'location_id': fields.many2one('stock.location', 'Production Location',
help="Keep empty if you produce at the location where the finnished products are needed." \
"Put a location if you produce at a fixed location. This can be a partner location " \
"if you subcontract the manufacturing operations."
@ -147,6 +147,17 @@ mrp_routing_workcenter()
class mrp_bom(osv.osv):
_name = 'mrp.bom'
_description = 'Bill of Material'
def _child_compute(self, cr, uid, ids, name, arg, context={}):
result = {}
for bom in self.browse(cr, uid, ids, context=context):
result[bom.id] = map(lambda x: x.id, bom.bom_lines)
ok = ((name=='child_complete_ids') and (bom.product_id.supply_method=='produce'))
if bom.type=='phantom' or ok:
sids = self.pool.get('mrp.bom').search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)])
if sids:
bom2 = self.pool.get('mrp.bom').browse(cr, uid, sids[0], context=context)
result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
return result
def _compute_type(self, cr, uid, ids, field_name, arg, context):
res = dict(map(lambda x: (x,''), ids))
for line in self.browse(cr, uid, ids):
@ -185,7 +196,9 @@ class mrp_bom(osv.osv):
'routing_id': fields.many2one('mrp.routing', 'Routing', help="The list of operations (list of workcenters) to produce the finnished product. The routing is mainly used to compute workcenter costs during operations and to plan futur loads on workcenters based on production plannification."),
'property_ids': fields.many2many('mrp.property', 'mrp_bom_property_rel', 'bom_id','property_id', 'Properties'),
'revision_ids': fields.one2many('mrp.bom.revision', 'bom_id', 'BoM Revisions'),
'revision_type': fields.selection([('numeric','numeric indices'),('alpha','alphabetical indices')], 'indice type')
'revision_type': fields.selection([('numeric','numeric indices'),('alpha','alphabetical indices')], 'indice type'),
'child_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hyerarchy", type='many2many'),
'child_complete_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hyerarchy", type='many2many')
}
_defaults = {
'active': lambda *a: 1,
@ -198,6 +211,7 @@ class mrp_bom(osv.osv):
_sql_constraints = [
('bom_qty_zero', 'CHECK (product_qty>0)', 'All product quantities must be greater than 0 !'),
]
def _check_recursion(self, cr, uid, ids):
level = 500
while len(ids):
@ -211,7 +225,7 @@ class mrp_bom(osv.osv):
(_check_recursion, 'Error ! You can not create recursive BoM.', ['parent_id'])
]
def onchange_product_id(self, cr, uid, ids, product_id, name, context={}):
if product_id:
prod=self.pool.get('product.product').browse(cr,uid,[product_id])[0]
@ -283,7 +297,7 @@ class mrp_bom(osv.osv):
def set_indices(self, cr, uid, ids, context = {}):
if not ids or (ids and not ids[0]):
return True
return True
res = self.read(cr, uid, ids, ['revision_ids', 'revision_type'])
rev_ids = res[0]['revision_ids']
idx = 1
@ -310,7 +324,7 @@ class mrp_bom_revision(osv.osv):
'author_id': fields.many2one('res.users', 'Author'),
'bom_id': fields.many2one('mrp.bom', 'BoM', select=True),
}
_defaults = {
'author_id': lambda x,y,z,c: z,
'date': lambda *a: time.strftime('%Y-%m-%d'),
@ -338,6 +352,7 @@ class mrp_production(osv.osv):
productions=self.read(cr,uid,ids,['id','move_prod_id'])
res={}
for production in productions:
res[production['id']]=False
if production.get('move_prod_id',False):
parent_move_line=get_parent_move(production['move_prod_id'][0])
if parent_move_line:
@ -603,7 +618,7 @@ class mrp_production(osv.osv):
'state': 'waiting'
}
res_final_id = self.pool.get('stock.move').create(cr, uid, data)
self.write(cr, uid, [production.id], {'move_created_ids': [(6, 'WTF', [res_final_id])]})
moves = []
for line in production.product_lines:
@ -973,14 +988,14 @@ class mrp_procurement(osv.osv):
newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
context.update({'lang':partner.lang})
product=self.pool.get('product.product').browse(cr,uid,procurement.product_id.id,context=context)
line = {
'name': product.name,
'product_qty': qty,
'product_id': procurement.product_id.id,
'product_uom': uom_id,
'price_unit': price,
'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
'move_dest_id': res_id,
'notes':product.description_purchase,
}
@ -991,7 +1006,7 @@ class mrp_procurement(osv.osv):
if partner_id:
taxep_id = self.pool.get('res.partner').property_get(cr, uid,partner_id,property_pref=['property_account_supplier_tax']).get('property_account_supplier_tax',False)
if taxep_id:
taxep=self.pool.get('account.tax').browse(cr, uid,taxep_id)
taxep=self.pool.get('account.tax').browse(cr, uid,taxep_id)
if not taxep or not taxep.id:
taxes_ids = [x.id for x in procurement.product_id.product_tmpl_id.supplier_taxes_id]
else:

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem icon="terp-mrp" id="menu_mrp_root" name="Manufacturing"/>
<!--
Property / Property Group
-->
<record id="mrp_property_group_form_view" model="ir.ui.view">
<field name="name">mrp.property.group.form</field>
<field name="model">mrp.property.group</field>
@ -30,7 +30,7 @@
<menuitem id="menu_mrp_configuration" name="Configuration" parent="menu_mrp_root"/>
<menuitem id="menu_mrp_property_group_action_prop" name="Properties" parent="menu_mrp_configuration"/>
<menuitem action="mrp_property_group_action" id="menu_mrp_property_group_action" parent="menu_mrp_property_group_action_prop"/>
<record id="mrp_property_tree_view" model="ir.ui.view">
<field name="name">mrp.property.tree</field>
<field name="model">mrp.property</field>
@ -66,11 +66,11 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem action="mrp_property_action" id="menu_mrp_property_action" parent="menu_mrp_property_group_action_prop"/>
<!--
Workcenters
-->
<record id="mrp_workcenter_tree_view" model="ir.ui.view">
<field name="name">mrp.workcenter.tree</field>
<field name="model">mrp.workcenter</field>
@ -129,11 +129,11 @@
<field name="view_id" ref="mrp_workcenter_tree_view"/>
</record>
<menuitem action="mrp_workcenter_action" id="menu_mrp_workcenter_action" parent="menu_mrp_configuration"/>
<!--
Routings
-->
<record id="mrp_routing_workcenter_tree_view" model="ir.ui.view">
<field name="name">mrp.routing.workcenter.tree</field>
<field name="model">mrp.routing.workcenter</field>
@ -147,7 +147,7 @@
</tree>
</field>
</record>
<record id="mrp_routing_workcenter_form_view" model="ir.ui.view">
<field name="name">mrp.routing.workcenter.form</field>
<field name="model">mrp.routing.workcenter</field>
@ -164,7 +164,7 @@
</form>
</field>
</record>
<record id="mrp_routing_form_view" model="ir.ui.view">
<field name="name">mrp.routing.form</field>
<field name="model">mrp.routing</field>
@ -203,11 +203,11 @@
<field name="view_id" ref="mrp_routing_tree_view"/>
</record>
<menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="menu_mrp_configuration"/>
<!--
Bill of Materials
-->
<record id="mrp_bom_form_view" model="ir.ui.view">
<field name="name">mrp.bom.form</field>
<field name="model">mrp.bom</field>
@ -237,7 +237,7 @@
<field name="active" select="2"/>
<field name="sequence"/>
<field name="bom_id"/>
<field name="date_start" select="2"/>
<field name="date_stop" select="2"/>
<field name="product_rounding"/>
@ -248,11 +248,12 @@
</form>
</field>
</record>
<record id="mrp_bom_tree_view" model="ir.ui.view">
<record id="mrp_bom_tree_view" model="ir.ui.view">
<field name="name">mrp.bom.tree</field>
<field name="model">mrp.bom</field>
<field name="type">tree</field>
<field name="field_parent">bom_lines</field>
<field name="field_parent">child_complete_ids</field>
<field name="arch" type="xml">
<tree string="BoM Structure" colors="blue:method">
<field name="product_id"/>
@ -275,7 +276,7 @@
<field name="view_id" ref="mrp_bom_tree_view"/>
</record>
<menuitem action="mrp_bom_form_action" id="menu_mrp_bom_form_action" parent="menu_mrp_configuration"/>
<record id="mrp_bom_tree_action" model="ir.actions.act_window">
<field name="name">Bill of Material Structure</field>
<field name="type">ir.actions.act_window</field>
@ -294,7 +295,7 @@
<field name="domain">[('bom_id','=',False)]</field>
</record>
<menuitem action="mrp_bom_form_action_new" id="menu_mrp_bom_form_action_new" parent="menu_mrp_bom_form_action"/>
<record id="mrp_bom_form_action2" model="ir.actions.act_window">
<field name="name">Bill of Materials Components</field>
<field name="type">ir.actions.act_window</field>
@ -312,14 +313,14 @@
<field name="view_type">tree</field>
<field name="view_id" ref="mrp_bom_tree_view"/>
</record>
<record id="ir_bom_architecture_open" model="ir.values">
<record id="ir_BOM_structure" model="ir.values">
<field eval="'client_action_multi'" name="key2"/>
<field eval="'mrp.bom'" name="model"/>
<field name="name">Bill of Materials Structure</field>
<field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
<field eval="True" name="object"/>
</record>
<record id="mrp_bom_revision_tree" model="ir.ui.view">
<field name="name">mrp.bom.revision</field>
<field name="model">mrp.bom.revision</field>
@ -347,11 +348,11 @@
</form>
</field>
</record>
<!--
Production Management
-->
<record id="mrp_production_tree_view" model="ir.ui.view">
<field name="name">mrp.production.tree</field>
<field name="model">mrp.production</field>
@ -368,8 +369,7 @@
</tree>
</field>
</record>
<record id="view_production_calendar" model="ir.ui.view">
<field name="name">mrp.production.calendar</field>
<field name="model">mrp.production</field>
@ -394,8 +394,7 @@
</graph>
</field>
</record>
<record id="mrp_production_form_view" model="ir.ui.view">
<field name="name">mrp.production.form</field>
<field name="model">mrp.production</field>
@ -491,7 +490,7 @@
<field name="domain">[('state','=','confirmed')]</field>
</record>
<menuitem action="mrp_production_action4" id="menu_production_orders_waiting4" parent="mrp.menu_mrp_production_action"/>
<record id="mrp_production_new" model="ir.actions.act_window">
<field name="name">New Production Order</field>
<field name="type">ir.actions.act_window</field>
@ -500,7 +499,7 @@
<field name="view_mode">form,tree,calendar,graph</field>
</record>
<menuitem action="mrp_production_new" id="menu_production_orders_new" parent="mrp.menu_mrp_production_action"/>
<record id="mrp_production_workcenter_form_view" model="ir.ui.view">
<field name="name">mrp.production.workcenter.line.form</field>
<field name="model">mrp.production.workcenter.line</field>
@ -529,7 +528,7 @@
</tree>
</field>
</record>
<record id="mrp_production_lot_form_view" model="ir.ui.view">
<field name="name">mrp.production.lot.line.form</field>
<field name="model">mrp.production.lot.line</field>
@ -562,9 +561,7 @@
</tree>
</field>
</record>
<record id="mrp_production_product_form_view" model="ir.ui.view">
<field name="name">mrp.production.product.line.form</field>
<field name="model">mrp.production.product.line</field>
@ -594,11 +591,11 @@
</tree>
</field>
</record>
<!--
Procurement
-->
<record id="mrp_procurement_tree_view" model="ir.ui.view">
<field name="name">mrp.procurement.tree</field>
<field name="model">mrp.procurement</field>
@ -678,7 +675,7 @@
<field name="view_id" eval="False"/>
</record>
<menuitem action="mrp_procurement_action" id="menu_mrp_procurement_action" parent="mrp.menu_mrp_root" groups="base.group_extended" />
<record id="mrp_procurement_action2" model="ir.actions.act_window">
<field name="name">Draft procurements</field>
<field name="type">ir.actions.act_window</field>
@ -697,7 +694,7 @@
<field name="domain">[('state','=','confirmed')]</field>
</record>
<menuitem action="mrp_procurement_action3" id="menu_mrp_procurement_action3" parent="mrp.menu_mrp_procurement_action"/>
<record id="mrp_procurement_action5" model="ir.actions.act_window">
<field name="name">Exceptions procurements</field>
<field name="type">ir.actions.act_window</field>
@ -707,7 +704,7 @@
<field name="domain">[('state','=','exception')]</field>
</record>
<menuitem action="mrp_procurement_action5" id="menu_mrp_procurement_action5" parent="stock.menu_stock_root"/>
<record id="mrp_procurement_action4" model="ir.actions.act_window">
<field name="name">Exceptions procurements to fix</field>
<field name="type">ir.actions.act_window</field>
@ -717,7 +714,7 @@
<field name="domain">[('state','=','exception'), ('message', '&lt;&gt;', '')]</field>
</record>
<menuitem action="mrp_procurement_action4" id="menu_mrp_procurement_action4" parent="mrp.menu_mrp_procurement_action5"/>
<record id="mrp_procurement_action11" model="ir.actions.act_window">
<field name="name">Temporary Procurement Exceptions</field>
<field name="type">ir.actions.act_window</field>
@ -727,7 +724,7 @@
<field name="domain">[('state','=','exception'), ('message', '=', '')]</field>
</record>
<menuitem action="mrp_procurement_action11" id="menu_mrp_procurement_action11" parent="mrp.menu_mrp_procurement_action5"/>
<record id="mrp_procurement_new" model="ir.actions.act_window">
<field name="name">New Procurement</field>
<field name="type">ir.actions.act_window</field>
@ -736,7 +733,7 @@
<field name="view_mode">form,tree</field>
</record>
<menuitem action="mrp_procurement_new" id="menu_mrp_procurement_new" parent="mrp.menu_mrp_procurement_action"/>
<!-- Order Point -->
<record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree</field>

View File

@ -39,4 +39,4 @@ class order(report_sxw.rml_parse):
})
report_sxw.report_sxw('report.mrp.production.order','mrp.production','addons/mrp/report/order.rml',parser=order)
report_sxw.report_sxw('report.mrp.production.order','mrp.production','addons/mrp/report/order.rml',parser=order, header=2)

View File

@ -3,6 +3,36 @@
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="42.0" width="527" height="758"/>
<header>
<pageGraphics>
<!--logo-->
<!--<fill color="darkblue"/>-->
<!--<stroke color="darkblue"/>-->
<!--TITLE COMPANY-->
<!-- <drawString x="4.6cm" y="28.7cm">[[ company.partner_id.name ]]</drawString> -->
<setFont name="Helvetica-Bold" size="9"/>
<!--COL 1-->
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
<drawRightString x="20cm" y="28.1cm">Analytic Check</drawRightString>
<!-- Header -->
<setFont name="Helvetica" size="9"/>
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</header>
</pageTemplate>
</template>
<stylesheet>
@ -13,45 +43,85 @@
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="1,2"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica-Bold" fontSize="16.0" leading="20"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="16.0" leading="20"/>
<paraStyle name="P3" fontName="Helvetica"/>
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="11.0" leading="14"/>
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="LEFT"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT"/>
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="11.0" leading="14"/>
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
<paraStyle name="P1" fontName="Helvetica" fontSize="16.0" leading="20"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="11"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="9.0" leading="11"/>
<paraStyle name="P4" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P7" fontName="Helvetica-Oblique" fontSize="9.0" leading="11"/>
<paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11"/>
<paraStyle name="P9" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT"/>
<paraStyle name="P12" fontName="Helvetica" alignment="LEFT"/>
<paraStyle name="P13" fontName="Helvetica-Oblique" fontSize="9.0" leading="11"/>
<paraStyle name="P14" fontName="Helvetica" fontSize="9.0" leading="11"/>
<paraStyle name="P15" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P16" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER"/>
<paraStyle name="P17" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P18" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="3.0"/>
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="P14" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="P15" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="P16" fontName="Helvetica" fontSize="9.0" leading="11"/>
<paraStyle name="P17" fontName="Helvetica" alignment="LEFT"/>
<paraStyle name="P18" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="P19" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P20" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="P21" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P22" fontName="Helvetica-Bold" fontSize="9.0" leading="11"/>
<paraStyle name="P23" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P24" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="P25" fontName="Helvetica-Bold" fontSize="16.0" leading="20"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
@ -60,76 +130,89 @@
</stylesheet>
<images/>
<story>
<para style="P14">[[ repeatIn(objects,'o') ]] </para>
<para style="P13">
<font color="white"> </font>
</para>
<para style="P14">
<font color="white"> </font>
</para>
<para style="P1">Production Order N° : [[ o.name ]]</para>
<para style="P2">
<font color="white"> </font>
</para>
<para style="P18">Printing date : [[ time.strftime('%d/%m/%Y') ]]</para>
<para style="P18">Partner Order reference : [[ o.sale_ref or ' ' ]]</para>
<para style="P18">SO number : [[ o.sale_name or '' ]]</para>
<para style="P3">
<font color="white"> </font>
</para>
<blockTable colWidths="130.0,313.0,85.0" repeatRows="1" style="Table1">
<tr>
<td>
<para style="P4">Product Name</para>
</td>
<td>
<para style="P5">Product Description</para>
</td>
<td>
<para style="P6">Qty</para>
</td>
</tr>
</blockTable>
<section>
<blockTable colWidths="130.0,312.0,86.0" style="Table2">
<tr>
<td>
<para style="P10">[[ '['+ o.product_id.code +']' ]] [[ o.product_id.name ]]</para>
</td>
<td>
<para style="P10">[[ o.product_id.description ]]</para>
</td>
<td>
<para style="P11">[[ '%.2f' % o.product_qty ]] [[ o.product_uom.name ]]</para>
</td>
</tr>
</blockTable>
</section>
<para style="P8">[[ repeatIn(objects,'o') ]] </para>
<para style="P7">
<font color="white"> </font>
</para>
<para style="P8">
<font color="white"> .........</font>
<font color="white"> .........</font>
<font color="white"> </font>
</para>
<blockTable colWidths="86.0,16.0,425.0" style="Table3">
<para style="terp_header">Production Order N° : [[ o.name ]]</para>
<para style="P1">
<font color="white"> </font>
</para>
<blockTable colWidths="74.0,88.0,78.0,89.0,199.0" repeatRows="1" style="Table1">
<tr>
<td>
<para style="P15">Planned Date </para>
<para style="terp_tblheader_General_Centre">Printing date</para>
</td>
<td>
<para style="P16">:</para>
<para style="terp_tblheader_General_Centre">Planned Date </para>
</td>
<td>
<para style="P15">[[ time.strftime('%d/%m/%Y', time.strptime(o.date_planned, '%Y-%m-%d %H:%M:%S')) ]]</para>
<para style="P9">
<font color="white"> </font>
</para>
<para style="terp_tblheader_General_Centre">Partner Ref</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">SO Number</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Product Name</para>
</td>
</tr>
</blockTable>
<para style="P12">
<font face="Times-Roman"/>
<section>
<blockTable colWidths="74.0,88.0,78.0,89.0,199.0" style="Table2">
<tr>
<td>
<para style="terp_default_Centre_8">[[ time.strftime('%d/%m/%Y') ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ time.strftime('%d/%m/%Y', time.strptime(o.date_planned, '%Y-%m-%d %H:%M:%S')) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_ref or ' ' ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_name or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ '['+ o.product_id.code +']' ]] [[ o.product_id.name ]]</para>
</td>
</tr>
</blockTable>
</section>
<para style="P2">
<font color="white"> </font>
</para>
<para style="P2">[[ o.product_id.description ]]</para>
<para style="P2">
<font color="white"> </font>
</para>
<blockTable colWidths="185.0,342.0" style="Table4">
<tr>
<td>
<para style="P21">Product </para>
</td>
<td>
<para style="P18">Qty</para>
</td>
</tr>
<tr>
<td>
<para style="P3">[[ repeatIn(o.move_lines,'line') ]]</para>
<para style="P3">[[ '['+line.product_id.code +']' ]][[ line.product_id.name ]]</para>
</td>
<td>
<para style="P5">[[ line.product_qty ]] [[line.product_uom.name]]</para>
</td>
</tr>
</blockTable>
<para style="P2">
<font color="white"> .........</font>
<font color="white"> .........</font>
</para>
<para style="P17">
<font color="white"> </font>
</para>
</story>
</document>

View File

@ -0,0 +1 @@
import mrp_subproduct

View File

@ -0,0 +1,46 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
###############################################################################
{
"name" : "MRP Sub Product",
"version" : "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com/module_stock.html",
"depends" : ["base","mrp"],
"category" : "Generic Modules/Production",
"init_xml" : [],
"demo_xml" : [],
"update_xml" : [
"mrp_subproduct_view.xml",
],
"active": False,
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,91 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from osv import fields
from osv import osv
class mrp_subproduct(osv.osv):
_name = 'mrp.subproduct'
_description = 'Mrp Sub Product'
_columns={
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_qty': fields.float('Product Qty', required=True),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
'bom_id': fields.many2one('mrp.bom', 'BoM'),
}
def onchange_product_id(self, cr, uid, ids, product_id,context={}):
if product_id:
prod=self.pool.get('product.product').browse(cr,uid,product_id)
v = {'product_uom':prod.uom_id.id}
return {'value': v}
return {}
mrp_subproduct()
class mrp_bom(osv.osv):
_name = 'mrp.bom'
_description = 'Bill of Material'
_inherit='mrp.bom'
_columns={
'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'sub_products'),
}
mrp_bom()
class mrp_production(osv.osv):
_name = 'mrp.production'
_description = 'Production'
_inherit= 'mrp.production'
def action_confirm(self, cr, uid, ids):
picking_id=super(mrp_production,self).action_confirm(cr, uid, ids)
for production in self.browse(cr, uid, ids):
source = production.product_id.product_tmpl_id.property_stock_production.id
for sub_product in production.bom_id.sub_products:
data = {
'name':'PROD:'+production.name,
'date_planned': production.date_planned,
'product_id': sub_product.product_id.id,
'product_qty': sub_product.product_qty,
'product_uom': sub_product.product_uom.id,
'product_uos_qty': production.product_uos and production.product_uos_qty or False,
'product_uos': production.product_uos and production.product_uos.id or False,
'location_id': source,
'location_dest_id': production.location_dest_id.id,
'move_dest_id': production.move_prod_id.id,
'state': 'waiting',
'production_id':production.id
}
sub_prod_ids=self.pool.get('stock.move').create(cr, uid,data)
return picking_id
mrp_production()

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="mrp_subproduct_view" model="ir.ui.view">
<field name="name">mrp.bom.sub.product</field>
<field name="model">mrp.bom</field>
<field name="inherit_id" ref="mrp.mrp_bom_form_view"/>
<field name="type">form</field>
<field name="arch" type="xml">
<notebook>
<page string="Sub Products" position="inside">
<field colspan="4" name="sub_products" nolabel="1" widget="one2many_list">
<tree string="sub products" editable="top">
<field name="product_id" on_change="onchange_product_id(product_id)"/>
<field name="product_uom"/>
<field name="product_qty"/>
</tree>
<form string="Sub Products">
<field name="product_id" on_change="onchange_product_id(product_id)"/>
<field name="product_uom"/>
<field name="product_qty"/>
</form>
</field>
</page>
</notebook>
</field>
</record>
</data>
</openerp>

View File

@ -4,7 +4,7 @@
"version":"1.0",
"author":"Tiny",
"category":"Custom",
"depends":["product"],
"depends":["base","product","account"],
"demo_xml":[],
"update_xml":["product_margin_view.xml"],
"active": False,

View File

@ -43,7 +43,7 @@ class product_product(osv.osv):
res[val.id] = {}
date_from=context.get('date_from', time.strftime('%Y-01-01'))
date_to=context.get('date_to', time.strftime('%Y-12-31'))
invoice_state=context.get('invoice_state', 'open')
invoice_state=context.get('invoice_state', 'open_paid')
if 'date_from' in field_names:
res[val.id]['date_from']=date_from
if 'date_to' in field_names:
@ -54,12 +54,12 @@ class product_product(osv.osv):
invoice_types=[]
states=[]
if invoice_state=='draft_open':
states=['draft','open']
elif invoice_state=='paid':
if invoice_state=='paid':
states=['paid']
elif invoice_state=='open':
states=['open']
elif invoice_state=='open_paid':
states=['open','paid']
elif invoice_state=='draft_open_paid':
states=['draft','open','paid']
if 'sale_avg_price' in field_names or 'sale_num_invoiced' in field_names or 'turnover' in field_names or 'sale_expected' in field_names:
invoice_types=['out_invoice','in_refund']
@ -71,15 +71,11 @@ class product_product(osv.osv):
avg(l.price_unit) as avg_unit_price,
sum(l.quantity) as num_qty,
sum(l.quantity * l.price_unit) as total,
sum(sale_line.product_uom_qty * sale_line.price_unit) as sale_expected,
sum(purchase_line.product_qty * purchase_line.price_unit) as normal_cost
sum(l.quantity * product.list_price) as sale_expected,
sum(l.quantity * product.standard_price) as normal_cost
from account_invoice_line l
left join account_invoice i on (l.invoice_id = i.id)
left join sale_order_invoice_rel sale_invoice on (i.id=sale_invoice.invoice_id)
left join sale_order sale on sale.id=sale_invoice.order_id
left join sale_order_line sale_line on sale.id=sale_line.order_id
left join purchase_order purchase on purchase.invoice_id=i.id
left join purchase_order_line purchase_line on purchase_line.order_id=purchase.id
left join product_template product on (product.id=l.product_id)
where l.product_id = %s and i.state in ('%s') and i.type in ('%s')
"""%(val.id,"','".join(states),"','".join(invoice_types))
cr.execute(sql)
@ -111,24 +107,22 @@ class product_product(osv.osv):
'date_from': fields.function(_product_margin, method=True, type='date', string='From Date', multi=True),
'date_to': fields.function(_product_margin, method=True, type='date', string='To Date', multi=True),
'invoice_state': fields.function(_product_margin, method=True, type='selection', selection=[
('paid','Paid'),
('open','All Open'),
('draft_open','Draft and Open')
('paid','Paid'),('open_paid','Open and Paid'),('draft_open_paid','Draft, Open and Paid')
], string='Invoice State',multi=True, readonly=True),
'sale_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='sale'),
'purchase_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='purchase'),
'sale_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='sale'),
'purchase_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='purchase'),
'sales_gap' : fields.function(_product_margin, method=True, type='float', string='Sales Gap', multi='sale'),
'purchase_gap' : fields.function(_product_margin, method=True, type='float', string='Purchase Gap', multi='purchase'),
'turnover' : fields.function(_product_margin, method=True, type='float', string='Turnover' ,multi='sale'),
'total_cost' : fields.function(_product_margin, method=True, type='float', string='Total Cost', multi='purchase'),
'sale_expected' : fields.function(_product_margin, method=True, type='float', string='Expected Sale', multi='sale'),
'normal_cost' : fields.function(_product_margin, method=True, type='float', string='Normal Cost', multi='purchase'),
'total_margin' : fields.function(_product_margin, method=True, type='float', string='Total Margin', multi='total'),
'expected_margin' : fields.function(_product_margin, method=True, type='float', string='Expected Margin', multi='total'),
'total_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Total Margin (%)', multi='margin'),
'expected_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Expected Margin (%)', multi='margin'),
'sale_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='sale',help="Avg. Price in Customer Invoices)"),
'purchase_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='purchase',help="Avg. Price in Supplier Invoices "),
'sale_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='sale',help="Sum of Quantity in Customer Invoices"),
'purchase_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='purchase',help="Sum of Quantity in Supplier Invoices"),
'sales_gap' : fields.function(_product_margin, method=True, type='float', string='Sales Gap', multi='sale',help="Excepted Sale - Turn Over"),
'purchase_gap' : fields.function(_product_margin, method=True, type='float', string='Purchase Gap', multi='purchase',help="Normal Cost - Total Cost"),
'turnover' : fields.function(_product_margin, method=True, type='float', string='Turnover' ,multi='sale',help="Sum of Multification of Invoice price and quantity of Customer Invoices"),
'total_cost' : fields.function(_product_margin, method=True, type='float', string='Total Cost', multi='purchase',help="Sum of Multification of Invoice price and quantity of Supplier Invoices "),
'sale_expected' : fields.function(_product_margin, method=True, type='float', string='Expected Sale', multi='sale',help="Sum of Multification of Sale Catalog price and quantity of Customer Invoices"),
'normal_cost' : fields.function(_product_margin, method=True, type='float', string='Normal Cost', multi='purchase',help="Sum of Multification of Cost price and quantity of Supplier Invoices"),
'total_margin' : fields.function(_product_margin, method=True, type='float', string='Total Margin', multi='total',help="Turnorder - Total Cost"),
'expected_margin' : fields.function(_product_margin, method=True, type='float', string='Expected Margin', multi='total',help="Excepted Sale - Normal Cost"),
'total_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Total Margin (%)', multi='margin',help="Total margin * 100 / Turnover"),
'expected_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Expected Margin (%)', multi='margin',help="Expected margin * 100 / Expected Sale"),
}

View File

@ -2,21 +2,38 @@
<openerp>
<data>
<wizard id="action_open_margin" menu="False" model="product.product" name="product.margin" string="Product Margin"/>
<wizard id="action_open_margin" menu="False" model="product.product" name="product.margins" string="Product Margins"/>
<menuitem id="menu_product_reporting" name="Reporting" parent ="product.menu_main_product" />
<menuitem icon="STOCK_JUSTIFY_FILL" action="action_open_margin" id="menu_action_product_margin" type="wizard" sequence="5" parent="menu_product_reporting" />
<record model="ir.ui.view" id="view_product_margin_graph">
<field name="name">product.margin.graph</field>
<field name="model">product.product</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Product Margins" type="bar">
<field name="name"/>
<field name="turnover" operator="+"/>
<field name="total_cost" operator="+"/>
</graph>
</field>
</record>
<record id="view_product_margin_form" model="ir.ui.view">
<field name="name">product.margin.form.inherit</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="priority">10</field>
<field name="arch" type="xml">
<page string="Prices" position="after">
<page string="Margin">
<field name="type">form</field>
<field name="priority">5</field>
<field name="arch" type="xml">
<form string="Product Margins">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="default_code" select="1"/>
</group>
<notebook colspan="4">
<page string="Margins">
<separator string="Analysis Criteria" colspan="4"/>
<field name="date_from"/>
<field name="date_to"/>
@ -42,11 +59,12 @@
<separator string="Margins" colspan="4"/>
<field name="total_margin"/>
<field name="expected_margin"/>
<field name="total_margin_rate" widget="progressbar"/>
<field name="total_margin_rate" widget="progressbar"/>
<field name="expected_margin_rate" widget="progressbar"/>
</page>
</page>
</page>
</notebook>
</form>
</field>
</record>
@ -55,18 +73,19 @@
<field name="model">product.product</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Product Margin">
<tree string="Product Margins">
<field name="name" select="1"/>
<field name="default_code" select="1"/>
<field name="sale_avg_price"/>
<field name="sale_num_invoiced"/>
<field name="turnover"/>
<field name="sales_gap"/>
<field name="total_cost"/>
<field name="turnover" sum="Turnover"/>
<field name="sales_gap" sum="Sales Gap"/>
<field name="total_cost" sum="Total Cost"/>
<field name="purchase_num_invoiced" string="#Purchased"/>
<field name="total_margin"/>
<field name="expected_margin"/>
<field name="total_margin_rate" widget="progressbar"/>
<field name="expected_margin_rate" widget="progressbar"/>
</tree>
</field>
</record>

View File

@ -36,17 +36,17 @@ def _action_open_window(self, cr, uid, data, context):
cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.tree', 'tree'))
view_res = cr.fetchone()
return {
'name': 'Product Margin',
'name': 'Product Margins',
'context':{'date_from':data['form']['from_date'],'date_to':data['form']['to_date'],'invoice_state' : data['form']['invoice_state']},
'view_type': 'form',
"view_mode": 'tree,form',
"view_mode": 'tree,form,graph',
'res_model':'product.product',
'type': 'ir.actions.act_window',
'view_id': view_res,
}
class product_margin(wizard.interface):
class product_margins(wizard.interface):
form1 = '''<?xml version="1.0"?>
<form string="View Stock of Products">
<separator string="Select " colspan="4"/>
@ -58,28 +58,32 @@ class product_margin(wizard.interface):
'from_date': {
'string': 'From',
'type': 'date',
'default': lambda *a:time.strftime('%Y-01-01'),
},
'to_date': {
'string': 'To',
'type': 'date',
'default': lambda *a:time.strftime('%Y-12-31'),
},
'invoice_state': {
'string': 'Invoice State',
'type': 'selection',
'selection': [('paid','Paid'),('open','All Open'),('draft_open','Draft and Open')],
'selection': [('paid','Paid'),('open_paid','Open and Paid'),('draft_open_paid','Draft, Open and Paid'),],
'required': True,
'default': lambda *a:"open",
'default': lambda *a:"open_paid",
},
}
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Margin','gtk-ok')]}
'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Margins','gtk-ok')]}
},
'open': {
'actions': [],
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
}
}
product_margin('product.margin')
product_margins('product.margins')

View File

@ -69,7 +69,9 @@ class profile_manufacturing_config_install_modules_wizard(osv.osv_memory):
"our frontend point of sale for a perfect ergonomy with touchscreen "\
"materials and payment processing hardware."),
'portal': fields.boolean('Portal',
help="This module allows you to manage a Portal system.")
help="This module allows you to manage a Portal system."),
'mrp_subproduct': fields.boolean('Mrp Sub Product',
help="This module allows you to add sub poducts in mrp bom.")
}
def action_cancel(self,cr,uid,ids,conect=None):
return {

View File

@ -11,6 +11,7 @@
<field name="stock_location"/>
<field name="mrp_jit"/>
<field name="mrp_operation"/>
<field name="mrp_subproduct"/>
<separator string="Sales Management" colspan="4"/>
<field name="point_of_sale"/>
<field name="sale_journal"/>

View File

@ -310,13 +310,28 @@
<field name="type">calendar</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<calendar color="user_id" date_delay="planned_hours" date_start="date_start" string="Tasks">
<calendar type="gantt" color="user_id" date_delay="planned_hours" date_start="date_start" string="Tasks">
<field name="name"/>
<field name="project_id"/>
</calendar>
</field>
</record>
<record model="ir.ui.view" id="view_project_task_graph">
<record id="view_task_gantt" model="ir.ui.view">
<field name="name">project.task.gantt</field>
<field name="model">project.task</field>
<field name="type">gantt</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<gantt color="user_id" date_delay="planned_hours" date_start="date_start" string="Tasks">
<level object="project.project" domain="[]">
<field name="name"/>
</level>
</gantt>
</field>
</record>
<record id="view_project_task_graph" model="ir.ui.view">
<field name="name">project.task.graph</field>
<field name="model">project.task</field>
<field name="type">graph</field>
@ -333,7 +348,7 @@
<field name="name">All Tasks</field>
<field name="res_model">project.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="view_mode">tree,form,calendar,gantt,graph</field>
<field eval="False" name="view_id"/>
</record>
<menuitem action="action_view_task" id="menu_action_view_task" parent="project.menu_main"/>
@ -342,7 +357,7 @@
<field name="name">My Tasks</field>
<field name="res_model">project.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="view_mode">tree,form,calendar,gantt,graph</field>
<field name="domain">[('user_id', '=', uid)]</field>
</record>
<menuitem action="action_view_task4" id="menu_action_view_task4" parent="project.menu_main"/>

View File

@ -10,7 +10,11 @@
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_All_Address_Detail">
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
@ -95,8 +99,11 @@
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" rightIndent="0.0" leftIndent="12.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P2" rightIndent="0.0" leftIndent="15.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" rightIndent="0.0" leftIndent="12.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P2" rightIndent="0.0" leftIndent="12.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P3" rightIndent="0.0" leftIndent="15.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P4" fontName="Times-Roman" fontSize="9.0" leading="11"/>
<paraStyle name="P5" fontName="Times-Bold" fontSize="10.0" leading="13"/>
<paraStyle name="P6" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
@ -133,40 +140,70 @@
<images/>
<story>
<para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
<para style="terp_default_8">
<para style="P6">
<font color="white"> </font>
</para>
<blockTable colWidths="294.0,240.0" style="Table_All_Address_Detail">
<blockTable colWidths="253.0,59.0,223.0" style="Tableau1">
<tr>
<td>
<para style="terp_default_9">[[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]</para>
<para style="terp_default_Bold_9">Shipping address :</para>
<para style="terp_default_9">[[ addr.partner_id.title or '' ]][[ addr.partner_id.name ]]</para>
<para style="terp_default_9">[[ addr.title or '' ]][[ addr.name ]]</para>
<para style="terp_default_9">[[ addr.street ]]</para>
<para style="terp_default_9">[[ addr.street2 or '' ]]</para>
<para style="terp_default_9"><font face="Times-Roman">[[ addr.zip or '' ]]</font> [[ addr.city or '' ]]</para>
<para style="terp_default_9">[[ addr.state_id and addr.state_id.name or '' ]]</para>
<para style="terp_default_9">[[ addr.country_id and addr.country_id.name or '' ]]</para>
</td>
<td>
<para style="terp_default_9">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.street ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.street2 or '' ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]]</para>
<para style="terp_default_9">[[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]]</para>
<para style="terp_default_9">
<blockTable colWidths="253.0" style="Tableau2">
<tr>
<td>
<para style="P6">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P6">[[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]</para>
<para style="P5">Shipping address :</para>
<para style="P6">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
<para style="P6">[[ addr.title or '' ]] [[ addr.name ]]</para>
<para style="P6">[[ addr.street ]]</para>
<para style="P6">[[ addr.street2 or '' ]]</para>
<para style="P6">[[ addr.zip or '' ]] [[ addr.city or '' ]]</para>
<para style="P6">[[ addr.state_id and addr.state_id.name or '' ]]</para>
<para style="P6">[[ addr.country_id and addr.country_id.name or '' ]]</para>
</td>
</tr>
</blockTable>
<para style="P6">
<font color="white"> </font>
</para>
<para style="terp_default_9">Tél. : [[ o.partner_address_id.phone or '' ]]</para>
<para style="terp_default_9">Fax : [[ o.partner_address_id.fax or '' ]]</para>
<para style="terp_default_9">TVA :[[ o.partner_id.vat or '' ]]</para>
</td>
<td>
<para style="P6">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P6">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
<para style="P6">[[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]]</para>
<para style="P6">[[ o.partner_address_id.street ]]</para>
<para style="P6">[[ o.partner_address_id.street2 or '' ]]</para>
<para style="P6">[[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]]</para>
<para style="P6">[[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]]</para>
<para style="P6">[[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]]</para>
<para style="P6">
<font color="white"> </font>
</para>
<para style="P6">Tel. : [[ o.partner_address_id.phone or '' ]]</para>
<para style="P6">Fax : [[ o.partner_address_id.fax or '' ]]</para>
<para style="P6">TVA : [[ o.partner_id.vat or '' ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_header">Request for Quotation [[ (o.state=='draft' or removeParentNode('font')) and '' ]] Order [[ (o.state&lt;&gt;'draft' or removeParentNode('font')) and '' ]] N° :[[ o.name ]]</para>
<para style="P6">
<font color="white"> </font>
</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="Standard">
<font color="white"> </font>
</para>
<para style="terp_header"> [[ (o.state=='draft' or removeParentNode('font')) and 'Request for Quotation' ]] [[ (o.state&lt;&gt;'draft' or removeParentNode('font')) and 'Purchase Order Confirmation' ]] N&#176; [[ o.name ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
@ -198,7 +235,7 @@
<para style="terp_default_Centre_9">[[ o.partner_ref or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]]</para>
<para style="Standard">[[ time.strftime('%d/%m/%Y', time.strptime(line.date_planned, '%Y-%m-%d %H:%M:%S')) ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ o.validator and o.validator.name or '' ]]</para>
@ -208,7 +245,7 @@
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="253.0,52.0,57.0,44.0,58.0,70.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
<blockTable colWidths="253.0,52.0,49.0,58.0,58.0,70.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
@ -232,7 +269,7 @@
</blockTable>
<section>
<para style="terp_default_8">[[ repeatIn(o.order_line,'line') ]]</para>
<blockTable colWidths="254.0,52.0,57.0,24.0,20.0,57.0,71.0" style="Table_Order_Pur_line_Content">
<blockTable colWidths="254.0,52.0,57.0,34.0,20.0,57.0,70.0" style="Table_Order_Pur_line_Content">
<tr>
<td>
<para style="terp_default_9">[[ line.name ]]</para>
@ -241,7 +278,7 @@
<para style="terp_default_9">[[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ time.strftime('%d/%m/%Y', time.strptime(line.date_planned, '%Y-%m-%d %H:%M:%S')) ]]</para>
<para style="terp_default_Centre_9">[[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d')) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ line.product_qty ]] </para>
@ -258,7 +295,7 @@
</tr>
<tr>
<td>
<para style="P3">[[ line.notes or removeParentNode('tr') ]]</para>
<para style="P2">[[ line.notes or removeParentNode('tr') ]]</para>
</td>
<td>
<para style="terp_default_9">
@ -293,7 +330,7 @@
</tr>
</blockTable>
</section>
<blockTable colWidths="415.0,57.0,42.0,20.0" style="Table_All_Total_Detail">
<blockTable colWidths="415.0,57.0,52.0,20.0" style="Table_All_Total_Detail">
<tr>
<td>
<para style="terp_default_9">
@ -333,7 +370,7 @@
</para>
</td>
<td>
<para style="P2">Total :</para>
<para style="P3">Total :</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ o.amount_total ]]</para>

View File

@ -69,10 +69,11 @@ class product_product(osv.osv):
location_ids = context['location']
else:
cr.execute("select lot_stock_id from stock_warehouse")
location_ids = [id for (id,) in cr.fetchall()]
location_ids = [id for (id,) in cr.fetchall()]
# build the list of ids of children of the location given by id
location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)])
child_location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)])
location_ids= len(child_location_ids) and child_location_ids or location_ids
states_str = ','.join(map(lambda s: "'%s'" % s, states))