Explorar o código

Este modulo es una extension del modulo stock_inventory que permite filtrar por dia, semana, semana pasada y agrupar por fecha.

SEBAS hai 2 días
achega
ad98da8fac
Modificáronse 7 ficheiros con 95 adicións e 0 borrados
  1. 6 0
      __init__.py
  2. BIN=BIN
      __init__.pyc
  3. 51 0
      __openerp__.py
  4. BIN=BIN
      static/description/icon.png
  5. 8 0
      stkinventory.py
  6. BIN=BIN
      stkinventory.pyc
  7. 30 0
      view/stkinventory_view.xml

+ 6 - 0
__init__.py

@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in module root
+# directory
+##############################################################################
+from . import stkinventory

BIN=BIN
__init__.pyc


+ 51 - 0
__openerp__.py

@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2015  ADHOC SA  (http://www.adhoc.com.ar)
+#    All Rights Reserved.
+#
+#    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": "Filtros para ajuste de inventario",
+    'version': '8.0.0.1.0',
+    'category': 'Tools',
+    'sequence': 14,
+    'author':  'Sebastian Penayo/Eiru',
+    'website': '',
+    'license': 'AGPL-3',
+    'summary': '',
+    'description': """
+Filtros de Stock Inventory
+==========================
+Este modulo es una extension del modulo stock_inventory que permite filtrar por dia, semana, semana pasada y agrupar por fecha.
+""",
+    'depends': [
+        'stock',
+    ],
+    'external_dependencies': {
+    },
+    'data': [
+        'view/stkinventory_view.xml'
+    ],
+    'demo': [
+    ],
+    'test': [
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN=BIN
static/description/icon.png


+ 8 - 0
stkinventory.py

@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in module root
+# directory
+##############################################################################
+from openerp import models, api, fields, _
+from datetime import datetime
+import json

BIN=BIN
stkinventory.pyc


+ 30 - 0
view/stkinventory_view.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <!-- Crear una nueva vista de búsqueda -->
+        <record id="view_inventory_search_filter" model="ir.ui.view">
+            <field name="name">stock.inventory.search.filter</field>
+            <field name="model">stock.inventory</field>
+              <field name="inherit_id" ref="stock.view_inventory_filter" />
+            <field name="arch" type="xml">
+                <search>
+                  <separator/>
+                  <filter string="Este año" name="year" domain="[('date','&lt;=', time.strftime('%%Y-12-31')),('date','&gt;=',time.strftime('%%Y-01-01'))]"/>
+                  <filter string="Año pasado  " domain="[('date','&gt;=',(context_today()-relativedelta(years=1)).strftime('%%Y-01-01')),('date','&lt;=', time.strftime('%%Y-01-01'))]"/>
+                  <filter string="Mes actual" domain="[('date','&lt;',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date','&gt;=',time.strftime('%%Y-%%m-01'))]"/>
+                  <filter string="Mes pasado" domain="[('date','&gt;=',(context_today()-relativedelta(months=1)).strftime('%%Y-%%m-01')),('date','&lt;',time.strftime('%%Y-%%m-01'))]"/>
+                  <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')))]"/>
+                  <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=" Ayer " domain="[('date','&lt;=', (datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d')),('date','&gt;=',(datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
+                  <separator/>
+                    <group string="Agrupar por">
+                        <filter string="Por deposito" context="{'group_by':'location_id'}"/>
+                        <filter string="Por dia" context="{'group_by':'date:month'}"/>
+                        <filter string="Por estado" context="{'group_by':'state'}"/>
+                      </group>
+                </search>
+            </field>
+        </record>
+    </data>
+</openerp>