[MERGE] stock reports in Qweb

bzr revid: qdp-launchpad@openerp.com-20140327174228-6beohyphca58nb00
This commit is contained in:
Quentin (OpenERP) 2014-03-27 18:42:28 +01:00
commit 522f87f03f
44 changed files with 333 additions and 2316 deletions

View File

@ -21,7 +21,6 @@
import delivery
import partner
import report
import sale
import stock

View File

@ -35,10 +35,10 @@ invoices from picking, OpenERP is able to add and compute the shipping line.
'depends': ['sale_stock'],
'data': [
'security/ir.model.access.csv',
'delivery_report.xml',
'delivery_view.xml',
'partner_view.xml',
'delivery_data.xml'
'delivery_data.xml',
'views/report_shipping.xml',
],
'demo': ['delivery_demo.xml'],
'test': ['test/delivery_cost.yml'],

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="report_shipping"
model="stock.picking"
name="sale.shipping"
multi="True"
rml="delivery/report/shipping.rml"
string="Delivery order"/>
</data>
</openerp>

View File

@ -225,10 +225,6 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="/form/header//button[@name='action_cancel']" position="after">
<button name="%(report_shipping)d" string="Print Delivery Order" states="confirmed,assigned" type="action"/>
<button name="%(report_shipping)d" string="Print Delivery Order" states="done" type="action" class="oe_highlight"/>
</xpath>
<xpath expr="//page[@string='Additional Info']/group[last()]" position="after">
<separator string="Carrier Informations"/>
<group>

View File

@ -1,24 +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 shipping
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,46 +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
from openerp.report import report_sxw
class shipping(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(shipping, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_partner_invoice_info': self.get_partner_invoice_info,
})
def get_partner_invoice_info(self, origin):
"""This method is used to get information of invoiced partner.
:param: origin: origin of picking
:return: tuple contaning partner name and address of invoiced partner
"""
sale_obj = self.pool.get('sale.order')
sale_id = sale_obj.search(self.cr, self.uid, [('name', '=', origin)])[0]
partner_invoice_id = sale_obj.browse(self.cr, self.uid, sale_id).partner_invoice_id
return partner_invoice_id.name, self.pool.get('res.partner')._display_address(self.cr, self.uid, partner_invoice_id)
report_sxw.report_sxw('report.sale.shipping','stock.picking','addons/delivery/report/shipping.rml',parser=shipping)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,212 +0,0 @@
<?xml version="1.0"?>
<document filename="Delivery Order.pdf">
<template title="Delivery Order" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="30.0" y1="27.0" width="508" height="815"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#666666" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#666666" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#666666" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="9.0" leading="11" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<pto>
<pto_header>
<blockTable colWidths="455.0,82.0" repeatRows="1" style="Table3">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
</tr>
</blockTable>
</pto_header>
<para style="terp_default_9">[[repeatIn(objects,'o')]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="287.0,254.0" repeatRows="1" style="Tableau1">
<tr>
<td>
<para style="terp_default_Bold_9">Invoiced to</para>
<para style="terp_default_9">[[ o.origin and get_partner_invoice_info(o.origin)[0] or '' ]]</para>
<para style="terp_default_9">[[ o.origin and get_partner_invoice_info(o.origin)[1] or '' ]]</para>
</td>
<td>
<para style="terp_default_9">[[ o.partner_id and o.partner_id.name or '' ]]</para>
<para style="terp_default_9">[[ o.partner_id and display_address(o.partner_id) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_header">Delivery Order : [[ o.name ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="126.0,103.0,103.0,103.0,103.0" style="Table1">
<tr>
<td>
<para style="terp_tblheader_General_Centre">Order Ref.</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Order Date</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Shipping Date</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Carrier</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Weight</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="126.0,103.0,103.0,103.0,103.0" style="Table2">
<tr>
<td>
<para style="terp_default_Centre_8">[[ o.origin or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(o.date,date_time=True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(o.min_date,date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ o.carrier_id and o.carrier_id.name or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(o.weight) ]]</para>
</td>
</tr>
</blockTable>
<para style="Standard">
<font color="white"> </font>
</para>
<blockTable colWidths="455.0,82.0" repeatRows="1" style="Table3">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_1">[[repeatIn(o.move_lines,'line')]]</para>
<blockTable colWidths="455.0,82.0" style="Table4">
<tr>
<td>
<para style="terp_default_9">[[line.product_id.code ]] [[ line.product_id and line.product_id.name or '']]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(line.product_qty) ]] [[ line.product_uom and line.product_uom.name ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_1">
<font color="white"> </font>
</para>
</section>
</pto>
</story>
</document>

View File

@ -46,19 +46,6 @@
wiz_id = self.create(cr, uid, {'journal_id': ref('account.sales_journal')},
{'active_ids': ship_ids, 'active_model': 'stock.picking'})
self.create_invoice(cr, uid, [wiz_id], {"active_ids": ship_ids, "active_id": ship_ids[0]})
-
I print a Delivery Order report.
-
!python {model: stock.picking}: |
import os
import openerp.report
from openerp import tools
sale = self.pool.get('sale.order')
sale_order = sale.browse(cr, uid, ref("sale_normal_delivery_charges"))
ship_ids = [x.id for x in sale_order.picking_ids]
data, format = openerp.report.render_report(cr, uid, ship_ids, 'sale.shipping', {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'delivery-shipping'+format), 'wb+').write(data)
-
Create one more sale order with Free Delivery Charges
-

View File

@ -0,0 +1,25 @@
<openerp>
<data>
<template id="report_shipping2" inherit_id="stock.report_picking">
<xpath expr="//div[@name='partner_header']" position="after">
<div name="invoice_partner" t-if="o.picking_type_id.code == 'outgoing' and o.sale_id and o.sale_id.partner_invoice_id">
Will be invoiced to:
<div t-field="o.sale_id.partner_invoice_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
</div>
</xpath>
<xpath expr="//th[@name='td_sched_date_h']" position="after">
<th t-if="o.picking_type_id.code == 'outgoing'"><strong>Carrier</strong></th>
<th><strong>Weight</strong></th>
</xpath>
<xpath expr="//td[@name='td_sched_date']" position="after">
<td t-if="o.picking_type_id.code == 'outgoing'">
<span t-field="o.carrier_id"/>
</td>
<td>
<span t-field="o.weight"/>
</td>
</xpath>
</template>
</data>
</openerp>

View File

@ -440,6 +440,21 @@ class stock_location_route(osv.osv):
class stock_picking(osv.osv):
_inherit = "stock.picking"
def _get_sale_id(self, cr, uid, ids, name, args, context=None):
sale_obj = self.pool.get("sale.order")
res = {}
for picking in self.browse(cr, uid, ids, context=context):
if picking.group_id:
res[picking.id] = False
sale_ids = sale_obj.search(cr, uid, [('procurement_group_id', '=', picking.group_id.id)], context=context)
if sale_ids:
res[picking.id] = sale_ids[0]
return res
_columns = {
'sale_id': fields.function(_get_sale_id, type="many2one", relation="sale.order", string="Sale Order"),
}
def _create_invoice_from_picking(self, cr, uid, picking, vals, context=None):
sale_obj = self.pool.get('sale.order')
sale_line_obj = self.pool.get('sale.order.line')

View File

@ -69,12 +69,11 @@ Dashboard / Reports for Warehouse Management will include:
],
'data': [
'security/stock_security.xml',
'security/ir.model.access.csv',
'security/ir.model.access.csv',
'stock_data.xml',
'stock_data.yml',
'wizard/stock_move_view.xml',
'wizard/stock_change_product_qty_view.xml',
'wizard/stock_location_product_view.xml',
'wizard/stock_return_picking_view.xml',
'wizard/make_procurement_view.xml',
'wizard/mrp_procurement_view.xml',
@ -89,6 +88,8 @@ Dashboard / Reports for Warehouse Management will include:
'board_warehouse_view.xml',
'res_config_view.xml',
'views/report_package_barcode.xml',
'views/report_stockpicking.xml',
'views/report_stockinventory.xml',
],
'test': [
'test/inventory.yml',

View File

@ -20,11 +20,7 @@
##############################################################################
import product_stock
import picking
import lot_overview_all
import report_stock
import stock_inventory_move_report
import lot_overview
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<lots>
<lot-line type="fields" name="id">
<code type="field" name="product_id.code"/>
<product type="field" name="product_id.name"/>
<variant type="field" name="product_id.variants"/>
<uom type="field" name="product_uom.name"/>
<quantity type="field" name="product_uom_qty"/>
</lot-line>
</lots>

View File

@ -1,59 +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">1</xsl:variable>
<xsl:variable name="height_increment">3.8</xsl:variable>
<xsl:variable name="width_increment">7</xsl:variable>
<xsl:variable name="frame_height">3.5cm</xsl:variable>
<xsl:variable name="frame_width">6.5cm</xsl:variable>
<xsl:variable name="number_columns">3</xsl:variable>
<xsl:variable name="max_frames">21</xsl:variable>
<xsl:template match="/">
<xsl:apply-templates select="lots"/>
</xsl:template>
<xsl:template match="lots">
<document>
<template leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Address list" author="Generated by Open ERP">
<pageTemplate id="all">
<pageGraphics/>
<xsl:apply-templates select="lot-line" mode="frames"/>
</pageTemplate>
</template>
<stylesheet>
<paraStyle name="nospace" fontName="Courier" fontSize="10" spaceBefore="0" spaceAfter="0"/>
</stylesheet>
<story>
<xsl:apply-templates select="lot-line" mode="story"/>
</story>
</document>
</xsl:template>
<xsl:template match="lot-line" mode="frames">
<xsl:if test="position() &lt; $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="lot-line" mode="story">
<para style="nospace"><xsl:value-of select="code"/><xsl:text>, </xsl:text><xsl:value-of select="quantity"/><xsl:text> </xsl:text><xsl:value-of select="uom"/></para>
<para style="nospace"><xsl:value-of select="product"/><xsl:text> </xsl:text><xsl:value-of select="variant"/></para>
<nextFrame/>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,56 +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
from openerp.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=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 = self.pool['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],['complete_name'])[0]['complete_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 self.price_total
def _grand_total(self):
return self.grand_total
report_sxw.report_sxw('report.lot.stock.overview', 'stock.location', 'addons/stock/report/lot_overview.rml', parser=lot_overview,header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,227 +0,0 @@
<?xml version="1.0"?>
<document filename="Location Inventory Overview.pdf">
<template title="Location Inventory Overview" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="33.0" y1="57.0" width="526" height="728"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table6">
<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"/>
</blockTableStyle>
<blockTableStyle id="Table7">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#999999" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#999999" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#999999" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#999999" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table8">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table10">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<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="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<pto>
<pto_header>
<blockTable colWidths="248.0,91.0,62.0,59.0,67.0" style="Table6">
<tr>
<td>
<para style="terp_tblheader_Details">Location / Product</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Variants</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Unit Price</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Value</para>
</td>
</tr>
</blockTable>
</pto_header>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_header_Centre">Location Inventory Overview</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="215.0,85.0,85.0,57.0,85.0" style="Table6">
<tr>
<td>
<para style="terp_tblheader_Details">Location / Product</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Variants</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Unit Price</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Value</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(objects,'o') ]]</para>
<section>
<para style="terp_default_2">[[ repeatIn(process(o.id),'ob') ]]</para>
<blockTable colWidths="339.0,62.0,59.0,66.0" style="Table7">
<tr>
<td>
<para style="terp_default_Bold_9">[[ (not ob['product']) and removeParentNode('blockTable') ]] [[ ob['location_name'] ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(ob['product'],'p') ]]</para>
<blockTable colWidths="28.0,186.0,85.0,85.0,57.0,85.0" style="Table8">
<tr>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">[ [[ p['code'] ]] ] [[ p['prod_name'] ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ p['variants'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[formatLang( p['prod_qty']) ]] [[ p['uom'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(p['price'], dp='Account') ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(p['price_value'], dp='Account', currency_obj = o.company_id.currency_id)]]</para>
</td>
</tr>
</blockTable>
</section>
<blockTable colWidths="28.0,399.0,99.0" style="Table10">
<tr>
<td>
<para style="terp_tblheader_Details">[[ (not ob['product']) and removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(price_total(), dp='Account', currency_obj = o.company_id.currency_id) ]]</para>
</td>
</tr>
</blockTable>
</section>
</section>
<blockTable colWidths="85.0,328.0,113.0" repeatRows="1" style="Table1">
<tr>
<td>
<para style="terp_default_Bold_9">Grand Total:</para>
</td>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(grand_total_price(), dp='Account', currency_obj = o.company_id.currency_id) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
</pto>
</story>
</document>

View File

@ -1,55 +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
from openerp.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=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 = self.pool['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],['complete_name'])[0]['complete_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 self.price_total
def _grand_total(self):
return 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,header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,227 +0,0 @@
<?xml version="1.0"?>
<document filename="Location Content.pdf">
<template title="Location Content" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="27.0" width="523" height="782"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table6">
<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"/>
</blockTableStyle>
<blockTableStyle id="Table7">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#999999" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#999999" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#999999" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#999999" start="3,-1" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Table8">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table10">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<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="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<pto>
<pto_header>
<blockTable colWidths="253.0,65.0,63.0,63.0,78.0" style="Table6">
<tr>
<td>
<para style="terp_tblheader_Details">Location / Product</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Variants</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Unit Price</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Value</para>
</td>
</tr>
</blockTable>
</pto_header>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_header_Centre">Location Content</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="211.0,85.0,85.0,57.0,85.0" style="Table6">
<tr>
<td>
<para style="terp_tblheader_Details">Location / Product</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Variants</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Unit Price</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Value</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(objects,'o') ]]</para>
<section>
<para style="terp_default_2">[[ repeatIn(process(o.id),'ob') ]]</para>
<blockTable colWidths="319.0,63.0,63.0,78.0" style="Table7">
<tr>
<td>
<para style="terp_default_Bold_9">[[ (not ob['product']) and removeParentNode('blockTable') ]][[ ob['location_name'] ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(ob['product'],'p') ]]</para>
<blockTable colWidths="28.0,183.0,85.0,85.0,57.0,85.0" style="Table8">
<tr>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_9">[ [[ p['code'] ]] ] [[ p['prod_name'] ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ p['variants'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[formatLang( p['prod_qty']) ]] [[ p['uom'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(p['price'], dp='Account') ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(p['price_value'], dp='Account', currency_obj = o.company_id.currency_id)]]</para>
</td>
</tr>
</blockTable>
</section>
<blockTable colWidths="28.0,395.0,99.0" style="Table10">
<tr>
<td>
<para style="terp_tblheader_Details">[[ (not ob['product']) and removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(price_total(), dp='Account', currency_obj = o.company_id.currency_id) ]]</para>
</td>
</tr>
</blockTable>
</section>
</section>
<blockTable colWidths="85.0,325.0,113.0" repeatRows="1" style="Table2">
<tr>
<td>
<para style="terp_default_Bold_9">Grand Total:</para>
</td>
<td>
<para style="terp_default_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ formatLang(grand_total_price(), dp='Account', currency_obj = o.company_id.currency_id) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_2">
<font color="white"> </font>
</para>
</pto>
</story>
</document>

View File

@ -1,94 +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
from openerp.report import report_sxw
from openerp.tools.translate import _
class picking(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(picking, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_internal_picking_src_lines': self.get_internal_picking_src_lines,
'get_internal_picking_dest_lines': self.get_internal_picking_dest_lines,
'get_product_desc': self.get_product_desc,
})
def get_product_desc(self, move_line):
desc = move_line.product_id.name
if move_line.product_id.default_code:
desc = '[' + move_line.product_id.default_code + ']' + ' ' + desc
return desc
def get_internal_picking_src_lines(self, picking):
res = []
for line in picking.move_lines:
if line.state not in ('confirmed', 'done', 'assigned', 'waiting') or line.scrapped:
continue
state_label = line.state == 'done' and _('Done') or (line.state == 'confirmed' and _('Waiting Availability') or (line.state == 'assigned' and _('Available') or _('Waiting Availability')))
row = {
'state': state_label,
'description': self.get_product_desc(line),
}
if not line.lot_ids:
row['quantity'] = line.product_uom_qty
row['lot_id'] = ''
row['uom'] = line.product_uom.name
row['location_id'] = line.location_id.name
row['barcode'] = line.product_id.ean13
res.append(row)
else:
for quant in line.lot_ids:
row2 = row.copy()
row2['quantity'] = quant.qty
row2['uom'] = line.product_id.uom_id.name
row2['location_id'] = quant.location_id.name
row2['lot_id'] = quant.lot_id and quant.lot_id.name or ''
row2['barcode'] = quant.lot_id and quant.lot_id.name or line.product_id.ean13
res.append(row2)
return res
def get_internal_picking_dest_lines(self, picking):
res = []
#TODO: rewrite according to pack ops
# for line in picking.move_lines:
# row = {'description': self.get_product_desc(line)}
# if not line.putaway_ids:
# row['quantity'] = line.product_uom_qty
# row['uom'] = line.product_uom.name
# row['location_id'] = line.location_dest_id.name
# row['barcode'] = line.product_id.ean13
# row['lot_id'] = ''
# res.append(row)
# else:
# for rec in line.putaway_ids:
# row2 = row.copy()
# row2['quantity'] = rec.quantity
# row2['uom'] = line.product_id.uom_id.name
# row2['location_id'] = rec.location_id.name
# row2['lot_id'] = rec.lot_id and rec.lot_id.name or ''
# row2['barcode'] = rec.lot_id and rec.lot_id.name or line.product_id.ean13
# res.append(row2)
return res
report_sxw.report_sxw('report.stock.picking.list', 'stock.picking', 'addons/stock/report/picking.rml', parser=picking)
report_sxw.report_sxw('report.stock.picking.list.internal', 'stock.picking', 'addons/stock/report/picking_internal.rml', parser=picking, header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,255 +0,0 @@
<?xml version="1.0"?>
<document filename="Packing List.pdf">
<template pageSize="(595.0,842.0)" title="Packing List" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="0.0" y1="57.0" width="538" height="728"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Address_detail">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Title_String">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Header_Order_Reference_Tbl">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Content_Order_Reference_Table">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Move_Line_Header">
<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"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_5cm_Above_Space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1cm_above_space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="3.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<pto>
<pto_header>
<blockTable colWidths="256.0,73.0,59.0,59.0,71.0" repeatRows="1" style="Move_Line_Header">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Lot</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Status</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Location</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
</tr>
</blockTable>
</pto_header>
<para style="terp_default_8">[[repeatIn(objects,'picking')]] </para>
<para style="terp_default_8">[[picking.picking_type_id.code == 'outgoing' and picking.partner_id and setLang(picking.partner_id.lang) or '']]</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<blockTable colWidths="269.0,269.0" style="Table_Address_detail">
<tr>
<td>
<para style="terp_default_Bold_9">Supplier Address : [[ (picking.picking_type_id.code == 'incoming' or removeParentNode('para')) and '' ]]</para>
<para style="terp_default_Bold_9">Customer Address : [[ (picking.picking_type_id.code == 'outgoing' or removeParentNode('para')) and '' ]]</para>
<para style="terp_default_Bold_9">Warehouse Address : [[ (picking.picking_type_id.code == 'internal' or removeParentNode('para')) and '' ]]</para>
<para style="terp_default_9">[[ (picking.partner_id and picking.partner_id.id and picking.partner_id.title.name) or '' ]] [[ picking.partner_id and picking.partner_id.id and picking.partner_id.name ]]</para>
<para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id) ]]</para>
<para style="terp_default_9">[[ picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Contact Address :</para>
<para style="terp_default_9">[[ picking.partner_id and picking.partner_id.title.name or '' ]] [[ picking.partner_id and picking.partner_id.name or '' ]]</para>
<para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id) ]] </para>
<para style="terp_default_9">[[ picking.partner_id.phone or picking.partner_id.email or removeParentNode('para')]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<blockTable colWidths="538.0" style="Table_Title_String">
<tr>
<td>
<para style="terp_header">Delivery Order : [[ (picking.picking_type_id.code == 'outgoing' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para>
<para style="terp_header">Incoming Shipment : [[ (picking.picking_type_id.code == 'incoming' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para>
<para style="terp_header">Internal Shipment : [[ (picking.picking_type_id.code == 'internal' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<blockTable colWidths="100.0,154.0,161.0,109.0" style="Header_Order_Reference_Tbl">
<tr>
<td>
<para style="terp_tblheader_General_Centre">Journal</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Order(Origin)</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Schedule Date</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Weight</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="100.0,154.0,162.0,109.0" style="Content_Order_Reference_Table">
<tr>
<td>
<para style="terp_default_Centre_8">[[ picking.picking_type_id.name]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ picking.origin or '']]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(picking.min_date,date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ 'weight' in picking._columns.keys() and picking.weight or '']]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<blockTable colWidths="315.0,132.0,71.0" repeatRows="1" style="Move_Line_Header">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Serial Number</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn([line for line in picking.move_lines if (line.state not in ['draft', 'cancel'] and not line.scrapped)],'move_lines') ]]</para>
<blockTable colWidths="315.0,132.0,71.0" style="Table1">
<tr>
<td>
<para style="terp_default_9"><font face="Helvetica" size="9.0">[[ get_product_desc(move_lines) ]] </font></para>
</td>
<td>
<para style="terp_default_Centre_9">[[ move_lines.quant_ids and ','.join(map(str, [q.lot_id.name for q in move_lines.quant_ids if q.lot_id])) or '' ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_lines.product_uom_qty) ]] [[ move_lines.product_uom.name ]]</para>
</td>
</tr>
</blockTable>
</section>
<para style="terp_default_2">
<font color="white"> </font>
</para>
</pto>
</story>
</document>

View File

@ -1,364 +0,0 @@
<?xml version="1.0"?>
<document filename="Packing List.pdf">
<template pageSize="(595.0,842.0)" title="Packing List" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="0.0" y1="57.0" width="538" height="728"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Address_detail">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table_Title_String">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Header_Order_Reference_Tbl">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Content_Order_Reference_Table">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="4,0" stop="4,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="4,0" stop="4,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Move_Line_Header">
<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"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica-Oblique" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Table Contents" fontName="Helvetica"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_5cm_Above_Space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_1cm_above_space" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="3.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<pto>
<pto_header>
<blockTable colWidths="155.0,73.0,59.0,59.0,71.0,100" repeatRows="1" style="Move_Line_Header">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Status</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Source Location</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Serial Number</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Barcode</para>
</td>
</tr>
</blockTable>
</pto_header>
<para style="terp_default_8">[[repeatIn(objects,'picking')]] </para>
<para style="terp_default_8">[[picking.picking_type_id.code == 'outgoing' and picking.partner_id and setLang(picking.partner_id.lang) or '']]</para>
<para style="terp_default_9">
<font color="white"> </font>
</para>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<blockTable colWidths="400,124" style="Table_Title_String">
<tr>
<td>
<para style="terp_header">Delivery Order : [[ (picking.picking_type_id.code == 'outgoing' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para>
<para style="terp_header">Incoming Shipment : [[ (picking.picking_type_id.code == 'incoming' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para>
<para style="terp_header">Internal Shipment : [[ (picking.picking_type_id.code == 'internal' or removeParentNode('para')) and '' ]] [[ picking.name ]]</para>
</td>
<td>
<barCode code="code128" quiet="9" fontName="Times-Roman" fontSize="50" alignment="CENTER"> [[ picking.name ]] </barCode>
</td>
</tr>
</blockTable>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<blockTable colWidths="100.0,154.0,161.0,109.0" style="Header_Order_Reference_Tbl">
<tr>
<td>
<para style="terp_tblheader_General_Centre">Journal</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Order(Origin)</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Schedule Date</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Weight</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="100.0,154.0,161.0,109.0" style="Content_Order_Reference_Table">
<tr>
<td>
<para style="terp_default_Centre_8">[[ picking.picking_type_id.name]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ picking.origin or '']]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(picking.min_date,date_time = True) ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ 'weight' in picking._columns.keys() and picking.weight or '']]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<blockTable colWidths="155.0,70.0,65.0,60.0,70.0,100.0" repeatRows="1" style="Move_Line_Header">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Status</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Source Location</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Serial Number</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Barcode</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(get_internal_picking_src_lines(picking), 'move_line') ]]</para>
<blockTable colWidths="155.0,70.0,65.0,60.0,70.0,100.0" style="Table1">
<tr>
<td>
<para style="terp_default_9"><font face="Helvetica" size="9.0">[[ move_line['description'] ]] </font></para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_line['state'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_line['quantity'] ]] [[ move_line['uom'] ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ move_line['location_id'] ]] </para>
</td>
<td>
<para style="terp_default_Centre_9">[[ move_line['lot_id'] ]]</para>
</td>
<td>
<barCode code="code128" quiet="9" fontName="Times-Roman" fontSize="50" alignment="CENTER">[[ move_line['barcode'] or removeParentNode('barCode')]]</barCode>
</td>
</tr>
</blockTable>
</section>
<para style="terp_default_Bold_9">[[ ([line for line in picking.move_lines if line.state == 'draft']) and 'Non Assigned Products:' or removeParentNode('para') ]]</para>
<para style="terp_default_2"/>
<section>
<para style="terp_default_2">[[ repeatIn([line for line in picking.move_lines if line.state == 'draft'],'move_lines') ]]</para>
<blockTable colWidths="155.0,70.0,65.0,60.0,70.0,100.0" style="Table1">
<tr>
<td>
<para style="terp_default_9"><font face="Helvetica" size="9.0">[[ get_product_desc(move_lines) ]] </font></para>
</td>
<td>
<para style="terp_default_Right_9">Unconfirmed</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(move_lines.product_qty) ]] [[ move_lines.product_uom.name ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ move_lines.location_id.name ]] </para>
</td>
<td>
<para style="terp_default_Centre_9"></para>
</td>
<td>
<barCode code="code128" quiet="9" fontName="Times-Roman" fontSize="50" alignment="CENTER">[[ move_lines.product_id.ean13 or removeParentNode('barCode')]]</barCode>
</td>
</tr>
</blockTable>
</section>
<para style="terp_default_2">
<font color="white"> </font>
</para>
</pto>
<pto>
<pto_header>
<blockTable colWidths="225.0,65.0,60.0,70.0,100.0" repeatRows="1" style="Move_Line_Header">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Suggested Destination</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Serial Number</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Barcode</para>
</td>
</tr>
</blockTable>
</pto_header>
<para style="terp_default_5cm_Above_Space">
<font color="white"> </font>
</para>
<para style="terp_default_2">
<font color="white"> </font>
</para>
<para style="terp_header">Suggested Destination Locations</para>
<para style="terp_default_2">
<font color="white"> </font>
</para>
<blockTable colWidths="225.0,65.0,60.0,70.0,100.0" repeatRows="1" style="Move_Line_Header">
<tr>
<td>
<para style="terp_tblheader_Details">Description</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Suggested Destination</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Serial Number</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Barcode</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(get_internal_picking_dest_lines(picking), 'move_line') ]]</para>
<blockTable colWidths="225.0,65.0,60.0,70.0,100.0" style="Table1">
<tr>
<td>
<para style="terp_default_9"><font face="Helvetica" size="9.0">[[ move_line['description'] ]] </font></para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_line['quantity'] ]] [[ move_line['uom'] ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ move_line['location_id'] ]] </para>
</td>
<td>
<para style="terp_default_Centre_9">[[ move_line['lot_id'] ]]</para>
</td>
<td>
<barCode code="code128" quiet="9" fontName="Times-Roman" fontSize="50" alignment="CENTER">[[ move_line['barcode'] or removeParentNode('barCode')]]</barCode>
</td>
</tr>
</blockTable>
</section>
</pto>
</story>
</document>

View File

@ -66,11 +66,13 @@ class report_stock(report_int):
for name in names:
names[name] = names[name].encode('utf8')
products = {}
prods = registry['stock.location']._product_all_get(cr, uid, location_id, product_ids)
ctx = context.copy()
ctx['location_id'] = loc_ids
prods = registry['product.product']._product_available(cr, uid, product_ids, context=ctx)
for prod in prods.keys():
products[prod] = [(now, prods[prod]['qty_available'])]
prods[prod] = 0
for p in prods:
products[p] = [(now,prods[p])]
prods[p] = 0
if not loc_ids or not product_ids:
return (False, 'pdf')

View File

@ -1,85 +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 openerp
from openerp.report.interface import report_rml
from openerp.report.interface import toxml
#FIXME: we should use toxml
class report_custom(report_rml):
def create_xml(self, cr, uid, ids, datas, context=None):
config = """
<config>
<date>09/09/2005</date>
<PageSize>210.00mm,297.00mm</PageSize>
<PageWidth>595.27</PageWidth>
<PageHeight>841.88</PageHeight>
<tableSize>60.00mm,60.00mm,60.00mm</tableSize>
<report-header>Stock by location</report-header>
<report-footer>Generated by OpenERP</report-footer>
</config>
"""
header = """
<header>
<field>Location</field>
<field>Product name</field>
<field>Product quantity</field>
</header>
"""
def process(location_id, level):
registry = openerp.registry(cr.dbname)
xml = '<row>'
location_name = registry['stock.location'].read(cr, uid, [location_id], ['name'])
xml += "<col para='yes' tree='yes' space='" + str(3*level) + "mm'>"
xml += location_name[0]['name'] + '</col>'
prod_info = registry['stock.location']._product_get(cr, uid, location_id)
xml += "<col>"
for prod_id in prod_info.keys():
if prod_info[prod_id] != 0.0:
prod_name = registry['product.product'].read(cr, uid, [prod_id], ['name'])
xml += prod_name[0]['name'] + '\n'
xml += '</col>'
xml += "<col>"
for prod_id in prod_info.keys():
if prod_info[prod_id] != 0.0:
xml += str(prod_info[prod_id]) + '\n'
xml += '</col></row>'
location_child = registry['stock.location'].read(cr, uid, [location_id], ['child_ids'])
for child_id in location_child[0]['child_ids']:
xml += process(child_id, level+1)
return xml
for location_id in ids:
xml = '<lines>' + process(location_id, 0) + '</lines>'
xml = '<?xml version="1.0" ?>' '<report>'+ config + header + xml + '</report>'
return self.post_process_xml_data(cr, uid, xml, context)
report_custom('report.stock.lot.location', 'stock.location', '', 'addons/stock/report/stock_by_location.xsl')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,109 +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: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="22" alignment="center"/>
<blockTableStyle id="header">
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
<blockValign value="TOP"/>
<blockAlignment value="RIGHT"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
<blockTableStyle id="lines">
<blockValign value="TOP"/>
<blockAlignment value="RIGHT"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
</xsl:template>
<xsl:template name="story">
<xsl:apply-templates select="report"/>
</xsl:template>
<xsl:template match="report">
<xsl:apply-templates select="config"/>
<blockTable style="header">
<xsl:attribute name="colWidths">
<xsl:value-of select="./config/tableSize"/>
</xsl:attribute>
<xsl:apply-templates select="header"/>
</blockTable>
<xsl:apply-templates select="lines"/>
</xsl:template>
<xsl:template match="config">
<para style="title">
<xsl:value-of select="report-header"/>
</para>
<spacer length="1cm" width="2mm"/>
</xsl:template>
<xsl:template match="header">
<tr>
<xsl:for-each select="field">
<td>
<para>
<xsl:value-of select="."/>
</para>
</td>
</xsl:for-each>
</tr>
</xsl:template>
<xsl:template match="lines">
<blockTable style="lines">
<xsl:attribute name="colWidths">
<xsl:value-of select="../config/tableSize"/>
</xsl:attribute>
<xsl:apply-templates select="row"/>
</blockTable>
<spacer length="2mm" width="2mm"/>
</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>
<xsl:attribute name="leftIndent"><xsl:value-of select="@space"/></xsl:attribute>
<xsl:value-of select="."/>
</para>
</xsl:when>
<xsl:otherwise>
<para>
<xsl:value-of select="."/>
</para>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xpre>
<xsl:value-of select="."/>
</xpre>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,218 +0,0 @@
<?xml version="1.0"?>
<document filename="Stock Inventory.pdf">
<template pageSize="(595.0,842.0)" title="Stock Inventory" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table5">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
</blockTableStyle>
<blockTableStyle id="Table4">
<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"/>
</blockTableStyle>
<blockTableStyle id="Table8">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
</blockTableStyle>
<blockTableStyle id="Table7">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="Standard" fontName="Helvetica"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Helvetica"/>
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Footer" fontName="Helvetica"/>
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_8" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Centre_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Right_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_Bold_Right_9" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_White_2" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#ffffff"/>
<paraStyle name="terp_default_Note" rightIndent="0.0" leftIndent="9.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="Table" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Untitled1" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_default_space" rightIndent="0.0" leftIndent="0.0" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="14.0" spaceAfter="0.0"/>
<images/>
</stylesheet>
<story>
<para style="terp_default_8">[[ repeatIn(objects,'o') ]] </para>
<blockTable colWidths="539.0" style="Table3">
<tr>
<td>
<para style="terp_header_Centre">Stock Inventory</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="539.0" style="Table5">
<tr>
<td>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="268.0,271.0" style="Table2">
<tr>
<td>
<para style="terp_tblheader_General_Centre">Inventory</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Date</para>
</td>
</tr>
</blockTable>
<blockTable colWidths="268.0,271.0" style="Table1">
<tr>
<td>
<para style="terp_default_Centre_8">[[ o.name ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(o.date,date_time=True) ]]</para>
</td>
</tr>
</blockTable>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<blockTable colWidths="59.0,86.0,213.0,91.0,91.0" style="Table4">
<tr>
<td>
<para style="terp_tblheader_Details">Location</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Production Lot</para>
</td>
<td>
<para style="terp_tblheader_Details">Product </para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Quantity</para>
</td>
<td>
<para style="terp_tblheader_Details_Centre">Manual Quantity</para>
</td>
</tr>
</blockTable>
<section>
<para style="terp_default_2">[[ repeatIn(o.line_ids, 'p') ]]</para>
<blockTable colWidths="58.0,87.0,212.0,91.0,91.0" style="Table8">
<tr>
<td>
<para style="terp_default_9">[[ p.location_id.name ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ p.prod_lot_id and p.prod_lot_id.name or '' ]]</para>
</td>
<td>
<para style="terp_default_9">[ [[ p.product_id.code ]] ] [[ p.product_id.name ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(p.product_qty) ]] [[ p.product_uom.name ]]</para>
</td>
<td>
<para style="terp_default_Right_9">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
</section>
<blockTable colWidths="318.0,39.0,91.0,91.0" style="Table7">
<tr>
<td>
<para style="terp_default_Bold_9">
<font color="white"> </font>
</para>
</td>
<td>
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Bold_Right_9">[[ formatLang(qty_total(o.line_ids)['quantity']) ]] [[ qty_total(o.line_ids)['uom'] ]]</para>
</td>
<td>
<para style="terp_default_Bold_Right_9">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="terp_default_8">
<font color="white"> </font>
</para>
</story>
</document>

View File

@ -1,47 +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
from openerp.report import report_sxw
class stock_inventory_move(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(stock_inventory_move, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'qty_total':self._qty_total
})
def _qty_total(self, objects):
total = 0.0
uom = objects[0].product_uom_id.name
for obj in objects:
total += obj.product_qty
return {'quantity':total,'uom':uom}
report_sxw.report_sxw(
'report.stock.inventory.move',
'stock.inventory',
'addons/stock/report/stock_inventory_move.rml',
parser=stock_inventory_move,
header='internal'
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -829,18 +829,10 @@ function openerp_picking_widgets(instance){
var self = this;
new instance.web.Model('stock.picking.type').call('read', [[self.picking_type_id], ['code'], new instance.web.CompoundContext()])
.then(function(pick_type){
if (pick_type[0]['code'] == 'outgoing'){
new instance.web.Model('stock.picking').call('do_print_delivery',[[self.picking.id]])
new instance.web.Model('stock.picking').call('do_print_picking',[[self.picking.id]])
.then(function(action){
return self.do_action(action);
});
}
else {
new instance.web.Model('stock.picking').call('do_print_picking',[[self.picking.id]])
.then(function(action){
return self.do_action(action);
});
}
});
},
picking_next: function(){

View File

@ -808,23 +808,10 @@ class stock_picking(osv.osv):
default['date_done'] = False
return super(stock_picking, self).copy(cr, uid, id, default, context)
def do_print_delivery(self, cr, uid, ids, context=None):
'''This function prints the delivery order'''
assert len(ids) == 1, 'This option should only be used for a single id at a time'
datas = {
'model': 'stock.picking',
'ids': ids,
}
return {'type': 'ir.actions.report.xml', 'report_name': 'stock.picking.list', 'datas': datas, 'nodestroy': True}
def do_print_picking(self, cr, uid, ids, context=None):
'''This function prints the picking list'''
assert len(ids) == 1, 'This option should only be used for a single id at a time'
datas = {
'model': 'stock.picking',
'ids': ids,
}
return {'type': 'ir.actions.report.xml', 'report_name': 'stock.picking.list.internal', 'datas': datas, 'nodestroy': True}
return self.pool.get("report").get_action(cr, uid, ids, 'stock.report_picking', context=context)
def action_confirm(self, cr, uid, ids, context=None):
todo = []
@ -2381,6 +2368,12 @@ class stock_inventory(osv.osv):
res_filter.append(('pack', _('A Pack')))
return res_filter
def _get_total_qty(self, cr, uid, ids, field_name, args, context=None):
res = {}
for inv in self.browse(cr, uid, ids, context=context):
res[inv.id] = sum([x.product_qty for x in inv.line_ids])
return res
_columns = {
'name': fields.char('Inventory Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Name."),
'date': fields.datetime('Inventory Date', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Create Date."),
@ -2395,6 +2388,7 @@ class stock_inventory(osv.osv):
'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number', readonly=True, states={'draft': [('readonly', False)]}, help="Specify Lot/Serial Number to focus your inventory on a particular Lot/Serial Number."),
'move_ids_exist': fields.function(_get_move_ids_exist, type='boolean', string=' Stock Move Exists?', help='technical field for attrs in view'),
'filter': fields.selection(_get_available_filters, 'Selection Filter'),
'total_qty': fields.function(_get_total_qty, type="float"),
}
def _default_stock_location(self, cr, uid, context=None):

View File

@ -42,6 +42,7 @@
-
!record {model: stock.inventory, id: stock_inventory_icecream}:
name: Inventory for icecream
filter: 'product'
product_id: product_icecream
-
!record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot0}:

View File

@ -1,14 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
string="Picking"
id="action_report_picking"
model="stock.picking"
report_type="qweb-pdf"
name="stock.report_picking"
file="stock.report_picking"
/>
<report
string="Inventory"
id="action_report_inventory"
model="stock.inventory"
report_type="qweb-pdf"
name="stock.report_inventory"
file="stock.report_inventory"
/>
<report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Stock Level Forecast"/>
<report id="report_picking_list" model="stock.picking" name="stock.picking.list.internal" string="Picking Slip" rml="stock/report/picking_internal.rml"/>
<report id="action_report_quant_package_barcode" model="stock.quant.package" report_type="qweb-pdf" name="stock.report_package_barcode" string="Package BarCode" file="stock.report_package_barcode"/>
<report id="report_picking_list_in" model="stock.pickin" name="stock.picking.list" string="Receipt Slip" rml="stock/report/picking.rml"/>
<report id="report_picking_list_out" model="stock.picking" name="stock.picking.list" string="Delivery Slip" rml="stock/report/picking.rml"/>
<report id="report_move_labels" model="stock.move" name="stock.move.label" string="Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
<report auto="False" id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Inventory Overview" rml="stock/report/lot_overview.rml"/>
<report id="report_location_overview_all" model="stock.location" name="lot.stock.overview_all" string="Location Content" rml="stock/report/lot_overview_all.rml"/>
<report id="report_stock_inventory_move" model="stock.inventory" name="stock.inventory.move" string="Stock Inventory" rml="stock/report/stock_inventory_move.rml"/>
</data>
</openerp>

View File

@ -586,11 +586,7 @@
<menuitem action="action_location_form" id="menu_action_location_form" groups="stock.group_locations"
parent="menu_stock_configuration" sequence="5"/>
<record model="ir.actions.act_window" id="action_product_location_tree">
<field name="context">{'product_id': active_id}</field>
<field name="name">Stock by Location</field>
<field name="res_model">stock.location</field>
</record>
<record id="act_product_stock_move_open" model="ir.actions.act_window">
<field name="context">{'search_default_done': 1,'search_default_product_id': active_id, 'default_product_id': active_id}</field>
<field name="name">Moves</field>
@ -725,7 +721,6 @@
<button name="do_transfer" states="assigned" string="Transfer" groups="stock.group_stock_user" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('pack_operation_exist', '=', True)]}"/>
<button name="do_partial_open_barcode" string="Enter Transfer Details" groups="stock.group_stock_user" type="object" class="oe_highlight" attrs="{'invisible': ['|',('pack_operation_exist', '=', True),('state','not in',('assigned', 'partially_available'))]}"/>
<button name="open_barcode_interface" string="Open Barcode interface" groups="stock.group_stock_user" type="object" class="oe_highlight" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state','not in',('assigned', 'partially_available'))]}"/>
<button name="do_print_delivery" string="Print Delivery Order" groups="stock.group_stock_user" type="object" attrs="{'invisible': ['|', ('picking_type_code', '!=', 'outgoing'), ('state', '!=', 'done')]}"/>
<button name="do_print_picking" string="Print Picking List" groups="stock.group_stock_user" type="object" attrs="{'invisible': ['|', ('picking_type_code', '=', 'outgoing'), ('state', '!=', 'assigned')]}"/>
<button name="%(act_stock_return_picking)d" string="Reverse Transfer" states="done" type="action" groups="base.group_user"/>
<button name="action_cancel" states="assigned,confirmed,partially_available,draft" string="Cancel Transfer" groups="base.group_user" type="object"/>
@ -1360,29 +1355,6 @@
<menuitem action="action_incoterms_tree" id="menu_action_incoterm_open" parent="menu_warehouse_config" sequence="1"/>
<act_window
context="{'location': active_id}"
domain="[('type','&lt;&gt;','service')]"
id="act_product_location_open"
name="Products"
res_model="product.product"
src_model="stock.location"/>
<record id="ir_act_product_location_open" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">stock.location</field>
<field name="name">Products</field>
<field eval="'ir.actions.act_window,%d'%act_product_location_open" name="value"/>
</record>
<record id="ir_act_product_location_open" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">stock.location</field>
<field name="name">Open Products</field>
<field eval="'ir.actions.act_window,%d'%action_view_stock_location_product" name="value"/>
</record>
<record id="view_pickingtype_filter" model="ir.ui.view">
<field name="name">stock.picking.type.filter</field>
@ -2145,7 +2117,7 @@
<field name="res_model">stock.picking</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('group_id','=',active_id)]</field>
<field name="domain">[('group_id','=',active_id)]</field>
</record>
<record id="procurement_group_form_view_herited" model="ir.ui.view">
<field name="name">procurement.group.form.herited</field>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_inventory">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">
<h2>
Stock Inventory
</h2>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Inventory</strong></th>
<th><strong>Date</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span t-field="o.name"/>
</td>
<td>
<span t-field="o.date"/>
</td>
</tr>
</tbody>
</table>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Location</strong></th>
<th><strong>Product</strong></th>
<th><strong>Production Lot</strong></th>
<th><strong>Package</strong></th>
<th class="text-right"><strong>Quantity</strong></th>
</tr>
</thead>
<tr t-foreach="o.line_ids" t-as="line">
<td><span t-field="line.location_id"/></td>
<td><span t-field="line.product_id"/></td>
<td><span t-field="line.prod_lot_id"/></td>
<td><span t-field="line.package_id"/></td>
<td class="text-right"><span t-field="line.product_qty"/> <span t-field="line.product_uom_id" groups="product.group_uom"/></td>
</tr>
<tr>
<td></td>
</tr>
</table>
<t t-if="o.filter == 'product' and o.product_id">
<div class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed">
<tr class="border-black">
<td><strong>Total Quantity</strong></td>
<td class="text-right">
<span t-field="o.total_qty"/> <span t-field="o.product_id.uom_id"/>
</td>
</tr>
</table>
</div>
</div>
</t>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_picking">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="page">
<div class="row"><div class="col-xs-4 pull-right">
<img t-att-src="'/report/barcode/Standard39/%s' % o.name"/>
</div></div>
<div t-if="o.picking_type_id.code=='incoming'">
<span><strong>Supplier Address:</strong></span>
</div>
<div t-if="o.picking_type_id.code=='internal'">
<span><strong>Warehouse Address:</strong></span>
</div>
<div t-if="o.picking_type_id.code=='outgoing'">
<span><strong>Customer Address:</strong></span>
</div>
<div t-if="o.partner_id" name="partner_header">
<div t-field="o.partner_id"
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
<p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
</div>
<h2>
<span t-field="o.picking_type_id"/>:
<span t-field="o.name"/>
</h2>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Order (Origin)</strong></th>
<th><strong>State</strong></th>
<th><strong>Commitment Date</strong></th>
<th name="td_sched_date_h"><strong>Scheduled Date</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span t-field="o.origin"/>
</td>
<td>
<span t-field="o.state"/>
</td>
<td>
<span t-field="o.date"/>
</td>
<td name="td_sched_date">
<span t-field="o.min_date"/>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<table class="table table-condensed" t-if="not o.pack_operation_ids">
<thead>
<tr>
<th><strong>Product</strong></th>
<th class="text-right"><strong>Quantity</strong></th>
<t t-if="o.picking_type_id.code != 'incoming'"><th><strong>Source</strong></th></t>
<th><strong>Barcode</strong></th>
<t t-if="o.picking_type_id.code != 'outgoing'"><th><strong>Destination</strong></th></t>
</tr>
</thead>
<tbody>
<tr t-foreach="o.move_lines" t-as="move">
<td><span t-field="move.product_id"/></td>
<td class="text-right"><span t-field="move.product_uom_qty"/> <span t-field="move.product_uom" groups="product.group_uom"/></td>
<t t-if="o.picking_type_id.code != 'incoming'"><td><span t-field="move.location_id"/></td></t>
<td>
<span t-if="move.product_id and move.product_id.ean13">
<img t-att-src="'/report/barcode/EAN13/%s' % move.product_id.ean13"/>
</span>
</td>
<t t-if="o.picking_type_id.code != 'outgoing'"><td><span t-field="move.location_dest_id"/></td></t>
</tr>
</tbody>
</table>
<table class="table table-condensed" t-if="o.pack_operation_ids">
<thead>
<tr>
<th><strong>Product</strong></th>
<th class="text-right"><strong>Quantity</strong></th>
<t t-if="o.picking_type_id.code != 'incoming'"><th><strong>Source</strong></th></t>
<th><strong>Barcode</strong></th>
<t t-if="o.picking_type_id.code != 'outgoing'"><th><strong>Destination</strong></th></t>
</tr>
</thead>
<tbody>
<tr t-foreach="o.pack_operation_ids" t-as="pack_operation">
<td><span t-field="pack_operation.product_id"/>
<t t-if="not pack_operation.product_id and pack_operation.package_id"><span t-field="pack_operation.package_id"/></t></td>
<td class="text-right"><span t-field="pack_operation.product_qty"/> <span t-field="pack_operation.product_uom_id" groups="product.group_uom"/></td>
<t t-if="o.picking_type_id.code != 'incoming'"><td><span t-field="pack_operation.location_id"/>
<span t-if="pack_operation.package_id">:</span>
<span t-field="pack_operation.package_id"/>
<span t-if="pack_operation.lot_id">:</span>
<span t-field="pack_operation.lot_id"/>
</td>
</t>
<td>
<span t-if="pack_operation.lot_id">
<img t-att-src="'/report/barcode/Standard39/%s' % pack_operation.lot_id"/>
</span>
<span t-if="pack_operation.product_id and not pack_operation.lot_id and pack_operation.product_id.ean13">
<img t-att-src="'/report/barcode/EAN13/%s' % pack_operation.product_id.ean13"/>
</span>
<span t-if="pack_operation.package_id and not pack_operation.product_id">
<img t-att-src="'/report/barcode/Standard39/%s' % pack_operation.package_id.name"/>
</span>
</td>
<t t-if="o.picking_type_id.code != 'outgoing'"><td><span t-field="pack_operation.location_dest_id"/>
<span t-if="pack_operation.result_package_id">:</span>
<span t-field="pack_operation.result_package_id"/>
</td></t>
</tr>
</tbody>
</table>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>

View File

@ -20,7 +20,6 @@
##############################################################################
import stock_move
import stock_location_product
import stock_return_picking
import stock_change_product_qty
import make_procurement_product

View File

@ -1,61 +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
from openerp.tools.translate import _
class stock_location_product(osv.osv_memory):
_name = "stock.location.product"
_description = "Products by Location"
_columns = {
'from_date': fields.datetime('From'),
'to_date': fields.datetime('To'),
'type': fields.selection([('inventory','Analyse Current Inventory'),
('period','Analyse a Period')], 'Analyse Type', required=True),
}
def action_open_window(self, cr, uid, ids, context=None):
""" To open location wise product information specific to given duration
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: An ID or list of IDs (but only the first ID will be processed)
@param context: A standard dictionary
@return: Invoice type
"""
if context is None:
context = {}
location_products = self.read(cr, uid, ids, ['from_date', 'to_date'], context=context)
if location_products:
return {
'name': _('Current Inventory'),
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'product.product',
'type': 'ir.actions.act_window',
'context': {'location': context['active_id'],
'from_date': location_products[0]['from_date'],
'to_date': location_products[0]['to_date']},
'domain': [('type', '<>', 'service')],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_stock_location_product" model="ir.ui.view">
<field name="name">Products by Location</field>
<field name="model">stock.location.product</field>
<field name="arch" type="xml">
<form string="View Stock of Products" version="7.0">
<group>
<field name="type"/>
</group>
<group attrs="{'invisible':[('type', '!=', 'period')], 'required':[('type', '=', 'period')]}">
<field name="from_date"/>
<field name="to_date"/>
</group>
<footer>
<button name="action_open_window" string="View Products Inventory" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<act_window name="Products by Location"
res_model="stock.location.product"
src_model="stock.location"
view_mode="form"
target="new"
key2="client_action_multi"
id="action_view_stock_location_product"/>
</data>
</openerp>

View File

@ -43,13 +43,21 @@ class stock_history(osv.osv):
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
res = super(stock_history, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
prod_dict= {}
if 'inventory_value' in fields:
for line in res:
if '__domain' in line:
lines = self.search(cr, uid, line['__domain'], context=context)
inv_value = 0.0
for line2 in self.browse(cr, uid, lines, context=context):
inv_value += line2.inventory_value
product_obj = self.pool.get("product.product")
lines_rec = self.browse(cr, uid, lines, context=context)
for line_rec in lines_rec:
if not line_rec.product_id.id in prod_dict:
if line_rec.product_id.cost_method == 'real':
prod_dict[line_rec.product_id.id] = line_rec.price_unit_on_quant
else:
prod_dict[line_rec.product_id.id] = product_obj.get_history_price(cr, uid, line_rec.product_id.id, line_rec.company_id.id, context=context)
inv_value += prod_dict[line_rec.product_id.id]
line['inventory_value'] = inv_value
return res
@ -93,9 +101,7 @@ class stock_history(osv.osv):
ir_property.value_text AS cost_method,
quant.cost as price_unit_on_quant
FROM
stock_move
LEFT JOIN
stock_quant quant ON quant.id IN (SELECT quant_id FROM stock_quant_move_rel WHERE move_id = stock_move.id)
stock_quant as quant, stock_quant_move_rel, stock_move
LEFT JOIN
stock_location location ON stock_move.location_dest_id = location.id
LEFT JOIN
@ -104,7 +110,8 @@ class stock_history(osv.osv):
product_template ON product_template.id = product_product.product_tmpl_id
LEFT JOIN
ir_property ON (ir_property.name = 'cost_method' and ir_property.res_id = 'product.template,' || product_template.id::text)
WHERE stock_move.state = 'done' AND location.usage = 'internal'
WHERE stock_move.state = 'done' AND location.usage = 'internal' AND stock_quant_move_rel.quant_id = quant.id
AND stock_quant_move_rel.move_id = stock_move.id
) UNION
(SELECT
'-' || stock_move.id::text || '-' || quant.id::text AS id,
@ -117,9 +124,7 @@ class stock_history(osv.osv):
ir_property.value_text AS cost_method,
quant.cost as price_unit_on_quant
FROM
stock_move
LEFT JOIN
stock_quant quant ON quant.id IN (SELECT quant_id FROM stock_quant_move_rel WHERE move_id = stock_move.id)
stock_quant as quant, stock_quant_move_rel, stock_move
LEFT JOIN
stock_location location ON stock_move.location_id = location.id
LEFT JOIN
@ -128,6 +133,7 @@ class stock_history(osv.osv):
product_template ON product_template.id = product_product.product_tmpl_id
LEFT JOIN
ir_property ON (ir_property.name = 'cost_method' and ir_property.res_id = 'product.template,' || product_template.id::text)
WHERE stock_move.state = 'done' AND location.usage = 'internal'
WHERE stock_move.state = 'done' AND location.usage = 'internal' AND stock_quant_move_rel.quant_id = quant.id
AND stock_quant_move_rel.move_id = stock_move.id
)
)""")

View File

@ -8,7 +8,7 @@
<field name="arch" type="xml">
<form string="Choose your date" version="7.0">
<p class="oe_gray" attrs="{'invisible': [('choose_date', '=', False)]}">
Choose the date for wich you want to get the stock valuation of your products.
Choose the date for which you want to get the stock valuation of your products.
This will filter the stock operation that weren't done at the selected date, to retreive the quantity
you had, and gives you the inventory value according to the standard price used at that time.
@ -49,7 +49,7 @@
<field name="company_id" groups="base.group_multi_company"/>
<field name="date"/>
<field name="quantity" sum="# of Products "/>
<field name="inventory_value"/>
<field name="inventory_value" sum="Total Value"/>
</tree>
</field>
</record>

View File

@ -21,5 +21,6 @@
import stock_picking_wave
import wizard
import controllers
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -34,6 +34,7 @@ This module adds the picking wave option in warehouse management.
'stock_picking_wave_view.xml',
'stock_picking_wave_sequence.xml',
'wizard/picking_to_wave_view.xml',
'stock_picking_wave_reports.xml',
],
'demo': [
'stock_picking_wave_demo.xml',

View File

@ -0,0 +1 @@
import main

View File

@ -0,0 +1,16 @@
from openerp.addons.web import http
from openerp.addons.web.http import request
class picking_wave_report(http.Controller):
@http.route('/report/stock_picking_wave.report_pickingwave/<ids>', type='http', auth='user',
website=True, multilang=True)
def report_picking_wave(self, ids):
self.cr, self.uid, self.pool = request.cr, request.uid, request.registry
ids = [int(i) for i in ids.split(',')]
picking_wave_obj = self.pool["stock.picking.wave"]
wave = picking_wave_obj.browse(self.cr, self.uid, ids[0])
docargs = {
'docs': wave.picking_ids,
}
return request.registry['report'].render(self.cr, self.uid, [], 'stock.report_picking', docargs)

View File

@ -31,22 +31,8 @@ class stock_picking_wave(osv.osv):
'''
This function print the report for all picking_ids associated to the picking wave
'''
picking_ids = []
for wave in self.browse(cr, uid, ids, context=context):
picking_ids += [picking.id for picking in wave.picking_ids]
if not picking_ids:
raise osv.except_osv(_('Error!'), _('Nothing to print.'))
datas = {
'ids': picking_ids,
'model': 'stock.picking',
'form': self.read(cr, uid, picking_ids, context=context)
}
return {
'type': 'ir.actions.report.xml',
'report_name': context.get('report', 'stock.picking.list'),
'datas': datas,
'nodestroy': True
}
context = context or {}
return self.pool.get("report").get_action(cr, uid, ids, 'stock_picking_wave.report_pickingwave', context=context)
def create(self, cr, uid, vals, context=None):
if vals.get('name', '/') == '/':

View File

@ -0,0 +1,12 @@
<openerp>
<data>
<report
id="action_report_print_picking_wave"
model="stock.picking.wave"
report_type="qweb-pdf"
string="Associated Pickings"
name="stock_picking_wave.report_pickingwave"
file="stock_picking_wave.report_pickingwave"
/>
</data>
</openerp>