from odoo import api, fields, models, _

class EtourismDirectoryCategory(models.Model):
    _name = "etourism.directory.category"
    _description = "Category"

    name = fields.Char('Name',required=True)
    code = fields.Char('Code')

    @api.model
    def fields_get(self, fields=None, attributes=None):
        """ Hide fields from advanced search
        """
        fields_to_hide = ['create_date','create_uid','write_date','write_uid']
        fields = super(EtourismDirectoryCategory, self).fields_get(fields, attributes=attributes)
        for field in fields_to_hide:
            if field in fields:
                fields[field]['selectable'] = False
        return fields