Skip to content

Commit

Permalink
Disable EvaluateDefaultValues and AutoTransaction options (#108)
Browse files Browse the repository at this point in the history
Disable EvaluateDefaultValues and AutoTransaction options if there are offline layers in the project
  • Loading branch information
marioba authored Mar 9, 2019
1 parent 158e6fb commit 08a7a19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions qfieldsync/core/offline_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ def convert(self):
self.project_configuration.offline_copy_only_aoi):
raise Exception(self.tr("Error trying to convert layers to offline layers"))

# Disable project options that could create problems on a portable
# project with offline layers
if self.__offline_layers:
QgsProject.instance().setEvaluateDefaultValues(False)
QgsProject.instance().setAutoTransaction(False)

# Now we have a project state which can be saved as offline project
QgsProject.instance().write(project_path)
finally:
Expand Down

0 comments on commit 08a7a19

Please sign in to comment.