From d5ce43fd18214a6313428182d1e30bbb5cf87659 Mon Sep 17 00:00:00 2001 From: pinky <> Date: Mon, 11 Dec 2006 05:35:47 +0000 Subject: [PATCH] Print my timesheet only Better workflow for mrp and project (services, mto) Better reports for the purchase order: Request for quotation Order bzr revid: pinky-1d6119b7f3152ec48e12f1d1b7d6f0482b5916ae --- addons/board_sale/__terp__.py | 2 +- addons/hr_timesheet/hr_timesheet_report.xml | 17 ++- addons/hr_timesheet/report/user_timesheet.py | 5 + .../wizard/wizard_print_timesheet.py | 24 +++- .../wizard/wizard_print_timesheet_users.py | 2 +- addons/project/project_workflow.xml | 2 +- addons/purchase/report/order.rml | 132 +++++++++--------- addons/purchase/report/request_quotation.rml | 30 ++-- 8 files changed, 130 insertions(+), 84 deletions(-) diff --git a/addons/board_sale/__terp__.py b/addons/board_sale/__terp__.py index 5e1b5ccfc41..57f9bee0493 100644 --- a/addons/board_sale/__terp__.py +++ b/addons/board_sale/__terp__.py @@ -3,7 +3,7 @@ "version":"1.0", "author":"Tiny", "category":"Board", - "depends":["base","sale", "report_crm"], + "depends":["base","sale", "report_crm", "report_sale"], "demo_xml":[], "update_xml":["board_sale_view.xml"], "active":False, diff --git a/addons/hr_timesheet/hr_timesheet_report.xml b/addons/hr_timesheet/hr_timesheet_report.xml index 5501fea2690..a9bc00922cc 100644 --- a/addons/hr_timesheet/hr_timesheet_report.xml +++ b/addons/hr_timesheet/hr_timesheet_report.xml @@ -15,7 +15,22 @@ model="hr.employee" name="hr.analytical.timesheet" menu="False" /> - + + + + ' % (aid, toxml(aname))) account_xml.append('\n'.join([xml % (day, amount) for day, amount in telems.iteritems()])) account_xml.append('') diff --git a/addons/hr_timesheet/wizard/wizard_print_timesheet.py b/addons/hr_timesheet/wizard/wizard_print_timesheet.py index 2f1c23c9af9..8d3b1618b9e 100644 --- a/addons/hr_timesheet/wizard/wizard_print_timesheet.py +++ b/addons/hr_timesheet/wizard/wizard_print_timesheet.py @@ -39,6 +39,14 @@ dates_form = ''' ''' + +dates_form_ro = ''' +
+ + + +''' + dates_fields = { 'month': dict(string=u'Month', type='selection', required=True, selection=[(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)]), 'year': dict(string=u'Year', type=u'integer', required=True), @@ -53,7 +61,7 @@ class wizard_report(wizard.interface): states = { 'init': { 'actions': [_get_value], - 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[ ('end','Cancel'),('report','Print')]} + 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[ ('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]} }, 'report': { 'actions': [], @@ -61,3 +69,17 @@ class wizard_report(wizard.interface): } } wizard_report('hr.analytical.timesheet') + +class wizard_report_my(wizard.interface): + states = { + 'init': { + 'actions': [_get_value], + 'result': {'type':'form', 'arch':dates_form_ro, 'fields':dates_fields, 'state':[ ('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]} + }, + 'report': { + 'actions': [], + 'result': {'type':'print', 'report':'hr.analytical.timesheet', 'state':'end'} + } + } +wizard_report_my('hr.analytical.timesheet.my') + diff --git a/addons/hr_timesheet/wizard/wizard_print_timesheet_users.py b/addons/hr_timesheet/wizard/wizard_print_timesheet_users.py index cbf238f4987..99c758972d3 100644 --- a/addons/hr_timesheet/wizard/wizard_print_timesheet_users.py +++ b/addons/hr_timesheet/wizard/wizard_print_timesheet_users.py @@ -51,7 +51,7 @@ class wizard_report(wizard.interface): states={ 'init':{ 'actions':[_get_value], - 'result':{'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('report','Print')]} + 'result':{'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel','gtk-cancel'),('report','Print','gtk-print')]} }, 'report':{ 'actions':[], diff --git a/addons/project/project_workflow.xml b/addons/project/project_workflow.xml index 07ecb2b94ac..944f6e9c518 100644 --- a/addons/project/project_workflow.xml +++ b/addons/project/project_workflow.xml @@ -1,7 +1,7 @@ - + subflow.done diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index 5d82d220d72..10c99915e67 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -28,7 +28,6 @@ - @@ -60,20 +59,21 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -94,12 +94,15 @@ - Shipping address : + + + [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]] + Shipping address : [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] [[ addr.title or '' ]] [[ addr.name ]] [[ addr.street ]] @@ -139,79 +142,80 @@ - [[ o.state=='draft' and 'Quotation ' or 'Order ' ]] N° : [[ o.name ]] + Request for Quotation [[ (o.state=='draft' or removeParentNode('font')) and '' ]] + + Order [[ (o.state<>'draft' or removeParentNode('font')) and '' ]] + N° : [[ o.name ]] + + - Our order reference : [[ o.ref or '' ]] - Your order reference : [[ o.partner_ref or '' ]] - Date ordered : [[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]] - Validated by : [[ o.validator and o.validator.name or '' ]] + Project: [[ o.project_id and o.project_id.complete_name ]] + Our order reference : [[ o.ref or '' ]] + Your order reference : [[ o.partner_ref or '' ]] + Date ordered : [[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]] + Validated by : [[ o.validator and o.validator.name or '' ]] - + - Product Description + Product Description - Applicable Taxes + Applicable Taxes - Date Promised + Date Requested - Qty + Qty - UoM + Unit Price - Unit Price - - - Net Price + Net Price
- [[ repeatIn(o.order_line,'line') ]] - + [[ repeatIn(o.order_line,'line') ]] + - [[ line.name ]] + [[ line.code ]] + [[ line.name ]] - [[ ', '.join(map(lambda x: x.name, line.taxes_id))]] + [[ ', '.join(map(lambda x: x.name, line.taxes_id))]] - [[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d')) ]] + [[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d')) ]] - [[ line.product_qty ]] + [[ line.product_qty ]] [[ line.product_uom.name ]] - [[ line.product_uom.name ]] + [[ '%.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 or removeParentNode('table') ]] + [[ l or removeParentNode('table') ]] - + @@ -224,57 +228,57 @@ - + - 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 ]] - - - - - - - - - - [[ o.notes or '' ]] [[ setTag('para','xpre') ]] + [[ '%.2f' % o.amount_total ]] [[ o.pricelist_id.currency_id.name ]] + + + + [[ o.notes or '' ]] [[ setTag('para','xpre') ]] + + + + + + diff --git a/addons/purchase/report/request_quotation.rml b/addons/purchase/report/request_quotation.rml index fd63b62d76f..5aca5fbe652 100644 --- a/addons/purchase/report/request_quotation.rml +++ b/addons/purchase/report/request_quotation.rml @@ -25,7 +25,6 @@ - @@ -84,12 +83,15 @@ - Shipping address : + + + [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]] + Shipping address : [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] [[ addr.title or '' ]] [[ addr.name ]] [[ addr.street ]] @@ -139,6 +141,10 @@ Request for Quotation [[ o.name ]] + + + + Our project: [[ o.project_id and o.project_id.complete_name or '/' ]] Other reference : [[ o.ref or '' ]] Printed: [[ time.strftime('%d/%m/%Y') ]] @@ -148,11 +154,8 @@ - + - - Code - Product @@ -166,13 +169,10 @@
[[ repeatIn(o.order_line,'line') ]] - + - [[ line.product_id and line.product_id.default_code or '' ]] - - - [[ line.name ]] + [[ line.product_id and line.product_id.default_code or '' ]] - [[ line.name ]] [[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d')) ]] @@ -215,10 +215,10 @@ - [[ user.name ]] - Tel: [[ user.address_id.phone ]] - Email: [[ user.address_id.email ]] - Fax: [[ user.address_id.fax ]] + [[ user.signature ]] + + +