diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 9d72579cc77..0d0a372a3d0 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -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', ], diff --git a/addons/purchase/purchase_report.xml b/addons/purchase/purchase_report.xml index a3a4a6a70b6..424a450cd9e 100644 --- a/addons/purchase/purchase_report.xml +++ b/addons/purchase/purchase_report.xml @@ -1,11 +1,22 @@ - - + + + diff --git a/addons/purchase/report/order.py b/addons/purchase/report/order.py deleted file mode 100644 index 68d92970aa0..00000000000 --- a/addons/purchase/report/order.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -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: - diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml deleted file mode 100644 index 6eb1b2167ee..00000000000 --- a/addons/purchase/report/order.rml +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[repeatIn(objects,'o')]] - [[ setLang(o.partner_id.lang) ]] - - - - - Description - - - Taxes - - - Date Req. - - - Qty - - - Unit Price - - - Net Price - - - - - - - - - - - - - - Shipping address : - [[ (o.dest_address_id and o.dest_address_id.name) or (o.warehouse_id and o.warehouse_id.name) or '']] - [[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_id)) or '']] - - - - - - - - - - - - - - [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ o.partner_id and display_address(o.partner_id) ]] - - - - Tel : [[ (o.partner_id.phone) or removeParentNode('para') ]] - Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]] - TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]] - - - - - - - [[ o.state=='draft' and removeParentNode('para') ]] Purchase Order Confirmation N° [[ o.name ]] - [[ o.state<>'draft' and removeParentNode('para') ]] Request for Quotation N° [[ o.name ]] - - - - - - - Our Order Reference - - - Your Order Reference - - - Order Date - - - Validated By - - - - - - - [[ o.name or '' ]] - - - [[ o.partner_ref or '' ]] - - - [[formatLang(o.date_order,date=True) ]] - - - [[ (o.validator and o.validator.name) or '' ]] - - - - - - - - - - Description - - - Taxes - - - Date Req. - - - Qty - - - Unit Price - - - Net Price - - - -
- [[repeatIn(o.order_line,'line')]] - - - - [[ line.name ]] - - - [[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]] - - - [[ formatLang( line.date_planned, date=True) ]] - - - [[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]] - - - [[ formatLang(line.price_unit, digits=get_digits(dp='Product Price') ) ]] - - - [[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]] - - - -
- - - - - - - - - Net Total : - - - [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) ]] - - - - - - - - - - Taxes : - - - [[ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) ]] - - - - - - - - - - Total : - - - [[ formatLang(o.amount_total, digits=get_digits(dp='Account') , currency_obj=o.pricelist_id.currency_id) ]] - - - - - - - - - - [[ format(o.notes or '') ]] - - - - - - -
-
-
diff --git a/addons/purchase/report/request_quotation.py b/addons/purchase/report/request_quotation.py deleted file mode 100644 index 7be23113584..00000000000 --- a/addons/purchase/report/request_quotation.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -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: - diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml deleted file mode 100644 index cfc97a75aa4..00000000000 --- a/addons/purchase/report/request_quotation.rml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[repeatIn(objects,'order')]] - [[ setLang(order.partner_id.lang) ]] - - - - - - - - - - Expected Delivery address: - [[ (order.dest_address_id and order.dest_address_id.name) or (order.warehouse_id and order.warehouse_id.name) or '']] - [[ order.dest_address_id and display_address(order.dest_address_id) ]] - - - - - - - - - - - - - - [[ (order .partner_id and order.partner_id.title and order.partner_id.title.name) or '' ]] [[ (order .partner_id and order.partner_id.name) or '' ]] - [[ order.partner_id and display_address(order .partner_id) ]] - - - - Tel.: [[ (order.partner_id and order.partner_id.phone) or removeParentNode('para') ]] - Fax: [[ (order.partner_id and order.partner_id.fax) or removeParentNode('para') ]] - TVA: [[ (order.partner_id and order.partner_id.vat) or removeParentNode('para') ]] - - - - - - - Request for Quotation : [[order.name]] - - - - - - - Description - - - Expected Date - - - Qty - - - -
- [[ repeatIn(order.order_line,'order_line') ]] - - - - [[ order_line.name ]] - - - [[ formatLang(order_line.date_planned, date = True) ]] - - - [[ formatLang(order_line.product_qty )]] - - - [[ (order_line.product_uom and order_line.product_uom.name) or '' ]] - - - -
- - - - [[ format(order.notes or '') ]] - - - - Regards, - - - - - - - [[ user.signature or '' ]] -
-
diff --git a/addons/purchase/test/ui/print_report.yml b/addons/purchase/test/ui/print_report.yml deleted file mode 100644 index 2fe7ec89d25..00000000000 --- a/addons/purchase/test/ui/print_report.yml +++ /dev/null @@ -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) diff --git a/addons/purchase/views/report_purchaseorder.xml b/addons/purchase/views/report_purchaseorder.xml new file mode 100644 index 00000000000..4cad5285245 --- /dev/null +++ b/addons/purchase/views/report_purchaseorder.xml @@ -0,0 +1,127 @@ + + + + + + diff --git a/addons/purchase/views/report_purchasequotation.xml b/addons/purchase/views/report_purchasequotation.xml new file mode 100644 index 00000000000..7a3ad9c9b3e --- /dev/null +++ b/addons/purchase/views/report_purchasequotation.xml @@ -0,0 +1,70 @@ + + + + + + + \ No newline at end of file