def executeRelation(self, action, id):
     group = RecordGroup(action['model_name'])
     group.load([id])
     record = group.modelByIndex(0)
     action['domain'] = record.evaluateExpression(action['domain'],
                                                  checkLoad=False)
     action['context'] = str(
         record.evaluateExpression(action['context'], checkLoad=False))
     Api.instance.executeAction(action)
Пример #2
0
 def executeRelation(self, record, action):
     id = record.get()[self.name]
     group = RecordGroup(self.attributes['relation'])
     group.load([id])
     record = group.modelByIndex(0)
     action = action.copy()
     action['domain'] = record.evaluateExpression(action['domain'],
                                                  checkLoad=False)
     action['context'] = str(
         record.evaluateExpression(action['context'], checkLoad=False))
     Api.instance.executeAction(action)
Пример #3
0
 def executeRelation(self, action):
     id = self.record.get()[self.name]
     group = RecordGroup(self.attrs['relation'])
     group.load([id])
     record = group.modelByIndex(0)
     # Copy action so we do not update the action, othewise, domain and context would only be
     # evaluated fo the first record but not the following ones.
     action = action.copy()
     action['domain'] = record.evaluateExpression(action['domain'],
                                                  checkLoad=False)
     action['context'] = str(
         record.evaluateExpression(action['context'], checkLoad=False))
     Api.instance.executeAction(action)