Review: Needs Fixing
Hello Ravi,
I'm sorry, but this MP only solve the problem partially.
- The fields_view_get() on project.task remove widget="float" when "project
time mode" on company is different from "Hours" - so the default behaviour is
to have widget="float_time". But, on base tree view (view_task_tree2), used for
"Project / Project / Tasks", the widget="float_time" is not set at all.
[Yes I know the bug was only reported to form view]
- Concerning the translations, by default there is not translation for "Hours"
of type "code", only UoM have translation for it. So doing _('Hours') would
always return "Hours", and testing on translated value is not right here.
Ok, that leads to the following proposal:
0. Add missing widget="float_time" on fields requiring it
1. Get time mode twice: translated + untranslated
- tm = translated "company_id.project_time_mode_id.name"
- tm_ref = *untranslated* "company_id.project_time_mode_id.name"
2. To known if you need to remove widget="float_time", check on tm_ref
3. For field string translations:
3.1 Get "Hour" UoM by searching for UoM without context (we need that
because in that case "tm" is not Hour)
3.2 hour_tm_name = translated name of the uom we got on 3.1
3.3 Replace string containing hour_tm_name by tm
What do you think of that ?
Regards,
Xavier
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-50624-rgo/+merge/92717
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-opw-50624-rgo.
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp