activity type fixs

This commit is contained in:
Neil Trini Lasrado 2015-02-12 18:47:17 +05:30
parent a6c361c00e
commit 744aec8def
4 changed files with 22 additions and 2 deletions

View File

@ -111,3 +111,4 @@ erpnext.patches.v5_0.update_item_name_in_bom
erpnext.patches.v5_0.new_crm_module
erpnext.patches.v5_0.rename_customer_issue
erpnext.patches.v5_0.update_material_transfer_for_manufacture
erpnext.patches.v5_0.manufacturing_activity_type

View File

@ -0,0 +1,13 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
if not frappe.db.exists('Activity Type','Manufacturing') {
doc = frappe.new_doc('Activity Type')
doc.update({
'activity_type' : 'Manufacturing'
})
doc.save()
}

View File

@ -7,4 +7,10 @@ import frappe
from frappe.model.document import Document
class ActivityType(Document):
pass
def on_trash(self):
self.validate_manufacturing_type()
def validate_manufacturing_type(self):
if self.activity_type == 'Manufacturing':
frappe.throw(_("Activity Type 'Manufacturing' cannot be deleted."))

View File

@ -135,7 +135,7 @@ def install(country=None):
{'doctype': 'Activity Type', 'activity_type': _('Proposal Writing')},
{'doctype': 'Activity Type', 'activity_type': _('Execution')},
{'doctype': 'Activity Type', 'activity_type': _('Communication')},
{'doctype': 'Activity Type', 'activity_type': _('Manufacturing')},
{'doctype': 'Activity Type', 'activity_type': 'Manufacturing'},
# Industry Type
{'doctype': 'Industry Type', 'industry': _('Accounting')},