brotherton-erpnext/erpnext/patches/v12_0/update_is_cancelled_field.py
Deepesh Garg 2a9c5badc6
feat: Immutable ledger ()
* fix: Reverse GL entry on cancellation of document

* fix: Removed set posting time field for multiple docs

* fix: Stop future reposting and reverse entry for purchase receipt and delivery note

* fix: Change is_cancelled field from select to check

* Revert "fix: Removed set posting time field for multiple docs"

This reverts commit 81fb808db7da69ab1e58ba226c0cd0b77e5b90c8.

* fix: Multiple fixes in GL Entry

* fix: Remove future reporting from doctypes

* fix: Canceled entry filters in Stock Ledger and General Ledger Report

* fix: Remove print statement

* fix: Validation for back dated entries

* fix: Codacy fixes

* fix: Add ignore links to multiple doctypes

* fix: Codacy Fixes

* fix: Ignore GL Entry and Stock Ledger entry while cancel

* fix: Test case fixes

* fix: Patch

* fix: Codacy

* fix: Budget Test Cases

* fix: Patch

* fix: Patch

* fix: Multiple test cases

* fix: changes in make_reverse_entry function

* fix: Update patch

* fix: Test Cases

* fix: Test Case fixes

* fix: Move patch upward in patches.txt

* fix: Budget Test Cases

* fix: Test Case and codacy

* fix: Patch

* fix: Minor label and UX fixes

* fix: Move freezing date check

* fix: Test Cases

* fix: Test cases

* fix: Test Cases

* fix: Test Case

* fix: Remove update_gl_entries_after function

* fix: Remove update_gl_entries_after function

* fix: Test Cases

* fix: Fiscal Year wise backdated entry

* fix: Update entries only for current SLE

* fix: Remove is_cancelled

* fix: Test Cases

* fix: Test cases

* fix: Test Cases

* fix: Uncomment account and stock balance sync logic

* fix: Stock balance and Account balance out of sync fixes

* fix: Test Cases

* fix: Test cases for POS, Stock Reco and Purchase Receipt

* fix: Stock Reco tests

* fix: Test stock reco precision

* fix: Test stock reco for fifo precision

* fix: Test stock reco for fifo precision

* fix: Stock Entry test case

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-30 10:38:58 +05:30

15 lines
606 B
Python

from __future__ import unicode_literals
import frappe
def execute():
try:
frappe.db.sql("UPDATE `tabStock Ledger Entry` SET is_cancelled = 0 where is_cancelled in ('', NULL, 'No')")
frappe.db.sql("UPDATE `tabSerial No` SET is_cancelled = 0 where is_cancelled in ('', NULL, 'No')")
frappe.db.sql("UPDATE `tabStock Ledger Entry` SET is_cancelled = 1 where is_cancelled = 'Yes'")
frappe.db.sql("UPDATE `tabSerial No` SET is_cancelled = 1 where is_cancelled = 'Yes'")
frappe.reload_doc("stock", "doctype", "stock_ledger_entry")
frappe.reload_doc("stock", "doctype", "serial_no")
except:
pass