changes
This commit is contained in:
25
fusion_tasks/graphify-out/mobility_sync_fix.py
Normal file
25
fusion_tasks/graphify-out/mobility_sync_fix.py
Normal file
@@ -0,0 +1,25 @@
|
||||
print('=== BEFORE ===')
|
||||
for uid in (32, 27):
|
||||
u = env['res.users'].browse(uid)
|
||||
print(f" uid={uid} login={u.login} active={u.active} "
|
||||
f"field_staff={u.x_fc_is_field_staff} sync_id={u.x_fc_tech_sync_id!r}")
|
||||
|
||||
try:
|
||||
env['res.users'].browse(32).x_fc_tech_sync_id = 'simranjeet'
|
||||
env['res.users'].browse(27).write({
|
||||
'x_fc_is_field_staff': True,
|
||||
'x_fc_tech_sync_id': 'hk',
|
||||
})
|
||||
env.cr.commit()
|
||||
print('Commit OK')
|
||||
except Exception as e:
|
||||
env.cr.rollback()
|
||||
print(f'FAILED: {type(e).__name__}: {e}')
|
||||
raise
|
||||
|
||||
print('=== AFTER ===')
|
||||
for uid in (32, 27):
|
||||
u = env['res.users'].browse(uid)
|
||||
print(f" uid={uid} login={u.login} active={u.active} "
|
||||
f"field_staff={u.x_fc_is_field_staff} sync_id={u.x_fc_tech_sync_id!r}")
|
||||
print('DONE')
|
||||
Reference in New Issue
Block a user