[REM] base,mrp: remove deprecated XSL reports
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -19,12 +19,5 @@
|
||||
report_type="qweb-pdf"
|
||||
/>
|
||||
|
||||
<report id="report_cost_structure"
|
||||
model="product.product"
|
||||
menu="False"
|
||||
name="product.price"
|
||||
string="Cost Structure"
|
||||
xsl="mrp/report/price.xsl"
|
||||
/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -19,6 +19,5 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import price
|
||||
import bom_structure
|
||||
import mrp_report
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version = '1.0' encoding="utf-8"?>
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
<xsl:variable name="signature" select="//corporate-header/user/signature"/>
|
||||
<xsl:variable name="title">Odoo Report</xsl:variable>
|
||||
<xsl:variable name="leftMargin">1cm</xsl:variable>
|
||||
<xsl:variable name="rightMargin">1cm</xsl:variable>
|
||||
<xsl:variable name="topMargin">1cm</xsl:variable>
|
||||
<xsl:variable name="bottomMargin">1cm</xsl:variable>
|
||||
<xsl:variable name="pageSize">21cm,29.7cm</xsl:variable>
|
||||
|
||||
<xsl:variable name="page_format">a4_letter</xsl:variable>
|
||||
|
||||
<xsl:template name="first_page_graphics_corporation">
|
||||
<!--logo-->
|
||||
<fill color="black"/>
|
||||
<stroke color="black"/>
|
||||
<setFont name="DejaVuSans" size="8"/>
|
||||
<drawString x="1.3cm" y="28.3cm"><xsl:value-of select="//date"/></drawString>
|
||||
<setFont name="DejaVuSans-Bold" size="10"/>
|
||||
<drawString x="9.8cm" y="28.3cm"><xsl:value-of select="//company"/></drawString>
|
||||
<stroke color="#000000"/>
|
||||
<lines>1.3cm 28.1cm 20cm 28.1cm</lines>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="other_pages_graphics_corporation">
|
||||
<!--logo-->
|
||||
<fill color="black"/>
|
||||
<stroke color="black"/>
|
||||
<setFont name="DejaVuSans" size="8"/>
|
||||
<drawString x="1.3cm" y="28.3cm"><xsl:value-of select="//date"/></drawString>
|
||||
<setFont name="DejaVuSans-Bold" size="10"/>
|
||||
<drawString x="9.8cm" y="28.3cm"><xsl:value-of select="//company"/></drawString>
|
||||
<stroke color="#000000"/>
|
||||
<lines>1.3cm 28.1cm 20cm 28.1cm</lines>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="first_page_frames">
|
||||
<xsl:if test="$page_format='a4_normal'">
|
||||
<frame id="main" x1="1cm" y1="2.5cm" width="19.0cm" height="25.0cm"/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$page_format='a4_letter'">
|
||||
<frame id="address" x1="11cm" y1="21.5cm" width="6cm" height="4cm"/>
|
||||
<frame id="main" x1="1cm" y1="2.5cm" width="19.0cm" height="17.5cm"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="other_pages_frames">
|
||||
<frame id="main" x1="1cm" y1="2.5cm" width="19.0cm" height="25.0cm"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -1,64 +0,0 @@
|
||||
<?xml version = '1.0' encoding="utf-8"?>
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<xsl:template name="first_page_graphics_report"/>
|
||||
<xsl:template name="other_pages_graphics_report"/>
|
||||
|
||||
<xsl:template name="rml">
|
||||
<document>
|
||||
<template author="Generated by Odoo, Fabien Pinckaers">
|
||||
<xsl:attribute name="pageSize">
|
||||
<xsl:value-of select="$pageSize"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="leftMargin">
|
||||
<xsl:value-of select="$leftMargin"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="rightMargin">
|
||||
<xsl:value-of select="$rightMargin"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="topMargin">
|
||||
<xsl:value-of select="$topMargin"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="bottomMargin">
|
||||
<xsl:value-of select="$bottomMargin"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:attribute name="title">
|
||||
<xsl:value-of select="$title"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<pageTemplate id="first_page">
|
||||
<pageGraphics>
|
||||
<xsl:call-template name="first_page_graphics_corporation"/>
|
||||
<xsl:call-template name="first_page_graphics_report"/>
|
||||
</pageGraphics>
|
||||
|
||||
<xsl:call-template name="first_page_frames"/>
|
||||
</pageTemplate>
|
||||
|
||||
<pageTemplate id="other_pages">
|
||||
<pageGraphics>
|
||||
<xsl:call-template name="other_pages_graphics_corporation"/>
|
||||
<xsl:call-template name="other_pages_graphics_report"/>
|
||||
</pageGraphics>
|
||||
|
||||
<xsl:call-template name="other_pages_frames"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
|
||||
<stylesheet>
|
||||
<xsl:call-template name="stylesheet"/>
|
||||
</stylesheet>
|
||||
|
||||
<story>
|
||||
<xsl:call-template name="story"/>
|
||||
</story>
|
||||
|
||||
</document>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -1,224 +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
|
||||
|
||||
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 = '<row>'
|
||||
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 = '- <b>'+ to_xml(prod.seller_id.name) +'</b>\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 = """<b>"""+rml_obj.formatLang(price)+' '+ (company_currency_symbol)+"""</b>\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 += '- <i>'+ to_xml(seller_id.name.name) +'</i>\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 += """<i>"""+rml_obj.formatLang(price) +' '+ (company_currency_symbol) +"""</i>\r\n"""
|
||||
xml += """<col para='yes'> """+ prod_name +""" </col>
|
||||
<col para='yes'> """+ main_sp_name + sellers + """ </col>
|
||||
<col f='yes'>"""+ rml_obj.formatLang(prod_qtty) +' '+ product_uom_name +"""</col>
|
||||
<col f='yes'>"""+ rml_obj.formatLang(float(main_strd_price)) +' '+ (company_currency_symbol) +"""</col>
|
||||
<col f='yes'>""" + main_sp_price + sellers_price + """</col>'"""
|
||||
|
||||
xml += '</row>'
|
||||
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 = '<row>'
|
||||
xml += "<col para='yes'>" + to_xml(workcenter.name) + '</col>'
|
||||
xml += "<col/>"
|
||||
xml += """<col f='yes'>"""+rml_obj.formatLang(cost_cycle)+' '+ (company_currency_symbol) + """</col>"""
|
||||
xml += """<col f='yes'>"""+rml_obj.formatLang(cost_hour)+' '+ (company_currency_symbol) + """</col>"""
|
||||
xml += """<col f='yes'>"""+rml_obj.formatLang(cost_hour + cost_cycle)+' '+ (company_currency_symbol) + """</col>"""
|
||||
xml += '</row>'
|
||||
|
||||
return xml, total
|
||||
|
||||
|
||||
xml = ''
|
||||
config_start = """
|
||||
<config>
|
||||
<date>""" + to_xml(rml_obj.formatLang(datetime.now().strftime('%Y-%m-%d %H:%M:%S'),date_time=True)) + """</date>
|
||||
<company>%s</company>
|
||||
<PageSize>210.00mm,297.00mm</PageSize>
|
||||
<PageWidth>595.27</PageWidth>
|
||||
<PageHeight>841.88</PageHeight>
|
||||
<tableSize>55.00mm,58.00mm,29.00mm,29.00mm,29.00mm</tableSize>
|
||||
""" % to_xml(user_pool.browse(cr, uid, uid).company_id.name)
|
||||
config_stop = """
|
||||
<report-footer>Generated by Odoo</report-footer>
|
||||
</config>
|
||||
"""
|
||||
|
||||
workcenter_header = """
|
||||
<lines style='header'>
|
||||
<row>
|
||||
<col>%s</col>
|
||||
<col t='yes'/>
|
||||
<col t='yes'>%s</col>
|
||||
<col t='yes'>%s</col>
|
||||
<col t='yes'>%s</col>
|
||||
</row>
|
||||
</lines>
|
||||
""" % (_('Work Center name'), _('Cycles Cost'), _('Hourly Cost'),_('Work Cost'))
|
||||
prod_header = """
|
||||
<row>
|
||||
<col>%s</col>
|
||||
<col>%s</col>
|
||||
<col t='yes'>%s</col>
|
||||
<col t='yes'>%s</col>
|
||||
<col t='yes'>%s</col>
|
||||
</row>
|
||||
""" % (_('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 = "<title>%s</title>" %(_("Cost Structure"))
|
||||
title += "<title>%s</title>" % (to_xml(product.name))
|
||||
xml += "<lines style='header'>" + title + prod_header + "</lines>"
|
||||
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 += """<lines style='lines'><row>
|
||||
<col para='yes'>-</col>
|
||||
<col para='yes'>-</col>
|
||||
<col para='yes'>-</col>
|
||||
<col para='yes'>-</col>
|
||||
<col para='yes'>-</col>
|
||||
</row></lines>"""
|
||||
xml += """<lines style='total'> <row>
|
||||
<col> """ + _('Total Cost of %s %s') % (str(number), product_uom_name) + """: </col>
|
||||
<col/>
|
||||
<col f='yes'/>
|
||||
<col t='yes'>"""+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ (company_currency_symbol) + """</col>
|
||||
<col t='yes'>"""+ rml_obj.formatLang(total, digits=purchase_price_digits) +' '+ (company_currency_symbol) + """</col>
|
||||
</row></lines>'"""
|
||||
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 += "<lines style='lines'>" + xml_tmp + '</lines>'
|
||||
xml += """<lines style='sub_total'> <row>
|
||||
<col> """ + _('Components Cost of %s %s') % (str(number), product_uom_name) + """: </col>
|
||||
<col/>
|
||||
<col t='yes'/>
|
||||
<col t='yes'>"""+ rml_obj.formatLang(total_strd, digits=purchase_price_digits) +' '+ (company_currency_symbol) + """</col>
|
||||
<col t='yes'></col>
|
||||
</row></lines>'"""
|
||||
|
||||
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 += "<lines style='lines'>" + xml_tmp + '</lines>'
|
||||
xml += """<lines style='sub_total'> <row>
|
||||
<col> """ + _('Work Cost of %s %s') % (str(number), product_uom_name) +""": </col>
|
||||
<col/>
|
||||
<col/>
|
||||
<col/>
|
||||
<col t='yes'>"""+ rml_obj.formatLang(total2, digits=purchase_price_digits) +' '+ (company_currency_symbol) +"""</col>
|
||||
</row></lines>'"""
|
||||
xml += """<lines style='total'> <row>
|
||||
<col> """ + _('Total Cost of %s %s') % (str(number), product_uom_name) + """: </col>
|
||||
<col/>
|
||||
<col t='yes'/>
|
||||
<col t='yes'>"""+ rml_obj.formatLang(total_strd+total2, digits=purchase_price_digits) +' '+ (company_currency_symbol) + """</col>
|
||||
<col t='yes'></col>
|
||||
</row></lines>'"""
|
||||
|
||||
xml = '<?xml version="1.0" ?><report>' + config_start + config_stop + xml + '</report>'
|
||||
|
||||
return xml
|
||||
|
||||
report_custom('report.product.price', 'product.product', '', 'addons/mrp/report/price.xsl')
|
||||
@@ -1,148 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
||||
|
||||
<xsl:import href="custom_default.xsl"/>
|
||||
<xsl:import href="custom_rml.xsl"/>
|
||||
<xsl:variable name="page_format">a4_normal</xsl:variable>
|
||||
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:call-template name="rml"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- stylesheet -->
|
||||
|
||||
<xsl:template name="stylesheet">
|
||||
<paraStyle name="title" fontName="Helvetica-Bold" fontSize="15.0" alignment="center"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right_bold" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
|
||||
|
||||
<blockTableStyle id="header">
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="lines">
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="total">
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="sub_total">
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="story">
|
||||
<xsl:apply-templates select="report"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="report">
|
||||
<xsl:apply-templates select="config"/>
|
||||
<xsl:apply-templates select="title"/>
|
||||
<xsl:apply-templates select="lines"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="config">
|
||||
<para style="title">
|
||||
<xsl:value-of select="report-header"/>
|
||||
</para>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="title">
|
||||
<para style="title">
|
||||
<xsl:value-of select="."/>
|
||||
</para>
|
||||
<spacer length="1cm" width="2mm"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="header">
|
||||
<tr>
|
||||
<xsl:for-each select="field">
|
||||
<td>
|
||||
<para style="terp_tblheader_General">
|
||||
<xsl:value-of select="."/>
|
||||
</para>
|
||||
</td>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="lines">
|
||||
|
||||
<xsl:apply-templates select="title"/>
|
||||
<blockTable>
|
||||
<xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute>
|
||||
<xsl:attribute name="colWidths">
|
||||
<xsl:value-of select="../config/tableSize"/>
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:apply-templates select="row"/>
|
||||
|
||||
</blockTable>
|
||||
|
||||
<xsl:if test="@style!='header'">
|
||||
<spacer length="2mm" width="2mm"/>
|
||||
|
||||
</xsl:if>
|
||||
<xsl:if test="@style='total'">
|
||||
<xsl:if test="position() < last()">
|
||||
<pageBreak/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="row">
|
||||
<tr>
|
||||
<xsl:apply-templates select="col"/>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="col">
|
||||
<td>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@para='yes'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@tree='yes'">
|
||||
<para style="terp_default_8">
|
||||
<xsl:attribute name="leftIndent"><xsl:value-of select="@space"/></xsl:attribute>
|
||||
<xsl:value-of select="."/>
|
||||
</para>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<para style="terp_default_8">
|
||||
<xsl:value-of select="."/>
|
||||
</para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="@f='yes'">
|
||||
<para style="terp_tblheader_Details_Right">
|
||||
<xsl:value-of select="."/>
|
||||
</para>
|
||||
</xsl:when>
|
||||
<xsl:when test="@t='yes'">
|
||||
<para style="terp_tblheader_Details_Right_bold">
|
||||
<xsl:value-of select="."/>
|
||||
</para>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<para style="terp_tblheader_General">
|
||||
<xsl:value-of select="."/>
|
||||
</para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</td>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -20,6 +20,5 @@
|
||||
##############################################################################
|
||||
|
||||
import mrp_product_produce
|
||||
import mrp_price
|
||||
import change_production_qty
|
||||
import stock_move
|
||||
|
||||
@@ -1,53 +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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
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,
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Product Cost Structure Report -->
|
||||
|
||||
<record id="view_mrp_product_price_wizard" model="ir.ui.view">
|
||||
<field name="name">Product Cost Structure</field>
|
||||
<field name="model">mrp.product_price</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Product Cost Structure">
|
||||
<group string="Print Cost Structure of Product.">
|
||||
<field name="number"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="print_report" type="object" string="Print" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window name="Product Cost Structure"
|
||||
res_model="mrp.product_price"
|
||||
src_model="product.product"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_print_multi"
|
||||
id="action_view_mrp_product_price_wizard"/>
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user