{"action":"closed","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/6189","labels_url":"https://api.github.com/repos/odoo/odoo/issues/6189/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/6189/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/6189/events","html_url":"https://github.com/odoo/odoo/issues/6189","id":66950721,"number":6189,"title":"[8.0] product_qty not initialized: this is a regression introduced by c9154e08","user":{"login":"gurneyalex","id":2032807,"avatar_url":"https://avatars.githubusercontent.com/u/2032807?v=3","gravatar_id":"","url":"https://api.github.com/users/gurneyalex","html_url":"https://github.com/gurneyalex","followers_url":"https://api.github.com/users/gurneyalex/followers","following_url":"https://api.github.com/users/gurneyalex/following{/other_user}","gists_url":"https://api.github.com/users/gurneyalex/gists{/gist_id}","starred_url":"https://api.github.com/users/gurneyalex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurneyalex/subscriptions","organizations_url":"https://api.github.com/users/gurneyalex/orgs","repos_url":"https://api.github.com/users/gurneyalex/repos","events_url":"https://api.github.com/users/gurneyalex/events{/privacy}","received_events_url":"https://api.github.com/users/gurneyalex/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-07T17:48:47Z","updated_at":"2015-04-08T10:07:12Z","closed_at":"2015-04-08T10:07:12Z","body":"I'm very concerned by  a1da6c21325ae7121aaba643aa1eea6401649dec by @simongoffin, which only fixes the symptom and not the underlying cause.\r\n\r\nI hit this issue when creating pickings from a SO with invoicing policy 'before delivery'. In which case, the stack leading to the creation of the stock move by the procurement goes through several workflow transitions. \r\n\r\nAt one step of this stack, account_move_line.reconcile() is called, which triggers the creation of an account_move_line. This call to models.create() goes in the \"recompute new-style fields\" section of models._create, which calls models.recompute. The code of recompute was modified in c9154e08 by @beledouxdenis to use with `rec.env.norecompute()`. \r\n\r\nAs a result of this, when the stock.move is finally created, `recs.env.recompute` is False. This causes stored function fields to not be recomputed and therefore not stored (see https://github.com/odoo/odoo/blob/8.0/openerp/models.py#L4252) which is exactly the point of c9154e08 from the changeset description. I don't understand why new API function fields are not affected by this behavior\r\n\r\nIn my opinion, c9154e08 is a problematic changeset, as it introduces this regression, an potentially many others, as any old api object created after the account move line in the chain of workflow propagation will suffer the same issues with its stored computed fields. \r\n\r\na1da6c21325ae7121aaba643aa1eea6401649dec does fix the problem for stock.move, but there are potentially production databases affected by this and being slowly and silently corrupted right now. "}}