diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 7483cad9aa0..1db082ac151 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -418,6 +418,7 @@
Draft Customer Invoices
account.invoice
form
+ tree,form,calendar,graph
[('state','=','draft'),('type','=','out_invoice')]
{'type':'out_invoice'}
@@ -439,6 +440,7 @@
PRO-FORMA Customer Invoices
account.invoice
form
+ tree,form,calendar,graph
[('state','=','proforma'),('type','=','out_invoice')]
{'type':'out_invoice'}
@@ -460,6 +462,7 @@
Unpaid Customer Invoices
account.invoice
form
+ tree,form,calendar,graph
[('state','!=','draft'),('reconciled','=',False),('type','=','out_invoice')]
{'type':'out_invoice'}
@@ -481,6 +484,7 @@
Draft Supplier Invoices
account.invoice
form
+ tree,form,calendar,graph
[('state','=','draft'),('type','=','in_invoice')]
{'type':'in_invoice'}
@@ -502,6 +506,7 @@
Unpaid Supplier Invoices
account.invoice
form
+ tree,form,calendar,graph
[('state','!=','draft'),('reconciled','=',False),('type','=','in_invoice')]
{'type':'in_invoice'}
@@ -523,6 +528,7 @@
Draft Customer Refunds
account.invoice
form
+ tree,form,calendar,graph
[('state','=','draft'),('type','=','out_refund')]
{'type':'out_refund'}
@@ -544,6 +550,7 @@
Unpaid Customer Refunds
account.invoice
form
+ tree,form,calendar,graph
[('state','!=','draft'),('reconciled','=',False),('type','=','out_refund')]
{'type':'out_refund'}
@@ -565,6 +572,7 @@
Draft Supplier Refunds
account.invoice
form
+ tree,form,calendar,graph
[('state','=','draft'),('type','=','in_refund')]
{'type':'in_refund'}
@@ -586,6 +594,7 @@
Unpaid Supplier Refunds
account.invoice
form
+ tree,form,calendar,graph
[('state','!=','draft'),('reconciled','=',False),('type','=','in_refund')]
{'type':'in_refund'}
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 5178b07eea8..45a4307a6c9 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -150,7 +150,9 @@
form
-
+
+
+
@@ -238,7 +240,7 @@
#
- account.analytic.journal.open.form
+ Entries of Open Analytic Journals
account.analytic.line
form
tree,form
diff --git a/addons/account/project/wizard/__init__.py b/addons/account/project/wizard/__init__.py
index 0e66d867caa..477e5262a00 100644
--- a/addons/account/project/wizard/__init__.py
+++ b/addons/account/project/wizard/__init__.py
@@ -34,6 +34,7 @@ import wizard_account_analytic_inverted_balance_report
import wizard_account_analytic_cost_ledger_report
import wizard_account_analytic_cost_ledger_for_journal_report
import wizard_account_analytic_analytic_check
+import wizard_account_analytic_line
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/project/wizard/wizard_account_analytic_line.py b/addons/account/project/wizard/wizard_account_analytic_line.py
new file mode 100644
index 00000000000..143737ab153
--- /dev/null
+++ b/addons/account/project/wizard/wizard_account_analytic_line.py
@@ -0,0 +1,86 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+import pooler
+import time
+
+def _action_open_window(self, cr, uid, data, context):
+ domain=[]
+ from_date= data['form']['from_date']
+ to_date=data['form']['to_date']
+ if from_date and to_date:
+ domain=[('date','>=',from_date),('date','<=',to_date)]
+ elif from_date:
+ domain=[('date','>=',from_date)]
+ elif to_date:
+ domain=[('date','<=',to_date)]
+ return {
+ 'name': 'Analytic Entries',
+ 'view_type': 'form',
+ "view_mode": 'tree,form',
+ 'res_model': 'account.analytic.line',
+ 'type': 'ir.actions.act_window',
+ 'domain': domain}
+
+
+class account_analytic_line(wizard.interface):
+ form1 = '''
+ '''
+ form1_fields = {
+ 'from_date': {
+ 'string': 'From',
+ 'type': 'date',
+ },
+ 'to_date': {
+ 'string': 'To',
+ 'type': 'date',
+ },
+ }
+
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Entries','gtk-ok')]}
+ },
+ 'open': {
+ 'actions': [],
+ 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
+ }
+ }
+account_analytic_line('account.analytic.line')
diff --git a/addons/process/process.py b/addons/process/process.py
index 49f6c8dc83a..1a0024af4b1 100644
--- a/addons/process/process.py
+++ b/addons/process/process.py
@@ -63,6 +63,29 @@ class process_process(osv.osv):
'active' : lambda *a: True,
}
+ def search_by_model(self, cr, uid, res_model, context):
+ pool = pooler.get_pool(cr.dbname)
+
+ model_ids = pool.get('ir.model').search(cr, uid, [('model', '=', res_model)])
+ if not model_ids:
+ return []
+
+ nodes = pool.get('process.node').search(cr, uid, [('model_id', 'in', model_ids)])
+ if not nodes:
+ return []
+
+ nodes = pool.get('process.node').browse(cr, uid, nodes, context)
+
+ unique = []
+ result = []
+
+ for node in nodes:
+ if node.process_id.id not in unique:
+ result.append((node.process_id.id, node.process_id.name))
+ unique.append(node.process_id.id)
+
+ return result
+
def graph_get(self, cr, uid, id, res_model, res_id, scale, context):
pool = pooler.get_pool(cr.dbname)