[6.0.1] HR-Timesheets: Field "Department" is not pre-populated

Bug #708730 reported by Bernard Renier - ADN
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 3

Bug Description

Hello,

When creating a new timesheet, the field "Department" on top right remains empty.

I think it should be pre-populated with employee's department that is recorded in employee's data.

Maybe I am wrong, but I don't see any functional reason to have other approach...

Regards,

Bernard

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hi,

Here is a patch for this issue:
- a default value for the department
- an change event updating the department when the employee is changed.

Best regards,

-sbi

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

See also bug #796246 for a similar issue regarding expenses.

Revision history for this message
Bernard Renier - ADN (bre-adn) wrote :

Thanks for the patch Stéphane !

Amit Parik (amit-parik)
Changed in openobject-addons:
importance: Wishlist → Low
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Bernard Renier,

I have applied the changes in hr_timesheet_sheet from the patch attached by Stéphane Bidoul, now its working fine the department is prepopulated as the user logs in and onchange method is also applied when user is changed.

Here is the Revision ID and Revision number of the bug :

Revision ID: bde@tiny2-desktop-20110615100411-gs5vkug3kb0i8sg8
Revision Number : 4782

The changes will be merged in the main addons soon.

Thanks for your suggestion.

Warm Regards,
Devnani Bharat R.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Stéphane Bidoul,

I have looked at your patch and it seems working fine, i have applied your patch and it will be merged with main addons soon. Thanks for your concern.

Thanks & Regards,
Devnani Bharat R.

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Note that it seems that setting the default department is not necessary, as the on_change on employee_id should be sufficient (see https://bugs.launchpad.net/openobject-client-web/+bug/796246).

Also, IMHO, the on_change method should be named on_change_employee_id and not on_change_department_id, this would be more consistent with what I've seen in other parts of the code.

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello Bharat,

You can improve your merge proposal with #6.

Thanks Stéphane,
mra

Changed in openobject-addons:
milestone: none → 6.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.