def _onchange_model_id(self): model_id = self.model_id self.name = model_id.name self.xml_id = "view_{snake}_search".format( snake=snake_case(model_id.model)) self.model_inherit_type = model_id.inherit_type # shouldn`t be doing that self.model_name = model_id.model # shouldn`t be doing that
def _onchange_model_id(self): self.name = self.model_id.name self.xml_id = "view_{snake}_form".format( snake=snake_case(self.model_id.model)) self.show_status_bar = True if self.model_id.special_states_field_id.id else False self.model_inherit_type = self.model_id.inherit_type #shouldn`t be doing that self.model_name = self.model_id.model #shouldn`t be doing that if not len(self.field_ids): field_list = [] for field in self.model_id.field_ids: if field.name in ['state'] or field.is_inherited: continue field_list.append({ 'field_id': field.id, 'widget': DEFAULT_WIDGETS_BY_TYPE.get(field.ttype), 'field_ttype': field.ttype, 'model_id': self.model_id.id, 'special_states_field_id': self.model_id.special_states_field_id.id }) self.field_ids = field_list
def _onchange_model_id(self): self.name = self.model_id.name self.xml_id = "view_{snake}_tree".format(snake = snake_case(self.model_id.model)) self.model_inherit_type = self.model_id.inherit_type #shouldn`t be doing that self.model_name = self.model_id.model #shouldn`t be doing that if not len(self.field_ids): field_list = [] for field in self.model_id.field_ids: if field.ttype not in ['binary', 'one2many', 'many2many']: field_list.append({'field_id': field.id, 'field_ttype': field.ttype, 'model_id': self.model_id.id, 'special_states_field_id': self.model_id.special_states_field_id.id}) self.field_ids = field_list
def _onchange_model_id(self): self.name = self.model_id.name self.xml_id = "view_{snake}_form".format(snake = snake_case(self.model_id.model)) self.show_status_bar = True if self.model_id.special_states_field_id.id else False self.model_inherit_type = self.model_id.inherit_type #shouldn`t be doing that self.model_name = self.model_id.model #shouldn`t be doing that if not len(self.field_ids): field_list = [] for field in self.model_id.field_ids: if field.name in ['state'] or field.is_inherited: continue field_list.append({'field_id': field.id, 'widget': DEFAULT_WIDGETS_BY_TYPE.get(field.ttype), 'field_ttype': field.ttype, 'model_id': self.model_id.id, 'special_states_field_id': self.model_id.special_states_field_id.id}) self.field_ids = field_list
def _onchange_model_id(self): model_id = self.model_id self.name = model_id.name self.xml_id = "view_{snake}_tree".format( snake=snake_case(model_id.model)) self.model_inherit_type = model_id.inherit_type # shouldn`t be doing that self.model_name = model_id.model # shouldn`t be doing that if not len(self.field_ids): field_list = [] for field in model_id.field_ids: if field.ttype not in ['binary', 'one2many', 'many2many']: field_list.append({ 'field_id': field.id, 'field_ttype': field.ttype, 'model_id': model_id.id, 'special_states_field_id': model_id.special_states_field_id.id }) self.field_ids = field_list
def _onchange_calendar_view(self): self.name = self.model_id.name self.xml_id = "view_{snake}_calendar".format(snake=snake_case(self.model_id.model)) self.model_inherit_type = self.model_id.inherit_type # shouldn`t be doing that self.model_name = self.model_id.model # shouldn`t be doing that
def _onchange_calendar_view(self): self.name = self.model_id.name self.xml_id = "view_{snake}_calendar".format( snake=snake_case(self.model_id.model)) self.model_inherit_type = self.model_id.inherit_type # shouldn`t be doing that self.model_name = self.model_id.model # shouldn`t be doing that
def _onchange_type(self): if (self.type == 'object') and self.name: self.method_name = "action_{name}".format(name=snake_case(self.name.replace(' ', '.')).lower())
def _onchange_model_id(self): model_id = self.model_id self.name = model_id.name self.xml_id = "view_{snake}_search".format(snake=snake_case(model_id.model)) self.model_inherit_type = model_id.inherit_type # shouldn`t be doing that self.model_name = model_id.model # shouldn`t be doing that
def _onchange_type(self): if (self.type == 'object') and self.name: self.method_name = "action_{name}".format( name=snake_case(self.name.replace(' ', '.')).lower())
def _onchange_type(self): if self.type == 'state' and self.change_to_state: self.method_name = "action_{state}".format(state=self.change_to_state) elif self.type == 'object' and self.name: self.method_name = "action_{name}".format(name=snake_case(self.name.replace(' ', '.')).lower())