Sfoglia il codice sorgente

Fixed Merge Conflict

version-14
Nabin Hait 7 anni fa
parent
commit
4b5893509a
11 ha cambiato i file con 58 aggiunte e 14 eliminazioni
  1. +1
    -1
      frappe/__init__.py
  2. +5
    -0
      frappe/build.js
  3. +22
    -0
      frappe/core/doctype/domain/domain.py
  4. +4
    -3
      frappe/model/document.py
  5. +2
    -1
      frappe/patches.txt
  6. +6
    -4
      frappe/patches/v9_1/resave_domain_settings.py
  7. +10
    -0
      frappe/patches/v9_1/revert_domain_settings.py
  8. +4
    -1
      frappe/public/js/frappe/views/reports/query_report.js
  9. +2
    -2
      frappe/utils/print_format.py
  10. +1
    -1
      frappe/utils/selenium_testdriver.py
  11. +1
    -1
      requirements.txt

+ 1
- 1
frappe/__init__.py Vedi File

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

__version__ = '9.2.11'
__version__ = '9.2.12'
__title__ = "Frappe Framework"

local = Local()


+ 5
- 0
frappe/build.js Vedi File

@@ -54,6 +54,11 @@ function watch() {
console.log('file watching on *:', file_watcher_port);
});

if (process.env.CI) {
// don't watch inside CI
return;
}

compile_less().then(() => {
build();
watch_less(function (filename) {


+ 22
- 0
frappe/core/doctype/domain/domain.py Vedi File

@@ -31,6 +31,28 @@ class Domain(Document):
# custom on_setup method
frappe.get_attr(self.data.on_setup)()

def remove_domain(self):
'''Unset domain settings'''
self.setup_data()
for role_name in self.data.restricted_roles:
if frappe.db.exists('Role', role_name):
role = frappe.get_doc('Role', role_name)
role.disabled = 1
role.save()

if self.data.custom_fields:
for doctype in self.data.custom_fields:
custom_fields = self.data.custom_fields[doctype]

# custom_fields can be a list or dict
if isinstance(custom_fields, dict):
custom_fields = [custom_fields]

for custom_field_detail in custom_fields:
custom_field = frappe.get_doc('Custom Field',
dict(dt=doctype, fieldname=custom_field_detail.get('fieldname')))
custom_field.delete()


def setup_roles(self):
'''Enable roles that are restricted to this domain'''


+ 4
- 3
frappe/model/document.py Vedi File

@@ -848,10 +848,10 @@ class Document(BaseDocument):
- `before_update_after_submit` for **Update after Submit**

Will also update title_field if set"""
self.set_title_field()
self.reset_seen()

self.load_doc_before_save()
self.reset_seen()

if self.flags.ignore_validate:
return

@@ -866,6 +866,8 @@ class Document(BaseDocument):
elif self._action=="update_after_submit":
self.run_method("before_update_after_submit")

self.set_title_field()

def load_doc_before_save(self):
'''Save load document from db before saving'''
self._doc_before_save = None
@@ -874,7 +876,6 @@ class Document(BaseDocument):
or self.meta.get_set_only_once_fields())):
self.get_doc_before_save()


def run_post_save_methods(self):
"""Run standard methods after `INSERT` or `UPDATE`. Standard Methods are:



+ 2
- 1
frappe/patches.txt Vedi File

@@ -196,4 +196,5 @@ frappe.patches.v8_5.patch_event_colors
frappe.patches.v8_10.delete_static_web_page_from_global_search
frappe.patches.v8_x.add_bgn_xaf_xof_currencies
frappe.patches.v9_1.add_sms_sender_name_as_parameters
frappe.patches.v9_1.resave_domain_settings
frappe.patches.v9_1.resave_domain_settings
frappe.patches.v9_1.revert_domain_settings

+ 6
- 4
frappe/patches/v9_1/resave_domain_settings.py Vedi File

@@ -1,10 +1,12 @@
import frappe

def execute():
domains = ['Education', 'Healthcare', 'Hospitality']
domain_settings = frappe.get_doc('Domain Settings')
active_domains = [d.domain for d in domain_settings.active_domains]
try:
for d in domains:
domain = frappe.get_doc('Domain', d)
domain.setup_domain()
for d in ('Education', 'Healthcare', 'Hospitality'):
if d in active_domains and frappe.db.exists('Domain', d):
domain = frappe.get_doc('Domain', d)
domain.setup_domain()
except frappe.LinkValidationError:
pass

+ 10
- 0
frappe/patches/v9_1/revert_domain_settings.py Vedi File

@@ -0,0 +1,10 @@
import frappe

def execute():
domain_settings = frappe.get_doc('Domain Settings')
active_domains = [d.domain for d in domain_settings.active_domains]

for domain_name in ('Education', 'Healthcare', 'Hospitality'):
if frappe.db.exists('Domain', domain_name) and domain_name not in active_domains:
domain = frappe.get_doc('Domain', domain_name)
domain.remove_domain()

+ 4
- 1
frappe/public/js/frappe/views/reports/query_report.js Vedi File

@@ -328,7 +328,10 @@ frappe.views.QueryReport = Class.extend({
me.trigger_refresh();
}
}
df.ignore_link_validation = true;

// This is specifically done true earlier due to some reason. Please update if anyone finds that.
// Done false as the api can be used in the script reports which can break due to invalid links
df.ignore_link_validation = false;
}
});



+ 2
- 2
frappe/utils/print_format.py Vedi File

@@ -42,8 +42,8 @@ def read_multi_pdf(output):
return filedata

@frappe.whitelist()
def download_pdf(doctype, name, format=None, doc=None):
html = frappe.get_print(doctype, name, format, doc=doc)
def download_pdf(doctype, name, format=None, doc=None, no_letterhead=0):
html = frappe.get_print(doctype, name, format, doc=doc, no_letterhead=no_letterhead)
frappe.local.response.filename = "{name}.pdf".format(name=name.replace(" ", "-").replace("/", "-"))
frappe.local.response.filecontent = get_pdf(html)
frappe.local.response.type = "download"


+ 1
- 1
frappe/utils/selenium_testdriver.py Vedi File

@@ -140,7 +140,7 @@ class TestDriver(object):
for entry in self.driver.get_log('browser'):
source, line_no, message = entry.get('message').split(' ', 2)

if message[0] in ('"', "'"):
if message and message[0] in ('"', "'"):
# message is a quoted/escaped string
message = literal_eval(message)



+ 1
- 1
requirements.txt Vedi File

@@ -23,7 +23,7 @@ selenium
-e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
babel
ipython
html2text
html2text==2016.9.19
email_reply_parser
click
num2words==0.5.5


Caricamento…
Annulla
Salva