Last active
February 7, 2019 11:47
-
-
Save eberloso/3cd56d0e220d199f57bf404d81258d1b to your computer and use it in GitHub Desktop.
Actualitzar lectures a m3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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