Browse Source

commit filter_project

sebas 8 years ago
commit
98d9d298a1
7 changed files with 103 additions and 0 deletions
  1. 6 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 51 0
      __openerp__.py
  4. 8 0
      project.py
  5. BIN
      project.pyc
  6. BIN
      static/description/icon.png
  7. 38 0
      view/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

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 Proyectos",
+    '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_test_activity que permite filtrar por actividades de etapas, responsable y mes de realizacion
+""",
+    'depends': [
+        'project','project_task_activity',
+    ],
+    'external_dependencies': {
+    },
+    'data': [
+        'view/project_view.xml'
+    ],
+    'demo': [
+    ],
+    'test': [
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

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


BIN
static/description/icon.png


+ 38 - 0
view/project_view.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_project_task_activity_search1" model="ir.ui.view">
+            <field name="name">project.task_activity.search1</field>
+            <field name="model">project.task.activity</field>
+            <field name="inherit_id" ref="project_task_activity.view_project_task_activity_search" />
+            <field name="arch" type="xml">
+                <search string="Activity">
+                    <field name="name"/>
+                    <field name="user_id"/>
+                    <field name="task_id"/>
+                    <field name="project_id"/>
+                    <field name="state"/>
+                    <filter string="Mis Actividades" domain="[('user_id','=',uid)]"/>
+                    <filter string="No Asignados" name="unassigned" domain="[('user_id', '=', False)]"/>
+                    <separator/>
+                    <filter string="Pendiente" name="pending" domain="[('state', '=', 'pending')]"/>
+                    <filter string="Realizado" name="done" domain="[('state', '=', 'done')]"/>
+                    <filter string="Cancelado" name="cancel" domain="[('state', '=', 'cancel')]"/>
+                    <filter string="Realizados hoy" domain="[('done_date', '&gt;=', datetime.datetime.now().strftime('%Y-%m-%d 00:00:00')),('done_date', '&lt;=',datetime.datetime.now().strftime('%Y-%m-%d 23:23:59'))]"/>
+                    <filter string="Realizados semana anterior" domain="[('done_date', '&gt;=', ((context_today()+relativedelta(weeks=-2, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('done_date', '&lt;=', ((context_today()+relativedelta(weeks=-1, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
+                    <filter string="Realizados esta semana" domain="[('done_date', '&gt;=', ((context_today()+relativedelta(weeks=-1, days=1, weekday=0)).strftime('%%Y-%%m-%%d'))),('done_date', '&lt;=', ((context_today()+relativedelta(weeks=0, weekday=6)).strftime('%%Y-%%m-%%d')))]"/>
+                    <group expand="0" string="">
+                        <filter string="Responsable" name="User" context="{'group_by':'user_id'}"/>
+                        <filter string="Estado" name="state" context="{'group_by':'state'}"/>
+                        <filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
+                        <separator/>
+                        <filter string="Mes de asignacion" context="{'group_by':'planned_date:month'}" help="Fecha Planeado"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>