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):
else:
res = api.execute('product.shelfs', 'get', {})
for r in res:
if r['ongoing_inv_start_datetime'] == "1-01-01 00:00:00":
r['ongoing_inv_start_datetime'] = ""
if r['date_last_product_added'] == "1-01-01":
r['date_last_product_added'] = ""
coop_logger.info(str(r))
if precision != 'simple':
if r['ongoing_inv_start_datetime'] == "1-01-01 00:00:00":
r['ongoing_inv_start_datetime'] = ""
if r['date_last_product_added'] == "1-01-01":
r['date_last_product_added'] = ""
coop_logger.info(str(r))
shelfs.append(r)
except Exception as 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