From 3ef65d7f9313137558622e105f44cac3cd3dbd15 Mon Sep 17 00:00:00 2001 From: pinky <> Date: Thu, 14 Dec 2006 14:35:24 +0000 Subject: [PATCH] Improvement of the L10n_fr account_chart Dashboards Type in PO orders bzr revid: pinky-d9b12f1707823e9b9a46ffee459fd90aedce8e3e --- addons/account/project/project.py | 1 + addons/account/project/project_view.xml | 1 + addons/board_sale/board_sale_view.xml | 11 +- .../hr_timesheet_invoice.py | 2 +- addons/l10n_ca-qc/__terp__.py | 2 +- addons/l10n_fr/__terp__.py | 2 +- addons/l10n_fr/account_pcg_france.xml | 28 ++-- addons/purchase/report/order.rml | 2 +- addons/report_timesheet/__init__.py | 30 ++++ addons/report_timesheet/__terp__.py | 13 ++ addons/report_timesheet/report_timesheet.py | 99 ++++++++++++ .../report_timesheet_view.xml | 142 ++++++++++++++++++ addons/sale/report/order.rml | 90 ++++++----- addons/sale/sale.py | 2 +- 14 files changed, 355 insertions(+), 70 deletions(-) create mode 100644 addons/report_timesheet/__init__.py create mode 100644 addons/report_timesheet/__terp__.py create mode 100644 addons/report_timesheet/report_timesheet.py create mode 100644 addons/report_timesheet/report_timesheet_view.xml diff --git a/addons/account/project/project.py b/addons/account/project/project.py index 12c26482bce..9b931f952f4 100644 --- a/addons/account/project/project.py +++ b/addons/account/project/project.py @@ -114,6 +114,7 @@ class account_analytic_account(osv.osv): 'quantity_max': fields.float('Maximal quantity'), 'partner_id' : fields.many2one('res.partner', 'Associated partner'), 'contact_id' : fields.many2one('res.partner.address', 'Contact'), + 'user_id' : fields.many2one('res.users', 'Account Manager'), 'date_start': fields.date('Date Start'), 'date': fields.date('Date End'), 'stats_ids': fields.one2many('report.hr.timesheet.invoice.journal', 'account_id', string='Statistics', readonly=True), diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 17048c4911f..092da107594 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -56,6 +56,7 @@ + diff --git a/addons/board_sale/board_sale_view.xml b/addons/board_sale/board_sale_view.xml index 1cad6cea1da..7ee9ccf8f7e 100644 --- a/addons/board_sale/board_sale_view.xml +++ b/addons/board_sale/board_sale_view.xml @@ -8,9 +8,14 @@ form
- + - + @@ -33,6 +38,6 @@ - + diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index 352ec0c44e9..8c4d8d6bd7e 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -32,7 +32,7 @@ from osv import fields, osv class hr_timesheet_invoice_factor(osv.osv): _name = "hr_timesheet_invoice.factor" - _description = "This class handle the types of invoicing, like 50% for customer" + _description = "Invoice rate" _columns = { 'name': fields.char('Internal name', size=128, required=True), 'customer_name': fields.char('Visible name', size=128), diff --git a/addons/l10n_ca-qc/__terp__.py b/addons/l10n_ca-qc/__terp__.py index ad1729a871c..49e6c1cbead 100644 --- a/addons/l10n_ca-qc/__terp__.py +++ b/addons/l10n_ca-qc/__terp__.py @@ -1,5 +1,5 @@ { - "name" : "Localisation for Quebec", + "name" : "Canada - Quebec", "version" : "1.0", "author" : "Tiny", "category" : "Localisation/Account charts", diff --git a/addons/l10n_fr/__terp__.py b/addons/l10n_fr/__terp__.py index b20c2a7e7cc..a33aa7d179d 100644 --- a/addons/l10n_fr/__terp__.py +++ b/addons/l10n_fr/__terp__.py @@ -1,5 +1,5 @@ { - "name" : "Localisation for France", + "name" : "France", "version" : "1.0", "author" : "Tiny", "category" : "Localisation/Account charts", diff --git a/addons/l10n_fr/account_pcg_france.xml b/addons/l10n_fr/account_pcg_france.xml index 75cc91822fa..e3e4e2f063b 100644 --- a/addons/l10n_fr/account_pcg_france.xml +++ b/addons/l10n_fr/account_pcg_france.xml @@ -2553,33 +2553,33 @@ payable - + 400 Fournisseurs et comptes rattachés payable - + 401 Fournisseurs payable - + - + 4011 Fournisseurs - Achats de biens et prestations de services payable - + 4017 Fournisseurs - Retenues de garantie payable - + 403 @@ -2700,33 +2700,33 @@ receivable - + 410 Clients et comptes rattachés receivable - + 411 Clients receivable - + - + 4111 Clients - Ventes de biens ou de prestations de services receivable - + 4117 Clients - Retenues de garantie receivable - + 413 @@ -2805,7 +2805,7 @@ receivable - + 421 Personnel - Rémunérations dues @@ -2875,7 +2875,7 @@ receivable - + 4284 Dettes provisionnées pour participation des salariés aux résultats diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index 10c99915e67..6c715479de0 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -186,7 +186,7 @@ - [[ 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 '' ]]
@@ -136,7 +136,7 @@ - + Product Description @@ -145,10 +145,7 @@ Applicable Taxes - Delay - - - Qty + Qty Disc. @@ -162,105 +159,102 @@
- [[ repeatIn(o.order_line,'line') ]] - + [[ repeatIn(o.order_line,'line') ]] + - [[ line.name ]] + [[ line.name ]] - [[ ', '.join(map(lambda x: x.name, line.tax_id))]] + [[ ', '.join(map(lambda x: x.name, line.tax_id))]] - [[ line.delay ]] + [[ line.product_uos_qty or line.product_uom_qty ]] [[ line.product_uos and line.product_uos.name or line.product_uom.name ]] - [[ line.product_uos_qty or line.product_uom_qty ]] [[ line.product_uos and line.product_uos.name or line.product_uom.name ]] + [[ (line.discount and str(line.discount)+'%')or '' ]] - [[ (line.discount and str(line.discount)+'%')or '' ]] + [[ '%.2f' % line.price_unit ]] - [[ '%.2f' % line.price_unit ]] - - - [[ '%.2f' % line.price_subtotal ]] + [[ '%.2f' % line.price_subtotal ]] - [[ repeatIn((line.notes and [line.notes]) or [], 'l') ]] + [[ repeatIn((line.notes and [line.notes]) or [], 'l') ]] - [[ l ]] [[ setTag('para','xpre') ]] + [[ l ]] [[ setTag('para','xpre') ]] - +
- + - + - Net Total : + Net Total : - [[ '%.2f' % o.amount_untaxed ]] [[ o.pricelist_id.currency_id.name ]] + [[ '%.2f' % o.amount_untaxed ]] [[ o.pricelist_id.currency_id.name ]] - + - Taxes : + Taxes : - [[ '%.2f' % o.amount_tax ]] [[ o.pricelist_id.currency_id.name ]] + [[ '%.2f' % o.amount_tax ]] [[ o.pricelist_id.currency_id.name ]] - + - TOTAL : + TOTAL : - [[ '%.2f' % o.amount_total ]] [[ o.pricelist_id.currency_id.name ]] + [[ '%.2f' % o.amount_total ]] [[ o.pricelist_id.currency_id.name ]] - + - [[ o.note or '' ]] [[ setTag('para','xpre') ]] + [[ o.note or '' ]] [[ setTag('para','xpre') ]] - [[ 'xpre' and o.partner_id.property_payment_term and o.partner_id.property_payment_term[1] ]] [[ setTag('para','xpre') ]] + [[ 'xpre' and o.partner_id.property_payment_term and o.partner_id.property_payment_term[1] ]] [[ setTag('para','xpre') ]] - + diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 483b3de4685..25673736733 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -488,7 +488,7 @@ class sale_order_line(osv.osv): 'order_id': fields.many2one('sale.order', 'Order Ref', required=True, ondelete='cascade', select=True), 'name': fields.char('Description', size=256, required=True, select=True), 'sequence': fields.integer('Sequence'), - 'delay': fields.float('Delay', required=True), + 'delay': fields.float('Delivery Delay', required=True), 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok','=',True)], change_default=True, relate=True), 'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id','invoice_id', 'Invoice Lines', readonly=True), 'invoiced': fields.boolean('Paid', readonly=True, select=True),