def fillresponse(self): self.action_list = [] if self.final_class is not None: self.add_action(self.final_class.get_action(TITLE_OK, "images/ok.png")) model_current = self.getparam('modelname') if model_current is None: self.model = self.inital_model else: self.model = apps.get_model(model_current) self.field_id = self.model.__name__.lower() if self.field_id == 'legalentity': self.field_id = 'legal_entity' self.item = self.model() XferSearchEditor.fillresponse(self) self.remove_component('title') lbl = XferCompLabelForm('modelname_lbl') lbl.set_value_as_title(_('model')) lbl.set_location(1, 0) self.add_component(lbl) selected_model = XferCompSelect('modelname') selected_model.set_value(model_current) selected_model.set_select(self.inital_model.get_select_contact_type()) selected_model.set_location(2, 0, 3) selected_model.set_action(self.request, self.get_action(), modal=FORMTYPE_REFRESH, close=CLOSE_NO) self.add_component(selected_model) if self.select_class is not None: grid = self.get_components(self.field_id) grid.add_action(self.request, self.select_class.get_action(_("Select"), "images/ok.png"), close=CLOSE_YES, unique=self.mode_select, params={'pkname': self.field_id}, pos_act=0)
def fillresponse(self): self.action_list = [] if self.final_class is not None: self.add_action( self.final_class.get_action(TITLE_OK, "images/ok.png")) model_current = self.getparam('modelname') if model_current is None: self.model = self.inital_model else: self.model = apps.get_model(model_current) self.field_id = self.model.__name__.lower() if self.field_id == 'legalentity': self.field_id = 'legal_entity' self.item = self.model() XferSearchEditor.fillresponse(self) self.remove_component('title') selected_model = XferCompSelect('modelname') selected_model.set_value(model_current) selected_model.set_select(self.inital_model.get_select_contact_type()) selected_model.set_location(1, 0, 4) selected_model.set_action(self.request, self.get_action(), modal=FORMTYPE_REFRESH, close=CLOSE_NO) selected_model.description = _('model') self.add_component(selected_model) if self.select_class is not None: grid = self.get_components(self.field_id) grid.add_action(self.request, self.select_class.get_action( _("Select"), "images/ok.png"), close=CLOSE_YES, unique=self.mode_select, params={'pkname': self.field_id}, pos_act=0)
def fillresponse(self): XferSearchEditor.fillresponse(self) self.item.editor.add_email_selector(self, 0, self.get_max_row() + 1, 5) if WrapAction.is_permission(self.request, 'contacts.add_abstractcontact'): self.get_components(self.field_id).add_action(self.request, ObjectMerge.get_action(_("Merge"), "images/clone.png"), close=CLOSE_NO, unique=SELECT_MULTI, params={'modelname': self.model.get_long_name(), 'field_id': self.field_id}) self.add_action(AbstractContactFindDouble.get_action(_("duplicate"), "images/clone.png"), params={'modelname': self.model.get_long_name(), 'field_id': self.field_id}, pos_act=0)
def fillresponse(self): XferSearchEditor.fillresponse(self) if self.select_class is not None: grid = self.get_components(self.field_id) grid.add_action(self.request, self.select_class.get_action( _("Select"), "images/ok.png"), close=CLOSE_YES, unique=self.mode_select, pos_act=0)
def fillresponse(self): XferSearchEditor.fillresponse(self) if self.select_class is not None: grid = self.get_components(self.field_id) grid.add_action(self.request, self.select_class.get_action(_("Select"), "images/ok.png"), close=CLOSE_YES, unique=self.mode_select, pos_act=0)