[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>
|
||||
@@ -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',
|
||||
|
||||
@@ -1,247 +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 match="/">
|
||||
<xsl:apply-templates select="report"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="report">
|
||||
<document filename="example_5.pdf">
|
||||
<template leftMargin="1.5cm" rightMargin="1.5cm" topMargin="1.5cm" bottomMargin="1.5cm"
|
||||
title="Reporting" author="Generated by OpenERP, Fabien Pinckaers">
|
||||
<xsl:attribute name="pageSize">
|
||||
<xsl:value-of select="/report/config/pageSize"/>
|
||||
</xsl:attribute>
|
||||
<pageTemplate id="first">
|
||||
<pageGraphics>
|
||||
<drawCentredString>
|
||||
<xsl:attribute name="x">
|
||||
<xsl:value-of select="/report/config/pageWidth div 2"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="y">
|
||||
<xsl:value-of select="/report/config/pageHeight - 56.69"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="config/report-header"/>
|
||||
</drawCentredString>
|
||||
|
||||
<fill color="(0.2,0.2,0.2)"/>
|
||||
<setFont name="Helvetica" size="10"/>
|
||||
<drawCentredString y="10mm">
|
||||
<xsl:attribute name="x">
|
||||
<xsl:value-of select="/report/config/pageWidth div 2"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="config/report-footer"/>
|
||||
</drawCentredString>
|
||||
|
||||
<fill color="(0.969,0.2,0.2)"/>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
<drawString x="1.5cm">
|
||||
<xsl:attribute name="y">
|
||||
<xsl:value-of select="/report/config/pageHeight - 56.69"/>
|
||||
</xsl:attribute><xsl:text>OpenERP</xsl:text>
|
||||
</drawString>
|
||||
|
||||
<fill color="(0.2,0.2,0.2)"/>
|
||||
<drawRightString>
|
||||
<xsl:attribute name="x">
|
||||
<xsl:value-of select="/report/config/pageWidth - 45"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="y">
|
||||
<xsl:value-of select="/report/config/pageHeight - 56.69"/>
|
||||
</xsl:attribute><xsl:value-of select="/report/config/date"/>
|
||||
</drawRightString>
|
||||
</pageGraphics>
|
||||
<frame id="column" x1="1.5cm" y1="1.5cm">
|
||||
<xsl:attribute name="width">
|
||||
<xsl:value-of select="/report/config/pageWidth - 85"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="height">
|
||||
<xsl:value-of select="/report/config/pageHeight - 100"/>
|
||||
</xsl:attribute>
|
||||
</frame>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<paraStyle name="sum" fontName="Helvetica" textColor="green"/>
|
||||
<paraStyle name="sum_float" fontName="Helvetica" alignment="right" textColor="green"/>
|
||||
<paraStyle name="sum_end" fontName="Helvetica" textColor="red"/>
|
||||
<paraStyle name="sum_float_end" fontName="Helvetica" alignment="right" textColor="red"/>
|
||||
<blockTableStyle id="table">
|
||||
<blockValign value="TOP"/>
|
||||
<blockFont name="Helvetica" size="12" start="0,0" stop="-1,0"/>
|
||||
<blockBackground colorName="(0.8,0.8,0.8)" start="0,0" stop="-1,0"/>
|
||||
|
||||
<lineStyle kind="GRID" colorName="lightgrey" thickness="0.3"/>
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="black" thickness="1.5" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="black" thickness="1.5" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<blockTable style="table">
|
||||
<xsl:attribute name="colWidths">
|
||||
<xsl:value-of select="/report/config/tableSize"/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates select="header"/>
|
||||
<xsl:apply-templates select="group"/>
|
||||
|
||||
<xsl:if test="group//@sum">
|
||||
<tr>
|
||||
<xsl:for-each select="group[position()=1]/record[position()=1]/field">
|
||||
<xsl:choose>
|
||||
<xsl:when test="position()=1">
|
||||
<td><para style="sum_end">SUM</para></td>
|
||||
</xsl:when>
|
||||
<xsl:when test="@sum">
|
||||
<xsl:variable name="ici">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<td><para style="sum_float_end"><xsl:value-of select="sum(../../../group/record/field[@id=$ici])"/></para></td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
<xsl:if test="group//@count">
|
||||
<tr>
|
||||
<xsl:for-each select="group[position()=1]/record[position()=1]/field">
|
||||
<xsl:choose>
|
||||
<xsl:when test="position()=1">
|
||||
<td><para style="sum_end">#</para></td>
|
||||
</xsl:when>
|
||||
<xsl:when test="@count">
|
||||
<xsl:variable name="ici">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<td><para style="sum_float_end"><xsl:value-of select="count(../../../group/record/field[@id=$ici])"/></para></td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
<xsl:if test="group//@avg">
|
||||
<tr>
|
||||
<xsl:for-each select="group[position()=1]/record[position()=1]/field">
|
||||
<xsl:choose>
|
||||
<xsl:when test="position()=1">
|
||||
<td><para style="sum_end">AVG</para></td>
|
||||
</xsl:when>
|
||||
<xsl:when test="@avg">
|
||||
<xsl:variable name="ici">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<td><para style="sum_float_end"><xsl:value-of select="sum(../../../group/record/field[@id=$ici]) div count(../../../group/record/field[@id=$ici])"/></para></td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="header">
|
||||
<tr>
|
||||
<xsl:apply-templates select="field"/>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="group">
|
||||
<xsl:if test="not(/report/config/totalonly)">
|
||||
<xsl:apply-templates select="record"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="/report/config/groupby">
|
||||
<!-- SUM -->
|
||||
<xsl:if test="//@sum">
|
||||
<tr>
|
||||
<xsl:for-each select="record[position()=1]/field">
|
||||
<xsl:choose>
|
||||
<xsl:when test="/report/config/groupby = @id">
|
||||
<td><para style="sum"><xsl:value-of select="."/> (SUM)</para></td>
|
||||
</xsl:when>
|
||||
<xsl:when test="@sum">
|
||||
<xsl:variable name="ici">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<td><para style="sum_float"><xsl:value-of select="sum(../../record/field[@id=$ici])"/></para></td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
<!-- COUNT -->
|
||||
<xsl:if test="//@count">
|
||||
<tr>
|
||||
<xsl:for-each select="record[position()=1]/field">
|
||||
<xsl:choose>
|
||||
<xsl:when test="/report/config/groupby = @id">
|
||||
<td><para style="sum"><xsl:value-of select="."/> (#)</para></td>
|
||||
</xsl:when>
|
||||
<xsl:when test="@count">
|
||||
<xsl:variable name="ici">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<td><para style="sum_float"><xsl:value-of select="count(../../record/field[@id=$ici])"/></para></td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
<!-- AVG -->
|
||||
<xsl:if test="//@avg">
|
||||
<tr>
|
||||
<xsl:for-each select="record[position()=1]/field">
|
||||
<xsl:choose>
|
||||
<xsl:when test="/report/config/groupby = @id">
|
||||
<td><para style="sum"><xsl:value-of select="."/> (AVG)</para></td>
|
||||
</xsl:when>
|
||||
<xsl:when test="@avg">
|
||||
<xsl:variable name="ici">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<td><para style="sum_float"><xsl:value-of select="sum(../../record/field[@id=$ici]) div count(../../record/field[@id=$ici])"/></para></td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="record">
|
||||
<tr>
|
||||
<xsl:apply-templates select="field"/>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="field">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@level">
|
||||
<td><pre><xsl:value-of select="@level"/><xsl:value-of select="."/></pre></td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td><para><xsl:value-of select="."/></para></td>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -1,38 +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/signature"/>
|
||||
<xsl:variable name="title">OpenERP 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>
|
||||
<!--:variable name="pageSize">29.7cm,21cm</xsl:variable> Or use default width and height for frame -->
|
||||
<xsl:variable name="pageSize">
|
||||
<xsl:value-of select="/report/config/PageSize"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="page_format">a4_letter</xsl:variable>
|
||||
|
||||
<xsl:template name="first_page_frames">
|
||||
<frame id="column" x1="1.5cm" y1="1.5cm">
|
||||
<xsl:attribute name="width">
|
||||
<xsl:value-of select="/report/config/PageWidth - 85"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="height">
|
||||
<xsl:value-of select="/report/config/PageHeight - 100"/>
|
||||
</xsl:attribute>
|
||||
</frame>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="other_pages_frames">
|
||||
<frame id="column" x1="1.5cm" y1="1.5cm">
|
||||
<xsl:attribute name="width">
|
||||
<xsl:value-of select="/report/config/PageWidth - 85"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="height">
|
||||
<xsl:value-of select="/report/config/PageHeight - 100"/>
|
||||
</xsl:attribute>
|
||||
</frame>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -1,62 +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 OpenERP, 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_report"/>
|
||||
</pageGraphics>
|
||||
|
||||
<xsl:call-template name="first_page_frames"/>
|
||||
</pageTemplate>
|
||||
|
||||
<pageTemplate id="other_pages">
|
||||
<pageGraphics>
|
||||
<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,70 +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="first_page_graphics_corporation"/>
|
||||
<xsl:template name="other_pages_graphics_corporation"/>
|
||||
|
||||
<xsl:template name="first_page_frames"/>
|
||||
<xsl:template name="other_pages_frames"/>
|
||||
-->
|
||||
<xsl:template name="rml">
|
||||
<document>
|
||||
<template author="Generated by OpenERP, 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,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<report
|
||||
id="res_partner_address_report"
|
||||
model="res.partner"
|
||||
name="res.partner"
|
||||
string="Labels"
|
||||
xml="base/res/res_partner_report_address.xml"
|
||||
xsl="base/res/res_partner_report_address.xsl"
|
||||
groups="base.group_no_one"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<addresses>
|
||||
<address type="fields" name="id">
|
||||
<company-title type="field" name="title.name"/>
|
||||
<company-name type="field" name="name"/>
|
||||
<type type="field" name="type"/>
|
||||
<street type="field" name="street"/>
|
||||
<street2 type="field" name="street2"/>
|
||||
<zip type="field" name="zip"/>
|
||||
<city type="field" name="city"/>
|
||||
<state type="field" name="state_id.name"/>
|
||||
<country type="field" name="country_id.name"/>
|
||||
</address>
|
||||
</addresses>
|
||||
@@ -1,74 +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="initial_bottom_pos">24.5</xsl:variable>
|
||||
<xsl:variable name="initial_left_pos">0.5</xsl:variable>
|
||||
<xsl:variable name="height_increment">3.5</xsl:variable>
|
||||
<xsl:variable name="width_increment">7</xsl:variable>
|
||||
<xsl:variable name="frame_height">3.7cm</xsl:variable>
|
||||
<xsl:variable name="frame_width">7cm</xsl:variable>
|
||||
<xsl:variable name="number_columns">3</xsl:variable>
|
||||
<xsl:variable name="max_frames">24</xsl:variable>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="addresses"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="addresses">
|
||||
<document>
|
||||
<template leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm"
|
||||
bottomMargin="2.0cm" title="Address list" author="Generated by OpenERP">
|
||||
<pageTemplate id="all">
|
||||
<pageGraphics/>
|
||||
<xsl:apply-templates select="address" mode="frames"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<paraStyle name="nospace" fontName="Courier" fontSize="12" spaceBefore="0" spaceAfter="0"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<xsl:apply-templates select="address" mode="story">
|
||||
<xsl:sort select="contact/country"/>
|
||||
<xsl:sort select="contact/zip"/>
|
||||
<xsl:sort select="company-name"/>
|
||||
</xsl:apply-templates>
|
||||
</story>
|
||||
</document>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="address" mode="frames">
|
||||
<xsl:if test="position() < $max_frames + 1">
|
||||
<frame>
|
||||
<xsl:attribute name="width">
|
||||
<xsl:value-of select="$frame_width"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="height">
|
||||
<xsl:value-of select="$frame_height"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="x1">
|
||||
<xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/>
|
||||
<xsl:text>cm</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="y1">
|
||||
<xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/>
|
||||
<xsl:text>cm</xsl:text>
|
||||
</xsl:attribute>
|
||||
</frame>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="address" mode="story">
|
||||
<para style="nospace"><xsl:value-of select="company-name"/><xsl:text> </xsl:text><xsl:value-of select="company-title"/></para>
|
||||
<para style="nospace"><xsl:value-of select="street"/></para>
|
||||
<para style="nospace"><xsl:value-of select="street2"/></para>
|
||||
<para style="nospace"><xsl:value-of select="zip"/><xsl:text> </xsl:text><xsl:value-of select="city"/></para>
|
||||
<para style="nospace"><xsl:value-of select="state"/></para>
|
||||
<para style="nospace"><xsl:value-of select="country"/></para>
|
||||
<xsl:if test="position() < last()">
|
||||
<nextFrame/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="contact">
|
||||
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
Reference in New Issue
Block a user