Pārlūkot izejas kodu

NEW lista de precio golden

Sebas 7 gadi atpakaļ
revīzija
1f73ac95d2

+ 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 report_productlist
+
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
__init__.pyc


+ 55 - 0
__openerp__.py

@@ -0,0 +1,55 @@
+# -*- 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': 'Lista de precios de productos',
+    'version': '1.0',
+    'category': 'Listado de lista de precios de productos',
+    'sequence': 2,
+    'summary': 'Product',
+    'description': """
+
+Lista de precios de productos
+====================================================
+
+Módulo que permite la impresión del Listado de lista de precios de productos.
+
+""",
+    'author': 'Sebastian Penayo/Eiru Software',
+    'website': 'https://www.eiru.com.py',
+    'depends': [
+        'base',
+    ],
+    'data': [
+        'report_productlist_view.xml',
+        'report_productlist_filter.xml',
+		'report_productlist.xml',
+    ],
+    'demo': [
+    ],
+    'test': [
+    ],
+    'installable': True,
+    'application': True,
+    'auto_install': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 65 - 0
report_productlist.py

@@ -0,0 +1,65 @@
+# -*- 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
+from datetime import datetime
+
+
+class report_productlist(osv.osv):
+    _name = "report.productlist"
+    _description = "Lista de Precios"
+    _auto = False
+    _rec_name = 'product_id'
+
+    _columns = {
+        'product_id': fields.many2one('product.product', 'Producto', readonly=True),
+        'name_template': fields.char('Descripción', readonly=True),
+        'list_price': fields.char('Lista de Precio', readonly=True),
+        'price_surcharge': fields.float('Precio', readonly=True),
+        'company_id': fields.many2one('res.company', 'Compañia', readonly=True),
+    }
+    _order = 'id desc'
+
+    def init(self, cr):
+        tools.drop_view_if_exists(cr, 'report_productlist')
+        cr.execute("""
+                create or replace view report_productlist as (
+        			SELECT row_number() over (ORDER BY pl.id) as id,
+                            po.id AS product_id,
+                            po.name_template AS name_template,
+                            pv.name as list_price,
+                            pl.price_surcharge as price_surcharge,
+                            pt.company_id
+                    from product_pricelist_item pl
+			                LEFT JOIN product_product po ON po.id = pl.product_tmpl_id
+				                LEFT JOIN product_template pt ON pt.id = po.product_tmpl_id
+	                        LEFT JOIN product_pricelist_version pv ON pv.id = pl.price_version_id
+		            where pv.price_grid = True and pl.price_surcharge>0 and po.name_template <> ''
+                    GROUP BY pl.id,
+                            po.id,
+                            po.name_template,
+                            pv.name,
+			                pl.price_surcharge,
+                            pt.company_id)
+    """)
+
+    # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
report_productlist.pyc


+ 78 - 0
report_productlist.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+        <report
+            id="report_productlist_id"
+            string="Listado de Precio de Productos"
+            model="report.productlist"
+            report_type="qweb-pdf"
+            file="report_product_list.report_productlist"
+            name="report_product_list.report_productlist"
+        />
+  <template id="report_productlist">
+    <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;
+                        }
+
+                        .crmc_tbody{
+                            font-size: 2.8mm;
+                            font-family: Arial, Helvetica, sans-serif;
+                        }
+                        .taxtotal{
+                            font-size: 2.8mm;
+                        }
+						.total{
+                            font-size: 2.8mm;
+                        }
+						.untotal{
+                            font-size: 2.8mm;
+                        }
+						.logo1{
+                            width: 100%;
+                            top: 1.5cm;
+                        }
+
+				</style>
+			   <h4 class="text-center">Listado de precios de Producto</h4>
+               <div class="logo1"> </div>
+			   <table class="table table-bordered">
+				<thead class="crm_tcab">
+					<tr class="active">
+                        <th class="text-left">Codigo</th>
+                        <th class="text-left">Descripcion</th>
+                        <th class="text-left">Lista de Precio</th>
+						<th class="text-left">Precio</th>
+                        <th class="text-left">Compañia</th>
+                    </tr>
+                </thead>
+               <t t-foreach="docs" t-as="o">
+                <tbody class="crmc_tbody">
+                        <td class="text-left">
+                            <span t-field="o.product_id"/>
+                        </td>
+                        <td class="text-left">
+                            <span t-field="o.name_template"/>
+                        </td>
+						<td class="text-left">
+                            <span t-field="o.list_price"/>
+                        </td>
+						<td class="text-right">
+                            <span t-field="o.price_surcharge"/>
+                        </td>
+                        <td class="text-left">
+                            <span t-field="o.company_id"/>
+                        </td>
+                </tbody>
+               </t>
+             </table>
+            </div>
+          </t>
+    </t>
+  </template>
+</data>
+</openerp>

+ 34 - 0
report_productlist_filter.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+  <!-- Custom reports (aka filters) -->
+  <record id="filter_report_product_funnel" model="ir.filters">
+      <field name="name">Por Compañia</field>
+      <field name="model_id">report.productlist</field>
+      <field name="domain">[]</field>
+      <field name="user_id" eval="False"/>
+      <field name="context">{'group_by': ['company_id']}</field>
+  </record>
+
+
+    <record id="view_product_report_search" model="ir.ui.view">
+        <field name="name">invoice.product.report.search</field>
+        <field name="model">report.productlist</field>
+        <field name="arch" type="xml">
+            <search string="Lista de precios">
+                <field name="product_id" operator="child_of"/>
+                <field name="company_id"/>
+                <field name="list_price"/>
+                <group expand="1" string="Agrupar por">
+                    <filter string="Producto" name="product_id" context="{'group_by':'product_id'}"/>
+                    <filter string="Compania" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
+
+                </group>
+            </search>
+        </field>
+    </record>
+
+
+</data>
+</openerp>

+ 50 - 0
report_productlist_view.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record id="report_productlist_tree_view" model="ir.ui.view">
+            <field name="name">report.productlist.tree.view</field>
+            <field name="model">report.productlist</field>
+            <field name="priority" eval="20"/>
+            <field name="arch" type="xml">
+                <tree string="Listado de Precios de Productos" create="false">
+                    <field name="product_id"/>
+                    <field name="name_template"/>
+                    <field name="list_price"/>
+                    <field name="price_surcharge"/>
+                    <field name="company_id"/>
+                </tree>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="productlist_analisis_form">
+            <field name="name">Listado de Precios de Productos</field>
+            <field name="model">report.productlist</field>
+            <field name="view_type">form</field>
+            <field eval="20" name="priority"/>
+            <field name="arch" type="xml">
+                <form string="Listado de Precios de Productos" create="false" edit="false">
+                    <group>
+                        <field name="product_id"/>
+                        <field name="name_template"/>
+                        <field name="list_price"/>
+                        <field name="price_surcharge"/>
+                        <field name="company_id"/>
+                    </group>
+                </form>
+            </field>
+        </record>
+
+        <record id="action_report_productlist_tree_view" model="ir.actions.act_window">
+            <field name="name">Listado de Precios de Productos</field>
+            <field name="res_model">report.productlist</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+        </record>
+
+        <menuitem name="Lista de precios por producto" action="action_report_productlist_tree_view"
+               id="menu_product_list_action_form"
+               parent="base.menu_product" sequence="90"/>
+
+
+    </data>
+</openerp>

BIN
static/description/icon.png