default date values improperly set in UTC during actions triggered via workflows

Bug #949516 reported by Willow IT's Code Repository Admin
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
OpenERP's Framework R&D

Bug Description

The function in fields.date, context_today, uses the context variable 'tz'. Since context is not passed by workflow triggers, dates generated by workflow transitions are picking up UTC date, not the client's timezone date.

For example, validating a customer invoice that has no invoice date.

This is possibly related to bug:434266

Related branches

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Indeed, it seems important else the date of many records will simply be wrong...
Please also consider merging NaN and Akretion work to have workflow passing the context into 6.2 as it didn't make it into 6.1:
https://code.launchpad.net/~openerp-community/openobject-server/context-in-workflows/+merge/85518

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

As per following two branches which is contains the fix for this bug.

lp:~openerp-dev/openobject-server/trunk-workflow-context-odo
lp:~openerp-dev/openobject-addons/trunk-workflow-context-odo

These both branches currently On hold because need a discussion on this. So FP and odo will decide on this.

That's why I am setting this as a "Triaged" and assign to the respective team

Thank you!

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Dates generated by fields.date.context_today() and fields.datetime.context_timestamp() should fallback to the user's TZ when none can be detected in the context. This is similar to how the translation system now falls back to the user's language when no context language can be detected. This should be fixed soon.

The various tentative patches for passing context through workflows are much more dangerous and incomplete solutions, and should probably be abandoned. At some point the OpenERP API should also make the transaction context implicit, deprecating this discussion.

Changed in openobject-server:
importance: Low → Medium
milestone: none → 7.0
status: Triaged → In Progress
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

The correction described in previous comment was applied in 7.0 server at revision 4783 rev-id: <email address hidden>

Thanks for reporting!

summary: - Workflow doesn't propagate context - needed for correct date generation
+ default date values improperly set in UTC during actions triggered via
+ workflows
Changed in openobject-server:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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