16 lines
546 B
Plaintext
16 lines
546 B
Plaintext
|
|
dbname = get_module_dbname('supplychain')
|
|
|
|
data = params_kw.get("data", "{}")
|
|
if isinstance(data, str):
|
|
data = json.loads(data)
|
|
|
|
record_id = data.get("id")
|
|
if not record_id:
|
|
return {"widgettype":"Error","options":{"title":"Delete Error","message":"Missing record id","cwidth":16,"cheight":9,"timeout":3}}
|
|
|
|
db = DBPools()
|
|
async with db.sqlorContext(dbname) as sor:
|
|
await sor.D("supplychain_accounting", {"id": record_id})
|
|
return {"widgettype":"Message","options":{"title":"Delete Success","message":"ok","cwidth":16,"cheight":9,"timeout":3}}
|