Adrielso před 8 roky
revize
daf6626853

+ 28 - 0
__init__.py

@@ -0,0 +1,28 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    product_brand for OpenERP                                                  #
+#    Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).                   #
+#    Authors, Mathieu Lemercier, mathieu@netandco.net,                          #
+#             Franck Bret, franck@netandco.net                                  #
+#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>   #
+#                                                                               #
+#    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/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product Brand is an Openobject module wich enable Brand management for products #
+###################################################################################
+import report_stockgral
+import math

binární
__init__.pyc


+ 51 - 0
__openerp__.py

@@ -0,0 +1,51 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    product_features for OpenERP                                                  #
+#    Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).                   #
+#    Authors, Mathieu Lemercier, mathieu@netandco.net,                          #
+#             Franck Bret, franck@netandco.net                                  #
+#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>   #
+#                                                                               #
+#    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/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product features is an Openobject module wich enable features management for products #
+###################################################################################
+{
+    'name': 'Listado General de Stock Valorizado',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Listado General de Stock Valorizado
+========================================
+
+Genera General de Stock Valorizado
+- Por Location
+- Por Genero
+- Por Marca
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.paraguayenlaweb.com',
+	'depends': ['stock', 'report'],
+    'data': [
+		'informe_stockgral_view.xml',
+		'informe_stock_general_view1.xml',
+        'informe_stock_general_view2.xml',
+		'stockgral_filter_view.xml',
+    ],
+    'installable': True,
+}

+ 88 - 0
informe_stock_general_view1.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+		<report id="report_ventasgral6"
+            model="report.stockgral1"
+            string="Listado de Stock Valorizado"
+            report_type="qweb-pdf"
+            name="report_stockgral.informe_stock_general_view1"
+            file="report_stockgral.informe_stock_general_view1"
+        />
+
+		<template id="informe_stock_general_view1">
+			<t t-call="report.html_container">
+				<t t-call="report.internal_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 valorizacion de productos en stock</h4>
+						<div class="logo1" />
+
+						  <table class="table table-condensed">
+							<thead class="crm_tcab">
+								<tr class="active">
+									<th>Referencia</th>
+									<th>Producto</th>
+									<th class="text-right">Cantidad</th>
+									<th class="text-right">Sub Total Venta</th>
+								</tr>
+							</thead>
+							<t t-foreach="docs" t-as="o">
+							<tbody>
+									<tr>
+										<td>
+											<span t-field="o.factory_reference"/>
+										</td>
+										<td>
+											<span t-field="o.product_id"/>
+										</td>
+
+										<td class="text-right">
+											<span t-field="o.quantity"/>
+										</td>
+
+										<td class="text-right">
+											<span t-field="o.subtotal_venta"/>
+										</td>
+									</tr>
+							</tbody>
+							</t>
+							<tr>
+                                <td colspan="4"></td>
+                            </tr>
+                            <tr class="border-black">
+                                <td colspan="3">Total:</td>
+
+								<td class="text-right">
+                                    <t t-set="total" t-value="sum([x.subtotal_venta for x in docs])"/>
+                                    <span t-esc="total"/>
+                                </td>
+                            </tr>
+						  </table>
+
+					</div>
+				</t>
+			</t>
+		</template>
+	</data>
+</openerp>

+ 82 - 0
informe_stock_general_view2.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+		<report id="report_ventasgral7"
+            model="report.stockgral1"
+            string="Listado General stock"
+            report_type="qweb-pdf"
+            name="report_stockgral.informe_stock_general_view2"
+            file="report_stockgral.informe_stock_general_view2"
+        />
+
+		<template id="informe_stock_general_view2">
+			<t t-call="report.html_container">
+				<t t-call="report.internal_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 General de stock</h4>
+						<div class="logo1" />
+
+						<table class="table table-condensed">
+							<thead class="crm_tcab">
+								<tr class="active">
+									<th>Referencia</th>
+									<th>Producto</th>
+									<th class="text-right">Cantidad</th>
+								</tr>
+							</thead>
+							<t t-foreach="docs" t-as="o">
+							<tbody>
+									<tr>
+										<td>
+											<span t-field="o.factory_reference"/>
+										</td>
+										<td>
+											<span t-field="o.product_id"/>
+										</td>
+
+										<td class="text-right">
+											<span t-field="o.quantity"/>
+										</td>
+
+									</tr>
+							</tbody>
+							</t>
+							<tr>
+                <td colspan="3"></td>
+              </tr>
+              <tr class="border-black">
+               <td colspan="3">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>

+ 30 - 0
informe_stockgral_view.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record id="report_stockgral_tree_view" model="ir.ui.view">
+            <field name="name">report.stockgral.tree.view</field>
+            <field name="model">report.stockgral1</field>
+            <field name="priority" eval="20"/>
+            <field name="arch" type="xml">
+                <tree string="Listado General de Stock" create="false">
+                    <field name="factory_reference" string="Referencia"/>
+					<field name="product_id" string="Producto"/>
+					<field name="quantity" string="Cantidad"/>
+					<field name="subtotal_venta" string="SubTotal" sum="st"/>
+					<field name="location_id" invisible="1"/>
+				</tree>
+            </field>
+        </record>
+				
+		<record id="action_report_stockgral_tree_view" model="ir.actions.act_window">
+            <field name="name">Listado General de Stock</field>
+            <field name="res_model">report.stockgral1</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree</field>
+        </record>
+				
+		<menuitem name="Stock" sequence="47" id="stock_gral_menu" parent="base.menu_reporting"/>
+		<menuitem id="menu_gral_stock" name="Listado General de Stock" parent="stock_gral_menu" action="action_report_stockgral_tree_view"/>
+		
+	</data>	
+</openerp>

+ 67 - 0
informe_stockgralxcliente.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+		<template id="report_posgralxcliente">
+			<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 Pos por cliente</h4>
+						<div class="logo1" />
+						 
+						  <table class="table table-condensed">
+							<thead class="crm_tcab">
+								<tr class="active">
+									<th>Cliente</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.product_qty"/>
+										</td> 
+										<td class="text-right">
+											<span t-field="o.price_total"/>
+										</td>
+									</tr>	
+							</tbody>
+							</t>
+						  </table>
+						  
+					</div>
+				</t>
+			</t>
+		</template>
+	</data>
+</openerp> 
+
+                        
+                                       
+                                    

+ 79 - 0
report_stockgral.py

@@ -0,0 +1,79 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp import tools
+from openerp.osv import fields, osv
+
+class report_stockgral1(osv.osv):
+    """
+    Quants are the smallest unit of stock physical instances
+    """
+    _name = "report.stockgral1"
+    _description = "Stockgral"
+    _auto = False
+    _columns = {
+		'product_id': fields.many2one('product.product', 'Product', required=True, select=True, readonly=True),
+		'unit_price': fields.float('Precio Venta', readonly=True),
+		'quantity': fields.float('Cantidad', readonly=True),
+		'subtotal_venta': fields.float('Subtotal', readonly=True),
+		'location_id': fields.many2one('stock.location', 'Ubicacion',  readonly=True),
+		'categ_id': fields.many2one('product.category', 'Categoria', readonly=True),
+		'brand_id': fields.many2one('product.brand', 'Marca', readonly=True),
+		'factory_reference': fields.char('Referencia', readonly=True),
+		'genre_id': fields.many2one('product.genre', 'Genero', readonly=True),
+        'parent_id': fields.many2one('product.category', 'Categoria Padre', readonly=True),
+        'id_parent' : fields.many2one('product.category', 'Categoria Padre', readonly=True),
+    }
+    _order = 'product_id desc'
+
+    def init(self, cr):
+		tools.sql.drop_view_if_exists(cr, 'report_stockgral1')
+		cr.execute("""
+            CREATE OR REPLACE VIEW report_stockgral1 as (
+                SELECT	s.id as id,
+                        s.product_id as product_id,
+                        pt.list_price as unit_price,
+                        SUM(s.qty) as quantity,
+                        SUM(s.qty) * SUM(pt.list_price) as subtotal_venta,
+                        pt.product_brand_id as brand_id,
+                        pt.product_genre_id as genre_id,
+                        pt.categ_id as categ_id,
+                        pt.factory_reference as factory_reference,
+                        r.id as location_id,
+                        g.parent_id as parent_id,
+                        pcc.id_parent as id_parent
+                FROM stock_quant s
+                        left join stock_location r on (r.id=s.location_id)
+                        left join product_product p on (p.id=s.product_id)
+                        left join product_template pt on (pt.id=p.product_tmpl_id)
+                            left join product_brand z on (pt.product_brand_id=z.id)
+                            left join product_genre t on (pt.product_genre_id=t.id)
+                            left join product_category g on (g.id=pt.categ_id)
+                        left join product_uom u on (u.id=pt.uom_id)
+                        left join (SELECT pp.id, pp.parent_id,
+                          case when (select ppp.parent_id from product_category ppp where ppp.id= pp.parent_id and ppp.parent_id !=1) is NULL
+                          then pp.parent_id  ELSE
+                          (select ppp.parent_id from product_category ppp where ppp.id= pp.parent_id and ppp.parent_id !=1) END as id_parent
+                    from product_category pp) as pcc on pcc.id = pt.categ_id
+                WHERE r.usage='internal' and  s.qty>0 and  pt.active=True
+                GROUP BY s.id,s.product_id,r.id,pt.product_brand_id,pt.factory_reference,pt.categ_id,pt.product_genre_id,pt.list_price, g.parent_id,pcc.id_parent)
+		""")
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

binární
report_stockgral.pyc


binární
static/description/icon.png


+ 62 - 0
stockgral_filter_view.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+    <!-- <record id="view_order_product_graph1" model="ir.ui.view">
+         <field name="name">sale.report.graph1</field>
+         <field name="model">sale.reportgral</field>
+         <field name="arch" type="xml">
+             <graph string="Sales Analysis1" type="pivot" stacked="True">
+                 <field name="section_id" type="row"/>
+                 <field name="date" interval="month" type="col"/>
+                 <field name="price_total" type="measure"/>
+             </graph>
+         </field>
+    </record>  -->
+
+    <!-- Custom reports (aka filters) -->
+    <record id="filter_stockgral_report_loc" model="ir.filters">
+        <field name="name">Por Location</field>
+        <field name="model_id">report.stockgral1</field>
+        <field name="user_id" eval="False"/>
+        <field name="context">{'group_by': ['location_id']}</field>
+    </record>
+	<record id="filter_stockgral_report_producto" model="ir.filters">
+        <field name="name">Por Producto</field>
+        <field name="model_id">report.stockgral1</field>
+        <field name="user_id" eval="False"/>
+        <field name="context">{'group_by': ['product_id']}</field>
+    </record>
+
+
+    <record id="view_order_stockgral_search1" model="ir.ui.view">
+        <field name="name">stock.stockgral.search</field>
+        <field name="model">report.stockgral1</field>
+        <field name="arch" type="xml">
+            <search string="Analysis">
+              <!--Filtar por categorias padres  -->
+              <filter string="Accesorios" icon="terp-accessories-archiver" domain="[('id_parent','=',6)]"/>
+              <filter string="Ropas" icon="terp-accessories-archiver" domain="[('id_parent','=',5)]"/>
+              <filter string="Calzados" icon="terp-accessories-archiver" domain="[('id_parent','=',4)]"/>
+              <filter string="Pelotas" icon="terp-accessories-archiver" domain="[('id_parent','=',30)]"/>
+
+				       <field name="brand_id"/>
+				       <field name="genre_id"/>
+               <field name="categ_id"/>
+               <field name="product_id"/>
+               <field name="parent_id"/>
+               <group expand="1" string="Group By">
+                  <filter string="Marca" name="Marca" context="{'group_by':'brand_id'}"/>
+					        <filter string="Genero" name="Genero" context="{'group_by':'genre_id'}"/>
+                  <filter string="Categoria" name="Categoria" context="{'group_by':'categ_id'}"/>
+                  <filter string="Producto" name="Producto" context="{'group_by':'product_id'}"/>
+                  <filter string="Categoria Padre" name="Categoria Padre" context="{'group_by':'parent_id'}"/>
+               </group>
+            </search>
+        </field>
+    </record>
+
+   <!--  <menuitem action="action_order_report_all" id="menu_report_product_all" parent="base.next_id_64" sequence="10"/> -->
+
+</data>
+</openerp>

+ 12 - 0
stockgral_report.xml

@@ -0,0 +1,12 @@
+<!-- <?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+		<report id="report_ventasgral6"
+            model="report.stockgral1"
+            string="Listado General"
+            report_type="qweb-html"
+            name="report_stockgral.informe_stock_general_view"
+            file="report_stockgral.informe_stock_general_view"
+        />
+    </data>
+</openerp> -->