- [[ line.code ]]
+ [[ line.product_id and line.product_id.default_code or '' ]]
[[ line.name ]]
|
diff --git a/addons/report_timesheet/__init__.py b/addons/report_timesheet/__init__.py
new file mode 100644
index 00000000000..8aa10ca5c9c
--- /dev/null
+++ b/addons/report_timesheet/__init__.py
@@ -0,0 +1,30 @@
+##############################################################################
+#
+# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id: timesheet.py 1005 2005-07-25 08:41:42Z nicoe $
+#
+# 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 report_timesheet
diff --git a/addons/report_timesheet/__terp__.py b/addons/report_timesheet/__terp__.py
new file mode 100644
index 00000000000..e20243125d0
--- /dev/null
+++ b/addons/report_timesheet/__terp__.py
@@ -0,0 +1,13 @@
+{
+ "name" : "Timesheet - Reporting",
+ "version" : "1.0",
+ "author" : "Tiny",
+ "website" : "http://tinyerp.com",
+ "depends" : ["hr_timesheet",'hr_timesheet_invoice'],
+ "category" : "Generic Modules/Human ressources",
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : ["report_timesheet_view.xml"],
+ "active": False,
+ "installable": True
+}
diff --git a/addons/report_timesheet/report_timesheet.py b/addons/report_timesheet/report_timesheet.py
new file mode 100644
index 00000000000..005b88f0b2a
--- /dev/null
+++ b/addons/report_timesheet/report_timesheet.py
@@ -0,0 +1,99 @@
+##############################################################################
+#
+# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id: sale.py 1005 2005-07-25 08:41:42Z nicoe $
+#
+# 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.
+#
+##############################################################################
+
+from osv import fields,osv
+
+class report_timesheet_user(osv.osv):
+ _name = "report_timesheet.user"
+ _description = "Timesheet per day"
+ _auto = False
+ _columns = {
+ 'name': fields.date('Date', readonly=True),
+ 'user_id':fields.many2one('res.users', 'User', readonly=True, relate=True),
+ 'quantity': fields.float('Quantity', readonly=True),
+ 'cost': fields.float('Cost', readonly=True)
+ }
+ _order = 'name desc,user_id desc'
+ def init(self, cr):
+ cr.execute("""
+ create or replace view report_timesheet_user as (
+ select
+ min(l.id) as id,
+ l.date as name,
+ l.user_id,
+ sum(l.unit_amount) as quantity,
+ sum(l.amount) as cost
+ from
+ account_analytic_line l
+ where
+ user_id is not null
+ group by l.date, l.user_id
+ )
+ """)
+report_timesheet_user()
+
+class report_timesheet_invoice(osv.osv):
+ _name = "report_timesheet.invoice"
+ _description = "Costs to invoice"
+ _auto = False
+ _columns = {
+ 'user_id':fields.many2one('res.users', 'User', readonly=True, relate=True),
+ 'project_id':fields.many2one('res.users', 'User', readonly=True, relate=True),
+ 'manager_id':fields.many2one('res.users', 'User', readonly=True, relate=True),
+ 'quantity': fields.float('Quantity', readonly=True),
+ 'amount_invoice': fields.float('To invoice', readonly=True)
+ }
+ _rec_name = 'user_id'
+ _order = 'name desc,user_id desc'
+ def init(self, cr):
+ cr.execute("""
+ create or replace view report_timesheet_invoice as (
+ select
+ min(l.id) as id,
+ l.user_id as user_id,
+ l.account_id as account_id,
+ a.user_id as manager_id,
+ sum(l.unit_amount) as quantity,
+ sum(l.unit_amount * t.list_price) as revenue
+ from account_analytic_line l
+ left join hr_timesheet_invoice_factor f on (l.to_invoice=f.id)
+ left join account_analytic_account a on (l.account_id=a.id)
+ left join product_product p on (l.to_invoice=f.id)
+ left join product_template t on (l.to_invoice=f.id)
+ where
+ l.to_invoice is not null and
+ l.invoice_id is null
+ group by
+ l.user_id,
+ l.account_id,
+ a.user_id
+ )
+ """)
+report_timesheet_invoice()
+
diff --git a/addons/report_timesheet/report_timesheet_view.xml b/addons/report_timesheet/report_timesheet_view.xml
new file mode 100644
index 00000000000..83d905d6727
--- /dev/null
+++ b/addons/report_timesheet/report_timesheet_view.xml
@@ -0,0 +1,142 @@
+
+
+
+
+ #
+ # Statistics report on timesheet by user
+ #
+
+
+ report_timesheet.user.graph
+ report_timesheet.user
+ graph
+
+
+
+
+
+
+
+
+
+
+ report_timesheet.timesheet.user.form
+ report_timesheet.user
+ form
+
+
+
+
+
+
+
+ report_timesheet.timesheet.user.tree
+ report_timesheet.user
+ tree
+
+
+
+
+
+
+
+
+
+
+
+ report_timesheet.user.tree
+ report_timesheet.user
+ form
+ tree,graph
+ [('name','>=',time.strftime('%Y-%m-01'))]
+
+
+
+
+ report_timesheet.user.tree.all
+ report_timesheet.user
+ form
+ tree,graph
+
+
+
+ #
+ # Statistics report on timesheets to invoice
+ #
+
+
+ report_timesheet.invoice.graph
+ report_timesheet.invoice
+ graph
+
+
+
+
+
+
+
+
+
+
+ report_timesheet.timesheet.invoice.form
+ report_timesheet.invoice
+ form
+
+
+
+
+
+
+
+ report_timesheet.timesheet.invoice.tree
+ report_timesheet.invoice
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+ report_timesheet.invoice.tree.all
+ report_timesheet.invoice
+ form
+ tree,graph
+
+
+
+
+ report_timesheet.invoice.tree
+ report_timesheet.invoice
+ form
+ tree,graph
+ [('manager_id','=',uid)]
+
+
+
+
+
diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml
index 66b71453bcf..7e33c8dad6e 100644
--- a/addons/sale/report/order.rml
+++ b/addons/sale/report/order.rml
@@ -24,7 +24,6 @@
-
@@ -59,19 +58,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -117,9 +117,9 @@
- Tél. : [[ o.partner_order_id.phone or '' ]]
+ Tel. : [[ o.partner_order_id.phone or '' ]]
Fax : [[ o.partner_order_id.fax or '' ]]
- TVA : [[ o.partner_id.vat or '' ]]
+ VAT : [[ o.partner_id.vat or '' ]]
|