Selaa lähdekoodia

Merge branch 'hotfix'

version-14
Nabin Hait 8 vuotta sitten
vanhempi
commit
ce4e170adb
3 muutettua tiedostoa jossa 12 lisäystä ja 12 poistoa
  1. +1
    -1
      frappe/__init__.py
  2. +1
    -1
      frappe/desk/query_report.py
  3. +10
    -10
      frappe/model/delete_doc.py

+ 1
- 1
frappe/__init__.py Näytä tiedosto

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

__version__ = '7.1.18'
__version__ = '7.1.19'
__title__ = "Frappe Framework"

local = Local()


+ 1
- 1
frappe/desk/query_report.py Näytä tiedosto

@@ -75,7 +75,7 @@ def run(report_name, filters=None, user=None):
frappe.msgprint(_("Must have report permission to access this report."),
raise_exception=True)

columns, result, message, chart = [], [], None, {}
columns, result, message, chart = [], [], None, None
if report.report_type=="Query Report":
if not report.query:
frappe.msgprint(_("Must specify a Query to run"), raise_exception=True)


+ 10
- 10
frappe/model/delete_doc.py Näytä tiedosto

@@ -168,16 +168,16 @@ def check_if_doc_is_linked(doc, method="Delete"):

for link_dt, link_field, issingle in link_fields:
if not issingle:
item = frappe.db.get_value(link_dt, {link_field:doc.name},
["name", "parent", "parenttype", "docstatus"], as_dict=True)
if item and ((item.parent or item.name) != doc.name) \
and ((method=="Delete" and item.docstatus<2) or (method=="Cancel" and item.docstatus==1)):
# raise exception only if
# linked to an non-cancelled doc when deleting
# or linked to a submitted doc when cancelling
frappe.throw(_("Cannot delete or cancel because {0} {1} is linked with {2} {3}")
.format(doc.doctype, doc.name, item.parenttype if item.parent else link_dt,
item.parent or item.name), frappe.LinkExistsError)
for item in frappe.db.get_values(link_dt, {link_field:doc.name},
["name", "parent", "parenttype", "docstatus"], as_dict=True):
if item and ((item.parent or item.name) != doc.name) \
and ((method=="Delete" and item.docstatus<2) or (method=="Cancel" and item.docstatus==1)):
# raise exception only if
# linked to an non-cancelled doc when deleting
# or linked to a submitted doc when cancelling
frappe.throw(_("Cannot delete or cancel because {0} {1} is linked with {2} {3}")
.format(doc.doctype, doc.name, item.parenttype if item.parent else link_dt,
item.parent or item.name), frappe.LinkExistsError)

def check_if_doc_is_dynamically_linked(doc, method="Delete"):
'''Raise `frappe.LinkExistsError` if the document is dynamically linked'''


Ladataan…
Peruuta
Tallenna