Skip to content

Instantly share code, notes, and snippets.

@eberloso
Last active February 7, 2019 11:47
Show Gist options
  • Save eberloso/3cd56d0e220d199f57bf404d81258d1b to your computer and use it in GitHub Desktop.
Save eberloso/3cd56d0e220d199f57bf404d81258d1b to your computer and use it in GitHub Desktop.
Actualitzar lectures a m3
# begin;
# update giscegas_lectures_lectura set lectura = lectura_m3;
# update giscegas_lectures_lectura_pool set lectura = lectura_m3;
# update giscegas_facturacio_lectures set lect_actual = lect_actual_m3;
# update giscegas_facturacio_lectures set lect_anterior = lect_anterior_m3;
from tqdm import tqdm
from erppeek import Client
c = Client("server:8069", "database", "login")
lect_obj = c.GiscegasLecturesLectura
lect_ids = sorted(lect_obj.search([]))
for lect_data in tqdm(lect_obj.read(lect_ids, ['factor_k'])):
lect_obj.write(lect_data['id'], {'factor_k':lect_data['factor_k']})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment