[MERGE] trunk-wms

bzr revid: qdp-launchpad@openerp.com-20140401092742-11g6j7rgcrpa9zo2
This commit is contained in:
Quentin (OpenERP) 2014-04-01 11:27:42 +02:00
commit 8631692023
117 changed files with 421 additions and 2464 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

@ -210,8 +210,6 @@ class EscposDriver(Thread):
eprint.text(receipt['company']['name'] + '\n')
eprint.set(align='center',type='b')
if check(receipt['shop']['name']):
eprint.text(receipt['shop']['name'] + '\n')
if check(receipt['company']['contact_address']):
eprint.text(receipt['company']['contact_address'] + '\n')
if check(receipt['company']['phone']):

View File

@ -92,7 +92,7 @@
assert proc.location_id.id == order.location_src_id.id, "Input location and procurement location do not correspond"
assert proc.product_uom.id == order_line.product_uom.id, "UOM does not correspond in procurement."
assert proc.product_uos_qty == order_line.product_uos and order_line.product_uos_qty or order_line.product_qty, "UOS qty does not correspond in procurement."
# procurement state should be `confirmed` at this stage, except if mrp_jit is installed, in which
# procurement state should be `confirmed` at this stage, except if procurement_jit is installed, in which
# case it could already be in `running` or `exception` state (not enough stock)
expected_states = ('confirmed', 'running', 'exception')
assert proc.state in expected_states, 'Procurement state is `%s` for %s, expected one of %s' % \

View File

@ -61,8 +61,8 @@ class pos_config(osv.osv):
'journal_ids' : fields.many2many('account.journal', 'pos_config_journal_rel',
'pos_config_id', 'journal_id', 'Available Payment Methods',
domain="[('journal_user', '=', True ), ('type', 'in', ['bank', 'cash'])]",),
'warehouse_id' : fields.many2one('stock.warehouse', 'Warehouse',
required=True),
'picking_type_id': fields.many2one('stock.picking.type', 'Picking Type'),
'stock_location_id': fields.many2one('stock.location', 'Stock Location', domain=[('usage', '=', 'internal')], required=True),
'journal_id' : fields.many2one('account.journal', 'Sale Journal',
domain=[('type', '=', 'sale')],
help="Accounting journal used to post sales entries."),
@ -87,7 +87,8 @@ class pos_config(osv.osv):
"to customize the reference numbers of your orders."),
'session_ids': fields.one2many('pos.session', 'config_id', 'Sessions'),
'group_by' : fields.boolean('Group Journal Items', help="Check this if you want to group the Journal Items by Product while closing a Session"),
'pricelist_id': fields.many2one('product.pricelist','Pricelist', required=True)
'pricelist_id': fields.many2one('product.pricelist','Pricelist', required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
}
def _check_cash_control(self, cr, uid, ids, context=None):
@ -131,24 +132,39 @@ class pos_config(osv.osv):
res = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', company_id)], limit=1, context=context)
return res and res[0] or False
def _default_warehouse(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context)
res = self.pool.get('stock.warehouse').search(cr, uid, [('company_id', '=', user.company_id.id)], limit=1, context=context)
return res and res[0] or False
def _default_pricelist(self, cr, uid, context=None):
res = self.pool.get('product.pricelist').search(cr, uid, [('type', '=', 'sale')], limit=1, context=context)
return res and res[0] or False
def _get_default_location(self, cr, uid, context=None):
wh_obj = self.pool.get('stock.warehouse')
user = self.pool.get('res.users').browse(cr, uid, uid, context)
res = wh_obj.search(cr, uid, [('company_id', '=', user.company_id.id)], limit=1, context=context)
if res and res[0]:
return wh_obj.browse(cr, uid, res[0], context=context).lot_stock_id.id
return False
def _get_default_company(self, cr, uid, context=None):
company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
return company_id
_defaults = {
'state' : POS_CONFIG_STATE[0][0],
'warehouse_id': _default_warehouse,
'journal_id': _default_sale_journal,
'group_by' : True,
'pricelist_id': _default_pricelist,
'iface_invoicing': True,
'stock_location_id': _get_default_location,
'company_id': _get_default_company,
}
def onchange_picking_type_id(self, cr, uid, ids, picking_type_id, context=None):
p_type_obj = self.pool.get("stock.picking.type")
p_type = p_type_obj.browse(cr, uid, picking_type_id, context=context)
if p_type.default_location_src_id and p_type.default_location_src_id.usage == 'internal' and p_type.default_location_dest_id and p_type.default_location_dest_id.usage == 'customer':
return {'value': {'stock_location_id': p_type.default_location_src_id.id}}
return False
def set_active(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state' : 'active'}, context=context)
@ -334,7 +350,7 @@ class pos_session(osv.osv):
# the .xml files as the CoA is not yet installed.
jobj = self.pool.get('pos.config')
pos_config = jobj.browse(cr, uid, config_id, context=context)
context.update({'company_id': pos_config.warehouse_id.company_id.id})
context.update({'company_id': pos_config.company_id.id})
if not pos_config.journal_id:
jid = jobj.default_get(cr, uid, ['journal_id'], context=context)['journal_id']
if jid:
@ -361,7 +377,7 @@ class pos_session(osv.osv):
bank_values = {
'journal_id' : journal.id,
'user_id' : uid,
'company_id' : pos_config.warehouse_id.company_id.id
'company_id' : pos_config.company_id.id
}
statement_id = self.pool.get('account.bank.statement').create(cr, uid, bank_values, context=context)
bank_statement_ids.append(statement_id)
@ -642,7 +658,6 @@ class pos_order(osv.osv):
_columns = {
'name': fields.char('Order Ref', size=64, required=True, readonly=True),
'company_id':fields.many2one('res.company', 'Company', required=True, readonly=True),
'warehouse_id': fields.related('session_id', 'config_id', 'warehouse_id', relation='stock.warehouse', type='many2one', string='Warehouse', store=True, readonly=True),
'date_order': fields.datetime('Order Date', readonly=True, select=True),
'user_id': fields.many2one('res.users', 'Salesman', help="Person who uses the the cash register. It can be a reliever, a student or an interim employee."),
'amount_tax': fields.function(_amount_all, string='Taxes', digits_compute=dp.get_precision('Account'), multi='all'),
@ -671,7 +686,8 @@ class pos_order(osv.osv):
'invoice_id': fields.many2one('account.invoice', 'Invoice'),
'account_move': fields.many2one('account.move', 'Journal Entry', readonly=True),
'picking_id': fields.many2one('stock.picking', 'Picking', readonly=True),
'picking_type_id': fields.many2one('stock.picking.type', 'Picking Type', required=True),
'picking_type_id': fields.related('session_id', 'config_id', 'picking_type_id', string="Picking Type", type='many2one', relation='stock.picking.type'),
'location_id': fields.related('session_id', 'config_id', 'stock_location_id', string="Location", type='many2one', store=True, relation='stock.location'),
'note': fields.text('Internal Notes'),
'nb_print': fields.integer('Number of Print', readonly=True),
'pos_reference': fields.char('Receipt Ref', size=64, readonly=True),
@ -706,7 +722,6 @@ class pos_order(osv.osv):
'session_id': _default_session,
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
'pricelist_id': _default_pricelist,
'picking_type_id': _get_out_picking_type,
}
def create(self, cr, uid, values, context=None):
@ -736,43 +751,55 @@ class pos_order(osv.osv):
continue
addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {}
picking_type = order.picking_type_id
picking_id = picking_obj.create(cr, uid, {
'origin': order.name,
'partner_id': addr.get('delivery',False),
'picking_type_id': picking_type.id,
'company_id': order.company_id.id,
'move_type': 'direct',
'note': order.note or "",
'invoice_state': 'none',
}, context=context)
self.write(cr, uid, [order.id], {'picking_id': picking_id}, context=context)
location_id = picking_type.default_location_src_id.id
picking_id = False
if picking_type:
picking_id = picking_obj.create(cr, uid, {
'origin': order.name,
'partner_id': addr.get('delivery',False),
'picking_type_id': picking_type.id,
'company_id': order.company_id.id,
'move_type': 'direct',
'note': order.note or "",
'invoice_state': 'none',
}, context=context)
self.write(cr, uid, [order.id], {'picking_id': picking_id}, context=context)
location_id = order.location_id.id
if order.partner_id:
destination_id = order.partner_id.property_stock_customer.id
else:
elif picking_type:
if not picking_type.default_location_dest_id:
raise osv.except_osv(_('Error!'), _('Missing source or destination location for picking type %s. Please configure those fields and try again.' % (picking_type.name,)))
destination_id = picking_type.default_location_dest_id.id
if not location_id or not destination_id:
raise osv.except_osv(_('Error!'), _('Missing source or destination location for picking type %s. Please configure those fields and try again.' % (picking_type.name,)))
else:
destination_id = partner_obj.default_get(cr, uid, ['property_stock_customer'], context=context)['property_stock_customer']
move_list = []
for line in order.lines:
if line.product_id and line.product_id.type == 'service':
continue
move_obj.create(cr, uid, {
move_list.append(move_obj.create(cr, uid, {
'name': line.name,
'product_uom': line.product_id.uom_id.id,
'product_uos': line.product_id.uom_id.id,
'picking_id': picking_id,
'picking_type_id': picking_type.id,
'product_id': line.product_id.id,
'product_uos_qty': abs(line.qty),
'product_uom_qty': abs(line.qty),
'state': 'draft',
'location_id': location_id if line.qty >= 0 else destination_id,
'location_dest_id': destination_id if line.qty >= 0 else location_id,
}, context=context)
picking_obj.action_confirm(cr, uid, [picking_id], context=context)
picking_obj.force_assign(cr, uid, [picking_id], context=context)
picking_obj.action_done(cr, uid, [picking_id], context=context)
}, context=context))
if picking_id:
picking_obj.action_confirm(cr, uid, [picking_id], context=context)
picking_obj.force_assign(cr, uid, [picking_id], context=context)
picking_obj.action_done(cr, uid, [picking_id], context=context)
elif move_list:
move_obj.action_confirm(cr, uid, move_list, context=context)
move_obj.force_assign(cr, uid, move_list, context=context)
move_obj.action_done(cr, uid, move_list, context=context)
return True
def cancel_order(self, cr, uid, ids, context=None):

View File

@ -31,6 +31,7 @@
</record>
<record model="pos.config" id="pos_config_main">
<field name="name">Main</field>
<field name="picking_type_id" ref="picking_type_posout"/>
</record>
<!-- notify all employees of module installation -->

View File

@ -80,7 +80,7 @@
<page string="Extra Info">
<group string="General Information">
<field name="company_id" groups="base.group_multi_company"/>
<field name="warehouse_id" widget="selection" groups="stock.group_locations"/>
<field name="location_id" widget="selection" groups="stock.group_locations"/>
<field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'point_of_sale.group_pos_user']}"/>
<field name="pricelist_id" groups="product.group_sale_pricelist" domain="[('type','=','sale')]"/>
<field name="picking_id" readonly="1"/>
@ -591,7 +591,9 @@
<field name="name"/>
</h1>
<group col="4">
<field name="warehouse_id" widget="selection" groups="stock.group_locations" />
<field name="picking_type_id" widget="selection" groups="stock.group_locations"
on_change="onchange_picking_type_id(picking_type_id)"/>
<field name="stock_location_id" groups="stock.group_locations"/>
<field name="pricelist_id" groups="product.group_sale_pricelist"/>
<field name="currency_id" invisible="1"/>
<field name="journal_id" widget="selection"/>
@ -639,7 +641,7 @@
<field name="arch" type="xml">
<tree string="Point of Sale Configuration" colors="grey:state == 'inactive'">
<field name="name" />
<field name="warehouse_id" groups="stock.group_locations"/>
<field name="stock_location_id" groups="stock.group_locations"/>
<field name="state" />
</tree>
</field>
@ -653,7 +655,7 @@
<field name="name" />
<filter string="Active" domain="[('state', '=', 'active')]" />
<filter string="Inactive" domain="[('state', '=', 'inactive')]" />
<field name="warehouse_id" groups="stock.group_locations" />
<field name="stock_location_id" groups="stock.group_locations" />
</search>
</field>
</record>

View File

@ -36,7 +36,7 @@ class pos_order_report(osv.osv):
'price_total':fields.float('Total Price', readonly=True),
'total_discount':fields.float('Total Discount', readonly=True),
'average_price': fields.float('Average Price', readonly=True,group_operator="avg"),
'warehouse_id':fields.many2one('stock.warehouse', 'Warehouse', readonly=True),
'location_id':fields.many2one('stock.location', 'Location', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'product_qty':fields.integer('# of Qty', readonly=True),
@ -61,7 +61,7 @@ class pos_order_report(osv.osv):
s.partner_id as partner_id,
s.state as state,
s.user_id as user_id,
s.warehouse_id as warehouse_id,
s.location_id as location_id,
s.company_id as company_id,
s.sale_journal as journal_id,
l.product_id as product_id
@ -71,7 +71,7 @@ class pos_order_report(osv.osv):
left join product_uom u on (u.id=pt.uom_id)
group by
s.date_order, s.partner_id,s.state,
s.user_id,s.warehouse_id,s.company_id,s.sale_journal,l.product_id,s.create_date
s.user_id,s.location_id,s.company_id,s.sale_journal,l.product_id,s.create_date
having
sum(l.qty * u.factor) != 0)""")

View File

@ -36,6 +36,7 @@
<filter string="Salesperson" icon="terp-personal" name="User" context="{'group_by':'user_id'}"/>
<filter string="Customer" icon="terp-personal" context="{'group_by':'partner_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
<filter string="Stock Location" context="{'group_by': 'location_id'}"/>
<filter string="Order Date (day)" icon="terp-go-today" context="{'group_by':'date:day'}" help="Day of order date"/>
<filter string="Order Date (month)" icon="terp-go-month" context="{'group_by':'date:month'}" help="Month of order date"/>
<filter string="Order Date (year)" icon="terp-go-year" context="{'group_by':'date:year'}" help="Year of order date"/>

View File

@ -34,7 +34,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
this.company_logo = null;
this.company_logo_base64 = '';
this.currency = null;
this.shop = null;
this.company = null;
this.user = null;
this.users = [];
@ -174,7 +173,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return self.fetch(
'pos.config',
['name','journal_ids','warehouse_id','journal_id','pricelist_id',
['name','journal_ids','journal_id','pricelist_id',
'iface_self_checkout', 'iface_led', 'iface_cashdrawer',
'iface_payment_terminal', 'iface_electronic_scale', 'iface_barscan',
'iface_vkeyboard','iface_print_via_proxy','iface_scan_via_proxy',
@ -191,10 +190,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
self.config.iface_scan_via_proxy ||
self.config.iface_cashdrawer;
return self.fetch('stock.warehouse',[],[['id','=', self.config.warehouse_id[0]]]);
}).then(function(shops){
self.shop = shops[0];
return self.fetch('product.pricelist',['currency_id'],[['id','=',self.config.pricelist_id[0]]]);
}).then(function(pricelists){
self.pricelist = pricelists[0];
@ -954,7 +949,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
var client = this.get('client');
var cashier = this.pos.cashier || this.pos.user;
var company = this.pos.company;
var shop = this.pos.shop;
var date = new Date();
return {
@ -999,9 +993,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
phone: company.phone,
logo: this.pos.company_logo_base64,
},
shop:{
name: shop.name,
},
currency: this.pos.currency,
};
},

View File

@ -781,7 +781,6 @@
<t t-esc="widget.pos.company.name"/><br />
Phone: <t t-esc="widget.pos.company.phone || ''"/><br />
User: <t t-esc="widget.pos.user.name"/><br />
Shop: <t t-esc="widget.pos.shop.name"/><br />
<br />
<t t-if="widget.pos.config.receipt_header">
<div style='text-align:center'>

View File

@ -91,85 +91,6 @@ class pos_return(osv.osv_memory):
'context': context,
'type': 'ir.actions.act_window',
}
def create_returns2(self, cr, uid, ids, context=None):
if context is None:
context = {}
active_id = context.get('active_id', False)
order_obj =self.pool.get('pos.order')
line_obj = self.pool.get('pos.order.line')
picking_obj = self.pool.get('stock.picking')
stock_move_obj = self.pool.get('stock.move')
property_obj= self.pool.get("ir.property")
uom_obj =self. pool.get('product.uom')
statementl_obj = self.pool.get('account.bank.statement.line')
#Todo :Need to clean the code
if active_id:
data = self.browse(cr, uid, ids, context=context)[0]
date_cur = time.strftime('%Y-%m-%d %H:%M:%S')
for order_id in order_obj.browse(cr, uid, [active_id], context=context):
source_stock_id = property_obj.get(cr, uid, 'property_stock_customer', 'res.partner', context=context).id
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
"WHERE w.lot_stock_id=s.id AND w.id=%s ",
(order_id.warehouse_id.id,))
res = cr.fetchone()
location_id = res and res[0] or None
new_picking = picking_obj.copy(cr, uid, order_id.picking_id.id, {'name':'%s (return)' % order_id.name,
'move_lines': [],
'state':'draft',
'type': 'in',
'partner_id': order_id.partner_id.id,
'date': date_cur })
new_order = order_obj.copy(cr, uid, order_id.id, {'name': 'Refund %s'%order_id.name,
'lines':[],
'statement_ids':[],
'picking_id':[]})
account_def = property_obj.get(cr, uid, 'property_account_payable', 'res.partner', context=context)
amount = 0.0
for line in order_id.lines:
for record in data.pos_moves_ids:
if line.id == record.line_id:
qty = record.quantity
amount += qty * line.price_unit
stock_move_obj.create(cr, uid, {
'product_uom_qty': qty,
'product_uos_qty': uom_obj._compute_qty(cr, uid, qty ,line.product_id.uom_id.id),
'picking_id': new_picking,
'product_uom': line.product_id.uom_id.id,
'location_id': source_stock_id,
'product_id': line.product_id.id,
'location_dest_id': location_id,
'name': '%s (return)' %order_id.name,
'date': date_cur
})
if qty != 0.0:
line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
statementl_obj.create(cr, uid, {
'name': 'Refund %s'%order_id.name,
'statement_id': order_id.statement_ids[0].statement_id.id,
'pos_statement_id': new_order,
'date': fields.date.context_today(self, cr, uid, context=context),
'account_id': order_id.partner_id and order_id.partner_id.property_account_payable \
and order_id.partner_id.property_account_payable.id or account_def.id,
'amount': -amount,
})
order_obj.write(cr,uid, [active_id,new_order], {'state': 'done'})
picking_obj.signal_button_confirm(cr, uid, [new_picking])
picking_obj.force_assign(cr, uid, [new_picking], context)
act = {
'domain': "[('id', 'in', ["+str(new_order)+"])]",
'name': 'Refunded Orders',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'pos.order',
'auto_refresh':0,
'res_id':new_order,
'view_id': False,
'context':context,
'type': 'ir.actions.act_window'
}
return act
class add_product(osv.osv_memory):

View File

@ -19,6 +19,6 @@
#
##############################################################################
import mrp_jit
import procurement_jit
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,7 +23,7 @@
{
'name': 'Just In Time Scheduling',
'version': '1.0',
'category': 'Manufacturing',
'category': 'Base',
'description': """
This module allows Just In Time computation of procurement orders.
==================================================================
@ -42,8 +42,8 @@ In that case, you can not use priorities any more on the different picking.
'depends': ['procurement'],
'data': [],
'demo': [],
'test': ['test/mrp_jit.yml'],
'test': ['test/procurement_jit.yml'],
'installable': True,
'auto_install': True,
'auto_install': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,5 +1,5 @@
-
In order to test mrp_jit module with OpenERP, I create procurement order for
In order to test procurement_jit module with OpenERP, I create procurement order for
Computer Case product and check whether it runs without scheduler or not.
-
!record {model: procurement.order, id: procurement_order_test1}:

View File

@ -49,7 +49,7 @@ completed.
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/product.jpeg', 'images/task_from_SO.jpeg'],
'depends': ['project', 'procurement', 'sale', 'mrp_jit'],
'depends': ['project', 'procurement', 'sale', 'procurement_jit'],
'data': ['project_mrp_view.xml'], #'process/project_mrp_process.xml'
'demo': ['project_mrp_demo.xml'],
'test': ['test/project_task_procurement.yml'],

View File

@ -1132,9 +1132,13 @@ class procurement_order(osv.osv):
def propagate_cancel(self, cr, uid, procurement, context=None):
if procurement.rule_id.action == 'buy' and procurement.purchase_line_id:
self.pool.get('purchase.order.line').action_cancel(cr, uid, [procurement.purchase_line_id.id], context=context)
purchase_line_obj = self.pool.get('purchase.order.line')
if procurement.purchase_line_id.product_qty > procurement.product_qty and procurement.purchase_line_id.order_id.state == 'draft':
purchase_line_obj.write(cr, uid, [procurement.purchase_line_id.id], {'product_qty': procurement.purchase_line_id.product_qty - procurement.product_qty}, context=context)
else:
purchase_line_obj.action_cancel(cr, uid, [procurement.purchase_line_id.id], context=context)
return super(procurement_order, self).propagate_cancel(cr, uid, procurement, context=context)
def _run(self, cr, uid, procurement, context=None):
if procurement.rule_id and procurement.rule_id.action == 'buy':
#make a purchase order for the procurement

View File

@ -403,6 +403,7 @@ class Report(osv.Model):
'report_name': report.report_name,
'report_type': report.report_type,
'report_file': report.report_file,
'context': context,
}
if datas:

View File

@ -6,8 +6,6 @@ openerp.report = function(instance) {
var self = this;
instance.web.blockUI();
action = _.clone(action);
var eval_contexts = ([instance.session.user_context] || []).concat([action.context]);
action.context = instance.web.pyeval.eval('contexts',eval_contexts);
_t = instance.web._t;
// QWeb reports

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):
res[picking.id] = False
if picking.group_id:
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

@ -37,11 +37,11 @@ class stock_config_settings(osv.osv_memory):
_columns = {
'company_id': fields.many2one('res.company', 'Company', required=True),
'module_mrp_jit': fields.boolean("Generate procurement in real time",
'module_procurement_jit': fields.boolean("Generate procurement in real time",
help="""This allows Just In Time computation of procurement orders.
All procurement orders will be processed immediately, which could in some
cases entail a small performance impact.
This installs the module mrp_jit."""),
This installs the module procurement_jit."""),
'module_claim_from_delivery': fields.boolean("Allow claim on deliveries",
help='Adds a Claim link to the delivery order.\n'
'-This installs the module claim_from_delivery.'),

View File

@ -63,8 +63,8 @@
<label for="id" string="Logistic"/>
<div>
<div>
<field name="module_mrp_jit" class="oe_inline"/>
<label for="module_mrp_jit"/>
<field name="module_procurement_jit" class="oe_inline"/>
<label for="module_procurement_jit"/>
</div>
<div>
<field name="group_stock_multiple_locations" class="oe_inline"/>

Some files were not shown because too many files have changed in this diff Show More