From 56359f06f674e6b5a55a069678fcb2c3141b8b89 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 17 Dec 2012 16:14:08 +0530 Subject: [PATCH 1/3] patch to clear web cache --- patches/december_2012/clear_web_cache.py | 8 ++++++++ patches/patch_list.py | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 patches/december_2012/clear_web_cache.py diff --git a/patches/december_2012/clear_web_cache.py b/patches/december_2012/clear_web_cache.py new file mode 100644 index 0000000000..da71492814 --- /dev/null +++ b/patches/december_2012/clear_web_cache.py @@ -0,0 +1,8 @@ +import webnotes +def execute(): + # build wn-web.js and wn-web.css + from website.helpers.make_web_include_files import make + make() + + import website.utils + website.utils.clear_cache() \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 2e8fc5e4fe..90f908e3ca 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -741,4 +741,8 @@ patch_list = [ 'patch_module': 'patches.december_2012', 'patch_file': 'replace_createlocal', }, + { + 'patch_module': 'patches.december_2012', + 'patch_file': 'clear_web_cache', + }, ] \ No newline at end of file From e93150bf264a17b573ab8b02b61f77bc8684c659 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 18 Dec 2012 10:33:04 +0530 Subject: [PATCH 2/3] sales order linked with project --- selling/doctype/sales_order/sales_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selling/doctype/sales_order/sales_order.py b/selling/doctype/sales_order/sales_order.py index 9d23565d87..f024efc2a8 100644 --- a/selling/doctype/sales_order/sales_order.py +++ b/selling/doctype/sales_order/sales_order.py @@ -59,7 +59,7 @@ class DocType(TransactionBase): #------------------------- def pull_project_customer(self): res = sql("select customer from `tabProject` where name = '%s'"%self.doc.project_name) - if res: + if res and res[0][0]: get_obj('DocType Mapper', 'Project-Sales Order').dt_map('Project', 'Sales Order', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Sales Order']]") From 5c2bb9d9ed458477b48cf6faa398235f253ac6fa Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 18 Dec 2012 10:44:01 +0530 Subject: [PATCH 3/3] sales order linked with project --- accounts/doctype/sales_invoice/sales_invoice.py | 5 +++-- stock/doctype/delivery_note/delivery_note.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py index ebc6dd3515..486bc0aad1 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.py +++ b/accounts/doctype/sales_invoice/sales_invoice.py @@ -322,8 +322,9 @@ class DocType(TransactionBase): def pull_project_customer(self): - res = webnotes.conn.sql("select customer from `tabProject` where name = '%s'"%self.doc.project_name) - if res: + res = webnotes.conn.sql("select customer from `tabProject` where name = '%s'" % + self.doc.project_name) + if res and res[0][0]: get_obj('DocType Mapper', 'Project-Sales Invoice').dt_map('Project', 'Sales Invoice', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Sales Invoice']]") def get_company_abbr(self): diff --git a/stock/doctype/delivery_note/delivery_note.py b/stock/doctype/delivery_note/delivery_note.py index ece99367dd..ef22437797 100644 --- a/stock/doctype/delivery_note/delivery_note.py +++ b/stock/doctype/delivery_note/delivery_note.py @@ -80,8 +80,8 @@ class DocType(TransactionBase): def pull_project_customer(self): - res = sql("select customer from `tabProject` where name = '%s'"%self.doc.project_name) - if res: + res = sql("select customer from `tabProject` where name = '%s'" % self.doc.project_name) + if res and res[0][0]: get_obj('DocType Mapper', 'Project-Delivery Note').dt_map('Project', 'Delivery Note', self.doc.project_name, self.doc, self.doclist, "[['Project', 'Delivery Note']]")