Merge branch 'staging-fixes' into staging
This commit is contained in:
commit
306ca0f446
9 changed files with 82 additions and 32 deletions
|
|
@ -125,14 +125,16 @@ def restore(context, sql_file_path, mariadb_root_username=None, mariadb_root_pas
|
|||
|
||||
@click.command('reinstall')
|
||||
@click.option('--admin-password', help='Administrator Password for reinstalled site')
|
||||
@click.option('--mariadb-root-username', help='Root username for MariaDB')
|
||||
@click.option('--mariadb-root-password', help='Root password for MariaDB')
|
||||
@click.option('--yes', is_flag=True, default=False, help='Pass --yes to skip confirmation')
|
||||
@pass_context
|
||||
def reinstall(context, admin_password=None, yes=False):
|
||||
def reinstall(context, admin_password=None, mariadb_root_username=None, mariadb_root_password=None, yes=False):
|
||||
"Reinstall site ie. wipe all data and start over"
|
||||
site = get_site(context)
|
||||
_reinstall(site, admin_password, yes, verbose=context.verbose)
|
||||
_reinstall(site, admin_password, mariadb_root_username, mariadb_root_password, yes, verbose=context.verbose)
|
||||
|
||||
def _reinstall(site, admin_password=None, yes=False, verbose=False):
|
||||
def _reinstall(site, admin_password=None, mariadb_root_username=None, mariadb_root_password=None, yes=False, verbose=False):
|
||||
if not yes:
|
||||
click.confirm('This will wipe your database. Are you sure you want to reinstall?', abort=True)
|
||||
try:
|
||||
|
|
@ -149,8 +151,9 @@ def _reinstall(site, admin_password=None, yes=False, verbose=False):
|
|||
frappe.destroy()
|
||||
|
||||
frappe.init(site=site)
|
||||
_new_site(frappe.conf.db_name, site, verbose=verbose, force=True, reinstall=True,
|
||||
install_apps=installed, admin_password=admin_password)
|
||||
_new_site(frappe.conf.db_name, site, verbose=verbose, force=True, reinstall=True, install_apps=installed,
|
||||
mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password,
|
||||
admin_password=admin_password)
|
||||
|
||||
@click.command('install-app')
|
||||
@click.argument('app')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
|
|
@ -517,6 +518,38 @@
|
|||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "disabled",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Disabled",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
|
|
@ -627,7 +660,7 @@
|
|||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-10-09 06:24:53.192890",
|
||||
"modified": "2018-11-27 17:57:21.913972",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Contacts",
|
||||
"name": "Address",
|
||||
|
|
|
|||
|
|
@ -81,16 +81,17 @@ class Address(Document):
|
|||
@frappe.whitelist()
|
||||
def get_default_address(doctype, name, sort_key='is_primary_address'):
|
||||
'''Returns default Address name for the given doctype, name'''
|
||||
out = frappe.db.sql('''select
|
||||
parent,
|
||||
(select `{0}` from tabAddress a where a.name=dl.parent) as `{0}`
|
||||
from
|
||||
`tabDynamic Link` dl
|
||||
where
|
||||
link_doctype=%s and
|
||||
link_name=%s and
|
||||
parenttype = "Address"
|
||||
'''.format(sort_key), (doctype, name))
|
||||
if sort_key not in ['is_shipping_address', 'is_primary_address']:
|
||||
return None
|
||||
|
||||
out = frappe.db.sql(""" SELECT
|
||||
addr.name, addr.%s
|
||||
FROM
|
||||
`tabAddress` addr, `tabDynamic Link` dl
|
||||
WHERE
|
||||
dl.parent = addr.name and dl.link_doctype = %s and
|
||||
dl.link_name = %s and ifnull(addr.disabled, 0) = 0
|
||||
""" %(sort_key, '%s', '%s'), (doctype, name))
|
||||
|
||||
if out:
|
||||
return sorted(out, key = functools.cmp_to_key(lambda x,y: cmp(y[1], x[1])))[0][0]
|
||||
|
|
@ -243,6 +244,7 @@ def address_query(doctype, txt, searchfield, start, page_len, filters):
|
|||
`tabDynamic Link`.parenttype = 'Address' and
|
||||
`tabDynamic Link`.link_doctype = %(link_doctype)s and
|
||||
`tabDynamic Link`.link_name = %(link_name)s and
|
||||
ifnull(`tabAddress`.disabled, 0) = 0 and
|
||||
`tabAddress`.`{key}` like %(txt)s
|
||||
{mcond} {condition}
|
||||
order by
|
||||
|
|
|
|||
|
|
@ -81,6 +81,9 @@ def generate_report_result(report, filters=None, user=None):
|
|||
if result:
|
||||
result = get_filtered_data(report.ref_doctype, columns, result, user)
|
||||
|
||||
if cint(report.add_total_row) and result:
|
||||
result = add_total_row(result, columns)
|
||||
|
||||
return {
|
||||
"result": result,
|
||||
"columns": columns,
|
||||
|
|
@ -325,10 +328,7 @@ def add_total_row(result, columns, meta = None):
|
|||
first_col_fieldtype = columns[0].get("fieldtype")
|
||||
|
||||
if first_col_fieldtype not in ["Currency", "Int", "Float", "Percent", "Date"]:
|
||||
if first_col_fieldtype == "Link":
|
||||
total_row[0] = "'" + _("Total") + "'"
|
||||
else:
|
||||
total_row[0] = _("Total")
|
||||
total_row[0] = _("Total")
|
||||
|
||||
result.append(total_row)
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ source_link = "https://github.com/frappe/frappe"
|
|||
app_license = "MIT"
|
||||
|
||||
develop_version = '12.x.x-develop'
|
||||
staging_version = '11.0.3-beta.34'
|
||||
staging_version = '11.0.3-beta.35'
|
||||
|
||||
app_email = "info@frappe.io"
|
||||
|
||||
|
|
|
|||
|
|
@ -393,17 +393,24 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
|
|||
}
|
||||
|
||||
render_datatable() {
|
||||
let data = this.data;
|
||||
if (this.raw_data.add_total_row) {
|
||||
data = data.slice();
|
||||
data.splice(-1, 1);
|
||||
}
|
||||
|
||||
if (this.datatable) {
|
||||
this.datatable.options.treeView = this.tree_report;
|
||||
this.datatable.refresh(this.data, this.columns);
|
||||
this.datatable.refresh(data, this.columns);
|
||||
} else {
|
||||
let datatable_options = {
|
||||
columns: this.columns,
|
||||
data: this.data,
|
||||
data: data,
|
||||
inlineFilters: true,
|
||||
treeView: this.tree_report,
|
||||
layout: 'fixed',
|
||||
cellHeight: 33
|
||||
cellHeight: 33,
|
||||
showTotalRow: this.raw_data.add_total_row
|
||||
};
|
||||
|
||||
if (this.report_settings.get_datatable_options) {
|
||||
|
|
@ -815,12 +822,17 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
|
|||
filters = Object.assign(frappe.urllib.get_dict("prepared_report_name"), filters);
|
||||
}
|
||||
|
||||
const visible_idx = this.datatable.datamanager.getFilteredRowIndices();
|
||||
if (visible_idx.length + 1 === this.data.length) {
|
||||
visible_idx.push(visible_idx.length);
|
||||
}
|
||||
|
||||
const args = {
|
||||
cmd: 'frappe.desk.query_report.export_query',
|
||||
report_name: this.report_name,
|
||||
file_format_type: file_format,
|
||||
filters: filters,
|
||||
visible_idx: this.datatable.datamanager.getFilteredRowIndices(),
|
||||
visible_idx: visible_idx,
|
||||
};
|
||||
|
||||
open_url_post(frappe.request.url, args);
|
||||
|
|
|
|||
|
|
@ -500,13 +500,13 @@ _f.Frm.prototype.render_form = function(is_a_different_doc) {
|
|||
// header must be refreshed before client methods
|
||||
// because add_custom_button
|
||||
() => this.refresh_header(is_a_different_doc),
|
||||
// call trigger
|
||||
() => this.script_manager.trigger("refresh"),
|
||||
// trigger global trigger
|
||||
// to use this
|
||||
() => $(document).trigger('form-refresh', [this]),
|
||||
// fields
|
||||
() => this.refresh_fields(),
|
||||
// call trigger
|
||||
() => this.script_manager.trigger("refresh"),
|
||||
// call onload post render for callbacks to be fired
|
||||
() => {
|
||||
if(this.cscript.is_onload) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
"awesomplete": "^1.1.2",
|
||||
"cookie": "^0.3.1",
|
||||
"express": "^4.16.2",
|
||||
"frappe-datatable": "^1.6.1",
|
||||
"frappe-datatable": "^1.6.2",
|
||||
"frappe-gantt": "^0.1.0",
|
||||
"fuse.js": "^3.2.0",
|
||||
"highlight.js": "^9.12.0",
|
||||
|
|
|
|||
|
|
@ -1219,10 +1219,10 @@ forwarded@~0.1.2:
|
|||
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
|
||||
integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=
|
||||
|
||||
frappe-datatable@^1.6.1:
|
||||
version "1.6.1"
|
||||
resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.6.1.tgz#e57850923b5f307fd02328c522c5abe35a17dd89"
|
||||
integrity sha512-u2l4I2Pwu4jTLSBF7vW7EDwzcRdfrlKbgaUCyhDUYlOhWl0sRt6rO2ZmIhU7znSYz7TNkKkAt7hkI+x+Mg6ONw==
|
||||
frappe-datatable@^1.6.2:
|
||||
version "1.6.2"
|
||||
resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.6.2.tgz#4144e2e15740a8b90dfd133410384214ee882ff9"
|
||||
integrity sha512-ES0wJnSa9LGCWpCDg7WKYeuHobWKsQJQn0t8rXvuscypg87BmW6EZAJRa1bL6E0HXrjyr7p5yNXH2LyUyiULkQ==
|
||||
dependencies:
|
||||
hyperlist "^1.0.0-beta"
|
||||
lodash "^4.17.5"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue