From cab5b31ffa0573d01e3bce128131cbcf2335390d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 22 Feb 2012 18:33:39 +0530 Subject: [PATCH 1/4] change product's document type to Master --- erpnext/website/doctype/product/product.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/website/doctype/product/product.txt b/erpnext/website/doctype/product/product.txt index 6258691a91..0405e4ca51 100644 --- a/erpnext/website/doctype/product/product.txt +++ b/erpnext/website/doctype/product/product.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-01-30 16:21:29', + 'creation': '2012-02-17 15:53:22', 'docstatus': 0, - 'modified': '2012-02-06 16:15:29', + 'modified': '2012-02-22 18:32:46', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -18,12 +18,13 @@ 'colour': u'White:FFF', 'description': u'A Product is shown on the website and is linked to an item.', 'doctype': 'DocType', + 'document_type': u'Master', 'max_attachments': 5, 'module': u'Website', 'name': '__common__', 'section_style': u'Simple', 'show_in_menu': 0, - 'version': 11 + 'version': 12 }, # These values are common for all DocField From 8569b7400a2a00be18702e479ad028463446ef8a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 23 Feb 2012 10:46:24 +0530 Subject: [PATCH 2/4] Update erpnext/production/doctype/bill_of_materials/bill_of_materials.py --- .../production/doctype/bill_of_materials/bill_of_materials.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/production/doctype/bill_of_materials/bill_of_materials.py b/erpnext/production/doctype/bill_of_materials/bill_of_materials.py index 117742576d..decb9fefe2 100644 --- a/erpnext/production/doctype/bill_of_materials/bill_of_materials.py +++ b/erpnext/production/doctype/bill_of_materials/bill_of_materials.py @@ -268,7 +268,7 @@ class DocType: def check_if_item_repeated(self, item, op, check_list): if [cstr(item), cstr(op)] in check_list: - msgprint("Item %s has been entered twice against same operation" % d.item_code, raise_exception = 1) + msgprint("Item %s has been entered twice against same operation" % item, raise_exception = 1) else: check_list.append([cstr(item), cstr(op)]) From 9f94275d65c54e6d0663cc74295fefde1688f5bc Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 23 Feb 2012 11:27:40 +0530 Subject: [PATCH 3/4] allow deletion of products --- erpnext/patches/jan_mar_2012/website/all.py | 2 ++ .../patches/jan_mar_2012/website/allow_product_delete.py | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 erpnext/patches/jan_mar_2012/website/allow_product_delete.py diff --git a/erpnext/patches/jan_mar_2012/website/all.py b/erpnext/patches/jan_mar_2012/website/all.py index c68e65369c..1443f361fb 100644 --- a/erpnext/patches/jan_mar_2012/website/all.py +++ b/erpnext/patches/jan_mar_2012/website/all.py @@ -5,6 +5,7 @@ import patches.jan_mar_2012.website.cleanups import patches.jan_mar_2012.website.domain_list import patches.jan_mar_2012.website.file_data_rename import patches.jan_mar_2012.website.analytics +import patches.jan_mar_2012.website.allow_product_delete def execute(): @@ -15,3 +16,4 @@ def execute(): patches.jan_mar_2012.website.domain_list.execute() patches.jan_mar_2012.website.file_data_rename.execute() patches.jan_mar_2012.website.analytics.execute() + patches.jan_mar_2012.website.allow_product_delete.execute() diff --git a/erpnext/patches/jan_mar_2012/website/allow_product_delete.py b/erpnext/patches/jan_mar_2012/website/allow_product_delete.py new file mode 100644 index 0000000000..54c0447a19 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/website/allow_product_delete.py @@ -0,0 +1,7 @@ +def execute(): + """ + Allow deletion of products + """ + import webnotes + webnotes.conn.sql("""UPDATE `tabDocPerm` SET cancel=1 + WHERE parent='Product' AND role='Website Manager'""") From bfa58a35168d52e22387ddd77c1e09f29a4cc07a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 23 Feb 2012 11:31:17 +0530 Subject: [PATCH 4/4] allow deletion of products --- erpnext/patches/jan_mar_2012/website/allow_product_delete.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/jan_mar_2012/website/allow_product_delete.py b/erpnext/patches/jan_mar_2012/website/allow_product_delete.py index 54c0447a19..fbef48f11e 100644 --- a/erpnext/patches/jan_mar_2012/website/allow_product_delete.py +++ b/erpnext/patches/jan_mar_2012/website/allow_product_delete.py @@ -4,4 +4,5 @@ def execute(): """ import webnotes webnotes.conn.sql("""UPDATE `tabDocPerm` SET cancel=1 - WHERE parent='Product' AND role='Website Manager'""") + WHERE parent='Product' AND role='Website Manager' + AND permlevel=0""")