From a35466b00862d0c5feb05443b37b8c665ce25e61 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 20 May 2013 18:32:06 +0530 Subject: [PATCH] [price list] on deletion of price list, delete all item price record for the same price list --- setup/doctype/price_list/price_list.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup/doctype/price_list/price_list.py b/setup/doctype/price_list/price_list.py index ae49bf868dd..5c03a3a8538 100644 --- a/setup/doctype/price_list/price_list.py +++ b/setup/doctype/price_list/price_list.py @@ -33,3 +33,6 @@ class DocType: msgprint(_("""Please check "Valid For All Countries" or \ enter atlease one row in the "Countries" table."""), raise_exception=True) + def on_trash(self): + webnotes.conn.sql("""delete from `tabItem Price` where price_list_name = %s""", + self.doc.name) \ No newline at end of file