patch for renaming the pos profile and setting the pos profile name
This commit is contained in:
parent
b1616a0cb3
commit
40ef7e7039
@ -455,3 +455,4 @@ erpnext.patches.v9_0.add_healthcare_domain
|
|||||||
erpnext.patches.v9_0.set_variant_item_description
|
erpnext.patches.v9_0.set_variant_item_description
|
||||||
erpnext.patches.v9_0.set_uoms_in_variant_field
|
erpnext.patches.v9_0.set_uoms_in_variant_field
|
||||||
erpnext.patches.v9_0.copy_old_fees_field_data
|
erpnext.patches.v9_0.copy_old_fees_field_data
|
||||||
|
erpnext.patches.v9_0.set_pos_profile_name
|
||||||
|
19
erpnext/patches/v9_0/set_pos_profile_name.py
Normal file
19
erpnext/patches/v9_0/set_pos_profile_name.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Copyright (c) 2017, Frappe and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
doctype = 'POS Profile'
|
||||||
|
frappe.reload_doctype(doctype)
|
||||||
|
|
||||||
|
for pos in frappe.get_all(doctype):
|
||||||
|
doc = frappe.get_doc(doctype, pos.name)
|
||||||
|
|
||||||
|
if not doc.user: continue
|
||||||
|
|
||||||
|
doc.pos_profile_name = doc.user + ' - ' + doc.company
|
||||||
|
doc.save()
|
||||||
|
|
||||||
|
frappe.rename_doc(doctype, doc.name, doc.pos_profile_name, force=True)
|
Loading…
x
Reference in New Issue
Block a user