[FIX] tools: don't extract missing spreadsheet data source name
Previous versions of spreadsheet files don't have a name for list and pivot datasources. The spreadsheet template "pipeline dashboard" in `document_spreadsheet_crm` is such a file. As a consequence, exporting the source terms from this module fails with a `KeyError: 'name'` Part-of: odoo/odoo#101659
This commit is contained in:
committed by
Martin Trigaux
parent
e1af8cd69c
commit
f07cd645c9
@@ -942,7 +942,8 @@ def extract_spreadsheet_terms(fileobj, keywords, comment_tags, options):
|
||||
pivots = data.get('pivots', {}).values()
|
||||
lists = data.get('lists', {}).values()
|
||||
for data_source in itertools.chain(lists, pivots):
|
||||
terms.append(data_source['name'])
|
||||
if 'name' in data_source:
|
||||
terms.append(data_source['name'])
|
||||
for global_filter in data.get('globalFilters', []):
|
||||
terms.append(global_filter['label'])
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user