Example #1
0
 def activate(menuitem, action, atype):
     rec = load(record)
     action = Action.evaluate(action, atype, rec)
     data = {"model": model, "id": rec.id, "ids": [rec.id]}
     event = gtk.get_current_event()
     allow_similar = False
     if event.state & gtk.gdk.CONTROL_MASK or event.state & gtk.gdk.MOD1_MASK:
         allow_similar = True
     with Window(hide_current=True, allow_similar=allow_similar):
         Action._exec_action(action, data, {})
Example #2
0
 def _action(self, action, atype):
     action = action.copy()
     if not self.screen.save_current():
         return
     record_id = self.screen.id_get()
     record_ids = self.screen.sel_ids_get()
     action = Action.evaluate(action, atype, self.screen.current_record)
     data = {
         'model': self.screen.model_name,
         'id': record_id,
         'ids': record_ids,
     }
     Action._exec_action(action, data, self.context)
Example #3
0
 def _action(self, action, atype):
     action = action.copy()
     if not self.screen.save_current():
         return
     record_id = self.screen.id_get()
     record_ids = self.screen.sel_ids_get()
     action = Action.evaluate(action, atype, self.screen.current_record)
     data = {
         'model': self.screen.model_name,
         'id': record_id,
         'ids': record_ids,
     }
     Action._exec_action(action, data, self.context)
Example #4
0
 def _action(self, action, atype):
     if not self.modified_save():
         return
     action = action.copy()
     record_id = (self.screen.current_record.id
                  if self.screen.current_record else None)
     record_ids = [r.id for r in self.screen.selected_records]
     action = Action.evaluate(action, atype, self.screen.current_record)
     data = {
         'model': self.screen.model_name,
         'id': record_id,
         'ids': record_ids,
     }
     Action.execute(action, data, context=self.screen.local_context)
Example #5
0
 def _action(self, action, atype):
     action = action.copy()
     if not self.screen.save_current():
         return
     record_id = (self.screen.current_record.id
                  if self.screen.current_record else None)
     record_ids = [r.id for r in self.screen.selected_records]
     action = Action.evaluate(action, atype, self.screen.current_record)
     data = {
         'model': self.screen.model_name,
         'id': record_id,
         'ids': record_ids,
     }
     Action._exec_action(action, data, self.screen.context)
Example #6
0
 def _action(self, action, atype):
     action = action.copy()
     if not self.screen.save_current():
         return
     record_id = (self.screen.current_record.id
         if self.screen.current_record else None)
     record_ids = [r.id for r in self.screen.selected_records]
     action = Action.evaluate(action, atype, self.screen.current_record)
     data = {
         'model': self.screen.model_name,
         'id': record_id,
         'ids': record_ids,
     }
     Action._exec_action(action, data, self.screen.context)
Example #7
0
 def activate(menuitem, action, atype):
     rec = load(record)
     action = Action.evaluate(action, atype, rec)
     data = {
         'model': model,
         'id': rec.id,
         'ids': [rec.id],
     }
     event = gtk.get_current_event()
     allow_similar = False
     if (event.state & gtk.gdk.CONTROL_MASK
             or event.state & gtk.gdk.MOD1_MASK):
         allow_similar = True
     with Window(hide_current=True, allow_similar=allow_similar):
         Action._exec_action(action, data, rec.get_context())