{"action":"created","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/26513","repository_url":"https://api.github.com/repos/odoo/odoo","labels_url":"https://api.github.com/repos/odoo/odoo/issues/26513/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/26513/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/26513/events","html_url":"https://github.com/odoo/odoo/pull/26513","id":352880446,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwMDc3NzQ0","number":26513,"title":"[REF] stock: `_action_done` and cache invalidation","user":{"login":"amoyaux","id":5512395,"node_id":"MDQ6VXNlcjU1MTIzOTU=","avatar_url":"https://avatars2.githubusercontent.com/u/5512395?v=4","gravatar_id":"","url":"https://api.github.com/users/amoyaux","html_url":"https://github.com/amoyaux","followers_url":"https://api.github.com/users/amoyaux/followers","following_url":"https://api.github.com/users/amoyaux/following{/other_user}","gists_url":"https://api.github.com/users/amoyaux/gists{/gist_id}","starred_url":"https://api.github.com/users/amoyaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amoyaux/subscriptions","organizations_url":"https://api.github.com/users/amoyaux/orgs","repos_url":"https://api.github.com/users/amoyaux/repos","events_url":"https://api.github.com/users/amoyaux/events{/privacy}","received_events_url":"https://api.github.com/users/amoyaux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-22T09:50:37Z","updated_at":"2018-08-22T11:58:48Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/26513","html_url":"https://github.com/odoo/odoo/pull/26513","diff_url":"https://github.com/odoo/odoo/pull/26513.diff","patch_url":"https://github.com/odoo/odoo/pull/26513.patch"},"body":"It is possible that a call to `_action_done` will unlink a quant. This happens when\r\nmoving a product from a location to another one and makes null the quantity of this\r\nproduct in one of theses locations. In this case, we unlink the quant because it is\r\nnow useless and could be confusing on reports based on quants.\r\n\r\nThe unwanted side effect is that unlinking a record will invalidate the cache. In\r\nsome pathologic cases, like making an inventory adjustment of 600 products\r\nand reseting their quantity back to 0, the time of the operation is around 15\r\nminutes. With this patch that tries to work carefully with the cache invalidation,\r\nthe same operations takes around 15 secondes.\r\n\r\nDescription of the issue/feature this PR addresses:\r\n\r\nCurrent behavior before PR:\r\n\r\nDesired behavior after PR is merged:\r\n\r\n\r\n\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/415007493","html_url":"https://github.com/odoo/odoo/pull/26513#issuecomment-415007493","issue_url":"https://api.github.com/repos/odoo/odoo/issues/26513","id":415007493,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTAwNzQ5Mw==","user":{"login":"amoyaux","id":5512395,"node_id":"MDQ6VXNlcjU1MTIzOTU=","avatar_url":"https://avatars2.githubusercontent.com/u/5512395?v=4","gravatar_id":"","url":"https://api.github.com/users/amoyaux","html_url":"https://github.com/amoyaux","followers_url":"https://api.github.com/users/amoyaux/followers","following_url":"https://api.github.com/users/amoyaux/following{/other_user}","gists_url":"https://api.github.com/users/amoyaux/gists{/gist_id}","starred_url":"https://api.github.com/users/amoyaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amoyaux/subscriptions","organizations_url":"https://api.github.com/users/amoyaux/orgs","repos_url":"https://api.github.com/users/amoyaux/repos","events_url":"https://api.github.com/users/amoyaux/events{/privacy}","received_events_url":"https://api.github.com/users/amoyaux/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T11:58:48Z","updated_at":"2018-08-22T11:58:48Z","author_association":"CONTRIBUTOR","body":"Checked with SN and the patch is useless in this case. We think about a better solution."}}
{"actor":{"display_login":"amoyaux"}}