Commit Graph

235 Commits

Author SHA1 Message Date
Denis Ledoux a23468c845 [FIX] hr_timesheet_sheet: total attendances & timesheets performances
For these function fields, bypassing the ORM, using a SQL query,
improves the execution time by 100 for a set of 80 timesheets
in a database with
 - 250K `hr.analytic.timesheet`
&
 - 250K `hr.attendance`.

These function fields depends on a one2many field which use
the SQL view `hr_timesheet_sheet_sheet_day`.

When performing `sheet.period_ids`, two SQL requests are performed,
 - the first just to know the ids in the sql view matching this sheet
 - the second to read the fields `total_attendance` & `total_timesheet`
and the request is performed on the entire set of lines of this view
(~250K lines in the observed use case)

while, when replaced by this SQL request, only one request is performed,
on a restricted set of lines, speeding up significantly the computation
of these computed fields for smaller sets of sheets.

opw-653447
2015-11-05 16:23:48 +01:00
Denis Ledoux 0c16c20c68 [FIX] hr_timesheet: timezone of anayltic sheets in sheet summary
The timezone of hr_analytic_sheet should be the timezone
of the employee as well, so sheet analytic lines and attendances
lines are grouped within the same timezone, the timezone
of the employees, so the time difference between the analytic
lines and the attendances lines can be properly computed.

Fixes #5809
Fixes #5379
Related to rev. 3bf1615ad4
2015-03-23 15:26:41 +01:00
Denis Ledoux 3bf1615ad4 [FIX] hr_timesheet: worked hours summary when sign in without sign out
In a timesheet, when a sign in is added, and a sign out
is not following, the current time is took as sign out value.

Rev. dbb2a669f4 corrected an issue
regarding the worked hours summary not taking into account
the employee timezone.
This timezone has to be applied on the current_time also.

e.g: For an employee being in timezone UTC + 1
If the current_time is presently 12:00 (UTC+1)
If the employee set his sign in to 10:00
and do not entered a sign out
The hours summary table displayed 1:00 of worked hours,
based on computation (11:00 - 10:00)
11:00 being 12:00 but in timezone UTC

Besides, another issue was present when entering
a sign in at midnight exactly without a sign out:
If the employee set his sign in to 00:00:00
and do not set a sign out, worked hours displayed 0 worked hours
whatever the current time.

Fixes #5379
Closes #5378
Closes #5503
2015-02-27 12:04:49 +01:00
Denis Ledoux dd9d8b0c84 [FIX] hr_timesheet_sheet: prevent new activity on confirmed sheets
Once a timesheet confirmed, the activity hours should not be modified,
for any reasons.

The constraint _check_sheet_state prevents to modify activities
for confirmed timesheets, but does not prevent the addition
of new activities within the current, but confirmed, timesheet.

opw-627415
fixes #5128
2015-02-09 12:13:17 +01:00
Denis Ledoux dbb2a669f4 [FIX] hr_timesheet_sheet: display timesheet by day summary in employee tz
If an employee in UTC + 1 (Europe/Brussels) entered an attendance from January 2 00:00 to Januay 2 23:59, the summary by day table displayed two different lines, for two different days:
 - 1 hour on January 1 from 23:00 to 23:59
 - 22:59 hours on January 2 from 00:00 to 22:59

 Which is obviously wrong, the employee, in its own time zone, worked on January 2 only.
2015-01-07 12:26:41 +01:00
rmu-odoo 16a969214f [FIX] hr_timesheet_sheet: avoid error when sort attendances
When an attendance line is edited, the tuple has no key 'name' which lead to a traceback.
Fixes #546
2014-09-17 18:25:08 +02:00
Yannick Vaucher c1601e75d3 [FIX] sign in and sign out were broken in rev 10019 as it doesn't provide a date to conversion of attendance time to employee timezone
lp bug: https://launchpad.net/bugs/1314589 fixed

bzr revid: yannick.vaucher@camptocamp.com-20140430113730-cn3xw66fbik8p32n
2014-04-30 13:37:30 +02:00
Martin Trigaux c393fbcddd [MERGE] [FIX] hr_timesheet_sheet: make it timezone tolerant and avoid errors when comparing datetime and dates, courtesy of Yannick Vaucher (Camptocamp)
The attendance date recieved by the server is in UTC while the user sees it in his timezone. This means that an attendance could be in a timesheet (bounded by dates) for a user but not for the server which would not accept a valid attendance.
The fix will make the check in the user's timezone.

Only the date part of the attendance is kept for comparison as the boundaries are dates objects.

bzr revid: mat@openerp.com-20140428153216-4s6r5hu1ov0p0ofm
2014-04-29 01:32:16 +10:00
Yannick Vaucher 22d1c0956f [UPD] resolve conflicts with main branch and fix bug introduced in rev 10015 lp:1313622
lp bug: https://launchpad.net/bugs/1313622 fixed

bzr revid: yannick.vaucher@camptocamp.com-20140428142017-3warx1ai72cfetj1
2014-04-28 16:20:17 +02:00
Yannick Vaucher 886c827458 [UPD]
bzr revid: yannick.vaucher@camptocamp.com-20140428135535-o9512996d18cudgq
2014-04-28 15:55:35 +02:00
Martin Trigaux bb85882322 [FIX] hr_timesheet_sheet: forbid to record an attendance in a submitted timesheet (opw 592632)
bzr revid: mat@openerp.com-20140425100856-lcpgyjdk4u632bws
2014-04-25 12:08:56 +02:00
Martin Trigaux 34067a1f49 [FIX] hr_timesheet_sheet: forbid to record an attendance in a submitted timesheet
lp bug: https://launchpad.net/bugs/1180769 fixed

bzr revid: mat@openerp.com-20140424142829-ramy830hwkghk1jv
2014-04-24 16:28:29 +02:00
Denis Ledoux 966a818aa6 [FIX] hr_timesheet_sheet: allow writing attendance line not according to the date order, and check that the attendances satisfy the alternance constraint, even for delete operations
lp bug: https://launchpad.net/bugs/1180773 fixed

bzr revid: dle@openerp.com-20140423112554-75bpk5k3viroqbh5
2014-04-23 13:25:54 +02:00
Yannick Vaucher c59b97b358 [FIX] hr_timesheet_sheet - remove useless call to AT TIME ZONE in psql request here it isn't current_date but an utc 'timestamp' date. Need a strong tea even if it isn't utc tea time.
bzr revid: yannick.vaucher@camptocamp.com-20130909103819-i3143f6zenrf8hi9
2013-09-09 12:38:19 +02:00
Yannick Vaucher 76a0d0acf6 [IMP] hr_timesheet_sheet - set default timezone as UTC if employee has none
bzr revid: yannick.vaucher@camptocamp.com-20130909103749-sc1ia08hna4o6q8h
2013-09-09 12:37:49 +02:00
Yannick Vaucher 0ed7f5ef3b [IMP] hr_timesheet_sheet - simplify and improve readability in search for sheet_ids
bzr revid: yannick.vaucher@camptocamp.com-20130909103724-4w5tkx2bfms07s91
2013-09-09 12:37:24 +02:00
Yannick Vaucher 372f3d131a [IMP] hr_timesheet_sheet - remove unused variable
bzr revid: yannick.vaucher@camptocamp.com-20130909103654-wwkpyaaoqpwq1mqu
2013-09-09 12:36:54 +02:00
Yannick Vaucher e2b7cd17fc [FIX] hr_timesheet_sheet - search sheet_id for attendance using date in users timezone. As attendances depends on timezone but timesheet have from and to date instead of datetime we have to change the attendance to the same timezone expected for timesheet. And as a Timesheet belongs to a user, we can expect this timesheet to be in the same timezone as its owner. Maybe a timezone field should be added on timesheet. In anycase it make no sense to have all timesheet forced with start and end date as UTC.
lp bug: https://launchpad.net/bugs/1204224 fixed

bzr revid: yannick.vaucher@camptocamp.com-20130723184341-zowaw71f0mpghgrx
2013-07-23 20:43:41 +02:00
Amit Dodiya 70f32e1d08 [FIX] hr_timesheet_sheet: timesheet is stuck after removing an inside attendance entries so restricted deletion of inside entries if it does not follow the signin signout rule
bzr revid: ado@tinyerp.com-20130610114126-puf1gf1m1qhjvcmg
2013-06-10 17:11:26 +05:30
Amit Dodiya b2b30af120 [FIX] hr_timesheet_sheet: timesheet is stuck after removing an inside attendance entries so restricted deletion of inside entries if it does not follow the signin signout rule
bzr revid: ado@tinyerp.com-20130610092948-i7ewkauvjse4rpc3
2013-06-10 14:59:48 +05:30
Amit Dodiya 141000ffb4 [FIX] hr_timesheet_sheet: timesheet is stuck after removing an inside attendance entries so restricted deletion of inside entries if it does not follow the signin signout rule
bzr revid: ado@tinyerp.com-20130604070131-ce1dln15r6oq04zb
2013-06-04 12:31:31 +05:30
Mohammed Shekha a74fa6ed73 [FIX]Fixed the issue of timezone on total attendance on My current timesheet view.
bzr revid: msh@openerp.com-20130522125350-b6yj2mpqosfwajkc
2013-05-22 18:23:50 +05:30
Quentin (OpenERP) 7351a7312d [FIX] hr_timesheet: improved perfomances on the read of timesheet sheets
bzr revid: qdp-launchpad@openerp.com-20130508085938-a2uyalx1cy2musj0
2013-05-08 10:59:38 +02:00
Cedric Snauwaert 7d0630b448 [FIX]hr_timesheet_sheet: fix user_id variable referenced before assignment when no employee_id
specified in onchange_employee_id

bzr revid: csn@openerp.com-20130314150614-bsnwc4gk7a9eyri0
2013-03-14 16:06:14 +01:00
Thibault Delavallée 331e420a55 [FIX] needaction: fixed last commit, harmonizing the parameters of the various needaction_domain_get.
bzr revid: tde@openerp.com-20121220110242-ot9ha7rt1ofyjoj5
2012-12-20 12:02:42 +01:00
Thibault Delavallée d737a7f098 [IMP] sale, purchase, hr_timesheet_sheet, hr_holidays, event, crm_meeting: fixed, improved and cleaned needaction_domain_get.
bzr revid: tde@openerp.com-20121220100005-d0r0se41fx83w38c
2012-12-20 11:00:05 +01:00
Cecile Tonglet 15fe515601 [MERGE] From trunk
bzr revid: cto@openerp.com-20121217144306-tkodwpox30cuvb28
2012-12-17 15:43:06 +01:00
Cedric Snauwaert ac367e4ceb [FIX]fix problem when trying to add line entry in my current timesheet
bzr revid: csn@openerp.com-20121212152126-czq2fwo1oxkvt73o
2012-12-12 16:21:26 +01:00
Vo Minh Thu 6072fd11af [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20121210111654-0pm3pupnqqeip52n
2012-12-10 12:16:54 +01:00
Fabien Pinckaers e128f7f5d8 [MERGE] fixes + cleaning hr_evaluation
bzr revid: fp@tinyerp.com-20121208124319-wyrc3udl3mau2963
2012-12-08 13:43:19 +01:00
Vo Minh Thu e7f4891d46 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121206145632-0h1coh5aaem65wsy
2012-12-06 15:56:32 +01:00
Tejas Tank 82c58a9f85 [FIX] corrected code for sending unwated more notes.
bzr revid: tta@openerp.com-20121206063612-g3l7aracvtyrkqnz
2012-12-06 11:36:12 +05:00
Tejas Tank 61382204dc [FIX] Does not require to set related field in default.
bzr revid: tta@openerp.com-20121203074442-cbzavdhswqyd306g
2012-12-03 12:44:42 +05:00
Tejas Tank cd4899aa6a An employee should receive a mail.message in inbox when an manager refuse a timesheet.
bzr revid: tta@openerp.com-20121122110015-61xx09vchksen6v3
2012-11-22 16:30:15 +05:30
Tejas Tank 0c07c9c827 [IMP] Corrected _needaction_domain_get.
bzr revid: tta@openerp.com-20121122063326-gsvahyei0xsnmzyg
2012-11-22 12:03:26 +05:30
Tejas Tank a8fb9f6cdd A manager of an employee should receive a mail.message in inbox when an employee validates a timesheet.
bzr revid: tta@openerp.com-20121121135444-i79rrica84rl4e4a
2012-11-21 19:24:44 +05:30
Tejas Tank 414920b52f [FIX] Corrected code style.
bzr revid: tta@openerp.com-20121121134349-fsko8x6t97d1hzdz
2012-11-21 19:13:49 +05:30
Bharat Devnani (OpenERP) 54e2722948 merged hsa's branch lp:~openerp-dev/openobject-addons/trunk-10-hr-click-2-bde-timesheet-hsa
bzr revid: bde@tinyerp.com-20121112110220-rqk5qo07ol4duzds
2012-11-12 16:32:20 +05:30
Bharat Devnani (OpenERP) 89f8722f23 [ADD] added default value for user_id
bzr revid: bde@tinyerp.com-20121112103455-aar7t15a4bixjyrj
2012-11-12 16:04:55 +05:30
Pinakin Nayi (OpenERP) d987291a63 [IMP]hr_timesheet_shhet add chatter
bzr revid: pna@tinyerp.com-20121112095424-p3z0bwx1f38nbv4n
2012-11-12 15:24:24 +05:30
Hardik 40745949d4 [IMP]following fields are invalid user in timesheet
bzr revid: hsa@tinyerp.com-20121109133705-biefd0u3d50zyzh6
2012-11-09 19:07:05 +05:30
Ajay Chauhan (OpenERP) 3894874ebb [MERGE] merge with lp:openobject-addons
bzr revid: cha@tinyerp.com-20121030050323-cpn92n9txy0xw5gj
2012-10-30 10:33:23 +05:30
Ajay Chauhan (OpenERP) 6cfffae349 [MERGE] merge with lp:openobject-addons
bzr revid: cha@tinyerp.com-20121029050259-0vimwnu84f2dvk2g
2012-10-29 10:32:59 +05:30
Fabien Pinckaers dd3e728fb6 [MERGE] + improve hr_timesheet
bzr revid: fp@tinyerp.com-20121026075715-kq910tdzhc1uul3l
2012-10-26 09:57:15 +02:00
Fabien Pinckaers a7368145ca [MERGE] typo
bzr revid: fp@openerp.com-20121024201424-98la8f2wkhfjrtae
2012-10-24 22:14:24 +02:00
Ajay Chauhan (OpenERP) 12246cfb2b [IMP] hr_timesheet_sheet: made little change in warning message
bzr revid: cha@tinyerp.com-20121022070215-y87h55i1h8fuljuf
2012-10-22 12:32:15 +05:30
Ajay Chauhan (OpenERP) b7bc79d9c3 [MERGE] merge with lp:openobject-addons
bzr revid: cha@tinyerp.com-20121018060531-wl123qyuvlccjyfc
bzr revid: cha@tinyerp.com-20121022053314-olinyyizlbcmf9y2
2012-10-22 11:03:14 +05:30
Fabien Pinckaers 6c15bcce12 [MERGE] HR
bzr revid: fp@openerp.com-20121021195925-sbsfni9i10r2o2bw
2012-10-21 21:59:25 +02:00
Mayur Maheshwari (OpenERP) 0b87880029 [IMP]all: imporve string state to status
bzr revid: mma@tinyerp.com-20121012114258-w2q3hg1wb5wlt8wi
2012-10-12 17:12:58 +05:30
Ajay Chauhan (OpenERP) 142253b76e [IMP] hr_timesheet_sheet: made changes in warning message
bzr revid: cha@tinyerp.com-20121011122036-ff1kevlg121t2yz7
2012-10-11 17:50:36 +05:30