コード例 #1
0
 def validate_set(self):
     change = self._check_load()
     for fname in self.mgroup.mfields:
         field = self.mgroup.mfields[fname]
         change = change or not field.get_state_attrs(self).get('valid', True)
         field.get_state_attrs(self)['valid'] = True
     if change:
         self.signal('record-changed')
     self.reload()
     return change
コード例 #2
0
ファイル: record.py プロジェクト: Som-Energia/erpclient
 def validate_set(self):
     change = self._check_load()
     for fname in self.mgroup.mfields:
         field = self.mgroup.mfields[fname]
         change = change or not field.get_state_attrs(self).get(
             'valid', True)
         field.get_state_attrs(self)['valid'] = True
     if change:
         self.signal('record-changed')
     self.reload()
     return change
コード例 #3
0
 def get(self, get_readonly=True, includeid=False, check_load=True, get_modifiedonly=False):
     if check_load:
         self._check_load()
     value = []
     for name, field in self.mgroup.mfields.items():
         if (get_readonly or not field.get_state_attrs(self).get('readonly', False)) \
             and (not get_modifiedonly or (field.name in self.modified_fields or isinstance(field, O2MField))):
                 value.append((name, field.get(self, readonly=get_readonly,
                     modified=get_modifiedonly)))
     value = dict(value)
     if includeid:
         value['id'] = self.id
     return value
コード例 #4
0
ファイル: record.py プロジェクト: Som-Energia/erpclient
 def get(self,
         get_readonly=True,
         includeid=False,
         check_load=True,
         get_modifiedonly=False):
     if check_load:
         self._check_load()
     value = []
     for name, field in self.mgroup.mfields.items():
         if (get_readonly or not field.get_state_attrs(self).get('readonly', False)) \
             and (not get_modifiedonly or (field.name in self.modified_fields or isinstance(field, O2MField))):
             value.append((name,
                           field.get(self,
                                     readonly=get_readonly,
                                     modified=get_modifiedonly)))
     value = dict(value)
     if includeid:
         value['id'] = self.id
     return value
コード例 #5
0
ファイル: record.py プロジェクト: Som-Energia/erpclient
 def _get_invalid_fields(self):
     res = []
     for fname, field in self.mgroup.mfields.items():
         if not field.get_state_attrs(self).get('valid', True):
             res.append((fname, field.attrs['string']))
     return dict(res)
コード例 #6
0
 def _get_invalid_fields(self):
     res = []
     for fname, field in self.mgroup.mfields.items():
         if not field.get_state_attrs(self).get('valid', True):
             res.append((fname, field.attrs['string']))
     return dict(res)