{"action":"closed","issue":{"url":"https://api.github.com/repos/frappe/erpnext/issues/3066","labels_url":"https://api.github.com/repos/frappe/erpnext/issues/3066/labels{/name}","comments_url":"https://api.github.com/repos/frappe/erpnext/issues/3066/comments","events_url":"https://api.github.com/repos/frappe/erpnext/issues/3066/events","html_url":"https://github.com/frappe/erpnext/issues/3066","id":66568014,"number":3066,"title":"Error when saving Sales Invoice","user":{"login":"pagliaso","id":2955272,"avatar_url":"https://avatars.githubusercontent.com/u/2955272?v=3","gravatar_id":"","url":"https://api.github.com/users/pagliaso","html_url":"https://github.com/pagliaso","followers_url":"https://api.github.com/users/pagliaso/followers","following_url":"https://api.github.com/users/pagliaso/following{/other_user}","gists_url":"https://api.github.com/users/pagliaso/gists{/gist_id}","starred_url":"https://api.github.com/users/pagliaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pagliaso/subscriptions","organizations_url":"https://api.github.com/users/pagliaso/orgs","repos_url":"https://api.github.com/users/pagliaso/repos","events_url":"https://api.github.com/users/pagliaso/events{/privacy}","received_events_url":"https://api.github.com/users/pagliaso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/frappe/erpnext/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/frappe/erpnext/labels/watchlist","name":"watchlist","color":"fbca04"}],"state":"closed","locked":false,"assignee":{"login":"nabinhait","id":836784,"avatar_url":"https://avatars.githubusercontent.com/u/836784?v=3","gravatar_id":"","url":"https://api.github.com/users/nabinhait","html_url":"https://github.com/nabinhait","followers_url":"https://api.github.com/users/nabinhait/followers","following_url":"https://api.github.com/users/nabinhait/following{/other_user}","gists_url":"https://api.github.com/users/nabinhait/gists{/gist_id}","starred_url":"https://api.github.com/users/nabinhait/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nabinhait/subscriptions","organizations_url":"https://api.github.com/users/nabinhait/orgs","repos_url":"https://api.github.com/users/nabinhait/repos","events_url":"https://api.github.com/users/nabinhait/events{/privacy}","received_events_url":"https://api.github.com/users/nabinhait/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/frappe/erpnext/milestones/23","html_url":"https://github.com/frappe/erpnext/milestones/Version%205%20Cleanup","labels_url":"https://api.github.com/repos/frappe/erpnext/milestones/23/labels","id":1066385,"number":23,"title":"Version 5 Cleanup","description":"","creator":{"login":"rmehta","id":140076,"avatar_url":"https://avatars.githubusercontent.com/u/140076?v=3","gravatar_id":"","url":"https://api.github.com/users/rmehta","html_url":"https://github.com/rmehta","followers_url":"https://api.github.com/users/rmehta/followers","following_url":"https://api.github.com/users/rmehta/following{/other_user}","gists_url":"https://api.github.com/users/rmehta/gists{/gist_id}","starred_url":"https://api.github.com/users/rmehta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmehta/subscriptions","organizations_url":"https://api.github.com/users/rmehta/orgs","repos_url":"https://api.github.com/users/rmehta/repos","events_url":"https://api.github.com/users/rmehta/events{/privacy}","received_events_url":"https://api.github.com/users/rmehta/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":3,"state":"open","created_at":"2015-04-14T07:17:04Z","updated_at":"2015-05-25T09:39:03Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-04-06T09:27:37Z","updated_at":"2015-05-25T09:39:03Z","closed_at":"2015-05-25T09:39:03Z","body":"Hello,\r\n\r\nI have just tried to modify an invoice created in v4 and saved correctly, and I get the following message.\r\n\r\nI am on v5.\r\n\r\nTraceback (innermost last):\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/desk/form/save.py\", line 18, in savedocs\r\n    doc.save()\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 218, in save\r\n    self.run_before_save_methods()\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 535, in run_before_save_methods\r\n    self.run_method(\"validate\")\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 501, in run_method\r\n    return Document.hook(fn)(self, *args, **kwargs)\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 614, in composer\r\n    return composed(self, method, *args, **kwargs)\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 597, in runner\r\n    add_to_return_value(self, fn(self, *args, **kwargs))\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 495, in \r\n    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\r\n  File \"/home/erpnext/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py\", line 46, in validate\r\n    self.validate_debit_to_acc()\r\n  File \"/home/erpnext/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py\", line 240, in validate_debit_to_acc\r\n    root_type, account_type = frappe.db.get_value(\"Account\", self.debit_to, [\"root_type\", \"account_type\"])\r\n TypeError: 'NoneType' object is not iterable\r\n\r\nTraceback (innermost last):\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/app.py\", line 51, in application\r\n    response = frappe.handler.handle()\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py\", line 62, in handle\r\n    execute_cmd(cmd)\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py\", line 85, in execute_cmd\r\n    ret = frappe.call(method, **frappe.form_dict)\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py\", line 716, in call\r\n    return fn(*args, **newargs)\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/desk/form/save.py\", line 18, in savedocs\r\n    doc.save()\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 218, in save\r\n    self.run_before_save_methods()\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 535, in run_before_save_methods\r\n    self.run_method(\"validate\")\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 501, in run_method\r\n    return Document.hook(fn)(self, *args, **kwargs)\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 614, in composer\r\n    return composed(self, method, *args, **kwargs)\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 597, in runner\r\n    add_to_return_value(self, fn(self, *args, **kwargs))\r\n  File \"/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py\", line 495, in \r\n    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\r\n  File \"/home/erpnext/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py\", line 46, in validate\r\n    self.validate_debit_to_acc()\r\n  File \"/home/erpnext/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py\", line 240, in validate_debit_to_acc\r\n    root_type, account_type = frappe.db.get_value(\"Account\", self.debit_to, [\"root_type\", \"account_type\"])\r\n TypeError: 'NoneType' object is not iterable\r\n\r\nMany thanks and kind regards from spain"}}