diff --git a/addons/mrp_repair/__init__.py b/addons/mrp_repair/__init__.py index 9727c3d05e9..388c5d2b72a 100644 --- a/addons/mrp_repair/__init__.py +++ b/addons/mrp_repair/__init__.py @@ -21,7 +21,5 @@ import mrp_repair import wizard -import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/mrp_repair/__openerp__.py b/addons/mrp_repair/__openerp__.py index a274cbc3ef4..c929ee2f43e 100644 --- a/addons/mrp_repair/__openerp__.py +++ b/addons/mrp_repair/__openerp__.py @@ -50,6 +50,8 @@ The following topics should be covered by this module: 'mrp_repair_view.xml', 'mrp_repair_workflow.xml', 'mrp_repair_report.xml', + + 'views/report_mrprepairorder.xml', ], 'demo': ['mrp_repair_demo.yml'], 'test': ['test/mrp_repair_users.yml', @@ -57,7 +59,6 @@ The following topics should be covered by this module: 'test/test_mrp_repair_b4inv.yml', 'test/test_mrp_repair_afterinv.yml', 'test/test_mrp_repair_cancel.yml', - 'test/mrp_repair_report.yml' ], 'installable': True, 'auto_install': False, diff --git a/addons/mrp_repair/mrp_repair_report.xml b/addons/mrp_repair/mrp_repair_report.xml index a28067609cd..3fd607ead90 100644 --- a/addons/mrp_repair/mrp_repair_report.xml +++ b/addons/mrp_repair/mrp_repair_report.xml @@ -1,12 +1,13 @@ - + diff --git a/addons/mrp_repair/report/__init__.py b/addons/mrp_repair/report/__init__.py deleted file mode 100644 index d7659b7fc65..00000000000 --- a/addons/mrp_repair/report/__init__.py +++ /dev/null @@ -1,25 +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 order - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/mrp_repair/report/order.py b/addons/mrp_repair/report/order.py deleted file mode 100644 index 818a55f0070..00000000000 --- a/addons/mrp_repair/report/order.py +++ /dev/null @@ -1,45 +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, - 'total': self.total, - }) - - def total(self, repair): - total = 0.0 - for operation in repair.operations: - total += operation.price_subtotal - for fee in repair.fees_lines: - total += fee.price_subtotal - total = total + repair.amount_tax - return total - -report_sxw.report_sxw('report.repair.order','mrp.repair','addons/mrp_repair/report/order.rml',parser=order) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml deleted file mode 100644 index 202ed6e4684..00000000000 --- a/addons/mrp_repair/report/order.rml +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Description - - - Tax - - - Quantity - - - Unit Price - - - Price - - - - - [[ repeatIn(objects,'o') ]] - - - - Shipping address : - [[ o.partner_id.name ]] - [[ o.address_id and display_address(o.address_id) ]] - - - - Invoice address : - [[ o.partner_id and o.partner_id.property_payment_term.name ]] - [[ o.partner_invoice_id and display_address(o.partner_invoice_id) ]] - - - - - - - - [[ o.partner_id.name or removeParentNode('para') ]] - [[ o.default_address_id and display_address(o.default_address_id) ]] - - - - - - - - - - - - - - - - - - - - - - [[ o.state<>'draft' and removeParentNode('para') ]]Repair Quotation N° : [[ o.name ]] - [[ o.state=='draft' and removeParentNode('para') ]]Repair Order N° : [[ o.name ]] - - - - - - - - - - Product to Repair - - - Lot Number - - - Guarantee Limit - - - Printing Date - - - - - - - [[ o.product_id.name or '' ]] - - - [[ o.prodlot_id.name or ' ' ]] - - - [[ formatLang(o.guarantee_limit,date = True) ]] - - - [[ formatLang(time.strftime('%Y-%m-%d'),date = True)]] - - - - - - - - - - - - - Description - - - Tax - - - Quantity - - - Unit Price - - - Price - - - - Operation Line(s) -
- [[ repeatIn(o.operations,'line') ]] - [[ (not line) and removeParentNode('section') ]] - [[ (line.to_invoice==True) or removeParentNode('blockTable') ]] - - - (Add) [[ ((line.type == 'add') or removeParentNode('para')) and '' ]] [[ line.name ]] - (Remove) [[ ((line.type == 'remove') or removeParentNode('para')) and '' ]] [[ line.name ]] - - - [[ ','.join(map( lambda x: x.name, line.tax_id)) ]] - - - [[ formatLang(line.product_uom_qty) ]] [[ line.product_uom.name ]] - - - - [[ formatLang(line.price_unit) ]] - - - [[ formatLang(line.price_subtotal, currency_obj = o.pricelist_id.currency_id) ]] - - - -
- Fees Line(s) [[ (o.fees_lines ==[] and removeParentNode('para') ) ]] -
- [[ repeatIn(o.fees_lines,'fees') ]] - [[ (not fees) and removeParentNode('section') ]] - - [[ (fees.to_invoice==True) or removeParentNode('blockTable') ]] - - - [[ fees.name ]] - - - [[ ','.join(map( lambda x: x.name, fees.tax_id)) ]] - - - [[ formatLang(fees.product_uom_qty) ]] [[ fees.product_uom.name ]] - - - [[ formatLang(fees.price_unit) ]] - - - [[ formatLang(fees.price_subtotal, currency_obj = o.pricelist_id.currency_id) ]] - - - -
- - - - - - - - - Net Total : - - - [[ formatLang(o.amount_untaxed, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]] - - - - - - - - - - - Taxes: - - - [[ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) ]] - - - - - - - - - - Total : - - - [[ formatLang(total(o), dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]] - - - - - - - - - - - - - [[ format(o.quotation_notes or '') or removeParentNode('blockTable') ]] - - - - - - -
-
-
diff --git a/addons/mrp_repair/test/mrp_repair_report.yml b/addons/mrp_repair/test/mrp_repair_report.yml deleted file mode 100644 index 166ace684d3..00000000000 --- a/addons/mrp_repair/test/mrp_repair_report.yml +++ /dev/null @@ -1,10 +0,0 @@ -- - In order to test the PDF reports defined on a MRP Repair, we will print an Order Report -- - !python {model: mrp.repair}: | - import os - import openerp.report - from openerp import tools - data, format = openerp.report.render_report(cr, uid, [ref('mrp_repair.mrp_repair_rmrp0')], 'repair.order', {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'mrp_repair-order_report.'+format), 'wb+').write(data) diff --git a/addons/mrp_repair/views/report_mrprepairorder.xml b/addons/mrp_repair/views/report_mrprepairorder.xml new file mode 100644 index 00000000000..6ff7e7a5e92 --- /dev/null +++ b/addons/mrp_repair/views/report_mrprepairorder.xml @@ -0,0 +1,155 @@ + + + + + +