diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index d4f6dc0c2f7..3d82445489a 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -59,7 +59,6 @@ Dashboard / Reports for MRP will include: 'mrp_data.xml', 'wizard/mrp_product_produce_view.xml', 'wizard/change_production_qty_view.xml', - 'wizard/mrp_price_view.xml', 'wizard/stock_move_view.xml', 'mrp_view.xml', 'mrp_report.xml', diff --git a/addons/mrp/mrp_report.xml b/addons/mrp/mrp_report.xml index 29c848acbe4..903749cf1a3 100644 --- a/addons/mrp/mrp_report.xml +++ b/addons/mrp/mrp_report.xml @@ -19,12 +19,5 @@ report_type="qweb-pdf" /> - diff --git a/addons/mrp/report/__init__.py b/addons/mrp/report/__init__.py index 78dc4832f9f..3add2534ba5 100644 --- a/addons/mrp/report/__init__.py +++ b/addons/mrp/report/__init__.py @@ -19,6 +19,5 @@ # ############################################################################## -import price import bom_structure import mrp_report diff --git a/addons/mrp/report/custom_default.xsl b/addons/mrp/report/custom_default.xsl deleted file mode 100644 index 6982a95ecea..00000000000 --- a/addons/mrp/report/custom_default.xsl +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Odoo Report - 1cm - 1cm - 1cm - 1cm - 21cm,29.7cm - - a4_letter - - - - - - - - - - - 1.3cm 28.1cm 20cm 28.1cm - - - - - - - - - - - - - - 1.3cm 28.1cm 20cm 28.1cm - - - - - - - - - - - - - - - - - - diff --git a/addons/mrp/report/custom_rml.xsl b/addons/mrp/report/custom_rml.xsl deleted file mode 100644 index 6b648bc13e3..00000000000 --- a/addons/mrp/report/custom_rml.xsl +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py deleted file mode 100644 index 87387280c95..00000000000 --- a/addons/mrp/report/price.py +++ /dev/null @@ -1,224 +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 - -import openerp -from openerp.report.interface import report_rml -from openerp.tools import to_xml -from openerp.report import report_sxw -from datetime import datetime -from openerp.tools.translate import _ - -class report_custom(report_rml): - def create_xml(self, cr, uid, ids, datas, context=None): - number = (datas.get('form', False) and datas['form']['number']) or 1 - registry = openerp.registry(cr.dbname) - product_pool = registry.get('product.product') - product_uom_pool = registry.get('product.uom') - workcenter_pool = registry.get('mrp.workcenter') - user_pool = registry.get('res.users') - bom_pool = registry.get('mrp.bom') - pricelist_pool = registry.get('product.pricelist') - rml_obj=report_sxw.rml_parse(cr, uid, product_pool._name,context) - rml_obj.localcontext.update({'lang':context.get('lang',False)}) - company_currency = user_pool.browse(cr, uid, uid).company_id.currency_id - company_currency_symbol = company_currency.symbol or company_currency.name - def process_bom(bom, currency_id, factor=1): - xml = '' - sum = 0 - sum_strd = 0 - prod = product_pool.browse(cr, uid, bom['product_id']) - - prod_name = to_xml(bom['name']) - prod_qtty = factor * bom['product_qty'] - product_uom = product_uom_pool.browse(cr, uid, bom['product_uom'], context=context) - product_uom_name = to_xml(product_uom.name) - main_sp_price, main_sp_name , main_strd_price = '','','' - sellers, sellers_price = '','' - - if prod.seller_id: - main_sp_name = '- '+ to_xml(prod.seller_id.name) +'\r\n' - pricelist = prod.seller_id.property_product_pricelist_purchase - price = pricelist_pool.price_get(cr,uid,[pricelist.id], - prod.id, number*prod_qtty or 1.0, prod.seller_id.id, { - 'uom': prod.uom_po_id.id, - 'date': time.strftime('%Y-%m-%d'), - })[pricelist.id] - main_sp_price = """"""+rml_obj.formatLang(price)+' '+ (company_currency_symbol)+"""\r\n""" - sum += prod_qtty*price - std_price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, prod.standard_price, to_uom_id=product_uom.id) - main_strd_price = str(std_price) + '\r\n' - sum_strd = prod_qtty*std_price - for seller_id in prod.seller_ids: - if seller_id.name.id == prod.seller_id.id: - continue - sellers += '- '+ to_xml(seller_id.name.name) +'\r\n' - pricelist = seller_id.name.property_product_pricelist_purchase - price = pricelist_pool.price_get(cr,uid,[pricelist.id], - prod.id, number*prod_qtty or 1.0, seller_id.name.id, { - 'uom': prod.uom_po_id.id, - 'date': time.strftime('%Y-%m-%d'), - })[pricelist.id] - sellers_price += """"""+rml_obj.formatLang(price) +' '+ (company_currency_symbol) +"""\r\n""" - xml += """ """+ prod_name +""" - """+ main_sp_name + sellers + """ - """+ rml_obj.formatLang(prod_qtty) +' '+ product_uom_name +""" - """+ rml_obj.formatLang(float(main_strd_price)) +' '+ (company_currency_symbol) +""" - """ + main_sp_price + sellers_price + """'""" - - xml += '' - return xml, sum, sum_strd - - def process_workcenter(wrk): - workcenter = workcenter_pool.browse(cr, uid, wrk['workcenter_id']) - cost_cycle = wrk['cycle']*workcenter.costs_cycle - cost_hour = wrk['hour']*workcenter.costs_hour - total = cost_cycle + cost_hour - xml = '' - xml += "" + to_xml(workcenter.name) + '' - xml += "" - xml += """"""+rml_obj.formatLang(cost_cycle)+' '+ (company_currency_symbol) + """""" - xml += """"""+rml_obj.formatLang(cost_hour)+' '+ (company_currency_symbol) + """""" - xml += """"""+rml_obj.formatLang(cost_hour + cost_cycle)+' '+ (company_currency_symbol) + """""" - xml += '' - - return xml, total - - - xml = '' - config_start = """ - - """ + to_xml(rml_obj.formatLang(datetime.now().strftime('%Y-%m-%d %H:%M:%S'),date_time=True)) + """ - %s - 210.00mm,297.00mm - 595.27 - 841.88 - 55.00mm,58.00mm,29.00mm,29.00mm,29.00mm - """ % to_xml(user_pool.browse(cr, uid, uid).company_id.name) - config_stop = """ - Generated by Odoo - - """ - - workcenter_header = """ - - - %s - - %s - %s - %s - - - """ % (_('Work Center name'), _('Cycles Cost'), _('Hourly Cost'),_('Work Cost')) - prod_header = """ - - %s - %s - %s - %s - %s - - """ % (_('Components'), _('Components suppliers'), _('Quantity'),_('Cost Price per Unit of Measure'), _('Supplier Price per Unit of Measure')) - - purchase_price_digits = rml_obj.get_digits(dp='Product Price') - - for product in product_pool.browse(cr, uid, ids, context=context): - product_uom_name = to_xml(product.uom_id.name) - bom_id = bom_pool._bom_find(cr, uid, product_id=product.id, context=context) - title = "%s" %(_("Cost Structure")) - title += "%s" % (to_xml(product.name)) - xml += "" + title + prod_header + "" - if not bom_id: - total_strd = number * product.standard_price - total = number * product_pool.price_get(cr, uid, [product.id], 'standard_price')[product.id] - xml += """ - - - - - - - - - - - """ - xml += """ - """ + _('Total Cost of %s %s') % (str(number), product_uom_name) + """: - - - """+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ (company_currency_symbol) + """ - """+ rml_obj.formatLang(total, digits=purchase_price_digits) +' '+ (company_currency_symbol) + """ - '""" - else: - bom = bom_pool.browse(cr, uid, bom_id, context=context) - factor = number * product.uom_id.factor / bom.product_uom.factor - sub_boms = bom_pool._bom_explode(cr, uid, bom, product, factor / bom.product_qty, context=context) - total = 0 - total_strd = 0 - parent_bom = { - 'product_qty': bom.product_qty, - 'name': bom.product_id.name, - 'product_uom': bom.product_uom.id, - 'product_id': bom.product_id.id - } - xml_tmp = '' - for sub_bom in (sub_boms and sub_boms[0]) or [parent_bom]: - txt, sum, sum_strd = process_bom(sub_bom, company_currency.id) - xml_tmp += txt - total += sum - total_strd += sum_strd - - xml += "" + xml_tmp + '' - xml += """ - """ + _('Components Cost of %s %s') % (str(number), product_uom_name) + """: - - - """+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ (company_currency_symbol) + """ - - '""" - - total2 = 0 - xml_tmp = '' - for wrk in (sub_boms and sub_boms[1]): - txt, sum = process_workcenter(wrk) - xml_tmp += txt - total2 += sum - if xml_tmp: - xml += workcenter_header - xml += "" + xml_tmp + '' - xml += """ - """ + _('Work Cost of %s %s') % (str(number), product_uom_name) +""": - - - - """+ rml_obj.formatLang(total2, digits=purchase_price_digits) +' '+ (company_currency_symbol) +""" - '""" - xml += """ - """ + _('Total Cost of %s %s') % (str(number), product_uom_name) + """: - - - """+ rml_obj.formatLang(total_strd+total2, digits=purchase_price_digits) +' '+ (company_currency_symbol) + """ - - '""" - - xml = '' + config_start + config_stop + xml + '' - - return xml - -report_custom('report.product.price', 'product.product', '', 'addons/mrp/report/price.xsl') diff --git a/addons/mrp/report/price.xsl b/addons/mrp/report/price.xsl deleted file mode 100644 index 5d00cb5045b..00000000000 --- a/addons/mrp/report/price.xsl +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - a4_normal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/addons/mrp/wizard/__init__.py b/addons/mrp/wizard/__init__.py index ef1726fd9ae..bf960861994 100644 --- a/addons/mrp/wizard/__init__.py +++ b/addons/mrp/wizard/__init__.py @@ -20,6 +20,5 @@ ############################################################################## import mrp_product_produce -import mrp_price import change_production_qty import stock_move diff --git a/addons/mrp/wizard/mrp_price.py b/addons/mrp/wizard/mrp_price.py deleted file mode 100644 index f3e8b2cd267..00000000000 --- a/addons/mrp/wizard/mrp_price.py +++ /dev/null @@ -1,53 +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 . -# -############################################################################## - -from openerp.osv import fields, osv - -class mrp_price(osv.osv_memory): - _name = 'mrp.product_price' - _description = 'Product Price' - _columns = { - 'number': fields.integer('Quantity', required=True, help="Specify quantity of products to produce or buy. Report of Cost structure will be displayed base on this quantity."), - } - _defaults = { - 'number': 1, - } - - def print_report(self, cr, uid, ids, context=None): - """ To print the report of Product cost structure - @param self: The object pointer. - @param cr: A database cursor - @param uid: ID of the user currently logged in - @param context: A standard dictionary - @return : Report - """ - if context is None: - context = {} - datas = {'ids' : context.get('active_ids',[])} - res = self.read(cr, uid, ids, ['number']) - res = res and res[0] or {} - datas['form'] = res - - return { - 'type' : 'ir.actions.report.xml', - 'report_name':'product.price', - 'datas' : datas, - } diff --git a/addons/mrp/wizard/mrp_price_view.xml b/addons/mrp/wizard/mrp_price_view.xml deleted file mode 100644 index a326fc6dbc0..00000000000 --- a/addons/mrp/wizard/mrp_price_view.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - Product Cost Structure - mrp.product_price - -
- - - -
-
-
-
-
- - -
-
diff --git a/openerp/addons/base/__openerp__.py b/openerp/addons/base/__openerp__.py index 3d31a7fecba..1a1cda5f73a 100644 --- a/openerp/addons/base/__openerp__.py +++ b/openerp/addons/base/__openerp__.py @@ -75,7 +75,6 @@ The kernel of OpenERP, needed for all installation. 'res/res_company_view.xml', 'res/res_request_view.xml', 'res/res_lang_view.xml', - 'res/res_partner_report.xml', 'res/res_partner_view.xml', 'res/res_bank_view.xml', 'res/res_country_view.xml', diff --git a/openerp/addons/base/report/custom.xsl b/openerp/addons/base/report/custom.xsl deleted file mode 100644 index 1e5fd740c0f..00000000000 --- a/openerp/addons/base/report/custom.xsl +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUM - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - AVG - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (SUM) - - - - - - - - - - - - - - - - - - - - - (#) - - - - - - - - - - - - - - - - - - - - - (AVG) - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
-
- -
diff --git a/openerp/addons/base/report/custom_default.xsl b/openerp/addons/base/report/custom_default.xsl deleted file mode 100644 index 2074bd2f7fb..00000000000 --- a/openerp/addons/base/report/custom_default.xsl +++ /dev/null @@ -1,38 +0,0 @@ - - - - - OpenERP Report - 1cm - 1cm - 1cm - 1cm - - - - - a4_letter - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/openerp/addons/base/report/custom_rml.xsl b/openerp/addons/base/report/custom_rml.xsl deleted file mode 100644 index 535fe789c23..00000000000 --- a/openerp/addons/base/report/custom_rml.xsl +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/openerp/addons/base/report/rml_template.xsl b/openerp/addons/base/report/rml_template.xsl deleted file mode 100644 index 2725dce5b76..00000000000 --- a/openerp/addons/base/report/rml_template.xsl +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/openerp/addons/base/res/res_partner_report.xml b/openerp/addons/base/res/res_partner_report.xml deleted file mode 100644 index 00b8a84608e..00000000000 --- a/openerp/addons/base/res/res_partner_report.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/openerp/addons/base/res/res_partner_report_address.xml b/openerp/addons/base/res/res_partner_report_address.xml deleted file mode 100644 index 1449eb5bc0c..00000000000 --- a/openerp/addons/base/res/res_partner_report_address.xml +++ /dev/null @@ -1,14 +0,0 @@ - - -
- - - - - - - - - -
-
diff --git a/openerp/addons/base/res/res_partner_report_address.xsl b/openerp/addons/base/res/res_partner_report_address.xsl deleted file mode 100644 index 83fb709e356..00000000000 --- a/openerp/addons/base/res/res_partner_report_address.xsl +++ /dev/null @@ -1,74 +0,0 @@ - - - 24.5 - 0.5 - 3.5 - 7 - 3.7cm - 7cm - 3 - 24 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cm - - - - cm - - - - - - - - - - - - - - - - - - - - -