{"action":"created","issue":{"url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/47","labels_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/47/comments","events_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/47/events","html_url":"https://github.com/OCA/stock-logistics-warehouse/pull/47","id":70349302,"number":47,"title":"ADD module stock dynamic mto","user":{"login":"florian-dacosta","id":5393860,"avatar_url":"https://avatars.githubusercontent.com/u/5393860?v=3","gravatar_id":"","url":"https://api.github.com/users/florian-dacosta","html_url":"https://github.com/florian-dacosta","followers_url":"https://api.github.com/users/florian-dacosta/followers","following_url":"https://api.github.com/users/florian-dacosta/following{/other_user}","gists_url":"https://api.github.com/users/florian-dacosta/gists{/gist_id}","starred_url":"https://api.github.com/users/florian-dacosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florian-dacosta/subscriptions","organizations_url":"https://api.github.com/users/florian-dacosta/orgs","repos_url":"https://api.github.com/users/florian-dacosta/repos","events_url":"https://api.github.com/users/florian-dacosta/events{/privacy}","received_events_url":"https://api.github.com/users/florian-dacosta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-04-23T08:48:41Z","updated_at":"2015-06-29T08:51:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/pulls/47","html_url":"https://github.com/OCA/stock-logistics-warehouse/pull/47","diff_url":"https://github.com/OCA/stock-logistics-warehouse/pull/47.diff","patch_url":"https://github.com/OCA/stock-logistics-warehouse/pull/47.patch"},"body":"Hello,\r\n\r\nWith products configured with the make to order route, it can happen that we end with some stock in the warehouse.\r\nFor example, we have a sale order, so a purchase order is made, then we cancel the sale order and we have un-wanted stock because the purchase order was already validated by the supplier.\r\n\r\nThis stock will stay forever since everytime a new sale order is made for this product, a purchase order will be created, no matter if we have stock or not.\r\n\r\nSo the goal of this module is to take product from the stock if any, even if the route configured is make to order.\r\nTo do so, on each pull rule belonging to the make to orde route, we can configure an equivalent make to stock rule.\r\nThanks for reviews"},"comment":{"url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/comments/116532160","html_url":"https://github.com/OCA/stock-logistics-warehouse/pull/47#issuecomment-116532160","issue_url":"https://api.github.com/repos/OCA/stock-logistics-warehouse/issues/47","id":116532160,"user":{"login":"mylbco","id":3402495,"avatar_url":"https://avatars.githubusercontent.com/u/3402495?v=3","gravatar_id":"","url":"https://api.github.com/users/mylbco","html_url":"https://github.com/mylbco","followers_url":"https://api.github.com/users/mylbco/followers","following_url":"https://api.github.com/users/mylbco/following{/other_user}","gists_url":"https://api.github.com/users/mylbco/gists{/gist_id}","starred_url":"https://api.github.com/users/mylbco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mylbco/subscriptions","organizations_url":"https://api.github.com/users/mylbco/orgs","repos_url":"https://api.github.com/users/mylbco/repos","events_url":"https://api.github.com/users/mylbco/events{/privacy}","received_events_url":"https://api.github.com/users/mylbco/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T08:51:48Z","updated_at":"2015-06-29T08:51:48Z","body":"Florian\r\n\r\nI've done some testing.\r\n\r\nFirst test with scenario's described in the readme work like a charm.\r\nBut I got a scenario where the system throws a traceback. \r\nScenario\r\n1. create a demodatabase (sale - purchase) with demo data\r\n2.  install the module dropshipment,\r\n3. Create a sale order (eg) agrolait\r\n4. In this sales order create a new product (eg) abc / product type stockable / routes dropshipping + buy / add supplier info.\r\n5. Confirm the order\r\n\r\nI get this traceback : \r\n\r\nTraceback (most recent call last):\r\n  File \"/home/peterl/odoo/openerp/http.py\", line 537, in _handle_exception\r\n    return super(JsonRequest, self)._handle_exception(exception)\r\n  File \"/home/peterl/odoo/openerp/http.py\", line 574, in dispatch\r\n    result = self._call_function(**self.params)\r\n  File \"/home/peterl/odoo/openerp/http.py\", line 310, in _call_function\r\n    return checked_call(self.db, *args, **kwargs)\r\n  File \"/home/peterl/odoo/openerp/service/model.py\", line 113, in wrapper\r\n    return f(dbname, *args, **kwargs)\r\n  File \"/home/peterl/odoo/openerp/http.py\", line 307, in checked_call\r\n    return self.endpoint(*a, **kw)\r\n  File \"/home/peterl/odoo/openerp/http.py\", line 803, in __call__\r\n    return self.method(*args, **kw)\r\n  File \"/home/peterl/odoo/openerp/http.py\", line 403, in response_wrap\r\n    response = f(*args, **kw)\r\n  File \"/home/peterl/odoo/addons/web/controllers/main.py\", line 948, in call_button\r\n    action = self._call_kw(model, method, args, {})\r\n  File \"/home/peterl/odoo/addons/web/controllers/main.py\", line 936, in _call_kw\r\n    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 241, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/peterl/odoo/addons/portal_sale/portal_sale.py\", line 67, in action_button_confirm\r\n    return super(sale_order, self).action_button_confirm(cr, uid, ids, context=context)\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 241, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/peterl/odoo/addons/sale/sale.py\", line 602, in action_button_confirm\r\n    self.signal_workflow(cr, uid, ids, 'order_confirm')\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 241, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/peterl/odoo/openerp/models.py\", line 3557, in signal_workflow\r\n    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)\r\n  File \"/home/peterl/odoo/openerp/workflow/__init__.py\", line 85, in trg_validate\r\n    return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)\r\n  File \"/home/peterl/odoo/openerp/workflow/service.py\", line 91, in validate\r\n    res2 = wi.validate(signal)\r\n  File \"/home/peterl/odoo/openerp/workflow/instance.py\", line 75, in validate\r\n    wi.process(signal=signal, force_running=force_running, stack=stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 120, in process\r\n    ok = self._split_test(activity['split_mode'], signal, stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 248, in _split_test\r\n    self._join_test(t[0], t[1], stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 257, in _join_test\r\n    WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 95, in create\r\n    workflow_item.process(stack=stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 120, in process\r\n    ok = self._split_test(activity['split_mode'], signal, stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 248, in _split_test\r\n    self._join_test(t[0], t[1], stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 257, in _join_test\r\n    WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 95, in create\r\n    workflow_item.process(stack=stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 120, in process\r\n    ok = self._split_test(activity['split_mode'], signal, stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 248, in _split_test\r\n    self._join_test(t[0], t[1], stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 257, in _join_test\r\n    WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 95, in create\r\n    workflow_item.process(stack=stack)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 116, in process\r\n    if not self._execute(activity, stack):\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 162, in _execute\r\n    returned_action = self.wkf_expr_execute(activity)\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 313, in wkf_expr_execute\r\n    return self.wkf_expr_eval_expr(activity['action'])\r\n  File \"/home/peterl/odoo/openerp/workflow/workitem.py\", line 291, in wkf_expr_eval_expr\r\n    result = eval(line, env, nocopy=True)\r\n  File \"/home/peterl/odoo/openerp/tools/safe_eval.py\", line 314, in safe_eval\r\n    return eval(c, globals_dict, locals_dict)\r\n  File \"\", line 1, in <module>\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 239, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 546, in new_api\r\n    result = method(self._model, cr, uid, self.ids, *args, **kwargs)\r\n  File \"/home/peterl/odoo/addons/sale/sale.py\", line 735, in action_ship_create\r\n    procurement_obj.run(cr, uid, proc_ids, context=context)\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 241, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 363, in old_api\r\n    result = method(recs, *args, **kwargs)\r\n  File \"/home/peterl/stock-logistics-warehouse-mylbco/stock_mts_mto_rule/model/procurement.py\", line 67, in run\r\n    res = super(ProcurementOrder, self).run(autocommit=autocommit)\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 239, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/home/peterl/odoo/openerp/api.py\", line 546, in new_api\r\n    result = method(self._model, cr, uid, self.ids, *args, **kwargs)\r\nValueError: \"run() got an unexpected keyword argument 'autocommit'\" while evaluating\r\nu'action_ship_create()'"}}