diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/templatetags/window_tables.py | 6 | ||||
-rw-r--r-- | ishtar_common/views_item.py | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py index a46f404ba..8193f1061 100644 --- a/ishtar_common/templatetags/window_tables.py +++ b/ishtar_common/templatetags/window_tables.py @@ -65,6 +65,9 @@ ASSOCIATED_MODELS['base_treatments'] = ( Treatment, 'get-treatment', '') ASSOCIATED_MODELS['treatment_files'] = (TreatmentFile, 'get-treatmentfile', '') ASSOCIATED_MODELS['containers'] = (Container, 'get-container', '') +ASSOCIATED_MODELS['divisions'] = (Container, 'get-divisions-container', '') +ASSOCIATED_MODELS['non-divisions'] = ( + Container, 'get-non-divisions-container', '') ASSOCIATED_MODELS['warehouses'] = (Warehouse, 'get-warehouse', '') ASSOCIATED_MODELS['documents'] = (Document, 'get-document', '') @@ -88,7 +91,8 @@ def dynamic_table_document( t = get_template('ishtar/blocks/window_tables/dynamic_documents.html') context = { 'caption': caption, - 'name': '{}{}{}'.format(slugify(caption), key, int(time.time())), + 'name': '{}{}{}'.format(slugify(caption), key, + int(time.time() * 1000)), 'source': source + source_attrs, 'source_full': source_full, 'simple_source': source, diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 33d817a25..1ef98e3c2 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -705,11 +705,11 @@ def _manage_bool_fields(model, bool_fields, reversed_bool_fields, dct, or_reqs): for k in bool_fields: if k not in dct: continue - elif dct[k] == u"1": + elif dct[k] == "1": dct.pop(k) continue - dct[k] = dct[k].replace(u'"', u'') - if dct[k] in [u"2", u"yes", str(_(u"Yes")).lower()]: + dct[k] = dct[k].replace('"', '') + if dct[k] in ["2", "yes", str(_("Yes")).lower(), "True"]: dct[k] = True else: dct[k] = False @@ -1399,7 +1399,7 @@ def get_item(model, func_name, default_name, extra_request_keys=None, :param own_table_cols: :param relation_types_prefix: :param do_not_deduplicate: duplication of id can occurs on large queryset a - mecanism of deduplication is used. But duplicate ids can be normal (for + mechanism of deduplication is used. But duplicate ids can be normal (for instance for record_relations view). :param model_for_perms: use another model to check permission :param alt_query_own: name of alternate method to get query_own |