Browse Source

commit filter_accountvoucher

sebas 8 years ago
commit
4865318d23
7 changed files with 111 additions and 0 deletions
  1. 6 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 51 0
      __openerp__.py
  4. 18 0
      account_voucherfilter.py
  5. BIN
      account_voucherfilter.pyc
  6. BIN
      static/description/icon.png
  7. 36 0
      view/account_voucher_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 account_voucherfilter

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 de Facturas por Monedas y Diario para Voucher",
+    'version': '8.0.0.1.0',
+    'category': 'Tools',
+    'sequence': 14,
+    'author':  'Sebastian Penayo/Eiru',
+    'website': '',
+    'license': 'AGPL-3',
+    'summary': '',
+    'description': """
+Filtros de Pago por Monedas y Diario para Voucher
+==============================
+Este modulo es una extension del modulo account_voucher que permite filtrar por monedas y filtrar por diario.
+""",
+    'depends': [
+        'account_voucher',
+    ],
+    'external_dependencies': {
+    },
+    'data': [
+        'view/account_voucher_view.xml'
+    ],
+    'demo': [
+    ],
+    'test': [
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 18 - 0
account_voucherfilter.py

@@ -0,0 +1,18 @@
+# -*- 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
+
+# class account_invoice(models.Model):
+#    _inherit = 'account.invoice'
+
+#    date_month = fields.Char(string='Date Month',compute='_get_date_month',store=True,readonly=True)
+
+#    @api.one
+#    @api.depends('date_invoice')
+#    def _get_date_month(self):
+#        self.date_month = datetime.strptime(self.date_invoice,'%Y-%m-%d').strftime('%m')

BIN
account_voucherfilter.pyc


BIN
static/description/icon.png


+ 36 - 0
view/account_voucher_view.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_account_voucherfilter_search1" model="ir.ui.view">
+            <field name="name">account.voucher.filter.search1</field>
+            <field name="model">account.voucher</field>
+            <field name="inherit_id" ref="account_voucher.view_voucher_filter_customer_pay"/>
+            <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'))]"/>
+                  <filter string="Guarani" name="payment_rate_currency_id" domain="[('payment_rate_currency_id','=','PYG')]"/>
+                  <filter string="Dolar" name="payment_rate_currency_id" domain="[('payment_rate_currency_id','=','USD')]"/>
+                  <filter string="Real" name="payment_rate_currency_id" domain="[('payment_rate_currency_id','=','BRL')]"/>
+                  <filter string="Peso" name="payment_rate_currency_id" domain="[('payment_rate_currency_id','=','ARS')]"/>
+                  <separator/>
+                  <group string="Agrupar por">
+                      <filter string="Journal" context="{'group_by':'journal_id'}"/>
+                      <filter string="Por dia" context="{'group_by':'date:day'}"/>
+                      <filter string="Por Mes" context="{'group_by':'date:month'}"/>
+                  </group>
+               </search>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>