Update the branch with stable addons

bzr revid: vinusoft85@gmail.com-20090529124633-lbfjvdikyqt7abuv
This commit is contained in:
vra (Tiny)
2009-05-29 18:16:33 +05:30
15 changed files with 575 additions and 220 deletions
@@ -161,7 +161,7 @@
<para style="terp_default_Centre_8">[[ o.sale_id and o.sale_id.name ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.sale_id and o.sale_id.date_order ]]</para>
<para style="terp_default_Centre_8">[[ o.sale_id and formatLang(o.sale_id.date_order,date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(o.min_date,date_time = True) ]]</para>
+2
View File
@@ -25,6 +25,8 @@ import product_stock
import lot_location
import ups
import picking
import lot_overview
import lot_overview_all
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+10 -20
View File
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
@@ -26,33 +26,23 @@ from report import report_sxw
class lot_location(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(lot_location, self).__init__(cr, uid, name, context)
self.grand_total = 0.0
self.localcontext.update({
'time': time,
'process':self.process,
'qty_total':self._qty_total,
})
def process(self,location_id):
res = {}
location_obj = pooler.get_pool(self.cr.dbname).get('stock.location')
product_obj = pooler.get_pool(self.cr.dbname).get('product.product')
data = location_obj._product_get_report(self.cr,self.uid, [location_id])
data['location_name'] = location_obj.read(self.cr, self.uid, [location_id],['name'])[0]['name']
self.grand_total += data['total']
return [data]
res['location_name'] = pooler.get_pool(self.cr.dbname).get('stock.location').read(self.cr, self.uid, [location_id],['name'])[0]['name']
prod_info = location_obj._product_get(self.cr, self.uid, location_id)
res['product'] = []
for prod in product_obj.browse(self.cr, self.uid, prod_info.keys()):
if prod_info[prod.id]:
res['product'].append({'prod_name': prod.name, 'prod_qty': prod_info[prod.id]})
if not res['product']:
res['product'].append({'prod_name': '', 'prod_qty': ''})
location_child = location_obj.read(self.cr, self.uid, [location_id], ['child_ids'])
list=[]
list.append(res)
for child_id in location_child[0]['child_ids']:
list.extend(self.process(child_id))
return list
def _qty_total(self):
return str( self.grand_total)
report_sxw.report_sxw('report.lot.location', 'stock.location', 'addons/stock/report/lot_location.rml', parser=lot_location)
+117 -2
View File
@@ -1,3 +1,118 @@
<?xml version="1.0"?>
<document filename="test.pdf"><template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20"><pageTemplate id="first"><frame id="first" x1="34.0" y1="28.0" width="527" height="786"/></pageTemplate></template><stylesheet><blockTableStyle id="Standard_Outline"><blockAlignment value="LEFT"/><blockValign value="TOP"/></blockTableStyle><blockTableStyle id="Table1"><blockAlignment value="LEFT"/><blockValign value="TOP"/><lineStyle kind="GRID" colorName="black"/><blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/><blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/><blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/></blockTableStyle><blockTableStyle id="Table4"><blockAlignment value="LEFT"/><blockValign value="TOP"/></blockTableStyle><initialize><paraStyle name="all" alignment="justify"/></initialize><paraStyle name="P1" fontName="Times-Roman" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P2" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P3" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P4" fontName="Times-BoldItalic" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P5" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P6" fontName="Times-Roman" fontSize="6.0" leading="8"/><paraStyle name="P7" fontName="Times-Roman" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P8" fontName="Times-BoldItalic" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P9" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P10" fontName="Times-Bold" fontSize="14.0" leading="17" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P11" fontName="Times-BoldItalic" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P12" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="P13" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="Standard" fontName="Times-Roman"/><paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/><paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/><paraStyle name="Index" fontName="Times-Roman"/></stylesheet><images/><story><para style="P1"><font color="white"> </font></para><section><blockTable colWidths="201.0,235.0,91.0" repeatRows="1" style="Table1"><tr><td><para style="Table Contents">Location</para></td><td><para style="Table Contents">Product</para></td><td><para style="Table Contents">Quantity</para></td></tr></blockTable><para style="P7">[[ repeatIn(objects,'o') ]]</para><section><para style="P4">[[ repeatIn(process(o.id),'ob') ]]</para><para style="P10">[[ ob ['location_name'] ]]</para><blockTable colWidths="202.0,234.0,92.0" repeatRows="1" style="Table4"><tr><td><para style="P2"><font color="white"> </font></para></td><td><para style="P2">[[ repeatIn(ob['product'], 'p') ]]</para><para style="P2">[[ p['prod_name'] ]]</para></td><td><para style="P5">[[ p['prod_qty'] ]]</para></td></tr></blockTable><para style="P6"><font color="white"> </font></para></section></section></story></document>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#d4d4d4" start="1,1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="3,0"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="3,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8"/>
<paraStyle name="P2" fontName="Times-Roman"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P41" fontName="Helvetica-BoldOblique" fontSize="0.0" leading="0" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P4" fontName="Helvetica-BoldOblique" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P8" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P9" fontName="Helvetica-BoldOblique" fontSize="2.0" leading="3" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10a" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
</stylesheet>
<images/>
<story>
<section>
<blockTable colWidths="201.0,235.0,91.0" repeatRows="1" style="Table1">
<tr>
<td><para style="P6">Location</para></td>
<td><para style="P6">Product</para></td>
<td><para style="P7">Quantity</para></td>
</tr>
</blockTable>
<para style="P41"><font color="white">[[ repeatIn(objects,'o') ]]</font></para>
<section>
<para style="P41"><font color="white">[[ repeatIn(process(o.id),'ob') ]]</font></para>
<blockTable colWidths="202.0,234.0,65.0,25" repeatRows="1" style="Table4">
<tr>
<td><para style="P5">[[ ob['location_name'] ]]</para></td>
<td><para style="Standard">[[ ob['product'] or 'No products in this Location !' ]]</para></td>
<td><para><font color="white"> </font></para></td>
<td><para><font color="white"> </font></para></td>
</tr>
<tr>
<td><para style="P3">[[ repeatIn(ob['product'], 'p') ]] </para></td>
<td><para style="P3">[[ p['prod_name'] ]]</para></td>
<td><para style="P12">[[ p['prod_qty'] ]]</para></td>
<td><para style="P12">[[ p['uom'] ]]</para></td>
</tr>
</blockTable>
<blockTable colWidths="200.0,235.0,60.0,25" style="Table2">
<tr>
<td><para style="P10"></para></td>
<td><para style="P10a">Total : </para></td>
<td><para style="P10">[[ ob['total'] ]]</para></td>
<td><para style="P10">Units</para></td>
</tr>
<tr>
<td><para style="P10"></para></td>
<td><para style="P10"></para></td>
<td><para style="P10"></para></td>
<td><para style="P10"></para></td>
</tr>
<tr>
<td><para style="P10"></para></td>
<td><para style="P10"></para></td>
<td><para style="P10"></para></td>
<td><para style="P10"></para></td>
</tr>
</blockTable>
</section>
</section>
<blockTable colWidths="200.0,235.0,60.0,25" style="Table3">
<tr>
<td><para style="P10a">Grand Total:</para></td>
<td><para style="P10"></para></td>
<td><para style="P10">[[ qty_total() ]]</para></td>
<td><para style="P10">Units</para></td>
</tr>
</blockTable>
</story>
</document>
+57
View File
@@ -0,0 +1,57 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import pooler
import time
from report import report_sxw
class lot_overview(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(lot_overview, self).__init__(cr, uid, name, context)
self.price_total = 0.0
self.grand_total = 0.0
self.localcontext.update({
'time': time,
'process':self.process,
'price_total': self._price_total,
'grand_total_price':self._grand_total,
})
def process(self,location_id):
location_obj = pooler.get_pool(self.cr.dbname).get('stock.location')
data = location_obj._product_get_report(self.cr,self.uid, [location_id])
data['location_name'] = location_obj.read(self.cr, self.uid, [location_id],['name'])[0]['name']
self.price_total = 0.0
self.price_total += data['total_price']
self.grand_total += data['total_price']
return [data]
def _price_total(self):
return str( self.price_total)
def _grand_total(self):
return str( self.grand_total)
report_sxw.report_sxw('report.lot.stock.overview', 'stock.location', 'addons/stock/report/lot_overview.rml', parser=lot_overview)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+135
View File
@@ -0,0 +1,135 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#d4d4d4" start="1,1" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica"/>
<paraStyle name="P4" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P41" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="P6" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="P7" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8"/>
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P8a" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P9" fontName="Helvetica-BoldOblique" fontSize="2.0" leading="3" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10a" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10b" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P10c" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
</stylesheet>
<images/>
<story>
<section>
<blockTable colWidths="60.0,190.0,61.0,55.0,59.0,56.0,61.0" repeatRows="1" style="Table1">
<tr>
<td><para style="P1">Location</para></td>
<td><para style="P1">Product</para></td>
<td><para style="P1">Variants</para></td>
<td><para style="P10a">Quantity</para></td>
<td><para style="P10a">UoM</para></td>
<td><para style="P10c">Unit Price</para></td>
<td><para style="P10a">Value</para></td>
</tr>
</blockTable>
<para style="P9">[[ repeatIn(objects,'o') ]]</para>
<section>
<para style="P12">[[ repeatIn(process(o.id),'ob') ]]</para>
<blockTable colWidths="60.0,200.0,56.0,55.0,52.0,56.0,68.0" repeatRows="1" style="Table2">
<tr>
<td><para style="P41">[[ ob['location_name'] ]]</para></td>
<td><para style="Standard">[[ ob['product'] or 'No products in this Location !' ]]</para></td>
<td><para><font color="white"></font></para></td>
<td><para><font color="white"></font></para></td>
<td><para><font color="white"></font></para></td>
<td><para><font color="white"></font></para></td>
<td><para><font color="white"></font></para></td>
</tr>
<tr>
<td><para style="P7">[[ repeatIn(ob['product'],'p') ]]</para></td>
<td><para style="P12">[[ p['prod_name'] ]]</para></td>
<td><para style="P4">[[ p['variants'] ]]</para></td>
<td><para style="P10b">[[ p['prod_qty'] ]]</para></td>
<td><para style="P10b">[[ p['uom'] ]]</para></td>
<td><para style="P10b">[[ p['price'] ]]</para></td>
<td><para style="P10b">[[ p['price_value'] ]]</para></td>
</tr>
</blockTable>
<blockTable colWidths="60.0,200.0,56.0,55.0,52.0,56.0,68.0" style="Table4">
<tr>
<td><para style="P8"></para></td>
<td><para style="P8">Total:</para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
<td><para style="P8a"><u>[[ price_total() ]]</u></para></td>
</tr>
</blockTable>
<para style="P11"><font color="white"> </font></para>
<para style="P11"><font color="white"> </font></para>
<para style="P11"><font color="white"> </font></para>
<para style="P11"><font color="white"> </font></para>
</section>
</section>
<blockTable colWidths="180,60,61.0,55.0,59.0,56.0,68.0" style="Table3">
<tr>
<td><para style="P8">Grand Total:</para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
<td><para style="P8"></para></td>
<td><para style="P8a"><u>[[ grand_total_price() ]]</u></para></td>
</tr>
</blockTable>
</story>
</document>
-13
View File
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<lotlist>
<lot type="fields" name="id">
<id type="field" name="id"/>
<product type="call" name="_product_get_report" args="">
<amount value="amount"/>
<variants value="variants"/>
<name value="name"/>
<uom value="uom"/>
<price value="price"/>
</product>
</lot>
</lotlist>
-71
View File
@@ -1,71 +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="../../base/report/corporate_defaults.xsl"/>
<xsl:import href="../../base/report/rml_template.xsl"/>
<xsl:template name="first_page_frames">
<frame id="main" x1="1cm" y1="2.5cm" width="19.0cm" height="23cm"/>
</xsl:template>
<xsl:template match="/">
<xsl:call-template name="rml"/>
</xsl:template>
<!-- stylesheet -->
<xsl:template name="stylesheet">
<blockTableStyle id="products">
<blockFont name="Helvetica-Bold" size="10" start="0,0" stop="-1,0"/>
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
<blockTextColor colorName="white" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="CENTER" start="0,0" stop="-1,0"/>
<blockAlignment value="RIGHT" start="1,1" stop="-1,-1"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
</xsl:template>
<xsl:template name="story">
<xsl:apply-templates select="lotlist"/>
</xsl:template>
<xsl:template name="lotlist">
<nextFrame/>
<setNextTemplate name="other_pages"/>
<xsl:apply-templates select="lot"/>
</xsl:template>
<xsl:template match="lot">
<spacer length="1cm"/>
<blockTable colWidths="8cm,2.5cm,2cm,2cm,2cm,2.5cm" style="products" repeatRows="1">
<tr>
<td t="1">Product</td><td t="1">Variants</td><td t="1">Amount</td><td t="1">UoM</td><td t="1">Unit Price</td><td t="1">Value</td>
</tr>
<xsl:apply-templates select="product"/>
</blockTable>
<setNextTemplate name="other_pages"/>
<pageBreak/>
<!--
<setNextTemplate name="first_page"/>
<nextFrame/>
-->
</xsl:template>
<xsl:template match="product">
<tr>
<td><para><xsl:value-of select="name"/></para></td>
<td><para><xsl:value-of select="variants"/></para></td>
<td><xsl:value-of select="amount"/></td>
<td><xsl:value-of select="uom"/></td>
<td><xsl:value-of select="price"/></td>
<td><xsl:value-of select="amount * price"/></td>
<!-- <td><xsl:value-of select="//product_amount[id=$product_id]/amount"/></td>
<td><xsl:value-of select="//product_amount[id=$product_id]/amount * price"/></td> -->
</tr>
</xsl:template>
</xsl:stylesheet>
+57
View File
@@ -0,0 +1,57 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import pooler
import time
from report import report_sxw
class lot_overview_all(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(lot_overview_all, self).__init__(cr, uid, name, context)
self.price_total = 0.0
self.grand_total = 0.0
self.localcontext.update({
'time': time,
'process':self.process,
'price_total': self._price_total,
'grand_total_price':self._grand_total,
})
def process(self,location_id):
location_obj = pooler.get_pool(self.cr.dbname).get('stock.location')
data = location_obj._product_get_all_report(self.cr,self.uid, [location_id])
data['location_name'] = location_obj.read(self.cr, self.uid, [location_id],['name'])[0]['name']
self.price_total = 0.0
self.price_total += data['total_price']
self.grand_total += data['total_price']
return [data]
def _price_total(self):
return str( self.price_total)
def _grand_total(self):
return str( self.grand_total)
report_sxw.report_sxw('report.lot.stock.overview_all', 'stock.location', 'addons/stock/report/lot_overview_all.rml', parser=lot_overview_all)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+156
View File
@@ -0,0 +1,156 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#d4d4d4" start="1,0" stop="-1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="7,0" stop="7,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="-1,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Helvetica-BoldOblique" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P6" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P5a" fontName="Helvetica-Bold" fontSize="10.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P9" fontName="Helvetica"/>
<paraStyle name="P10" fontName="Helvetica-BoldOblique" fontSize="6.0" leading="8"/>
<paraStyle name="P101" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P102" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P11" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P13" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
</stylesheet>
<images/>
<story>
<para style="P1">
<font color="white"> </font>
</para>
<section>
<blockTable colWidths="80,35.0,140.0,50.0,50.0,42.0,56.0,58.0" repeatRows="1" style="Table1">
<tr>
<td><para style="P2">Location</para></td>
<td><para style="P2">Code</para></td>
<td><para style="P2">Product</para></td>
<td><para style="P2">Variants</para></td>
<td><para style="P3">Amount</para></td>
<td><para style="P4">UoM</para></td>
<td><para style="P3">UnitPrice</para></td>
<td><para style="P3">Value</para></td>
</tr>
</blockTable>
<para>[[repeatIn(objects,'o')]]</para>
<section>
<para style="P12">[[ repeatIn(process(o.id),'ob') ]]</para>
<blockTable colWidths="80,35.0,140.0,50.0,50.0,42.0,56.0,58.0" repeatRows="1" style="Table4">
<tr>
<td><para style="P102">[[ ob['location_name'] ]]</para></td>
<td><para style="Standard"><font color="white"></font></para></td>
<td><para style="Standard">[[ ob['product'] or 'No products in this Location' ]]</para></td>
<td><para style="Standard"><font color="white"></font></para></td>
<td><para style="Standard"><font color="white"></font></para></td>
<td><para style="Standard"><font color="white"></font></para></td>
<td><para style="Standard"><font color="white"></font></para></td>
<td><para style="Standard"><font color="white"></font></para></td>
</tr>
<tr>
<td><para style="P7">[[ repeatIn(ob['product'],'p') ]]</para></td>
<td><para style="P7">[[ p['code'] ]]</para></td>
<td><para style="P7">[[ p['prod_name'] ]]</para></td>
<td><para style="P11">[[ p['variants'] ]]</para></td>
<td><para style="P12">[[ p['prod_qty'] ]]</para></td>
<td><para style="P13">[[ p['uom'] ]]</para></td>
<td><para style="P12">[[ p['price'] ]]</para></td>
<td><para style="P12">[[ p['price_value'] ]]</para></td>
</tr>
</blockTable>
<para style="P10">
<font color="white"> </font>
</para>
<blockTable colWidths="80,35.0,140.0,50.0,50.0,42.0,56.0,58.0" style="Table2">
<tr>
<td><para style="P5"></para></td>
<td><para style="P5">Total:</para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5a"><u>[[ price_total() ]]</u></para></td>
</tr>
</blockTable>
<para style="P1"><font color="white"> </font></para>
<para style="P1"><font color="white"> </font></para>
</section>
</section>
<blockTable colWidths="80,35.0,140.0,50.0,50.0,42.0,56.0,58.0" style="Table3">
<tr>
<td><para style="P5">Grand Total:</para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5"></para></td>
<td><para style="P5a"><u>[[ grand_total_price() ]]</u></para></td>
</tr>
</blockTable>
</story>
</document>
-14
View File
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<lotlist>
<lot type="fields" name="id">
<id type="field" name="id"/>
<product type="call" name="_product_get_all_report" args="">
<amount value="amount"/>
<variants value="variants"/>
<name value="name"/>
<code value="code"/>
<uom value="uom"/>
<price value="price"/>
</product>
</lot>
</lotlist>
-70
View File
@@ -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:import href="../../base/report/corporate_defaults.xsl"/>
<xsl:import href="../../base/report/rml_template.xsl"/>
<xsl:template name="first_page_frames">
<frame id="main" x1="1cm" y1="2.5cm" width="19.0cm" height="23cm"/>
</xsl:template>
<xsl:template match="/">
<xsl:call-template name="rml"/>
</xsl:template>
<!-- stylesheet -->
<xsl:template name="stylesheet">
<blockTableStyle id="products">
<blockFont name="Helvetica-Bold" size="10" start="0,0" stop="-1,0"/>
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
<blockTextColor colorName="white" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="CENTER" start="0,0" stop="-1,0"/>
<blockAlignment value="RIGHT" start="1,1" stop="-1,-1"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
</xsl:template>
<xsl:template name="story">
<xsl:apply-templates select="lotlist"/>
</xsl:template>
<xsl:template name="lotlist">
<nextFrame/>
<setNextTemplate name="other_pages"/>
<xsl:apply-templates select="lot"/>
</xsl:template>
<xsl:template match="lot">
<spacer length="1cm"/>
<blockTable colWidths="2cm,6cm,2.5cm,2cm,2cm,2cm,2.5cm" style="products" repeatRows="1">
<tr>
<td t="1">Code</td><td t="1">Product</td><td t="1">Variants</td><td t="1">Amount</td><td t="1">UoM</td><td t="1">Unit Price</td><td t="1">Value</td>
</tr>
<xsl:apply-templates select="product"/>
</blockTable>
<!--
<setNextTemplate name="first_page"/>
<nextFrame/>
-->
</xsl:template>
<xsl:template match="product">
<tr>
<td><para><xsl:value-of select="code"/></para></td>
<td><para><xsl:value-of select="name"/></para></td>
<td><para><xsl:value-of select="variants"/></para></td>
<td><xsl:value-of select="amount"/></td>
<td><xsl:value-of select="uom"/></td>
<td><xsl:value-of select="price"/></td>
<td><xsl:value-of select="amount * price"/></td>
<!-- <td><xsl:value-of select="//product_amount[id=$product_id]/amount"/></td>
<td><xsl:value-of select="//product_amount[id=$product_id]/amount * price"/></td> -->
</tr>
</xsl:template>
</xsl:stylesheet>
+22 -20
View File
@@ -134,10 +134,10 @@
</para>
</td>
<td>
<para style="terp_default_9">[[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title) or '' ]] [[ picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.name ]]</para>
<para style="terp_default_9">[[ (picking.address_id and picking.address_id.title) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]] </para>
<para style="terp_default_9">[[ (picking.address_id and picking.address_id.street) or '' ]] </para>
<para style="terp_default_9">[[ (picking.address_id and picking.address_id.zip) or '' ]] [[ (picking.address_id and picking.address_id.city) or '' ]] [[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or '' ]] </para>
<para style="terp_default_9">[[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title) or '' ]][[ picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.name ]]</para>
<para style="terp_default_9">[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]][[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]]</para>
<para style="terp_default_9">[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.street) or '' ]]</para>
<para style="terp_default_9">[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.zip) or '' ]][[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.city) or '' ]][[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or '' ]]</para>
<para style="terp_default_9">[[ (picking.address_id and picking.address_id.country_id and picking.address_id.country_id.name) or '' ]]</para>
</td>
</tr>
@@ -176,7 +176,7 @@
<para style="terp_tblheader_General_Centre">Expected Shipping Date </para>
</td>
<td>
<para style="terp_tblheader_General_Centre"></para>
<para style="terp_tblheader_General_Centre">weight</para>
</td>
</tr>
</blockTable>
@@ -186,20 +186,20 @@
<para style="terp_default_Centre_8">[[ picking.origin ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ (picking.address_id and picking.address_id.title) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]] </para>
<para style="terp_default_Centre_8">[[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]][[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(picking.min_date,date_time = True) ]]</para>
<para style="terp_default_Centre_8">[[ formatLang(picking.min_date,date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8"></para>
<para style="terp_default_Centre_8">[[ formatLang(picking.weight) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<blockTable colWidths="276.0,51.0,56.0,80.0,55.0" repeatRows="1" style="Move_Line_Header">
<blockTable colWidths="255.0,65.0,70.0,83.0,75.0" repeatRows="1" style="Move_Line_Header">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
@@ -218,28 +218,30 @@
</td>
</tr>
</blockTable>
<para style="terp_default_2"/>
<para style="terp_default_2">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state == 'assigned' )],'move_lines') ]]</para>
<blockTable colWidths="277.0,51.0,56.0,58.0,22.0,56.0" style="Move_Line_Contect_Assign_State">
<blockTable colWidths="255.0,65.0,70.0,50.0,30.0,75.0" style="Move_Line_Contect_Assign_State">
<tr>
<td>
<para style="terp_default_9">[ [[ move_lines.product_id.default_code ]] ] [[ move_lines.product_id.name ]]</para>
</td>
<td>
<para style="terp_default_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para>
<para style="terp_default_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_lines.state ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_lines.product_qty ]] </para>
<para style="terp_default_Right_9">[[ formatLang(move_lines.product_qty) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_lines.product_uom.name ]]</para>
</td>
<td>
<para style="terp_default_9">[[ (move_lines.location_id and move_lines.location_id.name) or '' ]]</para>
<para style="terp_default_9">[[ (((picking.type == 'out') and move_lines.location_id.name) or ((picking.type == 'in') and move_lines.location_dest_id.name) or ((picking.type == 'internal') and (move_lines.location_id.name + '-' + move_lines.location_dest_id.name)) or '' ) ]]</para>
</td>
</tr>
</blockTable>
@@ -250,31 +252,31 @@
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ (line.state == 'assigned') and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">Non Assigned Products: [[ ((line.state == 'assigned') or (line.state == 'done')) and removeParentNode('para') ]]</para>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
<section>
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
<blockTable colWidths="277.0,51.0,56.0,58.0,22.0,55.0" style="Move_Line_Content_Other_State">
<para style="terp_default_8">[[ repeatIn([line for line in picking.move_lines if (line.state != 'assigned' )],'move_lines') ]]</para>
<blockTable colWidths="255.0,65.0,70.0,50.0,30.0,75.0" style="Move_Line_Content_Other_State">
<tr>
<td>
<para style="terp_default_9">[ [[ move_lines.product_id.default_code ]] ] [[ move_lines.product_id.name ]]</para>
</td>
<td>
<para style="terp_default_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para>
<para style="terp_default_9">[[ (move_lines.prodlot_id and move_lines.prodlot_id.name) or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_lines.state ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_lines.product_qty ]] </para>
<para style="terp_default_Right_9">[[ formatLang(move_lines.product_qty) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_lines.product_uom.name ]]</para>
</td>
<td>
<para style="terp_default_9">[[ (move_lines.location_id and move_lines.location_id.name) or '' ]]</para>
<para style="terp_default_9">[[ (((picking.type == 'out') and move_lines.location_id.name) or ((picking.type == 'in') and move_lines.location_dest_id.name) or ((picking.type == 'internal') and (move_lines.location_id.name + '-' + move_lines.location_dest_id.name)) or '' ) ]]</para>
</td>
</tr>
</blockTable>
+16 -7
View File
@@ -205,8 +205,11 @@ class stock_location(osv.osv):
products_by_id.setdefault(product.id, [])
products_by_id[product.id] = product
result = []
result = {}
result['product'] = []
for id in ids:
quantity_total = 0.0
total_price = 0.0
for uom_id in products_by_uom.keys():
fnc = self._product_get
if recursive:
@@ -219,14 +222,20 @@ class stock_location(osv.osv):
if not qty[product_id]:
continue
product = products_by_id[product_id]
result.append({
quantity_total += qty[product_id]
price = qty[product_id] * product.standard_price
total_price += price
result['product'].append({
'price': product.standard_price,
'name': product.name,
'prod_name': product.name,
'code': product.default_code, # used by lot_overview_all report!
'variants': product.variants or '',
'uom': product.uom_id.name,
'amount': qty[product_id],
'prod_qty': qty[product_id],
'price_value':price,
})
result['total'] = quantity_total
result['total_price'] = total_price
return result
def _product_get_multi_location(self, cr, uid, ids, product_ids=False, context={}, states=['done'], what=('in', 'out')):
@@ -791,7 +800,7 @@ class stock_production_lot(osv.osv):
''')
res.update(dict(cr.fetchall()))
return res
def _stock_search(self, cr, uid, obj, name, args):
locations = self.pool.get('stock.location').search(cr, uid, [('usage','=','internal')])
cr.execute('''select
@@ -803,12 +812,12 @@ class stock_production_lot(osv.osv):
location_id in ('''+','.join(map(str, locations)) +''')
group by
prodlot_id
having sum(name) ''' + str(args[0][1]) + ''' ''' + str(args[0][2])
having sum(name) ''' + str(args[0][1]) + ''' ''' + str(args[0][2])
)
res = cr.fetchall()
ids = [('id','in',map(lambda x:x[0], res))]
return ids
_columns = {
'name': fields.char('Serial', size=64, required=True),
'ref': fields.char('Internal Ref', size=64),
+2 -2
View File
@@ -9,11 +9,11 @@
<report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Packing list" rml="stock/report/picking.rml"/>
<report id="report_move_labels" model="stock.move" name="stock.move.label" string="Print Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
<report id="report_location_overview" model="stock.location" name="stock.location.overview" string="Location Overview" xml="stock/report/lot_overview.xml" xsl="stock/report/lot_overview.xsl"/>
<report auto="False" id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Overview" rml="stock/report/lot_overview.rml"/>
<report auto="False" id="report_lot_location" model="stock.location" name="lot.location" rml="stock/report/lot_location.rml" string="Lots by location"/>
<report id="report_location_overview_all" model="stock.location" name="stock.location.overview.all" string="Location Content (With children)" xml="stock/report/lot_overview_all.xml" xsl="stock/report/lot_overview_all.xsl"/>
<report id="report_location_overview_all" model="stock.location" name="lot.stock.overview_all" string="Location Content (With children)" rml="stock/report/lot_overview_all.rml"/>
</data>
</openerp>