diff --git a/addons/account/models/account.py b/addons/account/models/account.py
index bf1a2aa5d69..5f591c991b9 100644
--- a/addons/account/models/account.py
+++ b/addons/account/models/account.py
@@ -173,14 +173,12 @@ class AccountAccount(models.Model):
_description = "Account"
_order = "code"
- @api.multi
@api.constrains('internal_type', 'reconcile')
def _check_reconcile(self):
for account in self:
if account.internal_type in ('receivable', 'payable') and account.reconcile == False:
raise ValidationError(_('You cannot have a receivable/payable account that is not reconcilable. (account code: %s)') % account.code)
- @api.multi
@api.constrains('user_type_id')
def _check_user_type_id(self):
data_unaffected_earnings = self.env.ref('account.data_unaffected_earnings')
@@ -340,7 +338,6 @@ class AccountAccount(models.Model):
code_prefix = code_prefix[:-1]
self.group_id = group
- @api.multi
def name_get(self):
result = []
for account in self:
@@ -348,7 +345,6 @@ class AccountAccount(models.Model):
result.append((account.id, name))
return result
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
default = dict(default or {})
@@ -421,7 +417,6 @@ class AccountAccount(models.Model):
"""
self.env.cr.execute(query, [tuple(self.ids)])
- @api.multi
def write(self, vals):
# Do not allow changing the company_id when account_move_line already exist
if vals.get('company_id', False):
@@ -442,7 +437,6 @@ class AccountAccount(models.Model):
return super(AccountAccount, self).write(vals)
- @api.multi
def unlink(self):
if self.env['account.move.line'].search([('account_id', 'in', self.ids)], limit=1):
raise UserError(_('You cannot perform this action on an account that contains journal items.'))
@@ -453,7 +447,6 @@ class AccountAccount(models.Model):
raise UserError(_('You cannot remove/deactivate an account which is set on a customer or vendor.'))
return super(AccountAccount, self).unlink()
- @api.multi
def action_open_reconcile(self):
self.ensure_one()
# Open reconciliation view for this account
@@ -613,13 +606,11 @@ class AccountJournal(models.Model):
('code_company_uniq', 'unique (code, name, company_id)', 'The code and name of the journal must be unique per company !'),
]
- @api.multi
def _compute_alias_domain(self):
alias_domain = self.env["ir.config_parameter"].sudo().get_param("mail.catchall.domain")
for record in self:
record.alias_domain = alias_domain
- @api.multi
# do not depend on 'sequence_id.date_range_ids', because
# sequence_id._get_current_sequence() may invalidate it!
@api.depends('sequence_id.use_date_range', 'sequence_id.number_next_actual')
@@ -634,7 +625,6 @@ class AccountJournal(models.Model):
else:
journal.sequence_number_next = 1
- @api.multi
def _inverse_seq_number_next(self):
'''Inverse 'sequence_number_next' to edit the current sequence next number.
'''
@@ -643,7 +633,6 @@ class AccountJournal(models.Model):
sequence = journal.sequence_id._get_current_sequence()
sequence.sudo().number_next = journal.sequence_number_next
- @api.multi
# do not depend on 'refund_sequence_id.date_range_ids', because
# refund_sequence_id._get_current_sequence() may invalidate it!
@api.depends('refund_sequence_id.use_date_range', 'refund_sequence_id.number_next_actual')
@@ -658,7 +647,6 @@ class AccountJournal(models.Model):
else:
journal.refund_sequence_number_next = 1
- @api.multi
def _inverse_refund_seq_number_next(self):
'''Inverse 'refund_sequence_number_next' to edit the current sequence next number.
'''
@@ -697,7 +685,6 @@ class AccountJournal(models.Model):
if not self.default_debit_account_id:
self.default_debit_account_id = self.default_credit_account_id
- @api.multi
def _get_alias_values(self, type, alias_name=None):
if not alias_name:
alias_name = self.name
@@ -709,7 +696,6 @@ class AccountJournal(models.Model):
'alias_name': re.sub(r'[^\w]+', '-', alias_name)
}
- @api.multi
def unlink(self):
bank_accounts = self.env['res.partner.bank'].browse()
for bank_account in self.mapped('bank_account_id'):
@@ -721,7 +707,6 @@ class AccountJournal(models.Model):
bank_accounts.unlink()
return ret
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
default = dict(default or {})
@@ -743,7 +728,6 @@ class AccountJournal(models.Model):
# remove alias_name to avoid useless write on alias
del(vals['alias_name'])
- @api.multi
def write(self, vals):
for journal in self:
company = journal.company_id
@@ -922,7 +906,6 @@ class AccountJournal(models.Model):
'partner_id': self.company_id.partner_id.id,
}).id
- @api.multi
def name_get(self):
res = []
for journal in self:
@@ -943,13 +926,11 @@ class AccountJournal(models.Model):
journal_ids = self._search(expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid)
return self.browse(journal_ids).name_get()
- @api.multi
@api.depends('company_id')
def _belong_to_company(self):
for journal in self:
journal.belong_to_company = (journal.company_id.id == self.env.company.id)
- @api.multi
def _search_company_journals(self, operator, value):
if value:
recs = self.search([('company_id', operator, self.env.company.id)])
@@ -959,7 +940,6 @@ class AccountJournal(models.Model):
recs = self.search([('company_id', operator, self.env.company.id)])
return [('id', 'in', [x.id for x in recs])]
- @api.multi
@api.depends('inbound_payment_method_ids', 'outbound_payment_method_ids')
def _methods_compute(self):
for journal in self:
@@ -1119,7 +1099,6 @@ class AccountTax(models.Model):
if not all(child.type_tax_use in ('none', tax.type_tax_use) for child in tax.children_tax_ids):
raise ValidationError(_('The application scope of taxes in a group must be either the same as the group or left empty.'))
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
default = dict(default or {}, name=_("%s (Copy)") % self.name)
@@ -1212,7 +1191,6 @@ class AccountTax(models.Model):
if self.amount_type == 'division' and price_include:
return base_amount - (base_amount * (self.amount / 100))
- @api.multi
def json_friendly_compute_all(self, price_unit, currency_id=None, quantity=1.0, product_id=None, partner_id=None, is_refund=False):
""" Just converts parameters in browse records and calls for compute_all, because js widgets can't serialize browse records """
if currency_id:
@@ -1240,7 +1218,6 @@ class AccountTax(models.Model):
rep_lines = self.mapped(is_refund and 'refund_repartition_line_ids' or 'invoice_repartition_line_ids')
return rep_lines.filtered(lambda x: x.repartition_type == repartition_type).mapped('tag_ids')
- @api.multi
def compute_all(self, price_unit, currency=None, quantity=1.0, product=None, partner=None, is_refund=False, handle_price_include=True):
""" Returns all information required to apply taxes (in self + their children in case of a tax group).
We consider the sequence of the parent for group of taxes.
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
index 5f2ee1702dc..25797b50edf 100644
--- a/addons/account/models/account_bank_statement.py
+++ b/addons/account/models/account_bank_statement.py
@@ -38,7 +38,6 @@ class AccountBankStmtCashWizard(models.Model):
cashbox_lines_ids = fields.One2many('account.cashbox.line', 'cashbox_id', string='Cashbox Lines')
- @api.multi
def validate(self):
bnk_stmt_id = self.env.context.get('bank_statement_id', False) or self.env.context.get('active_id', False)
bnk_stmt = self.env['account.bank.statement'].browse(bnk_stmt_id)
@@ -61,7 +60,6 @@ class AccountBankStmtCloseCheck(models.TransientModel):
_name = 'account.bank.statement.closebalance'
_description = 'Bank Statement Closing Balance'
- @api.multi
def validate(self):
bnk_stmt_id = self.env.context.get('active_id', False)
if bnk_stmt_id:
@@ -78,7 +76,6 @@ class AccountBankStatement(models.Model):
statement.balance_end = statement.balance_start + statement.total_entry_encoding
statement.difference = statement.balance_end_real - statement.balance_end
- @api.multi
def _is_difference_zero(self):
for bank_stmt in self:
bank_stmt.is_difference_zero = float_is_zero(bank_stmt.difference, precision_digits=bank_stmt.currency_id.decimal_places)
@@ -112,14 +109,12 @@ class AccountBankStatement(models.Model):
return journals[0]
return self.env['account.journal']
- @api.multi
def _get_opening_balance(self, journal_id):
last_bnk_stmt = self.search([('journal_id', '=', journal_id)], limit=1)
if last_bnk_stmt:
return last_bnk_stmt.balance_end
return 0
- @api.multi
def _set_opening_balance(self, journal_id):
self.balance_start = self._get_opening_balance(journal_id)
@@ -169,7 +164,6 @@ class AccountBankStatement(models.Model):
def onchange_journal_id(self):
self._set_opening_balance(self.journal_id.id)
- @api.multi
def _balance_check(self):
for stmt in self:
if not stmt.currency_id.is_zero(stmt.difference):
@@ -198,7 +192,6 @@ class AccountBankStatement(models.Model):
% (balance_end_real, balance_end))
return True
- @api.multi
def unlink(self):
for statement in self:
if statement.state != 'open':
@@ -207,7 +200,6 @@ class AccountBankStatement(models.Model):
statement.line_ids.unlink()
return super(AccountBankStatement, self).unlink()
- @api.multi
def open_cashbox_id(self):
context = dict(self.env.context or {})
if context.get('cashbox_id'):
@@ -223,7 +215,6 @@ class AccountBankStatement(models.Model):
'target': 'new'
}
- @api.multi
def check_confirm_bank(self):
if self.journal_type == 'cash' and not self.currency_id.is_zero(self.difference):
action_rec = self.env['ir.model.data'].xmlid_to_object('account.action_view_account_bnk_stmt_check')
@@ -232,7 +223,6 @@ class AccountBankStatement(models.Model):
return action
return self.button_confirm_bank()
- @api.multi
def button_confirm_bank(self):
self._balance_check()
statements = self.filtered(lambda r: r.state == 'open')
@@ -255,7 +245,6 @@ class AccountBankStatement(models.Model):
statement.message_post(body=_('Statement %s confirmed, journal items were created.') % (statement.name,))
statements.write({'state': 'confirm', 'date_done': time.strftime("%Y-%m-%d %H:%M:%S")})
- @api.multi
def button_journal_entries(self):
context = dict(self._context or {})
context['journal_id'] = self.journal_id.id
@@ -269,7 +258,6 @@ class AccountBankStatement(models.Model):
'context': context,
}
- @api.multi
def button_open(self):
""" Changes statement state to Running."""
for statement in self:
@@ -283,7 +271,6 @@ class AccountBankStatement(models.Model):
statement.name = st_number
statement.state = 'open'
- @api.multi
def action_bank_reconcile_bank_statements(self):
self.ensure_one()
bank_stmt_lines = self.mapped('line_ids')
@@ -365,14 +352,12 @@ class AccountBankStatementLine(models.Model):
line.amount = line.amount
return line
- @api.multi
def unlink(self):
for line in self:
if line.journal_entry_ids.ids:
raise UserError(_('In order to delete a bank statement line, you must first cancel it to delete related journal items.'))
return super(AccountBankStatementLine, self).unlink()
- @api.multi
def button_cancel_reconciliation(self):
aml_to_unbind = self.env['account.move.line']
aml_to_cancel = self.env['account.move.line']
@@ -500,7 +485,6 @@ class AccountBankStatementLine(models.Model):
aml_dict['move_id'] = move.id
return aml_dict
- @api.multi
def fast_counterpart_creation(self):
"""This function is called when confirming a bank statement and will allow to automatically process lines without
going in the bank reconciliation widget. By setting an account_id on bank statement lines, it will create a journal
@@ -766,7 +750,6 @@ class AccountBankStatementLine(models.Model):
counterpart_moves._check_balanced()
return counterpart_moves
- @api.multi
def _prepare_move_line_for_currency(self, aml_dict, date):
self.ensure_one()
company_currency = self.journal_id.company_id.currency_id
diff --git a/addons/account/models/account_cash_rounding.py b/addons/account/models/account_cash_rounding.py
index 091874074e4..d1ea9731913 100644
--- a/addons/account/models/account_cash_rounding.py
+++ b/addons/account/models/account_cash_rounding.py
@@ -25,7 +25,6 @@ class AccountCashRounding(models.Model):
selection=[('UP', 'UP'), ('DOWN', 'DOWN'), ('HALF-UP', 'HALF-UP')],
default='HALF-UP', help='The tie-breaking rule used for float rounding operations')
- @api.multi
def round(self, amount):
"""Compute the rounding on the amount passed as parameter.
@@ -34,7 +33,6 @@ class AccountCashRounding(models.Model):
"""
return float_round(amount, precision_rounding=self.rounding, rounding_method=self.rounding_method)
- @api.multi
def compute_difference(self, currency, amount):
"""Compute the difference between the base_amount and the amount after rounding.
For example, base_amount=23.91, after rounding=24.00, the result will be 0.09.
diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py
index dc760b842da..ee4235a2cce 100644
--- a/addons/account/models/account_journal_dashboard.py
+++ b/addons/account/models/account_journal_dashboard.py
@@ -73,7 +73,6 @@ class account_journal(models.Model):
return ['', _('Bank: Balance')]
# Below method is used to get data of bank and cash statemens
- @api.multi
def get_line_graph_datas(self):
"""Computes the data used to display the graph for bank and cash journals in the accounting dashboard"""
@@ -133,7 +132,6 @@ class account_journal(models.Model):
return [{'values': data, 'title': graph_title, 'key': graph_key, 'area': True, 'color': color, 'is_sample_data': is_sample_data}]
- @api.multi
def get_bar_graph_datas(self):
data = []
today = fields.Datetime.now(self)
@@ -205,7 +203,6 @@ class account_journal(models.Model):
AND move.type IN ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt')
''', {'journal_id': self.id})
- @api.multi
def get_journal_dashboard_datas(self):
currency = self.currency_id or self.company_id.currency_id
number_to_reconcile = number_to_check = last_balance = account_sum = 0
@@ -368,7 +365,6 @@ class account_journal(models.Model):
rslt_sum += target_currency.round(amount)
return (rslt_count, rslt_sum)
- @api.multi
def action_create_new(self):
ctx = self._context.copy()
ctx['default_journal_id'] = self.id
@@ -388,7 +384,6 @@ class account_journal(models.Model):
'context': ctx,
}
- @api.multi
def create_cash_statement(self):
ctx = self._context.copy()
ctx.update({'journal_id': self.id, 'default_journal_id': self.id, 'default_journal_type': 'cash'})
@@ -400,7 +395,6 @@ class account_journal(models.Model):
'context': ctx,
}
- @api.multi
def action_open_reconcile(self):
if self.type in ['bank', 'cash']:
# Open reconciliation view for bank statements belonging to this journal
@@ -423,7 +417,6 @@ class account_journal(models.Model):
'context': action_context,
}
- @api.multi
def action_open_to_check(self):
self.ensure_one()
ids = self.to_check_ids().ids
@@ -443,7 +436,6 @@ class account_journal(models.Model):
statement_line_ids = self.env['account.move.line'].search(domain).mapped('statement_line_id')
return statement_line_ids
- @api.multi
def open_action(self):
"""return action based on type for related journals"""
action_name = self._context.get('action_name')
@@ -484,19 +476,15 @@ class account_journal(models.Model):
return action
- @api.multi
def open_spend_money(self):
return self.open_payments_action('outbound')
- @api.multi
def open_collect_money(self):
return self.open_payments_action('inbound')
- @api.multi
def open_transfer_money(self):
return self.open_payments_action('transfer')
- @api.multi
def open_payments_action(self, payment_type, mode='tree'):
if payment_type == 'outbound':
action_ref = 'account.action_account_payments_payable'
@@ -510,7 +498,6 @@ class account_journal(models.Model):
action['views'] = [[False, 'form']]
return action
- @api.multi
def open_action_with_context(self):
action_name = self.env.context.get('action_name', False)
if not action_name:
@@ -528,7 +515,6 @@ class account_journal(models.Model):
action['name'] += ' for journal ' + self.name
return action
- @api.multi
def create_bank_statement(self):
"""return action to create a bank statements. This button should be called only on journals with type =='bank'"""
action = self.env.ref('account.action_bank_statement_tree').read()[0]
@@ -538,17 +524,14 @@ class account_journal(models.Model):
})
return action
- @api.multi
def create_customer_payment(self):
"""return action to create a customer payment"""
return self.open_payments_action('inbound', mode='form')
- @api.multi
def create_supplier_payment(self):
"""return action to create a supplier payment"""
return self.open_payments_action('outbound', mode='form')
- @api.multi
def create_internal_transfer(self):
"""return action to create a internal transfer"""
return self.open_payments_action('transfer', mode='form')
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index c9adf0ba7f0..7fb0597aaff 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -409,7 +409,6 @@ class AccountMove(models.Model):
'tag_ids': [(6, 0, tax_vals['tag_ids'])],
}
- @api.multi
def _recompute_tax_lines(self):
''' Compute the dynamic tax lines of the journal entry.
@@ -554,7 +553,6 @@ class AccountMove(models.Model):
tax_line._onchange_amount_currency()
tax_line._onchange_balance()
- @api.multi
def _recompute_cash_rounding_lines(self):
''' Handle the cash rounding feature on invoices.
@@ -676,7 +674,6 @@ class AccountMove(models.Model):
_apply_cash_rounding(self, diff_balance, diff_amount_currency, existing_cash_rounding_line)
- @api.multi
def _recompute_payment_terms_lines(self):
''' Compute the dynamic payment term lines of the journal entry.'''
self.ensure_one()
@@ -803,7 +800,6 @@ class AccountMove(models.Model):
self.invoice_payment_ref = new_terms_lines[-1].name or ''
self.invoice_date_due = new_terms_lines[-1].date_maturity
- @api.multi
def _recompute_dynamic_lines(self, recompute_all_taxes=False):
''' Recompute all lines that depend of others.
@@ -838,7 +834,6 @@ class AccountMove(models.Model):
if self != self._origin:
self.invoice_line_ids = self.line_ids.filtered(lambda line: not line.exclude_from_invoice_tab)
- @api.multi
def onchange(self, values, field_name, field_onchange):
# OVERRIDE
# As the dynamic lines in this model are quite complex, we need to ensure some computations are done exactly
@@ -962,7 +957,6 @@ class AccountMove(models.Model):
else:
move.invoice_payment_state = 'not_paid'
- @api.multi
def _inverse_amount_total(self):
for move in self:
if len(move.line_ids) != 2 or move.type != 'entry':
@@ -986,7 +980,6 @@ class AccountMove(models.Model):
move.write({'line_ids': to_write})
- @api.multi
def _get_domain_matching_supsense_moves(self):
self.ensure_one()
domain = self.env['account.move.line']._get_suspense_moves_domain()
@@ -1063,7 +1056,6 @@ class AccountMove(models.Model):
move.invoice_sequence_number_next_prefix = prefix
move.invoice_sequence_number_next = '%%0%sd' % sequence.padding % number_next
- @api.multi
def _inverse_invoice_sequence_number_next(self):
''' Set the number_next on the sequence related to the invoice/bill/refund'''
# Check user group.
@@ -1081,7 +1073,6 @@ class AccountMove(models.Model):
date_sequence = sequence._get_current_sequence()
date_sequence.number_next_actual = int(result.group(2))
- @api.multi
def _compute_payments_widget_to_reconcile_info(self):
for move in self:
move.invoice_outstanding_credits_debits_widget = json.dumps(False)
@@ -1128,7 +1119,6 @@ class AccountMove(models.Model):
move.invoice_outstanding_credits_debits_widget = json.dumps(info)
move.invoice_has_outstanding = True
- @api.multi
def _get_reconciled_info_JSON_values(self):
self.ensure_one()
foreign_currency = self.currency_id if self.currency_id != self.company_id.currency_id else False
@@ -1258,7 +1248,6 @@ class AccountMove(models.Model):
if self._cr.fetchone():
raise ValidationError(_('Duplicated vendor reference detected. You probably encoded twice the same vendor bill/credit note.'))
- @api.multi
def _check_balanced(self):
''' Assert the move is fully balanced debit = credit.
An error is raised if it's not the case.
@@ -1287,7 +1276,6 @@ class AccountMove(models.Model):
ids = [res[0] for res in query_res]
raise UserError(_("Cannot create unbalanced journal entry. Ids: %s") % str(ids))
- @api.multi
def _check_fiscalyear_lock_date(self):
for move in self:
lock_date = max(move.company_id.period_lock_date or date.min, move.company_id.fiscalyear_lock_date or date.min)
@@ -1301,7 +1289,6 @@ class AccountMove(models.Model):
raise UserError(message)
return True
- @api.multi
def _check_tax_lock_date(self):
if not self:
return
@@ -1322,7 +1309,6 @@ class AccountMove(models.Model):
Please change the journal entry date or the tax lock date set in the settings (%s) to proceed
''' % query_res[1]))
- @api.multi
def _check_move_consistency(self):
for move in self:
if move.line_ids:
@@ -1336,7 +1322,6 @@ class AccountMove(models.Model):
# LOW-LEVEL METHODS
# -------------------------------------------------------------------------
- @api.multi
def _move_autocomplete_invoice_lines_values(self):
''' This method recomputes dynamic lines on the current journal entry that include taxes, cash rounding
and payment terms lines.
@@ -1414,7 +1399,6 @@ class AccountMove(models.Model):
new_vals_list.append(move._move_autocomplete_invoice_lines_values())
return new_vals_list
- @api.multi
def _move_autocomplete_invoice_lines_write(self, vals):
''' During the write of an account.move with only 'invoice_line_ids' set and not 'line_ids', this method is called
to auto compute accounting lines of the invoice. In that case, accounts will be retrieved and taxes, cash rounding
@@ -1450,7 +1434,6 @@ class AccountMove(models.Model):
return moves
- @api.multi
def write(self, vals):
not_paid_invoices = self.filtered(lambda move: move.is_invoice(include_receipts=True) and move.invoice_payment_state not in ('paid', 'in_payment'))
@@ -1470,7 +1453,6 @@ class AccountMove(models.Model):
return res
- @api.multi
def unlink(self):
for move in self:
# check the lock date + check if some entries are reconciled
@@ -1478,7 +1460,6 @@ class AccountMove(models.Model):
move.line_ids.unlink()
return super(AccountMove, self).unlink()
- @api.multi
@api.depends('name', 'state')
def name_get(self):
result = []
@@ -1497,7 +1478,6 @@ class AccountMove(models.Model):
result.append((move.id, name))
return result
- @api.multi
def _track_subtype(self, init_values):
# OVERRIDE to add custom subtype depending of the state.
self.ensure_one()
@@ -1552,7 +1532,6 @@ class AccountMove(models.Model):
def is_outbound(self, include_receipts=True):
return self.type in self.get_outbound_types(include_receipts)
- @api.multi
def _get_invoice_reference_euro_invoice(self):
""" This computes the reference based on the RF Creditor Reference.
The data of the reference is the database id number of the invoice.
@@ -1565,7 +1544,6 @@ class AccountMove(models.Model):
reference = 'RF{} {}'.format(check_digits, " ".join(["".join(x) for x in zip_longest(*[iter(str(base))]*4, fillvalue="")]))
return reference
- @api.multi
def _get_invoice_reference_euro_partner(self):
""" This computes the reference based on the RF Creditor Reference.
The data of the reference is the user defined reference of the
@@ -1585,7 +1563,6 @@ class AccountMove(models.Model):
reference = 'RF{} {}'.format(check_digits, " ".join(["".join(x) for x in zip_longest(*[iter(partner_ref_nr)]*4, fillvalue="")]))
return reference
- @api.multi
def _get_invoice_reference_odoo_invoice(self):
""" This computes the reference based on the Odoo format.
We simply return the number of the invoice, defined on the journal
@@ -1594,7 +1571,6 @@ class AccountMove(models.Model):
self.ensure_one()
return self.name
- @api.multi
def _get_invoice_reference_odoo_partner(self):
""" This computes the reference based on the Odoo format.
The data used is the reference set on the partner or its database
@@ -1605,7 +1581,6 @@ class AccountMove(models.Model):
prefix = _('CUST')
return '%s/%s' % (prefix, ref)
- @api.multi
def _get_invoice_computed_reference(self):
self.ensure_one()
if self.journal_id.invoice_reference_type == 'none':
@@ -1617,7 +1592,6 @@ class AccountMove(models.Model):
else:
raise UserError(_('The combination of reference model and reference type on the journal is not implemented'))
- @api.multi
def _get_sequence(self):
''' Return the sequence to be used during the post of the current move.
:return: An ir.sequence record or False.
@@ -1631,7 +1605,6 @@ class AccountMove(models.Model):
return
return journal.refund_sequence_id
- @api.multi
def _get_invoice_display_name(self, show_ref=False):
''' Helper to get the display name of an invoice depending of its type.
:param show_ref: A flag indicating of the display name must include or not the journal entry reference.
@@ -1650,7 +1623,6 @@ class AccountMove(models.Model):
else:
return ('%s' % self.name) + (show_ref and self.ref and '(%s)' % self.ref or '')
- @api.multi
def _get_invoice_delivery_partner_id(self):
''' Hook allowing to retrieve the right delivery address depending of installed modules.
:return: A res.partner record's id representing the delivery address.
@@ -1658,7 +1630,6 @@ class AccountMove(models.Model):
self.ensure_one()
return self.partner_id.address_get(['delivery'])['delivery']
- @api.multi
def _get_invoice_intrastat_country_id(self):
''' Hook allowing to retrieve the intrastat country depending of installed modules.
:return: A res.country record's id.
@@ -1666,7 +1637,6 @@ class AccountMove(models.Model):
self.ensure_one()
return self.partner_id.country_id.id
- @api.multi
def _get_cash_basis_matched_percentage(self):
"""Compute the percentage to apply for cash basis method. This value is relevant only for moves that
involve journal items on receivable or payable accounts.
@@ -1701,7 +1671,6 @@ class AccountMove(models.Model):
else:
return abs(total_reconciled / total_amount)
- @api.multi
def _reverse_move_vals(self, default_values, cancel=True):
''' Reverse values passed as parameter being the copied values of the original journal entry.
For example, debit / credit must be switched. The tax lines must be edited in case of refunds.
@@ -1794,7 +1763,6 @@ class AccountMove(models.Model):
})
return move_vals
- @api.multi
def _reverse_moves(self, default_values_list=None, cancel=False):
''' Reverse a recordset of account.move.
If cancel parameter is true, the reconcilable or liquidity lines
@@ -1844,11 +1812,9 @@ class AccountMove(models.Model):
return reverse_moves
- @api.multi
def open_reconcile_view(self):
return self.line_ids.open_reconcile_view()
- @api.multi
def post(self):
for move in self:
if move.auto_post and move.date > fields.Date.today():
@@ -1910,7 +1876,6 @@ class AccountMove(models.Model):
# installing Accounting- with bank statements)
move.company_id.account_bank_reconciliation_start = move.date
- @api.multi
def action_reverse(self):
action = self.env.ref('account.action_view_account_move_reversal').read()[0]
@@ -1919,26 +1884,22 @@ class AccountMove(models.Model):
return action
- @api.multi
def action_post(self):
if self.mapped('line_ids.payment_id') and any(self.mapped('journal_id.post_at_bank_rec')):
raise UserError(_("A payment journal entry generated in a journal configured to post entries only when payments are reconciled with a bank statement cannot be manually posted. Those will be posted automatically after performing the bank reconciliation."))
return self.post()
- @api.multi
def js_assign_outstanding_line(self, line_id):
self.ensure_one()
lines = self.env['account.move.line'].browse(line_id)
lines += self.line_ids.filtered(lambda line: line.account_id == lines[0].account_id and not line.reconciled)
return lines.reconcile()
- @api.multi
def button_draft(self):
if any(move.state != 'cancel' for move in self):
raise UserError(_('Only cancelled journal entries can be reset to draft.'))
self.write({'state': 'draft'})
- @api.multi
def button_cancel(self):
AccountMoveLine = self.env['account.move.line']
excluded_move_ids = []
@@ -1961,7 +1922,6 @@ class AccountMove(models.Model):
self.mapped('line_ids').remove_move_reconcile()
return True
- @api.multi
def action_invoice_sent(self):
""" Open a window to compose an email, with the edi invoice template
message loaded by default
@@ -1991,7 +1951,6 @@ class AccountMove(models.Model):
'context': ctx,
}
- @api.multi
def action_invoice_print(self):
""" Print the invoice and mark it as sent, so that we can see more
easily the next step of the workflow
@@ -2005,12 +1964,10 @@ class AccountMove(models.Model):
else:
return self.env.ref('account.account_invoices_without_payment').report_action(self)
- @api.multi
def action_invoice_paid(self):
''' Hook to be overrided called when the invoice moves to the paid state. '''
pass
- @api.multi
def action_open_matching_suspense_moves(self):
self.ensure_one()
domain = self._get_domain_matching_supsense_moves()
@@ -2026,19 +1983,16 @@ class AccountMove(models.Model):
'context': action_context,
}
- @api.multi
def action_invoice_register_payment(self):
return self.env['account.payment']\
.with_context(active_ids=self.ids, active_model='account.move', active_id=self.id)\
.action_register_payment()
- @api.multi
def _get_report_base_filename(self):
if any(not move.is_invoice() for move in self):
raise UserError(_("Only invoices could be printed."))
return self._get_invoice_display_name()
- @api.multi
def preview_invoice(self):
self.ensure_one()
return {
@@ -2047,7 +2001,6 @@ class AccountMove(models.Model):
'url': self.get_portal_url(),
}
- @api.multi
def _compute_access_url(self):
super(AccountMove, self)._compute_access_url()
for move in self.filtered(lambda move: move.is_invoice()):
@@ -2058,7 +2011,6 @@ class AccountMove(models.Model):
for move in self:
move.has_reconciled_entries = len(move.line_ids._reconciled_lines()) > 1
- @api.multi
def action_view_reverse_entry(self):
self.ensure_one()
@@ -2095,7 +2047,6 @@ class AccountMove(models.Model):
records.post()
# offer the possibility to duplicate thanks to a button instead of a hidden menu, which is more visible
- @api.multi
def action_duplicate(self):
self.ensure_one()
action = self.env.ref('account.action_move_journal_line').read()[0]
@@ -2269,7 +2220,6 @@ class AccountMoveLine(models.Model):
account = repartition_line.account_id
return account
- @api.multi
def _get_computed_name(self):
self.ensure_one()
@@ -2292,7 +2242,6 @@ class AccountMoveLine(models.Model):
values.append(product.description_purchase)
return '\n'.join(values)
- @api.multi
def _get_computed_price_unit(self):
self.ensure_one()
@@ -2316,7 +2265,6 @@ class AccountMoveLine(models.Model):
price_unit, self.move_id.currency_id, company, self.move_id.date)
return price_unit
- @api.multi
def _get_computed_account(self):
self.ensure_one()
@@ -2332,7 +2280,6 @@ class AccountMoveLine(models.Model):
# In invoice.
return accounts['expense']
- @api.multi
def _get_computed_taxes(self):
self.ensure_one()
@@ -2369,14 +2316,12 @@ class AccountMoveLine(models.Model):
else:
return tax_ids
- @api.multi
def _get_computed_uom(self):
self.ensure_one()
if self.product_id:
return self.product_id.uom_id
return False
- @api.multi
def _get_price_total_and_subtotal(self, price_unit=None, quantity=None, discount=None, currency=None, product=None, partner=None, taxes=None, move_type=None):
self.ensure_one()
return self._get_price_total_and_subtotal_model(
@@ -2420,7 +2365,6 @@ class AccountMoveLine(models.Model):
res['price_total'] = res['price_subtotal'] = subtotal
return res
- @api.multi
def _get_fields_onchange_subtotal(self, price_subtotal=None, move_type=None, currency=None, company=None, date=None):
self.ensure_one()
return self._get_fields_onchange_subtotal_model(
@@ -2467,7 +2411,6 @@ class AccountMoveLine(models.Model):
'credit': price_subtotal < 0.0 and -price_subtotal or 0.0,
}
- @api.multi
def _get_fields_onchange_balance(self, quantity=None, discount=None, balance=None, move_type=None, currency=None, taxes=None):
self.ensure_one()
return self._get_fields_onchange_balance_model(
@@ -2584,7 +2527,6 @@ class AccountMoveLine(models.Model):
if not self.display_type in ('line_section', 'line_note'):
self.tax_ids = self._get_computed_taxes()
- @api.multi
def _onchange_balance(self):
for line in self:
if line.currency_id:
@@ -2775,7 +2717,6 @@ class AccountMoveLine(models.Model):
"Please change the journal entry date or the tax lock date set in the settings ({}) to proceed").format(
line.company_id.tax_lock_date or date.min))
- @api.multi
def _update_check(self):
""" Raise Warning to cause rollback if the move is posted, some entries are reconciled or the move is older than the lock date"""
move_ids = set()
@@ -2886,7 +2827,6 @@ class AccountMoveLine(models.Model):
return lines
- @api.multi
def write(self, vals):
# OVERRIDE
ACCOUNTING_FIELDS = ('debit', 'credit', 'amount_currency')
@@ -2942,7 +2882,6 @@ class AccountMoveLine(models.Model):
return result
- @api.multi
def unlink(self):
self._update_check()
self._check_tax_lock_date2()
@@ -2997,7 +2936,6 @@ class AccountMoveLine(models.Model):
values['account_id'] = accounts.id
return values
- @api.multi
@api.depends('ref', 'move_id')
def name_get(self):
result = []
@@ -3012,7 +2950,6 @@ class AccountMoveLine(models.Model):
# RECONCILIATION
# -------------------------------------------------------------------------
- @api.multi
def check_full_reconcile(self):
"""
This method check if a move is totally reconciled and if we need to create exchange rate entries for the move.
@@ -3110,7 +3047,6 @@ class AccountMoveLine(models.Model):
'exchange_move_id': exchange_move_id,
})
- @api.multi
def _reconcile_lines(self, debit_moves, credit_moves, field):
""" This function loops on the 2 recordsets given as parameter as long as it
can find a debit and a credit to reconcile together. It returns the recordset of the
@@ -3188,7 +3124,6 @@ class AccountMoveLine(models.Model):
return debit_moves+credit_moves
- @api.multi
def auto_reconcile_lines(self):
# Create list of debit and list of credit move ordered by date-currency
debit_moves = self.filtered(lambda r: r.debit != 0 or r.amount_currency > 0)
@@ -3223,7 +3158,6 @@ class AccountMoveLine(models.Model):
if not (all_accounts[0].reconcile or all_accounts[0].internal_type == 'liquidity'):
raise UserError(_('Account %s (%s) does not allow reconciliation. First change the configuration of this account to allow it.') % (all_accounts[0].name, all_accounts[0].code))
- @api.multi
def reconcile(self, writeoff_acc_id=False, writeoff_journal_id=False):
# Empty self can happen if the user tries to reconcile entries which are already reconciled.
# The calling method might have filtered out reconciled lines.
@@ -3342,19 +3276,16 @@ class AccountMoveLine(models.Model):
# Return the writeoff move.line which is to be reconciled
return line_to_reconcile
- @api.multi
def remove_move_reconcile(self):
""" Undo a reconciliation """
(self.mapped('matched_debit_ids') + self.mapped('matched_credit_ids')).unlink()
- @api.multi
def _copy_data_extend_business_fields(self, values):
''' Hook allowing copying business fields under certain conditions.
E.g. The link to the sale order lines must be preserved in case of a refund.
'''
self.ensure_one()
- @api.multi
def copy_data(self, default=None):
res = super(AccountMoveLine, self).copy_data(default=default)
if self._context.get('include_business_fields'):
@@ -3409,7 +3340,6 @@ class AccountMoveLine(models.Model):
self.ensure_one()
return self.analytic_tag_ids.filtered(lambda r: not r.active_analytic_distribution).ids
- @api.multi
def create_analytic_lines(self):
""" Create analytic items upon validation of an account.move.line having an analytic account or an analytic distribution.
"""
@@ -3427,7 +3357,6 @@ class AccountMoveLine(models.Model):
values_list = lines_to_create_analytic_entries._prepare_analytic_line()
self.env['account.analytic.line'].create(values_list)
- @api.multi
def _prepare_analytic_line(self):
""" Prepare the values used to create() an account.analytic.line upon validation of an account.move.line having
an analytic account. This method is intended to be extended in other modules.
@@ -3558,7 +3487,6 @@ class AccountMoveLine(models.Model):
ids.append(aml.id)
return ids
- @api.multi
def open_reconcile_view(self):
[action] = self.env.ref('account.action_account_moves_all_a').read()
ids = self._reconciled_lines()
@@ -3591,7 +3519,6 @@ class AccountPartialReconcile(models.Model):
readonly=True, copy=False, store=True,
help='Technical field used to determine at which date this reconciliation needs to be shown on the aged receivable/payable reports.')
- @api.multi
@api.depends('debit_move_id.date', 'credit_move_id.date')
def _compute_max_date(self):
for rec in self:
@@ -3794,7 +3721,6 @@ class AccountPartialReconcile(models.Model):
}
return self.env['account.move'].create(move_vals)
- @api.multi
def unlink(self):
""" When removing a partial reconciliation, also unlink its full reconciliation if it exists """
full_to_unlink = self.env['account.full.reconcile']
@@ -3822,7 +3748,6 @@ class AccountFullReconcile(models.Model):
reconciled_line_ids = fields.One2many('account.move.line', 'full_reconcile_id', string='Matched Journal Items')
exchange_move_id = fields.Many2one('account.move')
- @api.multi
def unlink(self):
""" When removing a full reconciliation, we need to revert the eventual journal entries we created to book the
fluctuation of the foreign currency's exchange rate.
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py
index 7a96e707be9..5b272f5d551 100644
--- a/addons/account/models/account_payment.py
+++ b/addons/account/models/account_payment.py
@@ -145,7 +145,6 @@ class account_payment(models.Model):
payment.show_partner_bank_account = payment.payment_method_code in self._get_method_codes_using_bank_account()
payment.require_partner_bank_account = payment.payment_method_code in self._get_method_codes_needing_bank_account()
- @api.multi
@api.depends('payment_type', 'journal_id')
def _compute_hide_payment_method(self):
for payment in self:
@@ -324,11 +323,9 @@ class account_payment(models.Model):
total += move_currency._convert(res['amount_residual'], currency, company, date)
return total
- @api.multi
def name_get(self):
return [(payment.id, payment.name or _('Draft Payment')) for payment in self]
- @api.multi
@api.depends('move_line_ids.reconciled')
def _get_move_reconciled(self):
for payment in self:
@@ -392,7 +389,6 @@ class account_payment(models.Model):
record.reconciled_invoice_ids = reconciled_moves.filtered(lambda move: move.is_invoice())
record.has_invoices = bool(record.reconciled_invoice_ids)
- @api.multi
def action_register_payment(self):
active_ids = self.env.context.get('active_ids')
if not active_ids:
@@ -408,7 +404,6 @@ class account_payment(models.Model):
'type': 'ir.actions.act_window',
}
- @api.multi
def button_journal_entries(self):
return {
'name': _('Journal Items'),
@@ -419,7 +414,6 @@ class account_payment(models.Model):
'domain': [('payment_id', 'in', self.ids)],
}
- @api.multi
def button_invoices(self):
return {
'name': _('Paid Invoices'),
@@ -431,7 +425,6 @@ class account_payment(models.Model):
'domain': [('id', 'in', [x.id for x in self.reconciled_invoice_ids])],
}
- @api.multi
def unreconcile(self):
""" Set back the payments in 'posted' or 'sent' state, without deleting the journal entries.
Called when cancelling a bank statement line linked to a pre-registered payment.
@@ -442,7 +435,6 @@ class account_payment(models.Model):
else:
payment.write({'state': 'posted'})
- @api.multi
def cancel(self):
for rec in self:
for move in rec.move_line_ids.mapped('move_id'):
@@ -452,7 +444,6 @@ class account_payment(models.Model):
move.unlink()
rec.state = 'cancelled'
- @api.multi
def unlink(self):
if any(bool(rec.move_line_ids) for rec in self):
raise UserError(_("You cannot delete a payment that is already posted."))
@@ -460,7 +451,6 @@ class account_payment(models.Model):
raise UserError(_('It is not allowed to delete a payment that already created a journal entry since it would create a gap in the numbering. You should create the journal entry again and cancel it thanks to a regular revert.'))
return super(account_payment, self).unlink()
- @api.multi
def _prepare_payment_moves(self):
''' Prepare the creation of journal entries (account.move) by creating a list of python dictionary to be passed
to the 'create' method.
@@ -640,7 +630,6 @@ class account_payment(models.Model):
all_move_vals.append(transfer_move_vals)
return all_move_vals
- @api.multi
def post(self):
""" Create the journal items for the payment and update the payment's state to 'posted'.
A journal entry is created containing an item in the source liquidity account (selected journal's default_debit or default_credit)
@@ -697,11 +686,9 @@ class account_payment(models.Model):
return True
- @api.multi
def action_draft(self):
return self.write({'state': 'draft'})
- @api.multi
def _get_invoice_payment_amount(self, inv):
"""
Computes the amount covered by the current payment in the given invoice.
@@ -769,7 +756,6 @@ class payment_register(models.TransientModel):
return {'domain': {'payment_method_id': domain}}
return {}
- @api.multi
def _prepare_payment_vals(self, invoice):
'''Create the payment values.
@@ -792,7 +778,6 @@ class payment_register(models.TransientModel):
}
return values
- @api.multi
def get_payments_vals(self):
'''Compute the values for payments.
@@ -800,7 +785,6 @@ class payment_register(models.TransientModel):
'''
return [self._prepare_payment_vals(invoice) for invoice in self.invoice_ids]
- @api.multi
def create_payments(self):
'''Create payments according to the invoices.
Having invoices with different commercial_partner_id or different type
diff --git a/addons/account/models/account_payment_term.py b/addons/account/models/account_payment_term.py
index ff757ae9c78..824e3dd216f 100644
--- a/addons/account/models/account_payment_term.py
+++ b/addons/account/models/account_payment_term.py
@@ -31,7 +31,6 @@ class AccountPaymentTerm(models.Model):
if len(lines) > 1:
raise ValidationError(_('A Payment Term should have only one line of type Balance.'))
- @api.multi
def compute(self, value, date_ref=False, currency=None):
self.ensure_one()
date_ref = date_ref or fields.Date.today()
@@ -68,7 +67,6 @@ class AccountPaymentTerm(models.Model):
result.append((last_date, dist))
return result
- @api.multi
def unlink(self):
for terms in self:
if self.env['account.move'].search([('payment_term_id', 'in', terms.ids)]):
diff --git a/addons/account/models/account_reconcile_model.py b/addons/account/models/account_reconcile_model.py
index 2834791ec38..af21f257f14 100644
--- a/addons/account/models/account_reconcile_model.py
+++ b/addons/account/models/account_reconcile_model.py
@@ -105,7 +105,6 @@ class AccountReconcileModel(models.Model):
number_entries = fields.Integer(string='Number of entries related to this model', compute='_compute_number_entries')
- @api.multi
def action_reconcile_stat(self):
self.ensure_one()
action = self.env.ref('account.action_move_journal_line').read()[0]
@@ -121,7 +120,6 @@ class AccountReconcileModel(models.Model):
})
return action
- @api.multi
def _compute_number_entries(self):
data = self.env['account.move.line'].read_group([('reconcile_model_id', 'in', self.ids)], ['reconcile_model_ids'], 'reconcile_model_id')
mapped_data = dict([(d['reconcile_model_id'][0], d['reconcile_model_id_count']) for d in data])
@@ -193,7 +191,6 @@ class AccountReconcileModel(models.Model):
base_line_dict['tag_ids'] = [(6, 0, res['base_tags'])]
return new_aml_dicts
- @api.multi
def _get_write_off_move_lines_dict(self, st_line, move_lines=None):
''' Get move.lines dict (to be passed to the create()) corresponding to the reconciliation model's write-off lines.
:param st_line: An account.bank.statement.line record.
@@ -265,7 +262,6 @@ class AccountReconcileModel(models.Model):
return new_aml_dicts
- @api.multi
def _prepare_reconciliation(self, st_line, move_lines=None, partner=None):
''' Reconcile the statement line with some move lines using this reconciliation model.
:param st_line: An account.bank.statement.line record.
@@ -324,7 +320,6 @@ class AccountReconcileModel(models.Model):
# RECONCILIATION CRITERIA
####################################################
- @api.multi
def _apply_conditions(self, query, params):
self.ensure_one()
rule = self
@@ -382,7 +377,6 @@ class AccountReconcileModel(models.Model):
return query, params
- @api.multi
def _get_with_tables(self, st_lines, partner_map=None):
with_tables = '''
WITH jnl_precision AS (
@@ -403,7 +397,6 @@ class AccountReconcileModel(models.Model):
with_tables += ', partners_table AS (' + partners_table + ')'
return with_tables
- @api.multi
def _get_invoice_matching_query(self, st_lines, excluded_ids=None, partner_map=None):
''' Get the query applying all rules trying to match existing entries with the given statement lines.
:param st_lines: Account.bank.statement.lines recordset.
@@ -534,7 +527,6 @@ class AccountReconcileModel(models.Model):
full_query += ' ORDER BY aml_date_maturity, aml_id'
return full_query, all_params
- @api.multi
def _get_writeoff_suggestion_query(self, st_lines, excluded_ids=None, partner_map=None):
''' Get the query applying all reconciliation rules.
:param st_lines: Account.bank.statement.lines recordset.
@@ -570,7 +562,6 @@ class AccountReconcileModel(models.Model):
full_query += ' UNION ALL '.join(queries)
return full_query, all_params
- @api.multi
def _check_rule_propositions(self, statement_line, candidates):
''' Check restrictions that can't be handled for each move.line separately.
/!\ Only used by models having a type equals to 'invoice_matching'.
@@ -601,7 +592,6 @@ class AccountReconcileModel(models.Model):
amount_percentage = (line_residual / total_residual) * 100 if total_residual else 0
return amount_percentage >= self.match_total_amount_param
- @api.multi
def _apply_rules(self, st_lines, excluded_ids=None, partner_map=None):
''' Apply criteria to get candidates for all reconciliation models.
:param st_lines: Account.bank.statement.lines recordset.
diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py
index bcd8d8c8d7b..8265620ef47 100644
--- a/addons/account/models/chart_template.py
+++ b/addons/account/models/chart_template.py
@@ -78,7 +78,6 @@ class AccountAccountTemplate(models.Model):
tag_ids = fields.Many2many('account.account.tag', 'account_account_template_account_tag', string='Account tag', help="Optional tags you may want to assign for custom reporting")
group_id = fields.Many2one('account.group')
- @api.multi
@api.depends('name', 'code')
def name_get(self):
res = []
@@ -346,7 +345,6 @@ class AccountChartTemplate(models.Model):
"""
return [{'acc_name': _('Cash'), 'account_type': 'cash'}, {'acc_name': _('Bank'), 'account_type': 'bank'}]
- @api.multi
def open_select_template_wizard(self):
# Add action to open wizard to select between several templates
if not self.company_id.chart_template_id:
@@ -397,7 +395,6 @@ class AccountChartTemplate(models.Model):
company.write({'tax_cash_basis_journal_id': journal.id})
return True
- @api.multi
def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):
def _get_default_account(journal_vals, type='debit'):
# Get the default accounts
@@ -438,7 +435,6 @@ class AccountChartTemplate(models.Model):
journal_data.append(vals)
return journal_data
- @api.multi
def generate_properties(self, acc_template_ref, company):
"""
This method used for creating properties.
@@ -490,7 +486,6 @@ class AccountChartTemplate(models.Model):
company.write({stock_property: value})
return True
- @api.multi
def _install_template(self, company, code_digits=None, obj_wizard=None, acc_ref=None, taxes_ref=None):
""" Recursively load the template objects and create the real objects from them.
@@ -520,7 +515,6 @@ class AccountChartTemplate(models.Model):
taxes_ref.update(tmp2)
return acc_ref, taxes_ref
- @api.multi
def _load_template(self, company, code_digits=None, account_ref=None, taxes_ref=None):
""" Generate all the objects from the templates
@@ -581,7 +575,6 @@ class AccountChartTemplate(models.Model):
return account_ref, taxes_ref
- @api.multi
def create_record_with_xmlid(self, company, template, model, vals):
return self._create_records_with_xmlid(model, [(template, vals)], company).id
@@ -647,7 +640,6 @@ class AccountChartTemplate(models.Model):
}
return val
- @api.multi
def generate_account(self, tax_template_ref, acc_template_ref, code_digits, company):
""" This method generates accounts from account templates.
@@ -713,7 +705,6 @@ class AccountChartTemplate(models.Model):
'second_tax_ids': [[4, tax_template_ref[tax.id], 0] for tax in account_reconcile_model.second_tax_ids],
}
- @api.multi
def generate_account_reconcile_model(self, tax_template_ref, acc_template_ref, company):
""" This method creates account reconcile models
@@ -732,7 +723,6 @@ class AccountChartTemplate(models.Model):
self.create_record_with_xmlid(company, account_reconcile_model, 'account.reconcile.model', vals)
return True
- @api.multi
def _get_fp_vals(self, company, position):
return {
'company_id': company.id,
@@ -748,7 +738,6 @@ class AccountChartTemplate(models.Model):
'zip_to': position.zip_to,
}
- @api.multi
def generate_fiscal_position(self, tax_template_ref, acc_template_ref, company):
""" This method generates Fiscal Position, Fiscal Position Accounts
and Fiscal Position Taxes from templates.
@@ -838,7 +827,6 @@ class AccountTaxTemplate(models.Model):
('name_company_uniq', 'unique(name, type_tax_use, chart_template_id)', 'Tax names must be unique !'),
]
- @api.multi
@api.depends('name', 'description')
def name_get(self):
res = []
@@ -883,7 +871,6 @@ class AccountTaxTemplate(models.Model):
val['tax_group_id'] = self.tax_group_id.id
return val
- @api.multi
def _generate_tax(self, company):
""" This method generate taxes from templates.
diff --git a/addons/account/models/company.py b/addons/account/models/company.py
index 42bb719afec..bd0b1dbdd7f 100644
--- a/addons/account/models/company.py
+++ b/addons/account/models/company.py
@@ -145,7 +145,6 @@ Best Regards,'''))
'account_setup_coa_state',
])
- @api.multi
def _check_lock_dates(self, vals):
'''Check the lock dates for the current companies. This can't be done in a api.constrains because we need
to perform some comparison between new/old values. This method forces the lock dates to be irreversible.
@@ -199,7 +198,6 @@ Best Regards,'''))
if period_lock_date < fiscalyear_lock_date:
raise ValidationError(_('You cannot define stricter conditions on advisors than on users. Please make sure that the lock date on advisor is set before the lock date for users.'))
- @api.multi
def compute_fiscalyear_dates(self, current_date):
'''Computes the start and end dates of the fiscal year where the given 'date' belongs to.
@@ -266,7 +264,6 @@ Best Regards,'''))
if account.code.startswith(old_code):
account.write({'code': self.get_new_account_code(account.code, old_code, new_code)})
- @api.multi
def _validate_fiscalyear_lock(self, values):
if values.get('fiscalyear_lock_date'):
nb_draft_entries = self.env['account.move'].search([
@@ -276,7 +273,6 @@ Best Regards,'''))
if nb_draft_entries:
raise ValidationError(_('There are still unposted entries in the period you want to lock. You should either post or delete them.'))
- @api.multi
def write(self, values):
#restrict the closing of FY if there are still unposted entries
self._validate_fiscalyear_lock(values)
@@ -538,13 +534,11 @@ Best Regards,'''))
}
return action
- @api.multi
def action_save_onboarding_invoice_layout(self):
""" Set the onboarding step as done """
if bool(self.logo) and self.logo != self._get_logo():
self.set_onboarding_step_done('account_onboarding_invoice_layout_state')
- @api.multi
def action_save_onboarding_sale_tax(self):
""" Set the onboarding step as done """
self.set_onboarding_step_done('account_onboarding_sale_tax_state')
diff --git a/addons/account/models/ir_actions_report.py b/addons/account/models/ir_actions_report.py
index a9df7eebb41..b3e4ecf7208 100644
--- a/addons/account/models/ir_actions_report.py
+++ b/addons/account/models/ir_actions_report.py
@@ -6,7 +6,6 @@ from odoo.exceptions import UserError
class IrActionsReport(models.Model):
_inherit = 'ir.actions.report'
- @api.multi
def retrieve_attachment(self, record):
# get the original bills through the message_main_attachment_id field of the record
if self.report_name == 'account.report_original_vendor_bill' and record.message_main_attachment_id:
@@ -15,7 +14,6 @@ class IrActionsReport(models.Model):
return record.message_main_attachment_id
return super(IrActionsReport, self).retrieve_attachment(record)
- @api.multi
def _post_pdf(self, save_in_attachment, pdf_content=None, res_ids=None):
# don't include the generated dummy report
if self.report_name == 'account.report_original_vendor_bill':
@@ -25,7 +23,6 @@ class IrActionsReport(models.Model):
raise UserError(_("No original vendor bills could be found for any of the selected vendor bills."))
return super(IrActionsReport, self)._post_pdf(save_in_attachment, pdf_content=pdf_content, res_ids=res_ids)
- @api.multi
def postprocess_pdf_report(self, record, buffer):
# don't save the 'account.report_original_vendor_bill' report as it's just a mean to print existing attachments
if self.report_name == 'account.report_original_vendor_bill':
diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py
index cdd9a916dd1..e47598aec29 100644
--- a/addons/account/models/partner.py
+++ b/addons/account/models/partner.py
@@ -107,7 +107,6 @@ class AccountFiscalPosition(models.Model):
vals['zip_from'], vals['zip_to'] = self._convert_zip_values(zip_from, zip_to)
return super(AccountFiscalPosition, self).create(vals)
- @api.multi
def write(self, vals):
zip_from = vals.get('zip_from')
zip_to = vals.get('zip_to')
@@ -224,7 +223,6 @@ class ResPartner(models.Model):
_name = 'res.partner'
_inherit = 'res.partner'
- @api.multi
def _credit_debit_get(self):
tables, where_clause, where_params = self.env['account.move.line'].with_context(company_id=self.env.company.id)._query_get()
where_params = [tuple(self.ids)] + where_params
@@ -247,7 +245,6 @@ class ResPartner(models.Model):
elif type == 'payable':
partner.debit = -val
- @api.multi
def _asset_difference_search(self, account_type, operator, operand):
if operator not in ('<', '=', '>', '>=', '<='):
return []
@@ -278,7 +275,6 @@ class ResPartner(models.Model):
def _debit_search(self, operator, operand):
return self._asset_difference_search('payable', operator, operand)
- @api.multi
def _invoice_total(self):
account_invoice_report = self.env['account.invoice.report']
if not self.ids:
@@ -317,13 +313,11 @@ class ResPartner(models.Model):
for partner, child_ids in all_partners_and_children.items():
partner.total_invoiced = sum(price['total'] for price in price_totals if price['partner_id'] in child_ids)
- @api.multi
def _compute_journal_item_count(self):
AccountMoveLine = self.env['account.move.line']
for partner in self:
partner.journal_item_count = AccountMoveLine.search_count([('partner_id', '=', partner.id)])
- @api.multi
def _compute_contracts_count(self):
AccountAnalyticAccount = self.env['account.analytic.account']
for partner in self:
@@ -380,7 +374,6 @@ class ResPartner(models.Model):
""", (partner.id,))
partner.has_unreconciled_entries = self.env.cr.rowcount == 1
- @api.multi
def mark_as_reconciled(self):
self.env['account.partial.reconcile'].check_access_rights('write')
return self.sudo().with_context(company_id=self.env.company.id).write({'last_time_entries_checked': time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)})
@@ -438,7 +431,6 @@ class ResPartner(models.Model):
invoice_warn = fields.Selection(WARNING_MESSAGE, 'Invoice', help=WARNING_HELP, default="no-message")
invoice_warn_msg = fields.Text('Message for Invoice')
- @api.multi
def _compute_bank_count(self):
bank_data = self.env['res.partner.bank'].read_group([('partner_id', 'in', self.ids)], ['partner_id'], ['partner_id'])
mapped_data = dict([(bank['partner_id'][0], bank['partner_id_count']) for bank in bank_data])
@@ -455,7 +447,6 @@ class ResPartner(models.Model):
['debit_limit', 'property_account_payable_id', 'property_account_receivable_id', 'property_account_position_id',
'property_payment_term_id', 'property_supplier_payment_term_id', 'last_time_entries_checked']
- @api.multi
def action_view_partner_invoices(self):
self.ensure_one()
action = self.env.ref('account.action_move_out_invoice_type').read()[0]
diff --git a/addons/account/models/product.py b/addons/account/models/product.py
index 2282da699c4..8fd979b3e7f 100644
--- a/addons/account/models/product.py
+++ b/addons/account/models/product.py
@@ -35,21 +35,18 @@ class ProductTemplate(models.Model):
domain=[('deprecated', '=', False)],
help="Keep this field empty to use the default value from the product category. If anglo-saxon accounting with automated valuation method is configured, the expense account on the product category will be used.")
- @api.multi
def _get_product_accounts(self):
return {
'income': self.property_account_income_id or self.categ_id.property_account_income_categ_id,
'expense': self.property_account_expense_id or self.categ_id.property_account_expense_categ_id
}
- @api.multi
def _get_asset_accounts(self):
res = {}
res['stock_input'] = False
res['stock_output'] = False
return res
- @api.multi
def get_product_accounts(self, fiscal_pos=None):
accounts = self._get_product_accounts()
if not fiscal_pos:
diff --git a/addons/account/models/res_config_settings.py b/addons/account/models/res_config_settings.py
index bda14428315..27d175a6777 100644
--- a/addons/account/models/res_config_settings.py
+++ b/addons/account/models/res_config_settings.py
@@ -91,7 +91,6 @@ class ResConfigSettings(models.TransientModel):
oldname='default_use_sale_note',
config_parameter='account.use_invoice_terms')
- @api.multi
def set_values(self):
super(ResConfigSettings, self).set_values()
if self.group_multi_currency:
diff --git a/addons/account/models/res_users.py b/addons/account/models/res_users.py
index 8030423e74d..1bc6ee1c813 100644
--- a/addons/account/models/res_users.py
+++ b/addons/account/models/res_users.py
@@ -8,7 +8,6 @@ from odoo.exceptions import ValidationError
class Users(models.Model):
_inherit = "res.users"
- @api.multi
@api.constrains('groups_id')
def _check_one_user_type(self):
super(Users, self)._check_one_user_type()
diff --git a/addons/account/wizard/account_invoice_import.py b/addons/account/wizard/account_invoice_import.py
index ed67308a1bf..3de4672ef0a 100644
--- a/addons/account/wizard/account_invoice_import.py
+++ b/addons/account/wizard/account_invoice_import.py
@@ -10,18 +10,15 @@ class ImportInvoiceImportWizard(models.TransientModel):
attachment_ids = fields.Many2many('ir.attachment', string='Files')
- @api.multi
def _create_invoice_from_file(self, attachment):
invoice = self.env['account.move'].create({})
attachment.write({'res_model': 'account.move', 'res_id': invoice.id})
invoice.message_post(attachment_ids=[attachment.id])
return invoice
- @api.multi
def _create_invoice(self, attachment):
return self._create_invoice_from_file(attachment)
- @api.multi
def create_invoices(self):
''' Create the invoices from files.
:return: A action redirecting to account.invoice tree/form view.
diff --git a/addons/account/wizard/account_invoice_send.py b/addons/account/wizard/account_invoice_send.py
index 812ed0ec297..f33aac08807 100644
--- a/addons/account/wizard/account_invoice_send.py
+++ b/addons/account/wizard/account_invoice_send.py
@@ -40,7 +40,6 @@ class AccountInvoiceSend(models.TransientModel):
})
return res
- @api.multi
@api.onchange('invoice_ids')
def _compute_composition_mode(self):
for wizard in self:
@@ -68,14 +67,12 @@ class AccountInvoiceSend(models.TransientModel):
else:
wizard.invoice_without_email = False
- @api.multi
def _send_email(self):
if self.is_email:
self.composer_id.send_mail()
if self.env.context.get('mark_invoice_as_sent'):
self.mapped('invoice_ids').write({'invoice_sent': True})
- @api.multi
def _print_document(self):
""" to override for each type of models that will use this composer."""
self.ensure_one()
@@ -83,7 +80,6 @@ class AccountInvoiceSend(models.TransientModel):
action.update({'close_on_report_download': True})
return action
- @api.multi
def send_and_print_action(self):
self.ensure_one()
self._send_email()
@@ -91,7 +87,6 @@ class AccountInvoiceSend(models.TransientModel):
return self._print_document()
return {'type': 'ir.actions.act_window_close'}
- @api.multi
def save_as_template(self):
self.ensure_one()
self.composer_id.save_as_template()
diff --git a/addons/account/wizard/account_move_reversal.py b/addons/account/wizard/account_move_reversal.py
index a6888c8b2a4..14d2a81257a 100644
--- a/addons/account/wizard/account_move_reversal.py
+++ b/addons/account/wizard/account_move_reversal.py
@@ -43,7 +43,6 @@ class AccountMoveReversal(models.TransientModel):
currency_id = fields.Many2one(related='move_id.currency_id')
move_type = fields.Selection(related='move_id.type')
- @api.multi
def reverse_moves(self):
moves = self.move_id or self.env['account.move'].browse(self._context['active_ids'])
diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py
index dad0acd868d..3d113ff58bf 100644
--- a/addons/account/wizard/account_report_common.py
+++ b/addons/account/wizard/account_report_common.py
@@ -36,7 +36,6 @@ class AccountCommonReport(models.TransientModel):
def _print_report(self, data):
raise NotImplementedError()
- @api.multi
def check_report(self):
self.ensure_one()
data = {}
diff --git a/addons/account/wizard/account_report_common_journal.py b/addons/account/wizard/account_report_common_journal.py
index 448561f1d67..c00de454b76 100644
--- a/addons/account/wizard/account_report_common_journal.py
+++ b/addons/account/wizard/account_report_common_journal.py
@@ -10,7 +10,6 @@ class AccountCommonJournalReport(models.TransientModel):
amount_currency = fields.Boolean('With Currency', help="Print Report with the currency column if the currency differs from the company currency.")
- @api.multi
def pre_print_report(self, data):
data['form'].update({'amount_currency': self.amount_currency})
return data
diff --git a/addons/account/wizard/account_unreconcile.py b/addons/account/wizard/account_unreconcile.py
index 10ccb7bd1c0..790e9b280fc 100644
--- a/addons/account/wizard/account_unreconcile.py
+++ b/addons/account/wizard/account_unreconcile.py
@@ -5,7 +5,6 @@ class AccountUnreconcile(models.TransientModel):
_name = "account.unreconcile"
_description = "Account Unreconcile"
- @api.multi
def trans_unrec(self):
context = dict(self._context or {})
if context.get('active_ids', False):
diff --git a/addons/account/wizard/account_validate_account_move.py b/addons/account/wizard/account_validate_account_move.py
index f74b7aefb5c..cc19c724e88 100644
--- a/addons/account/wizard/account_validate_account_move.py
+++ b/addons/account/wizard/account_validate_account_move.py
@@ -6,7 +6,6 @@ class ValidateAccountMove(models.TransientModel):
_name = "validate.account.move"
_description = "Validate Account Move"
- @api.multi
def validate_move(self):
context = dict(self._context or {})
moves = self.env['account.move'].browse(context.get('active_ids'))
diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py
index 776d5ad512c..14c12d32dee 100644
--- a/addons/account/wizard/pos_box.py
+++ b/addons/account/wizard/pos_box.py
@@ -9,7 +9,6 @@ class CashBox(models.TransientModel):
# in the context of the action
amount = fields.Float(string='Amount', digits=0, required=True)
- @api.multi
def run(self):
context = dict(self._context or {})
active_model = context.get('active_model', False)
@@ -19,7 +18,6 @@ class CashBox(models.TransientModel):
return self._run(records)
- @api.multi
def _run(self, records):
for box in self:
for record in records:
@@ -44,7 +42,6 @@ class CashBoxIn(CashBox):
ref = fields.Char('Reference')
- @api.multi
def _calculate_values_for_statement_line(self, record):
if not record.journal_id.company_id.transfer_account_id:
raise UserError(_("You have to define an 'Internal Transfer Account' in your cash register's journal."))
@@ -63,7 +60,6 @@ class CashBoxOut(CashBox):
_name = 'cash.box.out'
_description = 'Cash Box Out'
- @api.multi
def _calculate_values_for_statement_line(self, record):
if not record.journal_id.company_id.transfer_account_id:
raise UserError(_("You have to define an 'Internal Transfer Account' in your cash register's journal."))
diff --git a/addons/account/wizard/setup_wizards.py b/addons/account/wizard/setup_wizards.py
index 13a70058741..bfa7ea07ddc 100644
--- a/addons/account/wizard/setup_wizards.py
+++ b/addons/account/wizard/setup_wizards.py
@@ -40,7 +40,6 @@ class FinancialYearOpeningWizard(models.TransientModel):
(wiz.fiscalyear_last_month, wiz.fiscalyear_last_day)
)
- @api.multi
def write(self, vals):
# Amazing workaround: non-stored related fields on company are a BAD idea since the 3 fields
# must follow the constraint '_check_fiscalyear_last_day'. The thing is, in case of related
@@ -57,7 +56,6 @@ class FinancialYearOpeningWizard(models.TransientModel):
vals.pop('fiscalyear_last_month', None)
return super().write(vals)
- @api.multi
def action_save_onboarding_fiscal_year(self):
self.env.company.set_onboarding_step_done('account_setup_fy_data_state')
diff --git a/addons/account/wizard/wizard_tax_adjustments.py b/addons/account/wizard/wizard_tax_adjustments.py
index 736396531fb..f2caa043ba8 100644
--- a/addons/account/wizard/wizard_tax_adjustments.py
+++ b/addons/account/wizard/wizard_tax_adjustments.py
@@ -8,7 +8,6 @@ class TaxAdjustments(models.TransientModel):
_name = 'tax.adjustments.wizard'
_description = 'Tax Adjustments Wizard'
- @api.multi
def _get_default_journal(self):
return self.env['account.journal'].search([('type', '=', 'general')], limit=1).id
diff --git a/addons/account_bank_statement_import/account_bank_statement_import.py b/addons/account_bank_statement_import/account_bank_statement_import.py
index d88bfd6bae7..e908c6a505e 100644
--- a/addons/account_bank_statement_import/account_bank_statement_import.py
+++ b/addons/account_bank_statement_import/account_bank_statement_import.py
@@ -28,7 +28,6 @@ class AccountBankStatementImport(models.TransientModel):
data_file = fields.Binary(string='Bank Statement File', attachment=False, required=True, help='Get you bank statements in electronic format from your bank and select them here.')
filename = fields.Char()
- @api.multi
def import_file(self):
""" Process the file chosen in the wizard, create bank statement(s) and go to reconciliation. """
self.ensure_one()
diff --git a/addons/account_bank_statement_import/account_journal.py b/addons/account_bank_statement_import/account_journal.py
index 0c9046ba444..120206bf2db 100644
--- a/addons/account_bank_statement_import/account_journal.py
+++ b/addons/account_bank_statement_import/account_journal.py
@@ -20,7 +20,6 @@ class AccountJournal(models.Model):
rslt.append(("file_import", _("Import") + "(" + import_formats_str + ")"))
return rslt
- @api.multi
def import_statement(self):
"""return action to import bank/cash statements. This button should be called only on journals with type =='bank'"""
action_name = 'action_account_bank_statement_import'
diff --git a/addons/account_bank_statement_import/wizard/journal_creation.py b/addons/account_bank_statement_import/wizard/journal_creation.py
index 32c2464bc50..28654a46ccd 100644
--- a/addons/account_bank_statement_import/wizard/journal_creation.py
+++ b/addons/account_bank_statement_import/wizard/journal_creation.py
@@ -9,7 +9,6 @@ class AccountBankStatementImportJounalCreation(models.TransientModel):
journal_id = fields.Many2one('account.journal', delegate=True, required=True, ondelete='cascade')
- @api.multi
def create_journal(self):
""" Create the journal (the record is automatically created in the process of calling this method) and reprocess the statement """
statement_import_transient = self.env['account.bank.statement.import'].browse(self.env.context['statement_import_transient_id'])
diff --git a/addons/account_cancel/models/account_bank_statement.py b/addons/account_cancel/models/account_bank_statement.py
index f5e23e0b479..e6673fe9de4 100644
--- a/addons/account_cancel/models/account_bank_statement.py
+++ b/addons/account_cancel/models/account_bank_statement.py
@@ -8,7 +8,6 @@ from odoo.exceptions import UserError
class BankStatement(models.Model):
_inherit = 'account.bank.statement'
- @api.multi
def button_draft(self):
self.state = 'open'
diff --git a/addons/account_check_printing/models/account_journal.py b/addons/account_check_printing/models/account_journal.py
index 76bcef6412a..433e00c55e8 100644
--- a/addons/account_check_printing/models/account_journal.py
+++ b/addons/account_check_printing/models/account_journal.py
@@ -47,7 +47,6 @@ class AccountJournal(models.Model):
rec._create_check_sequence()
return rec
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
rec = super(AccountJournal, self).copy(default)
@@ -82,7 +81,6 @@ class AccountJournal(models.Model):
'outbound_payment_method_ids': [(4, check_printing.id, None)],
})
- @api.multi
def get_journal_dashboard_datas(self):
domain_checks_to_print = [
('journal_id', '=', self.id),
@@ -94,7 +92,6 @@ class AccountJournal(models.Model):
num_checks_to_print=len(self.env['account.payment'].search(domain_checks_to_print))
)
- @api.multi
def action_checks_to_print(self):
return {
'name': _('Checks to Print'),
diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py
index 3ba1be801f5..fdf0ecdf726 100644
--- a/addons/account_check_printing/models/account_payment.py
+++ b/addons/account_check_printing/models/account_payment.py
@@ -50,7 +50,6 @@ class AccountPayment(models.Model):
if len(communication) > 60:
raise ValidationError(_("A check memo cannot exceed 60 characters."))
- @api.multi
def post(self):
res = super(AccountPayment, self).post()
payment_method_check = self.env.ref('account_check_printing.account_payment_method_check')
@@ -59,7 +58,6 @@ class AccountPayment(models.Model):
payment.check_number = sequence.next_by_id()
return res
- @api.multi
def print_checks(self):
""" Check that the recordset is valid, set the payments state to sent and call print_checks() """
# Since this method can be called via a client_action_multi, we need to make sure the received records are what we expect
@@ -94,11 +92,9 @@ class AccountPayment(models.Model):
self.filtered(lambda r: r.state == 'draft').post()
return self.do_print_checks()
- @api.multi
def unmark_sent(self):
self.write({'state': 'posted'})
- @api.multi
def do_print_checks(self):
""" This method is a hook for l10n_xx_check_printing modules to implement actual check printing capabilities """
raise UserError(_("You have to choose a check layout. For this, go in Apps, search for 'Checks layout' and install one."))
diff --git a/addons/account_check_printing/models/chart_template.py b/addons/account_check_printing/models/chart_template.py
index 708c2d8249e..35c101873fb 100644
--- a/addons/account_check_printing/models/chart_template.py
+++ b/addons/account_check_printing/models/chart_template.py
@@ -6,7 +6,6 @@ from odoo import api, models
class AccountChartTemplate(models.Model):
_inherit = 'account.chart.template'
- @api.multi
def _create_bank_journals(self, company, acc_template_ref):
'''
When system automatically creates journals of bank and cash type when CoA is being installed
diff --git a/addons/account_check_printing/wizard/print_prenumbered_checks.py b/addons/account_check_printing/wizard/print_prenumbered_checks.py
index f76cd6d9847..1af58dd11a5 100644
--- a/addons/account_check_printing/wizard/print_prenumbered_checks.py
+++ b/addons/account_check_printing/wizard/print_prenumbered_checks.py
@@ -18,7 +18,6 @@ class PrintPreNumberedChecks(models.TransientModel):
if check.next_check_number and not re.match(r'^[0-9]+$', check.next_check_number):
raise ValidationError(_('Next Check Number should only contains numbers.'))
- @api.multi
def print_checks(self):
check_number = int(self.next_check_number)
payments = self.env['account.payment'].browse(self.env.context['payment_ids'])
diff --git a/addons/account_facturx/models/account_move.py b/addons/account_facturx/models/account_move.py
index 109537e96fb..844068b684e 100644
--- a/addons/account_facturx/models/account_move.py
+++ b/addons/account_facturx/models/account_move.py
@@ -22,7 +22,6 @@ DEFAULT_FACTURX_DATE_FORMAT = '%Y%m%d'
class AccountMove(models.Model):
_inherit = 'account.move'
- @api.multi
def _export_as_facturx_xml(self):
''' Create the Factur-x xml file content.
:return: The XML content as str.
@@ -47,7 +46,6 @@ class AccountMove(models.Model):
content = self.env.ref('account_facturx.account_invoice_facturx_export').render(template_values)
return b"" + content
- @api.multi
def _import_facturx_invoice(self, tree):
''' Extract invoice values from the Factur-x xml tree passed as parameter.
@@ -217,7 +215,6 @@ class AccountMove(models.Model):
return invoice_form.save()
- @api.multi
@api.returns('mail.message', lambda value: value.id)
def message_post(self, **kwargs):
# OVERRIDE
@@ -302,7 +299,6 @@ class AccountMove(models.Model):
# TO BE OVERWRITTEN
return []
- @api.multi
def _create_invoice_from_xml(self, attachment):
decoders = self._get_xml_decoders()
diff --git a/addons/account_facturx/models/ir_actions_report.py b/addons/account_facturx/models/ir_actions_report.py
index fbea5820266..72244d8e241 100644
--- a/addons/account_facturx/models/ir_actions_report.py
+++ b/addons/account_facturx/models/ir_actions_report.py
@@ -10,7 +10,6 @@ import io
class IrActionsReport(models.Model):
_inherit = 'ir.actions.report'
- @api.multi
def _post_pdf(self, save_in_attachment, pdf_content=None, res_ids=None):
# OVERRIDE
if self.model == 'account.move' and res_ids and len(res_ids) == 1:
diff --git a/addons/account_lock/models/res_company.py b/addons/account_lock/models/res_company.py
index 5a01046f36b..d54679e5dce 100644
--- a/addons/account_lock/models/res_company.py
+++ b/addons/account_lock/models/res_company.py
@@ -6,7 +6,6 @@ from odoo import models, api
class ResCompany(models.Model):
_inherit = 'res.company'
- @api.multi
def write(self, vals):
# fiscalyear_lock_date can't be set to a prior date
if 'fiscalyear_lock_date' in vals or 'period_lock_date' in vals:
diff --git a/addons/account_tax_python/models/account_tax.py b/addons/account_tax_python/models/account_tax.py
index 0b559fb8360..1870ea6b55e 100644
--- a/addons/account_tax_python/models/account_tax.py
+++ b/addons/account_tax_python/models/account_tax.py
@@ -35,7 +35,6 @@ class AccountTaxPython(models.Model):
return localdict['result']
return super(AccountTaxPython, self)._compute_amount(base_amount, price_unit, quantity, product, partner)
- @api.multi
def compute_all(self, price_unit, currency=None, quantity=1.0, product=None, partner=None, is_refund=False, handle_price_include=True):
taxes = self.filtered(lambda r: r.amount_type != 'code')
company = self.env.company
diff --git a/addons/analytic/models/analytic_account.py b/addons/analytic/models/analytic_account.py
index cddd3c61295..1b4196f0dc0 100644
--- a/addons/analytic/models/analytic_account.py
+++ b/addons/analytic/models/analytic_account.py
@@ -78,7 +78,6 @@ class AccountAnalyticAccount(models.Model):
line['credit'] = sum(accounts.mapped('credit'))
return res
- @api.multi
def _compute_debit_credit_balance(self):
Curr = self.env['res.currency']
analytic_line_obj = self.env['account.analytic.line']
@@ -140,7 +139,6 @@ class AccountAnalyticAccount(models.Model):
currency_id = fields.Many2one(related="company_id.currency_id", string="Currency", readonly=True)
- @api.multi
def name_get(self):
res = []
for analytic in self:
@@ -190,7 +188,6 @@ class AccountAnalyticLine(models.Model):
currency_id = fields.Many2one(related="company_id.currency_id", string="Currency", readonly=True, store=True, compute_sudo=True)
group_id = fields.Many2one('account.analytic.group', related='account_id.group_id', store=True, readonly=True, compute_sudo=True)
- @api.multi
@api.constrains('company_id', 'account_id')
def _check_company_id(self):
for line in self:
diff --git a/addons/auth_signup/models/res_config_settings.py b/addons/auth_signup/models/res_config_settings.py
index c9ea615e827..662152c2959 100644
--- a/addons/auth_signup/models/res_config_settings.py
+++ b/addons/auth_signup/models/res_config_settings.py
@@ -17,7 +17,6 @@ class ResConfigSettings(models.TransientModel):
auth_signup_template_user_id = fields.Many2one('res.users', string='Template user for new users created through signup',
config_parameter='base.template_portal_user_id')
- @api.multi
def open_template_user(self):
action = self.env.ref('base.action_res_users').read()[0]
action['res_id'] = literal_eval(self.env['ir.config_parameter'].sudo().get_param('base.template_portal_user_id', 'False'))
diff --git a/addons/auth_signup/models/res_partner.py b/addons/auth_signup/models/res_partner.py
index c041ffd3ccf..b92e5dc55f5 100644
--- a/addons/auth_signup/models/res_partner.py
+++ b/addons/auth_signup/models/res_partner.py
@@ -30,7 +30,6 @@ class ResPartner(models.Model):
signup_valid = fields.Boolean(compute='_compute_signup_valid', string='Signup Token is Valid')
signup_url = fields.Char(compute='_compute_signup_url', string='Signup URL')
- @api.multi
@api.depends('signup_token', 'signup_expiration')
def _compute_signup_valid(self):
dt = now()
@@ -38,7 +37,6 @@ class ResPartner(models.Model):
partner.signup_valid = bool(partner_sudo.signup_token) and \
(not partner_sudo.signup_expiration or dt <= partner_sudo.signup_expiration)
- @api.multi
def _compute_signup_url(self):
""" proxy for function field towards actual implementation """
result = self.sudo()._get_signup_url_for_action()
@@ -47,7 +45,6 @@ class ResPartner(models.Model):
self.env['res.users'].check_access_rights('write')
partner.signup_url = result.get(partner.id, False)
- @api.multi
def _get_signup_url_for_action(self, url=None, action=None, view_type=None, menu_id=None, res_id=None, model=None):
""" generate a signup url for the given partner ids and action, possibly overriding
the url state components (menu_id, id, view_type) """
@@ -101,7 +98,6 @@ class ResPartner(models.Model):
return res
- @api.multi
def action_signup_prepare(self):
return self.signup_prepare()
@@ -121,11 +117,9 @@ class ResPartner(models.Model):
res[partner.id]['auth_login'] = partner.user_ids[0].login
return res
- @api.multi
def signup_cancel(self):
return self.write({'signup_token': False, 'signup_type': False, 'signup_expiration': False})
- @api.multi
def signup_prepare(self, signup_type="signup", expiration=False):
""" generate a new token for the partners with the given validity, if necessary
:param expiration: the expiration datetime of the token (string, optional)
diff --git a/addons/auth_signup/models/res_users.py b/addons/auth_signup/models/res_users.py
index 559f92f9fb5..d2f40693f24 100644
--- a/addons/auth_signup/models/res_users.py
+++ b/addons/auth_signup/models/res_users.py
@@ -48,7 +48,6 @@ class ResUsers(models.Model):
return expression.TRUE_DOMAIN
- @api.multi
def _compute_state(self):
for user in self:
user.state = 'active' if user.login_date else 'new'
@@ -119,7 +118,6 @@ class ResUsers(models.Model):
raise SignupError(_('Signup is not allowed for uninvited users'))
return self._create_user_from_template(values)
- @api.multi
def _notify_inviter(self):
for user in self:
invite_partner = user.create_uid.partner_id
@@ -165,7 +163,6 @@ class ResUsers(models.Model):
raise Exception(_('Reset password: invalid username or email'))
return users.action_reset_password()
- @api.multi
def action_reset_password(self):
""" create signup token for each user, and send their signup url by email """
# prepare reset password signup
@@ -203,7 +200,6 @@ class ResUsers(models.Model):
template.with_context(lang=user.lang).send_mail(user.id, force_send=True, raise_exception=True)
_logger.info("Password reset email sent for user <%s> to <%s>", user.login, user.email)
- @api.multi
def send_unregistered_user_reminder(self, after_days=5):
datetime_min = fields.Datetime.today() - relativedelta(days=after_days)
datetime_max = datetime_min + relativedelta(hours=23, minutes=59, seconds=59)
@@ -245,7 +241,6 @@ class ResUsers(models.Model):
user.partner_id.with_context(create_user=True).signup_cancel()
return user
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
self.ensure_one()
diff --git a/addons/base_address_extended/models/base_address_extended.py b/addons/base_address_extended/models/base_address_extended.py
index ec788882d09..1ada529a8f1 100644
--- a/addons/base_address_extended/models/base_address_extended.py
+++ b/addons/base_address_extended/models/base_address_extended.py
@@ -42,7 +42,6 @@ class Partner(models.Model):
Overwrite this function if you want to add your own fields."""
return STREET_FIELDS
- @api.multi
def _set_street(self):
"""Updates the street field.
Writes the `street` field on the partners when one of the sub-fields in STREET_FIELDS
@@ -121,7 +120,6 @@ class Partner(models.Model):
return vals
- @api.multi
@api.depends('street')
def _split_street(self):
"""Splits street value into sub-fields.
diff --git a/addons/base_automation/models/base_automation.py b/addons/base_automation/models/base_automation.py
index ea7c204a1a5..1e2b2915d0d 100644
--- a/addons/base_automation/models/base_automation.py
+++ b/addons/base_automation/models/base_automation.py
@@ -102,7 +102,6 @@ class BaseAutomation(models.Model):
self._update_registry()
return base_automation
- @api.multi
def write(self, vals):
res = super(BaseAutomation, self).write(vals)
if set(vals).intersection(self.CRITICAL_FIELDS):
@@ -110,7 +109,6 @@ class BaseAutomation(models.Model):
self._update_registry()
return res
- @api.multi
def unlink(self):
res = super(BaseAutomation, self).unlink()
self._update_cron()
@@ -265,7 +263,6 @@ class BaseAutomation(models.Model):
# Note: we patch method _write() instead of write() in order to
# catch updates made by field recomputations.
#
- @api.multi
def _write(self, vals, **kw):
# retrieve the action rules to possibly execute
actions = self.env['base.automation']._get_actions(self, ['on_write', 'on_create_or_write'])
@@ -289,7 +286,6 @@ class BaseAutomation(models.Model):
def make_unlink():
""" Instanciate an unlink method that processes action rules. """
- @api.multi
def unlink(self, **kwargs):
# retrieve the action rules to possibly execute
actions = self.env['base.automation']._get_actions(self, ['on_unlink'])
diff --git a/addons/base_gengo/wizard/base_gengo_translations.py b/addons/base_gengo/wizard/base_gengo_translations.py
index 71d9c61c1a0..285bf281938 100644
--- a/addons/base_gengo/wizard/base_gengo_translations.py
+++ b/addons/base_gengo/wizard/base_gengo_translations.py
@@ -54,7 +54,6 @@ class BaseGengoTranslations(models.TransientModel):
icp = self.env['ir.config_parameter'].sudo()
return icp.get_param(self.GENGO_KEY, default="Undefined")
- @api.multi
def open_company(self):
self.ensure_one()
return {
@@ -92,7 +91,6 @@ class BaseGengoTranslations(models.TransientModel):
_logger.exception('Gengo connection failed')
return (False, _("Gengo connection failed with this message:\n``%s``") % e)
- @api.multi
def act_update(self):
'''
Function called by the wizard.
diff --git a/addons/base_geolocalize/models/res_partner.py b/addons/base_geolocalize/models/res_partner.py
index a0c887a1adb..0367c3e07e2 100644
--- a/addons/base_geolocalize/models/res_partner.py
+++ b/addons/base_geolocalize/models/res_partner.py
@@ -16,7 +16,6 @@ class ResPartner(models.Model):
result = geo_obj.geo_find(search, force_country=country)
return result
- @api.multi
def geo_localize(self):
# We need country names in English below
for partner in self.with_context(lang='en_US'):
diff --git a/addons/base_iban/models/res_partner_bank.py b/addons/base_iban/models/res_partner_bank.py
index b818e5742b5..190e430baba 100644
--- a/addons/base_iban/models/res_partner_bank.py
+++ b/addons/base_iban/models/res_partner_bank.py
@@ -77,7 +77,6 @@ class ResPartnerBank(models.Model):
pass
return super(ResPartnerBank, self).create(vals)
- @api.multi
def write(self, vals):
if vals.get('acc_number'):
try:
diff --git a/addons/base_import/models/base_import.py b/addons/base_import/models/base_import.py
index 8626d76acb9..76ad4683e28 100644
--- a/addons/base_import/models/base_import.py
+++ b/addons/base_import/models/base_import.py
@@ -223,7 +223,6 @@ class Import(models.TransientModel):
# TODO: cache on model?
return importable_fields
- @api.multi
def _read_file(self, options):
""" Dispatch to specific method to read file content, according to its mimetype or file type
:param options : dict of reading options (quoting, separator, ...)
@@ -261,7 +260,6 @@ class Import(models.TransientModel):
raise ImportError(_("Unable to load \"{extension}\" file: requires Python module \"{modname}\"").format(extension=file_extension, modname=req))
raise ValueError(_("Unsupported file format \"{}\", import only supports CSV, ODS, XLS and XLSX").format(self.file_type))
- @api.multi
def _read_xls(self, options):
""" Read file content, using xlrd lib """
book = xlrd.open_workbook(file_contents=self.file or b'')
@@ -307,7 +305,6 @@ class Import(models.TransientModel):
# use the same method for xlsx and xls files
_read_xlsx = _read_xls
- @api.multi
def _read_ods(self, options):
""" Read file content using ODSReader custom lib """
doc = odf_ods_reader.ODSReader(file=io.BytesIO(self.file or b''))
@@ -318,7 +315,6 @@ class Import(models.TransientModel):
if any(x for x in row if x.strip())
)
- @api.multi
def _read_csv(self, options):
""" Returns a CSV-parsed iterator of all non-empty lines in the file
:throws csv.Error: if an error is detected during CSV parsing
@@ -561,7 +557,6 @@ class Import(models.TransientModel):
matches[index] = match_field or None
return headers, matches
- @api.multi
def parse_preview(self, options, count=10):
""" Generates a preview of the uploaded files, and performs
fields-matching between the import's file data and the model's
@@ -737,7 +732,6 @@ class Import(models.TransientModel):
decimal_separator = options.get('float_decimal_separator', '.')
return thousand_separator, decimal_separator
- @api.multi
def _parse_import_data(self, data, import_fields, options):
""" Lauch first call to _parse_import_data_recursive with an
empty prefix. _parse_import_data_recursive will be run
@@ -745,7 +739,6 @@ class Import(models.TransientModel):
"""
return self._parse_import_data_recursive(self.res_model, '', data, import_fields, options)
- @api.multi
def _parse_import_data_recursive(self, model, prefix, data, import_fields, options):
# Get fields of type date/datetime
all_fields = self.env[model].fields_get()
@@ -845,7 +838,6 @@ class Import(models.TransientModel):
'error': e
})
- @api.multi
def do(self, fields, columns, options, dryrun=False):
""" Actual execution of the import
diff --git a/addons/base_import_module/models/base_import_module.py b/addons/base_import_module/models/base_import_module.py
index 205791cc76a..84510330ab6 100644
--- a/addons/base_import_module/models/base_import_module.py
+++ b/addons/base_import_module/models/base_import_module.py
@@ -14,7 +14,6 @@ class BaseImportModule(models.TransientModel):
import_message = fields.Text()
force = fields.Boolean(string='Force init', help="Force init mode even if installed. (will update `noupdate='1'` records)")
- @api.multi
def import_module(self):
self.ensure_one()
IrModule = self.env['ir.module.module']
@@ -35,7 +34,6 @@ class BaseImportModule(models.TransientModel):
'context': context,
}
- @api.multi
def action_module_open(self):
self.ensure_one()
return {
diff --git a/addons/base_import_module/models/ir_module.py b/addons/base_import_module/models/ir_module.py
index 8ac8e59b92b..ce1499941a9 100644
--- a/addons/base_import_module/models/ir_module.py
+++ b/addons/base_import_module/models/ir_module.py
@@ -31,7 +31,6 @@ class IrModule(models.Model):
module.installed_version = module.latest_version
super(IrModule, self - imported_modules)._get_latest_version()
- @api.multi
def _import_module(self, module, path, force=False):
known_mods = self.search([])
known_mods_names = {m.name: m for m in known_mods}
diff --git a/addons/base_setup/models/res_config_settings.py b/addons/base_setup/models/res_config_settings.py
index 39651b11c16..9cd9289a929 100644
--- a/addons/base_setup/models/res_config_settings.py
+++ b/addons/base_setup/models/res_config_settings.py
@@ -53,12 +53,10 @@ class ResConfigSettings(models.TransientModel):
)
return res
- @api.multi
def set_values(self):
super(ResConfigSettings, self).set_values()
self.env.ref('base.res_partner_rule').write({'active': not self.company_share_partner})
- @api.multi
def open_company(self):
return {
'type': 'ir.actions.act_window',
@@ -68,7 +66,6 @@ class ResConfigSettings(models.TransientModel):
'res_id': self.env.company.id,
'target': 'current',
}
- @api.multi
def open_default_user(self):
action = self.env.ref('base.action_res_users').read()[0]
action['res_id'] = self.env.ref('base.default_user').id
@@ -85,13 +82,11 @@ class ResConfigSettings(models.TransientModel):
'res_id': template_id.id,
}
- @api.multi
def edit_external_header(self):
if not self.external_report_layout_id:
return False
return self._prepare_report_view_action(self.external_report_layout_id.key)
- @api.multi
def change_report_template(self):
self.ensure_one()
template = self.env.ref('base.view_company_document_template_form')
diff --git a/addons/base_sparse_field/models/models.py b/addons/base_sparse_field/models/models.py
index c9e79a6fbb8..c47d17eb5a5 100644
--- a/addons/base_sparse_field/models/models.py
+++ b/addons/base_sparse_field/models/models.py
@@ -15,7 +15,6 @@ class IrModelFields(models.Model):
"This cannot be changed after creation.",
)
- @api.multi
def write(self, vals):
# Limitation: renaming a sparse field or changing the storing system is
# currently not allowed
diff --git a/addons/base_vat/models/res_partner.py b/addons/base_vat/models/res_partner.py
index c747452526f..e35843606ee 100644
--- a/addons/base_vat/models/res_partner.py
+++ b/addons/base_vat/models/res_partner.py
@@ -414,7 +414,6 @@ class ResPartner(models.Model):
values['vat'] = self._fix_vat_number(values['vat'])
return super(ResPartner, self).create(values)
- @api.multi
def write(self, values):
if values.get('vat'):
values['vat'] = self._fix_vat_number(values['vat'])
diff --git a/addons/bus/models/res_partner.py b/addons/bus/models/res_partner.py
index 3f67d2d1c9f..71f2f8fbb1f 100644
--- a/addons/bus/models/res_partner.py
+++ b/addons/bus/models/res_partner.py
@@ -10,7 +10,6 @@ class ResPartner(models.Model):
im_status = fields.Char('IM Status', compute='_compute_im_status')
- @api.multi
def _compute_im_status(self):
self.env.cr.execute("""
SELECT
diff --git a/addons/bus/models/res_users.py b/addons/bus/models/res_users.py
index e89f6ddd35f..8e40c1b13f3 100644
--- a/addons/bus/models/res_users.py
+++ b/addons/bus/models/res_users.py
@@ -11,7 +11,6 @@ class ResUsers(models.Model):
im_status = fields.Char('IM Status', compute='_compute_im_status')
- @api.multi
def _compute_im_status(self):
""" Compute the im_status of the users """
self.env.cr.execute("""
diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py
index 7355600e601..5498759f550 100644
--- a/addons/calendar/models/calendar.py
+++ b/addons/calendar/models/calendar.py
@@ -154,12 +154,10 @@ class Attendee(models.Model):
values['common_name'] = values.get("common_name")
return super(Attendee, self).create(vals_list)
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
raise UserError(_('You cannot duplicate a calendar attendee.'))
- @api.multi
def _send_mail_to_attendees(self, template_xmlid, force_send=False):
""" Send mail for event invitation to event attendees.
:param template_xmlid: xml id of the email template to use to send the invitation
@@ -216,12 +214,10 @@ class Attendee(models.Model):
return res
- @api.multi
def do_tentative(self):
""" Makes event invitation as Tentative. """
return self.write({'state': 'tentative'})
- @api.multi
def do_accept(self):
""" Marks event invitation as Accepted. """
result = self.write({'state': 'accepted'})
@@ -230,7 +226,6 @@ class Attendee(models.Model):
attendee.event_id.message_post(body=_("%s has accepted invitation") % (attendee.common_name), subtype="calendar.subtype_invitation")
return result
- @api.multi
def do_decline(self):
""" Marks event invitation as Declined. """
res = self.write({'state': 'declined'})
@@ -519,13 +514,11 @@ class Alarm(models.Model):
self._update_cron()
return result
- @api.multi
def write(self, values):
result = super(Alarm, self).write(values)
self._update_cron()
return result
- @api.multi
def unlink(self):
result = super(Alarm, self).unlink()
self._update_cron()
@@ -588,14 +581,12 @@ class Meeting(models.Model):
partners |= self.env['res.partner'].browse(active_id)
return partners
- @api.multi
def _get_recurrent_dates_by_event(self):
""" Get recurrent start and stop dates based on Rule string"""
start_dates = self._get_recurrent_date_by_event(date_field='start')
stop_dates = self._get_recurrent_date_by_event(date_field='stop')
return list(zip(start_dates, stop_dates))
- @api.multi
def _get_recurrent_date_by_event(self, date_field='start'):
""" Get recurrent dates based on Rule string and all event where recurrent_id is child
@@ -648,7 +639,6 @@ class Meeting(models.Model):
return timezone.localize(d.replace(tzinfo=None), is_dst=True).astimezone(pytz.UTC)
return [naive_tz_to_utc(d) if not use_naive_datetime else d for d in rset1 if d.year < MAXYEAR]
- @api.multi
def _get_recurrency_end_date(self):
""" Return the last date a recurring event happens, according to its end_type. """
self.ensure_one()
@@ -678,7 +668,6 @@ class Meeting(models.Model):
return computed_final_date or deadline
return final_date
- @api.multi
def _find_my_attendee(self):
""" Return the first attendee where the user connected has been invited
from all the meeting_ids in parameters.
@@ -860,25 +849,21 @@ class Meeting(models.Model):
alarm_ids = fields.Many2many('calendar.alarm', 'calendar_alarm_calendar_event_rel', string='Reminders', ondelete="restrict", copy=False)
is_highlighted = fields.Boolean(compute='_compute_is_highlighted', string='Is the Event Highlighted')
- @api.multi
def _compute_attendee(self):
for meeting in self:
attendee = meeting._find_my_attendee()
meeting.is_attendee = bool(attendee)
meeting.attendee_status = attendee.state if attendee else 'needsAction'
- @api.multi
def _compute_display_time(self):
for meeting in self:
meeting.display_time = self._get_display_time(meeting.start, meeting.stop, meeting.duration, meeting.allday)
- @api.multi
@api.depends('allday', 'start_date', 'start_datetime')
def _compute_display_start(self):
for meeting in self:
meeting.display_start = meeting.start_date if meeting.allday else meeting.start_datetime
- @api.multi
@api.depends('allday', 'start', 'stop')
def _compute_dates(self):
""" Adapt the value of start_date(time)/stop_date(time) according to start/stop fields and allday. Also, compute
@@ -900,7 +885,6 @@ class Meeting(models.Model):
meeting.duration = self._get_duration(meeting.start, meeting.stop)
- @api.multi
def _inverse_dates(self):
for meeting in self:
if meeting.allday:
@@ -935,7 +919,6 @@ class Meeting(models.Model):
else:
meeting.rrule = ''
- @api.multi
def _inverse_rrule(self):
for meeting in self:
if meeting.rrule:
@@ -983,7 +966,6 @@ class Meeting(models.Model):
# Calendar Business, Reccurency, ...
####################################################
- @api.multi
def _get_ics_file(self):
""" Returns iCalendar file for the event invitation.
:returns a dict of .ics file content for each meeting
@@ -1044,7 +1026,6 @@ class Meeting(models.Model):
return result
- @api.multi
def create_attendees(self):
current_user = self.env.user
result = {}
@@ -1095,7 +1076,6 @@ class Meeting(models.Model):
}
return result
- @api.multi
def get_search_fields(self, order_fields, r_date=None):
sort_fields = {}
for field in order_fields:
@@ -1113,7 +1093,6 @@ class Meeting(models.Model):
sort_fields['sort_start'] = display_start.replace(' ', '').replace('-', '') if display_start else False
return sort_fields
- @api.multi
def get_recurrent_ids(self, domain, order=None):
""" Gives virtual event ids for recurring events. This method gives ids of dates
that comes between start date and end date of calendar views
@@ -1240,7 +1219,6 @@ class Meeting(models.Model):
]
return [r['id'] for r in sorted(result_data, key=key)]
- @api.multi
def _rrule_serialize(self):
""" Compute rule string according to value type RECUR of iCalendar
:return: string containing recurring rule (empty if no rule)
@@ -1351,7 +1329,6 @@ class Meeting(models.Model):
data['end_type'] = 'end_date'
return data
- @api.multi
def get_interval(self, interval, tz=None):
""" Format and localize some dates to be used in email templates
:param string interval: Among 'day', 'month', 'dayname' and 'time' indicating the desired formatting
@@ -1385,7 +1362,6 @@ class Meeting(models.Model):
return result
- @api.multi
def get_display_time_tz(self, tz=False):
""" get the display_time of the meeting, forcing the timezone. This method is called from email template, to not use sudo(). """
self.ensure_one()
@@ -1393,7 +1369,6 @@ class Meeting(models.Model):
self = self.with_context(tz=tz)
return self._get_display_time(self.start, self.stop, self.duration, self.allday)
- @api.multi
def detach_recurring_event(self, values=None):
""" Detach a virtual recurring event by duplicating the original and change reccurent values
:param values : dict of value to override on the detached event
@@ -1422,7 +1397,6 @@ class Meeting(models.Model):
del data['id']
return meeting_origin.copy(default=data)
- @api.multi
def action_detach_recurring_event(self):
meeting = self.detach_recurring_event()
return {
@@ -1434,13 +1408,11 @@ class Meeting(models.Model):
'flags': {'form': {'action_buttons': True, 'options': {'mode': 'edit'}}}
}
- @api.multi
def action_open_calendar_event(self):
if self.res_model and self.res_id:
return self.env[self.res_model].browse(self.res_id).get_formview_action()
return False
- @api.multi
def action_sendmail(self):
email = self.env.user.email
if email:
@@ -1452,7 +1424,6 @@ class Meeting(models.Model):
# Messaging
####################################################
- @api.multi
def _get_message_unread(self):
id_map = {x: calendar_id2real_id(x) for x in self.ids}
real = self.browse(set(id_map.values()))
@@ -1464,7 +1435,6 @@ class Meeting(models.Model):
event.message_unread_counter = rec.message_unread_counter
event.message_unread = rec.message_unread
- @api.multi
def _get_message_needaction(self):
id_map = {x: calendar_id2real_id(x) for x in self.ids}
real = self.browse(set(id_map.values()))
@@ -1476,7 +1446,6 @@ class Meeting(models.Model):
event.message_needaction_counter = rec.message_needaction_counter
event.message_needaction = rec.message_needaction
- @api.multi
@api.returns('mail.message', lambda value: value.id)
def message_post(self, **kwargs):
thread_id = self.id
@@ -1488,17 +1457,14 @@ class Meeting(models.Model):
self = self.with_context(context)
return super(Meeting, self.browse(thread_id)).message_post(**kwargs)
- @api.multi
def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None):
records = self.browse(get_real_ids(self.ids))
return super(Meeting, records).message_subscribe(partner_ids=partner_ids, channel_ids=channel_ids, subtype_ids=subtype_ids)
- @api.multi
def _message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None, customer_ids=None):
records = self.browse(get_real_ids(self.ids))
return super(Meeting, records)._message_subscribe(partner_ids=partner_ids, channel_ids=channel_ids, subtype_ids=subtype_ids, customer_ids=customer_ids)
- @api.multi
def message_unsubscribe(self, partner_ids=None, channel_ids=None):
records = self.browse(get_real_ids(self.ids))
return super(Meeting, records).message_unsubscribe(partner_ids=partner_ids, channel_ids=channel_ids)
@@ -1507,7 +1473,6 @@ class Meeting(models.Model):
# ORM Overrides
####################################################
- @api.multi
def get_metadata(self):
real = self.browse({calendar_id2real_id(x) for x in self.ids})
return super(Meeting, real).get_metadata()
@@ -1521,7 +1486,6 @@ class Meeting(models.Model):
arg[2][n] = calendar_id.split('-')[0]
return super(Meeting, self)._name_search(name=name, args=args, operator=operator, limit=limit, name_get_uid=name_get_uid)
- @api.multi
def write(self, values):
# FIXME: neverending recurring events
if 'rrule' in values:
@@ -1640,7 +1604,6 @@ class Meeting(models.Model):
self.env['calendar.alarm_manager']._notify_next_alarm(meeting.partner_ids.ids)
return meeting
- @api.multi
def export_data(self, fields_to_export, raw_data=False):
""" Override to convert virtual ids to ids """
records = self.browse(set(get_real_ids(self.ids)))
@@ -1652,7 +1615,6 @@ class Meeting(models.Model):
raise UserError(_('Group by date is not supported, use the calendar view instead.'))
return super(Meeting, self.with_context(virtual_id=False)).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
- @api.multi
def read(self, fields=None, load='_classic_read'):
if not fields:
fields = list(self._fields)
@@ -1714,7 +1676,6 @@ class Meeting(models.Model):
del r[k]
return result
- @api.multi
def unlink(self, can_be_deleted=True):
# Get concerned attendees to notify them if there is an alarm on the unlinked events,
# as it might have changed their next event notification
@@ -1784,7 +1745,6 @@ class Meeting(models.Model):
return events[offset: offset + limit].ids
return events.ids
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
self.ensure_one()
diff --git a/addons/calendar/models/ir_attachment.py b/addons/calendar/models/ir_attachment.py
index ae1fe6aafb9..dd81fd35e91 100644
--- a/addons/calendar/models/ir_attachment.py
+++ b/addons/calendar/models/ir_attachment.py
@@ -20,7 +20,6 @@ class Attachment(models.Model):
args[index] = (args[index][0], args[index][1], get_real_ids(args[index][2]))
return super(Attachment, self)._search(args, offset=offset, limit=limit, order=order, count=count, access_rights_uid=access_rights_uid)
- @api.multi
def write(self, vals):
""" When posting an attachment (new or not), convert the virtual ids in real ids. """
if isinstance(vals.get('res_id'), str):
diff --git a/addons/calendar/models/mail_activity.py b/addons/calendar/models/mail_activity.py
index 2bd33f2c6c9..71d7bf0fadb 100644
--- a/addons/calendar/models/mail_activity.py
+++ b/addons/calendar/models/mail_activity.py
@@ -15,7 +15,6 @@ class MailActivity(models.Model):
calendar_event_id = fields.Many2one('calendar.event', string="Calendar Meeting", ondelete='cascade')
- @api.multi
def action_create_calendar_event(self):
self.ensure_one()
action = self.env.ref('calendar.action_calendar_event').read()[0]
diff --git a/addons/calendar/models/res_partner.py b/addons/calendar/models/res_partner.py
index 261b955fc8f..d43bea89ac1 100644
--- a/addons/calendar/models/res_partner.py
+++ b/addons/calendar/models/res_partner.py
@@ -13,7 +13,6 @@ class Partner(models.Model):
calendar_last_notif_ack = fields.Datetime('Last notification marked as read from base Calendar', default=fields.Datetime.now)
- @api.multi
def get_attendee_detail(self, meeting_id):
""" Return a list of tuple (id, name, status)
Used by base_calendar.js : Many2ManyAttendee
diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py
index 7e383027400..5cd47b96f83 100644
--- a/addons/crm/models/crm_lead.py
+++ b/addons/crm/models/crm_lead.py
@@ -167,7 +167,6 @@ class Lead(models.Model):
stage_ids = stages._search(search_domain, order=order, access_rights_uid=SUPERUSER_ID)
return stages.browse(stage_ids)
- @api.multi
def _compute_kanban_state(self):
today = date.today()
for lead in self:
@@ -234,7 +233,6 @@ class Lead(models.Model):
break
lead.email_state = email_state
- @api.multi
def _compute_meeting_count(self):
meeting_data = self.env['calendar.event'].read_group([('opportunity_id', 'in', self.ids)], ['opportunity_id'], ['opportunity_id'])
mapped_data = {m['opportunity_id'][0]: m['opportunity_id_count'] for m in meeting_data}
@@ -335,7 +333,6 @@ class Lead(models.Model):
self._onchange_compute_probability(optional_field_name='email_state')
@api.constrains('user_id')
- @api.multi
def _valid_team(self):
for lead in self:
if lead.user_id:
@@ -396,7 +393,6 @@ class Lead(models.Model):
result._write_probability(vals)
return result
- @api.multi
def write(self, vals):
# stage change:
if 'stage_id' in vals:
@@ -441,7 +437,6 @@ class Lead(models.Model):
super(Lead, lead).write(proba_vals)
return
- @api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
self.ensure_one()
@@ -473,13 +468,11 @@ class Lead(models.Model):
# Actions Methods
# ----------------------------------------
- @api.multi
def action_set_lost(self):
""" Lost semantic: probability = 0 or active = False """
result = self.write({'active': False, 'probability': 0})
return result
- @api.multi
def action_set_won(self):
""" Won semantic: probability = 100 (active untouched) """
for lead in self:
@@ -490,7 +483,6 @@ class Lead(models.Model):
def action_set_automated_probability(self):
self.write({'probability': self.automated_probability})
- @api.multi
def action_set_won_rainbowman(self):
self.ensure_one()
self.action_set_won()
@@ -542,7 +534,6 @@ class Lead(models.Model):
}
return True
- @api.multi
def action_schedule_meeting(self):
""" Open meeting's calendar view to schedule meeting on current opportunity.
:return dict: dictionary value for created Meeting view
@@ -561,11 +552,9 @@ class Lead(models.Model):
}
return action
- @api.multi
def close_dialog(self):
return {'type': 'ir.actions.act_window_close'}
- @api.multi
def edit_dialog(self):
form_view = self.env.ref('crm.crm_case_form_view_oppor')
return {
@@ -606,7 +595,6 @@ class Lead(models.Model):
# perform search, return the first found
return self.env['crm.stage'].search(search_domain, order=order, limit=1)
- @api.multi
def _merge_get_result_type(self):
""" Define the type of the result of the merge. If at least one of the
element to merge is an opp, the resulting new element will be an opp.
@@ -622,7 +610,6 @@ class Lead(models.Model):
return 'opportunity'
return 'lead'
- @api.multi
def _merge_data(self, fields):
""" Prepare lead/opp data into a dictionary for merging. Different types
of fields are processed in different ways:
@@ -696,7 +683,6 @@ class Lead(models.Model):
bodies.append("
".join(body + ['
']))
return bodies
- @api.multi
def _merge_notify(self, opportunities):
""" Create a message gathering merged leads/opps informations. Using message_post, send a
message explaining which fields has been merged and their new value. `self` is the
@@ -715,7 +701,6 @@ class Lead(models.Model):
message_body = "\n\n".join(message_bodies)
return self.message_post(body=message_body, subject=subject)
- @api.multi
def _merge_opportunity_history(self, opportunities):
""" Move mail.message from the given opportunities to the current one. `self` is the
crm.lead record destination for message of `opportunities`.
@@ -730,7 +715,6 @@ class Lead(models.Model):
})
return True
- @api.multi
def _merge_opportunity_attachments(self, opportunities):
""" Move attachments of given opportunities to the current one `self`, and rename
the attachments having same name than native ones.
@@ -756,7 +740,6 @@ class Lead(models.Model):
attachment.write(values)
return True
- @api.multi
def merge_dependences(self, opportunities):
""" Merge dependences (messages, attachments, ...). These dependences will be
transfered to `self`, the most important lead.
@@ -768,7 +751,6 @@ class Lead(models.Model):
self._merge_opportunity_history(opportunities)
self._merge_opportunity_attachments(opportunities)
- @api.multi
def merge_opportunity(self, user_id=False, team_id=False):
""" Merge opportunities in one. Different cases of merge:
- merge leads together = 1 new lead
@@ -821,7 +803,6 @@ class Lead(models.Model):
return opportunities_head
- @api.multi
def get_duplicated_leads(self, partner_id, include_lost=False):
""" Search for opportunities that have the same partner and that arent done or cancelled
:param partner_id : partner to search
@@ -850,7 +831,6 @@ class Lead(models.Model):
domain += ['|', '&', ('type', '=', 'lead'), ('active', '=', True), ('type', '=', 'opportunity')]
return self.search(domain)
- @api.multi
def _convert_opportunity_data(self, customer, team_id=False):
""" Extract the data from a lead to create the opportunity
:param customer : res.partner record
@@ -874,7 +854,6 @@ class Lead(models.Model):
value['stage_id'] = stage.id
return value
- @api.multi
def convert_opportunity(self, partner_id, user_ids=False, team_id=False):
customer = False
if partner_id:
@@ -890,7 +869,6 @@ class Lead(models.Model):
return True
- @api.multi
def _create_lead_partner_data(self, name, is_company, parent_id=False):
""" extract data from lead to create a partner
:param name : furtur name of the partner
@@ -921,7 +899,6 @@ class Lead(models.Model):
'type': 'contact'
}
- @api.multi
def _create_lead_partner(self):
""" Create a partner from lead data
:returns res.partner record
@@ -945,7 +922,6 @@ class Lead(models.Model):
return partner_company
return Partner.create(self._create_lead_partner_data(self.name, False))
- @api.multi
def handle_partner_assignation(self, action='create', partner_id=False):
""" Handle partner assignation during a lead conversion.
if action is 'create', create new partner with contact and assign lead to new partner_id.
@@ -970,7 +946,6 @@ class Lead(models.Model):
partner_ids[lead.id] = partner_id
return partner_ids
- @api.multi
def allocate_salesman(self, user_ids=None, team_id=False):
""" Assign salesmen and salesteam to a batch of leads. If there are more
leads than salesmen, these salesmen will be assigned in round-robin.
@@ -996,7 +971,6 @@ class Lead(models.Model):
lead.write(value)
return True
- @api.multi
def redirect_opportunity_view(self):
self.ensure_one()
# Get opportunity views
@@ -1020,7 +994,6 @@ class Lead(models.Model):
'context': {'default_type': 'opportunity'}
}
- @api.multi
def redirect_lead_view(self):
self.ensure_one()
# Get lead views
@@ -1062,7 +1035,6 @@ class Lead(models.Model):
sub_title = _('or send an email to %s') % (email_link)
return '
%s
%s
' % (help_title, sub_title) - @api.multi def log_meeting(self, meeting_subject, meeting_date, duration): if not duration: duration = _('unknown') @@ -1209,7 +1181,6 @@ class Lead(models.Model): def _creation_subtype(self): return self.env.ref('crm.mt_lead_create') - @api.multi def _track_subtype(self, init_values): self.ensure_one() if 'stage_id' in init_values and self.probability == 100 and self.stage_id: @@ -1220,7 +1191,6 @@ class Lead(models.Model): return self.env.ref('crm.mt_lead_stage') return super(Lead, self)._track_subtype(init_values) - @api.multi def _notify_get_groups(self): """ Handle salesman recipients that can convert leads into opportunities and set opportunities as won / lost. """ @@ -1248,7 +1218,6 @@ class Lead(models.Model): return [new_group] + groups - @api.multi def _notify_get_reply_to(self, default=None, records=None, company=None, doc_names=None): """ Override to set alias of lead and opportunities to their sales team if any. """ aliases = self.mapped('team_id').sudo()._notify_get_reply_to(default=default, records=None, company=company, doc_names=None) @@ -1258,7 +1227,6 @@ class Lead(models.Model): res.update(super(Lead, leftover)._notify_get_reply_to(default=default, records=None, company=company, doc_names=doc_names)) return res - @api.multi def get_formview_id(self, access_uid=None): if self.type == 'opportunity': view_id = self.env.ref('crm.crm_case_form_view_oppor').id @@ -1266,7 +1234,6 @@ class Lead(models.Model): view_id = super(Lead, self).get_formview_id() return view_id - @api.multi def _message_get_default_recipients(self): return {r.id: { 'partner_ids': [], @@ -1274,7 +1241,6 @@ class Lead(models.Model): 'email_cc': False} for r in self} - @api.multi def _message_get_suggested_recipients(self): recipients = super(Lead, self)._message_get_suggested_recipients() try: @@ -1331,7 +1297,6 @@ class Lead(models.Model): ('stage_id.fold', '=', False)]).write({'partner_id': new_partner.id}) return super(Lead, self)._message_post_after_hook(message, msg_vals) - @api.multi def _message_partner_info_from_emails(self, emails, link_mail=False): result = super(Lead, self)._message_partner_info_from_emails(emails, link_mail=link_mail) for partner_info in result: diff --git a/addons/crm/models/crm_stage.py b/addons/crm/models/crm_stage.py index 6e189d52146..5cd1a793f31 100644 --- a/addons/crm/models/crm_stage.py +++ b/addons/crm/models/crm_stage.py @@ -44,7 +44,6 @@ class Stage(models.Model): # This field for interface only team_count = fields.Integer('team_count', compute='_compute_team_count') - @api.multi def _compute_team_count(self): for stage in self: stage.team_count = self.env['crm.team'].search_count([]) diff --git a/addons/crm/models/crm_team.py b/addons/crm/models/crm_team.py index b62904788d2..a1a0f42bd6f 100644 --- a/addons/crm/models/crm_team.py +++ b/addons/crm/models/crm_team.py @@ -93,7 +93,6 @@ class Team(models.Model): defaults['team_id'] = self.id return values - @api.multi def write(self, vals): result = super(Team, self).write(vals) if 'alias_defaults' in vals: diff --git a/addons/crm/models/res_config_settings.py b/addons/crm/models/res_config_settings.py index 6b8c622bfbb..e2f2df0c68e 100644 --- a/addons/crm/models/res_config_settings.py +++ b/addons/crm/models/res_config_settings.py @@ -86,7 +86,6 @@ class ResConfigSettings(models.TransientModel): ) return res - @api.multi def set_values(self): super(ResConfigSettings, self).set_values() alias = self._find_default_lead_alias_id() diff --git a/addons/crm/models/res_partner.py b/addons/crm/models/res_partner.py index b6b52b95c11..869f89aed8e 100644 --- a/addons/crm/models/res_partner.py +++ b/addons/crm/models/res_partner.py @@ -36,13 +36,11 @@ class Partner(models.Model): ) return rec - @api.multi def _compute_opportunity_count(self): for partner in self: operator = 'child_of' if partner.is_company else '=' # the opportunity count should counts the opportunities of this company and all its contacts partner.opportunity_count = self.env['crm.lead'].search_count([('partner_id', operator, partner.id), ('type', '=', 'opportunity')]) - @api.multi def _compute_meeting_count(self): for partner in self: partner.meeting_count = len(partner.meeting_ids) @@ -59,7 +57,6 @@ class Partner(models.Model): if self.mobile: self.mobile = self.phone_format(self.mobile) - @api.multi def schedule_meeting(self): partner_ids = self.ids partner_ids.append(self.env.user.partner_id.id) diff --git a/addons/crm/wizard/crm_lead_lost.py b/addons/crm/wizard/crm_lead_lost.py index 4bcdf46992a..b1d07199699 100644 --- a/addons/crm/wizard/crm_lead_lost.py +++ b/addons/crm/wizard/crm_lead_lost.py @@ -9,7 +9,6 @@ class CrmLeadLost(models.TransientModel): lost_reason_id = fields.Many2one('crm.lost.reason', 'Lost Reason') - @api.multi def action_lost_reason_apply(self): leads = self.env['crm.lead'].browse(self.env.context.get('active_ids')) leads.write({'lost_reason': self.lost_reason_id.id}) diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index b911609f03a..4ba6bf27658 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -87,7 +87,6 @@ class Lead2OpportunityPartner(models.TransientModel): raise UserError(_("Closed/Dead leads cannot be converted into opportunities.")) return False - @api.multi def _convert_opportunity(self, vals): self.ensure_one() @@ -110,7 +109,6 @@ class Lead2OpportunityPartner(models.TransientModel): return res - @api.multi def action_apply(self): """ Convert lead to opportunity or merge lead and opportunity and open the freshly created opportunity view. @@ -205,7 +203,6 @@ class Lead2OpportunityMassConvert(models.TransientModel): self.opportunity_ids = self.env['crm.lead'].browse(leads_with_duplicates) - @api.multi def _convert_opportunity(self, vals): """ When "massively" (more than one at a time) converting leads to opportunities, check the salesteam_id and salesmen_ids and update @@ -219,7 +216,6 @@ class Lead2OpportunityMassConvert(models.TransientModel): vals.update({'user_ids': salesmen_ids, 'team_id': salesteam_id}) return super(Lead2OpportunityMassConvert, self)._convert_opportunity(vals) - @api.multi def mass_convert(self): self.ensure_one() if self.name == 'convert' and self.deduplicate: diff --git a/addons/crm/wizard/crm_merge_opportunities.py b/addons/crm/wizard/crm_merge_opportunities.py index 82795678d89..e492c85df2d 100644 --- a/addons/crm/wizard/crm_merge_opportunities.py +++ b/addons/crm/wizard/crm_merge_opportunities.py @@ -36,7 +36,6 @@ class MergeOpportunity(models.TransientModel): user_id = fields.Many2one('res.users', 'Salesperson', index=True) team_id = fields.Many2one('crm.team', 'Sales Team', oldname='section_id', index=True) - @api.multi def action_merge(self): self.ensure_one() merge_opportunity = self.opportunity_ids.merge_opportunity(self.user_id.id, self.team_id.id) diff --git a/addons/crm_iap_lead/models/crm_iap_lead_mining_request.py b/addons/crm_iap_lead/models/crm_iap_lead_mining_request.py index 7558180f28d..54ca723409a 100644 --- a/addons/crm_iap_lead/models/crm_iap_lead_mining_request.py +++ b/addons/crm_iap_lead/models/crm_iap_lead_mining_request.py @@ -158,7 +158,6 @@ class CRMLeadMiningRequest(models.Model): self._cr.commit() raise e - @api.multi def _create_leads_from_response(self, result): """ This method will get the response from the service and create the leads accordingly """ self.ensure_one() @@ -188,13 +187,11 @@ class CRMLeadMiningRequest(models.Model): sub_title = _('Generate new leads based on their country, industry, size, etc.') return '%s
%s
' % (help_title, sub_title) - @api.multi def action_draft(self): self.ensure_one() self.name = _('New') self.state = 'draft' - @api.multi def action_submit(self): self.ensure_one() if self.name == _('New'): @@ -208,7 +205,6 @@ class CRMLeadMiningRequest(models.Model): elif self.lead_type == 'opportunity': return self.action_get_opportunity_action() - @api.multi def action_get_lead_action(self): self.ensure_one() action = self.env.ref('crm.crm_lead_all_leads').read()[0] @@ -220,7 +216,6 @@ class CRMLeadMiningRequest(models.Model): """) return action - @api.multi def action_get_opportunity_action(self): self.ensure_one() action = self.env.ref('crm.crm_lead_opportunities').read()[0] diff --git a/addons/delivery/models/delivery_carrier.py b/addons/delivery/models/delivery_carrier.py index 0d4ef3118d2..b1c4ee6e44d 100644 --- a/addons/delivery/models/delivery_carrier.py +++ b/addons/delivery/models/delivery_carrier.py @@ -81,7 +81,6 @@ class DeliveryCarrier(models.Model): for c in self: c.debug_logging = not c.debug_logging - @api.multi def install_more_provider(self): return { 'name': 'New Providers', diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py index 66da5c70b29..e746c1b9d37 100644 --- a/addons/delivery/models/sale_order.py +++ b/addons/delivery/models/sale_order.py @@ -37,11 +37,9 @@ class SaleOrder(models.Model): if delivery_line: self.recompute_delivery_price = True - @api.multi def _remove_delivery_line(self): self.env['sale.order.line'].search([('order_id', 'in', self.ids), ('is_delivery', '=', True)]).unlink() - @api.multi def set_delivery_line(self, carrier, amount): # Remove delivery products from the sales order @@ -156,7 +154,6 @@ class SaleOrderLine(models.Model): return 0.0 line.product_qty = line.product_uom._compute_quantity(line.product_uom_qty, line.product_id.uom_id) - @api.multi def unlink(self): for line in self: if line.is_delivery: diff --git a/addons/delivery/models/stock_picking.py b/addons/delivery/models/stock_picking.py index 764f61cb98b..e596c930550 100644 --- a/addons/delivery/models/stock_picking.py +++ b/addons/delivery/models/stock_picking.py @@ -112,7 +112,6 @@ class StockPicking(models.Model): for picking in self: picking.weight = sum(move.weight for move in picking.move_lines if move.state != 'cancel') - @api.multi def action_done(self): res = super(StockPicking, self).action_done() for pick in self: @@ -121,7 +120,6 @@ class StockPicking(models.Model): pick.send_to_shipper() return res - @api.multi def _pre_put_in_pack_hook(self, move_line_ids): res = super(StockPicking, self)._pre_put_in_pack_hook(move_line_ids) if not res: @@ -151,7 +149,6 @@ class StockPicking(models.Model): ), } - @api.multi def action_send_confirmation_email(self): self.ensure_one() delivery_template_id = self.env.ref('delivery.mail_template_data_delivery_confirmation').id @@ -173,7 +170,6 @@ class StockPicking(models.Model): 'context': ctx, } - @api.multi def send_to_shipper(self): self.ensure_one() res = self.carrier_id.send_shipping(self)[0] @@ -188,12 +184,10 @@ class StockPicking(models.Model): self._add_delivery_cost_to_so() - @api.multi def print_return_label(self): self.ensure_one() res = self.carrier_id.get_return_label(self) - @api.multi def _add_delivery_cost_to_so(self): self.ensure_one() sale_order = self.sale_id @@ -209,7 +203,6 @@ class StockPicking(models.Model): 'name': sale_order.carrier_id.with_context(lang=self.partner_id.lang).name, }) - @api.multi def open_website_url(self): self.ensure_one() if not self.carrier_tracking_url: @@ -242,7 +235,6 @@ class StockPicking(models.Model): picking.message_post(body=msg) picking.carrier_tracking_ref = False - @api.multi def check_packages_are_identical(self): '''Some shippers require identical packages in the same shipment. This utility checks it.''' self.ensure_one() @@ -257,7 +249,6 @@ class StockPicking(models.Model): class StockReturnPicking(models.TransientModel): _inherit = 'stock.return.picking' - @api.multi def _create_returns(self): # Prevent copy of the carrier and carrier price when generating return picking # (we have no integration of returns for now) diff --git a/addons/digest/models/digest.py b/addons/digest/models/digest.py index 14b777a5f33..950794d29b3 100644 --- a/addons/digest/models/digest.py +++ b/addons/digest/models/digest.py @@ -80,21 +80,17 @@ class Digest(models.Model): vals['next_run_date'] = date.today() + relativedelta(days=3) return super(Digest, self).create(vals) - @api.multi def action_subscribe(self): if self.env.user not in self.user_ids: self.sudo().user_ids |= self.env.user - @api.multi def action_unsubcribe(self): if self.env.user in self.user_ids: self.sudo().user_ids -= self.env.user - @api.multi def action_activate(self): self.state = 'activated' - @api.multi def action_deactivate(self): self.state = 'deactivated' diff --git a/addons/event/models/event.py b/addons/event/models/event.py index b13b7cad4f8..1e35e4d29eb 100644 --- a/addons/event/models/event.py +++ b/addons/event/models/event.py @@ -182,7 +182,6 @@ class EventEvent(models.Model): badge_innerright = fields.Html(string='Badge Inner Right') event_logo = fields.Html(string='Event Logo') - @api.multi @api.depends('seats_max', 'registration_ids.state') def _compute_seats(self): """ Determine reserved, available, reserved but unconfirmed and used seats. """ @@ -281,7 +280,6 @@ class EventEvent(models.Model): if event.date_end < event.date_begin: raise ValidationError(_('The closing date cannot be earlier than the beginning date.')) - @api.multi @api.depends('name', 'date_begin', 'date_end') def name_get(self): result = [] @@ -302,14 +300,12 @@ class EventEvent(models.Model): res.button_confirm() return res - @api.multi def write(self, vals): res = super(EventEvent, self).write(vals) if vals.get('organizer_id'): self.message_subscribe([vals['organizer_id']]) return res - @api.multi @api.returns('self', lambda value: value.id) def copy(self, default=None): self.ensure_one() @@ -319,7 +315,6 @@ class EventEvent(models.Model): def button_draft(self): self.write({'state': 'draft'}) - @api.multi def button_cancel(self): if any('done' in event.mapped('registration_ids.state') for event in self): raise UserError(_("There are already attendees who attended this event. Please reset it to draft if you want to cancel this event.")) @@ -337,11 +332,9 @@ class EventEvent(models.Model): for attendee in event.registration_ids.filtered(filter_func): self.env['mail.template'].browse(template_id).send_mail(attendee.id, force_send=force_send) - @api.multi def _is_event_registrable(self): return self.date_end > fields.Datetime.now() - @api.multi def _get_ics_file(self): """ Returns iCalendar file for the event invitation. :returns a dict of .ics file content for each event @@ -401,7 +394,6 @@ class EventRegistration(models.Model): if registration.event_id.seats_availability == 'limited' and registration.event_id.seats_max and registration.event_id.seats_available < (1 if registration.state == 'draft' else 0): raise ValidationError(_('No more seats available for this event.')) - @api.multi def _check_auto_confirmation(self): if self._context.get('registration_force_draft'): return False @@ -471,7 +463,6 @@ class EventRegistration(models.Model): self.email = contact.email or self.email self.phone = contact.phone or self.phone - @api.multi def _message_get_suggested_recipients(self): recipients = super(EventRegistration, self)._message_get_suggested_recipients() public_users = self.env['res.users'].sudo() @@ -489,7 +480,6 @@ class EventRegistration(models.Model): pass return recipients - @api.multi def _message_get_default_recipients(self): # Prioritize registration email over partner_id, which may be shared when a single # partner booked multiple seats @@ -513,7 +503,6 @@ class EventRegistration(models.Model): ]).write({'partner_id': new_partner.id}) return super(EventRegistration, self)._message_post_after_hook(message, msg_vals) - @api.multi def action_send_badge_email(self): """ Open a window to compose an email, with the template - 'event_badge' message loaded by default @@ -540,7 +529,6 @@ class EventRegistration(models.Model): 'context': ctx, } - @api.multi def get_date_range_str(self): self.ensure_one() today = fields.Datetime.now() @@ -559,7 +547,6 @@ class EventRegistration(models.Model): else: return _('on ') + format_datetime(self.env, self.event_begin_date, tz=self.event_id.date_tz, dt_format='medium') - @api.multi def summary(self): self.ensure_one() return {'information': []} diff --git a/addons/event/models/res_partner.py b/addons/event/models/res_partner.py index 009b182c1ae..0be6c4c8287 100644 --- a/addons/event/models/res_partner.py +++ b/addons/event/models/res_partner.py @@ -14,7 +14,6 @@ class ResPartner(models.Model): for partner in self: partner.event_count = self.env['event.event'].search_count([('registration_ids.partner_id', 'child_of', partner.ids)]) - @api.multi def action_event_view(self): action = self.env.ref('event.action_event_view').read()[0] action['context'] = {} diff --git a/addons/event/wizard/event_confirm.py b/addons/event/wizard/event_confirm.py index a9825af916c..73c9e135799 100644 --- a/addons/event/wizard/event_confirm.py +++ b/addons/event/wizard/event_confirm.py @@ -9,7 +9,6 @@ class event_confirm(models.TransientModel): _name = "event.confirm" _description = 'Event Confirmation' - @api.multi def confirm(self): events = self.env['event.event'].browse(self._context.get('event_ids', [])) events.do_confirm() diff --git a/addons/event_sale/models/account_invoice.py b/addons/event_sale/models/account_invoice.py index 3ef88ea342c..0f5b46f2748 100644 --- a/addons/event_sale/models/account_invoice.py +++ b/addons/event_sale/models/account_invoice.py @@ -7,7 +7,6 @@ from odoo import api, models class AccountMove(models.Model): _inherit = 'account.move' - @api.multi def action_invoice_paid(self): """ When an invoice linked to a sales order selling registrations is paid confirm attendees. Attendees should indeed not be confirmed before diff --git a/addons/event_sale/models/event.py b/addons/event_sale/models/event.py index 543bf3cb87f..ba407dc8f60 100644 --- a/addons/event_sale/models/event.py +++ b/addons/event_sale/models/event.py @@ -53,7 +53,6 @@ class Event(models.Model): }) for ticket in self.event_type_id.event_ticket_ids] - @api.multi def _is_event_registrable(self): if super(Event, self)._is_event_registrable(): self.ensure_one() @@ -93,7 +92,6 @@ class EventTicket(models.Model): seats_unconfirmed = fields.Integer(string='Unconfirmed Seat Reservations', compute='_compute_seats', store=True) seats_used = fields.Integer(compute='_compute_seats', store=True) - @api.multi def _compute_is_expired(self): for record in self: if record.deadline: @@ -102,7 +100,6 @@ class EventTicket(models.Model): else: record.is_expired = False - @api.multi def _compute_price_reduce(self): for record in self: product = record.product_id @@ -116,7 +113,6 @@ class EventTicket(models.Model): taxes = tax_ids.compute_all(record.price_reduce, record.event_id.company_id.currency_id, 1.0, product=record.product_id) record.price_reduce_taxinc = taxes['total_included'] - @api.multi @api.depends('seats_max', 'registration_ids.state') def _compute_seats(self): """ Determine reserved, available, reserved but unconfirmed and used seats. """ @@ -145,7 +141,6 @@ class EventTicket(models.Model): if ticket.seats_max > 0: ticket.seats_available = ticket.seats_max - (ticket.seats_reserved + ticket.seats_used) - @api.multi @api.constrains('registration_ids', 'seats_max') def _check_seats_limit(self): for record in self: @@ -201,14 +196,12 @@ class EventRegistration(models.Model): if self.event_ticket_id and (not self.event_id or self.event_id != self.event_ticket_id.event_id): self.event_ticket_id = None - @api.multi @api.constrains('event_ticket_id', 'state') def _check_ticket_seats_limit(self): for record in self: if record.event_ticket_id.seats_max and record.event_ticket_id.seats_available < 0: raise ValidationError(_('No more available seats for this ticket')) - @api.multi def _check_auto_confirmation(self): res = super(EventRegistration, self)._check_auto_confirmation() if res: @@ -244,7 +237,6 @@ class EventRegistration(models.Model): }) return att_data - @api.multi def summary(self): res = super(EventRegistration, self).summary() if self.event_ticket_id.product_id.image_medium: diff --git a/addons/event_sale/models/sale_order.py b/addons/event_sale/models/sale_order.py index 6d3c2aa33ab..09eb3f36cd5 100644 --- a/addons/event_sale/models/sale_order.py +++ b/addons/event_sale/models/sale_order.py @@ -6,7 +6,6 @@ from odoo import api, fields, models class SaleOrder(models.Model): _inherit = "sale.order" - @api.multi def _action_confirm(self): res = super(SaleOrder, self)._action_confirm() for so in self: @@ -14,7 +13,6 @@ class SaleOrder(models.Model): so.order_line._update_registrations(confirm=so.amount_total == 0, cancel_to_draft=False) return res - @api.multi def action_confirm(self): res = super(SaleOrder, self).action_confirm() for so in self: @@ -35,7 +33,6 @@ class SaleOrderLine(models.Model): "an event ticket and it will automatically create a registration for this event ticket.") event_ok = fields.Boolean(related='product_id.event_ok', readonly=True) - @api.multi def _update_registrations(self, confirm=True, cancel_to_draft=False, registration_data=None): """ Create or update registrations linked to a sales order line. A sale order line has a product_uom_qty attribute that will be the number of diff --git a/addons/event_sale/wizard/event_edit_registration.py b/addons/event_sale/wizard/event_edit_registration.py index 73c5e44879e..5b5b98ab300 100644 --- a/addons/event_sale/wizard/event_edit_registration.py +++ b/addons/event_sale/wizard/event_edit_registration.py @@ -45,7 +45,6 @@ class RegistrationEditor(models.TransientModel): res = self._convert_to_write(res) return res - @api.multi def action_make_registration(self): self.ensure_one() for registration_line in self.event_registration_ids: @@ -74,7 +73,6 @@ class RegistrationEditorLine(models.TransientModel): phone = fields.Char(string='Phone') name = fields.Char(string='Name', index=True) - @api.multi def get_registration_data(self): self.ensure_one() return { diff --git a/addons/fetchmail/models/fetchmail.py b/addons/fetchmail/models/fetchmail.py index bda31375d81..3873b5deb65 100644 --- a/addons/fetchmail/models/fetchmail.py +++ b/addons/fetchmail/models/fetchmail.py @@ -84,24 +84,20 @@ odoo_mailgate: "|/path/to/odoo-mailgate.py --host=localhost -u %(uid)d -p PASSWO self._update_cron() return res - @api.multi def write(self, values): res = super(FetchmailServer, self).write(values) self._update_cron() return res - @api.multi def unlink(self): res = super(FetchmailServer, self).unlink() self._update_cron() return res - @api.multi def set_draft(self): self.write({'state': 'draft'}) return True - @api.multi def connect(self): self.ensure_one() if self.server_type == 'imap': @@ -123,7 +119,6 @@ odoo_mailgate: "|/path/to/odoo-mailgate.py --host=localhost -u %(uid)d -p PASSWO connection.sock.settimeout(MAIL_TIMEOUT) return connection - @api.multi def button_confirm_login(self): for server in self: try: @@ -149,7 +144,6 @@ odoo_mailgate: "|/path/to/odoo-mailgate.py --host=localhost -u %(uid)d -p PASSWO """ Method called by cron to fetch mails from servers """ return self.search([('state', '=', 'done'), ('server_type', 'in', ['pop', 'imap'])]).fetch_mail() - @api.multi def fetch_mail(self): """ WARNING: meant for cron usage only - will commit() after each email! """ additionnal_context = { diff --git a/addons/fleet/models/fleet_vehicle.py b/addons/fleet/models/fleet_vehicle.py index 709880486ed..3a713a0140e 100644 --- a/addons/fleet/models/fleet_vehicle.py +++ b/addons/fleet/models/fleet_vehicle.py @@ -220,7 +220,6 @@ class FleetVehicle(models.Model): future_driver.write({'plan_to_change_car': True}) return res - @api.multi def write(self, vals): if 'driver_id' in vals and vals['driver_id']: driver_id = vals['driver_id'] @@ -276,7 +275,6 @@ class FleetVehicle(models.Model): rec = self._search(expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid) return self.browse(rec).name_get() - @api.multi def return_action_to_open(self): """ This opens the xml view specified in xml_id for the current vehicle """ self.ensure_one() @@ -290,7 +288,6 @@ class FleetVehicle(models.Model): return res return False - @api.multi def act_show_log_cost(self): """ This opens log view to view and add new log for this vehicle, groupby default to only show effective costs @return: the costs log view @@ -305,7 +302,6 @@ class FleetVehicle(models.Model): ) return res - @api.multi def _track_subtype(self, init_values): self.ensure_one() if 'driver_id' in init_values: diff --git a/addons/fleet/models/fleet_vehicle_cost.py b/addons/fleet/models/fleet_vehicle_cost.py index 2dc64d58adf..5ddfd92cf90 100644 --- a/addons/fleet/models/fleet_vehicle_cost.py +++ b/addons/fleet/models/fleet_vehicle_cost.py @@ -176,24 +176,20 @@ class FleetVehicleLogContract(models.Model): if self.vehicle_id: self.odometer_unit = self.vehicle_id.odometer_unit - @api.multi def write(self, vals): res = super(FleetVehicleLogContract, self).write(vals) if vals.get('expiration_date') or vals.get('user_id'): self.activity_reschedule(['fleet.mail_act_fleet_contract_to_renew'], date_deadline=vals.get('expiration_date'), new_user_id=vals.get('user_id')) return res - @api.multi def contract_close(self): for record in self: record.state = 'closed' - @api.multi def contract_open(self): for record in self: record.state = 'open' - @api.multi def act_renew_contract(self): assert len(self.ids) == 1, "This operation should only be done for 1 single contract at a time, as it it suppose to open a window as result" for element in self: diff --git a/addons/fleet/models/fleet_vehicle_model.py b/addons/fleet/models/fleet_vehicle_model.py index b4129557f8e..e945da2ac71 100644 --- a/addons/fleet/models/fleet_vehicle_model.py +++ b/addons/fleet/models/fleet_vehicle_model.py @@ -18,7 +18,6 @@ class FleetVehicleModel(models.Model): image_medium = fields.Binary(related='brand_id.image_medium', string="Logo (medium)", readonly=False) image_small = fields.Binary(related='brand_id.image_small', string="Logo (small)", readonly=False) - @api.multi @api.depends('name', 'brand_id') def name_get(self): res = [] @@ -60,7 +59,6 @@ class FleetVehicleModelBrand(models.Model): tools.image_resize_images(vals) return super(FleetVehicleModelBrand, self).create(vals_list) - @api.multi def write(self, vals): tools.image_resize_images(vals) return super(FleetVehicleModelBrand, self).write(vals) diff --git a/addons/gamification/models/badge.py b/addons/gamification/models/badge.py index b0483dbeae7..fc93ffb8041 100644 --- a/addons/gamification/models/badge.py +++ b/addons/gamification/models/badge.py @@ -143,7 +143,6 @@ class GamificationBadge(models.Model): tools.image_resize_images(vals) return super(GamificationBadge, self).create(values_list) - @api.multi def write(self, vals): tools.image_resize_images(vals) return super(GamificationBadge, self).write(vals) diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 503ec655c5c..08194e0d7ec 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -167,7 +167,6 @@ class Challenge(models.Model): return super(Challenge, self).create(vals) - @api.multi def write(self, vals): if vals.get('user_domain'): users = self._get_challenger_users(ustr(vals.get('user_domain'))) @@ -299,12 +298,10 @@ class Challenge(models.Model): return True - @api.multi def action_start(self): """Start a challenge""" return self.write({'state': 'inprogress'}) - @api.multi def action_check(self): """Check a challenge @@ -317,7 +314,6 @@ class Challenge(models.Model): return self._update_all() - @api.multi def action_report_progress(self): """Manual report of a goal, does not influence automatic report frequency""" for challenge in self: @@ -602,7 +598,6 @@ class Challenge(models.Model): return challenge.write({'last_report_date': fields.Date.today()}) ##### Challenges ##### - @api.multi def accept_challenge(self): user = self.env.user sudoed = self.sudo() @@ -610,7 +605,6 @@ class Challenge(models.Model): sudoed.write({'invited_user_ids': [(3, user.id)], 'user_ids': [(4, user.id)]}) return sudoed._generate_goals_from_challenge() - @api.multi def discard_challenge(self): """The user discard the suggested challenge""" user = self.env.user diff --git a/addons/gamification/models/gamification_karma_rank.py b/addons/gamification/models/gamification_karma_rank.py index cd4ef6cc28a..cbbe7bf19d1 100644 --- a/addons/gamification/models/gamification_karma_rank.py +++ b/addons/gamification/models/gamification_karma_rank.py @@ -54,7 +54,6 @@ class KarmaRank(models.Model): users._recompute_rank() return res - @api.multi def write(self, vals): tools.image_resize_images(vals) res = super(KarmaRank, self).write(vals) diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index abc6549a3dd..75db403647e 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -117,7 +117,6 @@ class GoalDefinition(models.Model): definition._check_model_validity() return definition - @api.multi def write(self, vals): res = super(GoalDefinition, self).write(vals) if vals.get('computation_mode', 'count') in ('count', 'sum') and (vals.get('domain') or vals.get('model_id')): @@ -250,7 +249,6 @@ class Goal(models.Model): return {self: result} - @api.multi def update_goal(self): """Update the goals to recomputes values and change of states @@ -362,7 +360,6 @@ class Goal(models.Model): self.env.cr.commit() return True - @api.multi def action_start(self): """Mark a goal as started. @@ -370,7 +367,6 @@ class Goal(models.Model): self.write({'state': 'inprogress'}) return self.update_goal() - @api.multi def action_reach(self): """Mark a goal as reached. @@ -378,14 +374,12 @@ class Goal(models.Model): Progress at the next goal update until the end date.""" return self.write({'state': 'reached'}) - @api.multi def action_fail(self): """Set the state of the goal to failed. A failed goal will be ignored in future checks.""" return self.write({'state': 'failed'}) - @api.multi def action_cancel(self): """Reset the completion after setting a goal as reached or failed. @@ -398,7 +392,6 @@ class Goal(models.Model): def create(self, vals): return super(Goal, self.with_context(no_remind_goal=True)).create(vals) - @api.multi def write(self, vals): """Overwrite the write method to update the last_update field to today @@ -417,7 +410,6 @@ class Goal(models.Model): goal.challenge_id.sudo().report_progress(users=goal.user_id) return result - @api.multi def get_action(self): """Get the ir.action related to update the goal diff --git a/addons/gamification/models/res_users.py b/addons/gamification/models/res_users.py index a0ca65ced45..51a29065156 100644 --- a/addons/gamification/models/res_users.py +++ b/addons/gamification/models/res_users.py @@ -25,7 +25,6 @@ class Users(models.Model): for user in self: user.karma_position = 0 - @api.multi @api.depends('badge_ids') def _get_user_badge_level(self): """ Return total badge per level of users @@ -55,14 +54,12 @@ class Users(models.Model): res._recompute_rank() return res - @api.multi def write(self, vals): result = super(Users, self).write(vals) if 'karma' in vals: self._recompute_rank() return result - @api.multi def add_karma(self, karma): for user in self: user.karma += karma diff --git a/addons/gamification/wizard/grant_badge.py b/addons/gamification/wizard/grant_badge.py index 49fc1aeebf1..84b764c5d53 100644 --- a/addons/gamification/wizard/grant_badge.py +++ b/addons/gamification/wizard/grant_badge.py @@ -13,7 +13,6 @@ class grant_badge_wizard(models.TransientModel): badge_id = fields.Many2one("gamification.badge", string='Badge', required=True) comment = fields.Text('Comment') - @api.multi def action_grant_badge(self): """Wizard action for sending a badge to a chosen user""" diff --git a/addons/gamification/wizard/update_goal.py b/addons/gamification/wizard/update_goal.py index dfa8995238e..e9664e05205 100644 --- a/addons/gamification/wizard/update_goal.py +++ b/addons/gamification/wizard/update_goal.py @@ -11,7 +11,6 @@ class goal_manual_wizard(models.TransientModel): goal_id = fields.Many2one("gamification.goal", string='Goal', required=True) current = fields.Float('Current') - @api.multi def action_update_current(self): """Wizard action for updating the current value""" for wiz in self: diff --git a/addons/google_calendar/models/calendar.py b/addons/google_calendar/models/calendar.py index 65a3cfee564..672a85358a5 100644 --- a/addons/google_calendar/models/calendar.py +++ b/addons/google_calendar/models/calendar.py @@ -17,14 +17,12 @@ class Meeting(models.Model): 'attendee_ids', 'alarm_ids', 'location', 'privacy', 'active', 'start_date', 'start_datetime', 'stop_date', 'stop_datetime'] - @api.multi def write(self, values): sync_fields = set(self.get_fields_need_update_google()) if (set(values) and sync_fields) and 'oe_update_date' not in values and 'NewMeeting' not in self._context: values['oe_update_date'] = fields.Datetime.now() return super(Meeting, self).write(values) - @api.multi @api.returns('self', lambda value: value.id) def copy(self, default=None): default = default or {} @@ -36,7 +34,6 @@ class Meeting(models.Model): default['oe_update_date'] = False return super(Meeting, self).copy(default) - @api.multi def unlink(self, can_be_deleted=False): return super(Meeting, self).unlink(can_be_deleted=can_be_deleted) @@ -52,7 +49,6 @@ class Attendee(models.Model): ('google_id_uniq', 'unique(google_internal_event_id,partner_id,event_id)', 'Google ID should be unique!') ] - @api.multi def write(self, values): for attendee in self: meeting_id_to_update = values.get('event_id', attendee.event_id.id) diff --git a/addons/google_drive/models/google_drive.py b/addons/google_drive/models/google_drive.py index c937acaa356..26246870da5 100644 --- a/addons/google_drive/models/google_drive.py +++ b/addons/google_drive/models/google_drive.py @@ -22,7 +22,6 @@ class GoogleDrive(models.Model): _name = 'google.drive.config' _description = "Google Drive templates config" - @api.multi def get_google_drive_url(self, res_id, template_id): self.ensure_one() self = self.sudo() @@ -191,7 +190,6 @@ class GoogleDrive(models.Model): return word.group(2) return None - @api.multi def _compute_ressource_id(self): result = {} for record in self: @@ -202,7 +200,6 @@ class GoogleDrive(models.Model): raise UserError(_("Please enter a valid Google Document URL.")) return result - @api.multi def _compute_client_id(self): google_drive_client_id = self.env['ir.config_parameter'].sudo().get_param('google_drive_client_id') for record in self: diff --git a/addons/google_drive/models/res_config_settings.py b/addons/google_drive/models/res_config_settings.py index 49d7ff7d86d..63dadd0ea66 100644 --- a/addons/google_drive/models/res_config_settings.py +++ b/addons/google_drive/models/res_config_settings.py @@ -23,7 +23,6 @@ class ResConfigSettings(models.TransientModel): res.update(is_google_drive_token_generated=bool(refresh_token)) return res - @api.multi def confirm_setup_token(self): params = self.env['ir.config_parameter'].sudo() authorization_code_before = params.get_param('google_drive_authorization_code') @@ -33,7 +32,6 @@ class ResConfigSettings(models.TransientModel): refresh_token = self.env['google.service'].generate_refresh_token('drive', authorization_code) params.set_param('google_drive_refresh_token', refresh_token) - @api.multi def action_setup_token(self): self.ensure_one() template = self.env.ref('google_drive.google_drive_auth_code_wizard') diff --git a/addons/hr/models/hr_department.py b/addons/hr/models/hr_department.py index 180b3372e46..d754117a408 100644 --- a/addons/hr/models/hr_department.py +++ b/addons/hr/models/hr_department.py @@ -24,7 +24,6 @@ class Department(models.Model): note = fields.Text('Note') color = fields.Integer('Color Index') - @api.multi def name_get(self): if not self.env.context.get('hierarchical_naming', True): return [(record.id, record.name) for record in self] @@ -54,7 +53,6 @@ class Department(models.Model): department.message_subscribe(partner_ids=manager.user_id.partner_id.ids) return department - @api.multi def write(self, vals): """ If updating manager of a department, we need to update all the employees of department hierarchy, and subscribe the new manager. diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index abdb09e996e..1870c53015c 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -128,13 +128,11 @@ class HrEmployeePrivate(models.Model): ('user_uniq', 'unique (user_id, company_id)', "A user cannot be linked to multiple employees in the same company.") ] - @api.multi def name_get(self): if self.check_access_rights('read', raise_exception=False): return super(HrEmployeePrivate, self).name_get() return self.env['hr.employee.public'].browse(self.ids).name_get() - @api.multi def read(self, fields, load='_classic_read'): if self.check_access_rights('read', raise_exception=False): return super(HrEmployeePrivate, self).read(fields, load=load) @@ -163,7 +161,6 @@ class HrEmployeePrivate(models.Model): return super(HrEmployeePrivate, self)._search(args, offset=offset, limit=limit, order=order, count=count, access_rights_uid=access_rights_uid) return self.env['hr.employee.public']._search(args, offset=offset, limit=limit, order=order, count=count, access_rights_uid=access_rights_uid) - @api.multi def get_formview_id(self, access_uid=None): """ Override this method in order to redirect many2one towards the right model depending on access_uid """ if access_uid: @@ -176,7 +173,6 @@ class HrEmployeePrivate(models.Model): # Hardcode the form view for public employee return self.env.ref('hr.hr_employee_public_view_form').id - @api.multi def get_formview_action(self, access_uid=None): """ Override this method in order to redirect many2one towards the right model depending on access_uid """ res = super(HrEmployeePrivate, self).get_formview_action(access_uid=access_uid) @@ -259,7 +255,6 @@ class HrEmployeePrivate(models.Model): ])._subscribe_users() return employee - @api.multi def write(self, vals): if 'address_home_id' in vals: account_id = vals.get('bank_account_id') or self.bank_account_id.id @@ -277,7 +272,6 @@ class HrEmployeePrivate(models.Model): ])._subscribe_users() return res - @api.multi def unlink(self): resources = self.mapped('resource_id') super(HrEmployeePrivate, self).unlink() @@ -301,7 +295,6 @@ class HrEmployeePrivate(models.Model): } return res - @api.multi def generate_random_barcode(self): for employee in self: employee.barcode = "".join(choice(digits) for i in range(8)) @@ -392,7 +385,6 @@ class HrEmployeePrivate(models.Model): def _message_log(self, **kwargs): return super(HrEmployeePrivate, self._post_author())._message_log(**kwargs) - @api.multi @api.returns('mail.message', lambda value: value.id) def message_post(self, *args, **kwargs): return super(HrEmployeePrivate, self._post_author()).message_post(*args, **kwargs) diff --git a/addons/hr/models/hr_job.py b/addons/hr/models/hr_job.py index d181a0b18f0..a10b9fd86b6 100644 --- a/addons/hr/models/hr_job.py +++ b/addons/hr/models/hr_job.py @@ -46,7 +46,6 @@ class Job(models.Model): """ We don't want the current user to be follower of all created job """ return super(Job, self.with_context(mail_create_nosubscribe=True)).create(values) - @api.multi @api.returns('self', lambda value: value.id) def copy(self, default=None): self.ensure_one() @@ -55,14 +54,12 @@ class Job(models.Model): default['name'] = _("%s (copy)") % (self.name) return super(Job, self).copy(default=default) - @api.multi def set_recruit(self): for record in self: no_of_recruitment = 1 if record.no_of_recruitment == 0 else record.no_of_recruitment record.write({'state': 'recruit', 'no_of_recruitment': no_of_recruitment}) return True - @api.multi def set_open(self): return self.write({ 'state': 'open', diff --git a/addons/hr/models/res_partner.py b/addons/hr/models/res_partner.py index 62f7c3f949a..22d315aa68f 100644 --- a/addons/hr/models/res_partner.py +++ b/addons/hr/models/res_partner.py @@ -22,7 +22,6 @@ class Partner(models.Model): except AccessError: return suggestions - @api.multi def name_get(self): """ Override to allow an employee to see its private address in his profile. This avoids to relax access rules on `res.parter` and to add an `ir.rule`. diff --git a/addons/hr/models/res_users.py b/addons/hr/models/res_users.py index c64f678070a..5615a17a6ec 100644 --- a/addons/hr/models/res_users.py +++ b/addons/hr/models/res_users.py @@ -139,7 +139,6 @@ class User(models.Model): self = self.sudo() return super(User, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu) - @api.multi def write(self, vals): """ Synchronize user and its related employee @@ -178,7 +177,6 @@ class User(models.Model): for user in self: user.employee_id = self.env['hr.employee'].search([('id', 'in', user.employee_ids.ids), ('company_id', '=', user.company_id.id)], limit=1) - @api.multi def action_create_employee(self): self.ensure_one() self.env['hr.employee'].create(dict( diff --git a/addons/hr/wizard/hr_plan_wizard.py b/addons/hr/wizard/hr_plan_wizard.py index e6644da9f07..02e05023be1 100644 --- a/addons/hr/wizard/hr_plan_wizard.py +++ b/addons/hr/wizard/hr_plan_wizard.py @@ -19,7 +19,6 @@ class HrPlanWizard(models.TransientModel): plan_id = fields.Many2one('hr.plan', default=lambda self: self.env['hr.plan'].search([], limit=1)) employee_id = fields.Many2one('hr.employee', string='Employee', required=True) - @api.multi def action_launch(self): for activity_type in self.plan_id.plan_activity_type_ids: self.env['mail.activity'].create({ diff --git a/addons/hr_attendance/models/hr_attendance.py b/addons/hr_attendance/models/hr_attendance.py index 6b1550438a2..f24ec171c2a 100644 --- a/addons/hr_attendance/models/hr_attendance.py +++ b/addons/hr_attendance/models/hr_attendance.py @@ -19,7 +19,6 @@ class HrAttendance(models.Model): check_out = fields.Datetime(string="Check Out") worked_hours = fields.Float(string='Worked Hours', compute='_compute_worked_hours', store=True, readonly=True) - @api.multi def name_get(self): result = [] for attendance in self: @@ -97,7 +96,6 @@ class HrAttendance(models.Model): 'datetime': fields.Datetime.to_string(fields.Datetime.context_timestamp(self, fields.Datetime.from_string(last_attendance_before_check_out.check_in))), }) - @api.multi @api.returns('self', lambda value: value.id) def copy(self): raise exceptions.UserError(_('You cannot duplicate an attendance.')) diff --git a/addons/hr_attendance/models/hr_employee.py b/addons/hr_attendance/models/hr_employee.py index fa5d788c210..4af9d0f3442 100644 --- a/addons/hr_attendance/models/hr_employee.py +++ b/addons/hr_attendance/models/hr_employee.py @@ -88,7 +88,6 @@ class HrEmployeeBase(models.AbstractModel): return employee._attendance_action('hr_attendance.hr_attendance_action_kiosk_mode') return {'warning': _('No employee corresponding to barcode %(barcode)s') % {'barcode': barcode}} - @api.multi def attendance_manual(self, next_action, entered_pin=None): self.ensure_one() can_check_without_pin = not self.env.user.has_group('hr_attendance.group_hr_attendance_use_pin') or (self.user_id == self.env.user and entered_pin is None) @@ -96,7 +95,6 @@ class HrEmployeeBase(models.AbstractModel): return self._attendance_action(next_action) return {'warning': _('Wrong PIN')} - @api.multi def _attendance_action(self, next_action): """ Changes the attendance of the employee. Returns an action to the check in/out message, @@ -117,7 +115,6 @@ class HrEmployeeBase(models.AbstractModel): action_message['attendance'] = modified_attendance.read()[0] return {'action': action_message} - @api.multi def _attendance_action_change(self): """ Check In/Check Out action Check In: create a new attendance record diff --git a/addons/hr_contract/models/hr_contract.py b/addons/hr_contract/models/hr_contract.py index 9195bf138d6..b9a54ff2871 100644 --- a/addons/hr_contract/models/hr_contract.py +++ b/addons/hr_contract/models/hr_contract.py @@ -137,7 +137,6 @@ class Contract(models.Model): for contract in self: contract.employee_id.sudo().write({'contract_id': contract.id}) - @api.multi def write(self, vals): res = super(Contract, self).write(vals) if vals.get('state') == 'open': @@ -163,7 +162,6 @@ class Contract(models.Model): contract.employee_id.resource_calendar_id = contract.resource_calendar_id return contracts - @api.multi def _track_subtype(self, init_values): self.ensure_one() if 'state' in init_values and self.state == 'open' and 'kanban_state' in init_values and self.kanban_state == 'blocked': diff --git a/addons/hr_contract/models/resource.py b/addons/hr_contract/models/resource.py index 9382b7e5217..865e8733318 100644 --- a/addons/hr_contract/models/resource.py +++ b/addons/hr_contract/models/resource.py @@ -9,7 +9,6 @@ from odoo.osv.expression import AND class ResourceCalendar(models.Model): _inherit = 'resource.calendar' - @api.multi def transfer_leaves_to(self, other_calendar, resources=None, from_date=None): """ Transfer some resource.calendar.leaves from 'self' to another calendar 'other_calendar'. diff --git a/addons/hr_expense/models/account_journal_dashboard.py b/addons/hr_expense/models/account_journal_dashboard.py index 809d0ac6197..a41198f30f9 100644 --- a/addons/hr_expense/models/account_journal_dashboard.py +++ b/addons/hr_expense/models/account_journal_dashboard.py @@ -20,7 +20,6 @@ class AccountJournal(models.Model): and journal_id = %(journal_id)s""" return (query, {'journal_id': self.id}) - @api.multi def get_journal_dashboard_datas(self): res = super(AccountJournal, self).get_journal_dashboard_datas() #add the number and sum of expenses to pay to the json defining the accounting dashboard data @@ -32,7 +31,6 @@ class AccountJournal(models.Model): res['sum_expenses_to_pay'] = formatLang(self.env, sum_to_pay or 0.0, currency_obj=self.currency_id or self.company_id.currency_id) return res - @api.multi def open_expenses_action(self): [action] = self.env.ref('hr_expense.action_hr_expense_sheet_all_all').read() action['context'] = { diff --git a/addons/hr_expense/models/account_move_line.py b/addons/hr_expense/models/account_move_line.py index 49ddacba873..b920de82957 100644 --- a/addons/hr_expense/models/account_move_line.py +++ b/addons/hr_expense/models/account_move_line.py @@ -10,7 +10,6 @@ class AccountMoveLine(models.Model): expense_id = fields.Many2one('hr.expense', string='Expense', copy=False, help="Expense where the move line come from") - @api.multi def reconcile(self, writeoff_acc_id=False, writeoff_journal_id=False): res = super(AccountMoveLine, self).reconcile(writeoff_acc_id=writeoff_acc_id, writeoff_journal_id=writeoff_journal_id) account_move_ids = [l.move_id.id for l in self if float_compare(l.move_id._get_cash_basis_matched_percentage(), 1, precision_digits=5) == 0] diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index a9ee3194016..d249f35232c 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -112,7 +112,6 @@ class HrExpense(models.Model): expense.company_id, date_expense or fields.Date.today()) expense.total_amount_company = amount - @api.multi def _compute_attachment_number(self): attachment_data = self.env['ir.attachment'].read_group([('res_model', '=', 'hr.expense'), ('res_id', 'in', self.ids)], ['res_id'], ['res_id']) attachment = dict((data['res_id'], data['res_id_count']) for data in attachment_data) @@ -163,14 +162,12 @@ class HrExpense(models.Model): # ORM Overrides # ---------------------------------------- - @api.multi def unlink(self): for expense in self: if expense.state in ['done', 'approved']: raise UserError(_('You cannot delete a posted or approved expense.')) return super(HrExpense, self).unlink() - @api.multi def write(self, vals): if 'tax_ids' in vals or 'analytic_account_id' in vals or 'account_id' in vals: if any(not expense.is_editable for expense in self): @@ -198,7 +195,6 @@ class HrExpense(models.Model): # Actions # ---------------------------------------- - @api.multi def action_view_sheet(self): self.ensure_one() return { @@ -209,7 +205,6 @@ class HrExpense(models.Model): 'res_id': self.sheet_id.id } - @api.multi def action_submit_expenses(self): if any(expense.state != 'draft' or expense.sheet_id for expense in self): raise UserError(_("You cannot report twice the same line!")) @@ -230,7 +225,6 @@ class HrExpense(models.Model): } } - @api.multi def action_get_attachment_view(self): self.ensure_one() res = self.env['ir.actions.act_window'].for_xml_id('base', 'action_attachment') @@ -242,7 +236,6 @@ class HrExpense(models.Model): # Business # ---------------------------------------- - @api.multi def _prepare_move_values(self): """ This function prepares move values related to an expense @@ -261,7 +254,6 @@ class HrExpense(models.Model): } return move_values - @api.multi def _get_account_move_by_sheet(self): """ Return a mapping between the expense sheet of current expense and its account move :returns dict where key is a sheet id, and value is an account move record @@ -277,7 +269,6 @@ class HrExpense(models.Model): move = move_grouped_by_sheet[expense.sheet_id.id] return move_grouped_by_sheet - @api.multi def _get_expense_account_source(self): self.ensure_one() if self.account_id: @@ -293,7 +284,6 @@ class HrExpense(models.Model): raise UserError(_('Please configure Default Expense account for Product expense: `property_account_expense_categ_id`.')) return account - @api.multi def _get_expense_account_destination(self): self.ensure_one() account_dest = self.env['account.account'] @@ -307,7 +297,6 @@ class HrExpense(models.Model): account_dest = self.employee_id.address_home_id.property_account_payable_id.id return account_dest - @api.multi def _get_account_move_line_values(self): move_line_values_by_expense = {} for expense in self: @@ -392,7 +381,6 @@ class HrExpense(models.Model): move_line_values_by_expense[expense.id] = move_line_values return move_line_values_by_expense - @api.multi def action_move_create(self): ''' main function that is called when trying to create the accounting entries related to an expense @@ -449,7 +437,6 @@ class HrExpense(models.Model): return move_group_by_sheet - @api.multi def refuse_expense(self, reason): self.write({'is_refused': True}) self.sheet_id.write({'state': 'cancel'}) @@ -648,7 +635,6 @@ class HrExpenseSheet(models.Model): for sheet in self: sheet.total_amount = sum(sheet.expense_line_ids.mapped('total_amount_company')) - @api.multi def _compute_attachment_number(self): for sheet in self: sheet.attachment_number = sum(sheet.expense_line_ids.mapped('attachment_number')) @@ -658,7 +644,6 @@ class HrExpenseSheet(models.Model): for sheet in self: sheet.is_multiple_currency = len(sheet.expense_line_ids.mapped('currency_id')) > 1 - @api.multi def _compute_can_reset(self): is_expense_user = self.user_has_groups('hr_expense.group_hr_expense_team_approver') for sheet in self: @@ -670,7 +655,6 @@ class HrExpenseSheet(models.Model): self.department_id = self.employee_id.department_id self.user_id = self.employee_id.expense_manager_id or self.employee_id.parent_id.user_id - @api.multi @api.constrains('expense_line_ids') def _check_payment_mode(self): for sheet in self: @@ -691,7 +675,6 @@ class HrExpenseSheet(models.Model): sheet.activity_update() return sheet - @api.multi def unlink(self): for expense in self: if expense.state in ['post', 'done']: @@ -702,7 +685,6 @@ class HrExpenseSheet(models.Model): # Mail Thread # -------------------------------------------- - @api.multi def _track_subtype(self, init_values): self.ensure_one() if 'state' in init_values and self.state == 'approve': @@ -725,7 +707,6 @@ class HrExpenseSheet(models.Model): # Actions # -------------------------------------------- - @api.multi def action_sheet_move_create(self): if any(sheet.state != 'approve' for sheet in self): raise UserError(_("You can only generate accounting entry for approved expense(s).")) @@ -747,7 +728,6 @@ class HrExpenseSheet(models.Model): self.activity_update() return res - @api.multi def action_get_attachment_view(self): res = self.env['ir.actions.act_window'].for_xml_id('base', 'action_attachment') res['domain'] = [('res_model', '=', 'hr.expense'), ('res_id', 'in', self.expense_line_ids.ids)] @@ -763,16 +743,13 @@ class HrExpenseSheet(models.Model): # Business # -------------------------------------------- - @api.multi def set_to_paid(self): self.write({'state': 'done'}) - @api.multi def action_submit_sheet(self): self.write({'state': 'submit'}) self.activity_update() - @api.multi def approve_expense_sheets(self): if not self.user_has_groups('hr_expense.group_hr_expense_team_approver'): raise UserError(_("Only Managers and HR Officers can approve expenses")) @@ -789,11 +766,9 @@ class HrExpenseSheet(models.Model): self.write({'state': 'approve', 'user_id': responsible_id}) self.activity_update() - @api.multi def paid_expense_sheets(self): self.write({'state': 'done'}) - @api.multi def refuse_sheet(self, reason): if not self.user_has_groups('hr_expense.group_hr_expense_team_approver'): raise UserError(_("Only Managers and HR Officers can approve expenses")) @@ -811,7 +786,6 @@ class HrExpenseSheet(models.Model): sheet.message_post_with_view('hr_expense.hr_expense_template_refuse_reason', values={'reason': reason, 'is_sheet': True, 'name': self.name}) self.activity_update() - @api.multi def reset_expense_sheets(self): if not self.can_reset: raise UserError(_("Only HR Officers or the concerned employee can reset to draft.")) diff --git a/addons/hr_expense/models/res_config_settings.py b/addons/hr_expense/models/res_config_settings.py index 43c4de7ef09..1dfe455cad9 100644 --- a/addons/hr_expense/models/res_config_settings.py +++ b/addons/hr_expense/models/res_config_settings.py @@ -20,7 +20,6 @@ class ResConfigSettings(models.TransientModel): ) return res - @api.multi def set_values(self): super(ResConfigSettings, self).set_values() self.env.ref('hr_expense.mail_alias_expense').write({'alias_name': self.expense_alias_prefix}) diff --git a/addons/hr_expense/wizard/hr_expense_refuse_reason.py b/addons/hr_expense/wizard/hr_expense_refuse_reason.py index 42613a3f058..f457c039cae 100644 --- a/addons/hr_expense/wizard/hr_expense_refuse_reason.py +++ b/addons/hr_expense/wizard/hr_expense_refuse_reason.py @@ -35,7 +35,6 @@ class HrExpenseRefuseWizard(models.TransientModel): }) return res - @api.multi def expense_refuse_reason(self): self.ensure_one() if self.hr_expense_ids: diff --git a/addons/hr_expense/wizard/hr_expense_sheet_register_payment.py b/addons/hr_expense/wizard/hr_expense_sheet_register_payment.py index eaf0b8f7ac5..f8fbe16ab22 100644 --- a/addons/hr_expense/wizard/hr_expense_sheet_register_payment.py +++ b/addons/hr_expense/wizard/hr_expense_sheet_register_payment.py @@ -92,7 +92,6 @@ class HrExpenseSheetRegisterPaymentWizard(models.TransientModel): 'communication': self.communication } - @api.multi def expense_post_payment(self): self.ensure_one() context = dict(self._context or {}) diff --git a/addons/hr_gamification/models/gamification.py b/addons/hr_gamification/models/gamification.py index 13423a6b7fe..6f9dba1777f 100644 --- a/addons/hr_gamification/models/gamification.py +++ b/addons/hr_gamification/models/gamification.py @@ -31,7 +31,6 @@ class GamificationBadge(models.Model): ('employee_id', '!=', False) ]) - @api.multi def get_granted_employees(self): employee_ids = self.mapped('owner_ids.employee_id').ids return { diff --git a/addons/hr_gamification/wizard/gamification_badge_user_wizard.py b/addons/hr_gamification/wizard/gamification_badge_user_wizard.py index 7c4c174129f..6bb1370be80 100644 --- a/addons/hr_gamification/wizard/gamification_badge_user_wizard.py +++ b/addons/hr_gamification/wizard/gamification_badge_user_wizard.py @@ -12,7 +12,6 @@ class GamificationBadgeUserWizard(models.TransientModel): user_id = fields.Many2one('res.users', string='User', related='employee_id.user_id', store=False, readonly=True, compute_sudo=True) - @api.multi def action_grant_badge(self): """Wizard action for sending a badge to a chosen employee""" if not self.user_id: diff --git a/addons/hr_holidays/models/hr_department.py b/addons/hr_holidays/models/hr_department.py index 44675d836ba..d076113ec55 100644 --- a/addons/hr_holidays/models/hr_department.py +++ b/addons/hr_holidays/models/hr_department.py @@ -20,7 +20,6 @@ class Department(models.Model): total_employee = fields.Integer( compute='_compute_total_employee', string='Total Employee') - @api.multi def _compute_leave_count(self): Requests = self.env['hr.leave'] Allocations = self.env['hr.leave.allocation'] @@ -50,7 +49,6 @@ class Department(models.Model): department.allocation_to_approve_count = res_allocation.get(department.id, 0) department.absence_of_today = res_absence.get(department.id, 0) - @api.multi def _compute_total_employee(self): emp_data = self.env['hr.employee'].read_group([('department_id', 'in', self.ids)], ['department_id'], ['department_id']) result = dict((data['department_id'][0], data['department_id_count']) for data in emp_data) diff --git a/addons/hr_holidays/models/hr_employee.py b/addons/hr_holidays/models/hr_employee.py index a79ad7eb307..a10b3349d23 100644 --- a/addons/hr_holidays/models/hr_employee.py +++ b/addons/hr_holidays/models/hr_employee.py @@ -69,7 +69,6 @@ class HrEmployeeBase(models.AbstractModel): GROUP BY h.employee_id""", (tuple(self.ids),)) return dict((row['employee_id'], row['days']) for row in self._cr.dictfetchall()) - @api.multi def _compute_remaining_leaves(self): remaining = self._get_remaining_leaves() for employee in self: @@ -77,7 +76,6 @@ class HrEmployeeBase(models.AbstractModel): employee.leaves_count = value employee.remaining_leaves = value - @api.multi def _compute_allocation_count(self): for employee in self: allocations = self.env['hr.leave.allocation'].search([ @@ -98,7 +96,6 @@ class HrEmployeeBase(models.AbstractModel): employees = self.filtered(lambda employee: employee.hr_presence_state != 'present' and employee.is_absent) employees.update({'hr_presence_state': 'absent'}) - @api.multi def _compute_leave_status(self): # Used SUPERUSER_ID to forcefully get status of other user's leave, to bypass record rule holidays = self.env['hr.leave'].sudo().search([ @@ -130,7 +127,6 @@ class HrEmployeeBase(models.AbstractModel): if manager and manager.has_group('hr.group_hr_user') and (self.leave_manager_id == previous_manager or not self.leave_manager_id): self.leave_manager_id = manager - @api.multi def _compute_show_leaves(self): show_leaves = self.env['res.users'].has_group('hr_holidays.group_hr_holidays_user') for employee in self: @@ -139,7 +135,6 @@ class HrEmployeeBase(models.AbstractModel): else: employee.show_leaves = False - @api.multi def _search_absent_employee(self, operator, value): holidays = self.env['hr.leave'].sudo().search([ ('employee_id', '!=', False), diff --git a/addons/hr_holidays/models/hr_leave.py b/addons/hr_holidays/models/hr_leave.py index 8deda82c3f4..05b172894f0 100644 --- a/addons/hr_holidays/models/hr_leave.py +++ b/addons/hr_holidays/models/hr_leave.py @@ -383,7 +383,6 @@ class HolidaysRequest(models.Model): self.mode_company_id = False self.department_id = False - @api.multi def _sync_employee_details(self): for holiday in self: holiday.manager_id = holiday.employee_id.parent_id.id @@ -402,7 +401,6 @@ class HolidaysRequest(models.Model): else: self.number_of_days = 0 - @api.multi @api.depends('number_of_days') def _compute_number_of_days_display(self): for holiday in self: @@ -412,7 +410,6 @@ class HolidaysRequest(models.Model): self.ensure_one() return self.employee_id.resource_calendar_id or self.env.company.resource_calendar_id - @api.multi @api.depends('number_of_days') def _compute_number_of_hours_display(self): for holiday in self: @@ -423,7 +420,6 @@ class HolidaysRequest(models.Model): else: holiday.number_of_hours_display = 0 - @api.multi @api.depends('number_of_hours_display', 'number_of_days_display') def _compute_duration_display(self): for leave in self: @@ -433,7 +429,6 @@ class HolidaysRequest(models.Model): else float_round(leave.number_of_days_display, precision_digits=2)), _('hours') if leave.leave_type_request_unit == 'hour' else _('days')) - @api.multi @api.depends('state', 'employee_id', 'department_id') def _compute_can_reset(self): for holiday in self: @@ -501,7 +496,6 @@ class HolidaysRequest(models.Model): # ORM Overrides methods #################################################### - @api.multi def name_get(self): res = [] for leave in self: @@ -533,13 +527,11 @@ class HolidaysRequest(models.Model): ) return res - @api.multi def add_follower(self, employee_id): employee = self.env['hr.employee'].browse(employee_id) if employee.user_id: self.message_subscribe(partner_ids=employee.user_id.partner_id.ids) - @api.multi @api.constrains('holiday_status_id', 'date_to', 'date_from') def _check_leave_type_validity(self): for leave in self: @@ -609,7 +601,6 @@ class HolidaysRequest(models.Model): # skip SpecialValue (e.g. for missing record or access right) pass - @api.multi def write(self, values): # Allow an employee to always write his own out of office message if len(self) == 1 and values.keys() == {'out_of_office_message'} and self.employee_id.user_id == self.env.user: @@ -628,13 +619,11 @@ class HolidaysRequest(models.Model): holiday._onchange_leave_dates() return result - @api.multi def unlink(self): for holiday in self.filtered(lambda holiday: holiday.state not in ['draft', 'cancel', 'confirm']): raise UserError(_('You cannot delete a time off which is in %s state.') % (holiday.state,)) return super(HolidaysRequest, self).unlink() - @api.multi def copy_data(self, default=None): raise UserError(_('A leave cannot be duplicated.')) @@ -645,7 +634,6 @@ class HolidaysRequest(models.Model): # Business methods #################################################### - @api.multi def _create_resource_leave(self): """ This method will create entry in resource calendar time off object at the time of holidays validated :returns: created `resource.calendar.leaves` @@ -666,7 +654,6 @@ class HolidaysRequest(models.Model): }) return self.env['resource.calendar.leaves'].create(vals_list) - @api.multi def _remove_resource_leave(self): """ This method will create entry in resource calendar time off object at the time of holidays cancel/removed """ return self.env['resource.calendar.leaves'].search([('holiday_id', 'in', self.ids)]).unlink() @@ -681,7 +668,6 @@ class HolidaysRequest(models.Model): meeting = self.env['calendar.event'].with_context(no_mail_to_attendees=True).create(meeting_values) holiday.write({'meeting_id': meeting.id}) - @api.multi def _prepare_holidays_meeting_values(self): self.ensure_one() calendar = self.employee_id.resource_calendar_id or self.env.company.resource_calendar_id @@ -703,7 +689,6 @@ class HolidaysRequest(models.Model): (4, self.user_id.partner_id.id)] return meeting_values - @api.multi def _prepare_holiday_values(self, employee): self.ensure_one() values = { @@ -721,7 +706,6 @@ class HolidaysRequest(models.Model): } return values - @api.multi def action_draft(self): for holiday in self: if holiday.state not in ['confirm', 'refuse']: @@ -738,7 +722,6 @@ class HolidaysRequest(models.Model): self.activity_update() return True - @api.multi def action_confirm(self): if self.filtered(lambda holiday: holiday.state != 'draft'): raise UserError(_('Time off request must be in Draft state ("To Submit") in order to confirm it.')) @@ -746,7 +729,6 @@ class HolidaysRequest(models.Model): self.activity_update() return True - @api.multi def action_approve(self): # if validation_type == 'both': this method is the first approval approval # if validation_type != 'both': this method calls action_validate() below @@ -760,7 +742,6 @@ class HolidaysRequest(models.Model): self.activity_update() return True - @api.multi def action_validate(self): current_employee = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1) if any(holiday.state not in ['confirm', 'validate1'] for holiday in self): @@ -799,7 +780,6 @@ class HolidaysRequest(models.Model): employee_requests.filtered(lambda holiday: holiday.validation_type != 'no_validation').activity_update() return True - @api.multi def action_refuse(self): current_employee = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1) for holiday in self: @@ -912,14 +892,12 @@ class HolidaysRequest(models.Model): # Messaging methods #################################################### - @api.multi def _track_subtype(self, init_values): if 'state' in init_values and self.state == 'validate': leave_notif_subtype = self.holiday_status_id.leave_notif_subtype_id return leave_notif_subtype or self.env.ref('hr_holidays.mt_leave') return super(HolidaysRequest, self)._track_subtype(init_values) - @api.multi def _notify_get_groups(self): """ Handle HR users and officers recipients that can validate or refuse holidays directly from email. """ @@ -942,7 +920,6 @@ class HolidaysRequest(models.Model): return [new_group] + groups - @api.multi def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None): # due to record rule can not allow to add follower and mention on validated leave so subscribe through sudo if self.state in ['validate', 'validate1']: diff --git a/addons/hr_holidays/models/hr_leave_allocation.py b/addons/hr_holidays/models/hr_leave_allocation.py index 6b87fb8c8f6..a5f4f32c646 100644 --- a/addons/hr_holidays/models/hr_leave_allocation.py +++ b/addons/hr_holidays/models/hr_leave_allocation.py @@ -200,7 +200,6 @@ class HolidaysAllocation(models.Model): holiday.write(values) - @api.multi @api.depends('employee_id', 'holiday_status_id') def _compute_leaves(self): for allocation in self: @@ -208,13 +207,11 @@ class HolidaysAllocation(models.Model): allocation.max_leaves = leave_type.max_leaves allocation.leaves_taken = leave_type.leaves_taken - @api.multi @api.depends('number_of_days') def _compute_number_of_days_display(self): for allocation in self: allocation.number_of_days_display = allocation.number_of_days - @api.multi @api.depends('number_of_days', 'employee_id') def _compute_number_of_hours_display(self): for allocation in self: @@ -223,7 +220,6 @@ class HolidaysAllocation(models.Model): else: allocation.number_of_hours_display = allocation.number_of_days * (allocation.employee_id.resource_calendar_id.hours_per_day or HOURS_PER_DAY) - @api.multi @api.depends('number_of_hours_display', 'number_of_days_display') def _compute_duration_display(self): for allocation in self: @@ -233,7 +229,6 @@ class HolidaysAllocation(models.Model): else float_round(allocation.number_of_days_display, precision_digits=2)), _('hours') if allocation.type_request_unit == 'hour' else _('days')) - @api.multi @api.depends('state', 'employee_id', 'department_id') def _compute_can_reset(self): for allocation in self: @@ -257,13 +252,11 @@ class HolidaysAllocation(models.Model): else: allocation.can_approve = True - @api.multi @api.onchange('number_of_hours_display') def _onchange_number_of_hours_display(self): for allocation in self: allocation.number_of_days = allocation.number_of_hours_display / (allocation.employee_id.resource_calendar_id.hours_per_day or HOURS_PER_DAY) - @api.multi @api.onchange('number_of_days_display') def _onchange_number_of_days_display(self): for allocation in self: @@ -322,7 +315,6 @@ class HolidaysAllocation(models.Model): # ORM Overrides methods #################################################### - @api.multi def name_get(self): res = [] for allocation in self: @@ -345,13 +337,11 @@ class HolidaysAllocation(models.Model): ) return res - @api.multi def add_follower(self, employee_id): employee = self.env['hr.employee'].browse(employee_id) if employee.user_id: self.message_subscribe(partner_ids=employee.user_id.partner_id.ids) - @api.multi @api.constrains('holiday_status_id') def _check_leave_type_validity(self): for allocation in self: @@ -381,7 +371,6 @@ class HolidaysAllocation(models.Model): holiday.activity_update() return holiday - @api.multi def write(self, values): employee_id = values.get('employee_id', False) if values.get('state'): @@ -392,13 +381,11 @@ class HolidaysAllocation(models.Model): self._onchange_employee() return result - @api.multi def unlink(self): for holiday in self.filtered(lambda holiday: holiday.state not in ['draft', 'cancel', 'confirm']): raise UserError(_('You cannot delete a time off which is in %s state.') % (holiday.state,)) return super(HolidaysAllocation, self).unlink() - @api.multi def copy_data(self, default=None): raise UserError(_('A time off cannot be duplicated.')) @@ -409,7 +396,6 @@ class HolidaysAllocation(models.Model): # Business methods #################################################### - @api.multi def _prepare_holiday_values(self, employee): self.ensure_one() values = { @@ -429,7 +415,6 @@ class HolidaysAllocation(models.Model): } return values - @api.multi def action_draft(self): for holiday in self: if holiday.state not in ['confirm', 'refuse']: @@ -446,7 +431,6 @@ class HolidaysAllocation(models.Model): self.activity_update() return True - @api.multi def action_confirm(self): if self.filtered(lambda holiday: holiday.state != 'draft'): raise UserError(_('Time off request must be in Draft state ("To Submit") in order to confirm it.')) @@ -454,7 +438,6 @@ class HolidaysAllocation(models.Model): self.activity_update() return res - @api.multi def action_approve(self): # if validation_type == 'both': this method is the first approval approval # if validation_type != 'both': this method calls action_validate() below @@ -468,7 +451,6 @@ class HolidaysAllocation(models.Model): self.activity_update() return True - @api.multi def action_validate(self): current_employee = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1) for holiday in self: @@ -506,7 +488,6 @@ class HolidaysAllocation(models.Model): childs.action_validate() return childs - @api.multi def action_refuse(self): current_employee = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1) for holiday in self: @@ -608,14 +589,12 @@ class HolidaysAllocation(models.Model): # Messaging methods #################################################### - @api.multi def _track_subtype(self, init_values): if 'state' in init_values and self.state == 'validate': allocation_notif_subtype_id = self.holiday_status_id.allocation_notif_subtype_id return allocation_notif_subtype_id or self.env.ref('hr_holidays.mt_leave_allocation') return super(HolidaysAllocation, self)._track_subtype(init_values) - @api.multi def _notify_get_groups(self): """ Handle HR users and officers recipients that can validate or refuse holidays directly from email. """ @@ -638,7 +617,6 @@ class HolidaysAllocation(models.Model): return [new_group] + groups - @api.multi def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None): # due to record rule can not allow to add follower and mention on validated leave so subscribe through sudo if self.state in ['validate', 'validate1']: diff --git a/addons/hr_holidays/models/hr_leave_type.py b/addons/hr_holidays/models/hr_leave_type.py index f12be3ebee5..ac890454a9e 100644 --- a/addons/hr_holidays/models/hr_leave_type.py +++ b/addons/hr_holidays/models/hr_leave_type.py @@ -92,7 +92,6 @@ class HolidaysType(models.Model): leave_notif_subtype_id = fields.Many2one('mail.message.subtype', string='Time Off Notification Subtype', default=lambda self: self.env.ref('hr_holidays.mt_leave', raise_if_not_found=False)) allocation_notif_subtype_id = fields.Many2one('mail.message.subtype', string='Allocation Notification Subtype', default=lambda self: self.env.ref('hr_holidays.mt_leave_allocation', raise_if_not_found=False)) - @api.multi @api.constrains('validity_start', 'validity_stop') def _check_validity_dates(self): for leave_type in self: @@ -100,7 +99,6 @@ class HolidaysType(models.Model): leave_type.validity_start > leave_type.validity_stop: raise ValidationError(_("End of validity period should be greater than start of validity period")) - @api.multi @api.depends('validity_start', 'validity_stop') def _compute_valid(self): dt = self._context.get('default_date_from') or fields.Date.context_today(self) @@ -151,7 +149,6 @@ class HolidaysType(models.Model): return [('id', 'in', valid_leave)] - @api.multi def get_days(self, employee_id): # need to use `dict` constructor to create a dict per id result = dict((id, dict(max_leaves=0, leaves_taken=0, remaining_leaves=0, virtual_remaining_leaves=0)) for id in self.ids) @@ -221,7 +218,6 @@ class HolidaysType(models.Model): employee_id = self.env['hr.employee'].search([('user_id', '=', self.env.user.id), ('company_id', '=', self.env.company.id)], limit=1).id return employee_id - @api.multi def _compute_leaves(self): data_days = {} employee_id = self._get_contextual_employee_id() @@ -236,7 +232,6 @@ class HolidaysType(models.Model): holiday_status.remaining_leaves = result.get('remaining_leaves', 0) holiday_status.virtual_remaining_leaves = result.get('virtual_remaining_leaves', 0) - @api.multi def _compute_group_days_allocation(self): domain = [ ('holiday_status_id', 'in', self.ids), @@ -257,7 +252,6 @@ class HolidaysType(models.Model): for allocation in self: allocation.group_days_allocation = grouped_dict.get(allocation.id, 0) - @api.multi def _compute_group_days_leave(self): grouped_res = self.env['hr.leave'].read_group( [('holiday_status_id', 'in', self.ids), ('holiday_type', '=', 'employee'), ('state', '=', 'validate'), @@ -269,7 +263,6 @@ class HolidaysType(models.Model): for allocation in self: allocation.group_days_leave = grouped_dict.get(allocation.id, 0) - @api.multi def name_get(self): if not self._context.get('employee_id'): # leave counts is based on employee_id, would be inaccurate if not based on correct employee @@ -309,7 +302,6 @@ class HolidaysType(models.Model): return leaves.sorted(key=sort_key, reverse=True).ids return leave_ids - @api.multi def action_see_days_allocated(self): self.ensure_one() action = self.env.ref('hr_holidays.hr_leave_allocation_action_all').read()[0] @@ -329,7 +321,6 @@ class HolidaysType(models.Model): } return action - @api.multi def action_see_group_leaves(self): self.ensure_one() action = self.env.ref('hr_holidays.hr_leave_action_all').read()[0] diff --git a/addons/hr_holidays/models/mail_channel.py b/addons/hr_holidays/models/mail_channel.py index 3d5992dd856..8342aeb54eb 100644 --- a/addons/hr_holidays/models/mail_channel.py +++ b/addons/hr_holidays/models/mail_channel.py @@ -7,7 +7,6 @@ from odoo import api, fields, models class Channel(models.Model): _inherit = 'mail.channel' - @api.multi def partner_info(self, all_partners, direct_partners): partner_infos = super(Channel, self).partner_info(all_partners, direct_partners) # only search for leave out_of_office_message if im_status is on leave diff --git a/addons/hr_holidays/models/mail_message_subtype.py b/addons/hr_holidays/models/mail_message_subtype.py index 78d0c394ad5..f650ec1a898 100644 --- a/addons/hr_holidays/models/mail_message_subtype.py +++ b/addons/hr_holidays/models/mail_message_subtype.py @@ -41,7 +41,6 @@ class MailMessageSubtype(models.Model): result._update_department_subtype() return result - @api.multi def write(self, vals): result = super(MailMessageSubtype, self).write(vals) self.filtered( diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department.py b/addons/hr_holidays/wizard/hr_holidays_summary_department.py index 3a6777cbfe1..995e9926a18 100644 --- a/addons/hr_holidays/wizard/hr_holidays_summary_department.py +++ b/addons/hr_holidays/wizard/hr_holidays_summary_department.py @@ -19,7 +19,6 @@ class HolidaysSummaryDept(models.TransientModel): ('both', 'Both Approved and Confirmed') ], string='Time Off Type', required=True, default='Approved') - @api.multi def print_report(self): self.ensure_one() [data] = self.read() diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_employees.py b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py index b0ec45a585e..fccc926996d 100644 --- a/addons/hr_holidays/wizard/hr_holidays_summary_employees.py +++ b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py @@ -18,7 +18,6 @@ class HolidaysSummaryEmployee(models.TransientModel): ('both', 'Both Approved and Confirmed') ], string='Select Time Off Type', required=True, default='Approved') - @api.multi def print_report(self): self.ensure_one() [data] = self.read() diff --git a/addons/hr_maintenance/models/equipment.py b/addons/hr_maintenance/models/equipment.py index 343a10c92f2..a9dce11960e 100644 --- a/addons/hr_maintenance/models/equipment.py +++ b/addons/hr_maintenance/models/equipment.py @@ -45,7 +45,6 @@ class MaintenanceEquipment(models.Model): equipment.message_subscribe(partner_ids=partner_ids) return equipment - @api.multi def write(self, vals): partner_ids = [] # subscribe employee or department manager when equipment assign to employee or department. @@ -61,7 +60,6 @@ class MaintenanceEquipment(models.Model): self.message_subscribe(partner_ids=partner_ids) return super(MaintenanceEquipment, self).write(vals) - @api.multi def _track_subtype(self, init_values): self.ensure_one() if ('employee_id' in init_values and self.employee_id) or ('department_id' in init_values and self.department_id): @@ -109,7 +107,6 @@ class MaintenanceRequest(models.Model): result.message_subscribe(partner_ids=[result.employee_id.user_id.partner_id.id]) return result - @api.multi def write(self, vals): if vals.get('employee_id'): employee = self.env['hr.employee'].browse(vals['employee_id']) diff --git a/addons/hr_recruitment/models/hr_department.py b/addons/hr_recruitment/models/hr_department.py index 020284c3f3b..66db1ca30b3 100644 --- a/addons/hr_recruitment/models/hr_department.py +++ b/addons/hr_recruitment/models/hr_department.py @@ -13,7 +13,6 @@ class HrDepartment(models.Model): expected_employee = fields.Integer( compute='_compute_recruitment_stats', string='Expected Employee') - @api.multi def _compute_new_applicant_count(self): applicant_data = self.env['hr.applicant'].read_group( [('department_id', 'in', self.ids), ('stage_id.sequence', '<=', '1')], @@ -22,7 +21,6 @@ class HrDepartment(models.Model): for department in self: department.new_applicant_count = result.get(department.id, 0) - @api.multi def _compute_recruitment_stats(self): job_data = self.env['hr.job'].read_group( [('department_id', 'in', self.ids)], diff --git a/addons/hr_recruitment/models/hr_employee.py b/addons/hr_recruitment/models/hr_employee.py index 73104b1a31f..e1b58cf9705 100644 --- a/addons/hr_recruitment/models/hr_employee.py +++ b/addons/hr_recruitment/models/hr_employee.py @@ -9,7 +9,6 @@ class HrEmployee(models.Model): newly_hired_employee = fields.Boolean('Newly hired employee', compute='_compute_newly_hired_employee', search='_search_newly_hired_employee') - @api.multi def _compute_newly_hired_employee(self): read_group_result = self.env['hr.applicant'].read_group( [('emp_id', 'in', self.ids), ('job_id.state', '=', 'recruit')], diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py index b72e362c5b0..9cfe5427e8f 100644 --- a/addons/hr_recruitment/models/hr_job.py +++ b/addons/hr_recruitment/models/hr_job.py @@ -71,7 +71,6 @@ class Job(models.Model): job.document_ids = result[job.id] job.documents_count = len(job.document_ids) - @api.multi def _compute_application_count(self): read_group_result = self.env['hr.applicant'].read_group([('job_id', 'in', self.ids)], ['job_id'], ['job_id']) result = dict((data['job_id'][0], data['job_id_count']) for data in read_group_result) @@ -111,11 +110,9 @@ class Job(models.Model): vals['favorite_user_ids'] = vals.get('favorite_user_ids', []) + [(4, self.env.uid)] return super(Job, self).create(vals) - @api.multi def _creation_subtype(self): return self.env.ref('hr_recruitment.mt_job_new') - @api.multi def action_get_attachment_tree_view(self): action = self.env.ref('base.action_attachment').read()[0] action['context'] = { @@ -126,11 +123,9 @@ class Job(models.Model): action['domain'] = ['|', '&', ('res_model', '=', 'hr.job'), ('res_id', 'in', self.ids), '&', ('res_model', '=', 'hr.applicant'), ('res_id', 'in', self.mapped('application_ids').ids)] return action - @api.multi def close_dialog(self): return {'type': 'ir.actions.act_window_close'} - @api.multi def edit_dialog(self): form_view = self.env.ref('hr.view_hr_job_form') return { diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py index 92cd84ca3cb..cb7c2f7101b 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -24,7 +24,6 @@ class RecruitmentSource(models.Model): job_id = fields.Many2one('hr.job', "Job ID") alias_id = fields.Many2one('mail.alias', "Alias ID") - @api.multi def create_alias(self): campaign = self.env.ref('hr_recruitment.utm_campaign_job') medium = self.env.ref('utm.utm_medium_email') @@ -194,7 +193,6 @@ class Applicant(models.Model): for applicant in self.filtered(lambda applicant: applicant.email_from): applicant.application_count = application_data_mapped.get(applicant.email_from, 1) - 1 - @api.multi def _get_attachment_number(self): read_group_res = self.env['ir.attachment'].read_group( [('res_model', '=', 'hr.applicant'), ('res_id', 'in', self.ids)], @@ -296,7 +294,6 @@ class Applicant(models.Model): vals.update(self._onchange_stage_id_internal(vals.get('stage_id'))['value']) return super(Applicant, self).create(vals) - @api.multi def write(self, vals): # user_id change: update date_open if vals.get('user_id'): @@ -320,14 +317,12 @@ class Applicant(models.Model): empty_list_help_id=self.env.context.get('default_job_id'), empty_list_help_document_name=_("job applicant"))).get_empty_list_help(help) - @api.multi def action_get_created_employee(self): self.ensure_one() action = self.env['ir.actions.act_window'].for_xml_id('hr', 'open_view_employee_list') action['res_id'] = self.mapped('emp_id').ids[0] return action - @api.multi def action_makeMeeting(self): """ This opens Meeting's calendar view to schedule meeting on current applicant @return: Dictionary value for created Meeting view @@ -346,7 +341,6 @@ class Applicant(models.Model): } return res - @api.multi def action_get_attachment_tree_view(self): attachment_action = self.env.ref('base.action_attachment') action = attachment_action.read()[0] @@ -355,7 +349,6 @@ class Applicant(models.Model): action['search_view_id'] = (self.env.ref('hr_recruitment.ir_attachment_view_search_inherit_hr_recruitment').id, ) return action - @api.multi def action_applications_email(self): return { 'type': 'ir.actions.act_window', @@ -365,7 +358,6 @@ class Applicant(models.Model): 'domain': [('email_from', 'in', self.mapped('email_from'))], } - @api.multi def _track_template(self, changes): res = super(Applicant, self)._track_template(changes) applicant = self[0] @@ -377,11 +369,9 @@ class Applicant(models.Model): }) return res - @api.multi def _creation_subtype(self): return self.env.ref('hr_recruitment.mt_applicant_new') - @api.multi def _track_subtype(self, init_values): record = self[0] if 'emp_id' in init_values and record.emp_id and record.emp_id.active: @@ -390,7 +380,6 @@ class Applicant(models.Model): return self.env.ref('hr_recruitment.mt_applicant_stage_changed') return super(Applicant, self)._track_subtype(init_values) - @api.multi def _notify_get_reply_to(self, default=None, records=None, company=None, doc_names=None): """ Override to set alias of applicants to their job definition if any. """ aliases = self.mapped('job_id')._notify_get_reply_to(default=default, records=None, company=company, doc_names=None) @@ -400,7 +389,6 @@ class Applicant(models.Model): res.update(super(Applicant, leftover)._notify_get_reply_to(default=default, records=None, company=company, doc_names=doc_names)) return res - @api.multi def _message_get_suggested_recipients(self): recipients = super(Applicant, self)._message_get_suggested_recipients() for applicant in self: @@ -450,7 +438,6 @@ class Applicant(models.Model): ('stage_id.fold', '=', False)]).write({'partner_id': new_partner.id}) return super(Applicant, self)._message_post_after_hook(message, msg_vals) - @api.multi def create_employee_from_applicant(self): """ Create an hr.employee from the hr.applicants """ employee = False @@ -495,11 +482,9 @@ class Applicant(models.Model): dict_act_window['res_id'] = employee.id return dict_act_window - @api.multi def archive_applicant(self): self.write({'active': False}) - @api.multi def reset_applicant(self): """ Reinsert the applicant into the recruitment pipe in the first stage""" default_stage_id = self._default_stage_id() diff --git a/addons/hr_recruitment_survey/models/hr_applicant.py b/addons/hr_recruitment_survey/models/hr_applicant.py index bd784622dc1..22d1fd7030e 100644 --- a/addons/hr_recruitment_survey/models/hr_applicant.py +++ b/addons/hr_recruitment_survey/models/hr_applicant.py @@ -9,7 +9,6 @@ class Applicant(models.Model): survey_id = fields.Many2one('survey.survey', related='job_id.survey_id', string="Survey", readonly=True) response_id = fields.Many2one('survey.user_input', "Response", ondelete="set null", oldname="response") - @api.multi def action_start_survey(self): self.ensure_one() # create a response and link it to this applicant @@ -21,7 +20,6 @@ class Applicant(models.Model): # grab the token of the response and start surveying return self.survey_id.with_context(survey_token=response.token).action_start_survey() - @api.multi def action_print_survey(self): """ If response is available then print this response otherwise print survey form (print template of the survey) """ self.ensure_one() diff --git a/addons/hr_recruitment_survey/models/hr_job.py b/addons/hr_recruitment_survey/models/hr_job.py index eb24574e55a..72550f53e19 100644 --- a/addons/hr_recruitment_survey/models/hr_job.py +++ b/addons/hr_recruitment_survey/models/hr_job.py @@ -11,6 +11,5 @@ class Job(models.Model): domain=[('category', '=', 'hr_recruitment')], help="Choose an interview form for this job position and you will be able to print/answer this interview from all applicants who apply for this job") - @api.multi def action_print_survey(self): return self.survey_id.action_print_survey() diff --git a/addons/hr_timesheet/models/hr_timesheet.py b/addons/hr_timesheet/models/hr_timesheet.py index 1fcfc4a70d0..1e13fd00d4d 100644 --- a/addons/hr_timesheet/models/hr_timesheet.py +++ b/addons/hr_timesheet/models/hr_timesheet.py @@ -79,7 +79,6 @@ class AccountAnalyticLine(models.Model): result._timesheet_postprocess(values) return result - @api.multi def write(self, values): values = self._timesheet_preprocess(values) result = super(AccountAnalyticLine, self).write(values) @@ -148,7 +147,6 @@ class AccountAnalyticLine(models.Model): vals['product_uom_id'] = analytic_account.company_id.project_time_mode_id.id return vals - @api.multi def _timesheet_postprocess(self, values): """ Hook to update record one by one according to the values of a `write` or a `create`. """ sudo_self = self.sudo() # this creates only one env for all operation that required sudo() in `_timesheet_postprocess_values`override @@ -158,7 +156,6 @@ class AccountAnalyticLine(models.Model): timesheet.write(values_to_write[timesheet.id]) return values - @api.multi def _timesheet_postprocess_values(self, values): """ Get the addionnal values to write on record :param dict values: values for the model's fields, as a dictionary:: diff --git a/addons/hr_timesheet/models/project.py b/addons/hr_timesheet/models/project.py index 8c6d21eab92..430d9434f42 100644 --- a/addons/hr_timesheet/models/project.py +++ b/addons/hr_timesheet/models/project.py @@ -48,7 +48,6 @@ class Project(models.Model): values['analytic_account_id'] = analytic_account.id return super(Project, self).create(values) - @api.multi def write(self, values): # create the AA for project still allowing timesheet if values.get('allow_timesheets'): @@ -115,7 +114,6 @@ class Task(models.Model): # ORM # --------------------------------------------------------- - @api.multi def write(self, values): # a timesheet must have an analytic account (and a project) if 'project_id' in values and self and not values.get('project_id'): diff --git a/addons/hr_work_entry/models/hr_work_entry.py b/addons/hr_work_entry/models/hr_work_entry.py index daf793d3732..845c353f552 100644 --- a/addons/hr_work_entry/models/hr_work_entry.py +++ b/addons/hr_work_entry/models/hr_work_entry.py @@ -61,7 +61,6 @@ class HrWorkEntry(models.Model): dt = date_stop - date_start return dt.days * 24 + dt.seconds / 3600 # Number of hours - @api.multi def action_validate(self): """ Try to validate work entries. @@ -75,7 +74,6 @@ class HrWorkEntry(models.Model): return True return False - @api.multi def _check_if_error(self): if not self: return False @@ -143,7 +141,6 @@ class HrWorkEntry(models.Model): with self._error_checking(skip=skip_check): return super(HrWorkEntry, self).write(vals) - @api.multi def unlink(self): with self._error_checking(): return super().unlink() diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py index f0f8ca0e9d7..920ad6ecb90 100644 --- a/addons/im_livechat/models/im_livechat_channel.py +++ b/addons/im_livechat/models/im_livechat_channel.py @@ -63,7 +63,6 @@ class ImLivechatChannel(models.Model): for channel in self: channel.are_you_inside = bool(self.env.uid in [u.id for u in channel.user_ids]) - @api.multi def _compute_script_external(self): view = self.env['ir.model.data'].get_object('im_livechat', 'external_loader') values = { @@ -74,13 +73,11 @@ class ImLivechatChannel(models.Model): values["channel_id"] = record.id record.script_external = view.render(values) - @api.multi def _compute_web_page_link(self): base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') for record in self: record.web_page = "%s/im_livechat/support/%i" % (base_url, record.id) - @api.multi @api.depends('channel_ids') def _compute_nbr_channel(self): for record in self: @@ -91,7 +88,6 @@ class ImLivechatChannel(models.Model): tools.image_resize_images(vals) return super(ImLivechatChannel, self).create(vals) - @api.multi def write(self, vals): tools.image_resize_images(vals) return super(ImLivechatChannel, self).write(vals) @@ -99,17 +95,14 @@ class ImLivechatChannel(models.Model): # -------------------------- # Action Methods # -------------------------- - @api.multi def action_join(self): self.ensure_one() return self.write({'user_ids': [(4, self._uid)]}) - @api.multi def action_quit(self): self.ensure_one() return self.write({'user_ids': [(3, self._uid)]}) - @api.multi def action_view_rating(self): """ Action to display the rating relative to the channel, so all rating of the sessions of the current channel @@ -123,7 +116,6 @@ class ImLivechatChannel(models.Model): # -------------------------- # Channel Methods # -------------------------- - @api.multi def _get_available_users(self): """ get available user of a given channel :retuns : return the res.users having their im_status online @@ -131,7 +123,6 @@ class ImLivechatChannel(models.Model): self.ensure_one() return self.user_ids.filtered(lambda user: user.im_status == 'online') - @api.multi def _get_mail_channel(self, anonymous_name, previous_operator_id=None, user_id=None, country_id=None): """ Return a mail.channel given a livechat channel. It creates one with a connected operator, or return false otherwise :param anonymous_name : the name of the anonymous person of the channel diff --git a/addons/im_livechat/models/mail_channel.py b/addons/im_livechat/models/mail_channel.py index 28da41a9a27..7939379ea8c 100644 --- a/addons/im_livechat/models/mail_channel.py +++ b/addons/im_livechat/models/mail_channel.py @@ -40,14 +40,12 @@ class MailChannel(models.Model): _sql_constraints = [('livechat_operator_id', "CHECK((channel_type = 'livechat' and livechat_operator_id is not null) or (channel_type != 'livechat'))", 'Livechat Operator ID is required for a channel of type livechat.')] - @api.multi def _compute_is_chat(self): super(MailChannel, self)._compute_is_chat() for record in self: if record.channel_type == 'livechat': record.is_chat = True - @api.multi def _channel_message_notifications(self, message, message_format=False): """ When a anonymous user create a mail.channel, the operator is not notify (to avoid massive polling when clicking on livechat button). So when the anonymous person is sending its FIRST message, the channel header @@ -68,13 +66,11 @@ class MailChannel(models.Model): notifications = self._channel_channel_notifications(unpinned_channel_partner.mapped('partner_id').ids) + notifications return notifications - @api.multi def channel_fetch_message(self, last_id=False, limit=20): """ Override to add the context of the livechat username.""" channel = self.with_context(im_livechat_use_username=True) if self.channel_type == 'livechat' else self return super(MailChannel, channel).channel_fetch_message(last_id=last_id, limit=limit) - @api.multi def channel_info(self, extra_info=False): """ Extends the channel header by adding the livechat operator and the 'anonymous' profile :rtype : list(dict) diff --git a/addons/im_livechat/models/res_partner.py b/addons/im_livechat/models/res_partner.py index e3f85594151..4359b77206f 100644 --- a/addons/im_livechat/models/res_partner.py +++ b/addons/im_livechat/models/res_partner.py @@ -10,7 +10,6 @@ class Partners(models.Model): """ _inherit = 'res.partner' - @api.multi def name_get(self): if self.env.context.get('im_livechat_use_username'): # process the ones with livechat username diff --git a/addons/l10n_be_invoice_bba/models/account_invoice.py b/addons/l10n_be_invoice_bba/models/account_invoice.py index fc50d09cd5a..036baa3ebce 100644 --- a/addons/l10n_be_invoice_bba/models/account_invoice.py +++ b/addons/l10n_be_invoice_bba/models/account_invoice.py @@ -17,7 +17,6 @@ account.move object: add support for Belgian structured communication class AccountMove(models.Model): _inherit = 'account.move' - @api.multi def _get_reference_be_partner(self): """ This computes the reference based on the belgian national standard “OGM-VCS”. @@ -35,7 +34,6 @@ class AccountMove(models.Model): reference = '+++%s/%s/%s%02d+++' % (bbacomm[:3], bbacomm[3:7], bbacomm[7:], mod) return reference - @api.multi def _get_reference_be_invoice(self): """ This computes the reference based on the belgian national standard “OGM-VCS”. diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py index 1238d18bdd8..62e26b3250e 100644 --- a/addons/l10n_ch/models/account_invoice.py +++ b/addons/l10n_ch/models/account_invoice.py @@ -175,7 +175,6 @@ class AccountMove(models.Model): - associate this bank with a postal reference for the currency used in this invoice\n - fill the 'bank account' field of the invoice with the postal to be used to receive the related payment. A default account will be automatically set for all invoices created after you defined a postal account for your company.""")) - @api.multi def action_invoice_sent(self): # OVERRIDE rslt = super(AccountMove, self).action_invoice_sent() @@ -185,7 +184,6 @@ class AccountMove(models.Model): return rslt - @api.multi @api.returns('mail.message', lambda value: value.id) def message_post(self, **kwargs): if self.env.context.get('l10n_ch_mark_isr_as_sent'): diff --git a/addons/l10n_ch/models/mail_template.py b/addons/l10n_ch/models/mail_template.py index 30918bd4b78..59d7ffba7e4 100644 --- a/addons/l10n_ch/models/mail_template.py +++ b/addons/l10n_ch/models/mail_template.py @@ -9,7 +9,6 @@ from odoo import api, models class MailTemplate(models.Model): _inherit = 'mail.template' - @api.multi def generate_email(self, res_ids, fields=None): """ Method overridden in order to add an attachment containing the ISR to the draft message when opening the 'send by mail' wizard on an invoice. diff --git a/addons/l10n_de/models/datev.py b/addons/l10n_de/models/datev.py index a44ff410110..be1382f3f74 100644 --- a/addons/l10n_de/models/datev.py +++ b/addons/l10n_de/models/datev.py @@ -21,7 +21,6 @@ class AccountTax(models.Model): class AccountMove(models.Model): _inherit = 'account.move' - @api.multi def post(self): # OVERRIDE to check the invoice lines taxes. for invoice in self.filtered(lambda move: move.is_invoice()): diff --git a/addons/l10n_do/models/chart_template.py b/addons/l10n_do/models/chart_template.py index f21dde62ddf..9da77527b4f 100644 --- a/addons/l10n_do/models/chart_template.py +++ b/addons/l10n_do/models/chart_template.py @@ -18,7 +18,6 @@ class AccountChartTemplate(models.Model): ] return super(AccountChartTemplate, self)._get_default_bank_journals_data() - @api.multi def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None): """Create fiscal journals for buys""" res = super(AccountChartTemplate, self)._prepare_all_journals( diff --git a/addons/l10n_eu_service/wizard/wizard.py b/addons/l10n_eu_service/wizard/wizard.py index abcdd56316e..9e2eb76671a 100644 --- a/addons/l10n_eu_service/wizard/wizard.py +++ b/addons/l10n_eu_service/wizard/wizard.py @@ -70,7 +70,6 @@ class l10n_eu_service(models.TransientModel): 'res.country', 'l10n_eu_service_country_rel_todo', default=_default_todo_country_ids, string='EU Customers From', required=True) - @api.multi def generate_eu_service(self): tax_rate = self.env["l10n_eu_service.service_tax_rate"] account_tax = self.env['account.tax'] diff --git a/addons/l10n_fr_certification/models/account.py b/addons/l10n_fr_certification/models/account.py index 91a6e0df1c3..93f57c7b648 100644 --- a/addons/l10n_fr_certification/models/account.py +++ b/addons/l10n_fr_certification/models/account.py @@ -67,7 +67,6 @@ class AccountMove(models.Model): ensure_ascii=True, indent=None, separators=(',',':')) - @api.multi def write(self, vals): has_been_posted = False for move in self: @@ -93,7 +92,6 @@ class AccountMove(models.Model): res |= super(AccountMove, move).write(vals_hashing) return res - @api.multi def button_cancel(self): #by-pass the normal behavior/message that tells people can cancel a posted journal entry #if the journal allows it. @@ -148,7 +146,6 @@ class AccountMove(models.Model): class AccountMoveLine(models.Model): _inherit = "account.move.line" - @api.multi def write(self, vals): # restrict the operation in case we are trying to write a forbidden field if set(vals).intersection(LINE_FIELDS): @@ -166,7 +163,6 @@ class AccountJournal(models.Model): field_string = self._fields['update_posted'].get_description(self.env)['string'] raise UserError(_("According to the French law, you cannot modify a journal in order for its posted data to be updated or deleted. Unauthorized field: %s.") % field_string) - @api.multi def _is_journal_alterable(self): self.ensure_one() critical_domain = [('journal_id', '=', self.id), @@ -177,7 +173,6 @@ class AccountJournal(models.Model): raise UserError(_('It is not permitted to disable the data inalterability in this journal (%s) since journal entries have already been protected.') % (self.name, )) return True - @api.multi def write(self, vals): # restrict the operation in case we are trying to write a forbidden field for journal in self: diff --git a/addons/l10n_fr_certification/models/res_company.py b/addons/l10n_fr_certification/models/res_company.py index f5f962f6fa3..56dabe11355 100644 --- a/addons/l10n_fr_certification/models/res_company.py +++ b/addons/l10n_fr_certification/models/res_company.py @@ -22,7 +22,6 @@ class ResCompany(models.Model): company._create_secure_sequence(sequence_fields) return company - @api.multi def write(self, vals): res = super(ResCompany, self).write(vals) #if country changed to fr, create the securisation sequence diff --git a/addons/l10n_fr_fec/wizard/account_fr_fec.py b/addons/l10n_fr_fec/wizard/account_fr_fec.py index 09665c73540..8adab17adea 100644 --- a/addons/l10n_fr_fec/wizard/account_fr_fec.py +++ b/addons/l10n_fr_fec/wizard/account_fr_fec.py @@ -97,7 +97,6 @@ class AccountFrFec(models.TransientModel): 'siren': company.vat[4:13] if not is_dom_tom else '', } - @api.multi def generate_fec(self): self.ensure_one() # We choose to implement the flat file instead of the XML diff --git a/addons/l10n_fr_pos_cert/models/account_bank_statement.py b/addons/l10n_fr_pos_cert/models/account_bank_statement.py index cded72c1aae..12344e1805a 100644 --- a/addons/l10n_fr_pos_cert/models/account_bank_statement.py +++ b/addons/l10n_fr_pos_cert/models/account_bank_statement.py @@ -8,7 +8,6 @@ from odoo.exceptions import UserError class AccountBankStatement(models.Model): _inherit = 'account.bank.statement' - @api.multi def unlink(self): for statement in self.filtered(lambda s: s.company_id._is_accounting_unalterable() and s.journal_id.journal_user): raise UserError(_('You cannot modify anything on a bank statement (name: %s) that was created by point of sale operations.') % (statement.name,)) @@ -18,7 +17,6 @@ class AccountBankStatement(models.Model): class AccountBankStatementLine(models.Model): _inherit = 'account.bank.statement.line' - @api.multi def unlink(self): for line in self.filtered(lambda s: s.company_id._is_accounting_unalterable() and s.journal_id.journal_user): raise UserError(_('You cannot modify anything on a bank statement line (name: %s) that was created by point of sale operations.') % (line.name,)) diff --git a/addons/l10n_fr_pos_cert/models/pos.py b/addons/l10n_fr_pos_cert/models/pos.py index 6a11fdfac6c..7278b9c9c64 100644 --- a/addons/l10n_fr_pos_cert/models/pos.py +++ b/addons/l10n_fr_pos_cert/models/pos.py @@ -27,7 +27,6 @@ def ctx_tz(record, field): class pos_config(models.Model): _inherit = 'pos.config' - @api.multi def open_ui(self): for config in self.filtered(lambda c: c.company_id._is_accounting_unalterable()): if config.current_session_id: @@ -38,7 +37,6 @@ class pos_config(models.Model): class pos_session(models.Model): _inherit = 'pos.session' - @api.multi def _check_session_timing(self): self.ensure_one() date_today = datetime.utcnow() @@ -47,7 +45,6 @@ class pos_session(models.Model): raise UserError(_("This session has been opened another day. To comply with the French law, you should close sessions on a daily basis. Please close session %s and open a new one.") % self.name) return True - @api.multi def open_frontend_cb(self): for session in self.filtered(lambda s: s.config_id.company_id._is_accounting_unalterable()): session._check_session_timing() @@ -112,7 +109,6 @@ class pos_order(models.Model): ensure_ascii=True, indent=None, separators=(',',':')) - @api.multi def write(self, vals): has_been_posted = False for order in self: @@ -187,7 +183,6 @@ class pos_order(models.Model): class PosOrderLine(models.Model): _inherit = "pos.order.line" - @api.multi def write(self, vals): # restrict the operation in case we are trying to write a forbidden field if set(vals).intersection(LINE_FIELDS): diff --git a/addons/l10n_fr_pos_cert/models/res_company.py b/addons/l10n_fr_pos_cert/models/res_company.py index 0b11d2bec8d..651c5815148 100644 --- a/addons/l10n_fr_pos_cert/models/res_company.py +++ b/addons/l10n_fr_pos_cert/models/res_company.py @@ -17,7 +17,6 @@ class ResCompany(models.Model): company._create_secure_sequence(sequence_fields) return company - @api.multi def write(self, vals): res = super(ResCompany, self).write(vals) #if country changed to fr, create the securisation sequence diff --git a/addons/l10n_fr_sale_closing/models/account_closing.py b/addons/l10n_fr_sale_closing/models/account_closing.py index 4348938dd8f..636cf754750 100644 --- a/addons/l10n_fr_sale_closing/models/account_closing.py +++ b/addons/l10n_fr_sale_closing/models/account_closing.py @@ -133,11 +133,9 @@ class AccountClosing(models.Model): 'date_stop': FieldDateTime.to_string(date_stop), 'name_interval': name_interval} - @api.multi def write(self, vals): raise UserError(_('Sale Closings are not meant to be written or deleted under any circumstances.')) - @api.multi def unlink(self): raise UserError(_('Sale Closings are not meant to be written or deleted under any circumstances.')) diff --git a/addons/l10n_fr_sale_closing/models/res_company.py b/addons/l10n_fr_sale_closing/models/res_company.py index 7e623ff5d3e..a18ec1b8082 100644 --- a/addons/l10n_fr_sale_closing/models/res_company.py +++ b/addons/l10n_fr_sale_closing/models/res_company.py @@ -18,7 +18,6 @@ class ResCompany(models.Model): company._create_secure_sequence(sequence_fields) return company - @api.multi def write(self, vals): res = super(ResCompany, self).write(vals) #if country changed to fr, create the securisation sequence diff --git a/addons/l10n_in/models/chart_template.py b/addons/l10n_in/models/chart_template.py index bd8b66d3b8c..5fe711b4df7 100644 --- a/addons/l10n_in/models/chart_template.py +++ b/addons/l10n_in/models/chart_template.py @@ -7,7 +7,6 @@ from odoo import api, fields, models, _ class AccountChartTemplate(models.Model): _inherit = 'account.chart.template' - @api.multi def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None): res = super(AccountChartTemplate, self)._prepare_all_journals(acc_template_ref, company, journals_dict=journals_dict) if self == self.env.ref('l10n_in.indian_chart_template_standard'): diff --git a/addons/l10n_in_sale/models/sale_order.py b/addons/l10n_in_sale/models/sale_order.py index 4ea92c6f3b5..e6493a1c296 100644 --- a/addons/l10n_in_sale/models/sale_order.py +++ b/addons/l10n_in_sale/models/sale_order.py @@ -10,7 +10,6 @@ class SaleOrder(models.Model): l10n_in_reseller_partner_id = fields.Many2one('res.partner', string='Reseller', domain=[('vat', '!=', False)], states={'posted': [('readonly', True)]}) - @api.multi def _prepare_invoice(self): invoice_vals = super(SaleOrder, self)._prepare_invoice() invoice_vals['l10n_in_reseller_partner_id'] = self.l10n_in_reseller_partner_id.id diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py index 3d46670c05f..bc0dbc4a838 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -47,7 +47,6 @@ class AccountMove(models.Model): l10n_it_einvoice_id = fields.Many2one('ir.attachment', string="Electronic invoice", copy=False) - @api.multi def post(self): # OVERRIDE super(AccountMove, self).post() @@ -134,7 +133,6 @@ class AccountMove(models.Model): if not tax_line.tax_line_id.l10n_it_has_exoneration and tax_line.tax_line_id.amount == 0: raise ValidationError(_("%s has an amount of 0.0, you must indicate the kind of exoneration." % tax_line.name)) - @api.multi def invoice_generate_xml(self): for invoice in self: if invoice.l10n_it_einvoice_id and invoice.l10n_it_send_state not in ['invalid', 'to_send']: @@ -253,7 +251,6 @@ class AccountMove(models.Model): content = self.env.ref('l10n_it_edi.account_invoice_it_FatturaPA_export').render(template_values) return content - @api.multi def send_pec_mail(self): self.ensure_one() allowed_state = ['to_send', 'invalid'] @@ -738,7 +735,6 @@ class ImportInvoiceImportWizard(models.TransientModel): _name = 'account.invoice.import.wizard' _inherit = 'account.invoice.import.wizard' - @api.multi def _create_invoice_from_file(self, attachment): if attachment.mimetype == 'application/xml' and re.search("([A-Z]{2}[A-Za-z0-9]{2,28}_[A-Za-z0-9]{0,5}.(xml.p7m|xml))", attachment.name): if self.env['account.move'].search([('l10n_it_einvoice_name', '=', attachment.name)], limit=1): diff --git a/addons/l10n_it_edi/models/ddt.py b/addons/l10n_it_edi/models/ddt.py index 92d858f222e..426e6a60b7c 100644 --- a/addons/l10n_it_edi/models/ddt.py +++ b/addons/l10n_it_edi/models/ddt.py @@ -11,7 +11,6 @@ class L10nItDdt(models.Model): name = fields.Char(string="Numero DDT", size=20, help="Transport document number", required=True) date = fields.Date(string="Data DDT", help="Transport document date", required=True) - @api.multi def name_get(self): res = [] for ddt in self: diff --git a/addons/l10n_it_edi/models/ir_mail_server.py b/addons/l10n_it_edi/models/ir_mail_server.py index ec2a96b93e4..8af502b2c09 100644 --- a/addons/l10n_it_edi/models/ir_mail_server.py +++ b/addons/l10n_it_edi/models/ir_mail_server.py @@ -37,7 +37,6 @@ class FetchmailServer(models.Model): if record.l10n_it_is_pec and record.type != 'imap': raise ValidationError("PEC mail server must be of type IMAP.") - @api.multi def fetch_mail(self): """ WARNING: meant for cron usage only - will commit() after each email! """ diff --git a/addons/l10n_multilang/models/l10n_multilang.py b/addons/l10n_multilang/models/l10n_multilang.py index 2f6e3731faa..e307f28d5a3 100644 --- a/addons/l10n_multilang/models/l10n_multilang.py +++ b/addons/l10n_multilang/models/l10n_multilang.py @@ -12,7 +12,6 @@ _logger = logging.getLogger(__name__) class AccountChartTemplate(models.Model): _inherit = 'account.chart.template' - @api.multi def process_translations(self, langs, in_field, in_ids, out_ids): """ This method copies translations values of templates into new Accounts/Taxes/Journals for languages selected @@ -46,7 +45,6 @@ class AccountChartTemplate(models.Model): counter += 1 return True - @api.multi def process_coa_translations(self): installed_langs = dict(self.env['res.lang'].get_installed()) company_obj = self.env['res.company'] @@ -72,17 +70,14 @@ class AccountChartTemplate(models.Model): chart_template_id._process_fiscal_pos_translations(company.id, langs, 'name') return True - @api.multi def _process_accounts_translations(self, company_id, langs, field): in_ids, out_ids = self._get_template_from_model(company_id, 'account.account') return self.process_translations(langs, field, in_ids, out_ids) - @api.multi def _process_taxes_translations(self, company_id, langs, field): in_ids, out_ids = self._get_template_from_model(company_id, 'account.tax') return self.process_translations(langs, field, in_ids, out_ids) - @api.multi def _process_fiscal_pos_translations(self, company_id, langs, field): in_ids, out_ids = self._get_template_from_model(company_id, 'account.fiscal.position') return self.process_translations(langs, field, in_ids, out_ids) @@ -121,7 +116,6 @@ class BaseLanguageInstall(models.TransientModel): """ Install Language""" _inherit = "base.language.install" - @api.multi def lang_install(self): self.ensure_one() already_installed = self.env['res.lang'].search_count([('code', '=', self.lang)]) diff --git a/addons/l10n_mx/models/chart_template.py b/addons/l10n_mx/models/chart_template.py index edf8000544e..1e36706ffa5 100644 --- a/addons/l10n_mx/models/chart_template.py +++ b/addons/l10n_mx/models/chart_template.py @@ -22,7 +22,6 @@ class AccountChartTemplate(models.Model): company.write({'tax_cash_basis_journal_id': journal_basis.id}) return res - @api.multi def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None): """Create the tax_cash_basis_journal_id""" res = super(AccountChartTemplate, self)._prepare_all_journals( diff --git a/addons/link_tracker/models/link_tracker.py b/addons/link_tracker/models/link_tracker.py index 3bc0b02473f..32d4bfb487a 100644 --- a/addons/link_tracker/models/link_tracker.py +++ b/addons/link_tracker/models/link_tracker.py @@ -164,13 +164,11 @@ class LinkTracker(models.Model): return html - @api.multi def action_view_statistics(self): action = self.env['ir.actions.act_window'].for_xml_id('link_tracker', 'link_tracker_click_action_statistics') action['domain'] = [('link_id', '=', self.id)] return action - @api.multi def action_visit_page(self): return { 'name': _("Visit Webpage"), diff --git a/addons/lunch/models/lunch_cashmove.py b/addons/lunch/models/lunch_cashmove.py index bfac0777959..7089904b34a 100644 --- a/addons/lunch/models/lunch_cashmove.py +++ b/addons/lunch/models/lunch_cashmove.py @@ -18,7 +18,6 @@ class LunchCashMove(models.Model): amount = fields.Float('Amount', required=True) description = fields.Text('Description') - @api.multi def name_get(self): return [(cashmove.id, '%s %s' % (_('Lunch Cashmove'), '#%d' % cashmove.id)) for cashmove in self] diff --git a/addons/lunch/models/lunch_supplier.py b/addons/lunch/models/lunch_supplier.py index 40842de88fb..e4e975536bd 100644 --- a/addons/lunch/models/lunch_supplier.py +++ b/addons/lunch/models/lunch_supplier.py @@ -93,7 +93,6 @@ class LunchSupplier(models.Model): 'Automatic Email Sending Time should be between 0 and 12'), ] - @api.multi def name_get(self): res = [] for supplier in self: diff --git a/addons/lunch/report/lunch_cashmove_report.py b/addons/lunch/report/lunch_cashmove_report.py index 6741d7d2fa3..163393697c9 100644 --- a/addons/lunch/report/lunch_cashmove_report.py +++ b/addons/lunch/report/lunch_cashmove_report.py @@ -17,7 +17,6 @@ class CashmoveReport(models.Model): user_id = fields.Many2one('res.users', string='User') description = fields.Text('Description') - @api.multi def name_get(self): return [(cashmove.id, '%s %s' % (_('Lunch Cashmove'), '#%d' % cashmove.id)) for cashmove in self] diff --git a/addons/lunch/report/lunch_product_report.py b/addons/lunch/report/lunch_product_report.py index 3a30fc426d3..8c0d80bf0d1 100644 --- a/addons/lunch/report/lunch_product_report.py +++ b/addons/lunch/report/lunch_product_report.py @@ -51,7 +51,6 @@ class LunchProductReport(models.Model): return expression.OR([[('supplier_id.available_location_ids', 'in', value)], [('supplier_id.available_location_ids', '=', False)]]) - @api.multi def write(self, values): user_id = self.env.user.id if 'is_favorite' in values: diff --git a/addons/mail/models/ir_attachment.py b/addons/mail/models/ir_attachment.py index 4e0cfc4b0ea..c2dd7fe9f5b 100644 --- a/addons/mail/models/ir_attachment.py +++ b/addons/mail/models/ir_attachment.py @@ -7,7 +7,6 @@ from odoo import api, models class IrAttachment(models.Model): _inherit = 'ir.attachment' - @api.multi def _post_add_create(self): """ Overrides behaviour when the attachment is created through the controller """ diff --git a/addons/mail/models/ir_model.py b/addons/mail/models/ir_model.py index b4950d73ed4..9451c4a59be 100644 --- a/addons/mail/models/ir_model.py +++ b/addons/mail/models/ir_model.py @@ -53,7 +53,6 @@ class IrModel(models.Model): return super(IrModel, self).unlink() - @api.multi def write(self, vals): if self and ('is_mail_thread' in vals or 'is_mail_activity' in vals or 'is_mail_blacklist' in vals): if not all(rec.state == 'manual' for rec in self): diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py index 97ef1011eff..566c994d75d 100644 --- a/addons/mail/models/mail_activity.py +++ b/addons/mail/models/mail_activity.py @@ -90,7 +90,6 @@ class MailActivityType(models.Model): for activity_type in self: activity_type.initial_res_model_id = activity_type.res_model_id - @api.multi def unlink(self): if any(self.get_external_id().values()): raise exceptions.ValidationError("You can not delete activity type that are used as master data.") @@ -160,13 +159,11 @@ class MailActivity(models.Model): # access can_write = fields.Boolean(compute='_compute_can_write', help='Technical field to hide buttons if the current user has no access.') - @api.multi @api.onchange('previous_activity_type_id') def _compute_has_recommended_activities(self): for record in self: record.has_recommended_activities = bool(record.previous_activity_type_id.next_type_ids) - @api.multi @api.onchange('previous_activity_type_id') def _onchange_previous_activity_type_id(self): for record in self: @@ -226,7 +223,6 @@ class MailActivity(models.Model): if self.recommended_activity_type_id: self.activity_type_id = self.recommended_activity_type_id - @api.multi def _filter_access_rules(self, operation): """ Return the subset of ``self`` for which ``operation`` is allowed. A custom implementation is done on activities as this document has some @@ -282,7 +278,6 @@ class MailActivity(models.Model): return valid - @api.multi def _check_access_assignation(self): """ Check assigned user (user_id field) has access to the document. Purpose is to allow assigned user to handle their activities. For that purpose @@ -334,7 +329,6 @@ class MailActivity(models.Model): {'type': 'activity_updated', 'activity_created': True}) return activity - @api.multi def write(self, values): if values.get('user_id'): user_changes = self.filtered(lambda activity: activity.user_id.id != values.get('user_id')) @@ -361,7 +355,6 @@ class MailActivity(models.Model): {'type': 'activity_updated', 'activity_deleted': True}) return res - @api.multi def unlink(self): for activity in self: if activity.date_deadline <= fields.Date.today(): @@ -374,7 +367,6 @@ class MailActivity(models.Model): # Business Methods # ------------------------------------------------------ - @api.multi def action_notify(self): if not self: return @@ -397,14 +389,12 @@ class MailActivity(models.Model): email_layout_xmlid='mail.mail_notification_light', ) - @api.multi def action_done(self): """ Wrapper without feedback because web button add context as parameter, therefore setting context to feedback """ messages, next_activities = self._action_done() return messages.ids and messages.ids[0] or False - @api.multi def action_feedback(self, feedback=False, attachment_ids=None): messages, next_activities = self._action_done(feedback=feedback, attachment_ids=attachment_ids) return messages.ids and messages.ids[0] or False @@ -414,7 +404,6 @@ class MailActivity(models.Model): parameter, therefore setting context to feedback """ return self.action_feedback_schedule_next() - @api.multi def action_feedback_schedule_next(self, feedback=False): ctx = dict( clean_context(self.env.context), @@ -485,7 +474,6 @@ class MailActivity(models.Model): return messages, next_activities - @api.multi def action_close_dialog(self): return {'type': 'ir.actions.act_window_close'} @@ -636,7 +624,6 @@ class MailActivityMixin(models.AbstractModel): def _search_activity_summary(self, operator, operand): return [('activity_ids.summary', operator, operand)] - @api.multi def write(self, vals): # Delete activities of archived record. if 'active' in vals and vals['active'] is False: @@ -645,7 +632,6 @@ class MailActivityMixin(models.AbstractModel): ).unlink() return super(MailActivityMixin, self).write(vals) - @api.multi def unlink(self): """ Override unlink to delete records activities through (res_model, res_id). """ record_ids = self.ids @@ -655,7 +641,6 @@ class MailActivityMixin(models.AbstractModel): ).unlink() return result - @api.multi def toggle_active(self): """ Before archiving the record we should also remove its ongoing activities. Otherwise they stay in the systray and concerning archived diff --git a/addons/mail/models/mail_alias.py b/addons/mail/models/mail_alias.py index ecf03c3c5a3..2a8b9c6bde8 100644 --- a/addons/mail/models/mail_alias.py +++ b/addons/mail/models/mail_alias.py @@ -73,7 +73,6 @@ class Alias(models.Model): ('alias_unique', 'UNIQUE(alias_name)', 'Unfortunately this email alias is already used, please choose a unique one') ] - @api.multi def _get_alias_domain(self): alias_domain = self.env["ir.config_parameter"].sudo().get_param("mail.catchall.domain") for record in self: @@ -107,14 +106,12 @@ class Alias(models.Model): vals['alias_parent_model_id'] = model.id return super(Alias, self).create(vals) - @api.multi def write(self, vals): """"give a unique alias name if given alias name is already assigned""" if vals.get('alias_name') and self.ids: vals['alias_name'] = self._clean_and_make_unique(vals.get('alias_name'), alias_ids=self.ids) return super(Alias, self).write(vals) - @api.multi def name_get(self): """Return the mail alias display alias_name, including the implicit mail catchall domain if exists from config otherwise "New Alias". @@ -154,7 +151,6 @@ class Alias(models.Model): name = re.sub(r'[^\w+.]+', '-', name) return self._find_unique(name, alias_ids=alias_ids) - @api.multi def open_document(self): if not self.alias_model_id or not self.alias_force_thread_id: return False @@ -165,7 +161,6 @@ class Alias(models.Model): 'type': 'ir.actions.act_window', } - @api.multi def open_parent_document(self): if not self.alias_parent_model_id or not self.alias_parent_thread_id: return False @@ -212,7 +207,6 @@ class AliasMixin(models.AbstractModel): record.alias_id.sudo().write(record.get_alias_values()) return record - @api.multi def unlink(self): """ Delete the given records, and cascade-delete their corresponding alias. """ aliases = self.mapped('alias_id') diff --git a/addons/mail/models/mail_blacklist.py b/addons/mail/models/mail_blacklist.py index 4311aa54b6e..f2e8dddb65c 100644 --- a/addons/mail/models/mail_blacklist.py +++ b/addons/mail/models/mail_blacklist.py @@ -50,7 +50,6 @@ class MailBlackList(models.Model): results = super(MailBlackList, self).create(to_create) return self.env['mail.blacklist'].browse(bl_entries.values()) | results - @api.multi def write(self, values): if 'email' in values: values['email'] = tools.email_normalize(values['email']) @@ -151,7 +150,6 @@ class MailBlackListMixin(models.AbstractModel): for record in self: record.is_blacklisted = record.email_normalized in blacklist - @api.multi def _message_receive_bounce(self, email, partner, mail_id=None): """ Override of mail.thread generic method. Purpose is to increment the bounce counter of the record. """ diff --git a/addons/mail/models/mail_cc_mixin.py b/addons/mail/models/mail_cc_mixin.py index 88e16f7d6b8..cc1554fcff5 100644 --- a/addons/mail/models/mail_cc_mixin.py +++ b/addons/mail/models/mail_cc_mixin.py @@ -29,7 +29,6 @@ class MailCCMixin(models.AbstractModel): cc_values.update(custom_values) return super(MailCCMixin, self).message_new(msg_dict, cc_values) - @api.multi def message_update(self, msg_dict, update_vals=None): '''Adds cc email to self.email_cc while trying to keep email as raw as possible but unique''' if update_vals is None: @@ -43,7 +42,6 @@ class MailCCMixin(models.AbstractModel): cc_values.update(update_vals) return super(MailCCMixin, self).message_update(msg_dict, cc_values) - @api.multi def _message_get_suggested_recipients(self): recipients = super(MailCCMixin, self)._message_get_suggested_recipients() for record in self: diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index cbc548825d9..2b56951fb4f 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -134,13 +134,11 @@ class Channel(models.Model): for channel in self: channel.is_subscribed = self.env.user.partner_id in channel.channel_partner_ids - @api.multi @api.depends('moderator_ids') def _compute_is_moderator(self): for channel in self: channel.is_moderator = self.env.user in channel.moderator_ids - @api.multi @api.depends('moderation_ids') def _compute_moderation_count(self): read_group_res = self.env['mail.moderation'].read_group([('channel_id', 'in', self.ids)], ['channel_id'], 'channel_id') @@ -169,7 +167,6 @@ class Channel(models.Model): if any(not channel.moderator_ids for channel in self if channel.moderation): raise ValidationError('Moderated channels must have moderators.') - @api.multi def _compute_is_member(self): memberships = self.env['mail.channel.partner'].sudo().search([ ('channel_id', 'in', self.ids), @@ -179,7 +176,6 @@ class Channel(models.Model): for record in self: record.is_member = record in membership_ids - @api.multi def _compute_is_chat(self): for record in self: if record.channel_type == 'chat': @@ -233,7 +229,6 @@ class Channel(models.Model): return channel - @api.multi def unlink(self): aliases = self.mapped('alias_id') @@ -249,7 +244,6 @@ class Channel(models.Model): aliases.sudo().unlink() return res - @api.multi def write(self, vals): # First checks if user tries to modify moderation fields and has not the right to do it. if any(key for key in MODERATION_FIELDS if vals.get(key)) and any(self.env.user not in channel.moderator_ids for channel in self if channel.moderation): @@ -279,7 +273,6 @@ class Channel(models.Model): for mail_channel in self: mail_channel.write({'channel_partner_ids': [(4, pid) for pid in mail_channel.mapped('group_ids').mapped('users').mapped('partner_id').ids]}) - @api.multi def action_follow(self): self.ensure_one() channel_partner = self.mapped('channel_last_seen_partner_ids').filtered(lambda cp: cp.partner_id == self.env.user.partner_id) @@ -287,11 +280,9 @@ class Channel(models.Model): return self.write({'channel_last_seen_partner_ids': [(0, 0, {'partner_id': self.env.user.partner_id.id})]}) return False - @api.multi def action_unfollow(self): return self._action_unfollow(self.env.user.partner_id) - @api.multi def _action_unfollow(self, partner): channel_info = self.channel_info('unsubscribe')[0] # must be computed before leaving the channel (access rights) result = self.write({'channel_partner_ids': [(3, partner.id)]}) @@ -302,7 +293,6 @@ class Channel(models.Model): self.sudo().message_post(body=notification, subtype="mail.mt_comment", author_id=partner.id) return result - @api.multi def _notify_get_groups(self): """ All recipients of a message on a channel are considered as partners. This means they will receive a minimal email, without a link to access @@ -314,7 +304,6 @@ class Channel(models.Model): groups[index] = (group_name, lambda partner: False, group_data) return groups - @api.multi def _notify_email_header_dict(self): headers = super(Channel, self)._notify_email_header_dict() headers['Precedence'] = 'list' @@ -330,7 +319,6 @@ class Channel(models.Model): headers['X-Forge-To'] = list_to return headers - @api.multi def _message_receive_bounce(self, email, partner, mail_id=None): """ Override bounce management to unsubscribe bouncing addresses """ for p in partner: @@ -338,7 +326,6 @@ class Channel(models.Model): self._action_unfollow(p) return super(Channel, self)._message_receive_bounce(email, partner, mail_id=mail_id) - @api.multi def _notify_email_recipient_values(self, recipient_ids): # Excluded Blacklisted whitelist = self.env['res.partner'].sudo().browse(recipient_ids).filtered(lambda p: not p.is_blacklisted) @@ -377,7 +364,6 @@ class Channel(models.Model): moderation_status = 'pending_moderation' return moderation_status, email - @api.multi @api.returns('mail.message', lambda value: value.id) def message_post(self, message_type='notification', **kwargs): moderation_status, email = self._extract_moderation_values(message_type, **kwargs) @@ -419,7 +405,6 @@ class Channel(models.Model): # Moderation # -------------------------------------------------- - @api.multi def send_guidelines(self): """ Send guidelines to all channel members. """ if self.env.user in self.moderator_ids or self.env.user.has_group('base.group_system'): @@ -429,7 +414,6 @@ class Channel(models.Model): else: raise UserError("Only an administrator or a moderator can send guidelines to channel members!") - @api.multi def _send_guidelines(self, partners): """ Send guidelines of a given channel. Returns False if template used for guidelines not found. Caller may have to handle this return value. """ @@ -453,7 +437,6 @@ class Channel(models.Model): mail.send() return True - @api.multi def _update_moderation_email(self, emails, status): """ This method adds emails into either white or black of the channel list of emails according to status. If an email in emails is already moderated, the method updates the email status. @@ -481,7 +464,6 @@ class Channel(models.Model): # - when a message is posted on a channel (to the channel, using _notify() method) # Anonymous method - @api.multi def _broadcast(self, partner_ids): """ Broadcast the current channel header to the given partner ids :param partner_ids : the partner to notify @@ -489,7 +471,6 @@ class Channel(models.Model): notifications = self._channel_channel_notifications(partner_ids) self.env['bus.bus'].sendmany(notifications) - @api.multi def _channel_channel_notifications(self, partner_ids): """ Generate the bus notifications of current channel for the given partner ids :param partner_ids : the partner to send the current channel header @@ -510,7 +491,6 @@ class Channel(models.Model): else: message._notify_pending_by_chat() - @api.multi def _channel_message_notifications(self, message, message_format=False): """ Generate the bus notifications for the given message :param message : the mail.message to sent @@ -545,7 +525,6 @@ class Channel(models.Model): partner_infos[user.partner_id.id]['out_of_office_message'] = user.out_of_office_message return partner_infos - @api.multi def channel_info(self, extra_info=False): """ Get the informations header for the current channels :returns a list of channels values @@ -629,7 +608,6 @@ class Channel(models.Model): channel_infos.append(info) return channel_infos - @api.multi def channel_fetch_message(self, last_id=False, limit=20): """ Return message values of the current channel. :param last_id : last message id to start the research @@ -737,7 +715,6 @@ class Channel(models.Model): if channel_partners: channel_partners.write({'is_pinned': pinned}) - @api.multi def channel_seen(self): self.ensure_one() if self.channel_message_ids.ids: @@ -762,7 +739,6 @@ class Channel(models.Model): self.env['bus.bus'].sendone((self._cr.dbname, 'res.partner', self.env.user.partner_id.id), data) return last_message_id - @api.multi def channel_fetched(self): """ Broadcast the channel_fetched notification to channel members :param channel_ids : list of channel id that has been fetched by current user @@ -787,7 +763,6 @@ class Channel(models.Model): } self.env['bus.bus'].sendmany([[(self._cr.dbname, 'mail.channel', channel.id), data]]) - @api.multi def channel_invite(self, partner_ids): """ Add the given partner_ids to the current channels and broadcast the channel header to them. :param partner_ids : list of partner id to add @@ -820,7 +795,6 @@ class Channel(models.Model): 'custom_channel_name': name, }) - @api.multi def notify_typing(self, is_typing, is_website_user=False): """ Broadcast the typing notification to channel members :param is_typing: (boolean) tells whether the current user is typing or not @@ -884,7 +858,6 @@ class Channel(models.Model): domain = expression.AND([domain, [('name', 'ilike', '%'+name+'%')]]) return self.search(domain).read(['name', 'public', 'uuid', 'channel_type']) - @api.multi def channel_join_and_get_info(self): self.ensure_one() added = self.action_follow() @@ -949,7 +922,6 @@ class Channel(models.Model): def _channel_fetch_listeners_where_clause(self, uuid): return ("C.uuid = %s", (uuid,)) - @api.multi def channel_fetch_preview(self): """ Return the last message of the given channels """ if not self: @@ -984,7 +956,6 @@ class Channel(models.Model): commands.append(command) return commands - @api.multi def execute_command(self, command='', **kwargs): """ Executes a given command """ self.ensure_one() diff --git a/addons/mail/models/mail_followers.py b/addons/mail/models/mail_followers.py index 417b83e59f5..87f20af46d1 100644 --- a/addons/mail/models/mail_followers.py +++ b/addons/mail/models/mail_followers.py @@ -36,7 +36,6 @@ class Followers(models.Model): 'mail.message.subtype', string='Subtype', help="Message subtypes followed, meaning subtypes that will be pushed onto the user's Wall.") - @api.multi def _invalidate_documents(self, vals_list=None): """ Invalidate the cache of the documents followed by ``self``. @@ -57,7 +56,6 @@ class Followers(models.Model): res._invalidate_documents(vals_list) return res - @api.multi def write(self, vals): if 'res_model' in vals or 'res_id' in vals: self._invalidate_documents() @@ -66,7 +64,6 @@ class Followers(models.Model): self._invalidate_documents() return res - @api.multi def unlink(self): self._invalidate_documents() return super(Followers, self).unlink() diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py index f9069021307..e6d2506c00a 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -70,7 +70,6 @@ class MailMail(models.Model): new_mail.attachment_ids.check(mode='read') return new_mail - @api.multi def write(self, vals): res = super(MailMail, self).write(vals) if vals.get('attachment_ids'): @@ -78,7 +77,6 @@ class MailMail(models.Model): mail.attachment_ids.check(mode='read') return res - @api.multi def unlink(self): # cascade-delete the parent message for all mails that are not created for a notification mail_msg_cascade_ids = [mail.mail_message_id.id for mail in self if not mail.notification] @@ -95,11 +93,9 @@ class MailMail(models.Model): self = self.with_context(dict(self._context, default_type=None)) return super(MailMail, self).default_get(fields) - @api.multi def mark_outgoing(self): return self.write({'state': 'outgoing'}) - @api.multi def cancel(self): return self.write({'state': 'cancel'}) @@ -142,7 +138,6 @@ class MailMail(models.Model): _logger.exception("Failed processing mail queue") return res - @api.multi def _postprocess_sent_message(self, success_pids, failure_reason=False, failure_type=None): """Perform any post-processing necessary after sending ``mail`` successfully, including deleting it completely along with its @@ -184,14 +179,12 @@ class MailMail(models.Model): # mail_mail formatting, tools and send mechanism # ------------------------------------------------------ - @api.multi def _send_prepare_body(self): """Return a specific ir_email body. The main purpose of this method is to be inherited to add custom content depending on some module.""" self.ensure_one() return self.body_html or '' - @api.multi def _send_prepare_values(self, partner=None): """Return a dictionary for specific email values, depending on a partner, or generic to the whole recipients given by mail.email_to. @@ -212,7 +205,6 @@ class MailMail(models.Model): } return res - @api.multi def _split_by_server(self): """Returns an iterator of pairs `(mail_server_id, record_ids)` for current recordset. @@ -230,7 +222,6 @@ class MailMail(models.Model): for mail_batch in tools.split_every(batch_size, record_ids): yield server_id, mail_batch - @api.multi def send(self, auto_commit=False, raise_exception=False): """ Sends the selected emails immediately, ignoring their current state (mails that have already been sent should not be passed @@ -271,7 +262,6 @@ class MailMail(models.Model): if smtp_session: smtp_session.quit() - @api.multi def _send(self, auto_commit=False, raise_exception=False, smtp_session=None): IrMailServer = self.env['ir.mail_server'] IrAttachment = self.env['ir.attachment'] diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 45b71613a85..229fdb943eb 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -129,7 +129,6 @@ class Message(models.Model): email_layout_xmlid = fields.Char('Layout', copy=False, oldname='layout') # xml id of layout add_sign = fields.Boolean(default=True) - @api.multi def _get_needaction(self): """ Need action on a mail.message = notified on my channel """ my_messages = self.env['mail.notification'].sudo().search([ @@ -145,7 +144,6 @@ class Message(models.Model): return ['&', ('notification_ids.res_partner_id', '=', self.env.user.partner_id.id), ('notification_ids.is_read', '=', False)] return ['&', ('notification_ids.res_partner_id', '=', self.env.user.partner_id.id), ('notification_ids.is_read', '=', True)] - @api.multi def _compute_has_error(self): error_from_notification = self.env['mail.notification'].sudo().search([ ('mail_message_id', 'in', self.ids), @@ -153,7 +151,6 @@ class Message(models.Model): for message in self: message.has_error = message in error_from_notification - @api.multi def _search_has_error(self, operator, operand): if operator == '=' and operand: return [('notification_ids.notification_status', 'in', ('bounce', 'exception'))] @@ -173,7 +170,6 @@ class Message(models.Model): return [('starred_partner_ids', 'in', [self.env.user.partner_id.id])] return [('starred_partner_ids', 'not in', [self.env.user.partner_id.id])] - @api.multi def _compute_need_moderation(self): for message in self: message.need_moderation = False @@ -237,7 +233,6 @@ class Message(models.Model): return ids - @api.multi def set_message_done(self): """ Remove the needaction from messages for the current partner. """ partner_id = self.env.user.partner_id @@ -290,7 +285,6 @@ class Message(models.Model): notification = {'type': 'toggle_star', 'message_ids': ids, 'starred': False} self.env['bus.bus'].sendone((self._cr.dbname, 'res.partner', self.env.user.partner_id.id), notification) - @api.multi def toggle_message_starred(self): """ Toggle messages as (un)starred. Technically, the notifications related to uid are set to (un)starred. @@ -415,7 +409,6 @@ class Message(models.Model): return True - @api.multi def message_fetch_failed(self): messages = self.search([ ('has_error', '=', True), @@ -452,7 +445,6 @@ class Message(models.Model): messages = messages.sorted(key='id', reverse=True)[:limit] return messages.message_format() - @api.multi def message_format(self): """ Get the message values in the format for web client. Since message values can be broadcasted, computed fields MUST NOT BE READ and broadcasted. @@ -527,7 +519,6 @@ class Message(models.Model): message['module_icon'] = modules.module.get_module_icon(self.env[message['model']]._original_module) return message_values - @api.multi def _get_message_format_fields(self): return [ 'id', 'body', 'date', 'author_id', 'email_from', # base message fields @@ -550,7 +541,6 @@ class Message(models.Model): 'module_icon': '/mail/static/src/img/smiley/mailfailure.jpg', } - @api.multi def _format_mail_failures(self): """ A shorter message to notify a failure update """ failures_infos = [] @@ -574,7 +564,6 @@ class Message(models.Model): failures_infos.append(info) return failures_infos - @api.multi def _notify_mail_failure_update(self): messages = self.env['mail.message'] for message in self: @@ -606,7 +595,6 @@ class Message(models.Model): if not self._cr.fetchone(): self._cr.execute("""CREATE INDEX mail_message_model_res_id_idx ON mail_message (model, res_id)""") - @api.multi def is_thread_message(self, vals=None): if vals: res_id = vals.get('res_id') @@ -713,7 +701,6 @@ class Message(models.Model): id_list = [id for id in ids if id in final_ids] return id_list - @api.multi def check_access_rule(self, operation): """ Access rules of mail.message: - read: if @@ -1010,7 +997,6 @@ class Message(models.Model): message_id = tools.generate_tracking_message_id('private') return message_id - @api.multi def _invalidate_documents(self, model=None, res_id=None): """ Invalidate the cache of the documents followed by ``self``. """ for record in self: @@ -1100,14 +1086,12 @@ class Message(models.Model): return message - @api.multi def read(self, fields=None, load='_classic_read'): """ Override to explicitely call check_access_rule, that is not called by the ORM. It instead directly fetches ir.rules and apply them. """ self.check_access_rule('read') return super(Message, self).read(fields=fields, load=load) - @api.multi def write(self, vals): record_changed = 'model' in vals or 'res_id' in vals if record_changed or 'message_type' in vals: @@ -1120,7 +1104,6 @@ class Message(models.Model): self._invalidate_documents() return res - @api.multi def unlink(self): # cascade-delete attachments that are directly attached to the message (should only happen # for mail.messages that act as parent for a standalone mail.mail record). @@ -1139,7 +1122,6 @@ class Message(models.Model): # Moderation # -------------------------------------------------- - @api.multi def moderate(self, decision, **kwargs): """ Moderate messages. A check is done on moderation status of the current user to ensure we only moderate valid messages. """ @@ -1151,7 +1133,6 @@ class Message(models.Model): if to_moderate: self.browse(to_moderate)._moderate(decision, **kwargs) - @api.multi def _moderate(self, decision, **kwargs): """ :param decision * accept - moderate message and broadcast that message to followers of relevant channels. @@ -1200,7 +1181,6 @@ class Message(models.Model): # message will always be a thread_message. This check should always be true. self.env[message.model].browse(message.res_id)._notify_thread(message) - @api.multi def _moderate_send_reject_email(self, subject, comment): for msg in self: if not msg.email_from: @@ -1221,7 +1201,6 @@ class Message(models.Model): } self.env['mail.mail'].sudo().create(vals) - @api.multi def _search_from_same_authors(self): """ Returns all pending moderation messages that have same email_from and same res_id as given recordset. """ @@ -1235,7 +1214,6 @@ class Message(models.Model): ]) return messages - @api.multi def _moderate_discard(self): """ Notify deletion of messages to their moderators and authors and then delete them. """ diff --git a/addons/mail/models/mail_message_subtype.py b/addons/mail/models/mail_message_subtype.py index 9c800793b47..43922018e89 100644 --- a/addons/mail/models/mail_message_subtype.py +++ b/addons/mail/models/mail_message_subtype.py @@ -46,12 +46,10 @@ class MailMessageSubtype(models.Model): self.clear_caches() return super(MailMessageSubtype, self).create(vals) - @api.multi def write(self, vals): self.clear_caches() return super(MailMessageSubtype, self).write(vals) - @api.multi def unlink(self): self.clear_caches() return super(MailMessageSubtype, self).unlink() diff --git a/addons/mail/models/mail_notification.py b/addons/mail/models/mail_notification.py index 571023450d9..c89ce0fd57d 100644 --- a/addons/mail/models/mail_notification.py +++ b/addons/mail/models/mail_notification.py @@ -51,7 +51,6 @@ class Notification(models.Model): if not self._cr.fetchone(): self._cr.execute('CREATE INDEX mail_notification_res_partner_id_is_read_notification_status_mail_message_id ON mail_message_res_partner_needaction_rel (res_partner_id, is_read, notification_status, mail_message_id)') - @api.multi def format_failure_reason(self): self.ensure_one() if self.failure_type != 'UNKNOWN': diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py index e657e146837..cfcc72b08b3 100644 --- a/addons/mail/models/mail_template.py +++ b/addons/mail/models/mail_template.py @@ -194,26 +194,22 @@ class MailTemplate(models.Model): self.sub_model_object_field = False self.null_value = False - @api.multi def unlink(self): self.unlink_action() return super(MailTemplate, self).unlink() - @api.multi @api.returns('self', lambda value: value.id) def copy(self, default=None): default = dict(default or {}, name=_("%s (copy)") % self.name) return super(MailTemplate, self).copy(default=default) - @api.multi def unlink_action(self): for template in self: if template.ref_ir_act_window: template.ref_ir_act_window.unlink() return True - @api.multi def create_action(self): ActWindow = self.env['ir.actions.act_window'] view = self.env.ref('mail.email_compose_message_wizard_form') @@ -302,7 +298,6 @@ class MailTemplate(models.Model): return multi_mode and results or results[res_ids[0]] - @api.multi def get_email_template(self, res_ids): multi_mode = True if isinstance(res_ids, int): @@ -332,7 +327,6 @@ class MailTemplate(models.Model): return multi_mode and results or results[res_ids[0]] - @api.multi def generate_recipients(self, results, res_ids): """Generates the recipients of the template. Default values can ben generated instead of the template values if requested by template or context. @@ -370,7 +364,6 @@ class MailTemplate(models.Model): results[res_id]['partner_ids'] = partner_ids return results - @api.multi def generate_email(self, res_ids, fields=None): """Generates an email from the template for given the given model based on records given by res_ids. @@ -463,7 +456,6 @@ class MailTemplate(models.Model): # EMAIL # ---------------------------------------- - @api.multi def send_mail(self, res_id, force_send=False, raise_exception=False, email_values=None, notif_layout=False): """ Generates a new mail.mail. Template is rendered on record given by res_id and model coming from template. diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 8a53e51cba2..37720077b66 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -148,7 +148,6 @@ class MailThread(models.AbstractModel): # using read() below is much faster than followers.mapped('res_id') return [('id', 'in', [res['res_id'] for res in followers.read(['res_id'])])] - @api.multi @api.depends('message_follower_ids') def _compute_is_follower(self): followers = self.env['mail.followers'].sudo().search([ @@ -175,7 +174,6 @@ class MailThread(models.AbstractModel): # using read() below is much faster than followers.mapped('res_id') return [('id', 'not in', [res['res_id'] for res in followers.read(['res_id'])])] - @api.multi def _get_message_unread(self): partner_id = self.env.user.partner_id.id res = dict.fromkeys(self.ids, 0) @@ -199,7 +197,6 @@ class MailThread(models.AbstractModel): record.message_unread_counter = res.get(record._origin.id, 0) record.message_unread = bool(record.message_unread_counter) - @api.multi def _get_message_needaction(self): res = dict.fromkeys(self.ids, 0) if self.ids: @@ -220,7 +217,6 @@ class MailThread(models.AbstractModel): def _search_message_needaction(self, operator, operand): return [('message_ids.needaction', operator, operand)] - @api.multi def _compute_message_has_error(self): res = {} if self.ids: @@ -240,7 +236,6 @@ class MailThread(models.AbstractModel): def _search_message_has_error(self, operator, operand): return ['&', ('message_ids.has_error', operator, operand), ('message_ids.author_id', '=', self.env.user.partner_id.id)] - @api.multi def _compute_message_attachment_count(self): read_group_var = self.env['ir.attachment'].read_group([('res_id', 'in', self.ids), ('res_model', '=', self._name)], fields=['res_id'], @@ -308,7 +303,6 @@ class MailThread(models.AbstractModel): return threads - @api.multi def write(self, values): if self._context.get('tracking_disable'): return super(MailThread, self).write(values) @@ -337,7 +331,6 @@ class MailThread(models.AbstractModel): track_self._message_track_post_template(changes) return result - @api.multi def unlink(self): """ Override unlink to delete messages and followers. This cannot be cascaded, because link is done through (res_model, res_id). """ @@ -350,7 +343,6 @@ class MailThread(models.AbstractModel): ).unlink() return res - @api.multi def copy_data(self, default=None): # avoid tracking multiple temporary changes during copy return super(MailThread, self.with_context(mail_notrack=True)).copy_data(default=default) @@ -507,7 +499,6 @@ class MailThread(models.AbstractModel): check_operation = operation return check_operation - @api.multi def message_change_thread(self, new_thread): """ Transfer the list of the mail thread messages from an model to another @@ -567,7 +558,6 @@ class MailThread(models.AbstractModel): :returns: a subtype browse record or False if no subtype is trigerred """ - @api.multi def _track_subtype(self, init_values): """ Give the subtypes triggered by the changes on the record according to values that have been updated. @@ -579,11 +569,9 @@ class MailThread(models.AbstractModel): """ return False - @api.multi def _track_template(self, changes): return dict() - @api.multi def _message_track_post_template(self, changes): if not changes: return True @@ -597,7 +585,6 @@ class MailThread(models.AbstractModel): self.message_post_with_template(template.id, **post_kwargs) return True - @api.multi def _message_track(self, tracked_fields, initial): """ For a given record, fields to check (tuple column name, column info) and initial values, return a structure that is a tuple containing : @@ -625,7 +612,6 @@ class MailThread(models.AbstractModel): return changes, tracking_value_ids - @api.multi def message_track(self, tracked_fields, initial_values): """ Track updated values. Comparing the initial and current values of the fields given in tracked_fields, it generates a message containing @@ -1177,7 +1163,6 @@ class MailThread(models.AbstractModel): data[name_field] = msg_dict.get('subject', '') return self.create(data) - @api.multi def message_update(self, msg_dict, update_vals=None): """Called by ``message_process`` when a new message is received for an existing thread. The default behavior is to update the record @@ -1195,7 +1180,6 @@ class MailThread(models.AbstractModel): self.write(update_vals) return True - @api.multi def _message_receive_bounce(self, email, partner, mail_id=None): """Called by ``message_process`` when a bounce email (such as Undelivered Mail Returned to Sender) is received for an existing thread. The default @@ -1439,7 +1423,6 @@ class MailThread(models.AbstractModel): res[record.id] = {'partner_ids': recipient_ids, 'email_to': email_to, 'email_cc': email_cc} return res - @api.multi def _message_add_suggested_recipient(self, result, partner=None, email=None, reason=''): """ Called by _message_get_suggested_recipients, to add a suggested recipient in the result dictionary. The form is : @@ -1464,7 +1447,6 @@ class MailThread(models.AbstractModel): result[self.ids[0]].append((False, email, reason)) return result - @api.multi def _message_get_suggested_recipients(self): """ Returns suggested recipients for ids. Those are a list of tuple (partner_id, partner_name, reason), to be managed by Chatter. """ @@ -1547,7 +1529,6 @@ class MailThread(models.AbstractModel): partners.append(partner) return partners - @api.multi def _message_partner_info_from_emails(self, emails, link_mail=False): """ Convert a list of emails into a list partner_ids and a list new_partner_ids. The return value is non conventional because @@ -1672,7 +1653,6 @@ class MailThread(models.AbstractModel): return_values['attachment_ids'] = m2m_attachment_ids return return_values - @api.multi @api.returns('mail.message', lambda value: value.id) def message_post(self, body='', subject=None, message_type='notification', @@ -1809,7 +1789,6 @@ class MailThread(models.AbstractModel): using already-computed values instead of having to rebrowse things. """ pass - @api.multi def message_post_with_view(self, views_or_xmlid, **kwargs): """ Helper method to send a mail / post a message using a view_id to render using the ir.qweb engine. This method is stand alone, because @@ -1834,7 +1813,6 @@ class MailThread(models.AbstractModel): kwargs['body'] = rendered_template record.message_post_with_template(False, **kwargs) - @api.multi def message_post_with_template(self, template_id, email_layout_xmlid=None, **kwargs): """ Helper method to send a mail with a template :param template_id : the id of the template to render to create the body of the message @@ -1976,7 +1954,6 @@ class MailThread(models.AbstractModel): # Notification API # ------------------------------------------------------ - @api.multi def _notify_thread(self, message, msg_vals=False, **kwargs): """ Main notification method. This method basically does two things @@ -2252,7 +2229,6 @@ class MailThread(models.AbstractModel): 'lang': lang, } - @api.multi def _notify_compute_recipients(self, message, msg_vals): """ Compute recipients to notify based on subtype and followers. This method returns data structured as expected for ``_notify_recipients``. """ @@ -2321,7 +2297,6 @@ class MailThread(models.AbstractModel): hm = hmac.new(secret.encode('utf-8'), token.encode('utf-8'), hashlib.sha1).hexdigest() return hm - @api.multi def _notify_get_action_link(self, link_type, **kwargs): local_kwargs = dict(kwargs) # do not modify in-place, modify copy instead base_params = { @@ -2354,7 +2329,6 @@ class MailThread(models.AbstractModel): return link - @api.multi def _notify_get_groups(self): """ Return groups used to classify recipients of a notification email. Groups is a list of tuple containing of form (group_name, group_func, @@ -2394,7 +2368,6 @@ class MailThread(models.AbstractModel): ) ] - @api.multi def _notify_classify_recipients(self, recipient_data, model_name): """ Classify recipients to be notified of a message in groups to have specific rendering depending on their group. For example users could @@ -2459,7 +2432,6 @@ class MailThread(models.AbstractModel): return result - @api.multi def _notify_get_reply_to(self, default=None, records=None, company=None, doc_names=None): """ Returns the preferred reply-to email address when replying to a thread on documents. Documents are either given by self it this method is called @@ -2544,7 +2516,6 @@ class MailThread(models.AbstractModel): return records._notify_get_reply_to(default=default, company=company, doc_names=doc_names) return self._notify_get_reply_to(default=default, records=records, company=company, doc_names=doc_names) - @api.multi def _notify_email_recipient_values(self, recipient_ids): """ Format email notification recipient values to store on the notification mail.mail. Basic method just set the recipient partners as mail_mail @@ -2561,7 +2532,6 @@ class MailThread(models.AbstractModel): # Followers API # ------------------------------------------------------ - @api.multi def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None): """ Main public API to add followers to a record set. Its main purpose is to perform access rights checks before calling ``_message_subscribe``. """ @@ -2618,7 +2588,6 @@ class MailThread(models.AbstractModel): return True - @api.multi def message_unsubscribe(self, partner_ids=None, channel_ids=None): """ Remove partners from the records followers. """ # not necessary for computation, but saves an access right check @@ -2673,7 +2642,6 @@ class MailThread(models.AbstractModel): pass return [] - @api.multi def _message_auto_subscribe_notify(self, partner_ids, template): """ Notify new followers, using a template to render the content of the notification message. Notifications pushed are done using the standard @@ -2708,7 +2676,6 @@ class MailThread(models.AbstractModel): model_description=model_description, ) - @api.multi def _message_auto_subscribe(self, updated_values): """ Handle auto subscription. Auto subscription is done based on two main mechanisms diff --git a/addons/mail/models/mail_tracking_value.py b/addons/mail/models/mail_tracking_value.py index e99e2fec946..499ad86f5a7 100644 --- a/addons/mail/models/mail_tracking_value.py +++ b/addons/mail/models/mail_tracking_value.py @@ -81,7 +81,6 @@ class MailTracking(models.Model): return values return {} - @api.multi def get_display_value(self, type): assert type in ('new', 'old') result = [] @@ -106,12 +105,10 @@ class MailTracking(models.Model): result.append(record['%s_value_char' % type]) return result - @api.multi def get_old_display_value(self): # grep : # old_value_integer | old_value_datetime | old_value_char return self.get_display_value('old') - @api.multi def get_new_display_value(self): # grep : # new_value_integer | new_value_datetime | new_value_char return self.get_display_value('new') diff --git a/addons/mail/models/models.py b/addons/mail/models/models.py index e15bad70166..8c407ea4535 100644 --- a/addons/mail/models/models.py +++ b/addons/mail/models/models.py @@ -18,7 +18,6 @@ class BaseModel(models.AbstractModel): templates = E.templates(activity_box) return E.activity(templates, string=self._description) - @api.multi def _notify_email_headers(self): """ Generate the email headers based on record diff --git a/addons/mail/models/res_company.py b/addons/mail/models/res_company.py index 45011902e83..e1223bf3192 100644 --- a/addons/mail/models/res_company.py +++ b/addons/mail/models/res_company.py @@ -10,7 +10,6 @@ class Company(models.Model): catchall = fields.Char(string="Catchall Email", compute="_compute_catchall") - @api.multi def _compute_catchall(self): ConfigParameter = self.env['ir.config_parameter'].sudo() alias = ConfigParameter.get_param('mail.catchall.alias') diff --git a/addons/mail/models/res_partner.py b/addons/mail/models/res_partner.py index e2abaf7d75b..ab32936b79c 100644 --- a/addons/mail/models/res_partner.py +++ b/addons/mail/models/res_partner.py @@ -22,14 +22,12 @@ class Partner(models.Model): # override the field to track the visibility of user user_id = fields.Many2one(tracking=True) - @api.multi def _message_get_suggested_recipients(self): recipients = super(Partner, self)._message_get_suggested_recipients() for partner in self: partner._message_add_suggested_recipient(recipients, partner=partner, reason=_('Partner Profile')) return recipients - @api.multi def _message_get_default_recipients(self): return {r.id: { 'partner_ids': [r.id], diff --git a/addons/mail/models/res_users.py b/addons/mail/models/res_users.py index c7c21420585..07be8de63ee 100644 --- a/addons/mail/models/res_users.py +++ b/addons/mail/models/res_users.py @@ -41,7 +41,6 @@ class Users(models.Model): out_of_office_message = fields.Char(string='Message') @api.depends('moderation_channel_ids.moderation', 'moderation_channel_ids.moderator_ids') - @api.multi def _compute_is_moderator(self): moderated = self.env['mail.channel'].search([ ('id', 'in', self.mapped('moderation_channel_ids').ids), @@ -52,7 +51,6 @@ class Users(models.Model): for user in self: user.is_moderator = user in user_ids - @api.multi def _compute_moderation_counter(self): self._cr.execute(""" SELECT channel_moderator.res_users_id, COUNT(msg.id) @@ -93,7 +91,6 @@ GROUP BY channel_moderator.res_users_id""", [tuple(self.ids)]) self.env['mail.channel'].search([('group_ids', 'in', user.groups_id.ids)])._subscribe_users() return user - @api.multi def write(self, vals): write_res = super(Users, self).write(vals) sel_groups = [vals[k] for k in vals if is_selection_groups(k) and vals[k]] @@ -159,7 +156,6 @@ class res_groups_mail_channel(models.Model): _inherit = 'res.groups' _description = 'Access Groups' - @api.multi def write(self, vals, context=None): write_res = super(res_groups_mail_channel, self).write(vals) if vals.get('users'): diff --git a/addons/mail/models/update.py b/addons/mail/models/update.py index 54cbc98ffef..5f3a1d70c40 100644 --- a/addons/mail/models/update.py +++ b/addons/mail/models/update.py @@ -79,7 +79,6 @@ class PublisherWarrantyContract(AbstractModel): r.raise_for_status() return literal_eval(r.text) - @api.multi def update_notification(self, cron_mode=True): """ Send a message to Odoo's publisher warranty server to check the diff --git a/addons/mail/wizard/base_partner_merge.py b/addons/mail/wizard/base_partner_merge.py index d31749cacad..aed2cefd723 100644 --- a/addons/mail/wizard/base_partner_merge.py +++ b/addons/mail/wizard/base_partner_merge.py @@ -7,7 +7,6 @@ class MergePartnerAutomatic(models.TransientModel): _inherit = 'base.partner.merge.automatic.wizard' - @api.multi def _log_merge_operation(self, src_partners, dst_partner): super(MergePartnerAutomatic, self)._log_merge_operation(src_partners, dst_partner) dst_partner.message_post(body='%s %s' % (_("Merged with the following partners:"), ", ".join('%s <%s> (ID %s)' % (p.name, p.email or 'n/a', p.id) for p in src_partners))) diff --git a/addons/mail/wizard/email_template_preview.py b/addons/mail/wizard/email_template_preview.py index 95b9f9208c5..244cdb295bc 100644 --- a/addons/mail/wizard/email_template_preview.py +++ b/addons/mail/wizard/email_template_preview.py @@ -45,7 +45,6 @@ class TemplatePreview(models.TransientModel): preview_lang = fields.Selection(_get_languages, string='Template Preview Language') @api.onchange('res_id', 'preview_lang') - @api.multi def on_change_res_id(self): if not self.res_id: return {} diff --git a/addons/mail/wizard/invite.py b/addons/mail/wizard/invite.py index 5c7889b6a76..34f42159cd4 100644 --- a/addons/mail/wizard/invite.py +++ b/addons/mail/wizard/invite.py @@ -46,7 +46,6 @@ class Invite(models.TransientModel): message = fields.Html('Message') send_mail = fields.Boolean('Send Email', default=True, help="If checked, the partners will receive an email warning they have been added in the document's followers.") - @api.multi def add_followers(self): email_from = self.env['mail.message']._get_default_from() for wizard in self: diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 55cd6740b4b..ac05a1cf2a0 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -204,13 +204,11 @@ class MailComposer(models.TransientModel): #------------------------------------------------------ # action buttons call with positionnal arguments only, so we need an intermediary function # to ensure the context is passed correctly - @api.multi def action_send_mail(self): self.send_mail() return {'type': 'ir.actions.act_window_close', 'infos': 'mail_sent'} - @api.multi def send_mail(self, auto_commit=False): """ Process the wizard content and proceed with sending the related email(s), rendering any template patterns on the fly if needed. """ @@ -289,7 +287,6 @@ class MailComposer(models.TransientModel): if wizard.composition_mode == 'mass_mail': batch_mails.send(auto_commit=auto_commit) - @api.multi def get_mail_values(self, res_ids): """Generate the values that will be used by send_mail to create mail_messages or mail_mails. """ @@ -380,7 +377,6 @@ class MailComposer(models.TransientModel): # Template methods #------------------------------------------------------ - @api.multi @api.onchange('template_id') def onchange_template_id_wrapper(self): self.ensure_one() @@ -388,7 +384,6 @@ class MailComposer(models.TransientModel): for fname, value in values.items(): setattr(self, fname, value) - @api.multi def onchange_template_id(self, template_id, composition_mode, model, res_id): """ - mass_mailing: we cannot render, so return the template values - normal mode: return rendered values @@ -434,7 +429,6 @@ class MailComposer(models.TransientModel): return {'value': values} - @api.multi def save_as_template(self): """ hit save as template button: current form value will be a new template attached to the current document. """ @@ -459,7 +453,6 @@ class MailComposer(models.TransientModel): # Template rendering #------------------------------------------------------ - @api.multi def render_message(self, res_ids): """Generate template-based values of wizard, for the document records given by res_ids. This method is meant to be inherited by email_template that diff --git a/addons/mail/wizard/mail_resend_cancel.py b/addons/mail/wizard/mail_resend_cancel.py index f3bb8307754..7f2c5d334fb 100644 --- a/addons/mail/wizard/mail_resend_cancel.py +++ b/addons/mail/wizard/mail_resend_cancel.py @@ -11,13 +11,11 @@ class MailResendCancel(models.TransientModel): model = fields.Char(string='Model') help_message = fields.Char(string='Help message', compute='_compute_help_message') - @api.multi @api.depends('model') def _compute_help_message(self): for wizard in self: wizard.help_message = _("Are you sure you want to discard %s mail delivery failures. You won't be able to re-send these mails later!") % (wizard._context.get('unread_counter')) - @api.multi def cancel_resend_action(self): author_id = self.env.user.partner_id.id for wizard in self: diff --git a/addons/mail/wizard/mail_resend_message.py b/addons/mail/wizard/mail_resend_message.py index 9c72944961b..dc659681dac 100644 --- a/addons/mail/wizard/mail_resend_message.py +++ b/addons/mail/wizard/mail_resend_message.py @@ -49,7 +49,6 @@ class MailResendMessage(models.TransientModel): raise UserError('No message_id found in context') return rec - @api.multi def resend_mail_action(self): """ Process the wizard content and proceed with sending the related email(s), rendering any template patterns on the fly if needed. """ @@ -79,7 +78,6 @@ class MailResendMessage(models.TransientModel): self.mail_message_id._notify_mail_failure_update() return {'type': 'ir.actions.act_window_close'} - @api.multi def cancel_mail_action(self): for wizard in self: for notif in wizard.notification_ids: diff --git a/addons/maintenance/models/maintenance.py b/addons/maintenance/models/maintenance.py index 1978129da6e..73a30347399 100644 --- a/addons/maintenance/models/maintenance.py +++ b/addons/maintenance/models/maintenance.py @@ -46,14 +46,12 @@ class MaintenanceEquipmentCategory(models.Model): "create new maintenance request for this equipment category.") fold = fields.Boolean(string='Folded in Maintenance Pipe', compute='_compute_fold', store=True) - @api.multi def _compute_equipment_count(self): equipment_data = self.env['maintenance.equipment'].read_group([('category_id', 'in', self.ids)], ['category_id'], ['category_id']) mapped_data = dict([(m['category_id'][0], m['category_id_count']) for m in equipment_data]) for category in self: category.equipment_count = mapped_data.get(category.id, 0) - @api.multi def _compute_maintenance_count(self): maintenance_data = self.env['maintenance.request'].read_group([('category_id', 'in', self.ids)], ['category_id'], ['category_id']) mapped_data = dict([(m['category_id'][0], m['category_id_count']) for m in maintenance_data]) @@ -69,7 +67,6 @@ class MaintenanceEquipmentCategory(models.Model): category_id.alias_id.write({'alias_parent_thread_id': category_id.id, 'alias_defaults': {'category_id': category_id.id}}) return category_id - @api.multi def unlink(self): MailAlias = self.env['mail.alias'] for category in self: @@ -94,14 +91,12 @@ class MaintenanceEquipment(models.Model): _inherit = ['mail.thread', 'mail.activity.mixin'] _description = 'Maintenance Equipment' - @api.multi def _track_subtype(self, init_values): self.ensure_one() if 'owner_user_id' in init_values and self.owner_user_id: return self.env.ref('maintenance.mt_mat_assign') return super(MaintenanceEquipment, self)._track_subtype(init_values) - @api.multi def name_get(self): result = [] for record in self: @@ -211,7 +206,6 @@ class MaintenanceEquipment(models.Model): equipment.message_subscribe(partner_ids=[equipment.owner_user_id.partner_id.id]) return equipment - @api.multi def write(self, vals): if vals.get('owner_user_id'): self.message_subscribe(partner_ids=self.env['res.users'].browse(vals['owner_user_id']).partner_id.ids) @@ -264,11 +258,9 @@ class MaintenanceRequest(models.Model): def _default_stage(self): return self.env['maintenance.stage'].search([], limit=1) - @api.multi def _creation_subtype(self): return self.env.ref('maintenance.mt_req_created') - @api.multi def _track_subtype(self, init_values): self.ensure_one() if 'stage_id' in init_values: @@ -307,11 +299,9 @@ class MaintenanceRequest(models.Model): maintenance_team_id = fields.Many2one('maintenance.team', string='Team', required=True, default=_get_default_team_id) duration = fields.Float(help="Duration in hours.") - @api.multi def archive_equipment_request(self): self.write({'archive': True}) - @api.multi def reset_equipment_request(self): """ Reinsert the maintenance request into the maintenance pipe in the first stage""" first_stage_obj = self.env['maintenance.stage'].search([], order="sequence asc", limit=1) @@ -342,7 +332,6 @@ class MaintenanceRequest(models.Model): request.activity_update() return request - @api.multi def write(self, vals): # Overridden to reset the kanban_state to normal whenever # the stage (stage_id) of the Maintenance Request changes. diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py index 34ef0472c7e..a4de6be6972 100644 --- a/addons/mass_mailing/models/mail_mail.py +++ b/addons/mass_mailing/models/mail_mail.py @@ -52,7 +52,6 @@ class MailMail(models.Model): ) return url - @api.multi def _send_prepare_body(self): """ Override to add the tracking URL to the body and to add Statistic_id in shorted urls """ @@ -80,7 +79,6 @@ class MailMail(models.Model): return body - @api.multi def _send_prepare_values(self, partner=None): # TDE: temporary addition (mail was parameter) due to semi-new-API res = super(MailMail, self)._send_prepare_values(partner) @@ -94,7 +92,6 @@ class MailMail(models.Model): res['body'] = res['body'].replace(link_to_replace, unsubscribe_url if unsubscribe_url else '#') return res - @api.multi def _postprocess_sent_message(self, success_pids, failure_reason=False, failure_type=None): mail_sent = not failure_type # we consider that a recipient error is a failure with mass mailling and show them as failed for mail in self: diff --git a/addons/mass_mailing/models/mail_thread.py b/addons/mass_mailing/models/mail_thread.py index 4797fdfbff1..5195672eead 100644 --- a/addons/mass_mailing/models/mail_thread.py +++ b/addons/mass_mailing/models/mail_thread.py @@ -43,7 +43,6 @@ class MailThread(models.AbstractModel): self.env['mail.mail.statistics'].set_replied(mail_message_ids=message_ids) return super(MailThread, self).message_route_process(message, message_dict, routes) - @api.multi def message_post_with_template(self, template_id, **kwargs): # avoid having message send through `message_post*` methods being implicitly considered as # mass-mailing @@ -53,7 +52,6 @@ class MailThread(models.AbstractModel): ) return super(MailThread, no_massmail).message_post_with_template(template_id, **kwargs) - @api.multi def _message_receive_bounce(self, email, partner, mail_id=None): """In addition, an auto blacklist rule check if the email can be blacklisted to avoid sending mails indefinitely to this email address. diff --git a/addons/mass_mailing/models/mass_mailing.py b/addons/mass_mailing/models/mass_mailing.py index 4b049edd3b2..f4f598cf3c9 100644 --- a/addons/mass_mailing/models/mass_mailing.py +++ b/addons/mass_mailing/models/mass_mailing.py @@ -75,7 +75,6 @@ class MassMailingContactListRel(models.Model): vals['unsubscription_date'] = vals['opt_out'] and fields.Datetime.now() return super(MassMailingContactListRel, self).create(vals) - @api.multi def write(self, vals): if 'opt_out' in vals: vals['unsubscription_date'] = vals['opt_out'] and fields.Datetime.now() @@ -133,11 +132,9 @@ class MassMailingList(models.Model): for mailing_list in self: mailing_list.contact_nbr = data.get(mailing_list.id, 0) - @api.multi def name_get(self): return [(list.id, "%s (%s)" % (list.name, list.contact_nbr)) for list in self] - @api.multi def action_merge(self, src_lists, archive): """ Insert all the contact from the mailing lists 'src_lists' to the @@ -200,7 +197,6 @@ class MassMailingList(models.Model): if archive: (src_lists - self).write({'active': False}) - @api.multi def close_dialog(self): return {'type': 'ir.actions.act_window_close'} @@ -285,7 +281,6 @@ class MassMailingContact(models.Model): contact = self.create({'name': name, 'email': email, 'list_ids': [(4, list_id)]}) return contact.name_get()[0] - @api.multi def _message_get_default_recipients(self): return {r.id: { 'partner_ids': [], @@ -578,7 +573,6 @@ class MassMailing(models.Model): row['bounced_ratio'] = 100.0 * row['bounced'] / total self.browse(row.pop('mailing_id')).update(row) - @api.multi def _unsubscribe_token(self, res_id, email): """Generate a secure hash for this mailing list and parameters. @@ -654,7 +648,6 @@ class MassMailing(models.Model): vals['subject'] = vals['name'] return super(MassMailing, self).create(vals) - @api.multi @api.returns('self', lambda value: value.id) def copy(self, default=None): self.ensure_one() @@ -734,7 +727,6 @@ class MassMailing(models.Model): # Views & Actions #------------------------------------------------------ - @api.multi def action_duplicate(self): self.ensure_one() mass_mailing_copy = self.copy() @@ -750,7 +742,6 @@ class MassMailing(models.Model): } return False - @api.multi def action_test_mailing(self): self.ensure_one() ctx = dict(self.env.context, default_mass_mailing_id=self.id) @@ -763,22 +754,18 @@ class MassMailing(models.Model): 'context': ctx, } - @api.multi def action_schedule_date(self): self.ensure_one() action = self.env.ref('mass_mailing.mass_mailing_schedule_date_action').read()[0] action['context'] = dict(self.env.context, default_mass_mailing_id=self.id) return action - @api.multi def put_in_queue(self): self.write({'state': 'in_queue'}) - @api.multi def cancel_mass_mailing(self): self.write({'state': 'draft', 'schedule_date': False}) - @api.multi def retry_failed_mail(self): failed_mails = self.env['mail.mail'].search([('mailing_id', 'in', self.ids), ('state', '=', 'exception')]) failed_mails.mapped('statistics_ids').unlink() diff --git a/addons/mass_mailing/wizard/mail_compose_message.py b/addons/mass_mailing/wizard/mail_compose_message.py index 3f88e62552b..3f5c0c03e2e 100644 --- a/addons/mass_mailing/wizard/mail_compose_message.py +++ b/addons/mass_mailing/wizard/mail_compose_message.py @@ -14,7 +14,6 @@ class MailComposeMessage(models.TransientModel): mass_mailing_name = fields.Char(string='Mass Mailing Name') mailing_list_ids = fields.Many2many('mail.mass_mailing.list', string='Mailing List') - @api.multi def get_mail_values(self, res_ids): """ Override method that generated the mail content by creating the mail.mail.statistics values in the o2m of mail_mail, when doing pure diff --git a/addons/mass_mailing/wizard/mass_mailing_list_merge.py b/addons/mass_mailing/wizard/mass_mailing_list_merge.py index c71661b668e..9a1a0f4409f 100644 --- a/addons/mass_mailing/wizard/mass_mailing_list_merge.py +++ b/addons/mass_mailing/wizard/mass_mailing_list_merge.py @@ -27,7 +27,6 @@ class MassMailingListMerge(models.TransientModel): }) return res - @api.multi def action_mailing_lists_merge(self): if self.merge_options == 'new': self.dest_list_id = self.env['mail.mass_mailing.list'].create({ diff --git a/addons/mass_mailing/wizard/test_mailing.py b/addons/mass_mailing/wizard/test_mailing.py index 7f2459d4a07..ba66510ca68 100644 --- a/addons/mass_mailing/wizard/test_mailing.py +++ b/addons/mass_mailing/wizard/test_mailing.py @@ -12,7 +12,6 @@ class TestMassMailing(models.TransientModel): help='Comma-separated list of email addresses.', default=lambda self: self.env['mail.message']._get_default_from()) mass_mailing_id = fields.Many2one('mail.mass_mailing', string='Mailing', required=True, ondelete='cascade') - @api.multi def send_mail_test(self): self.ensure_one() mails = self.env['mail.mail'] diff --git a/addons/mass_mailing_crm/models/mass_mailing.py b/addons/mass_mailing_crm/models/mass_mailing.py index 55749142d3f..2faede45ed0 100644 --- a/addons/mass_mailing_crm/models/mass_mailing.py +++ b/addons/mass_mailing_crm/models/mass_mailing.py @@ -31,14 +31,12 @@ class MassMailing(models.Model): mass_mailing.crm_lead_count = 0 mass_mailing.crm_opportunities_count = lead_and_opportunities_count - @api.multi def action_redirect_to_leads(self): action = self.env.ref('crm.crm_lead_all_leads').read()[0] action['domain'] = self._get_crm_utm_domain() action['context'] = {'default_type': 'lead', 'active_test': False} return action - @api.multi def action_redirect_to_opportunities(self): action = self.env.ref('crm.crm_lead_opportunities').read()[0] action['view_mode'] = 'tree,kanban,graph,pivot,form,calendar' diff --git a/addons/mass_mailing_sale/models/mass_mailing.py b/addons/mass_mailing_sale/models/mass_mailing.py index 3287f5cf08b..85b797a839e 100644 --- a/addons/mass_mailing_sale/models/mass_mailing.py +++ b/addons/mass_mailing_sale/models/mass_mailing.py @@ -33,14 +33,12 @@ class MassMailing(models.Model): else: mass_mailing.sale_invoiced_amount = 0 - @api.multi def action_redirect_to_quotations(self): action = self.env.ref('sale.action_quotations_with_onboarding').read()[0] action['domain'] = self._get_sale_utm_domain() action['context'] = {'default_type': 'lead'} return action - @api.multi def action_redirect_to_invoiced(self): action = self.env.ref('account.view_move_form').read()[0] invoices = self.env['sale.order'].search(self._get_sale_utm_domain()).mapped('invoice_ids') diff --git a/addons/membership/models/account_move.py b/addons/membership/models/account_move.py index 62b7526eae5..06db8a82ce9 100644 --- a/addons/membership/models/account_move.py +++ b/addons/membership/models/account_move.py @@ -9,7 +9,6 @@ from datetime import date class AccountMove(models.Model): _inherit = 'account.move' - @api.multi def button_draft(self): # OVERRIDE to update the cancel date. res = super(AccountMove, self).button_draft() @@ -19,7 +18,6 @@ class AccountMove(models.Model): ]).write({'date_cancel': False}) return res - @api.multi def button_cancel(self): # OVERRIDE to update the cancel date. res = super(AccountMove, self).button_cancel() @@ -29,7 +27,6 @@ class AccountMove(models.Model): ]).write({'date_cancel': fields.Date.today()}) return res - @api.multi def write(self, vals): # OVERRIDE to write the partner on the membership lines. res = super(AccountMove, self).write(vals) @@ -43,7 +40,6 @@ class AccountMove(models.Model): class AccountMoveLine(models.Model): _inherit = 'account.move.line' - @api.multi def write(self, vals): # OVERRIDE res = super(AccountMoveLine, self).write(vals) diff --git a/addons/membership/models/partner.py b/addons/membership/models/partner.py index 03b69268a12..3df55ae8d96 100644 --- a/addons/membership/models/partner.py +++ b/addons/membership/models/partner.py @@ -114,7 +114,6 @@ class Partner(models.Model): partners._recompute_todo(self._fields['membership_state']) self.recompute() - @api.multi def create_membership_invoice(self, product, amount): """ Create Customer Invoice of Membership for partners. """ diff --git a/addons/membership/wizard/membership_invoice.py b/addons/membership/wizard/membership_invoice.py index 8502111a923..e1228e3aacb 100644 --- a/addons/membership/wizard/membership_invoice.py +++ b/addons/membership/wizard/membership_invoice.py @@ -18,7 +18,6 @@ class MembershipInvoice(models.TransientModel): price_dict = self.product_id.price_compute('list_price') self.member_price = price_dict.get(self.product_id.id) or False - @api.multi def membership_invoice(self): invoice_list = self.env['res.partner'].browse(self._context.get('active_ids')).create_membership_invoice(self.product_id, self.member_price) diff --git a/addons/mrp/models/mrp_bom.py b/addons/mrp/models/mrp_bom.py index ca46c616e52..26be8ffcdf5 100644 --- a/addons/mrp/models/mrp_bom.py +++ b/addons/mrp/models/mrp_bom.py @@ -110,11 +110,9 @@ class MrpBom(models.Model): for line in self.bom_line_ids: line.operation_id = False - @api.multi def name_get(self): return [(bom.id, '%s%s' % (bom.code and '%s: ' % bom.code or '', bom.product_tmpl_id.display_name)) for bom in self] - @api.multi def unlink(self): if self.env['mrp.production'].search([('bom_id', 'in', self.ids), ('state', 'not in', ['done', 'cancel'])], limit=1): raise UserError(_('You can not delete a Bill of Material with running manufacturing orders.\nPlease close or cancel it first.')) @@ -336,7 +334,6 @@ class MrpBomLine(models.Model): return True return False - @api.multi def action_see_attachments(self): domain = [ '|', diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 81c2cce8548..5131ad30b2d 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -248,7 +248,6 @@ class MrpProduction(models.Model): for production in self: production.finished_move_line_ids = production.move_finished_ids.mapped('move_line_ids') - @api.multi @api.depends('bom_id.routing_id', 'bom_id.routing_id.operation_ids') def _compute_routing(self): for production in self: @@ -257,7 +256,6 @@ class MrpProduction(models.Model): else: production.routing_id = False - @api.multi @api.depends('workorder_ids') def _compute_workorder_count(self): data = self.env['mrp.workorder'].read_group([('production_id', 'in', self.ids)], ['production_id'], ['production_id']) @@ -265,7 +263,6 @@ class MrpProduction(models.Model): for production in self: production.workorder_count = count_data.get(production.id, 0) - @api.multi @api.depends('workorder_ids.state') def _compute_workorder_done_count(self): data = self.env['mrp.workorder'].read_group([ @@ -275,7 +272,6 @@ class MrpProduction(models.Model): for production in self: production.workorder_done_count = count_data.get(production.id, 0) - @api.multi @api.depends('move_raw_ids.state', 'move_finished_ids.state', 'workorder_ids', 'workorder_ids.state', 'qty_produced', 'move_raw_ids.quantity_done', 'product_qty') def _compute_state(self): """ Compute the production state. It use the same process than stock @@ -329,7 +325,6 @@ class MrpProduction(models.Model): any_quantity_done = any([m.quantity_done > 0 for m in order.move_raw_ids]) order.unreserve_visible = not any_quantity_done and already_reserved - @api.multi @api.depends('move_raw_ids.quantity_done', 'move_finished_ids.quantity_done', 'is_locked') def _compute_post_visible(self): for order in self: @@ -338,7 +333,6 @@ class MrpProduction(models.Model): else: order.post_visible = order.is_locked and any((x.quantity_done > 0 and x.state not in ['done', 'cancel']) for x in order.move_finished_ids) - @api.multi @api.depends('workorder_ids.state', 'move_finished_ids', 'move_finished_ids.quantity_done', 'is_locked') def _get_produced_qty(self): for production in self: @@ -347,14 +341,12 @@ class MrpProduction(models.Model): production.qty_produced = qty_produced return True - @api.multi def _compute_scrap_move_count(self): data = self.env['stock.scrap'].read_group([('production_id', 'in', self.ids)], ['production_id'], ['production_id']) count_data = dict((item['production_id'][0], item['production_id_count']) for item in data) for production in self: production.scrap_count = count_data.get(production.id, 0) - @api.multi @api.depends('workorder_ids.date_planned_start', 'workorder_ids.date_planned_finished') def _compute_date_planned(self): for order in self: @@ -427,7 +419,6 @@ class MrpProduction(models.Model): self.location_src_id = self.picking_type_id.default_location_src_id.id or location.id self.location_dest_id = self.picking_type_id.default_location_dest_id.id or location.id - @api.multi def write(self, vals): res = super(MrpProduction, self).write(vals) if 'date_planned_start' in vals: @@ -454,7 +445,6 @@ class MrpProduction(models.Model): values['procurement_group_id'] = self.env["procurement.group"].create({'name': values['name']}).id return super(MrpProduction, self).create(values) - @api.multi def unlink(self): if any(production.state != 'cancel' for production in self): raise UserError(_('Cannot delete a manufacturing order not in cancel state')) @@ -547,7 +537,6 @@ class MrpProduction(models.Model): } return data - @api.multi def _update_raw_move(self, bom_line, line_data): """ :returns update_move, old_quantity, new_quantity """ quantity = line_data['qty'] @@ -608,20 +597,17 @@ class MrpProduction(models.Model): (production.move_raw_ids | production.move_finished_ids)._action_confirm() return True - @api.multi def action_assign(self): for production in self: production.move_raw_ids._action_assign() production.workorder_ids._refresh_wo_lines() return True - @api.multi def open_produce_product(self): self.ensure_one() action = self.env.ref('mrp.act_mrp_product_produce').read()[0] return action - @api.multi def button_plan(self): """ Create work orders. And probably do stuff, like things. """ orders_to_plan = self.filtered(lambda order: order.routing_id and order.state == 'confirmed') @@ -705,7 +691,6 @@ class MrpProduction(models.Model): raise UserError(_("Some work orders have already started, you cannot unplan this manufacturing order.")) self.workorder_ids.unlink() - @api.multi def _generate_workorders(self, exploded_boms): workorders = self.env['mrp.workorder'] original_one = False @@ -779,7 +764,6 @@ class MrpProduction(models.Model): error_msg += ml.product_id.display_name + ' (' + ', '.join((lots_short & ml.lot_produced_ids).mapped('name')) + ')\n' raise UserError(error_msg) - @api.multi def action_cancel(self): """ Cancels production order, unfinished stock moves and set procurement orders in exception """ @@ -822,7 +806,6 @@ class MrpProduction(models.Model): self.ensure_one() return True - @api.multi def post_inventory(self): for order in self: moves_not_to_do = order.move_raw_ids.filtered(lambda x: x.state == 'done') @@ -852,7 +835,6 @@ class MrpProduction(models.Model): moveline.write({'consume_line_ids': [(6, 0, [x for x in consume_move_lines.ids])]}) return True - @api.multi def button_mark_done(self): self.ensure_one() for wo in self.workorder_ids: @@ -871,19 +853,16 @@ class MrpProduction(models.Model): self.write({'date_finished': fields.Datetime.now()}) return True - @api.multi def do_unreserve(self): for production in self: production.move_raw_ids.filtered(lambda x: x.state not in ('done', 'cancel'))._do_unreserve() return True - @api.multi def button_unreserve(self): self.ensure_one() self.do_unreserve() return True - @api.multi def button_scrap(self): self.ensure_one() return { @@ -899,7 +878,6 @@ class MrpProduction(models.Model): 'target': 'new', } - @api.multi def action_see_move_scrap(self): self.ensure_one() action = self.env.ref('stock.action_stock_scrap').read()[0] diff --git a/addons/mrp/models/mrp_routing.py b/addons/mrp/models/mrp_routing.py index c79200ae8eb..f697df1cb3d 100644 --- a/addons/mrp/models/mrp_routing.py +++ b/addons/mrp/models/mrp_routing.py @@ -69,7 +69,6 @@ class MrpRoutingWorkcenter(models.Model): batch_size = fields.Float('Quantity to Process', default=1.0) workorder_ids = fields.One2many('mrp.workorder', 'operation_id', string="Work Orders") - @api.multi @api.depends('time_cycle_manual', 'time_mode', 'workorder_ids') def _compute_time_cycle(self): manual_ops = self.filtered(lambda operation: operation.time_mode == 'manual') @@ -86,7 +85,6 @@ class MrpRoutingWorkcenter(models.Model): else: operation.time_cycle = operation.time_cycle_manual - @api.multi def _compute_workorder_count(self): data = self.env['mrp.workorder'].read_group([ ('operation_id', 'in', self.ids), diff --git a/addons/mrp/models/mrp_unbuild.py b/addons/mrp/models/mrp_unbuild.py index f02b27e467a..35058090c9b 100644 --- a/addons/mrp/models/mrp_unbuild.py +++ b/addons/mrp/models/mrp_unbuild.py @@ -92,13 +92,11 @@ class MrpUnbuild(models.Model): vals['name'] = self.env['ir.sequence'].next_by_code('mrp.unbuild') or _('New') return super(MrpUnbuild, self).create(vals) - @api.multi def unlink(self): if 'done' in self.mapped('state'): raise UserError(_("You cannot delete an unbuild order if the state is 'Done'.")) return super(MrpUnbuild, self).unlink() - @api.multi def action_unbuild(self): self.ensure_one() if self.product_id.tracking != 'none' and not self.lot_id.id: diff --git a/addons/mrp/models/mrp_workcenter.py b/addons/mrp/models/mrp_workcenter.py index 65b05606a04..50b861b7980 100644 --- a/addons/mrp/models/mrp_workcenter.py +++ b/addons/mrp/models/mrp_workcenter.py @@ -95,7 +95,6 @@ class MrpWorkcenter(models.Model): workcenter.workorder_progress_count = result[workcenter.id].get('progress', 0) workcenter.workorder_late_count = count_data.get(workcenter.id, 0) - @api.multi @api.depends('time_ids', 'time_ids.date_end', 'time_ids.loss_type') def _compute_working_state(self): for workcenter in self: @@ -116,7 +115,6 @@ class MrpWorkcenter(models.Model): # the workcenter is blocked workcenter.working_state = 'blocked' - @api.multi def _compute_blocked_time(self): # TDE FIXME: productivity loss type should be only losses, probably count other time logs differently ?? data = self.env['mrp.workcenter.productivity'].read_group([ @@ -129,7 +127,6 @@ class MrpWorkcenter(models.Model): for workcenter in self: workcenter.blocked_time = count_data.get(workcenter.id, 0.0) / 60.0 - @api.multi def _compute_productive_time(self): # TDE FIXME: productivity loss type should be only losses, probably count other time logs differently data = self.env['mrp.workcenter.productivity'].read_group([ @@ -150,7 +147,6 @@ class MrpWorkcenter(models.Model): else: order.oee = 0.0 - @api.multi def _compute_performance(self): wo_data = self.env['mrp.workorder'].read_group([ ('date_start', '>=', fields.Datetime.to_string(datetime.datetime.now() - relativedelta.relativedelta(months=1))), @@ -164,13 +160,11 @@ class MrpWorkcenter(models.Model): else: workcenter.performance = 0.0 - @api.multi @api.constrains('capacity') def _check_capacity(self): if any(workcenter.capacity <= 0.0 for workcenter in self): raise exceptions.UserError(_('The capacity must be strictly positive.')) - @api.multi def unblock(self): self.ensure_one() if self.working_state != 'blocked': @@ -186,7 +180,6 @@ class MrpWorkcenter(models.Model): return super(MrpWorkcenter, self.with_context({ 'default_resource_type': 'material'})).create(vals) - @api.multi def action_work_order(self): action = self.env.ref('mrp.action_work_orders').read()[0] return action @@ -264,7 +257,6 @@ class MrpWorkcenterProductivity(models.Model): else: blocktime.duration = 0.0 - @api.multi def button_block(self): self.ensure_one() self.workcenter_id.order_ids.end_all() diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py index 5a7e1c257f9..03ff2c69bcf 100644 --- a/addons/mrp/models/mrp_workorder.py +++ b/addons/mrp/models/mrp_workorder.py @@ -199,7 +199,6 @@ class MrpWorkorder(models.Model): else: workorder.allowed_lots_domain = allowed_lot_ids - @api.multi def name_get(self): return [(wo.id, "%s - %s - %s" % (wo.production_id.name, wo.product_id.name, wo.name)) for wo in self] @@ -232,14 +231,12 @@ class MrpWorkorder(models.Model): else: order.is_user_working = False - @api.multi def _compute_scrap_move_count(self): data = self.env['stock.scrap'].read_group([('workorder_id', 'in', self.ids)], ['workorder_id'], ['workorder_id']) count_data = dict((item['workorder_id'][0], item['workorder_id_count']) for item in data) for workorder in self: workorder.scrap_count = count_data.get(workorder.id, 0) - @api.multi @api.depends('date_planned_finished', 'production_id.date_planned_finished') def _compute_color(self): late_orders = self.filtered(lambda x: x.production_id.date_planned_finished and x.date_planned_finished > x.production_id.date_planned_finished) @@ -248,7 +245,6 @@ class MrpWorkorder(models.Model): for order in (self - late_orders): order.color = 2 - @api.multi def write(self, values): if list(values.keys()) != ['time_ids'] and any(workorder.state == 'done' for workorder in self): raise UserError(_('You can not change the finished work order.')) @@ -331,7 +327,6 @@ class MrpWorkorder(models.Model): return True return False - @api.multi def record_production(self): if not self: return True @@ -436,7 +431,6 @@ class MrpWorkorder(models.Model): else: current_lot_lines.qty_done += self.qty_producing - @api.multi def _start_nextworkorder(self): rounding = self.product_id.uom_id.rounding if self.next_work_order_id.state == 'pending' and ( @@ -446,7 +440,6 @@ class MrpWorkorder(models.Model): float_compare(self.operation_id.batch_size, self.qty_produced, precision_rounding=rounding) <= 0)): self.next_work_order_id.state = 'ready' - @api.multi def button_start(self): self.ensure_one() # As button_start is automatically called in the new view @@ -479,13 +472,11 @@ class MrpWorkorder(models.Model): 'date_start': datetime.now(), }) - @api.multi def button_finish(self): self.ensure_one() self.end_all() return self.write({'state': 'done', 'date_finished': fields.Datetime.now()}) - @api.multi def end_previous(self, doall=False): """ @param: doall: This will close all open time lines on the open work orders when doall = True, otherwise @@ -518,26 +509,21 @@ class MrpWorkorder(models.Model): not_productive_timelines.write({'loss_id': loss_id.id}) return True - @api.multi def end_all(self): return self.end_previous(doall=True) - @api.multi def button_pending(self): self.end_previous() return True - @api.multi def button_unblock(self): for order in self: order.workcenter_id.unblock() return True - @api.multi def action_cancel(self): return self.write({'state': 'cancel'}) - @api.multi def button_done(self): if any([x.state in ('done', 'cancel') for x in self]): raise UserError(_('A Manufacturing Order is already done or cancelled.')) @@ -545,7 +531,6 @@ class MrpWorkorder(models.Model): return self.write({'state': 'done', 'date_finished': datetime.now()}) - @api.multi def button_scrap(self): self.ensure_one() return { @@ -561,14 +546,12 @@ class MrpWorkorder(models.Model): 'target': 'new', } - @api.multi def action_see_move_scrap(self): self.ensure_one() action = self.env.ref('stock.action_stock_scrap').read()[0] action['domain'] = [('workorder_id', '=', self.id)] return action - @api.multi @api.depends('qty_production', 'qty_produced') def _compute_qty_remaining(self): for wo in self: diff --git a/addons/mrp/models/product.py b/addons/mrp/models/product.py index 13dfecb427d..dd874cd31c5 100644 --- a/addons/mrp/models/product.py +++ b/addons/mrp/models/product.py @@ -22,13 +22,11 @@ class ProductTemplate(models.Model): for product in self: product.bom_count = self.env['mrp.bom'].search_count([('product_tmpl_id', '=', product.id)]) - @api.multi def _compute_used_in_bom_count(self): for template in self: template.used_in_bom_count = self.env['mrp.bom'].search_count( [('bom_line_ids.product_id', 'in', template.product_variant_ids.ids)]) - @api.multi def action_used_in_bom(self): self.ensure_one() action = self.env.ref('mrp.mrp_bom_form_action').read()[0] @@ -39,7 +37,6 @@ class ProductTemplate(models.Model): for template in self: template.mrp_product_qty = float_round(sum(template.mapped('product_variant_ids').mapped('mrp_product_qty')), precision_rounding=template.uom_id.rounding) - @api.multi def action_view_mos(self): action = self.env.ref('mrp.mrp_production_report').read()[0] action['domain'] = [('state', '=', 'done'), ('product_tmpl_id', 'in', self.ids)] @@ -63,12 +60,10 @@ class ProductProduct(models.Model): for product in self: product.bom_count = self.env['mrp.bom'].search_count(['|', ('product_id', '=', product.id), '&', ('product_id', '=', False), ('product_tmpl_id', '=', product.product_tmpl_id.id)]) - @api.multi def _compute_used_in_bom_count(self): for product in self: product.used_in_bom_count = self.env['mrp.bom'].search_count([('bom_line_ids.product_id', '=', product.id)]) - @api.multi def action_used_in_bom(self): self.ensure_one() action = self.env.ref('mrp.mrp_bom_form_action').read()[0] @@ -118,7 +113,6 @@ class ProductProduct(models.Model): else: super(ProductProduct, self)._compute_quantities() - @api.multi def action_view_bom(self): action = self.env.ref('mrp.product_open_bom').read()[0] template_ids = self.mapped('product_tmpl_id').ids @@ -130,7 +124,6 @@ class ProductProduct(models.Model): action['domain'] = ['|', ('product_id', 'in', self.ids), '&', ('product_id', '=', False), ('product_tmpl_id', 'in', template_ids)] return action - @api.multi def action_view_mos(self): action = self.env.ref('mrp.mrp_production_report').read()[0] action['domain'] = [('state', '=', 'done'), ('product_id', 'in', self.ids)] diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index 331b744397d..3289c9aa525 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -38,7 +38,6 @@ class StockMoveLine(models.Model): return False return super(StockMoveLine, self)._reservation_is_updatable(quantity, reserved_quant) - @api.multi def write(self, vals): for move_line in self: if move_line.move_id.production_id and 'lot_id' in vals: diff --git a/addons/mrp/models/stock_rule.py b/addons/mrp/models/stock_rule.py index 91f57647470..5e7e9d1bf81 100644 --- a/addons/mrp/models/stock_rule.py +++ b/addons/mrp/models/stock_rule.py @@ -66,7 +66,6 @@ class StockRule(models.Model): fields += ['bom_line_id'] return fields - @api.multi def _get_matching_bom(self, product_id, company_id, values): if values.get('bom_id', False): return values['bom_id'] diff --git a/addons/mrp/models/stock_warehouse.py b/addons/mrp/models/stock_warehouse.py index a21b0f1277f..4178fdb1b49 100644 --- a/addons/mrp/models/stock_warehouse.py +++ b/addons/mrp/models/stock_warehouse.py @@ -239,14 +239,12 @@ class StockWarehouse(models.Model): }) return data - @api.multi def write(self, vals): if any(field in vals for field in ('manufacture_steps', 'manufacture_to_resupply')): for warehouse in self: warehouse._update_location_manufacture(vals.get('manufacture_steps', warehouse.manufacture_steps)) return super(StockWarehouse, self).write(vals) - @api.multi def _get_all_routes(self): routes = super(StockWarehouse, self)._get_all_routes() routes |= self.filtered(lambda self: self.manufacture_to_resupply and self.manufacture_pull_id and self.manufacture_pull_id.route_id).mapped('manufacture_pull_id').mapped('route_id') @@ -256,7 +254,6 @@ class StockWarehouse(models.Model): self.mapped('pbm_loc_id').write({'active': new_manufacture_step != 'mrp_one_step'}) self.mapped('sam_loc_id').write({'active': new_manufacture_step == 'pbm_sam'}) - @api.multi def _update_name_and_code(self, name=False, code=False): res = super(StockWarehouse, self)._update_name_and_code(name, code) # change the manufacture stock rule name diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py index e92f053780a..d2fad9cc431 100644 --- a/addons/mrp/wizard/change_production_qty.py +++ b/addons/mrp/wizard/change_production_qty.py @@ -39,7 +39,6 @@ class ChangeProductionQty(models.TransientModel): move[0].write({'product_uom_qty': move.product_uom_qty - qty}) return modification - @api.multi def change_prod_qty(self): precision = self.env['decimal.precision'].precision_get('Product Unit of Measure') for wizard in self: diff --git a/addons/mrp/wizard/mrp_product_produce.py b/addons/mrp/wizard/mrp_product_produce.py index 981547e0e8b..d4f402a16af 100644 --- a/addons/mrp/wizard/mrp_product_produce.py +++ b/addons/mrp/wizard/mrp_product_produce.py @@ -85,7 +85,6 @@ class MrpProductProduce(models.TransientModel): 'target': 'new', } - @api.multi def do_produce(self): """ Save the current wizard and go back to the MO. """ self.ensure_one() @@ -99,7 +98,6 @@ class MrpProductProduce(models.TransientModel): todo_quantity = todo_quantity if (todo_quantity > 0) else 0 return todo_quantity - @api.multi def _record_production(self): # Check all the product_produce line have a move id (the user can add product # to consume directly in the wizard) diff --git a/addons/mrp_account/models/mrp_production.py b/addons/mrp_account/models/mrp_production.py index 4a2d0f52a29..c0631356b4e 100644 --- a/addons/mrp_account/models/mrp_production.py +++ b/addons/mrp_account/models/mrp_production.py @@ -62,7 +62,6 @@ class MrpProduction(models.Model): # able to produce orders AccountAnalyticLine.create(vals) - @api.multi def button_mark_done(self): self.ensure_one() res = super(MrpProduction, self).button_mark_done() diff --git a/addons/note/models/note.py b/addons/note/models/note.py index d8a0a9b94f6..6fbe39477df 100644 --- a/addons/note/models/note.py +++ b/addons/note/models/note.py @@ -60,7 +60,6 @@ class Note(models.Model): text = html2plaintext(note.memo) if note.memo else '' note.name = text.strip().replace('*', '').split("\n")[0] - @api.multi def _compute_stage_id(self): first_user_stage = self.env['note.stage'].search([('user_id', '=', self.env.uid)], limit=1) for note in self: @@ -70,7 +69,6 @@ class Note(models.Model): if not note.stage_id: note.stage_id = first_user_stage - @api.multi def _inverse_stage_id(self): for note in self.filtered('stage_id'): note.stage_ids = note.stage_id + note.stage_ids.filtered(lambda stage: stage.user_id != self.env.user) @@ -124,10 +122,8 @@ class Note(models.Model): return result return super(Note, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy) - @api.multi def action_close(self): return self.write({'open': False, 'date_done': fields.date.today()}) - @api.multi def action_open(self): return self.write({'open': True}) diff --git a/addons/pad/models/pad.py b/addons/pad/models/pad.py index 404e645e6f0..c43246e1441 100644 --- a/addons/pad/models/pad.py +++ b/addons/pad/models/pad.py @@ -100,7 +100,6 @@ class PadCommon(models.AbstractModel): # TODO # reverse engineer protocol to be setHtml without using the api key - @api.multi def write(self, vals): self._set_field_to_pad(vals) self._set_pad_to_field(vals) diff --git a/addons/partner_autocomplete/models/res_config_settings.py b/addons/partner_autocomplete/models/res_config_settings.py index baa00e62d4d..2ae3fd6d508 100644 --- a/addons/partner_autocomplete/models/res_config_settings.py +++ b/addons/partner_autocomplete/models/res_config_settings.py @@ -12,7 +12,6 @@ class ResConfigSettings(models.TransientModel): for config in self: config.partner_autocomplete_insufficient_credit = self.env['iap.account'].get_credits('partner_autocomplete') <= 0 - @api.multi def redirect_to_buy_autocomplete_credit(self): Account = self.env['iap.account'] return { diff --git a/addons/partner_autocomplete/models/res_partner.py b/addons/partner_autocomplete/models/res_partner.py index e0ed09a799d..2259d987c18 100644 --- a/addons/partner_autocomplete/models/res_partner.py +++ b/addons/partner_autocomplete/models/res_partner.py @@ -186,7 +186,6 @@ class ResPartner(models.Model): return partners - @api.multi def write(self, values): res = super(ResPartner, self).write(values) if len(self) == 1: diff --git a/addons/payment/models/account_invoice.py b/addons/payment/models/account_invoice.py index de16fb595c8..882a25b6279 100644 --- a/addons/payment/models/account_invoice.py +++ b/addons/payment/models/account_invoice.py @@ -18,12 +18,10 @@ class AccountMove(models.Model): for trans in self: trans.authorized_transaction_ids = trans.transaction_ids.filtered(lambda t: t.state == 'authorized') - @api.multi def get_portal_last_transaction(self): self.ensure_one() return self.transaction_ids.get_last_transaction() - @api.multi def _create_payment_transaction(self, vals): '''Similar to self.env['payment.transaction'].create(vals) but the values are filled with the current invoices fields (e.g. the partner or the currency). @@ -89,10 +87,8 @@ class AccountMove(models.Model): return transaction - @api.multi def payment_action_capture(self): self.authorized_transaction_ids.s2s_capture_transaction() - @api.multi def payment_action_void(self): self.authorized_transaction_ids.s2s_void_transaction() diff --git a/addons/payment/models/account_payment.py b/addons/payment/models/account_payment.py index 220cb37db38..fe6f31eeb21 100644 --- a/addons/payment/models/account_payment.py +++ b/addons/payment/models/account_payment.py @@ -13,7 +13,6 @@ class AccountPayment(models.Model): payment_token_id = fields.Many2one('payment.token', string="Saved payment token", domain=[('acquirer_id.capture_manually', '=', False)], help="Note that tokens from acquirers set to only authorize transactions (instead of capturing the amount) are not available.") - @api.multi def _get_payment_chatter_link(self): self.ensure_one() return '%s' % (self.id, self.name) @@ -33,7 +32,6 @@ class AccountPayment(models.Model): res['domain'] = {'payment_token_id': domain} return res - @api.multi def _prepare_payment_transaction_vals(self): self.ensure_one() return { @@ -48,7 +46,6 @@ class AccountPayment(models.Model): 'type': 'server2server', } - @api.multi def _create_payment_transaction(self, vals=None): for pay in self: if pay.payment_transaction_id: @@ -76,7 +73,6 @@ class AccountPayment(models.Model): self.mapped('payment_transaction_id').filtered(lambda x: x.state == 'done' and not x.is_processed)._post_process_after_done() return res - @api.multi def post(self): # Post the payments "normally" if no transactions are needed. # If not, let the acquirer updates the state. diff --git a/addons/payment/models/chart_template.py b/addons/payment/models/chart_template.py index ddf814d7d93..0e7ef826c13 100644 --- a/addons/payment/models/chart_template.py +++ b/addons/payment/models/chart_template.py @@ -6,7 +6,6 @@ from odoo import api, fields, models, _ class AccountChartTemplate(models.Model): _inherit = 'account.chart.template' - @api.multi def _create_bank_journals(self, company, acc_template_ref): res = super(AccountChartTemplate, self)._create_bank_journals(company, acc_template_ref) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 7b747de0ce6..2ae15c91fb9 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -187,7 +187,6 @@ class PaymentAcquirer(models.Model): return [('provider', 'in', tokenized)] return [('provider', 'not in', tokenized)] - @api.multi def _compute_feature_support(self): feature_support = self._get_feature_support() for acquirer in self: @@ -195,7 +194,6 @@ class PaymentAcquirer(models.Model): acquirer.authorize_implemented = acquirer.provider in feature_support['authorize'] acquirer.token_implemented = acquirer.provider in feature_support['tokenize'] - @api.multi def _check_required_if_provider(self): """ If the field has 'required_if_provider="I am interested by this lead.
') if comment: @@ -186,7 +179,6 @@ class CrmLead(models.Model): lead.message_post(body=message) lead.sudo().convert_opportunity(lead.partner_id.id) # sudo required to convert partner data - @api.multi def partner_desinterested(self, comment=False, contacted=False, spam=False): if contacted: message = '%s
' % _('I am not interested by this lead. I contacted the lead.') @@ -210,7 +202,6 @@ class CrmLead(models.Model): values['partner_declined_ids'] = [(4, p, 0) for p in partner_ids.ids] self.sudo().write(values) - @api.multi def update_lead_portal(self, values): self.check_access_rights('write') for lead in self: @@ -275,7 +266,6 @@ class CrmLead(models.Model): # DO NOT FORWARD PORT IN MASTER # instead, crm.lead should implement portal.mixin # - @api.multi def get_access_action(self, access_uid=None): """ Instead of the classic form view, redirect to the online document for portal users or if force_website=True in the context. """ diff --git a/addons/website_crm_partner_assign/models/res_partner.py b/addons/website_crm_partner_assign/models/res_partner.py index e3973d596af..3bf89a04ae9 100644 --- a/addons/website_crm_partner_assign/models/res_partner.py +++ b/addons/website_crm_partner_assign/models/res_partner.py @@ -17,7 +17,6 @@ class ResPartnerGrade(models.Model): partner_weight = fields.Integer('Level Weight', default=1, help="Gives the probability to assign a lead to this partner. (0 means no assignation.)") - @api.multi def _compute_website_url(self): super(ResPartnerGrade, self)._compute_website_url() for grade in self: diff --git a/addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py b/addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py index 5b672a91ab4..68be6600641 100644 --- a/addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py +++ b/addons/website_crm_partner_assign/wizard/crm_forward_to_partner.py @@ -53,7 +53,6 @@ class CrmLeadForwardToPartner(models.TransientModel): res['assignation_lines'].append((0, 0, self._convert_to_assignation_line(lead, partner))) return res - @api.multi def action_forward(self): self.ensure_one() template = self.env.ref('website_crm_partner_assign.email_template_lead_forward_mail', False) diff --git a/addons/website_event/models/event.py b/addons/website_event/models/event.py index 17d9b1bd328..ad7f56abf8d 100644 --- a/addons/website_event/models/event.py +++ b/addons/website_event/models/event.py @@ -39,7 +39,6 @@ class Event(models.Model): domain = ['&', '|', ('email', '=', email), ('partner_id', '=', self.env.user.partner_id.id), ('event_id', '=', event.id)] event.is_participating = self.env['event.registration'].search_count(domain) - @api.multi @api.depends('name') def _compute_website_url(self): super(Event, self)._compute_website_url() @@ -81,7 +80,6 @@ class Event(models.Model): res._toggle_create_website_menus(vals) return res - @api.multi def write(self, vals): res = super(Event, self).write(vals) self._toggle_create_website_menus(vals) @@ -100,21 +98,18 @@ class Event(models.Model): }) return menu - @api.multi def google_map_img(self, zoom=8, width=298, height=298): self.ensure_one() if self.address_id: return self.sudo().address_id.google_map_img(zoom=zoom, width=width, height=height) return None - @api.multi def google_map_link(self, zoom=8): self.ensure_one() if self.address_id: return self.sudo().address_id.google_map_link(zoom=zoom) return None - @api.multi def _track_subtype(self, init_values): self.ensure_one() if 'is_published' in init_values and self.is_published: @@ -123,7 +118,6 @@ class Event(models.Model): return self.env.ref('website_event.mt_event_unpublished') return super(Event, self)._track_subtype(init_values) - @api.multi def action_open_badge_editor(self): """ open the event badge editor : redirect to the report page of event badge report """ self.ensure_one() diff --git a/addons/website_event_sale/models/sale_order.py b/addons/website_event_sale/models/sale_order.py index cd25e6e1943..a65b007a71f 100644 --- a/addons/website_event_sale/models/sale_order.py +++ b/addons/website_event_sale/models/sale_order.py @@ -7,7 +7,6 @@ from odoo.exceptions import UserError class SaleOrder(models.Model): _inherit = "sale.order" - @api.multi def _cart_find_product_line(self, product_id=None, line_id=None, **kwargs): self.ensure_one() lines = super(SaleOrder, self)._cart_find_product_line(product_id, line_id) @@ -18,7 +17,6 @@ class SaleOrder(models.Model): domain.append(('event_ticket_id', '=', self.env.context.get("event_ticket_id"))) return self.env['sale.order.line'].sudo().search(domain) - @api.multi def _website_product_id_change(self, order_id, product_id, qty=0): order = self.env['sale.order'].sudo().browse(order_id) if self._context.get('pricelist') != order.pricelist_id.id: @@ -49,7 +47,6 @@ class SaleOrder(models.Model): return values - @api.multi def _cart_update(self, product_id=None, line_id=None, add_qty=0, set_qty=0, **kwargs): OrderLine = self.env['sale.order.line'] @@ -101,7 +98,6 @@ class SaleOrder(models.Model): class SaleOrderLine(models.Model): _inherit = "sale.order.line" - @api.multi @api.depends('product_id.display_name', 'event_ticket_id.display_name') def _compute_name_short(self): """ If the sale order line concerns a ticket, we don't want the product name, but the ticket name instead. diff --git a/addons/website_event_track/models/event.py b/addons/website_event_track/models/event.py index c95d7d29059..b77533126cd 100644 --- a/addons/website_event_track/models/event.py +++ b/addons/website_event_track/models/event.py @@ -47,14 +47,12 @@ class Event(models.Model): 'event.track.tag', relation='event_track_tags_rel', string='Track Tags', compute='_compute_tracks_tag_ids', store=True) - @api.multi def _compute_track_count(self): data = self.env['event.track'].read_group([('stage_id.is_cancel', '!=', True)], ['event_id'], ['event_id']) result = dict((data['event_id'][0], data['event_id_count']) for data in data) for event in self: event.track_count = result.get(event.id, 0) - @api.multi def _compute_sponsor_count(self): data = self.env['event.sponsor'].read_group([], ['event_id'], ['event_id']) result = dict((data['event_id'][0], data['event_id_count']) for data in data) @@ -99,7 +97,6 @@ class Event(models.Model): res = [(_('Talk Proposals'), '/event/%s/track_proposal' % slug(self), False, 'track_proposal')] return res - @api.multi @api.depends('track_ids.tag_ids') def _compute_tracks_tag_ids(self): for event in self: diff --git a/addons/website_event_track/models/event_track.py b/addons/website_event_track/models/event_track.py index b24d15cbd39..6f0a72d31c6 100644 --- a/addons/website_event_track/models/event_track.py +++ b/addons/website_event_track/models/event_track.py @@ -90,7 +90,6 @@ class Track(models.Model): 'Priority', required=True, default='1') image = fields.Binary('Image', related='partner_id.image_medium', store=True, readonly=False) - @api.multi @api.depends('name') def _compute_website_url(self): super(Track, self)._compute_website_url() @@ -119,7 +118,6 @@ class Track(models.Model): return track - @api.multi def write(self, vals): if 'stage_id' in vals and 'kanban_state' not in vals: vals['kanban_state'] = 'normal' @@ -133,7 +131,6 @@ class Track(models.Model): """ Always display all stages """ return stages.search([], order=order) - @api.multi def _track_template(self, changes): res = super(Track, self)._track_template(changes) track = self[0] @@ -146,7 +143,6 @@ class Track(models.Model): }) return res - @api.multi def _track_subtype(self, init_values): self.ensure_one() if 'kanban_state' in init_values and self.kanban_state == 'blocked': @@ -155,7 +151,6 @@ class Track(models.Model): return self.env.ref('website_event_track.mt_track_ready') return super(Track, self)._track_subtype(init_values) - @api.multi def _message_get_suggested_recipients(self): recipients = super(Track, self)._message_get_suggested_recipients() for track in self: @@ -177,7 +172,6 @@ class Track(models.Model): ]).write({'partner_id': new_partner.id}) return super(Track, self)._message_post_after_hook(message, msg_vals) - @api.multi def open_track_speakers_list(self): return { 'name': _('Speakers'), diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py index 5a98dc12a41..3bd01177ec7 100644 --- a/addons/website_forum/models/forum.py +++ b/addons/website_forum/models/forum.py @@ -129,7 +129,6 @@ class Forum(models.Model): def create(self, values): return super(Forum, self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True)).create(values) - @api.multi def write(self, vals): res = super(Forum, self).write(vals) if 'active' in vals: @@ -291,14 +290,12 @@ class Post(models.Model): else: post.relevancy = 0 - @api.multi def _get_user_vote(self): votes = self.env['forum.post.vote'].search_read([('post_id', 'in', self._ids), ('user_id', '=', self._uid)], ['vote', 'post_id']) mapped_vote = dict([(v['post_id'][0], v['vote']) for v in votes]) for vote in self: vote.user_vote = mapped_vote.get(vote.id, 0) - @api.multi @api.depends('vote_ids.vote') def _get_vote_count(self): read_group_res = self.env['forum.post.vote'].read_group([('post_id', 'in', self._ids)], ['post_id', 'vote'], ['post_id', 'vote'], lazy=False) @@ -342,7 +339,6 @@ class Post(models.Model): for post in self: post.has_validated_answer = any(answer.is_correct for answer in post.child_ids) - @api.multi def _get_post_karma_rights(self): user = self.env.user is_admin = self.env.is_admin() @@ -435,7 +431,6 @@ class Post(models.Model): raise KarmaError(_('%d karma required to edit a post.') % post.karma_edit) return super(Post, self).get_mail_message_access(res_ids, operation, model_name=model_name) - @api.multi def write(self, vals): trusted_keys = ['active', 'is_correct', 'tag_ids'] # fields where security is checked manually if 'content' in vals: @@ -490,7 +485,6 @@ class Post(models.Model): answers.write({'active': vals['active']}) return res - @api.multi def post_notification(self): for post in self: tag_partners = post.tag_ids.mapped('message_partner_ids') @@ -520,7 +514,6 @@ class Post(models.Model): subtype_id=self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note')) return True - @api.multi def reopen(self): if any(post.parent_id or post.state != 'close' for post in self): return False @@ -542,7 +535,6 @@ class Post(models.Model): self.sudo().write({'state': 'active'}) - @api.multi def close(self, reason_id): if any(post.parent_id for post in self): return False @@ -630,7 +622,6 @@ class Post(models.Model): }) return True - @api.multi def mark_as_offensive_batch(self, key, values): spams = self.browse() if key == 'create_uid': @@ -644,7 +635,6 @@ class Post(models.Model): _logger.info('User %s marked as spams (in batch): %s' % (self.env.uid, spams)) return spams.mark_as_offensive(reason_id) - @api.multi def unlink(self): for post in self: if not post.can_unlink: @@ -656,7 +646,6 @@ class Post(models.Model): self.env.user.sudo().add_karma(post.forum_id.karma_gen_answer_accepted * -1) return super(Post, self).unlink() - @api.multi def bump(self): """ Bump a question: trigger a write_date by writing on a dummy bump_date field. One cannot bump a question more than once every 10 days. """ @@ -666,7 +655,6 @@ class Post(models.Model): return self.sudo().write({'bump_date': fields.Datetime.now()}) return False - @api.multi def vote(self, upvote=True): Vote = self.env['forum.post.vote'] vote_ids = Vote.search([('post_id', 'in', self._ids), ('user_id', '=', self._uid)]) @@ -685,7 +673,6 @@ class Post(models.Model): Vote.create({'post_id': post_id, 'vote': new_vote}) return {'vote_count': self.vote_count, 'user_vote': new_vote} - @api.multi def convert_answer_to_comment(self): """ Tools to convert an answer (forum.post) to a comment (mail.message). The original post is unlinked and a new comment is posted on the question @@ -778,12 +765,10 @@ class Post(models.Model): result.append(comment.unlink()) return result - @api.multi def set_viewed(self): self._cr.execute("""UPDATE forum_post SET views = views+1 WHERE id IN %s""", (self._ids,)) return True - @api.multi def get_access_action(self, access_uid=None): """ Instead of the classic form view, redirect to the post on the website directly """ self.ensure_one() @@ -795,7 +780,6 @@ class Post(models.Model): 'res_id': self.id, } - @api.multi def _notify_get_groups(self): """ Add access button to everyone if the document is active. """ groups = super(Post, self)._notify_get_groups() @@ -806,7 +790,6 @@ class Post(models.Model): return groups - @api.multi @api.returns('mail.message', lambda value: value.id) def message_post(self, message_type='notification', **kwargs): if self.ids and message_type == 'comment': # user comments have a restriction on karma @@ -829,7 +812,6 @@ class Post(models.Model): kwargs['record_name'] = self.parent_id.name return super(Post, self).message_post(message_type=message_type, **kwargs) - @api.multi def _notify_record_by_inbox(self, message, recipients_data, msg_vals=False, **kwargs): """ Override to avoid keeping all notified recipients of a comment. We avoid tracking needaction on post comments. Only emails should be @@ -887,7 +869,6 @@ class Vote(models.Model): vote._vote_update_karma('0', vote.vote) return vote - @api.multi def write(self, values): # can't modify owner of a vote if not self.env.is_admin(): @@ -951,7 +932,6 @@ class Tags(models.Model): ('name_uniq', 'unique (name, forum_id)', "Tag name already exists !"), ] - @api.multi @api.depends("post_ids.tag_ids", "post_ids.state") def _get_posts_count(self): for tag in self: diff --git a/addons/website_forum/models/res_users.py b/addons/website_forum/models/res_users.py index 35a5fc32545..5e5b88f34fb 100644 --- a/addons/website_forum/models/res_users.py +++ b/addons/website_forum/models/res_users.py @@ -10,7 +10,6 @@ class Users(models.Model): create_date = fields.Datetime('Create Date', readonly=True, index=True) forum_waiting_posts_count = fields.Integer('Waiting post', compute="_get_user_waiting_post") - @api.multi def _get_user_waiting_post(self): for user in self: Post = self.env['forum.post'] @@ -18,7 +17,6 @@ class Users(models.Model): user.forum_waiting_posts_count = Post.search_count(domain) # Wrapper for call_kw with inherits - @api.multi def open_website_url(self): return self.mapped('partner_id').open_website_url() diff --git a/addons/website_hr_recruitment/models/hr_recruitment.py b/addons/website_hr_recruitment/models/hr_recruitment.py index 1cbaab7541b..4f250a623e1 100644 --- a/addons/website_hr_recruitment/models/hr_recruitment.py +++ b/addons/website_hr_recruitment/models/hr_recruitment.py @@ -46,13 +46,11 @@ class Job(models.Model): website_description = fields.Html('Website description', translate=html_translate, sanitize_attributes=False, default=_get_default_website_description, prefetch=False) - @api.multi def _compute_website_url(self): super(Job, self)._compute_website_url() for job in self: job.website_url = "/jobs/detail/%s" % job.id - @api.multi def set_open(self): self.write({'website_published': False}) return super(Job, self).set_open() diff --git a/addons/website_livechat/models/im_livechat.py b/addons/website_livechat/models/im_livechat.py index 6dc57e0845b..282966c90cc 100644 --- a/addons/website_livechat/models/im_livechat.py +++ b/addons/website_livechat/models/im_livechat.py @@ -11,7 +11,6 @@ class ImLivechatChannel(models.Model): _name = 'im_livechat.channel' _inherit = ['im_livechat.channel', 'website.published.mixin'] - @api.multi def _compute_website_url(self): super(ImLivechatChannel, self)._compute_website_url() for channel in self: diff --git a/addons/website_livechat/models/website.py b/addons/website_livechat/models/website.py index c52dc9a09f0..d842c97a445 100644 --- a/addons/website_livechat/models/website.py +++ b/addons/website_livechat/models/website.py @@ -10,7 +10,6 @@ class Website(models.Model): channel_id = fields.Many2one('im_livechat.channel', string='Website Live Chat Channel') - @api.multi def get_livechat_channel_info(self): """ Get the livechat info dict (button text, channel name, ...) for the livechat channel of the current website. diff --git a/addons/website_mail/models/mail_message.py b/addons/website_mail/models/mail_message.py index 911571787cf..8070c7d7fcc 100644 --- a/addons/website_mail/models/mail_message.py +++ b/addons/website_mail/models/mail_message.py @@ -31,7 +31,6 @@ class MailMessage(models.Model): domain = super(MailMessage, self)._non_employee_message_domain() return expression.AND([domain, [('website_published', '=', True)]]) - @api.multi def _compute_description(self): for message in self: if message.subject: @@ -50,7 +49,6 @@ class MailMessage(models.Model): return super(MailMessage, self)._search(args, offset=offset, limit=limit, order=order, count=count, access_rights_uid=access_rights_uid) - @api.multi def check_access_rule(self, operation): """ Add Access rules of mail.message for non-employee user: - read: @@ -65,7 +63,6 @@ class MailMessage(models.Model): ) return super(MailMessage, self).check_access_rule(operation=operation) - @api.multi def _portal_message_format(self, fields_list): fields_list += ['website_published'] return super(MailMessage, self)._portal_message_format(fields_list) diff --git a/addons/website_mail_channel/models/mail_channel.py b/addons/website_mail_channel/models/mail_channel.py index c7612aebcea..6778a11f4a2 100644 --- a/addons/website_mail_channel/models/mail_channel.py +++ b/addons/website_mail_channel/models/mail_channel.py @@ -13,7 +13,6 @@ from odoo.addons.http_routing.models.ir_http import slug class MailGroup(models.Model): _inherit = 'mail.channel' - @api.multi def _notify_email_header_dict(self): headers = super(MailGroup, self)._notify_email_header_dict() base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') @@ -22,7 +21,6 @@ class MailGroup(models.Model): headers['List-Unsubscribe'] = '<%s/groups?unsubscribe>' % (base_url,), return headers - @api.multi def _send_confirmation_email(self, partner_ids, unsubscribe=False): base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') route = "/groups/%(action)s/%(channel)s/%(partner)s/%(token)s" @@ -50,7 +48,6 @@ class MailGroup(models.Model): return True - @api.multi def _generate_action_token(self, partner_id, action='unsubscribe'): self.ensure_one() secret = self.env['ir.config_parameter'].sudo().get_param('database.secret') diff --git a/addons/website_mail_channel/models/mail_mail.py b/addons/website_mail_channel/models/mail_mail.py index 8032aa03514..271e245e6f8 100644 --- a/addons/website_mail_channel/models/mail_mail.py +++ b/addons/website_mail_channel/models/mail_mail.py @@ -8,7 +8,6 @@ from odoo.addons.http_routing.models.ir_http import slug class MailMail(models.Model): _inherit = 'mail.mail' - @api.multi def _send_prepare_body(self): """ Short-circuit parent method for mail groups, replace the default footer with one appropriate for mailing-lists.""" diff --git a/addons/website_partner/models/res_partner.py b/addons/website_partner/models/res_partner.py index 5c49c3344bc..d80f2b6f056 100644 --- a/addons/website_partner/models/res_partner.py +++ b/addons/website_partner/models/res_partner.py @@ -11,7 +11,6 @@ class WebsiteResPartner(models.Model): website_description = fields.Html('Website Partner Full Description', strip_style=True) website_short_description = fields.Text('Website Partner Short Description') - @api.multi def _compute_website_url(self): super(WebsiteResPartner, self)._compute_website_url() for partner in self: diff --git a/addons/website_profile/models/res_users.py b/addons/website_profile/models/res_users.py index fd440665f44..6b184ddcca4 100644 --- a/addons/website_profile/models/res_users.py +++ b/addons/website_profile/models/res_users.py @@ -58,7 +58,6 @@ class Users(models.Model): self.id, force_send=True, raise_exception=True) return True - @api.multi def _process_profile_validation_token(self, token, email): self.ensure_one() validation_token = self._generate_profile_token(self.id, email) diff --git a/addons/website_rating/models/mail_message.py b/addons/website_rating/models/mail_message.py index 2f1f59cc320..5a31a0d96c2 100644 --- a/addons/website_rating/models/mail_message.py +++ b/addons/website_rating/models/mail_message.py @@ -7,7 +7,6 @@ from odoo import api, fields, models class MailMessage(models.Model): _inherit = 'mail.message' - @api.multi def _portal_message_format(self, field_list): # inlude rating value in data if requested if self._context.get('rating_include'): diff --git a/addons/website_sale/models/mail_compose_message.py b/addons/website_sale/models/mail_compose_message.py index 7f12365123b..68b2fe3524d 100644 --- a/addons/website_sale/models/mail_compose_message.py +++ b/addons/website_sale/models/mail_compose_message.py @@ -7,7 +7,6 @@ from odoo import api, models class MailComposeMessage(models.TransientModel): _inherit = 'mail.compose.message' - @api.multi def send_mail(self, auto_commit=False): context = self._context # TODO TDE: clean that brole one day diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index 24e30a271f7..e9d4a1e27b5 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -51,7 +51,6 @@ class ProductPricelist(models.Model): self.clear_cache() return res - @api.multi def write(self, data): res = super(ProductPricelist, self).write(data) if data.keys() & {'code', 'active', 'website_id', 'selectable'}: @@ -59,7 +58,6 @@ class ProductPricelist(models.Model): self.clear_cache() return res - @api.multi def unlink(self): res = super(ProductPricelist, self).unlink() self._check_website_pricelist() @@ -85,7 +83,6 @@ class ProductPricelist(models.Model): if not website.pricelist_ids: raise UserError(_("With this action, '%s' website would not have any pricelist available.") % (website.name)) - @api.multi def _is_available_on_website(self, website_id): """ To be able to be used on a website, a pricelist should either: - Have its `website_id` set to current website (specific pricelist). @@ -169,7 +166,6 @@ class ProductPublicCategory(models.Model): tools.image_resize_images(vals) return super(ProductPublicCategory, self).create(vals) - @api.multi def write(self, vals): tools.image_resize_images(vals) return super(ProductPublicCategory, self).write(vals) @@ -179,7 +175,6 @@ class ProductPublicCategory(models.Model): if not self._check_recursion(): raise ValueError(_('Error ! You cannot create recursive categories.')) - @api.multi def name_get(self): res = [] for category in self: @@ -215,7 +210,6 @@ class ProductTemplate(models.Model): product_template_image_ids = fields.One2many('product.image', 'product_tmpl_id', string="Extra Product Media", copy=True) - @api.multi def _has_no_variant_attributes(self): """Return whether this `product.template` has at least one no_variant attribute. @@ -226,7 +220,6 @@ class ProductTemplate(models.Model): self.ensure_one() return any(a.create_variant == 'no_variant' for a in self.valid_product_attribute_ids) - @api.multi def _has_is_custom_values(self): self.ensure_one() """Return whether this `product.template` has at least one is_custom @@ -237,7 +230,6 @@ class ProductTemplate(models.Model): """ return any(v.is_custom for v in self.valid_product_attribute_value_ids) - @api.multi def _get_possible_variants_sorted(self, parent_combination=None): """Return the sorted recordset of variants that are possible. @@ -275,7 +267,6 @@ class ProductTemplate(models.Model): return self._get_possible_variants(parent_combination).sorted(_sort_key_variant) - @api.multi def _get_combination_info(self, combination=False, product_id=False, add_qty=1, pricelist=False, parent_combination=False, only_template=False): """Override for website, where we want to: - take the website pricelist if no pricelist is set @@ -322,7 +313,6 @@ class ProductTemplate(models.Model): return combination_info - @api.multi def _create_first_product_variant(self, log_warning=False): """Create if necessary and possible and return the first product variant for this template. @@ -335,7 +325,6 @@ class ProductTemplate(models.Model): """ return self._create_product_variant(self._get_first_possible_combination(), log_warning) - @api.multi def _get_current_company_fallback(self, **kwargs): """Override: if a website is set on the product or given, fallback to the company of the website. Otherwise use the one from parent method.""" @@ -392,7 +381,6 @@ class ProductTemplate(models.Model): res['default_meta_description'] = self.description_sale return res - @api.multi def _compute_website_url(self): super(ProductTemplate, self)._compute_website_url() for product in self: @@ -402,13 +390,11 @@ class ProductTemplate(models.Model): # Rating Mixin API # --------------------------------------------------------- - @api.multi def _rating_domain(self): """ Only take the published rating into account to compute avg and count """ domain = super(ProductTemplate, self)._rating_domain() return expression.AND([domain, [('website_published', '=', True)]]) - @api.multi def _get_images(self): """Return a list of records implementing `image.mixin` to display on the carousel on the website for this template. @@ -438,7 +424,6 @@ class Product(models.Model): attributes = ','.join(str(x) for x in product.attribute_value_ids.ids) product.website_url = "%s#attr=%s" % (product.product_tmpl_id.website_url, attributes) - @api.multi def website_publish_button(self): self.ensure_one() res = self.product_tmpl_id.website_publish_button() @@ -448,14 +433,12 @@ class Product(models.Model): res['url'] = self.website_url return res - @api.multi def open_website_url(self): self.ensure_one() res = self.product_tmpl_id.open_website_url() res['url'] = self.website_url return res - @api.multi def _get_images(self): """Return a list of records implementing `image.mixin` to display on the carousel on the website for this variant. diff --git a/addons/website_sale/models/res_partner.py b/addons/website_sale/models/res_partner.py index 7bfa8911180..204a3339ac7 100644 --- a/addons/website_sale/models/res_partner.py +++ b/addons/website_sale/models/res_partner.py @@ -10,7 +10,6 @@ class ResPartner(models.Model): last_website_so_id = fields.Many2one('sale.order', compute='_compute_last_website_so_id', string='Last Online Sales Order') - @api.multi def _compute_last_website_so_id(self): SaleOrder = self.env['sale.order'] for partner in self: diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index ef21416714d..c664bfd4271 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -33,14 +33,12 @@ class SaleOrder(models.Model): for order in self: order.website_order_line = order.order_line - @api.multi @api.depends('website_order_line.product_uom_qty', 'website_order_line.product_id') def _compute_cart_info(self): for order in self: order.cart_quantity = int(sum(order.mapped('website_order_line.product_uom_qty'))) order.only_services = all(l.product_id.type in ('service', 'digital') for l in order.website_order_line) - @api.multi @api.depends('website_id', 'date_order', 'order_line', 'state', 'partner_id') def _compute_abandoned_cart(self): for order in self: @@ -70,7 +68,6 @@ class SaleOrder(models.Model): return abandoned_domain return expression.distribute_not(['!'] + abandoned_domain) # negative domain - @api.multi def _cart_find_product_line(self, product_id=None, line_id=None, **kwargs): """Find the cart line matching the given parameters. @@ -98,7 +95,6 @@ class SaleOrder(models.Model): return self.env['sale.order.line'] - @api.multi def _website_product_id_change(self, order_id, product_id, qty=0): order = self.sudo().browse(order_id) product_context = dict(self.env.context) @@ -144,7 +140,6 @@ class SaleOrder(models.Model): 'discount': discount, } - @api.multi def _cart_update(self, product_id=None, line_id=None, add_qty=0, set_qty=0, **kwargs): """ Add or set product quantity, add_qty can be negative """ self.ensure_one() @@ -305,7 +300,6 @@ class SaleOrder(models.Model): return random.sample(accessory_products, len(accessory_products)) - @api.multi def action_recovery_email_send(self): for order in self: order._portal_ensure_token() @@ -330,7 +324,6 @@ class SaleOrder(models.Model): }, } - @api.multi def _get_cart_recovery_template(self): """ Return the cart recovery template record for a set of orders. @@ -343,7 +336,6 @@ class SaleOrder(models.Model): template = template or self.env.ref('website_sale.mail_template_sale_cart_recovery', raise_if_not_found=False) return template or self.env['mail.template'] - @api.multi def _cart_recovery_email_send(self): """Send the cart recovery email on the current recordset, making sure that the portal token exists to avoid broken links, and marking the email as sent. @@ -367,7 +359,6 @@ class SaleOrderLine(models.Model): linked_line_id = fields.Many2one('sale.order.line', string='Linked Order Line', domain="[('order_id', '!=', order_id)]", ondelete='cascade') option_line_ids = fields.One2many('sale.order.line', 'linked_line_id', string='Options Linked') - @api.multi @api.depends('product_id.display_name') def _compute_name_short(self): """ Compute a short name for this sale order line, to be used on the website where we don't have much space. diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py index dae1e9c4d9e..6d6541bda42 100644 --- a/addons/website_sale/models/website.py +++ b/addons/website_sale/models/website.py @@ -50,7 +50,6 @@ class Website(models.Model): Pricelist._get_website_pricelists_domain(website.id) ) - @api.multi def _compute_pricelist_id(self): for website in self: if website._context.get('website_id') != website.id: @@ -190,7 +189,6 @@ class Website(models.Model): _logger.error('Fail to find pricelist for partner "%s" (id %s)', partner.name, partner.id) return pl - @api.multi def sale_product_domain(self): return [("sale_ok", "=", True)] + self.get_current_website().website_domain() @@ -202,7 +200,6 @@ class Website(models.Model): self.env['account.payment.term'].sudo().search([('company_id', '=', self.company_id.id)], limit=1) ).id - @api.multi def _prepare_sale_order_values(self, partner, pricelist): self.ensure_one() affiliate_id = request.session.get('affiliate_id') @@ -229,7 +226,6 @@ class Website(models.Model): return values - @api.multi def sale_get_order(self, force_create=False, code=None, update_pricelist=False, force_pricelist=False): """ Return the current sales order after mofications specified by params. :param bool force_create: Create sales order if not already existing diff --git a/addons/website_sale_coupon/models/sale_order.py b/addons/website_sale_coupon/models/sale_order.py index 49f18e80570..574e355455b 100644 --- a/addons/website_sale_coupon/models/sale_order.py +++ b/addons/website_sale_coupon/models/sale_order.py @@ -63,7 +63,6 @@ class SaleOrder(models.Model): request.session.pop('error_promo_code') return error - @api.multi def _cart_update(self, product_id=None, line_id=None, add_qty=0, set_qty=0, **kwargs): res = super(SaleOrder, self)._cart_update(product_id=product_id, line_id=line_id, add_qty=add_qty, set_qty=set_qty, **kwargs) self.recompute_coupon_lines() diff --git a/addons/website_sale_delivery/models/sale_order.py b/addons/website_sale_delivery/models/sale_order.py index 620a3190791..e79805195f5 100644 --- a/addons/website_sale_delivery/models/sale_order.py +++ b/addons/website_sale_delivery/models/sale_order.py @@ -76,7 +76,6 @@ class SaleOrder(models.Model): # searching on website_published will also search for available website (_search method on computed field) return self.env['delivery.carrier'].sudo().search([('website_published', '=', True)]).available_carriers(address) - @api.multi def _cart_update(self, product_id=None, line_id=None, add_qty=0, set_qty=0, **kwargs): """ Override to update carrier quotation if quantity changed """ diff --git a/addons/website_sale_digital/models/product.py b/addons/website_sale_digital/models/product.py index 9b567749062..5da47231694 100644 --- a/addons/website_sale_digital/models/product.py +++ b/addons/website_sale_digital/models/product.py @@ -9,14 +9,12 @@ class ProductTemplate(models.Model): attachment_count = fields.Integer(compute='_compute_attachment_count', string="File") - @api.multi def _compute_attachment_count(self): attachment_data = self.env['ir.attachment'].read_group([('res_model', '=', self._name), ('res_id', 'in', self.ids), ('product_downloadable', '=', True)], ['res_id'], ['res_id']) mapped_data = dict([(data['res_id'], data['res_id_count']) for data in attachment_data]) for product_template in self: product_template.attachment_count = mapped_data.get(product_template.id, 0) - @api.multi def action_open_attachments(self): self.ensure_one() return { @@ -38,7 +36,6 @@ class Product(models.Model): attachment_count = fields.Integer(compute='_compute_attachment_count', string="File") - @api.multi def _compute_attachment_count(self): for product in self: product.attachment_count = self.env['ir.attachment'].search_count([ @@ -46,7 +43,6 @@ class Product(models.Model): ('res_model', '=', 'product.template'), ('res_id', '=', product.product_tmpl_id.id), ('product_downloadable', '=', True), ('res_model', '=', 'product.product'), ('res_id', '=', product.id), ('product_downloadable', '=', True)]) - @api.multi def action_open_attachments(self): self.ensure_one() return { diff --git a/addons/website_sale_product_configurator/models/sale_order.py b/addons/website_sale_product_configurator/models/sale_order.py index e3d1fdc96e7..943fd23f22a 100644 --- a/addons/website_sale_product_configurator/models/sale_order.py +++ b/addons/website_sale_product_configurator/models/sale_order.py @@ -7,7 +7,6 @@ from odoo import api, models class SaleOrder(models.Model): _inherit = "sale.order" - @api.multi def _cart_find_product_line(self, product_id=None, line_id=None, **kwargs): lines = super(SaleOrder, self)._cart_find_product_line(product_id, line_id, **kwargs) if lines: diff --git a/addons/website_sale_slides/models/sale_order.py b/addons/website_sale_slides/models/sale_order.py index 6ab212628dd..266e257603b 100644 --- a/addons/website_sale_slides/models/sale_order.py +++ b/addons/website_sale_slides/models/sale_order.py @@ -7,7 +7,6 @@ from odoo import models, api class SaleOrder(models.Model): _inherit = "sale.order" - @api.multi def _action_confirm(self): """ If the product of an order line is a 'course', we add the client of the sale_order as a member of the channel(s) on which this product is configured (see slide.channel.product_id). """ diff --git a/addons/website_sale_stock/models/product_template.py b/addons/website_sale_stock/models/product_template.py index 6d056d1ed2e..0b16fbad1c2 100644 --- a/addons/website_sale_stock/models/product_template.py +++ b/addons/website_sale_stock/models/product_template.py @@ -16,7 +16,6 @@ class ProductTemplate(models.Model): available_threshold = fields.Float(string='Availability Threshold', default=5.0) custom_message = fields.Text(string='Custom Message', default='', translate=True) - @api.multi def _get_combination_info(self, combination=False, product_id=False, add_qty=1, pricelist=False, reference_product=False, only_template=False): combination_info = super(ProductTemplate, self)._get_combination_info( combination=combination, product_id=product_id, add_qty=add_qty, pricelist=pricelist, diff --git a/addons/website_sale_stock/models/res_config_settings.py b/addons/website_sale_stock/models/res_config_settings.py index 51b05aa01ae..17fcafc8276 100644 --- a/addons/website_sale_stock/models/res_config_settings.py +++ b/addons/website_sale_stock/models/res_config_settings.py @@ -16,7 +16,6 @@ class ResConfigSettings(models.TransientModel): available_threshold = fields.Float(string='Availability Threshold') website_warehouse_id = fields.Many2one('stock.warehouse', related='website_id.warehouse_id', domain="[('company_id', '=', website_company_id)]", readonly=False) - @api.multi def set_values(self): super(ResConfigSettings, self).set_values() IrDefault = self.env['ir.default'].sudo() diff --git a/addons/website_sale_stock/models/sale_order.py b/addons/website_sale_stock/models/sale_order.py index 060577c8e80..391ad44b4af 100644 --- a/addons/website_sale_stock/models/sale_order.py +++ b/addons/website_sale_stock/models/sale_order.py @@ -31,14 +31,12 @@ class SaleOrder(models.Model): values['warning'] = self.warning_stock return values - @api.multi def _website_product_id_change(self, order_id, product_id, qty=0): res = super(SaleOrder, self)._website_product_id_change(order_id, product_id, qty=qty) product = self.env['product.product'].browse(product_id) res['customer_lead'] = product.sale_delay return res - @api.multi def _get_stock_warning(self, clear=True): self.ensure_one() warn = self.warning_stock @@ -52,7 +50,6 @@ class SaleOrderLine(models.Model): warning_stock = fields.Char('Warning') - @api.multi def _get_stock_warning(self, clear=True): self.ensure_one() warn = self.warning_stock diff --git a/addons/website_sale_stock/models/website.py b/addons/website_sale_stock/models/website.py index e9730cffed0..78d2301c338 100644 --- a/addons/website_sale_stock/models/website.py +++ b/addons/website_sale_stock/models/website.py @@ -7,7 +7,6 @@ class Website(models.Model): warehouse_id = fields.Many2one('stock.warehouse', string='Warehouse') - @api.multi def _prepare_sale_order_values(self, partner, pricelist): self.ensure_one() values = super(Website, self)._prepare_sale_order_values(partner, pricelist) diff --git a/addons/website_sale_wishlist/models/product_wishlist.py b/addons/website_sale_wishlist/models/product_wishlist.py index 1bcbe57baef..678bace4cb1 100644 --- a/addons/website_sale_wishlist/models/product_wishlist.py +++ b/addons/website_sale_wishlist/models/product_wishlist.py @@ -79,7 +79,6 @@ class ResPartner(models.Model): class ProductTemplate(models.Model): _inherit = 'product.template' - @api.multi def _is_in_wishlist(self): self.ensure_one() return self in self.env['product.wishlist'].current().mapped('product_id.product_tmpl_id') @@ -88,7 +87,6 @@ class ProductTemplate(models.Model): class ProductProduct(models.Model): _inherit = 'product.product' - @api.multi def _is_in_wishlist(self): self.ensure_one() return self in self.env['product.wishlist'].current().mapped('product_id') diff --git a/addons/website_slides/models/res_groups.py b/addons/website_slides/models/res_groups.py index 7a44b3365e3..c7d28545b25 100644 --- a/addons/website_slides/models/res_groups.py +++ b/addons/website_slides/models/res_groups.py @@ -7,7 +7,6 @@ from odoo import api, models class UserGroup(models.Model): _inherit = 'res.groups' - @api.multi def write(self, vals): """ Automatically subscribe new users to linked slide channels """ write_res = super(UserGroup, self).write(vals) diff --git a/addons/website_slides/models/res_users.py b/addons/website_slides/models/res_users.py index a97f7bb7e96..47f6baa980e 100644 --- a/addons/website_slides/models/res_users.py +++ b/addons/website_slides/models/res_users.py @@ -14,7 +14,6 @@ class Users(models.Model): self.env['slide.channel'].sudo().search([('enroll_group_ids', 'in', user.groups_id.ids)])._action_add_members(user.partner_id) return user - @api.multi def write(self, vals): """ Trigger automatic subscription based on updated user groups """ res = super(Users, self).write(vals) diff --git a/addons/website_slides/models/slide_channel.py b/addons/website_slides/models/slide_channel.py index 313b76b55d3..0b780567c0c 100644 --- a/addons/website_slides/models/slide_channel.py +++ b/addons/website_slides/models/slide_channel.py @@ -269,13 +269,11 @@ class Channel(models.Model): def _get_can_publish_error_message(self): return _("Publishing is restricted to the responsible of training courses or members of the publisher group for documentation courses") - @api.multi def get_base_url(self): self.ensure_one() icp = self.env['ir.config_parameter'].sudo().get_param('web.base.url') return self.website_id and self.website_id._get_http_domain() or icp - @api.multi @api.depends('name', 'website_id.domain') def _compute_website_url(self): super(Channel, self)._compute_website_url() @@ -284,7 +282,6 @@ class Channel(models.Model): base_url = channel.get_base_url() channel.website_url = '%s/slides/%s' % (base_url, slug(channel)) - @api.multi def _compute_action_rights(self): user_karma = self.env.user.karma for channel in self: @@ -332,7 +329,6 @@ class Channel(models.Model): channel._add_groups_members() return channel - @api.multi def write(self, vals): res = super(Channel, self).write(vals) if vals.get('user_id'): @@ -344,7 +340,6 @@ class Channel(models.Model): self._add_groups_members() return res - @api.multi @api.returns('mail.message', lambda value: value.id) def message_post(self, parent_id=False, subtype=None, **kwargs): """ Temporary workaround to avoid spam. If someone replies on a channel @@ -365,7 +360,6 @@ class Channel(models.Model): # Business / Actions # --------------------------------------------------------- - @api.multi def action_redirect_to_members(self): action = self.env.ref('website_slides.slide_channel_partner_action').read()[0] action['view_mode'] = 'tree' @@ -375,7 +369,6 @@ class Channel(models.Model): return action - @api.multi def action_channel_invite(self): self.ensure_one() @@ -479,7 +472,6 @@ class Channel(models.Model): # Rating Mixin API # --------------------------------------------------------- - @api.multi def _rating_domain(self): """ Only take the published rating into account to compute avg and count """ domain = super(Channel, self)._rating_domain() diff --git a/addons/website_slides/models/slide_slide.py b/addons/website_slides/models/slide_slide.py index dbf065ad7a1..6dbb0a00a30 100644 --- a/addons/website_slides/models/slide_slide.py +++ b/addons/website_slides/models/slide_slide.py @@ -241,7 +241,6 @@ class Slide(models.Model): for key, value in values.items(): self[key] = value - @api.multi @api.depends('name', 'channel_id.website_id.domain') def _compute_website_url(self): # TDE FIXME: clena this link.tracker strange stuff @@ -297,7 +296,6 @@ class Slide(models.Model): slide._post_publication() return slide - @api.multi def write(self, values): if values.get('url') and values['url'] != self.url: doc_data = self._parse_document_url(values['url']).get('values', dict()) @@ -314,7 +312,6 @@ class Slide(models.Model): # Mail/Rating # --------------------------------------------------------- - @api.multi @api.returns('mail.message', lambda value: value.id) def message_post(self, message_type='notification', **kwargs): self.ensure_one() @@ -322,7 +319,6 @@ class Slide(models.Model): raise KarmaError(_('Not enough karma to comment')) return super(Slide, self).message_post(message_type=message_type, **kwargs) - @api.multi def get_access_action(self, access_uid=None): """ Instead of the classic form view, redirect to website if it is published. """ self.ensure_one() @@ -336,7 +332,6 @@ class Slide(models.Model): } return super(Slide, self).get_access_action(access_uid) - @api.multi def _notify_get_groups(self): """ Add access button to everyone if the document is active. """ groups = super(Slide, self)._notify_get_groups() diff --git a/addons/website_slides/wizard/slide_channel_invite.py b/addons/website_slides/wizard/slide_channel_invite.py index 76330d0da10..be7db01a12e 100644 --- a/addons/website_slides/wizard/slide_channel_invite.py +++ b/addons/website_slides/wizard/slide_channel_invite.py @@ -77,7 +77,6 @@ class SlideChannelInvite(models.TransientModel): values['body'] = template.body_html return super(SlideChannelInvite, self).create(values) - @api.multi def action_invite(self): """ Process the wizard content and proceed with sending the related email(s), rendering any template patterns on the fly if needed """ diff --git a/addons/website_slides_survey/models/slide_slide.py b/addons/website_slides_survey/models/slide_slide.py index c7639917b27..49caaa29a93 100644 --- a/addons/website_slides_survey/models/slide_slide.py +++ b/addons/website_slides_survey/models/slide_slide.py @@ -27,7 +27,6 @@ class SlidePartnerRelation(models.Model): vals['completed'] = True return super(SlidePartnerRelation, self).create(vals_list) - @api.multi def _write(self, vals): if vals.get('survey_quizz_passed'): vals['completed'] = True @@ -45,7 +44,6 @@ class Slide(models.Model): ('check_certification_preview', "CHECK(slide_type != 'certification' OR is_preview = False)", "A slide of type certification cannot be previewed."), ] - @api.multi def _generate_certification_url(self): """ get a map of certification url for certification slide from `self`. The url will come from the survey user input: 1/ existing and not done user_input for member of the course diff --git a/addons/website_slides_survey/models/survey_user.py b/addons/website_slides_survey/models/survey_user.py index 73ecef89129..ec658874ff5 100644 --- a/addons/website_slides_survey/models/survey_user.py +++ b/addons/website_slides_survey/models/survey_user.py @@ -19,7 +19,6 @@ class SurveyUserInput(models.Model): records._check_for_failed_attempt() return records - @api.multi def write(self, vals): res = super(SurveyUserInput, self).write(vals) if 'state' in vals: diff --git a/addons/website_theme_install/models/ir_module_module.py b/addons/website_theme_install/models/ir_module_module.py index e7e31e176f2..532be6e52c6 100644 --- a/addons/website_theme_install/models/ir_module_module.py +++ b/addons/website_theme_install/models/ir_module_module.py @@ -36,7 +36,6 @@ class IrModuleModule(models.Model): # for kanban view is_installed_on_current_website = fields.Boolean(compute='_compute_is_installed_on_current_website') - @api.multi def _compute_is_installed_on_current_website(self): """ Compute for every theme in ``self`` if the current website is using it or not. @@ -48,7 +47,6 @@ class IrModuleModule(models.Model): for module in self: module.is_installed_on_current_website = module == self.env['website'].get_current_website().theme_id - @api.multi def write(self, vals): """ Override to correctly upgrade themes after upgrade/installation of modules. @@ -93,7 +91,6 @@ class IrModuleModule(models.Model): return super(IrModuleModule, self).write(vals) - @api.multi def _get_module_data(self, model_name): """ Return every theme template model of type ``model_name`` for every theme in ``self``. @@ -180,7 +177,6 @@ class IrModuleModule(models.Model): self._theme_cleanup(model_name, website) - @api.multi def _post_copy(self, old_rec, new_rec): self.ensure_one() translated_fields = self._theme_translated_fields.get(old_rec._name, []) @@ -194,7 +190,6 @@ class IrModuleModule(models.Model): (dst_field, new_rec.id, src_field, old_rec.id)) - @api.multi def _theme_load(self, website): """ For every type of model in ``self._theme_model_names``, and for every theme in ``self``: @@ -213,7 +208,6 @@ class IrModuleModule(models.Model): self = self.env()[self._name].browse(self.id) self.env['theme.utils']._post_copy(module, website) - @api.multi def _theme_unload(self, website): """ For every type of model in ``self._theme_model_names``, and for every theme in ``self``: @@ -231,7 +225,6 @@ class IrModuleModule(models.Model): models.unlink() self._theme_cleanup(model_name, website) - @api.multi def _theme_cleanup(self, model_name, website): """ Remove orphan models of type ``model_name`` from the current theme and @@ -265,7 +258,6 @@ class IrModuleModule(models.Model): ]) orphans.unlink() - @api.multi def _theme_get_upstream(self): """ Return installed upstream themes. @@ -275,7 +267,6 @@ class IrModuleModule(models.Model): self.ensure_one() return self.upstream_dependencies(exclude_states=('',)).filtered(lambda x: x.name.startswith('theme_')) - @api.multi def _theme_get_downstream(self): """ Return installed downstream themes that starts with the same name. @@ -288,7 +279,6 @@ class IrModuleModule(models.Model): self.ensure_one() return self.downstream_dependencies().filtered(lambda x: x.name.startswith(self.name)) - @api.multi def _theme_get_stream_themes(self): """ Returns all the themes in the stream of the current theme. @@ -305,7 +295,6 @@ class IrModuleModule(models.Model): all_mods = up_mod | all_mods return all_mods - @api.multi def _theme_get_stream_website_ids(self): """ Websites for which this theme (self) is in the stream (up or down) of their theme. @@ -319,7 +308,6 @@ class IrModuleModule(models.Model): websites |= website return websites - @api.multi def _theme_upgrade_upstream(self): """ Upgrade the upstream dependencies of a theme. @@ -351,7 +339,6 @@ class IrModuleModule(models.Model): theme._theme_unload(website) website.theme_id = False - @api.multi def button_choose_theme(self): """ Remove any existing theme on the current website and install the theme ``self`` instead. diff --git a/addons/website_theme_install/models/theme_models.py b/addons/website_theme_install/models/theme_models.py index b9b2f006c94..20a30c9713a 100644 --- a/addons/website_theme_install/models/theme_models.py +++ b/addons/website_theme_install/models/theme_models.py @@ -31,7 +31,6 @@ class ThemeView(models.Model): # TODO master add missing field: customize_show - @api.multi def _convert_to_base_model(self, website, **kwargs): self.ensure_one() inherit = self.inherit_id @@ -70,7 +69,6 @@ class ThemeAttachment(models.Model): copy_ids = fields.One2many('ir.attachment', 'theme_template_id', 'Attachment using a copy of me', copy=False, readonly=True) - @api.multi def _convert_to_base_model(self, website, **kwargs): self.ensure_one() new_attach = { @@ -98,7 +96,6 @@ class ThemeMenu(models.Model): parent_id = fields.Many2one('theme.website.menu', index=True, ondelete="cascade") copy_ids = fields.One2many('website.menu', 'theme_template_id', 'Menu using a copy of me', copy=False, readonly=True) - @api.multi def _convert_to_base_model(self, website, **kwargs): self.ensure_one() page_id = self.page_id.copy_ids.filtered(lambda x: x.website_id == website) @@ -124,7 +121,6 @@ class ThemePage(models.Model): website_indexed = fields.Boolean('Page Indexed', default=True) copy_ids = fields.One2many('website.page', 'theme_template_id', 'Page using a copy of me', copy=False, readonly=True) - @api.multi def _convert_to_base_model(self, website, **kwargs): self.ensure_one() view_id = self.view_id.copy_ids.filtered(lambda x: x.website_id == website) diff --git a/addons/website_twitter/models/res_config_settings.py b/addons/website_twitter/models/res_config_settings.py index 4cb58e52d72..b0e70529313 100644 --- a/addons/website_twitter/models/res_config_settings.py +++ b/addons/website_twitter/models/res_config_settings.py @@ -68,7 +68,6 @@ class ResConfigSettings(models.TransientModel): TwitterConfig._check_twitter_authorization() return TwitterConfig - @api.multi def write(self, vals): TwitterConfig = super(ResConfigSettings, self).write(vals) if vals.get('twitter_api_key') or vals.get('twitter_api_secret') or vals.get('twitter_screen_name'): diff --git a/addons/website_twitter/models/website_twitter.py b/addons/website_twitter/models/website_twitter.py index 966f7ab6249..f7de73301dd 100644 --- a/addons/website_twitter/models/website_twitter.py +++ b/addons/website_twitter/models/website_twitter.py @@ -45,7 +45,6 @@ class WebsiteTwitter(models.Model): _logger.debug("Refreshing tweets for website IDs: %r", website.ids) website.fetch_favorite_tweets() - @api.multi def fetch_favorite_tweets(self): WebsiteTweets = self.env['website.twitter.tweet'] tweet_ids = [] diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst index a5d03443f52..90300568c8f 100644 --- a/doc/howtos/backend.rst +++ b/doc/howtos/backend.rst @@ -789,7 +789,6 @@ method should simply set the value of the field to compute on every record in name = fields.Char(compute='_compute_name') - @api.multi def _compute_name(self): for record in self: record.name = str(random.randint(1, 1e6)) diff --git a/doc/howtos/profilecode.rst b/doc/howtos/profilecode.rst index ed6d2640648..1251c052ff7 100644 --- a/doc/howtos/profilecode.rst +++ b/doc/howtos/profilecode.rst @@ -20,7 +20,6 @@ its sub-called methods. from odoo.tools.profiler import profile [...] @profile('/temp/prof.profile') - @api.multi def mymethod(...) This produces a file called /temp/prof.profile diff --git a/doc/reference/guidelines.rst b/doc/reference/guidelines.rst index de9723121ff..c1a282cf19f 100644 --- a/doc/reference/guidelines.rst +++ b/doc/reference/guidelines.rst @@ -586,13 +586,11 @@ Programming in Odoo Make your method work in batch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When adding a function, make sure it can process multiple records. Typically, -such methods are decorated with the ``api.multi`` decorator. Then you will have -to iterate on ``self`` to treat each record. +When adding a function, make sure it can process multiple records by iterating +on self to treat each record. .. code-block:: python - @api.multi def my_method(self) for record in self: record.do_cool_stuff() @@ -607,7 +605,6 @@ is recommended to use ``read_group`` method, to compute all value in only one re .. code-block:: python - @api.multi def _compute_equipment_count(self): """ Count the number of equipement per category """ equipment_data = self.env['hr.equipment'].read_group([('category_id', 'in', self.ids)], ['category_id'], ['category_id']) @@ -943,8 +940,8 @@ Symbols and Conventions - Selection method: the selection method pattern is *_selection_