Commit 6bb941fe by Yvon Kerdoncuff

in get_all shelfs in precision simple case, do not try to access missing fields

parent 59e6e987
Pipeline #3938 failed with stage
...@@ -564,11 +564,12 @@ class Shelfs(models.Model): ...@@ -564,11 +564,12 @@ class Shelfs(models.Model):
else: else:
res = api.execute('product.shelfs', 'get', {}) res = api.execute('product.shelfs', 'get', {})
for r in res: for r in res:
if r['ongoing_inv_start_datetime'] == "1-01-01 00:00:00": if precision != 'simple':
r['ongoing_inv_start_datetime'] = "" if r['ongoing_inv_start_datetime'] == "1-01-01 00:00:00":
if r['date_last_product_added'] == "1-01-01": r['ongoing_inv_start_datetime'] = ""
r['date_last_product_added'] = "" if r['date_last_product_added'] == "1-01-01":
coop_logger.info(str(r)) r['date_last_product_added'] = ""
coop_logger.info(str(r))
shelfs.append(r) shelfs.append(r)
except Exception as e: except Exception as e:
coop_logger.error("Rayons, get_all : %s", str(e)) coop_logger.error("Rayons, get_all : %s", str(e))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment