From b2a0e44121d8afa3559ea9145516343db9cfc637 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 19 Jun 2015 18:29:57 +0200 Subject: [PATCH] Add posted counters + update translation --- hr_holidays_usability/i18n/fr.po | 42 ++++-- .../i18n/hr_holidays_usability.pot | 140 +++++++++++++++--- .../report/hr_holidays_employee_counter.py | 16 +- .../hr_holidays_employee_counter_view.xml | 7 +- 4 files changed, 170 insertions(+), 35 deletions(-) diff --git a/hr_holidays_usability/i18n/fr.po b/hr_holidays_usability/i18n/fr.po index 2deba7e..f9eca99 100644 --- a/hr_holidays_usability/i18n/fr.po +++ b/hr_holidays_usability/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-11 22:19+0000\n" -"PO-Revision-Date: 2015-06-11 22:19+0000\n" +"POT-Creation-Date: 2015-06-19 16:26+0000\n" +"PO-Revision-Date: 2015-06-19 16:26+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -179,6 +179,11 @@ msgstr "Compteur pour ce type de congé" msgid "Counters" msgstr "Compteurs" +#. module: hr_holidays_usability +#: model:ir.model,name:hr_holidays_usability.model_hr_holidays_employee_counter +msgid "Counters for holidays of employees" +msgstr "Compteurs pour les congés des employés" + #. module: hr_holidays_usability #: view:hr.holidays.mass.allocation:0 msgid "Create Allocations" @@ -190,12 +195,22 @@ msgstr "Créer des attributions" msgid "Current Leaves Taken" msgstr "Congés pris" +#. module: hr_holidays_usability +#: field:hr.holidays.employee.counter,current_leaves_taken_posted:0 +msgid "Current Leaves Taken Posted" +msgstr "Congés pris comptabilisés" + #. module: hr_holidays_usability #: field:hr.holidays,current_remaining_leaves:0 -#: field:hr.holidays.employee.counter,current_remaining_leaves:0 +#: field:hr.holidays.employee.counter,current_leaves_remaining:0 msgid "Current Remaining Leaves" msgstr "Congés restants" +#. module: hr_holidays_usability +#: field:hr.holidays.employee.counter,current_leaves_remaining_posted:0 +msgid "Current Remaining Leaves Posted" +msgstr "Congés restants comptabilisés" + #. module: hr_holidays_usability #: field:res.company,mass_allocation_default_holiday_status_id:0 msgid "Default Leave Type for Mass Allocation" @@ -209,17 +224,16 @@ msgstr "Description" #. module: hr_holidays_usability #: selection:hr.holidays.post,state:0 msgid "Done" -msgstr "" +msgstr "Done" #. module: hr_holidays_usability #: selection:hr.holidays.post,state:0 msgid "Draft" -msgstr "" +msgstr "Draft" #. module: hr_holidays_usability #: view:hr.holidays.employee.counter:0 #: field:hr.holidays.employee.counter,employee_id:0 -#: model:ir.model,name:hr_holidays_usability.model_hr_employee msgid "Employee" msgstr "Employé" @@ -410,7 +424,7 @@ msgstr "Début du congé" #. module: hr_holidays_usability #: field:hr.holidays.post,state:0 msgid "State" -msgstr "" +msgstr "State" #. module: hr_holidays_usability #: code:addons/hr_holidays_usability/hr_holidays.py:238 @@ -480,6 +494,11 @@ msgstr "Total des congés pris" msgid "Total Remaining Leaves" msgstr "Total des congés restants" +#. module: hr_holidays_usability +#: view:hr.holidays.employee.counter:0 +msgid "Total Remaining and Posted Leaves" +msgstr "Total des congés restants comptabilisés" + #. module: hr_holidays_usability #: field:hr.holidays.status,vacation_compute_method:0 msgid "Vacation Compute Method" @@ -489,7 +508,7 @@ msgstr "Méthode de calcul des jours de congé" #: code:addons/hr_holidays_usability/hr_holidays.py:346 #, python-format msgid "Warning!" -msgstr "Warning!" +msgstr "Attention !" #. module: hr_holidays_usability #: model:ir.model,name:hr_holidays_usability.model_hr_holidays_mass_allocation @@ -516,10 +535,5 @@ msgstr "Vous devez entrer une valeur pour le nombre de jours." #. module: hr_holidays_usability #: constraint:hr.holidays:0 msgid "error msg in raise" -msgstr "" - -#. module: hr_holidays_usability -#: model:ir.model,name:hr_holidays_usability.model_hr_holidays_employee_counter -msgid "hr.holidays.employee.counter" -msgstr "hr.holidays.employee.counter" +msgstr "error msg in raise" diff --git a/hr_holidays_usability/i18n/hr_holidays_usability.pot b/hr_holidays_usability/i18n/hr_holidays_usability.pot index 1ff027a..582e92f 100644 --- a/hr_holidays_usability/i18n/hr_holidays_usability.pot +++ b/hr_holidays_usability/i18n/hr_holidays_usability.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-12 07:36+0000\n" -"PO-Revision-Date: 2015-06-12 07:36+0000\n" +"POT-Creation-Date: 2015-06-19 16:24+0000\n" +"PO-Revision-Date: 2015-06-19 16:24+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -24,37 +24,48 @@ msgid "\n" "

WARNING : THIS IS A TEST E-MAIL sent from a test OpenERP database (${ctx.get('dbname')}). Do not take into account !

\n" "\n" "% endif\n" -"

The following ${object.type == 'remove' and 'leave request' or 'ALLOCATION request (i.e. credit of days, not debit !)'} has been ${ctx.get('wkf_tracker') or 'ERROR'} today in OpenERP by ${user.name or ''} :

\n" +"

La ${object.type == 'remove' and 'demande' or \"demande d'ATTRIBUTION\"} de congé a été ${ctx.get('wkf_tracker') or 'ERROR'} aujourd'hui dans OpenERP par ${user.name or ''} :

\n" "\n" "\n" "\n" -"% if ctx.get('wkf_tracker') == 'submitted':\n" +"% if ctx.get('wkf_tracker') == 'soumise':\n" "% if object.type == 'remove':\n" -"

To validate or refuse it, go to the menu Human Resources > Leaves > Leave requests to approve.

\n" +"

Pour la valider ou la refuser, allez dans le menu Ressources humaines > Congés > Demandes de congé à valider.

\n" "% else:\n" -"

To validate or refuse it, go to the menu Human Resources > Leaves > Allocation requests.

\n" +"

Pour la valider ou la refuser, allez dans le menu Ressources humaines > Congés > Demandes d'attribution de congés à valider.

\n" "% endif\n" -"\n" "% endif\n" "

\n" "--
\n" -"Automatic e-mail sent by OpenERP. Do not reply.
\n" -"Database : ${ctx.get('dbname')}
\n" +"Mail envoyé automatiquement par OpenERP. Ne pas répondre.
\n" +"Base de donnée : ${ctx.get('dbname')}
\n" "

\n" "\n" "" @@ -67,7 +78,7 @@ msgstr "" #. module: hr_holidays_usability #: model:email.template,subject:hr_holidays_usability.email_template_hr_holidays -msgid "${ctx.get('dbname') and 'prod' not in ctx.get('dbname') and '[TEST]' or ''}[${object.type == 'remove' and 'Leave' or 'Allocation'} ${ctx.get('wkf_tracker')}] ${object.name or ''} - ${object.employee_id.name or ''}" +msgid "${ctx.get('dbname') and 'prod' not in ctx.get('dbname') and '[TEST]' or ''}[${object.type == 'remove' and 'Demande' or 'Attribution'} de congé ${ctx.get('wkf_tracker')}] ${object.name or ''} - ${object.employee_id.name or ''}" msgstr "" #. module: hr_holidays_usability @@ -133,12 +144,22 @@ msgstr "" msgid "Current Leaves Taken" msgstr "" +#. module: hr_holidays_usability +#: field:hr.holidays.employee.counter,current_leaves_taken_posted:0 +msgid "Current Leaves Taken Posted" +msgstr "" + #. module: hr_holidays_usability #: field:hr.holidays,current_remaining_leaves:0 -#: field:hr.holidays.employee.counter,current_remaining_leaves:0 +#: field:hr.holidays.employee.counter,current_leaves_remaining:0 msgid "Current Remaining Leaves" msgstr "" +#. module: hr_holidays_usability +#: field:hr.holidays.employee.counter,current_leaves_remaining_posted:0 +msgid "Current Remaining Leaves Posted" +msgstr "" + #. module: hr_holidays_usability #: field:res.company,mass_allocation_default_holiday_status_id:0 msgid "Default Leave Type for Mass Allocation" @@ -190,6 +211,20 @@ msgstr "" msgid "Enter the last day of vacation. For example, if you leave one full calendar week, the last day of vacation is Friday evening (and not Monday of the week after)" msgstr "" +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:237 +#: code:addons/hr_holidays_usability/hr_holidays.py:243 +#: code:addons/hr_holidays_usability/hr_holidays.py:250 +#: code:addons/hr_holidays_usability/hr_holidays.py:257 +#: code:addons/hr_holidays_usability/hr_holidays.py:263 +#: code:addons/hr_holidays_usability/hr_holidays.py:269 +#: code:addons/hr_holidays_usability/wizard/hr_holidays_mass_allocation.py:71 +#: code:addons/hr_holidays_usability/wizard/hr_holidays_mass_allocation.py:75 +#: code:addons/hr_holidays_usability/wizard/hr_holidays_post.py:84 +#, python-format +msgid "Error:" +msgstr "" + #. module: hr_holidays_usability #: selection:hr.holidays,vacation_time_to:0 msgid "Evening" @@ -282,6 +317,12 @@ msgstr "" msgid "Morning" msgstr "" +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/wizard/hr_holidays_post.py:85 +#, python-format +msgid "No leave request to post." +msgstr "" + #. module: hr_holidays_usability #: selection:hr.holidays,vacation_time_from:0 #: selection:hr.holidays,vacation_time_to:0 @@ -334,16 +375,58 @@ msgstr "" msgid "State" msgstr "" +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:238 +#, python-format +msgid "The first day cannot be after the last day !" +msgstr "" + +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:264 +#, python-format +msgid "The first day of vacation cannot be a bank holiday !" +msgstr "" + +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:251 +#, python-format +msgid "The first day of vacation cannot be a saturday or sunday !" +msgstr "" + +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:258 +#, python-format +msgid "The last day of Vacation cannot be a saturday or sunday !" +msgstr "" + +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:270 +#, python-format +msgid "The last day of vacation cannot be a bank holiday !" +msgstr "" + #. module: hr_holidays_usability #: sql_constraint:hr.holidays.mass.allocation:0 msgid "The number of days must be positive" msgstr "" +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:244 +#, python-format +msgid "The start of vacation is exactly the same as the end !" +msgstr "" + #. module: hr_holidays_usability #: help:hr.holidays.post,before_date:0 msgid "The wizard will select the validated holidays that ended before that date (including holidays that ended on that date)." msgstr "" +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:347 +#, python-format +msgid "There are not enough %s allocated for employee %s (requesting %s days but only %s days left)." +msgstr "" + #. module: hr_holidays_usability #: field:hr.holidays,total_allocated_leaves:0 #: field:hr.holidays.employee.counter,total_allocated_leaves:0 @@ -360,11 +443,22 @@ msgstr "" msgid "Total Remaining Leaves" msgstr "" +#. module: hr_holidays_usability +#: view:hr.holidays.employee.counter:0 +msgid "Total Remaining and Posted Leaves" +msgstr "" + #. module: hr_holidays_usability #: field:hr.holidays.status,vacation_compute_method:0 msgid "Vacation Compute Method" msgstr "" +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/hr_holidays.py:346 +#, python-format +msgid "Warning!" +msgstr "" + #. module: hr_holidays_usability #: model:ir.model,name:hr_holidays_usability.model_hr_holidays_mass_allocation msgid "Wizard for mass allocation of holidays" @@ -375,6 +469,18 @@ msgstr "" msgid "Wizard for post holidays" msgstr "" +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/wizard/hr_holidays_mass_allocation.py:76 +#, python-format +msgid "You must select at least one employee." +msgstr "" + +#. module: hr_holidays_usability +#: code:addons/hr_holidays_usability/wizard/hr_holidays_mass_allocation.py:72 +#, python-format +msgid "You must set a value for the number of days." +msgstr "" + #. module: hr_holidays_usability #: constraint:hr.holidays:0 msgid "error msg in raise" diff --git a/hr_holidays_usability/report/hr_holidays_employee_counter.py b/hr_holidays_usability/report/hr_holidays_employee_counter.py index dbf77c6..283ec27 100644 --- a/hr_holidays_usability/report/hr_holidays_employee_counter.py +++ b/hr_holidays_usability/report/hr_holidays_employee_counter.py @@ -36,7 +36,9 @@ class HrHolidaysEmployeeCounter(orm.Model): 'holiday_status_id': fields.many2one( "hr.holidays.status", "Leave Type"), 'current_leaves_taken': fields.float('Current Leaves Taken'), - 'current_remaining_leaves': fields.float('Current Remaining Leaves'), + 'current_leaves_taken_posted': fields.float('Current Leaves Taken Posted'), + 'current_leaves_remaining': fields.float('Current Remaining Leaves'), + 'current_leaves_remaining_posted': fields.float('Current Remaining Leaves Posted'), 'total_allocated_leaves': fields.float('Total Allocated Leaves'), } @@ -53,7 +55,17 @@ class HrHolidaysEmployeeCounter(orm.Model): THEN hh.number_of_days * -1 ELSE 0 END) AS current_leaves_taken, - sum(hh.number_of_days) AS current_remaining_leaves, + sum( + CASE WHEN hh.type='remove' AND hh.posted_date IS NOT null + THEN hh.number_of_days * -1 + ELSE 0 + END) AS current_leaves_taken_posted, + sum(hh.number_of_days) AS current_leaves_remaining, + sum( + CASE WHEN (hh.type='remove' AND hh.posted_date IS NOT null) OR hh.type='add' + THEN hh.number_of_days + ELSE 0 + END) as current_leaves_remaining_posted, sum( CASE WHEN hh.type = 'add' THEN hh.number_of_days diff --git a/hr_holidays_usability/report/hr_holidays_employee_counter_view.xml b/hr_holidays_usability/report/hr_holidays_employee_counter_view.xml index b628812..02e1cbd 100644 --- a/hr_holidays_usability/report/hr_holidays_employee_counter_view.xml +++ b/hr_holidays_usability/report/hr_holidays_employee_counter_view.xml @@ -10,9 +10,12 @@ - - + + + +