Commit Graph

288 Commits

Author SHA1 Message Date
Your Name d32d812812 Allow HR managers to modify even confirmed time sheets
This is particularly useful in case the "Invoicable" attribute
was not set correctly by the employee (who may even not know if
his work is invoicable to a customer or not)
2016-07-02 08:35:43 +00:00
Denis Ledoux 8558ecfdf3 [MERGE] forward port of branch saas-3 up to dd8cbf4 2015-11-06 16:08:30 +01:00
Denis Ledoux dd8cbf49ac [MERGE] forward port of branch 7.0 up to d24fcd1 2015-11-06 16:04:21 +01:00
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
matt454357 f243a01795 [FIX] hr_timesheet_sheet: Attendances & timesheets timezone
When creating timesheet,
default from-date and to-date are adjusted for user timezone.
Fixes #3627

User timezone considered when assigning attendance records to timesheet
Fixes #3628

Closes #3632
2015-09-02 11:48:55 +02:00
Christophe Simonis 3540ec53e4 [MERGE] forward port of branch saas-3 up to 6b70b80 2015-03-25 18:00:08 +01:00
Christophe Simonis 6b70b80a0e [MERGE] forward port of branch 7.0 up to 881c10b 2015-03-25 17:41:53 +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
Christophe Simonis 416f0246ac [MERGE] forward port of branch saas-3 up to 4a3c471 2015-03-09 12:03:22 +01:00
Christophe Simonis 4a3c4713e9 [MERGE] forward port of branch 7.0 up to 209ce6f 2015-03-09 11:24:32 +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
David Monjoie 5f45e7ca96 [FIX] hr_timesheet_sheet: properly unlink timesheets when deleting a timesheet_sheet
Adaptation of afe4a97d03, but we properly unlink the timesheet lines themselves instead of going for the account.analytic.lines like the original commit proposition did. Actually, the unlink method of hr.analytic.timesheet already unlinks the corresponding acount.analytic.line, but those records were previously deleted via ondelete='cascade', which didn't trigger the unlink method at all, so the associated analytic lines were not deleted accordingly.
Fixes opw 628256.
2015-02-26 16:18:08 +01:00
Denis Ledoux 1d7120a978 [FIX] hr_timesheet_sheet: prevent modify activities of confirmed sheets
In 7.0, prevent changes in activities of validated sheets was done thanks to the constraint
_check_sheet_state.
In 7.0, python constraints were checked at each write operations
whatever if the fields on which the constraint is were altered or not

This is no longer the case in Odoo 8.0: The constraint is checked
only if the fields on which the constraint is are altered.

As this specific constraint must be applied anytime, whatever the altered fields,
we now do this constraint check in the "write" method.
Besides, it was already the case for the unlink method.

opw-627415
2015-02-09 12:30:28 +01:00
Denis Ledoux eaa32e51dd [MERGE] forward port of branch saas-3 up to 9003537 2015-02-09 12:19:36 +01:00
Denis Ledoux 9003537222 [MERGE] forward port of branch 7.0 up to dd9d8b0 2015-02-09 12:14:09 +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 ccb4e4332e [FIX] hr_timesheet_sheet: prevent sheets overlaping
The constraint prevent sheets to overlap was broken because it relies on a check on the
user_id.  The problem is that the latter uses an old-api function field
that is not recomputed yet at the time of the validation.  The fix consists in
using a non-computed field instead.

This rev. is related to:
 - 4fb9c8f0dc
 - 6c78541978

Closes #4217
opw-620175
2015-01-14 13:35:38 +01:00
Denis Ledoux 295dcfc480 [MERGE] forward port of branch saas-3 up to b2be001 2015-01-07 12:49:06 +01:00
Denis Ledoux b2be001257 [MERGE] forward port of branch 7.0 up to dbb2a66 2015-01-07 12:48:39 +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
Denis Ledoux 29e08a272c [MERGE] forward port of branch saas-3 up to 5bd0249 2014-09-18 16:18:23 +02:00
Denis Ledoux 5bd0249515 [MERGE] forward port of branch 7.0 up to a218a9e 2014-09-18 16:05:34 +02: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
Raphael Collet 2398f480cd [IMP] addons: add _depends on models backed up by an sql view and used by other models 2014-07-08 15:32:38 +02:00
Raphael Collet a6b025d6d9 [FIX] models, fields: add model dependencies for models backed up by sql views 2014-07-08 10:16:16 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary `size` parameters on char fields 2014-06-25 17:13:43 +02:00
OstapYakovenko e035cc9105 [FIX] hr_timesheet_sheet: fix typo in field name 2014-06-02 18:37:52 +02:00
Christophe Simonis b8089a1521 [MERGE] forward port of branch saas-4 up to revid 9410 chs@openerp.com-20140507164207-kmme4tsrd4w1m7l1
bzr revid: chs@openerp.com-20140507170112-bjeltv2b0coy60am
2014-05-07 19:01:12 +02:00
Christophe Simonis 1091b24a0c [MERGE] forward port of branch saas-3 up to revid 9450 chs@openerp.com-20140507153348-g2qw61dkxvps13br
bzr revid: chs@openerp.com-20140507160023-8wwqlbf3bv7yqe67
2014-05-07 18:00:23 +02:00
Christophe Simonis 1953aa442f [MERGE] forward port of branch 7.0 up to revid 10037 mat@openerp.com-20140507133552-v4qsdp7qdp9iwewi
bzr revid: chs@openerp.com-20140507153348-g2qw61dkxvps13br
2014-05-07 17:33:48 +02:00
Gery Debongnie ad0ed2c4d8 [FIX] code cleanup (addon hr_timesheet_sheet)
remove try/except/statement that should not be here, uses search_count when appropriate, and remove a now useless one2many field

bzr revid: ged@openerp.com-20140507141725-h2z9u72roscf407n
2014-05-07 16:17:25 +02:00
Gery Debongnie 5aa2fa150c [MERGE] merge from trunk
bzr revid: ged@openerp.com-20140502130753-4z24z1to9pkrckvq
2014-05-02 15:07:53 +02:00
Antony Lesuisse 7e25b9ae55 [MERGE] saas-4 report_webkit missing dependency on report
bzr revid: al@openerp.com-20140501152604-4cobh5ui47dt4pem
bzr revid: al@openerp.com-20140501155633-gefnc3zqcsr2rhaz
bzr revid: al@openerp.com-20140501161156-4wbsvhh8gz4r22h3
2014-05-01 18:11:56 +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
Olivier Dony c3e812f34a [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 10025 rev-id odo@openerp.com-20140430102552-qkwv20b20nve64th
bzr revid: odo@openerp.com-20140430110048-6971xplq8k073tto
2014-04-30 13:00:48 +02:00
Denis Ledoux 79d4c57877 [MERGE] Forward-port of latest saas-3 bugfixes, up to rev. 9439 revid:dle@openerp.com-20140429112147-hqfqd0y487s817n7
bzr revid: dle@openerp.com-20140429112738-y2el246dmd2o2zy9
2014-04-29 13:27:38 +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
Denis Ledoux 2832d2ddc9 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 10016 revid:dle@openerp.com-20140425125507-njfyl1r6wn11vqwx
bzr revid: dle@openerp.com-20140425125926-5nchz1tcq4fx18jx
2014-04-25 14:59:26 +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
Christophe Simonis 7a7d7febf8 [MERGE] forward port of branch saas-3 up to revid 9429 chs@openerp.com-20140424123538-rxk9got9k2on1ki1
bzr revid: chs@openerp.com-20140424131824-4ksluvhnegp7kplb
bzr revid: chs@openerp.com-20140424134533-lhhcd32n3s0m9cqk
2014-04-24 15:45:33 +02:00
Christophe Simonis 52cfc16c2e [MERGE] forward port of branch 7.0 up to revid 10012 launchpad_translations_on_behalf_of_openerp-20140424063249-gwnojb5kvlq544nz
bzr revid: chs@openerp.com-20140424123538-rxk9got9k2on1ki1
2014-04-24 14:35:38 +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
Bharat Devnani (Open ERP) 3a0c820dfd [MERGE][IMP] More explicit error messages (in delivery, hr_timesheet_sheet, purchase, purchase_requisition, sale_stock, stock)
bzr revid: rim@openerp.com-20140422123022-22zef462lts0qyqi
2014-04-22 14:30:22 +02:00
Bharat R. Devnani (OpenERP) b8d4387d33 [MERGE] merged with main addons branch
bzr revid: bde@tinyerp.com-20140418061256-n53rymt5j8krzvr5
2014-04-18 11:42:56 +05:30
Gery Debongnie f57b767361 [MERGE] merge from trunk
bzr revid: ged@openerp.com-20140415150146-5ovdjzta58t5dhd2
2014-04-15 17:01:46 +02:00
Gery Debongnie 8135812d34 [FIX] moves the field definitions of models hr.job and hr.employee that should have been in submodules to their correct place (in hr_something) to avoid dependencies problems (addons hr, hr_*)
bzr revid: ged@openerp.com-20140415105419-wy026n5k10wo80wb
2014-04-15 12:54:19 +02:00