activity type fixs
This commit is contained in:
parent
a6c361c00e
commit
744aec8def
@ -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
|
||||
|
13
erpnext/patches/v5_0/manufacturing_activity_type.py
Normal file
13
erpnext/patches/v5_0/manufacturing_activity_type.py
Normal 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()
|
||||
}
|
@ -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."))
|
@ -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')},
|
||||
|
Loading…
x
Reference in New Issue
Block a user