From dc79334f1cbbe726837b2af71f533e604ce05b9d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 9 Sep 2014 12:35:15 +0530 Subject: [PATCH 1/2] [fix] Clear website cache for Item Group on saving Item --- erpnext/setup/doctype/item_group/item_group.py | 5 +++-- erpnext/stock/doctype/item/item.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 944dfb1a789..59a0ecb24fe 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -102,7 +102,8 @@ def invalidate_cache_for(doc, item_group=None): if not item_group: item_group = doc.name - for i in get_parent_item_groups(item_group): - route = doc.get_route() + for d in get_parent_item_groups(item_group): + d = frappe.get_doc("Item Group", d.name) + route = d.get_route() if route: clear_cache(route) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index c158014797a..17fe0ae0a03 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -374,5 +374,5 @@ def invalidate_cache_for_item(doc): for item_group in website_item_groups: invalidate_cache_for(doc, item_group) - if doc.get("old_item_group"): + if doc.get("old_item_group") and doc.get("old_item_group") != doc.item_group: invalidate_cache_for(doc, doc.old_item_group) From 48b3d1383fe7f40e18748a7a3b5c7344af8f16be Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 9 Sep 2014 12:59:16 +0530 Subject: [PATCH 2/2] [minor] Cheque Printing Format --- .../cheque_printing_format/cheque_printing_format.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/print_format/cheque_printing_format/cheque_printing_format.json b/erpnext/accounts/print_format/cheque_printing_format/cheque_printing_format.json index 47fe0133659..ce61fa1fc8c 100755 --- a/erpnext/accounts/print_format/cheque_printing_format/cheque_printing_format.json +++ b/erpnext/accounts/print_format/cheque_printing_format/cheque_printing_format.json @@ -3,9 +3,9 @@ "doc_type": "Journal Voucher", "docstatus": 0, "doctype": "Print Format", - "html": "
\n\n\t{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n
\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Advice\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n{%- for label, value in (\n (_(\"Voucher Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Reference / Cheque No.\"), doc.cheque_no),\n (_(\"Reference / Cheque Date\"), frappe.utils.formatdate(doc.cheque_date))\n ) -%}\n
\n
\n
{{ value }}
\n
\n{%- endfor -%}\n\t
\n\t

{{ _(\"This amount is in full / part settlement of the listed bills\") }}:

\n{%- for label, value in (\n (_(\"Amount\"), \"\" + doc.total_amount + \"
\" + (doc.total_amount_in_words or \"\") + \"
\"),\n (_(\"References\"), doc.remark)\n ) -%}\n
\n
\n
{{ value }}
\n
\n {%- endfor -%}\n
\n\t
\n\t\tPrepared By
\n\t
\n\t\tAuthorised Signatory
\n\t
\n\t\tReceived Payment as Above
\n\t
\n\t\t_____________
\n\t
\n\t\tA/C Payee
\n\t
\n\t\t_____________
\n\t
\n\t\t{{ frappe.utils.formatdate(doc.cheque_date) }}
\n\t
\n\t\t{{ doc.pay_to_recd_from }}
\n\t
\n\t\t{{ doc.total_amount_in_words }}
\n\t
\n\t\t{{ doc.total_amount }}
\n
", + "html": "
\n\n\t{%- from \"templates/print_formats/standard_macros.html\" import add_header -%}\n
\n {%- if not doc.get(\"print_heading\") and not doc.get(\"select_print_heading\") \n and doc.set(\"select_print_heading\", _(\"Payment Advice\")) -%}{%- endif -%}\n {{ add_header(0, 1, doc, letter_head, no_letterhead) }}\n\n{%- for label, value in (\n (_(\"Voucher Date\"), frappe.utils.formatdate(doc.voucher_date)),\n (_(\"Reference / Cheque No.\"), doc.cheque_no),\n (_(\"Reference / Cheque Date\"), frappe.utils.formatdate(doc.cheque_date))\n ) -%}\n
\n
\n
{{ value }}
\n
\n{%- endfor -%}\n\t
\n\t

{{ _(\"This amount is in full / part settlement of the listed bills\") }}:

\n{%- for label, value in (\n (_(\"Amount\"), \"\" + (doc.total_amount or \"\") + \"
\" + (doc.total_amount_in_words or \"\") + \"
\"),\n (_(\"References\"), doc.remark)\n ) -%}\n
\n
\n
{{ value }}
\n
\n {%- endfor -%}\n
\n\t
\n\t\tPrepared By
\n\t
\n\t\tAuthorised Signatory
\n\t
\n\t\tReceived Payment as Above
\n\t
\n\t\t_____________
\n\t
\n\t\tA/C Payee
\n\t
\n\t\t_____________
\n\t
\n\t\t{{ frappe.utils.formatdate(doc.cheque_date) }}
\n\t
\n\t\t{{ doc.pay_to_recd_from }}
\n\t
\n\t\t{{ doc.total_amount_in_words }}
\n\t
\n\t\t{{ doc.total_amount }}
\n
", "idx": 1, - "modified": "2014-08-29 19:54:01.082535", + "modified": "2014-09-09 03:27:13.708596", "modified_by": "Administrator", "module": "Accounts", "name": "Cheque Printing Format",