Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE][REF] mail, various: rename and merge both tracking field parameters #28430

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -241,7 +241,7 @@ def _compute_payments(self):
('in_refund','Vendor Credit Note'),
], readonly=True, states={'draft': [('readonly', False)]}, index=True, change_default=True,
default=lambda self: self._context.get('type', 'out_invoice'),
track_visibility='always')
tracking=True)

refund_invoice_id = fields.Many2one('account.invoice', string="Invoice for which this invoice is the credit note")
number = fields.Char(related='move_id.name', store=True, readonly=True, copy=False)
@@ -259,7 +259,7 @@ def _compute_payments(self):
('paid', 'Paid'),
('cancel', 'Cancelled'),
], string='Status', index=True, readonly=True, default='draft',
track_visibility='onchange', copy=False,
tracking=True, copy=False,
help=" * The 'Draft' status is used when a user is encoding a new and unconfirmed Invoice.\n"
" * The 'Open' status is used when user creates invoice, an invoice number is generated. It stays in the open status till the user pays the invoice.\n"
" * The 'In Payment' status is used when payments have been registered for the entirety of the invoice in a journal configured to post entries at bank reconciliation only, and some of them haven't been reconciled with a bank statement line yet.\n"
@@ -279,7 +279,7 @@ def _compute_payments(self):
"means direct payment.")
partner_id = fields.Many2one('res.partner', string='Partner', change_default=True,
readonly=True, states={'draft': [('readonly', False)]},
track_visibility='always', help="You can find a contact by its Name, TIN, Email or Internal Reference.")
tracking=True, help="You can find a contact by its Name, TIN, Email or Internal Reference.")
vendor_bill_id = fields.Many2one('account.invoice', string='Vendor Bill',
help="Auto-complete from a past bill.")
payment_term_id = fields.Many2one('account.payment.term', string='Payment Terms', oldname='payment_term',
@@ -306,7 +306,7 @@ def _compute_payments(self):

amount_by_group = fields.Binary(string="Tax amount by group", compute='_amount_by_group', help="type: [(name, amount, base, formated amount, formated base)]")
amount_untaxed = fields.Monetary(string='Untaxed Amount',
store=True, readonly=True, compute='_compute_amount', track_visibility='always')
store=True, readonly=True, compute='_compute_amount', tracking=True)
amount_untaxed_signed = fields.Monetary(string='Untaxed Amount in Company Currency', currency_field='company_currency_id',
store=True, readonly=True, compute='_compute_amount')
amount_tax = fields.Monetary(string='Tax',
@@ -321,7 +321,7 @@ def _compute_payments(self):
help="Total amount in the currency of the company, negative for credit notes.")
currency_id = fields.Many2one('res.currency', string='Currency',
required=True, readonly=True, states={'draft': [('readonly', False)]},
default=_default_currency, track_visibility='always')
default=_default_currency, tracking=True)
company_currency_id = fields.Many2one('res.currency', related='company_id.currency_id', string="Company Currency", readonly=True)
journal_id = fields.Many2one('account.journal', string='Journal',
required=True, readonly=True, states={'draft': [('readonly', False)]},
@@ -345,7 +345,7 @@ def _compute_payments(self):
compute='_compute_residual', store=True, help="Remaining amount due in the currency of the company.")
payment_ids = fields.Many2many('account.payment', 'account_invoice_payment_rel', 'invoice_id', 'payment_id', string="Payments", copy=False, readonly=True)
payment_move_line_ids = fields.Many2many('account.move.line', string='Payment Move Lines', compute='_compute_payments', store=True)
user_id = fields.Many2one('res.users', string='Salesperson', track_visibility='onchange',
user_id = fields.Many2one('res.users', string='Salesperson', tracking=True,
readonly=True, states={'draft': [('readonly', False)]},
default=lambda self: self.env.user, copy=False)
fiscal_position_id = fields.Many2one('account.fiscal.position', string='Fiscal Position', oldname='fiscal_position',
@@ -369,7 +369,7 @@ def _compute_payments(self):
help='International Commercial Terms are a series of predefined commercial terms used in international transactions.')

#fields related to vendor bills automated creation by email
source_email = fields.Char(string='Source Email', track_visibility='onchange')
source_email = fields.Char(string='Source Email', tracking=True)
vendor_display_name = fields.Char(compute='_get_vendor_display_info', store=True) # store=True to enable sorting on that column
invoice_icon = fields.Char(compute='_get_vendor_display_info', store=False)

@@ -65,7 +65,7 @@ def _default_payment_journal(self):
('cancel', 'Cancelled'),
('proforma', 'Pro-forma'),
('posted', 'Posted')
], 'Status', readonly=True, track_visibility='onchange', copy=False, default='draft',
], 'Status', readonly=True, tracking=True, copy=False, default='draft',
help=" * The 'Draft' status is used when a user is encoding a new and unconfirmed Voucher.\n"
" * The 'Pro-forma' status is used when the voucher does not have a voucher number.\n"
" * The 'Posted' status is used when user create voucher,a voucher number is generated and voucher entries are created in account.\n"
@@ -121,8 +121,8 @@ def _compute_debit_credit_balance(self):
account.credit = data_credit.get(account.id, 0.0)
account.balance = account.credit - account.debit

name = fields.Char(string='Analytic Account', index=True, required=True, track_visibility='onchange')
code = fields.Char(string='Reference', index=True, track_visibility='onchange')
name = fields.Char(string='Analytic Account', index=True, required=True, tracking=True)
code = fields.Char(string='Reference', index=True, tracking=True)
active = fields.Boolean('Active', help="If the active field is set to False, it will allow you to hide the account without removing it.", default=True)

group_id = fields.Many2one('account.analytic.group', string='Group')
@@ -132,7 +132,7 @@ def _compute_debit_credit_balance(self):
company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.user.company_id)

# use auto_join to speed up name_search call
partner_id = fields.Many2one('res.partner', string='Customer', auto_join=True, track_visibility='onchange')
partner_id = fields.Many2one('res.partner', string='Customer', auto_join=True, tracking=True)

balance = fields.Monetary(compute='_compute_debit_credit_balance', string='Balance')
debit = fields.Monetary(compute='_compute_debit_credit_balance', string='Debit')
@@ -765,7 +765,7 @@ def _compute_is_highlighted(self):
event.is_highlighted = True

name = fields.Char('Meeting Subject', required=True, states={'done': [('readonly', True)]})
state = fields.Selection([('draft', 'Unconfirmed'), ('open', 'Confirmed')], string='Status', readonly=True, track_visibility='onchange', default='draft')
state = fields.Selection([('draft', 'Unconfirmed'), ('open', 'Confirmed')], string='Status', readonly=True, tracking=True, default='draft')

is_attendee = fields.Boolean('Attendee', compute='_compute_attendee')
attendee_status = fields.Selection(Attendee.STATE_SELECTION, string='Attendee Status', compute='_compute_attendee')
@@ -775,14 +775,14 @@ def _compute_is_highlighted(self):
stop = fields.Datetime('Stop', required=True, help="Stop date of an event, without time for full days events")

allday = fields.Boolean('All Day', states={'done': [('readonly', True)]}, default=False)
start_date = fields.Date('Start Date', compute='_compute_dates', inverse='_inverse_dates', store=True, states={'done': [('readonly', True)]}, track_visibility='onchange')
start_datetime = fields.Datetime('Start DateTime', compute='_compute_dates', inverse='_inverse_dates', store=True, states={'done': [('readonly', True)]}, track_visibility='onchange')
stop_date = fields.Date('End Date', compute='_compute_dates', inverse='_inverse_dates', store=True, states={'done': [('readonly', True)]}, track_visibility='onchange')
stop_datetime = fields.Datetime('End Datetime', compute='_compute_dates', inverse='_inverse_dates', store=True, states={'done': [('readonly', True)]}, track_visibility='onchange') # old date_deadline
start_date = fields.Date('Start Date', compute='_compute_dates', inverse='_inverse_dates', store=True, states={'done': [('readonly', True)]}, tracking=True)
start_datetime = fields.Datetime('Start DateTime', compute='_compute_dates', inverse='_inverse_dates', store=True, states={'done': [('readonly', True)]}, tracking=True)
stop_date = fields.Date('End Date', compute='_compute_dates', inverse='_inverse_dates', store=True, states={'done': [('readonly', True)]}, tracking=True)
stop_datetime = fields.Datetime('End Datetime', compute='_compute_dates', inverse='_inverse_dates', store=True, states={'done': [('readonly', True)]}, tracking=True) # old date_deadline
duration = fields.Float('Duration', states={'done': [('readonly', True)]})
description = fields.Text('Description', states={'done': [('readonly', True)]})
privacy = fields.Selection([('public', 'Everyone'), ('private', 'Only me'), ('confidential', 'Only internal users')], 'Privacy', default='public', states={'done': [('readonly', True)]}, oldname="class")
location = fields.Char('Location', states={'done': [('readonly', True)]}, track_visibility='onchange', help="Location of Event")
location = fields.Char('Location', states={'done': [('readonly', True)]}, tracking=True, help="Location of Event")
show_as = fields.Selection([('free', 'Free'), ('busy', 'Busy')], 'Show Time as', states={'done': [('readonly', True)]}, default='busy')

# linked document
@@ -64,31 +64,31 @@ def _default_stage_id(self):
return self._stage_find(team_id=team.id, domain=[('fold', '=', False)]).id

name = fields.Char('Opportunity', required=True, index=True)
partner_id = fields.Many2one('res.partner', string='Customer', track_visibility='onchange', track_sequence=1, index=True,
partner_id = fields.Many2one('res.partner', string='Customer', tracking=1, index=True,
help="Linked partner (optional). Usually created when converting the lead. You can find a partner by its Name, TIN, Email or Internal Reference.")
active = fields.Boolean('Active', default=True, track_visibility=True)
active = fields.Boolean('Active', default=True, tracking=True)
date_action_last = fields.Datetime('Last Action', readonly=True)
email_from = fields.Char('Email', help="Email address of the contact", track_visibility='onchange', track_sequence=4, index=True)
email_from = fields.Char('Email', help="Email address of the contact", tracking=4, index=True)
website = fields.Char('Website', index=True, help="Website of the contact")
team_id = fields.Many2one('crm.team', string='Sales Team', oldname='section_id', default=lambda self: self.env['crm.team'].sudo()._get_default_team_id(user_id=self.env.uid),
index=True, track_visibility='onchange', help='When sending mails, the default email address is taken from the Sales Team.')
index=True, tracking=True, help='When sending mails, the default email address is taken from the Sales Team.')
kanban_state = fields.Selection([('grey', 'No next activity planned'), ('red', 'Next activity late'), ('green', 'Next activity is planned')],
string='Kanban State', compute='_compute_kanban_state')
email_cc = fields.Text('Global CC', 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")
description = fields.Text('Notes', track_visibility='onchange', track_sequence=6)
description = fields.Text('Notes', tracking=6)
tag_ids = fields.Many2many('crm.lead.tag', 'crm_lead_tag_rel', 'lead_id', 'tag_id', string='Tags', help="Classify and analyze your lead/opportunity categories like: Training, Service")
contact_name = fields.Char('Contact Name', track_visibility='onchange', track_sequence=3)
partner_name = fields.Char("Company Name", track_visibility='onchange', track_sequence=2, index=True, help='The name of the future partner company that will be created while converting the lead into opportunity')
contact_name = fields.Char('Contact Name', tracking=3)
partner_name = fields.Char("Company Name", tracking=2, index=True, help='The name of the future partner company that will be created while converting the lead into opportunity')
type = fields.Selection([('lead', 'Lead'), ('opportunity', 'Opportunity')], index=True, required=True,
default=lambda self: 'lead' if self.env['res.users'].has_group('crm.group_use_lead') else 'opportunity',
help="Type is used to separate Leads and Opportunities")
priority = fields.Selection(crm_stage.AVAILABLE_PRIORITIES, string='Priority', index=True, default=crm_stage.AVAILABLE_PRIORITIES[0][0])
date_closed = fields.Datetime('Closed Date', readonly=True, copy=False)

stage_id = fields.Many2one('crm.stage', string='Stage', ondelete='restrict', track_visibility='onchange', index=True,
stage_id = fields.Many2one('crm.stage', string='Stage', ondelete='restrict', tracking=True, index=True,
domain="['|', ('team_id', '=', False), ('team_id', '=', team_id)]",
group_expand='_read_group_stage_ids', default=lambda self: self._default_stage_id())
user_id = fields.Many2one('res.users', string='Salesperson', track_visibility='onchange', default=lambda self: self.env.user)
user_id = fields.Many2one('res.users', string='Salesperson', index=True, tracking=True, default=lambda self: self.env.user)
referred = fields.Char('Referred By')

date_open = fields.Datetime('Assignation Date', readonly=True, default=fields.Datetime.now)
@@ -102,7 +102,7 @@ def _default_stage_id(self):

# Only used for type opportunity
probability = fields.Float('Probability', group_operator="avg", default=lambda self: self._default_probability())
planned_revenue = fields.Monetary('Expected Revenue', currency_field='company_currency', track_visibility='always')
planned_revenue = fields.Monetary('Expected Revenue', currency_field='company_currency', tracking=True)
expected_revenue = fields.Monetary('Prorated Revenue', currency_field='company_currency', store=True, compute="_compute_expected_revenue")
date_deadline = fields.Date('Expected Closing', help="Estimate of the date on which the opportunity will be won.")
color = fields.Integer('Color Index', default=0)
@@ -121,13 +121,13 @@ def _default_stage_id(self):
city = fields.Char('City')
state_id = fields.Many2one("res.country.state", string='State')
country_id = fields.Many2one('res.country', string='Country')
phone = fields.Char('Phone', track_visibility='onchange', track_sequence=5)
phone = fields.Char('Phone', tracking=5)
mobile = fields.Char('Mobile')
function = fields.Char('Job Position')
title = fields.Many2one('res.partner.title')
company_id = fields.Many2one('res.company', string='Company', index=True, default=lambda self: self.env.user.company_id.id)
meeting_count = fields.Integer('# Meetings', compute='_compute_meeting_count')
lost_reason = fields.Many2one('crm.lost.reason', string='Lost Reason', index=True, track_visibility='onchange')
lost_reason = fields.Many2one('crm.lost.reason', string='Lost Reason', index=True, tracking=True)

_sql_constraints = [
('check_probability', 'check(probability >= 0 and probability <= 100)', 'The probability of closing the deal should be between 0% and 100%!')
@@ -97,15 +97,15 @@ class EventEvent(models.Model):
user_id = fields.Many2one(
'res.users', string='Responsible',
default=lambda self: self.env.user,
track_visibility="onchange",
tracking=True,
readonly=False, states={'done': [('readonly', True)]})
company_id = fields.Many2one(
'res.company', string='Company', change_default=True,
default=lambda self: self.env['res.company']._company_default_get('event.event'),
required=False, readonly=False, states={'done': [('readonly', True)]})
organizer_id = fields.Many2one(
'res.partner', string='Organizer',
track_visibility="onchange",
tracking=True,
default=lambda self: self.env.user.company_id.partner_id)
event_type_id = fields.Many2one(
'event.type', string='Category',
@@ -149,10 +149,10 @@ class EventEvent(models.Model):
date_tz = fields.Selection('_tz_get', string='Timezone', required=True, default=lambda self: self.env.user.tz or 'UTC')
date_begin = fields.Datetime(
string='Start Date', required=True,
track_visibility='onchange', states={'done': [('readonly', True)]})
tracking=True, states={'done': [('readonly', True)]})
date_end = fields.Datetime(
string='End Date', required=True,
track_visibility='onchange', states={'done': [('readonly', True)]})
tracking=True, states={'done': [('readonly', True)]})
date_begin_located = fields.Char(string='Start Date Located', compute='_compute_date_begin_tz')
date_end_located = fields.Char(string='End Date Located', compute='_compute_date_end_tz')

@@ -167,7 +167,7 @@ class EventEvent(models.Model):
'res.partner', string='Location',
default=lambda self: self.env.user.company_id.partner_id,
readonly=False, states={'done': [('readonly', True)]},
track_visibility="onchange")
tracking=True)
country_id = fields.Many2one('res.country', 'Country', related='address_id.country_id', store=True, readonly=False)
twitter_hashtag = fields.Char('Twitter Hashtag')
description = fields.Html(
@@ -389,7 +389,7 @@ class EventRegistration(models.Model):
state = fields.Selection([
('draft', 'Unconfirmed'), ('cancel', 'Cancelled'),
('open', 'Confirmed'), ('done', 'Attended')],
string='Status', default='draft', readonly=True, copy=False, track_visibility='onchange')
string='Status', default='draft', readonly=True, copy=False, tracking=True)
email = fields.Char(string='Email')
phone = fields.Char(string='Phone')
name = fields.Char(string='Attendee Name', index=True)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.