Browse Source

fix organic check box not working

Daniel Sheffield 3 years ago
parent
commit
b49e90a660
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/activities/TransactionEditor.py

+ 2 - 2
app/activities/TransactionEditor.py

@@ -61,7 +61,7 @@ class TransactionEditor(FocusWidget):
         })
 
     def apply_organic_state(self, w, state):
-        self.data['organic'] = repr(state).lower()
+        self.data['organic'] = 'yes' if state is True else 'no'
 
     def clear(self):
         for k in self.data:
@@ -79,7 +79,7 @@ class TransactionEditor(FocusWidget):
                 date or None, store or None
             ) else ''
         )
-        self.organic_checkbox.set_state(True if self.data['organic'] == 'true' else False)
+        self.organic_checkbox.set_state(True if self.data['organic'] == 'yes' else False)
         return self
 
     def focus_on_product(self):