Merge branch 'develop' of https://github.com/Aradhya-Tripathi/frappe into query-conversion

This commit is contained in:
Aradhya-Tripathi 2021-10-14 22:47:50 +05:30
commit d72df06e4b
4 changed files with 30 additions and 1 deletions

View file

@ -15,5 +15,6 @@ core/ @surajshetty3416
database @gavindsouza
model @gavindsouza
requirements.txt @gavindsouza
query_builder/ @gavindsouza
commands/ @gavindsouza
workspace @shariquerik

View file

@ -36,7 +36,7 @@ frappe.ui.form.on("Print Format", {
else if (frm.doc.custom_format && !frm.doc.raw_printing) {
frm.set_df_property("html", "reqd", 1);
}
if (frappe.perm.has_perm('DocType', 0, 'read', frm.doc.doc_type)) {
if (frappe.model.can_read(frm.doc.doc_type)) {
frappe.db.get_value('DocType', frm.doc.doc_type, 'default_print_format', (r) => {
if (r.default_print_format != frm.doc.name) {
frm.add_custom_button(__("Set as Default"), function () {

View file

@ -56,6 +56,11 @@ $('body').on('click', 'a', function(e) {
return override(e.currentTarget.hash);
}
if (frappe.router.is_app_route(e.currentTarget.pathname)) {
// target has "/app, this is a v2 style route.
return override(e.currentTarget.pathname + e.currentTarget.hash);
}
});
frappe.router = {

View file

@ -28,6 +28,17 @@ class MariaDB(Base, MySQLQuery):
table = cls.DocType(table)
return super().from_(table, *args, **kwargs)
@classmethod
def into(cls, table, *args, **kwargs):
if isinstance(table, str):
table = cls.DocType(table)
return super().into(table, *args, **kwargs)
@classmethod
def update(cls, table, *args, **kwargs):
if isinstance(table, str):
table = cls.DocType(table)
return super().update(table, *args, **kwargs)
class Postgres(Base, PostgreSQLQuery):
field_translation = {"table_name": "relname", "table_rows": "n_tup_ins"}
@ -58,3 +69,15 @@ class Postgres(Base, PostgreSQLQuery):
table = cls.DocType(table)
return super().from_(table, *args, **kwargs)
@classmethod
def into(cls, table, *args, **kwargs):
if isinstance(table, str):
table = cls.DocType(table)
return super().into(table, *args, **kwargs)
@classmethod
def update(cls, table, *args, **kwargs):
if isinstance(table, str):
table = cls.DocType(table)
return super().update(table, *args, **kwargs)