At the start of execute, you need to run:
webnotes.reload_doc("accounts", "doctype", "pos_setting")

This will sync the schema, else the forthcoming queries will raise exception that `customer` column not found