Best Python code snippet using localstack_python
update_is_cancelled_field.py
Source:update_is_cancelled_field.py
1import vmraid2def execute():3 # handle type casting for is_cancelled field4 module_doctypes = (5 ("stock", "Stock Ledger Entry"),6 ("stock", "Serial No"),7 ("accounts", "GL Entry"),8 )9 for module, doctype in module_doctypes:10 if (11 not vmraid.db.has_column(doctype, "is_cancelled")12 or vmraid.db.get_column_type(doctype, "is_cancelled").lower() == "int(1)"13 ):14 continue15 vmraid.db.sql(16 """17 UPDATE `tab{doctype}`18 SET is_cancelled = 019 where is_cancelled in ('', 'No') or is_cancelled is NULL""".format(20 doctype=doctype21 )22 )23 vmraid.db.sql(24 """25 UPDATE `tab{doctype}`26 SET is_cancelled = 127 where is_cancelled = 'Yes'""".format(28 doctype=doctype29 )30 )...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!