Преглед изворни кода

commit project_project_filter

sebas пре 8 година
комит
501c6dceec
7 измењених фајлова са 100 додато и 0 уклоњено
  1. 6 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 51 0
      __openerp__.py
  4. 8 0
      project_project.py
  5. BIN
      project_project.pyc
  6. BIN
      static/description/icon.png
  7. 35 0
      view/project_project_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 project_project


+ 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 Proyectos Principal",
+    'version': '8.0.0.1.0',
+    'category': 'Tools',
+    'sequence': 14,
+    'author':  'Sebastian Penayo/Eiru',
+    'website': '',
+    'license': 'AGPL-3',
+    'summary': '',
+    'description': """
+Filtros de Proyectos
+=====================
+Este modulo es una extension del modulo projet_project que permite filtrar por proyectos creados por semana, dia y mes de realizacion
+""",
+    'depends': [
+        'project',
+    ],
+    'external_dependencies': {
+    },
+    'data': [
+        'view/project_project_view.xml'
+    ],
+    'demo': [
+    ],
+    'test': [
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 8 - 0
project_project.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
project_project.pyc


BIN
static/description/icon.png


+ 35 - 0
view/project_project_view.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_project_project_search1" model="ir.ui.view">
+            <field name="name">project.project_activity.search1</field>
+            <field name="model">project.project</field>
+            <field name="inherit_id" ref="project.view_project_project_filter" />
+            <field name="arch" type="xml">
+                <search>
+                    <separator/>
+                    <filter string="Este año" name="year" domain="[('date_start','&lt;=', time.strftime('%%Y-12-31')),('date_start','&gt;=',time.strftime('%%Y-01-01'))]"/>
+                    <filter string="Año pasado  " domain="[('date_start'','&gt;=',(context_today()-relativedelta(years=1)).strftime('%%Y-01-01')),('date_start','&lt;=', time.strftime('%%Y-01-01'))]"/>
+                    <filter string="Mes actual" domain="[('date_start'','&lt;',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date_start','&gt;=',time.strftime('%%Y-%%m-01'))]"/>
+                    <filter string="Mes pasado" domain="[('date_start'','&gt;=',(context_today()-relativedelta(months=1)).strftime('%%Y-%%m-01')),('date_start','&lt;',time.strftime('%%Y-%%m-01'))]"/>
+                    <filter string="Iniciado semana anterior" domain="[('date_start'', '&gt;=', ((context_today()+relativedelta(weeks=-2, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('date_start', '&lt;=', ((context_today()+relativedelta(weeks=-1, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
+                    <filter string="Iniciado esta semana" domain="[('date_start'', '&gt;=', ((context_today()+relativedelta(weeks=-1, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('date_start', '&lt;=', ((context_today()+relativedelta(weeks=0, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
+                    <filter string="Iniciado hoy" domain="[('date_start', '&gt;=', datetime.datetime.now().strftime('%Y-%m-%d 00:00:00')),('date_start', '&lt;=',datetime.datetime.now().strftime('%Y-%m-%d 23:23:59'))]"/>
+                    <filter string="Iniciado ayer" domain="[('date_start','&lt;=', (datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d')),('date_start','&gt;=',(datetime.date.today()-relativedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
+                    <group expand="0" string="">
+                        <filter string="Estado" name="state" context="{'group_by':'state'}"/>
+                        <filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
+                        <filter string="Responsable" context="{'group_by':'user_id'}" groups="base.group_multi_company"/>
+                        <filter string="Cliente" context="{'group_by':'partner_id'}" groups="base.group_multi_company"/>
+                        <separator/>
+                        <filter string="Mes de Inicio" context="{'group_by':'date_start:month'}" help="Mes Inicio"/>
+                        <filter string="Por dia de inicio" context="{'group_by':'date_start:day'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>