{"action":"opened","issue":{"url":"https://api.github.com/repos/frappe/erpnext/issues/2857","labels_url":"https://api.github.com/repos/frappe/erpnext/issues/2857/labels{/name}","comments_url":"https://api.github.com/repos/frappe/erpnext/issues/2857/comments","events_url":"https://api.github.com/repos/frappe/erpnext/issues/2857/events","html_url":"https://github.com/frappe/erpnext/issues/2857","id":58729120,"number":2857,"title":"[V5] Error in Workflow","user":{"login":"umairsy","id":910238,"avatar_url":"https://avatars.githubusercontent.com/u/910238?v=3","gravatar_id":"","url":"https://api.github.com/users/umairsy","html_url":"https://github.com/umairsy","followers_url":"https://api.github.com/users/umairsy/followers","following_url":"https://api.github.com/users/umairsy/following{/other_user}","gists_url":"https://api.github.com/users/umairsy/gists{/gist_id}","starred_url":"https://api.github.com/users/umairsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairsy/subscriptions","organizations_url":"https://api.github.com/users/umairsy/orgs","repos_url":"https://api.github.com/users/umairsy/repos","events_url":"https://api.github.com/users/umairsy/events{/privacy}","received_events_url":"https://api.github.com/users/umairsy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-24T12:03:05Z","updated_at":"2015-02-24T12:03:05Z","closed_at":null,"body":"I defined Workflow for the Sales Order document.\r\n\r\nWhile creating Sales Order, following is the server error when click on \"Save\".\r\n\r\nServer error:\r\n\r\nTraceback (innermost last):\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py\", line 18, in savedocs\r\n    doc.save()\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 211, in save\r\n    self.run_before_save_methods()\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 498, in run_before_save_methods\r\n    self.run_method(\"validate\")\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 464, in run_method\r\n    return Document.hook(fn)(self, *args, **kwargs)\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 575, in composer\r\n    return composed(self, method, *args, **kwargs)\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 558, in runner\r\n    add_to_return_value(self, fn(self, *args, **kwargs))\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 458, in \r\n    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py\", line 80, in validate\r\n    super(SalesOrder, self).validate()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py\", line 31, in validate\r\n    super(SellingController, self).validate()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py\", line 19, in validate\r\n    self.calculate_taxes_and_totals()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py\", line 56, in calculate_taxes_and_totals\r\n    calculate_taxes_and_totals(self)\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py\", line 16, in __init__\r\n    self.calculate()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py\", line 20, in calculate\r\n    self._calculate()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py\", line 33, in _calculate\r\n    self.calculate_taxes()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py\", line 220, in calculate_taxes\r\n    flt(self.doc.get(\"taxes\")[i-1].grand_total_for_current_item + current_tax_amount, tax.precision(\"total_taxes_and_charges\"))\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py\", line 427, in precision\r\n    if df.fieldtype in (\"Currency\", \"Float\", \"Percent\"):\r\n AttributeError: 'NoneType' object has no attribute 'fieldtype'\r\n\r\nTraceback (innermost last):\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/app.py\", line 49, in application\r\n    response = frappe.handler.handle()\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/handler.py\", line 62, in handle\r\n    execute_cmd(cmd)\r\n  File \"/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 724, in call\r\n    return fn(*args, **newargs)\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py\", line 18, in savedocs\r\n    doc.save()\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 211, in save\r\n    self.run_before_save_methods()\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 498, in run_before_save_methods\r\n    self.run_method(\"validate\")\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 464, in run_method\r\n    return Document.hook(fn)(self, *args, **kwargs)\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 575, in composer\r\n    return composed(self, method, *args, **kwargs)\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 558, in runner\r\n    add_to_return_value(self, fn(self, *args, **kwargs))\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 458, in \r\n    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py\", line 80, in validate\r\n    super(SalesOrder, self).validate()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/selling_controller.py\", line 31, in validate\r\n    super(SellingController, self).validate()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py\", line 19, in validate\r\n    self.calculate_taxes_and_totals()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/accounts_controller.py\", line 56, in calculate_taxes_and_totals\r\n    calculate_taxes_and_totals(self)\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py\", line 16, in __init__\r\n    self.calculate()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py\", line 20, in calculate\r\n    self._calculate()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py\", line 33, in _calculate\r\n    self.calculate_taxes()\r\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/taxes_and_totals.py\", line 220, in calculate_taxes\r\n    flt(self.doc.get(\"taxes\")[i-1].grand_total_for_current_item + current_tax_amount, tax.precision(\"total_taxes_and_charges\"))\r\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py\", line 427, in precision\r\n    if df.fieldtype in (\"Currency\", \"Float\", \"Percent\"):\r\n AttributeError: 'NoneType' object has no attribute 'fieldtype'"}}