{"action":"created","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/6036","labels_url":"https://api.github.com/repos/odoo/odoo/issues/6036/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/6036/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/6036/events","html_url":"https://github.com/odoo/odoo/pull/6036","id":65171086,"number":6036,"title":"[8.0] Ignore canceled sales order lines","user":{"login":"guewen","id":417223,"avatar_url":"https://avatars.githubusercontent.com/u/417223?v=3","gravatar_id":"","url":"https://api.github.com/users/guewen","html_url":"https://github.com/guewen","followers_url":"https://api.github.com/users/guewen/followers","following_url":"https://api.github.com/users/guewen/following{/other_user}","gists_url":"https://api.github.com/users/guewen/gists{/gist_id}","starred_url":"https://api.github.com/users/guewen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guewen/subscriptions","organizations_url":"https://api.github.com/users/guewen/orgs","repos_url":"https://api.github.com/users/guewen/repos","events_url":"https://api.github.com/users/guewen/events{/privacy}","received_events_url":"https://api.github.com/users/guewen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":35,"created_at":"2015-03-30T09:25:03Z","updated_at":"2015-04-17T10:41:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/6036","html_url":"https://github.com/odoo/odoo/pull/6036","diff_url":"https://github.com/odoo/odoo/pull/6036.diff","patch_url":"https://github.com/odoo/odoo/pull/6036.patch"},"body":"**Ignore canceled sales order lines**\r\n\r\nThe sales order lines have a `canceled` state, but this state is not always considered when some logic is looping over lines. This check is done in some places already and this PR's aim is to do it in the remaining places.\r\n\r\nWe encountered this issue when developing the module [sale_amendment](https://github.com/guewen/sale-workflow/tree/8.0-sale_amendment/sale_amendment) which allows to amend sales orders and thus, to cancel only a part of the lines in a sales order.\r\n\r\nHow to reproduce on runbot (only a selection of things that are corrected here):\r\n* Go to `Settings > Technical > User Interface > Menu Items`\r\n* Create a new menu with name : `Sales Order Lines`, parent menu : `Sales/Sales`; action: `ir.actions.act_window`, `Sales Order Lines`.\r\n* Go to `Sales > Sales > Sales Order Lines` \r\n* Search for the line from `SO005` with the product `[EXT-HDD] External Hard disk`\r\n* Click on `Cancel Line`\r\n* Open `SO005`\r\n* Bug 1: the total amount still includes the amount of the canceled line\r\n* Open the Delivery Order of the SO `SO005` and cancel it; the SO is now in `shipping_except`\r\n* Go to the sales order `SO005` and click on `Recreate Delivery Order`\r\n* Bug 2: the new delivery order has a move for the canceled order line\r\n\r\nI am going to propose a similar PR on the purchases orders.\r\n\r\n@qdp-odoo @jco-odoo  I would be glad if you could review this"},"comment":{"url":"https://api.github.com/repos/odoo/odoo/issues/comments/93962496","html_url":"https://github.com/odoo/odoo/pull/6036#issuecomment-93962496","issue_url":"https://api.github.com/repos/odoo/odoo/issues/6036","id":93962496,"user":{"login":"jco-odoo","id":3832699,"avatar_url":"https://avatars.githubusercontent.com/u/3832699?v=3","gravatar_id":"","url":"https://api.github.com/users/jco-odoo","html_url":"https://github.com/jco-odoo","followers_url":"https://api.github.com/users/jco-odoo/followers","following_url":"https://api.github.com/users/jco-odoo/following{/other_user}","gists_url":"https://api.github.com/users/jco-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/jco-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jco-odoo/subscriptions","organizations_url":"https://api.github.com/users/jco-odoo/orgs","repos_url":"https://api.github.com/users/jco-odoo/repos","events_url":"https://api.github.com/users/jco-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/jco-odoo/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T10:41:53Z","updated_at":"2015-04-17T10:41:53Z","body":"Main doubts we have is about how to interpret a cancelled state of a sale\norder line: should it change the amount of the sale order or not (as it is\nweird to have a cancelled sale order with an amount of 0), what is the\ndifference between a cancelled and a deleted line (if exception, should it\nbe regenerated?)\n\nOn Thu, Apr 16, 2015 at 11:48 AM, Joël Grand-Guillaume <\nnotifications@github.com> wrote:\n\n> @odony <https://github.com/odony> @jco-odoo <https://github.com/jco-odoo>\n> Any new/update on this one ?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/odoo/odoo/pull/6036#issuecomment-93694761>.\n>\n"}}