fix: E-commerce permissions

This commit is contained in:
Ankush Menat
2023-10-17 22:11:56 +05:30
parent 7b9cedebf6
commit f4d74990fe
2 changed files with 27 additions and 17 deletions

View File

@@ -6,6 +6,7 @@ import frappe
from frappe import _, bold, throw
from frappe.utils import cint, flt, get_link_to_form, nowtime
from erpnext.accounts.party import render_address
from erpnext.controllers.accounts_controller import get_taxes_and_charges
from erpnext.controllers.sales_and_purchase_return import get_rate_for_return
from erpnext.controllers.stock_controller import StockController
@@ -592,12 +593,6 @@ class SellingController(StockController):
)
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 = {
"customer_address": "address_display",
"shipping_address_name": "shipping_address",
@@ -607,8 +602,9 @@ class SellingController(StockController):
for address_field, address_display_field in address_dict.items():
if self.get(address_field):
address = frappe.call(render_address, self.get(address_field), ignore_permissions=True)
self.set(address_display_field, address)
self.set(
address_display_field, render_address(self.get(address_field), check_permissions=False)
)
def validate_for_duplicate_items(self):
check_list, chk_dupl_itm = [], []