Ver código fonte

Merge branch 'hotfix'

version-14
Nabin Hait 8 anos atrás
pai
commit
221f42a52e
3 arquivos alterados com 9 adições e 5 exclusões
  1. +1
    -1
      frappe/__init__.py
  2. +6
    -2
      frappe/model/document.py
  3. +2
    -2
      frappe/translate.py

+ 1
- 1
frappe/__init__.py Ver arquivo

@@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json
from .exceptions import * from .exceptions import *
from .utils.jinja import get_jenv, get_template, render_template from .utils.jinja import get_jenv, get_template, render_template


__version__ = "7.0.40"
__version__ = "7.0.41"


local = Local() local = Local()




+ 6
- 2
frappe/model/document.py Ver arquivo

@@ -999,8 +999,12 @@ def execute_action(doctype, name, action, **kwargs):
getattr(doc, action)(**kwargs) getattr(doc, action)(**kwargs)
except frappe.ValidationError: except frappe.ValidationError:
# add a comment (?) # add a comment (?)
doc.add_comment('Comment',
_('Action Failed') + '<br><br>' + json.loads(frappe.local.message_log[-1]).get('message'))
if frappe.local.message_log:
msg = json.loads(frappe.local.message_log[-1]).get('message')
else:
msg = '<pre><code>' + frappe.get_traceback() + '</pre></code>'
doc.add_comment('Comment', _('Action Failed') + '<br><br>' + msg)


doc.notify_update() doc.notify_update()
except Exception: except Exception:


+ 2
- 2
frappe/translate.py Ver arquivo

@@ -363,8 +363,8 @@ def get_messages_from_workflow(doctype=None, app_name=None):
'select distinct message from `tabWorkflow Document State` where parent=%s and message is not null', 'select distinct message from `tabWorkflow Document State` where parent=%s and message is not null',
(w['name'],), as_dict=True) (w['name'],), as_dict=True)


messages.extend([("Workflow: " + w['name'], states['message'])
for state in states if is_translatable(state['state'])])
messages.extend([("Workflow: " + w['name'], state['message'])
for state in states if is_translatable(state['message'])])


actions = frappe.db.sql( actions = frappe.db.sql(
'select distinct action from `tabWorkflow Transition` where parent=%s', 'select distinct action from `tabWorkflow Transition` where parent=%s',


Carregando…
Cancelar
Salvar