fix: Ignore addr permission in internal code
This commit is contained in:
parent
5bb3e290d2
commit
7b9cedebf6
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _, bold, throw
|
from frappe import _, bold, throw
|
||||||
from frappe.contacts.doctype.address.address import get_address_display
|
|
||||||
from frappe.utils import cint, flt, get_link_to_form, nowtime
|
from frappe.utils import cint, flt, get_link_to_form, nowtime
|
||||||
|
|
||||||
from erpnext.controllers.accounts_controller import get_taxes_and_charges
|
from erpnext.controllers.accounts_controller import get_taxes_and_charges
|
||||||
@ -593,6 +592,12 @@ class SellingController(StockController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def set_customer_address(self):
|
def set_customer_address(self):
|
||||||
|
try:
|
||||||
|
from frappe.contacts.doctype.address.address import render_address
|
||||||
|
except ImportError:
|
||||||
|
# Older frappe versions where this function is not available
|
||||||
|
from frappe.contacts.doctype.address.address import get_address_display as render_address
|
||||||
|
|
||||||
address_dict = {
|
address_dict = {
|
||||||
"customer_address": "address_display",
|
"customer_address": "address_display",
|
||||||
"shipping_address_name": "shipping_address",
|
"shipping_address_name": "shipping_address",
|
||||||
@ -602,7 +607,8 @@ class SellingController(StockController):
|
|||||||
|
|
||||||
for address_field, address_display_field in address_dict.items():
|
for address_field, address_display_field in address_dict.items():
|
||||||
if self.get(address_field):
|
if self.get(address_field):
|
||||||
self.set(address_display_field, get_address_display(self.get(address_field)))
|
address = frappe.call(render_address, self.get(address_field), ignore_permissions=True)
|
||||||
|
self.set(address_display_field, address)
|
||||||
|
|
||||||
def validate_for_duplicate_items(self):
|
def validate_for_duplicate_items(self):
|
||||||
check_list, chk_dupl_itm = [], []
|
check_list, chk_dupl_itm = [], []
|
||||||
|
Loading…
Reference in New Issue
Block a user