Преглед на файлове

commit reportgral_purchase1

sebas преди 8 години
ревизия
02b4962681

+ 26 - 0
__init__.py

@@ -0,0 +1,26 @@
+# -*- 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 reportgral_purchase1
+import report
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
__init__.pyc


+ 56 - 0
__openerp__.py

@@ -0,0 +1,56 @@
+# -*- 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/>.
+#
+##############################################################################
+
+
+{
+    'name': 'Listado Gral de Compras con product brand',
+    'version': '1.1',
+    'category': 'Purchase Management',
+    'sequence': 19,
+    'summary': 'Listado Gral de Compras con product brand',
+    'description': """
+Listado Gral de Compras con product brand
+==================================================
+
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': '',
+    'depends': ['stock_account', 'report', 'product_brand'],
+    'data': [
+        'informe_compra_general_view1.xml',
+        'purchase_report1.xml',
+        'informe_compra_por_categoria1.xml',
+        'informe_compragralxprov1.xml',
+        'informe_compra_por_fecha1.xml',
+        'purchasegral_filter_view1.xml',
+		'report/informe_compragral_view1.xml',
+    ],
+    'test': [
+
+    ],
+    'demo': [
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 77 - 0
informe_compra_general_view1.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+		<template id="report_compragral1">
+			<t t-call="report.html_container">
+				<t t-call="report.external_layout">
+					<div class="page">
+						<style type="text/css">
+							.crm_tcab{
+							font-size: 3mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+							.crm_tbody{
+							font-size: 2.8mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+							.logo1{
+							width: 100%;
+							top: 1.5cm;
+							}
+
+							.total1{
+							font-size: 2.8mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+						</style>
+						<h4 class="text-center">Listado de compras por producto</h4>
+						<div class="logo1" />
+
+						  <table class="table table-condensed">
+							<thead class="crm_tcab">
+								<tr class="active">
+									<th>Producto</th>
+									<th class="text-right">Precio Costo</th>
+									<th class="text-right">Cantidad</th>
+									<th class="text-right">Sub Total</th>
+								</tr>
+							</thead>
+							<t t-foreach="docs" t-as="o">
+							<tbody>
+									<tr>
+										<td>
+											<span t-field="o.product_id"/>
+										</td>
+										<td class="text-right">
+											<span t-esc="(o.price_total)/(o.quantity)"/>
+										</td>
+										<td class="text-right">
+											<span t-field="o.quantity"/>
+										</td>
+										<td class="text-right">
+											<span t-field="o.price_total"/>
+										</td>
+									</tr>
+							</tbody>
+							</t>
+							<tr>
+                                <td colspan="4"></td>
+                            </tr>
+                            <tr class="border-black">
+                                <td colspan="2">Total:</td>
+								<td class="text-right">
+                                    <t t-set="total" t-value="sum([x.quantity for x in docs])"/>
+                                    <span t-esc="total"/>
+                                </td>
+                            </tr>
+						  </table>
+
+					</div>
+				</t>
+			</t>
+		</template>
+	</data>
+</openerp>

+ 78 - 0
informe_compra_por_categoria1.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+		<template id="informe_compra_por_categoria1">
+			<t t-call="report.html_container">
+				<t t-call="report.external_layout">
+					<div class="page">
+						<style type="text/css">
+							.crm_tcab{
+							font-size: 3mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+							.crm_tbody{
+							font-size: 2.8mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+							.logo1{
+							width: 100%;
+							top: 1.5cm;
+							}
+
+							.total1{
+							font-size: 2.8mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+						</style>
+						<h4 class="text-center">Listado de compras por categoria</h4>
+						<div class="logo1" />
+
+						  <table class="table table-condensed">
+
+							<thead class="crm_tcab">
+								<tr class="active">
+									<th>Producto</th>
+									<th class="text-left">Categoria</th>
+									<th class="text-center">Cantidad</th>
+									<th class="text-right">Sub Total</th>
+								</tr>
+							</thead>
+							<t t-foreach="docs" t-as="o">
+							<tbody>
+									<tr>
+										<td class="text-left">
+											<span t-esc="o.product_id.name"/>
+										</td>
+										<td class="text-left">
+											<span t-field="o.category_id"/>
+										</td>
+										<td class="text-right">
+											<span t-field="o.quantity"/>
+										</td>
+										<td class="text-right">
+											<span t-field="o.price_total"/>
+										</td>
+									</tr>
+							</tbody>
+							</t>
+							<tr>
+                                <td colspan="4"></td>
+                            </tr>
+                            <tr class="border-black">
+                                <td colspan="2">Total:</td>
+								<td class="text-right">
+                                    <t t-set="total" t-value="sum([x.quantity for x in docs])"/>
+                                    <span t-esc="total"/>
+                                </td>
+                            </tr>
+						  </table>
+
+					</div>
+				</t>
+			</t>
+		</template>
+	</data>
+</openerp>

+ 71 - 0
informe_compra_por_fecha1.xml

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+		<template id="informe_compra_por_fecha1">
+			<t t-call="report.html_container">
+				<t t-call="report.external_layout">
+					<div class="page">
+						<style type="text/css">
+							.crm_tcab{
+							font-size: 3mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+							.crm_tbody{
+							font-size: 2.8mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+							.logo1{
+							width: 100%;
+							top: 1.5cm;
+							}
+
+							.total1{
+							font-size: 2.8mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+						</style>
+						<h4 class="text-center">Listado de compras por fecha</h4>
+						<div class="logo1" />
+
+						  <table class="table table-condensed">
+							<thead class="crm_tcab">
+								<tr class="active">
+									<th>Fecha</th>
+									<th>Cliente</th>
+									<th>Producto</th>
+									<th class="text-center">Cantidad</th>
+									<th class="text-right">Sub Total</th>
+								</tr>
+							</thead>
+							<t t-foreach="docs" t-as="o">
+							<tbody>
+									<tr>
+										<td>
+											<span t-field="o.date" t-field-options='{"widget": "date"}'/>
+										</td>
+										<td class="text-left">
+											<span t-esc="o.partner_id.name"/>
+										</td>
+										<td class="text-left">
+											<span t-esc="o.product_id.name"/>
+										</td>
+										<td class="text-center">
+											<span t-field="o.quantity"/>
+										</td>
+										<td class="text-right">
+											<span t-field="o.price_total"/>
+										</td>
+									</tr>
+							</tbody>
+							</t>
+						  </table>
+
+					</div>
+				</t>
+			</t>
+		</template>
+	</data>
+</openerp>

+ 63 - 0
informe_compragralxprov1.xml

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+		<template id="report_compragralxprov1">
+			<t t-call="report.html_container">
+				<t t-call="report.external_layout">
+					<div class="page">
+						<style type="text/css">
+							.crm_tcab{
+							font-size: 3mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+							.crm_tbody{
+							font-size: 2.8mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+							.logo1{
+							width: 100%;
+							top: 1.5cm;
+							}
+
+							.total1{
+							font-size: 2.8mm;
+							font-family: Arial, Helvetica, sans-serif;
+							}
+
+						</style>
+						<h4 class="text-center">Listado de compras por proveedor</h4>
+						<div class="logo1" />
+
+						  <table class="table table-condensed">
+							<thead class="crm_tcab">
+								<tr class="active">
+									<th>Proveedor</th>
+									<th class="text-center">Cantidad</th>
+									<th class="text-right">Sub Total</th>
+								</tr>
+							</thead>
+							<t t-foreach="docs" t-as="o">
+							<tbody>
+									<tr>
+										<td>
+											<span t-field="o.partner_id"/>
+										</td>
+										<td class="text-center">
+											<span t-field="o.quantity"/>
+										</td>
+										<td class="text-right">
+											<span t-field="o.price_total"/>
+										</td>
+									</tr>
+							</tbody>
+							</t>
+						  </table>
+
+					</div>
+				</t>
+			</t>
+		</template>
+	</data>
+</openerp>

+ 36 - 0
purchase_report1.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <report id="report_cpgral"
+            model="purchase.report2"
+            string="Listado de compras por producto"
+            report_type="qweb-pdf"
+            name="reportgral_purchase1.report_compragral1"
+            file="reportgral_purchase1.report_compragral1"
+        />
+
+		<report id="report_cpgral2"
+            model="purchase.report2"
+            string="Listado de compras por proveedor"
+            report_type="qweb-pdf"
+            name="reportgral_purchase1.report_compragralxprov1"
+            file="reportgral_purchase1.report_compragralxprov1"
+        />
+
+		<report id="report_cpgral3"
+            model="purchase.report2"
+            string="Listado de compras por fecha"
+            report_type="qweb-pdf"
+            name="reportgral_purchase1.informe_compra_por_fecha1"
+            file="reportgral_purchase1.informe_compra_por_fecha1"
+        />
+		
+		<report id="report_cpgral4"
+            model="purchase.report2"
+            string="Listado de compras por categoria"
+            report_type="qweb-pdf"
+            name="reportgral_purchase1.informe_compra_por_categoria1"
+            file="reportgral_purchase1.informe_compra_por_categoria1"
+        />
+    </data>
+</openerp>

+ 80 - 0
purchasegral_filter_view1.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <!-- Custom reports (aka filters) -->
+        <record id="filter_purchase_order_monthly_purchases1" model="ir.filters">
+            <field name="name">Compras Mensualmente</field>
+            <field name="model_id">purchase.report2</field>
+            <field name="domain">[('state','&lt;&gt;','cancel')]</field>
+            <field name="user_id" eval="False"/>
+            <field name="context">{'group_by': ['category_id'], 'col_group_by': ['date:month'], 'measures': ['quantity']}</field>
+        </record>
+        <record id="filter_purchase_order_price_per_supplier1" model="ir.filters">
+            <field name="name">Precio por Proveedor</field>
+            <field name="model_id">purchase.report2</field>
+            <field name="domain">[('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]</field>
+            <field name="user_id" eval="False"/>
+            <field name="context">{'group_by': ['partner_id'], 'col_group_by': ['product_id'], 'measures': ['price_average']}</field>
+        </record>
+
+        <record id="filter_purchase_report_brand2" model="ir.filters">
+              <field name="name">Por Marca</field>
+              <field name="model_id">purchase.report2</field>
+              <field name="user_id" eval="False"/>
+              <field name="context">{'group_by': ['product_brand_id']}</field>
+          </record>
+        <record id="filter_purchase_report_brand3" model="ir.filters">
+              <field name="name">Por Mes/Marca</field>
+              <field name="model_id">purchase.report2</field>
+              <field name="user_id" eval="False"/>
+              <field name="context">{'group_by': ['date:month','product_brand_id']}</field>
+          </record>
+
+        <record id="filter_purchase_order_average_delivery_time1" model="ir.filters">
+            <field name="name">Tiempo de entrega</field>
+            <field name="model_id">purchase.report2</field>
+            <field name="domain">[('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]</field>
+            <field name="user_id" eval="False"/>
+            <field name="context">{'group_by': ['partner_id'], 'measures': ['delay_pass']}</field>
+        </record>
+
+		<record id="view_purchase_order_search2" model="ir.ui.view">
+        <field name="name">report.purchase.order.search2</field>
+        <field name="model">purchase.report2</field>
+        <field name="arch" type="xml">
+            <search string="Ordenes de Compra">
+                <filter string="Presupuestos" name="quotes" domain="[('state','=','draft')]"/>
+                <filter string="Ordenes" name="orders" domain="[('state','&lt;&gt;','draft'),('state','&lt;&gt;','cancel')]"/>
+                <field name="partner_id"/>
+                <field name="product_id"/>
+                <group expand="0" string="Filtros Extendidos">
+                    <field name="user_id"/>
+                    <field name="validator"/>
+                    <field name="location_id"/>
+                    <field name="picking_type_id"/>
+                    <field name="company_id" groups="base.group_multi_company"/>
+                    <field name="date"/>
+                    <field name="date_approve"/>
+                    <field name="expected_date"/>
+                </group>
+                <group expand="1" string="Agrupado por">
+                    <filter string="Proveedor" name="group_partner_id" context="{'group_by':'partner_id'}"/>
+                    <filter string="Responsable" name="Responsible" context="{'group_by':'user_id'}"/>
+                    <filter string="Categoria de producto" name="group_category_id" context="{'group_by':'category_id'}"/>
+                    <filter string="Estado" context="{'group_by':'state'}"/>
+                    <filter string="Compania" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
+                    <filter string="Hoy" domain="[('date', '&gt;=', datetime.datetime.now().strftime('%Y-%m-%d 00:00:00')),('date', '&lt;=',datetime.datetime.now().strftime('%Y-%m-%d 23:23:59'))]"/>
+                    <filter string="Semana anterior" domain="[('date', '&gt;=', ((context_today()+relativedelta(weeks=-2, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('date', '&lt;=', ((context_today()+relativedelta(weeks=-1, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
+                    <filter string="Esta semana" domain="[('date', '&gt;=', ((context_today()+relativedelta(weeks=-1, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('date', '&lt;=', ((context_today()+relativedelta(weeks=0, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
+                    <separator/>
+                    <filter string="Mes" context="{'group_by':'date:month'}"/>
+                    <filter string="Por dia" context="{'group_by':'date:day'}"/>
+                </group>
+            </search>
+        </field>
+    </record>
+
+
+    </data>
+</openerp>

+ 24 - 0
report/__init__.py

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

BIN
report/__init__.pyc


+ 30 - 0
report/informe_compragral_view1.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record id="report_compragral_tree_view2" model="ir.ui.view">
+            <field name="name">report.compragral.tree.view2</field>
+            <field name="model">purchase.report2</field>
+            <field name="priority" eval="20"/>
+            <field name="arch" type="xml">
+                <tree string="Listado General de Compras" create="false">
+					<field name="id" invisible="1"/>
+					<field name="product_id" string="Producto"/>
+					<field name="quantity" string="Cantidad"/>
+					<field name="price_total" string="Total"/>
+				</tree>
+            </field>
+        </record>
+
+		<record id="action_compra_gral_tree_view2" model="ir.actions.act_window">
+            <field name="name">Listado General de Compras</field>
+            <field name="res_model">purchase.report2</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree</field>
+        </record>
+
+		<menuitem id="purchase_compragral_menu2" name="Listado General de Compras" parent="base.next_id_73" sequence="11" action="action_compra_gral_tree_view2"/>
+
+
+
+	</data>
+</openerp>

+ 133 - 0
report/purchase_report2.py

@@ -0,0 +1,133 @@
+# -*- 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/>.
+#
+##############################################################################
+
+#
+# Please note that these reports are not multi-currency !!!
+#
+
+from openerp.osv import fields,osv
+from openerp import tools
+
+class purchase_report2(osv.osv):
+    _name = "purchase.report2"
+    _description = "Ordenes de Compra"
+    _auto = False
+    _columns = {
+        'date': fields.datetime('Fecha Compra', readonly=True, help="Fecha en la que se ha creado este documento"),  # TDE FIXME master: rename into date_order
+        'state': fields.selection([('draft', 'Borrador'),
+                                     ('confirmed', 'Confirmado'),
+                                      ('approved', 'Aprobado'),
+                                      ('except_picking', 'Excepción de envío'),
+                                      ('except_invoice', 'Excepción factura'),
+                                      ('done', 'Realizado'),
+                                      ('cancel', 'Cancelado')],'Estado del pedido', readonly=True),
+        'product_id':fields.many2one('product.product', 'Producto', readonly=True),
+        'product_brand_id':fields.many2one('product.brand', 'Marca', readonly=True),
+        'picking_type_id': fields.many2one('stock.warehouse', 'Almacén', readonly=True),
+        'location_id': fields.many2one('stock.location', 'Destino', readonly=True),
+        'partner_id':fields.many2one('res.partner', 'Proveedor', readonly=True),
+        'pricelist_id':fields.many2one('product.pricelist', 'Lista Precio', readonly=True),
+        'date_approve':fields.date('Fecha aprobado', readonly=True),
+        'expected_date':fields.date('Fecha esperada', readonly=True),
+        'validator' : fields.many2one('res.users', 'Por validado', readonly=True),
+        'product_uom' : fields.many2one('product.uom', 'Unidad de Medida', required=True),
+        'company_id':fields.many2one('res.company', 'Compania', readonly=True),
+        'user_id':fields.many2one('res.users', 'Responsable', readonly=True),
+        'delay':fields.float('Días para validar', digits=(16,2), readonly=True),
+        'delay_pass':fields.float('Días para entregar', digits=(16,2), readonly=True),
+        'quantity': fields.integer('Cantidad', readonly=True),  # TDE FIXME master: rename into unit_quantity
+        'price_total': fields.float('Total Precio', readonly=True),
+        'price_average': fields.float('Precio promedio', readonly=True, group_operator="avg"),
+        'negociation': fields.float('Precio Standard Compra', readonly=True, group_operator="avg"),
+        'price_standard': fields.float('Products Value', readonly=True, group_operator="sum"),
+        'nbr': fields.integer('# de Lineas', readonly=True),  # TDE FIXME master: rename into nbr_lines
+        'category_id': fields.many2one('product.category', 'Categoria', readonly=True)
+
+    }
+    _order = 'date desc, price_total desc'
+    def init(self, cr):
+        tools.sql.drop_view_if_exists(cr, 'purchase_report2')
+        cr.execute("""
+            create or replace view purchase_report2 as (
+                select
+                    min(l.id) as id,
+                    s.date_order as date,
+                    s.state,
+                    s.date_approve,
+                    s.minimum_planned_date as expected_date,
+                    s.dest_address_id,
+                    s.pricelist_id,
+                    s.validator,
+                    s.picking_type_id as picking_type_id,
+                    s.partner_id as partner_id,
+                    s.create_uid as user_id,
+                    s.company_id as company_id,
+                    l.product_id,
+                    t.categ_id as category_id,
+                    t.product_brand_id as product_brand_id,
+                    t.uom_id as product_uom,
+                    s.location_id as location_id,
+                    sum(l.product_qty/u.factor*u2.factor) as quantity,
+                    extract(epoch from age(s.date_approve,s.date_order))/(24*60*60)::decimal(16,2) as delay,
+                    extract(epoch from age(l.date_planned,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
+                    count(*) as nbr,
+                    sum(l.price_unit*l.product_qty)::decimal(16,2) as price_total,
+                    avg(100.0 * (l.price_unit*l.product_qty) / NULLIF(ip.value_float*l.product_qty/u.factor*u2.factor, 0.0))::decimal(16,2) as negociation,
+                    sum(ip.value_float*l.product_qty/u.factor*u2.factor)::decimal(16,2) as price_standard,
+                    (sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty/u.factor*u2.factor),0.0))::decimal(16,2) as price_average
+                from purchase_order_line l
+                    join purchase_order s on (l.order_id=s.id)
+                        left join product_product p on (l.product_id=p.id)
+                            left join product_template t on (p.product_tmpl_id=t.id)
+                                left join product_brand r on (r.id=t.product_brand_id)
+                            LEFT JOIN ir_property ip ON (ip.name='standard_price' AND ip.res_id=CONCAT('product.template,',t.id) AND ip.company_id=s.company_id)
+                    left join product_uom u on (u.id=l.product_uom)
+                    left join product_uom u2 on (u2.id=t.uom_id)
+                group by
+                    s.company_id,
+                    s.create_uid,
+                    s.partner_id,
+                    u.factor,
+                    s.location_id,
+                    l.price_unit,
+                    s.date_approve,
+                    l.date_planned,
+                    t.product_brand_id,
+                    l.product_uom,
+                    s.minimum_planned_date,
+                    s.pricelist_id,
+                    s.validator,
+                    s.dest_address_id,
+                    l.product_id,
+                    t.categ_id,
+                    s.date_order,
+                    s.state,
+                    s.picking_type_id,
+                    u.uom_type,
+                    u.category_id,
+                    t.uom_id,
+                    u.id,
+                    u2.factor
+            )
+        """)
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
report/purchase_report2.pyc


+ 37 - 0
reportgral_purchase1.py

@@ -0,0 +1,37 @@
+# -*- 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 pytz
+from openerp import SUPERUSER_ID, workflow
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
+from operator import attrgetter
+from openerp.tools.safe_eval import safe_eval as eval
+from openerp.osv import fields, osv
+from openerp.tools.translate import _
+import openerp.addons.decimal_precision as dp
+from openerp.osv.orm import browse_record_list, browse_record, browse_null
+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP
+from openerp.tools.float_utils import float_compare
+
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
reportgral_purchase1.pyc


BIN
static/description/icon.png