{"action":"created","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/20691","repository_url":"https://api.github.com/repos/odoo/odoo","labels_url":"https://api.github.com/repos/odoo/odoo/issues/20691/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/20691/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/20691/events","html_url":"https://github.com/odoo/odoo/issues/20691","id":271194163,"number":20691,"title":"ISR Postal number regex","user":{"login":"dcoopennet","id":16645946,"avatar_url":"https://avatars2.githubusercontent.com/u/16645946?v=4","gravatar_id":"","url":"https://api.github.com/users/dcoopennet","html_url":"https://github.com/dcoopennet","followers_url":"https://api.github.com/users/dcoopennet/followers","following_url":"https://api.github.com/users/dcoopennet/following{/other_user}","gists_url":"https://api.github.com/users/dcoopennet/gists{/gist_id}","starred_url":"https://api.github.com/users/dcoopennet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcoopennet/subscriptions","organizations_url":"https://api.github.com/users/dcoopennet/orgs","repos_url":"https://api.github.com/users/dcoopennet/repos","events_url":"https://api.github.com/users/dcoopennet/events{/privacy}","received_events_url":"https://api.github.com/users/dcoopennet/received_events","type":"User","site_admin":false},"labels":[{"id":712046675,"url":"https://api.github.com/repos/odoo/odoo/labels/11.0","name":"11.0","color":"80f438","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-04T13:59:08Z","updated_at":"2017-11-07T09:21:26Z","closed_at":"2017-11-06T09:02:16Z","author_association":"NONE","body":"Impacted versions: 11.0\r\n\r\nSteps to reproduce:\r\n- No step required\r\n\r\nCurrent behavior:\r\n- The check with the regex on the postal number match absolutely no number.\r\n\r\nExpected behavior:\r\n- The check should match the last number of the postal account number (example: 01-123456-8 -> 8)\r\n\r\ndef _is_l10n_ch_postal:\r\n    if re.match('\\d+$', account_ref or ''):\r\n        account_ref_without_check = account_ref[:-1]\r\n        return mod10r(account_ref_without_check) == account_ref\r\n    return False\r\n\r\nI think you should replace match with search.\r\n"},"comment":{"url":"https://api.github.com/repos/odoo/odoo/issues/comments/342422585","html_url":"https://github.com/odoo/odoo/issues/20691#issuecomment-342422585","issue_url":"https://api.github.com/repos/odoo/odoo/issues/20691","id":342422585,"user":{"login":"open-net-sarl","id":8555256,"avatar_url":"https://avatars3.githubusercontent.com/u/8555256?v=4","gravatar_id":"","url":"https://api.github.com/users/open-net-sarl","html_url":"https://github.com/open-net-sarl","followers_url":"https://api.github.com/users/open-net-sarl/followers","following_url":"https://api.github.com/users/open-net-sarl/following{/other_user}","gists_url":"https://api.github.com/users/open-net-sarl/gists{/gist_id}","starred_url":"https://api.github.com/users/open-net-sarl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-net-sarl/subscriptions","organizations_url":"https://api.github.com/users/open-net-sarl/orgs","repos_url":"https://api.github.com/users/open-net-sarl/repos","events_url":"https://api.github.com/users/open-net-sarl/events{/privacy}","received_events_url":"https://api.github.com/users/open-net-sarl/received_events","type":"User","site_admin":false},"created_at":"2017-11-07T09:21:26Z","updated_at":"2017-11-07T09:21:26Z","author_association":"NONE","body":"So we have to input our account numbers without the \"-\" ?\r\nThe test i made were with the \"-\" and it seems that your method _is_l10n_ch_postal receive as argument the non-sanitized number."}}
{"actor":{"display_login":"open-net-sarl"}}