[IMP] Purchase quotation and purchase order converted to QWeb

bzr revid: openerp-sle@openerp-sle.home-20140214144627-se5x0alcl43gut4k
This commit is contained in:
openerp-sle 2014-02-14 15:46:27 +01:00
parent f51ffe6227
commit 31cf553335
9 changed files with 217 additions and 561 deletions

View File

@ -65,6 +65,9 @@ Dashboard / Reports for Purchase Management will include:
'board_purchase_view.xml',
'edi/purchase_order_action_data.xml',
'res_config_view.xml',
'views/report_purchaseorder.xml',
'views/report_purchasequotation.xml',
],
'test': [
'test/ui/purchase_users.yml',
@ -75,7 +78,6 @@ Dashboard / Reports for Purchase Management will include:
'test/process/merge_order.yml',
'test/process/edi_purchase_order.yml',
'test/process/invoice_on_poline.yml',
'test/ui/print_report.yml',
'test/ui/duplicate_order.yml',
'test/ui/delete_order.yml',
],

View File

@ -1,11 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report auto="False" id="report_purchase_quotation" model="purchase.order"
name="purchase.quotation" rml="purchase/report/request_quotation.rml"
string="Request for Quotation"/>
<report auto="False" id="report_purchase_order" model="purchase.order"
name="purchase.order" rml="purchase/report/order.rml"
usage="default" string="Purchase Order"/>
<report
string="Purchase Order"
id="action_report_purchase_order"
model="purchase.order"
report_type="qweb-pdf"
name="purchase.report_purchaseorder"
file="purchase.report_purchaseorder"
/>
<report
string="Request for Quotation"
id="report_purchase_quotation"
model="purchase.order"
report_type="qweb-pdf"
name="purchase.report_purchasequotation"
file="purchase.report_purchasequotation"
/>
</data>
</openerp>

View File

@ -1,33 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from openerp.report import report_sxw
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(order, self).__init__(cr, uid, name, context=context)
self.localcontext.update({'time': time})
report_sxw.report_sxw('report.purchase.order','purchase.order','addons/purchase/report/order.rml',parser=order)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,319 +0,0 @@
<?xml version="1.0"?>
<document filename="Purchase Order.pdf">
<template title="Purchase Order" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="18.0" y1="42.0" width="535" height="758"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Header_Order_Reference_Tbl">
<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="LINEAFTER" 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"/>
</blockTableStyle>
<blockTableStyle id="Content_Order_Reference_Table">
<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="LINEAFTER" 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"/>
</blockTableStyle>
<blockTableStyle id="Table_Header_Pur_ord_Line">
<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="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_Order_Pur_line_Content">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table_All_Total_Detail">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
</blockTableStyle>
<blockTableStyle id="Table_Outer_Notes">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Centre_8" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<pto>
<para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
<para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
<pto_header>
<blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
<tr>
<td>
<para style="terp_tblheader_General"><b>Description</b></para>
</td>
<td>
<para style="terp_tblheader_General"><b>Taxes</b></para>
</td>
<td>
<para style="terp_tblheader_General"><b>Date Req.</b></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><b>Qty</b></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><b>Net Price</b></para>
</td>
</tr>
</blockTable>
</pto_header>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="253.0,59.0,223.0" style="Tableau1">
<tr>
<td>
<blockTable colWidths="253.0" style="Tableau2">
<tr>
<td>
<para style="terp_default_Bold_9"><b>Shipping address :</b></para>
<para style="terp_default_9">[[ (o.dest_address_id and o.dest_address_id.name) or (o.warehouse_id and o.warehouse_id.name) or '']]</para>
<para style="terp_default_9">[[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_id)) or '']]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
<para style="terp_default_9">[[ o.partner_id and display_address(o.partner_id) ]] </para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">Tel : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
<para style="terp_default_9">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
<para style="terp_default_9">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_header"><b>[[ o.state=='draft' and removeParentNode('para') ]] Purchase Order Confirmation N° [[ o.name ]]</b></para>
<para style="terp_header"><b>[[ o.state&lt;&gt;'draft' and removeParentNode('para') ]] Request for Quotation N° [[ o.name ]]</b></para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="136.0,132.0,133.0,133.0" style="Header_Order_Reference_Tbl">
<tr>
<td>
<para style="terp_tblheader_General_Centre"><b>Our Order Reference</b></para>
</td>
<td>
<para style="terp_tblheader_General_Centre"><b>Your Order Reference</b></para>
</td>
<td>
<para style="terp_tblheader_General_Centre"><b>Order Date</b></para>
</td>
<td>
<para style="terp_tblheader_General_Centre"><b>Validated By</b></para>
</td>
</tr>
</blockTable>
<blockTable colWidths="136.0,132.0,133.0,133.0" style="Content_Order_Reference_Table">
<tr>
<td>
<para style="terp_default_Centre_8">[[ o.name or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.partner_ref or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[formatLang(o.date_order,date=True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ (o.validator and o.validator.name) or '' ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
<tr>
<td>
<para style="terp_tblheader_General"><b>Description</b></para>
</td>
<td>
<para style="terp_tblheader_General"><b>Taxes</b></para>
</td>
<td>
<para style="terp_tblheader_General"><b>Date Req.</b></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><b>Qty</b></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
</td>
<td>
<para style="terp_tblheader_General_Right"><b>Net Price</b></para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_8">[[repeatIn(o.order_line,'line')]]</para>
<blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" style="Table_Order_Pur_line_Content">
<tr>
<td>
<para style="terp_default_9">[[ line.name ]]</para>
</td>
<td>
<para style="terp_default_9">[[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]]</para>
</td>
<td>
<para style="terp_default_9">[[ formatLang( line.date_planned, date=True) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]] </para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.price_unit, digits=get_digits(dp='Product Price') ) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]</para>
</td>
</tr>
</blockTable>
</section>
<blockTable colWidths="375.0,60.0,100.0" style="Table_All_Total_Detail">
<tr>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">Net Total :</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]]</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">Taxes :</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]</para>
</td>
</tr>
<tr>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9"><b>Total :</b></para>
</td>
<td>
<para style="terp_default_Bold_9_Right"><b>[[ formatLang(o.amount_total, digits=get_digits(dp='Account') , currency_obj=o.pricelist_id.currency_id) ]]</b></para>
</td>
</tr>
</blockTable>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="535.0" style="Table_Outer_Notes">
<tr>
<td>
<para style="terp_default_9">[[ format(o.notes or '') ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</pto>
</story>
</document>

View File

@ -1,35 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from openerp.report import report_sxw
class request_quotation(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(request_quotation, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'user': self.pool.get('res.users').browse(cr, uid, uid, context)
})
report_sxw.report_sxw('report.purchase.quotation','purchase.order','addons/purchase/report/request_quotation.rml',parser=request_quotation)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,146 +0,0 @@
<?xml version="1.0"?>
<document filename="requestforquotation.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="23.0" y1="43.0" width="530" height="799"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Product_Header_Title">
<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"/>
</blockTableStyle>
<blockTableStyle id="Table_Product_Line">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard"/>
<paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Space bet user and signature" fontSize="4.0" leading="5" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<para style="terp_default_9">[[repeatIn(objects,'order')]]</para>
<para style="terp_default_9">[[ setLang(order.partner_id.lang) ]]</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="250.0,59.0,221.0" style="Tableau1">
<tr>
<td>
<blockTable colWidths="250.0" style="Tableau2">
<tr>
<td>
<para style="terp_default_Bold_9"><b>Expected Delivery address:</b></para>
<para style="terp_default_9">[[ (order.dest_address_id and order.dest_address_id.name) or (order.warehouse_id and order.warehouse_id.name) or '']]</para>
<para style="P1">[[ order.dest_address_id and display_address(order.dest_address_id) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">[[ (order .partner_id and order.partner_id.title and order.partner_id.title.name) or '' ]] [[ (order .partner_id and order.partner_id.name) or '' ]] </para>
<para style="terp_default_9">[[ order.partner_id and display_address(order .partner_id) ]] </para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">Tel.: [[ (order.partner_id and order.partner_id.phone) or removeParentNode('para') ]]</para>
<para style="terp_default_9">Fax: [[ (order.partner_id and order.partner_id.fax) or removeParentNode('para') ]]</para>
<para style="P1">TVA: [[ (order.partner_id and order.partner_id.vat) or removeParentNode('para') ]]</para>
</td>
</tr>
</blockTable>
<para style="Standard">
<font color="white"> </font>
</para>
<para style="terp_header"><b>Request for Quotation : [[order.name]]</b></para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="349.0,90.0,92.0" repeatRows="1" style="Table_Product_Header_Title">
<tr>
<td>
<para style="terp_tblheader_Details"><b>Description</b></para>
</td>
<td>
<para style="terp_tblheader_Details_Centre"><b>Expected Date</b></para>
</td>
<td>
<para style="terp_tblheader_Details_Centre"><b>Qty</b></para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_9">[[ repeatIn(order.order_line,'order_line') ]]</para>
<blockTable colWidths="349.0,89.0,49.0,43.0" style="Table_Product_Line">
<tr>
<td>
<para style="terp_default_9">[[ order_line.name ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ formatLang(order_line.date_planned, date = True) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(order_line.product_qty )]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ (order_line.product_uom and order_line.product_uom.name) or '' ]]</para>
</td>
</tr>
</blockTable>
</section>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">[[ format(order.notes or '') ]]</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_9">Regards,</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="Space bet user and signature">
<font color="white"> </font>
</para>
<para style="terp_default_9">[[ user.signature or '' ]]</para>
</story>
</document>

View File

@ -1,21 +0,0 @@
-
In order to test the PDF reports defined on a Purchase Order, I print a Request Quotation report
-
!python {model: purchase.order}: |
import os
import openerp.report
from openerp import tools
data, format = openerp.report.render_report(cr, uid, [ref('purchase.purchase_order_1'), ref('purchase.purchase_order_2')], 'purchase.quotation', {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'purchase-request_quotation'+format), 'wb+').write(data)
-
I print Purchase Order report
-
!python {model: purchase.order}: |
import os
from openerp import tools
from openerp.report import render_report
ids = [ref('purchase.purchase_order_1'), ref('purchase.purchase_order_2')]
data, format = render_report(cr, uid, ids, 'purchase.order', {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'purchase-purchase_order_report'+format), 'wb+').write(data)

View File

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_purchaseorder">
<t t-call="report.html_skeleton">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">
<div class="oe_structure"/>
<div class="row">
<div class="col-xs-6">
Shipping address :<br/>
<div t-if="o.dest_address_id">
<div t-field="o.dest_address_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
<p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
</div>
<div t-if="o.warehouse_id">
<span t-field="o.warehouse_id.name"/>
<div t-field="o.warehouse_id.partner_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
<p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
</div>
</div>
<div class="col-xs-4 col-xs-offset-2">
<div t-field="o.partner_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
</div>
</div>
<h2 t-if="o.state != 'draft'">Purchase Order Confirmation N°<span t-field="o.name"/></h2>
<h2 t-if="o.state == 'draft'">Request for Quotation N°<span t-field="o.name"/></h2>
<div class="row mt32 mb32">
<div t-if="o.name" class="col-xs-3">
<strong>Our Order Reference:</strong>
<p t-field="o.name"/>
</div>
<div t-if="o.partner_ref" class="col-xs-3">
<strong>Your Order Reference</strong>
<p t-field="o.partner_ref"/>
</div>
<div t-if="o.date_order" class="col-xs-3">
<strong>Order Date:</strong>
<p t-field="o.date_order"/>
</div>
<div t-if="o.validator" class="col-xs-3">
<strong>Validated By:</strong>
<p t-field="o.validator"/>
</div>
</div>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Description</strong></th>
<th><strong>Taxes</strong></th>
<th class="text-center"><strong>Date Req.</strong></th>
<th class="text-right"><strong>Qty</strong></th>
<th class="text-right"><strong>Unit Price</strong></th>
<th class="text-right"><strong>Net Price</strong></th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.order_line" t-as="line">
<td>
<span t-field="line.name"/>
</td>
<td>
<span t-esc="', '.join(map(lambda x: x.name, line.taxes_id))"/>
</td>
<td class="text-center">
<span t-field="line.date_planned"/>
</td>
<td class="text-right">
<span t-field="line.product_qty"/>
<span t-field="line.product_uom.name" groups="product.group_uom"/>
</td>
<td class="text-right">
<span t-field="line.price_unit"/>
</td>
<td class="text-right">
<span t-field="line.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tr class="border-black">
<td><strong>Total Without Taxes</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
<tr>
<td>Taxes</td>
<td class="text-right">
<span t-field="o.amount_tax"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span t-field="o.amount_total"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
</td>
</tr>
</table>
</div>
</div>
<p t-field="o.notes"/>
<div class="oe_structure"/>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_purchasequotation">
<t t-call="report.html_skeleton">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">
<div class="oe_structure"/>
<div class="row">
<div class="col-xs-6">
Shipping address :<br/>
<div t-if="o.dest_address_id">
<div t-field="o.dest_address_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
<p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
</div>
<div t-if="o.warehouse_id">
<span t-field="o.warehouse_id.name"/>
<div t-field="o.warehouse_id.partner_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
<p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
</div>
</div>
<div class="col-xs-4 col-xs-offset-2">
<div t-field="o.partner_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
</div>
</div>
<h2>Request for Quotation <span t-field="o.name"/></h2>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Description</strong></th>
<th class="text-center"><strong>Expected Date</strong></th>
<th class="text-center"><strong>Qty</strong></th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.order_line" t-as="order_line">
<td>
<span t-field="order_line.name"/>
</td>
<td class="text-center">
<span t-field="order_line.date_planned"/>
</td>
<td class="text-right">
<span t-field="order_line.product_qty"/>
<span t-field="order_line.product_uom" groups="product.group_uom"/>
</td>
</tr>
</tbody>
</table>
<p t-field="o.notes"/>
<span>Regards,</span>
<span t-field="user.signature"/>
<div class="oe_structure"/>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>