{"action":"created","issue":{"url":"https://api.github.com/repos/OCA/vertical-isp/issues/9","labels_url":"https://api.github.com/repos/OCA/vertical-isp/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/OCA/vertical-isp/issues/9/comments","events_url":"https://api.github.com/repos/OCA/vertical-isp/issues/9/events","html_url":"https://github.com/OCA/vertical-isp/pull/9","id":81981133,"number":9,"title":"[ADD] Enforce unique product codes on contracts","user":{"login":"veloutin","id":356233,"avatar_url":"https://avatars.githubusercontent.com/u/356233?v=3","gravatar_id":"","url":"https://api.github.com/users/veloutin","html_url":"https://github.com/veloutin","followers_url":"https://api.github.com/users/veloutin/followers","following_url":"https://api.github.com/users/veloutin/following{/other_user}","gists_url":"https://api.github.com/users/veloutin/gists{/gist_id}","starred_url":"https://api.github.com/users/veloutin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veloutin/subscriptions","organizations_url":"https://api.github.com/users/veloutin/orgs","repos_url":"https://api.github.com/users/veloutin/repos","events_url":"https://api.github.com/users/veloutin/events{/privacy}","received_events_url":"https://api.github.com/users/veloutin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-28T15:23:16Z","updated_at":"2015-05-28T20:59:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OCA/vertical-isp/pulls/9","html_url":"https://github.com/OCA/vertical-isp/pull/9","diff_url":"https://github.com/OCA/vertical-isp/pull/9.diff","patch_url":"https://github.com/OCA/vertical-isp/pull/9.patch"},"body":"Not sure if this is too specific, but here goes:\r\n\r\nThis module adds a restriction on contracts (account.analytic.account) services (contract.service) so that product codes cannot be repeated.\r\n\r\n1. Why not a constraint: To allow a smooth transition for existing data, the check is enforced when creating contracts or services, or when modifying contract services. This also prevents the new check from failing invoicing processes or anything that might write to the contract.\r\n2. Why restrict based on product code: We use lines with a \"Detail\" product that may be repeated for each service/product. This allows enforcing only on actual products."},"comment":{"url":"https://api.github.com/repos/OCA/vertical-isp/issues/comments/106596952","html_url":"https://github.com/OCA/vertical-isp/pull/9#issuecomment-106596952","issue_url":"https://api.github.com/repos/OCA/vertical-isp/issues/9","id":106596952,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T20:59:35Z","updated_at":"2015-05-28T20:59:35Z","body":"\n[![Coverage Status](https://coveralls.io/builds/2675084/badge)](https://coveralls.io/builds/2675084)\n\nCoverage decreased (-0.65%) to 60.19% when pulling **a1304b1c07019c212e8ebd3842b33c1bad9be5af on savoirfairelinux:7.0_contract_unique_product** into **c6a40aa4cdb9808ecde0e8d6fa3208a13016efdb on OCA:7.0**.\n"}}