Browse Source

[fix] print report issue

version-14
Rushabh Mehta 8 years ago
parent
commit
d0aecc0be6
4 changed files with 58 additions and 4 deletions
  1. +54
    -1
      frappe/core/doctype/docperm/docperm.json
  2. +1
    -0
      frappe/data/Framework.sql
  3. +2
    -2
      frappe/public/js/frappe/views/reports/print_grid.html
  4. +1
    -1
      frappe/public/js/lib/microtemplate.js

+ 54
- 1
frappe/core/doctype/docperm/docperm.json View File

@@ -14,6 +14,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "role_and_level", "fieldname": "role_and_level",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -38,6 +39,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "role", "fieldname": "role",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@@ -67,6 +69,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"description": "Filter records based on User Permissions defined for a user", "description": "Filter records based on User Permissions defined for a user",
"fieldname": "apply_user_permissions", "fieldname": "apply_user_permissions",
"fieldtype": "Check", "fieldtype": "Check",
@@ -92,6 +95,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"description": "Apply this rule if the User is the Owner", "description": "Apply this rule if the User is the Owner",
"fieldname": "if_owner", "fieldname": "if_owner",
"fieldtype": "Check", "fieldtype": "Check",
@@ -118,6 +122,34 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "is_custom",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Custom",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_2", "fieldname": "column_break_2",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
@@ -141,6 +173,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "0", "default": "0",
"fieldname": "permlevel", "fieldname": "permlevel",
"fieldtype": "Int", "fieldtype": "Int",
@@ -170,6 +203,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"depends_on": "", "depends_on": "",
"description": "JSON list of DocTypes used to apply User Permissions. If empty, all linked DocTypes will be used to apply User Permissions.", "description": "JSON list of DocTypes used to apply User Permissions. If empty, all linked DocTypes will be used to apply User Permissions.",
"fieldname": "user_permission_doctypes", "fieldname": "user_permission_doctypes",
@@ -196,6 +230,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "section_break_4", "fieldname": "section_break_4",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -220,6 +255,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "read", "fieldname": "read",
"fieldtype": "Check", "fieldtype": "Check",
@@ -249,6 +285,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "write", "fieldname": "write",
"fieldtype": "Check", "fieldtype": "Check",
@@ -278,6 +315,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "create", "fieldname": "create",
"fieldtype": "Check", "fieldtype": "Check",
@@ -307,6 +345,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "delete", "fieldname": "delete",
"fieldtype": "Check", "fieldtype": "Check",
@@ -332,6 +371,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "column_break_8", "fieldname": "column_break_8",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
@@ -355,6 +395,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "submit", "fieldname": "submit",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
@@ -383,6 +424,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "cancel", "fieldname": "cancel",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
@@ -411,6 +453,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "amend", "fieldname": "amend",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
@@ -439,6 +482,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "additional_permissions", "fieldname": "additional_permissions",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -463,6 +507,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "report", "fieldname": "report",
"fieldtype": "Check", "fieldtype": "Check",
@@ -490,6 +535,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "export", "fieldname": "export",
"fieldtype": "Check", "fieldtype": "Check",
@@ -515,6 +561,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "import", "fieldname": "import",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
@@ -539,6 +586,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"description": "This role update User Permissions for a user", "description": "This role update User Permissions for a user",
"fieldname": "set_user_permissions", "fieldname": "set_user_permissions",
"fieldtype": "Check", "fieldtype": "Check",
@@ -564,6 +612,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "column_break_19", "fieldname": "column_break_19",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
@@ -587,6 +636,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "share", "fieldname": "share",
"fieldtype": "Check", "fieldtype": "Check",
@@ -613,6 +663,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "print", "fieldname": "print",
"fieldtype": "Check", "fieldtype": "Check",
@@ -638,6 +689,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "email", "fieldname": "email",
"fieldtype": "Check", "fieldtype": "Check",
@@ -670,7 +722,7 @@
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"max_attachments": 0, "max_attachments": 0,
"modified": "2016-07-11 03:27:59.695670",
"modified": "2016-09-29 08:07:20.450064",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Core", "module": "Core",
"name": "DocPerm", "name": "DocPerm",
@@ -679,5 +731,6 @@
"quick_entry": 0, "quick_entry": 0,
"read_only": 0, "read_only": 0,
"read_only_onload": 0, "read_only_onload": 0,
"sort_order": "ASC",
"track_seen": 0 "track_seen": 0
} }

+ 1
- 0
frappe/data/Framework.sql View File

@@ -77,6 +77,7 @@ CREATE TABLE `tabDocPerm` (
`permlevel` int(11) DEFAULT '0', `permlevel` int(11) DEFAULT '0',
`role` varchar(255) DEFAULT NULL, `role` varchar(255) DEFAULT NULL,
`match` varchar(255) DEFAULT NULL, `match` varchar(255) DEFAULT NULL,
`is_custom` int(1) NOT NULL DEFAULT 0,
`read` int(1) NOT NULL DEFAULT 1, `read` int(1) NOT NULL DEFAULT 1,
`write` int(1) NOT NULL DEFAULT 1, `write` int(1) NOT NULL DEFAULT 1,
`create` int(1) NOT NULL DEFAULT 1, `create` int(1) NOT NULL DEFAULT 1,


+ 2
- 2
frappe/public/js/frappe/views/reports/print_grid.html View File

@@ -2,7 +2,7 @@
{% if title %} {% if title %}
<h2>{{ __(title) }}</h2> <h2>{{ __(title) }}</h2>
<hr> <hr>
{{ endif }}
{% endif %}
<table class="table table-bordered"> <table class="table table-bordered">
<!-- heading --> <!-- heading -->
<thead> <thead>
@@ -27,7 +27,7 @@
{% var value = col.fieldname ? row[col.fieldname] : row[col.id]; %} {% var value = col.fieldname ? row[col.fieldname] : row[col.id]; %}


<td>{{ col.formatter <td>{{ col.formatter
? col.formatter(i, c, value, col, row, true)
? col.formatter(row._index, col._index, value, col, row, true)
: value }}</td> : value }}</td>
{% endif %} {% endif %}
{% endfor %} {% endfor %}


+ 1
- 1
frappe/public/js/lib/microtemplate.js View File

@@ -26,7 +26,7 @@ frappe.template.compile = function(str, name) {
var i = frappe.utils.get_random(3); var i = frappe.utils.get_random(3);
var len = frappe.utils.get_random(3); var len = frappe.utils.get_random(3);
return "{% for (var "+i+"=0, "+len+"="+p2+".length; "+i+"<"+len+"; "+i+"++) { var " return "{% for (var "+i+"=0, "+len+"="+p2+".length; "+i+"<"+len+"; "+i+"++) { var "
+p1+" = "+p2+"["+i+"]; %}";
+p1+" = "+p2+"["+i+"]; "+p1+"._index = "+i+"; %}";
} }
str = str.replace(/{%\s?for\s([a-z]+)\sin\s([a-z._]+)\s?%}/g, replacer); str = str.replace(/{%\s?for\s([a-z]+)\sin\s([a-z._]+)\s?%}/g, replacer);




Loading…
Cancel
Save