From 6dfd430a2fe51b6ad87834148188cac9dcb9058e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 10 Feb 2015 14:41:27 +0530 Subject: [PATCH] Moved flags like ignore_mandatory, ignore_validate etc to doc.flags --- .../chart_of_accounts/chart_of_accounts.py | 2 +- .../doctype/sales_invoice/sales_invoice.py | 2 +- erpnext/accounts/general_ledger.py | 2 +- erpnext/accounts/utils.py | 2 +- erpnext/controllers/selling_controller.py | 3 +-- erpnext/hr/doctype/employee/employee.py | 2 +- erpnext/manufacturing/doctype/bom/bom.py | 4 ++-- .../production_planning_tool.py | 2 +- .../patches/v4_0/apply_user_permissions.py | 2 +- .../global_defaults_to_system_settings.py | 4 ++-- erpnext/patches/v4_2/recalculate_bom_cost.py | 6 +++--- erpnext/patches/v4_2/reset_bom_costs.py | 2 +- erpnext/projects/doctype/time_log/time_log.py | 8 ++++---- .../doctype/time_log_batch/time_log_batch.py | 2 +- erpnext/selling/doctype/customer/customer.py | 2 +- .../selling/doctype/quotation/quotation.py | 6 +++--- erpnext/setup/doctype/company/company.py | 6 +++--- erpnext/setup/install.py | 2 +- .../page/setup_wizard/install_fixtures.py | 4 ++-- erpnext/shopping_cart/cart.py | 20 +++++++++---------- erpnext/startup/boot.py | 2 ++ .../material_request/test_material_request.py | 2 +- .../stock/doctype/price_list/price_list.py | 2 +- erpnext/stock/doctype/serial_no/serial_no.py | 2 +- erpnext/stock/doctype/warehouse/warehouse.py | 2 +- erpnext/stock/stock_ledger.py | 4 ++-- erpnext/stock/utils.py | 4 ++-- erpnext/templates/pages/address.py | 2 +- erpnext/utilities/repost_stock.py | 4 ++-- 29 files changed, 54 insertions(+), 53 deletions(-) diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py index 790ba1df3e..9df3b88ea6 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py @@ -40,7 +40,7 @@ def create_charts(chart_name, company): }) if root_account: - account.ignore_mandatory = True + account.flags.ignore_mandatory = True account.insert() diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 63aef26e09..132304f690 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -152,7 +152,7 @@ class SalesInvoice(SellingController): if d.time_log_batch: tlb = frappe.get_doc("Time Log Batch", d.time_log_batch) tlb.sales_invoice = sales_invoice - tlb.ignore_validate_update_after_submit = True + tlb.flags.ignore_validate_update_after_submit = True tlb.save() def validate_time_logs_are_submitted(self): diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 9d4f86bf51..5c57a90974 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -81,7 +81,7 @@ def save_entries(gl_map, adv_adj, update_outstanding): def make_entry(args, adv_adj, update_outstanding): args.update({"doctype": "GL Entry"}) gle = frappe.get_doc(args) - gle.ignore_permissions = 1 + gle.flags.ignore_permissions = 1 gle.insert() gle.run_method("on_update_with_args", adv_adj, update_outstanding) gle.submit() diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 8ecbc8d5a2..415a51a800 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -209,7 +209,7 @@ def update_against_doc(d, jv_obj): ch.docstatus = 1 # will work as update after submit - jv_obj.ignore_validate_update_after_submit = True + jv_obj.flags.ignore_validate_update_after_submit = True jv_obj.save() def remove_against_link_from_jv(ref_type, ref_no, against_field): diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 89cac69765..67637cf9d2 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -48,8 +48,7 @@ class SellingController(StockController): def set_missing_lead_customer_details(self): if getattr(self, "customer", None): from erpnext.accounts.party import _get_party_details - party_details = _get_party_details(self.customer, - ignore_permissions=getattr(self, "ignore_permissions", None)) + party_details = _get_party_details(self.customer, ignore_permissions=self.flags.ignore_permissions) if not self.meta.get_field("sales_team"): party_details.pop("sales_team") diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 042dcd79e6..9cd029b64c 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -58,7 +58,7 @@ class Employee(Document): def update_user(self): # add employee role if missing user = frappe.get_doc("User", self.user_id) - user.ignore_permissions = True + user.flags.ignore_permissions = True if "Employee" not in user.get("user_roles"): user.add_roles("Employee") diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 7cc3919e2f..8379b81a61 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -131,7 +131,7 @@ class BOM(Document): d.rate = rate if self.docstatus == 1: - self.ignore_validate_update_after_submit = True + self.flags.ignore_validate_update_after_submit = True self.calculate_cost() self.save() @@ -353,7 +353,7 @@ class BOM(Document): if act_pbom and act_pbom[0][0]: frappe.throw(_("Cannot deactivate or cancel BOM as it is linked with other BOMs")) - + def validate_operations(self): if self.with_operations and not self.get('operations'): frappe.throw(_("Operations cannot be left blank.")) diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index 713433e652..24204f254a 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -394,7 +394,7 @@ class ProductionPlanningTool(Document): "sales_order_no": sales_order if sales_order!="No Sales Order" else None }) - pr_doc.ignore_permissions = 1 + pr_doc.flags.ignore_permissions = 1 pr_doc.submit() purchase_request_list.append(pr_doc.name) diff --git a/erpnext/patches/v4_0/apply_user_permissions.py b/erpnext/patches/v4_0/apply_user_permissions.py index 7dae02f785..52e0bb7bc6 100644 --- a/erpnext/patches/v4_0/apply_user_permissions.py +++ b/erpnext/patches/v4_0/apply_user_permissions.py @@ -28,7 +28,7 @@ def update_hr_permissions(): for employee in frappe.db.sql_list("""select name from `tabEmployee` where docstatus < 2"""): try: emp = frappe.get_doc("Employee", employee) - emp.ignore_mandatory = True + emp.flags.ignore_mandatory = True emp.save() except EmployeeUserDisabledError: pass diff --git a/erpnext/patches/v4_0/global_defaults_to_system_settings.py b/erpnext/patches/v4_0/global_defaults_to_system_settings.py index 57b21aea41..4c3ae76e8e 100644 --- a/erpnext/patches/v4_0/global_defaults_to_system_settings.py +++ b/erpnext/patches/v4_0/global_defaults_to_system_settings.py @@ -31,9 +31,9 @@ def execute(): system_settings.language = lang - system_settings.ignore_mandatory = True + system_settings.flags.ignore_mandatory = True system_settings.save() global_defaults = frappe.get_doc("Global Defaults") - global_defaults.ignore_mandatory = True + global_defaults.flags.ignore_mandatory = True global_defaults.save() diff --git a/erpnext/patches/v4_2/recalculate_bom_cost.py b/erpnext/patches/v4_2/recalculate_bom_cost.py index 3a194ff195..ff96cea1c9 100644 --- a/erpnext/patches/v4_2/recalculate_bom_cost.py +++ b/erpnext/patches/v4_2/recalculate_bom_cost.py @@ -6,11 +6,11 @@ import frappe def execute(): for d in frappe.db.sql("select name from `tabBOM` where docstatus < 2"): - try: + try: document = frappe.get_doc('BOM', d[0]) if document.docstatus == 1: - document.ignore_validate_update_after_submit = True + document.flags.ignore_validate_update_after_submit = True document.calculate_cost() document.save() except: - pass \ No newline at end of file + pass diff --git a/erpnext/patches/v4_2/reset_bom_costs.py b/erpnext/patches/v4_2/reset_bom_costs.py index 49f0b2ec6d..0b49112a09 100644 --- a/erpnext/patches/v4_2/reset_bom_costs.py +++ b/erpnext/patches/v4_2/reset_bom_costs.py @@ -9,7 +9,7 @@ def execute(): for d in frappe.db.sql("""select name from `tabBOM` where docstatus < 2""", as_dict=1): try: bom = frappe.get_doc('BOM', d.name) - bom.ignore_validate_update_after_submit = True + bom.flags.ignore_validate_update_after_submit = True bom.calculate_cost() bom.save() frappe.db.commit() diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py index a7401b4abf..33855afb53 100644 --- a/erpnext/projects/doctype/time_log/time_log.py +++ b/erpnext/projects/doctype/time_log/time_log.py @@ -110,7 +110,7 @@ class TimeLog(Document): tl.hours, self.production_order, operation[0], operation[1])) pro_order = frappe.get_doc("Production Order", self.production_order) - pro_order.ignore_validate_update_after_submit = True + pro_order.flags.ignore_validate_update_after_submit = True pro_order.update_operation_status() pro_order.calculate_operating_cost() pro_order.set_actual_dates() @@ -129,14 +129,14 @@ class TimeLog(Document): from `tabTime Log` where production_order = %s and operation = %s and docstatus=1""", (self.production_order, self.operation), as_dict=1)[0] - + def validate_project(self): if self.time_log_for == 'Project': if not self.project: frappe.throw(_("Project is Mandatory.")) if self.time_log_for == "": - self.project = None - + self.project = None + def validate_manufacturing(self): if self.time_log_for == 'Manufacturing': if not self.production_order: diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py index e878577554..d2e83e191f 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py @@ -57,7 +57,7 @@ class TimeLogBatch(Document): tl = frappe.get_doc("Time Log", d.time_log) tl.time_log_batch = time_log_batch tl.sales_invoice = self.sales_invoice - tl.ignore_validate_update_after_submit = True + tl.flags.ignore_validate_update_after_submit = True tl.save() @frappe.whitelist() diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 6b8ec9e94c..8a50de57e9 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -61,7 +61,7 @@ class Customer(TransactionBase): c.customer = self.name c.customer_name = self.customer_name c.is_primary_contact = 1 - c.ignore_permissions = getattr(self, "ignore_permissions", None) + c.flags.ignore_permissions = self.flags.ignore_permissions c.autoname() if not frappe.db.exists("Contact", c.name): c.insert() diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 10a59f4ab7..5a052209d1 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -24,7 +24,7 @@ class Quotation(SellingController): def has_sales_order(self): return frappe.db.get_value("Sales Order Item", {"prevdoc_docname": self.name, "docstatus": 1}) - + def validate_for_items(self): chk_dupl_itm = [] for d in self.get('items'): @@ -111,7 +111,7 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): target.customer = customer.name target.customer_name = customer.customer_name target.ignore_pricing_rule = 1 - target.ignore_permissions = ignore_permissions + target.flags.ignore_permissions = ignore_permissions target.run_method("set_missing_values") target.run_method("calculate_taxes_and_totals") @@ -152,7 +152,7 @@ def _make_customer(source_name, ignore_permissions=False): from erpnext.selling.doctype.lead.lead import _make_customer customer_doclist = _make_customer(lead_name, ignore_permissions=ignore_permissions) customer = frappe.get_doc(customer_doclist) - customer.ignore_permissions = ignore_permissions + customer.flags.ignore_permissions = ignore_permissions if quotation[1] == "Shopping Cart": customer.customer_group = frappe.db.get_value("Shopping Cart Settings", None, "default_customer_group") diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 67257bb000..6247afd059 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -102,7 +102,7 @@ class Company(Document): for d in self.fld_dict.keys(): account.set(d, (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.abbr or lst[self.fld_dict[d]]) if not account.parent_account: - account.ignore_mandatory = True + account.flags.ignore_mandatory = True account.insert() def set_default_accounts(self): @@ -146,10 +146,10 @@ class Company(Document): for cc in cc_list: cc.update({"doctype": "Cost Center"}) cc_doc = frappe.get_doc(cc) - cc_doc.ignore_permissions = True + cc_doc.flags.ignore_permissions = True if cc.get("cost_center_name") == self.name: - cc_doc.ignore_mandatory = True + cc_doc.flags.ignore_mandatory = True cc_doc.insert() frappe.db.set(self, "cost_center", _("Main") + " - " + self.abbr) diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index fdbbe9ef37..ce7af6dd41 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -20,7 +20,7 @@ def after_install(): def feature_setup(): """save global defaults and features setup""" doc = frappe.get_doc("Features Setup", "Features Setup") - doc.ignore_permissions = True + doc.flags.ignore_permissions = True # store value as 1 for all these fields flds = ['fs_item_serial_nos', 'fs_item_batch_nos', 'fs_brands', 'fs_item_barcode', diff --git a/erpnext/setup/page/setup_wizard/install_fixtures.py b/erpnext/setup/page/setup_wizard/install_fixtures.py index f83ab35053..96ea0d93d9 100644 --- a/erpnext/setup/page/setup_wizard/install_fixtures.py +++ b/erpnext/setup/page/setup_wizard/install_fixtures.py @@ -136,7 +136,7 @@ def install(country=None): {'doctype': 'Activity Type', 'activity_type': _('Execution')}, {'doctype': 'Activity Type', 'activity_type': _('Communication')}, {'doctype': 'Activity Type', 'activity_type': _('Manufacturing')}, - + # Industry Type {'doctype': 'Industry Type', 'industry': _('Accounting')}, {'doctype': 'Industry Type', 'industry': _('Advertising')}, @@ -203,6 +203,6 @@ def install(country=None): # ignore mandatory for root parent_link_field = ("parent_" + scrub(doc.doctype)) if doc.meta.get_field(parent_link_field) and not doc.get(parent_link_field): - doc.ignore_mandatory = True + doc.flags.ignore_mandatory = True doc.insert() diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index 3ee089c227..5b544858ec 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -41,7 +41,7 @@ def place_order(): if not quotation.get(fieldname): throw(_("{0} is required").format(quotation.meta.get_label(fieldname))) - quotation.ignore_permissions = True + quotation.flags.ignore_permissions = True quotation.submit() if quotation.lead: @@ -53,7 +53,7 @@ def place_order(): for item in sales_order.get("items"): item.reserved_warehouse = frappe.db.get_value("Item", item.item_code, "website_warehouse") or None - sales_order.ignore_permissions = True + sales_order.flags.ignore_permissions = True sales_order.insert() sales_order.submit() frappe.local.cookie_manager.delete_cookie("cart_count") @@ -88,7 +88,7 @@ def update_cart(item_code, qty, with_doc): frappe.delete_doc("Quotation", quotation.name, ignore_permissions=True) quotation = _get_cart_quotation() else: - quotation.ignore_permissions = True + quotation.flags.ignore_permissions = True quotation.save() set_cart_count(quotation) @@ -117,7 +117,7 @@ def update_cart_address(address_fieldname, address_name): apply_cart_settings(quotation=quotation) - quotation.ignore_permissions = True + quotation.flags.ignore_permissions = True quotation.save() return get_cart_quotation(quotation) @@ -175,7 +175,7 @@ def _get_cart_quotation(party=None): qdoc.contact_person = frappe.db.get_value("Contact", {"email_id": frappe.session.user, "customer": party.name}) - qdoc.ignore_permissions = True + qdoc.flags.ignore_permissions = True qdoc.run_method("set_missing_values") apply_cart_settings(party, qdoc) @@ -201,18 +201,18 @@ def update_party(fullname, company_name=None, mobile_no=None, phone=None): contact.customer_name = party.customer_name contact.mobile_no = mobile_no contact.phone = phone - contact.ignore_permissions = True + contact.flags.ignore_permissions = True contact.save() party_doc = frappe.get_doc(party.as_dict()) - party_doc.ignore_permissions = True + party_doc.flags.ignore_permissions = True party_doc.save() qdoc = _get_cart_quotation(party) if not qdoc.get("__islocal"): qdoc.customer_name = company_name or fullname qdoc.run_method("set_missing_lead_customer_details") - qdoc.ignore_permissions = True + qdoc.flags.ignore_permissions = True qdoc.save() def apply_cart_settings(party=None, quotation=None): @@ -276,7 +276,7 @@ def get_lead_or_customer(): }) if frappe.session.user not in ("Guest", "Administrator"): - lead_doc.ignore_permissions = True + lead_doc.flags.ignore_permissions = True lead_doc.insert() return lead_doc @@ -303,7 +303,7 @@ def apply_shipping_rule(shipping_rule): apply_cart_settings(quotation=quotation) - quotation.ignore_permissions = True + quotation.flags.ignore_permissions = True quotation.save() return get_cart_quotation(quotation) diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index c7acba74b9..f96d9e11ed 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -9,6 +9,8 @@ def boot_session(bootinfo): """boot session - send website info if guest""" import frappe + print "erpnext boot session" + bootinfo.custom_css = frappe.db.get_value('Style Settings', None, 'custom_css') or '' bootinfo.website_settings = frappe.get_doc('Website Settings') diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index 6fe73fc85b..ded9a0ad1f 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -216,7 +216,7 @@ class TestMaterialRequest(unittest.TestCase): mr.update_status('Submitted') - se.ignore_validate_update_after_submit = True + se.flags.ignore_validate_update_after_submit = True se.submit() mr.update_status('Stopped') self.assertRaises(frappe.InvalidStatusError, se.cancel) diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index 5f468695b8..35bd8dc5d5 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -51,7 +51,7 @@ class PriceList(Document): if self.name == b.get(price_list_fieldname): b.set(price_list_fieldname, None) - b.ignore_permissions = True + b.flags.ignore_permissions = True b.save() for module in ["Selling", "Buying"]: diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index d55daa01a1..59871ddd1c 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -278,7 +278,7 @@ def make_serial_no(serial_no, sle): sr = frappe.new_doc("Serial No") sr.warehouse = None sr.dont_update_if_missing.append("warehouse") - sr.ignore_permissions = True + sr.flags.ignore_permissions = True sr.serial_no = serial_no sr.item_code = sle.item_code diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index 2c81c4c98b..48a0587a2d 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -54,7 +54,7 @@ class Warehouse(Document): "warehouse": self.name, "freeze_account": "No" }) - ac_doc.ignore_permissions = True + ac_doc.flags.ignore_permissions = True ac_doc.insert() msgprint(_("Account head {0} created").format(ac_doc.name)) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 62cc397ef9..8a558ad2cf 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -49,7 +49,7 @@ def set_as_cancel(voucher_type, voucher_no): def make_entry(args): args.update({"doctype": "Stock Ledger Entry"}) sle = frappe.get_doc(args) - sle.ignore_permissions = 1 + sle.flags.ignore_permissions = 1 sle.insert() sle.submit() return sle.name @@ -149,7 +149,7 @@ def update_entries_after(args, allow_zero_rate=False, verbose=1): "item_code": args["item_code"], "warehouse": args["warehouse"], }) - bin_wrapper.ignore_permissions = 1 + bin_wrapper.flags.ignore_permissions = 1 bin_wrapper.insert() frappe.db.sql("""update `tabBin` set valuation_rate=%s, actual_qty=%s, diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index a7759c5f97..6f49f0234c 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -64,11 +64,11 @@ def get_bin(item_code, warehouse): "item_code": item_code, "warehouse": warehouse, }) - bin_obj.ignore_permissions = 1 + bin_obj.flags.ignore_permissions = 1 bin_obj.insert() else: bin_obj = frappe.get_doc('Bin', bin) - bin_obj.ignore_permissions = True + bin_obj.flags.ignore_permissions = True return bin_obj def update_bin(args): diff --git a/erpnext/templates/pages/address.py b/erpnext/templates/pages/address.py index 46dde92c8f..d0314940a4 100644 --- a/erpnext/templates/pages/address.py +++ b/erpnext/templates/pages/address.py @@ -53,7 +53,7 @@ def save_address(fields, address_fieldname=None): party_fieldname: party.name, (party_fieldname + "_name"): party.get(party_fieldname + "_name") }) - doc.ignore_permissions = True + doc.flags.ignore_permissions = True doc.save() if address_fieldname: diff --git a/erpnext/utilities/repost_stock.py b/erpnext/utilities/repost_stock.py index df7d82bb2b..3143ba70b2 100644 --- a/erpnext/utilities/repost_stock.py +++ b/erpnext/utilities/repost_stock.py @@ -179,8 +179,8 @@ def set_stock_balance_as_per_serial_no(item_code=None, posting_date=None, postin } sle_doc = frappe.get_doc(sle_dict) - sle_doc.ignore_validate = True - sle_doc.ignore_links = True + sle_doc.flags.ignore_validate = True + sle_doc.flags.ignore_links = True sle_doc.insert() args = sle_dict.copy()