mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 21:59:13 +00:00
[fix] unset default customer group (#10689)
* [fix] unset default customer group * added __init__.py file for patch v8.9 directory
This commit is contained in:
committed by
Makarand Bauskar
parent
a6d78ef842
commit
bf8e331135
@@ -435,3 +435,4 @@ erpnext.patches.v8_5.remove_project_type_property_setter
|
|||||||
erpnext.patches.v8_7.add_more_gst_fields
|
erpnext.patches.v8_7.add_more_gst_fields
|
||||||
erpnext.patches.v8_7.fix_purchase_receipt_status
|
erpnext.patches.v8_7.fix_purchase_receipt_status
|
||||||
erpnext.patches.v8_6.rename_bom_update_tool
|
erpnext.patches.v8_6.rename_bom_update_tool
|
||||||
|
erpnext.patches.v8_9.set_default_customer_group
|
||||||
|
|||||||
1
erpnext/patches/v8_9/__init__.py
Normal file
1
erpnext/patches/v8_9/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
6
erpnext/patches/v8_9/set_default_customer_group.py
Normal file
6
erpnext/patches/v8_9/set_default_customer_group.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
selling_settings = frappe.get_single('Selling Settings')
|
||||||
|
selling_settings.set_default_customer_group_and_territory()
|
||||||
|
selling_settings.save()
|
||||||
@@ -8,6 +8,7 @@ import frappe
|
|||||||
import frappe.defaults
|
import frappe.defaults
|
||||||
from frappe.utils import cint
|
from frappe.utils import cint
|
||||||
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
|
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
|
||||||
|
from frappe.utils.nestedset import get_root_of
|
||||||
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
@@ -31,3 +32,9 @@ class SellingSettings(Document):
|
|||||||
for doctype in ("Sales Order", "Sales Invoice", "Delivery Note"):
|
for doctype in ("Sales Order", "Sales Invoice", "Delivery Note"):
|
||||||
make_property_setter(doctype, "tax_id", "hidden", self.hide_tax_id, "Check")
|
make_property_setter(doctype, "tax_id", "hidden", self.hide_tax_id, "Check")
|
||||||
make_property_setter(doctype, "tax_id", "print_hide", self.hide_tax_id, "Check")
|
make_property_setter(doctype, "tax_id", "print_hide", self.hide_tax_id, "Check")
|
||||||
|
|
||||||
|
def set_default_customer_group_and_territory(self):
|
||||||
|
if not self.customer_group:
|
||||||
|
self.customer_group = get_root_of('Customer Group')
|
||||||
|
if not self.territory:
|
||||||
|
self.territory = get_root_of('Territory')
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ def set_defaults(args):
|
|||||||
selling_settings.so_required = "No"
|
selling_settings.so_required = "No"
|
||||||
selling_settings.dn_required = "No"
|
selling_settings.dn_required = "No"
|
||||||
selling_settings.allow_multiple_items = 1
|
selling_settings.allow_multiple_items = 1
|
||||||
|
selling_settings.set_default_customer_group_and_territory()
|
||||||
selling_settings.save()
|
selling_settings.save()
|
||||||
|
|
||||||
buying_settings = frappe.get_doc("Buying Settings")
|
buying_settings = frappe.get_doc("Buying Settings")
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.utils.nestedset import get_root_of
|
|
||||||
|
|
||||||
def boot_session(bootinfo):
|
def boot_session(bootinfo):
|
||||||
"""boot session - send website info if guest"""
|
"""boot session - send website info if guest"""
|
||||||
@@ -17,9 +16,9 @@ def boot_session(bootinfo):
|
|||||||
|
|
||||||
load_country_and_currency(bootinfo)
|
load_country_and_currency(bootinfo)
|
||||||
bootinfo.sysdefaults.territory = frappe.db.get_single_value('Selling Settings',
|
bootinfo.sysdefaults.territory = frappe.db.get_single_value('Selling Settings',
|
||||||
'territory') or get_root_of('Territory')
|
'territory')
|
||||||
bootinfo.sysdefaults.customer_group = frappe.db.get_single_value('Selling Settings',
|
bootinfo.sysdefaults.customer_group = frappe.db.get_single_value('Selling Settings',
|
||||||
'customer_group') or get_root_of('Customer Group')
|
'customer_group')
|
||||||
|
|
||||||
bootinfo.notification_settings = frappe.get_doc("Notification Control",
|
bootinfo.notification_settings = frappe.get_doc("Notification Control",
|
||||||
"Notification Control")
|
"Notification Control")
|
||||||
|
|||||||
Reference in New Issue
Block a user