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, {})
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)
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)
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)
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())