{"action":"created","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/11864","repository_url":"https://api.github.com/repos/odoo/odoo","labels_url":"https://api.github.com/repos/odoo/odoo/issues/11864/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/11864/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/11864/events","html_url":"https://github.com/odoo/odoo/pull/11864","id":151850076,"number":11864,"title":"[8.0][IMP] qweb: Improve current QWeb Widgets","user":{"login":"crimoniv","id":8294431,"avatar_url":"https://avatars.githubusercontent.com/u/8294431?v=3","gravatar_id":"","url":"https://api.github.com/users/crimoniv","html_url":"https://github.com/crimoniv","followers_url":"https://api.github.com/users/crimoniv/followers","following_url":"https://api.github.com/users/crimoniv/following{/other_user}","gists_url":"https://api.github.com/users/crimoniv/gists{/gist_id}","starred_url":"https://api.github.com/users/crimoniv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crimoniv/subscriptions","organizations_url":"https://api.github.com/users/crimoniv/orgs","repos_url":"https://api.github.com/users/crimoniv/repos","events_url":"https://api.github.com/users/crimoniv/events{/privacy}","received_events_url":"https://api.github.com/users/crimoniv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-29T11:57:43Z","updated_at":"2016-04-29T12:03:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/11864","html_url":"https://github.com/odoo/odoo/pull/11864","diff_url":"https://github.com/odoo/odoo/pull/11864.diff","patch_url":"https://github.com/odoo/odoo/pull/11864.patch"},"body":"### Description of the issue/feature this PR addresses:\r\nThere are common value types (as `date`, `datetime` and `float`) that don't have any *QWeb Widget*, so there is no way to format them when printing reports. This PR aims to provide a better report-oriented way to manage these values.\r\n\r\nThis PR does not change the current Odoo behavior but adds 3 new QWeb widgets (`date`, `datetime` and `float`) and extends the `monetary` widget funcionality.\r\n\r\n### Current behavior before PR:\r\n* `float` values are printed without any kind of precision\r\n* `date` and `datetime` values can only be printed with `strftime` and do not aply any TZ conversion by default.\r\n* `monetary` values, although they already have their own widget, are not able to apply currency conversions as the current widget is lacking the parameter `from_currency`.\r\n\r\n### Desired behavior after PR is merged:\r\n* `float` precision can be set with the parameter `digits`. The next example will print \"123.40\":\r\n```xml\r\n<span t-esc=\"123.4\" t-esc-options='{\"widget\": \"float\", \"digits\": [16, 2]}'/>\r\n```\r\n* `date` and `datetime` values can be formatted with `format` (just as happens with the current `date` and `datetime` field widgets). Also, they will be able to be converted to the current TZ. Usage:\r\n```xml\r\n<span t-esc=\"datetime.datetime.now()\" t-esc-options='{\"widget\": \"datetime\", \"format\": \"dd/MM/yyyy hh:mm\"}'/>\r\n```\r\n* `monetary` widget will be able to convert values between different currencies, e.g.:\r\n```xml\r\n<span t-esc=\"12.3\" t-esc-options='{\"widget\": \"monetary\", \"display_currency\": \"o.partner_currency_id\", \"from_currency\": \"o.company_currency_id\"}'/>\r\n```\r\n--\r\nI confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr\r\n"},"comment":{"url":"https://api.github.com/repos/odoo/odoo/issues/comments/215693921","html_url":"https://github.com/odoo/odoo/pull/11864#issuecomment-215693921","issue_url":"https://api.github.com/repos/odoo/odoo/issues/11864","id":215693921,"user":{"login":"Yenthe666","id":6352350,"avatar_url":"https://avatars.githubusercontent.com/u/6352350?v=3","gravatar_id":"","url":"https://api.github.com/users/Yenthe666","html_url":"https://github.com/Yenthe666","followers_url":"https://api.github.com/users/Yenthe666/followers","following_url":"https://api.github.com/users/Yenthe666/following{/other_user}","gists_url":"https://api.github.com/users/Yenthe666/gists{/gist_id}","starred_url":"https://api.github.com/users/Yenthe666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yenthe666/subscriptions","organizations_url":"https://api.github.com/users/Yenthe666/orgs","repos_url":"https://api.github.com/users/Yenthe666/repos","events_url":"https://api.github.com/users/Yenthe666/events{/privacy}","received_events_url":"https://api.github.com/users/Yenthe666/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T12:03:25Z","updated_at":"2016-04-29T12:03:25Z","body":"@crimoniv neat! It is nice to see somebody finally extending and improving the existing QWeb widgets. :+1: \r\n@odony I feel like you should be notified about this, I think this will interest you and otherwise it might stay floating around for a while."}}