diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 5025a24b3cd..09b5ba80391 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -128,7 +128,7 @@ class AccountBankStatement(models.Model): _inherit = ['mail.thread'] name = fields.Char(string='Reference', states={'open': [('readonly', False)]}, copy=False, readonly=True) - date = fields.Date(required=True, states={'confirm': [('readonly', True)]}, select=True, copy=False, default=fields.Date.context_today) + date = fields.Date(required=True, states={'confirm': [('readonly', True)]}, index=True, copy=False, default=fields.Date.context_today) date_done = fields.Datetime(string="Closed On") balance_start = fields.Monetary(string='Starting Balance', states={'confirm': [('readonly', True)]}, default=_default_opening_balance) balance_end_real = fields.Monetary('Ending Balance', states={'confirm': [('readonly', True)]}) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 8116df538c4..2ba2602ad25 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -102,8 +102,8 @@ class AccountVoucher(models.Model): pay_now = fields.Selection([ ('pay_now', 'Pay Directly'), ('pay_later', 'Pay Later'), - ], 'Payment', select=True, readonly=True, states={'draft': [('readonly', False)]}, default='pay_later') - date_due = fields.Date('Due Date', readonly=True, select=True, states={'draft': [('readonly', False)]}) + ], 'Payment', index=True, readonly=True, states={'draft': [('readonly', False)]}, default='pay_later') + date_due = fields.Date('Due Date', readonly=True, index=True, states={'draft': [('readonly', False)]}) @api.onchange('partner_id', 'pay_now') def onchange_partner_id(self): diff --git a/addons/event/models/event.py b/addons/event/models/event.py index c14ce0e51cc..5348726b100 100644 --- a/addons/event/models/event.py +++ b/addons/event/models/event.py @@ -290,7 +290,7 @@ class event_registration(models.Model): string='Status', default='draft', readonly=True, copy=False, track_visibility='onchange') email = fields.Char(string='Email') phone = fields.Char(string='Phone') - name = fields.Char(string='Attendee Name', select=True) + name = fields.Char(string='Attendee Name', index=True) @api.one @api.constrains('event_id', 'state') diff --git a/addons/event_sale/wizard/event_edit_registration.py b/addons/event_sale/wizard/event_edit_registration.py index 98f6553f5a6..0526db91646 100644 --- a/addons/event_sale/wizard/event_edit_registration.py +++ b/addons/event_sale/wizard/event_edit_registration.py @@ -68,7 +68,7 @@ class RegistrationEditorLine(models.TransientModel): event_ticket_id = fields.Many2one('event.event.ticket', string='Event Ticket') email = fields.Char(string='Email') phone = fields.Char(string='Phone') - name = fields.Char(string='Name', select=True) + name = fields.Char(string='Name', index=True) @api.one def get_registration_data(self): diff --git a/addons/hr_equipment/models/hr_equipment.py b/addons/hr_equipment/models/hr_equipment.py index fa7ebe2e95f..0d48366224f 100644 --- a/addons/hr_equipment/models/hr_equipment.py +++ b/addons/hr_equipment/models/hr_equipment.py @@ -236,7 +236,7 @@ class HrEquipmentRequest(models.Model): employee_id = fields.Many2one('hr.employee', string='Employee', default=_default_employee_get) department_id = fields.Many2one('hr.department', string='Department') category_id = fields.Many2one('hr.equipment.category', string='Category') - equipment_id = fields.Many2one('hr.equipment', string='Asset', select=True) + equipment_id = fields.Many2one('hr.equipment', string='Asset', index=True) user_id = fields.Many2one('res.users', string='Assigned to', track_visibility='onchange') stage_id = fields.Many2one('hr.equipment.stage', string='Stage', track_visibility='onchange', default=_default_stage) priority = fields.Selection([('0', 'Very Low'), ('1', 'Low'), ('2', 'Normal'), ('3', 'High')], string='Priority') diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py index 5d52ca247cd..fdcbf8be550 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -111,19 +111,19 @@ class Applicant(models.Model): help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma") probability = fields.Float("Probability") partner_id = fields.Many2one('res.partner', "Contact") - create_date = fields.Datetime("Creation Date", readonly=True, select=True) + create_date = fields.Datetime("Creation Date", readonly=True, index=True) write_date = fields.Datetime("Update Date", readonly=True) stage_id = fields.Many2one('hr.recruitment.stage', 'Stage', track_visibility='onchange', - domain="[('job_ids', '=', job_id)]", copy=False, select=1, + domain="[('job_ids', '=', job_id)]", copy=False, index=True, default=_default_stage_id) last_stage_id = fields.Many2one('hr.recruitment.stage', "Last Stage", help="Stage of the applicant before being in the current stage. Used for lost cases analysis.") categ_ids = fields.Many2many('hr.applicant.category', string="Tags") company_id = fields.Many2one('res.company', "Company", default=_default_company_id) user_id = fields.Many2one('res.users', "Responsible", track_visibility="onchange", default=lambda self: self.env.uid) - date_closed = fields.Datetime("Closed", readonly=True, select=True) - date_open = fields.Datetime("Assigned", readonly=True, select=True) - date_last_stage_update = fields.Datetime("Last Stage Update", select=True, default=fields.Datetime.now) + date_closed = fields.Datetime("Closed", readonly=True, index=True) + date_open = fields.Datetime("Assigned", readonly=True, index=True) + date_last_stage_update = fields.Datetime("Last Stage Update", index=True, default=fields.Datetime.now) date_action = fields.Date("Next Action Date") title_action = fields.Char("Next Action", size=64) priority = fields.Selection(AVAILABLE_PRIORITIES, "Appreciation", default='0') diff --git a/addons/lunch/models/lunch.py b/addons/lunch/models/lunch.py index c0a194df053..8b9af708905 100644 --- a/addons/lunch/models/lunch.py +++ b/addons/lunch/models/lunch.py @@ -147,7 +147,7 @@ class LunchOrderLine(models.Model): ('confirmed', 'Received'), ('ordered', 'Ordered'), ('cancelled', 'Cancelled')], - 'Status', readonly=True, select=True, default='new') + 'Status', readonly=True, index=True, default='new') cashmove = fields.One2many('lunch.cashmove', 'order_id', 'Cash Move') currency_id = fields.Many2one('res.currency', related='order_id.currency_id') @@ -234,7 +234,7 @@ class LunchAlert(models.Model): alert_type = fields.Selection([('specific', 'Specific Day'), ('week', 'Every Week'), ('days', 'Every Day')], - string='Recurrency', required=True, select=True, default='specific') + string='Recurrency', required=True, index=True, default='specific') specific_day = fields.Date('Day', default=fields.Date.context_today) monday = fields.Boolean('Monday') tuesday = fields.Boolean('Tuesday') diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index 578828d9757..e2a99d350ba 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -48,7 +48,7 @@ class Channel(models.Model): ('channel', 'Channel')], 'Channel Type', default='channel') description = fields.Text('Description') - uuid = fields.Char('UUID', size=50, select=True, default=lambda self: '%s' % uuid.uuid4()) + uuid = fields.Char('UUID', size=50, index=True, default=lambda self: '%s' % uuid.uuid4()) email_send = fields.Boolean('Send messages by email', default=False) # multi users channel channel_last_seen_partner_ids = fields.One2many('mail.channel.partner', 'channel_id', string='Last Seen') diff --git a/addons/mail/models/mail_followers.py b/addons/mail/models/mail_followers.py index 2dd62582b1d..eda2c0647a4 100644 --- a/addons/mail/models/mail_followers.py +++ b/addons/mail/models/mail_followers.py @@ -18,13 +18,13 @@ class Followers(models.Model): _description = 'Document Followers' res_model = fields.Char( - 'Related Document Model', required=True, select=1, help='Model of the followed resource') + 'Related Document Model', required=True, index=True, help='Model of the followed resource') res_id = fields.Integer( - 'Related Document ID', select=1, help='Id of the followed resource') + 'Related Document ID', index=True, help='Id of the followed resource') partner_id = fields.Many2one( - 'res.partner', string='Related Partner', ondelete='cascade', select=1) + 'res.partner', string='Related Partner', ondelete='cascade', index=True) channel_id = fields.Many2one( - 'mail.channel', string='Listener', ondelete='cascade', select=1) + 'mail.channel', string='Listener', ondelete='cascade', index=True) subtype_ids = fields.Many2many( 'mail.message.subtype', string='Subtype', help="Message subtypes followed, meaning subtypes that will be pushed onto the user's Wall.") diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 3ef01566916..025afc90b20 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -57,12 +57,12 @@ class Message(models.Model): help='Attachments are linked to a document through model / res_id and to the message' 'through this field.') parent_id = fields.Many2one( - 'mail.message', 'Parent Message', select=True, ondelete='set null', + 'mail.message', 'Parent Message', index=True, ondelete='set null', help="Initial thread message.") child_ids = fields.One2many('mail.message', 'parent_id', 'Child Messages') # related document - model = fields.Char('Related Document Model', select=1) - res_id = fields.Integer('Related Document ID', select=1) + model = fields.Char('Related Document Model', index=True) + res_id = fields.Integer('Related Document ID', index=True) record_name = fields.Char('Message Record Name', help="Name get of the related document.") # characteristics message_type = fields.Selection([ @@ -73,13 +73,13 @@ class Message(models.Model): help="Message type: email for email message, notification for system " "message, comment for other messages such as user replies", oldname='type') - subtype_id = fields.Many2one('mail.message.subtype', 'Subtype', ondelete='set null', select=1) + subtype_id = fields.Many2one('mail.message.subtype', 'Subtype', ondelete='set null', index=True) # origin email_from = fields.Char( 'From', default=_get_default_from, help="Email address of the sender. This field is set when no matching partner is found and replaces the author_id field in the chatter.") author_id = fields.Many2one( - 'res.partner', 'Author', select=1, + 'res.partner', 'Author', index=True, ondelete='set null', default=_get_default_author, help="Author of the message. If not set, email_from may hold an email address that did not match any partner.") author_avatar = fields.Binary("Author's avatar", related='author_id.image_small') @@ -108,7 +108,7 @@ class Message(models.Model): no_auto_thread = fields.Boolean( 'No threading for answers', help='Answers do not go in the original document discussion thread. This has an impact on the generated message-id.') - message_id = fields.Char('Message-Id', help='Message unique identifier', select=1, readonly=1, copy=False) + message_id = fields.Char('Message-Id', help='Message unique identifier', index=True, readonly=1, copy=False) reply_to = fields.Char('Reply-To', help='Reply email address. Setting the reply_to bypasses the automatic thread creation.') mail_server_id = fields.Many2one('ir.mail_server', 'Outgoing mail server') diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py index 4bb2b2378cf..c4346fd6c71 100644 --- a/addons/mail/models/mail_template.py +++ b/addons/mail/models/mail_template.py @@ -116,7 +116,7 @@ class MailTemplate(models.Model): name = fields.Char('Name') model_id = fields.Many2one('ir.model', 'Applies to', help="The kind of document with with this template can be used") - model = fields.Char('Related Document Model', related='model_id.model', select=True, store=True, readonly=True) + model = fields.Char('Related Document Model', related='model_id.model', index=True, store=True, readonly=True) lang = fields.Char('Language', help="Optional translation language (ISO code) to select when sending out an email. " "If not set, the english version will be used. " diff --git a/addons/mail/models/mail_tracking_value.py b/addons/mail/models/mail_tracking_value.py index 87c26590550..8619c69404d 100644 --- a/addons/mail/models/mail_tracking_value.py +++ b/addons/mail/models/mail_tracking_value.py @@ -25,7 +25,7 @@ class MailTracking(models.Model): new_value_text = fields.Text('New Value Text', readonly=1) new_value_datetime = fields.Datetime('New Value Datetime', readonly=1) - mail_message_id = fields.Many2one('mail.message', 'Message ID', required=True, select=True, ondelete='cascade') + mail_message_id = fields.Many2one('mail.message', 'Message ID', required=True, index=True, ondelete='cascade') @api.model def create_tracking_values(self, initial_value, new_value, col_name, col_info): diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py index bb6e8e9aeb4..a8bbccebfb5 100644 --- a/addons/mail/wizard/invite.py +++ b/addons/mail/wizard/invite.py @@ -25,8 +25,8 @@ class Invite(models.TransientModel): result['message'] = _('
Hello,
%s invited you to follow a new document.