diff options
| author | Raphael Collet <rco@odoo.com> | 2019-04-10 08:16:33 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2019-07-08 13:51:35 +0000 |
| commit | c552fb7a618afe2feea2e0358ead9eb6ebff0c94 (patch) | |
| tree | dff502e0d0ced6cea06c940e664533ff175ae9c7 /addons | |
| parent | fa5037650db987c0aece183758d59ce6026add4e (diff) | |
[IMP] api: remove deprecated decorators
Diffstat (limited to 'addons')
36 files changed, 0 insertions, 40 deletions
diff --git a/addons/account/models/account_analytic_line.py b/addons/account/models/account_analytic_line.py index 92e3dc6c973..9a7235ac9a0 100644 --- a/addons/account/models/account_analytic_line.py +++ b/addons/account/models/account_analytic_line.py @@ -17,7 +17,6 @@ class AccountAnalyticLine(models.Model): code = fields.Char(size=8) ref = fields.Char(string='Ref.') - @api.v8 @api.onchange('product_id', 'product_uom_id', 'unit_amount', 'currency_id') def on_change_unit_amount(self): if not self.product_id: diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index f69db68a67f..1309145169c 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2779,7 +2779,6 @@ class AccountMoveLine(models.Model): # LOW-LEVEL METHODS # ------------------------------------------------------------------------- - @api.model_cr def init(self): """ change index on partner_id to a multi-column index on (partner_id, ref), the new index will behave in the same way when we search on partner_id, with the addition of being optimal when having a query that will diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index d63c997347f..1ac06b0372d 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -164,7 +164,6 @@ class AccountInvoiceReport(models.Model): COALESCE(partner.country_id, commercial_partner.country_id) ''' - @api.model_cr def init(self): tools.drop_view_if_exists(self.env.cr, self._table) self.env.cr.execute(''' diff --git a/addons/base_automation/models/base_automation.py b/addons/base_automation/models/base_automation.py index ba754f2fe3e..ea7c204a1a5 100644 --- a/addons/base_automation/models/base_automation.py +++ b/addons/base_automation/models/base_automation.py @@ -231,7 +231,6 @@ class BaseAutomation(models.Model): ) return any(differ(field.name) for field in self.trigger_field_ids) - @api.model_cr def _register_hook(self): """ Patch models that should trigger action rules based on creation, modification, deletion of records and form onchanges. diff --git a/addons/base_gengo/wizard/base_gengo_translations.py b/addons/base_gengo/wizard/base_gengo_translations.py index e7f806074b4..b6b2c4966a4 100644 --- a/addons/base_gengo/wizard/base_gengo_translations.py +++ b/addons/base_gengo/wizard/base_gengo_translations.py @@ -45,13 +45,11 @@ class BaseGengoTranslations(models.TransientModel): sync_limit = fields.Integer("No. of terms to sync", default=20) authorized_credentials = fields.Boolean('The private and public keys are valid') - @api.model_cr def init(self): icp = self.env['ir.config_parameter'].sudo() if not icp.get_param(self.GENGO_KEY): icp.set_param(self.GENGO_KEY, str(uuid.uuid4())) - @api.model_cr def get_gengo_key(self): icp = self.env['ir.config_parameter'].sudo() return icp.get_param(self.GENGO_KEY, default="Undefined") diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 483917ccf92..fab4eef4d45 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -57,7 +57,6 @@ class Lead(models.Model): 'utm.mixin', 'format.address.mixin', 'phone.validation.mixin'] _primary_email = 'email_from' - @api.model_cr_context def _auto_init(self): res = super(Lead, self)._auto_init() tools.create_index(self._cr, 'crm_lead_create_date_team_id_idx', @@ -146,7 +145,6 @@ class Lead(models.Model): ('check_probability', 'check(probability >= 0 and probability <= 100)', 'The probability of closing the deal should be between 0% and 100%!') ] - @api.model_cr_context def _auto_init(self): res = super(Lead, self)._auto_init() tools.create_index(self._cr, 'crm_lead_user_id_team_id_type_index', diff --git a/addons/crm/report/crm_activity_report.py b/addons/crm/report/crm_activity_report.py index 55742b22623..554b49a3290 100644 --- a/addons/crm/report/crm_activity_report.py +++ b/addons/crm/report/crm_activity_report.py @@ -75,7 +75,6 @@ class ActivityReport(models.Model): m.model = 'crm.lead' AND (m.mail_activity_type_id IS NOT NULL OR m.subtype_id = %s) """ % (disccusion_subtype.id,) - @api.model_cr def init(self): tools.drop_view_if_exists(self._cr, self._table) self._cr.execute(""" diff --git a/addons/crm_iap_lead_website/models/crm_reveal_view.py b/addons/crm_iap_lead_website/models/crm_reveal_view.py index fb0705adcdc..a8a7dd14a7c 100644 --- a/addons/crm_iap_lead_website/models/crm_reveal_view.py +++ b/addons/crm_iap_lead_website/models/crm_reveal_view.py @@ -17,7 +17,6 @@ class CRMRevealView(models.Model): reveal_state = fields.Selection([('to_process', 'To Process'), ('not_found', 'Not Found')], default='to_process', string="State", index=True) create_date = fields.Datetime(index=True) - @api.model_cr def init(self): self._cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('crm_reveal_view_ip_rule_id',)) if not self._cr.fetchone(): diff --git a/addons/hr/models/hr_employee_public.py b/addons/hr/models/hr_employee_public.py index 82799661d0e..1f7af77dfb9 100644 --- a/addons/hr/models/hr_employee_public.py +++ b/addons/hr/models/hr_employee_public.py @@ -49,7 +49,6 @@ class HrEmployeePublic(models.Model): def _get_fields(self): return ','.join('emp.%s' % name for name, field in self._fields.items() if field.store and field.type not in ['many2many', 'one2many']) - @api.model_cr def init(self): tools.drop_view_if_exists(self.env.cr, self._table) self.env.cr.execute("""CREATE or REPLACE VIEW %s as ( diff --git a/addons/hr_holidays/models/hr_leave.py b/addons/hr_holidays/models/hr_leave.py index f4223cdddeb..12c44f26cb4 100644 --- a/addons/hr_holidays/models/hr_leave.py +++ b/addons/hr_holidays/models/hr_leave.py @@ -252,7 +252,6 @@ class HolidaysRequest(models.Model): ('duration_check', "CHECK ( number_of_days >= 0 )", "If you want to change the number of days you should use the 'period' mode"), ] - @api.model_cr_context def _auto_init(self): res = super(HolidaysRequest, self)._auto_init() tools.create_index(self._cr, 'hr_leave_date_to_date_from_index', diff --git a/addons/hr_timesheet_attendance/report/hr_timesheet_attendance_report.py b/addons/hr_timesheet_attendance/report/hr_timesheet_attendance_report.py index 0aa0bbaf275..7081a1ac5af 100644 --- a/addons/hr_timesheet_attendance/report/hr_timesheet_attendance_report.py +++ b/addons/hr_timesheet_attendance/report/hr_timesheet_attendance_report.py @@ -15,7 +15,6 @@ class TimesheetAttendance(models.Model): total_attendance = fields.Float() total_difference = fields.Float() - @api.model_cr def init(self): self._cr.execute("""CREATE OR REPLACE VIEW %s AS ( SELECT diff --git a/addons/im_livechat/report/im_livechat_report_channel.py b/addons/im_livechat/report/im_livechat_report_channel.py index 21305ab7b99..70b1fc1d30f 100644 --- a/addons/im_livechat/report/im_livechat_report_channel.py +++ b/addons/im_livechat/report/im_livechat_report_channel.py @@ -38,7 +38,6 @@ class ImLivechatReportChannel(models.Model): is_unrated = fields.Integer('Session not rated', readonly=True) partner_id = fields.Many2one('res.partner', 'Operator', readonly=True) - @api.model_cr def init(self): # Note : start_date_hour must be remove when the read_group will allow grouping on the hour of a datetime. Don't forget to change the view ! tools.drop_view_if_exists(self.env.cr, 'im_livechat_report_channel') diff --git a/addons/im_livechat/report/im_livechat_report_operator.py b/addons/im_livechat/report/im_livechat_report_operator.py index a9391e2a6be..cafaf898da2 100644 --- a/addons/im_livechat/report/im_livechat_report_operator.py +++ b/addons/im_livechat/report/im_livechat_report_operator.py @@ -20,7 +20,6 @@ class ImLivechatReportOperator(models.Model): time_to_answer = fields.Float('Time to answer', digits=(16, 2), readonly=True, group_operator="avg", help="Average time to give the first answer to the visitor") duration = fields.Float('Average duration', digits=(16, 2), readonly=True, group_operator="avg", help="Duration of the conversation (in seconds)") - @api.model_cr def init(self): # Note : start_date_hour must be remove when the read_group will allow grouping on the hour of a datetime. Don't forget to change the view ! tools.drop_view_if_exists(self.env.cr, 'im_livechat_report_operator') diff --git a/addons/l10n_in/report/account_invoice_report.py b/addons/l10n_in/report/account_invoice_report.py index ebbee57ab68..d33d1927e78 100644 --- a/addons/l10n_in/report/account_invoice_report.py +++ b/addons/l10n_in/report/account_invoice_report.py @@ -302,7 +302,6 @@ class L10nInAccountInvoiceReport(models.Model): """ return group_by_str - @api.model_cr def init(self): tools.drop_view_if_exists(self.env.cr, self._table) self.env.cr.execute("""CREATE or REPLACE VIEW %s AS ( diff --git a/addons/l10n_in/report/account_payment_report.py b/addons/l10n_in/report/account_payment_report.py index 266d8f39c43..05aed203314 100644 --- a/addons/l10n_in/report/account_payment_report.py +++ b/addons/l10n_in/report/account_payment_report.py @@ -101,7 +101,6 @@ class L10nInPaymentReport(models.AbstractModel): AND tax.tax_group_id in (SELECT res_id FROM ir_model_data WHERE module='l10n_in' AND name in ('igst_group','gst_group')) AND ac.internal_type IN ('receivable', 'payable') AND am.state = 'posted'""" - @api.model_cr def init(self): tools.drop_view_if_exists(self.env.cr, self._table) self.env.cr.execute("""CREATE or REPLACE VIEW %s AS ( diff --git a/addons/l10n_in/report/exempted_gst_report.py b/addons/l10n_in/report/exempted_gst_report.py index 05d68a39ded..435b58e05cf 100644 --- a/addons/l10n_in/report/exempted_gst_report.py +++ b/addons/l10n_in/report/exempted_gst_report.py @@ -89,7 +89,6 @@ class L10nInExemptedReport(models.Model): """ return from_str - @api.model_cr def init(self): tools.drop_view_if_exists(self.env.cr, self._table) self._cr.execute("""CREATE OR REPLACE VIEW %s AS (%s %s)""" % ( diff --git a/addons/l10n_in/report/hsn_gst_report.py b/addons/l10n_in/report/hsn_gst_report.py index 0fb4a844a74..7961ddda02b 100644 --- a/addons/l10n_in/report/hsn_gst_report.py +++ b/addons/l10n_in/report/hsn_gst_report.py @@ -98,7 +98,6 @@ class L10nInProductHsnReport(models.Model): """ return from_str - @api.model_cr def init(self): tools.drop_view_if_exists(self.env.cr, self._table) self.env.cr.execute("""CREATE OR REPLACE VIEW %s AS (%s %s)""" % ( diff --git a/addons/mail/models/mail_alias.py b/addons/mail/models/mail_alias.py index 77bdc216728..ecf03c3c5a3 100644 --- a/addons/mail/models/mail_alias.py +++ b/addons/mail/models/mail_alias.py @@ -220,7 +220,6 @@ class AliasMixin(models.AbstractModel): aliases.unlink() return res - @api.model_cr_context def _init_column(self, name): """ Create aliases for existing rows. """ super(AliasMixin, self)._init_column(name) diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index 524f3763d93..7912a856ca4 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -410,7 +410,6 @@ class Channel(models.Model): return True return super(Channel, self)._alias_check_contact(message, message_dict, alias) - @api.model_cr def init(self): self._cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('mail_channel_partner_seen_message_id_idx',)) if not self._cr.fetchone(): diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 1b9e8b41fa4..e90249e9533 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -585,7 +585,6 @@ class Message(models.Model): # mail_message internals #------------------------------------------------------ - @api.model_cr def init(self): self._cr.execute("""SELECT indexname FROM pg_indexes WHERE indexname = 'mail_message_model_res_id_idx'""") if not self._cr.fetchone(): diff --git a/addons/mail/models/mail_notification.py b/addons/mail/models/mail_notification.py index b687633a86d..3397342a818 100644 --- a/addons/mail/models/mail_notification.py +++ b/addons/mail/models/mail_notification.py @@ -37,7 +37,6 @@ class Notification(models.Model): ], string='Failure type') failure_reason = fields.Text('Failure reason', copy=False) - @api.model_cr def init(self): self._cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('mail_notification_res_partner_id_is_read_email_status_mail_message_id',)) if not self._cr.fetchone(): diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index f5ad45c0a56..e88c11cbc84 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -430,9 +430,6 @@ class MailComposer(models.TransientModel): values['body'] = values.pop('body_html') # This onchange should return command instead of ids for x2many field. - # ORM handle the assignation of command list on new onchange (api.v8), - # this force the complete replacement of x2many field with - # command and is compatible with onchange api.v7 values = self._convert_to_write(values) return {'value': values} diff --git a/addons/mass_mailing/models/mass_mailing_report.py b/addons/mass_mailing/models/mass_mailing_report.py index 13f8c873d6e..de63344389c 100644 --- a/addons/mass_mailing/models/mass_mailing_report.py +++ b/addons/mass_mailing/models/mass_mailing_report.py @@ -22,7 +22,6 @@ class MassMailingReport(models.Model): string='Status', readonly=True) email_from = fields.Char('From', readonly=True) - @api.model_cr def init(self): """Mass Mail Statistical Report: based on mail.mail.statistics that models the various statistics collected for each mailing, and mail.mass_mailing model that models the diff --git a/addons/membership/report/report_membership.py b/addons/membership/report/report_membership.py index 1734bc045f5..bab4b67a7b1 100644 --- a/addons/membership/report/report_membership.py +++ b/addons/membership/report/report_membership.py @@ -37,7 +37,6 @@ class ReportMembership(models.Model): company_id = fields.Many2one('res.company', string='Company', readonly=True) quantity = fields.Integer(readonly=True) - @api.model_cr def init(self): '''Create the view''' tools.drop_view_if_exists(self._cr, self._table) diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py index 3111dc7fd3c..33684c818c7 100644 --- a/addons/point_of_sale/report/pos_order_report.py +++ b/addons/point_of_sale/report/pos_order_report.py @@ -94,7 +94,6 @@ class PosOrderReport(models.Model): SUM(l.qty * u.factor) != 0 """ - @api.model_cr def init(self): tools.drop_view_if_exists(self._cr, self._table) self._cr.execute(""" diff --git a/addons/purchase/report/purchase_bill.py b/addons/purchase/report/purchase_bill.py index 0a9609144b8..8517cc6ad5b 100644 --- a/addons/purchase/report/purchase_bill.py +++ b/addons/purchase/report/purchase_bill.py @@ -20,7 +20,6 @@ class PurchaseBillUnion(models.Model): vendor_bill_id = fields.Many2one('account.move', string='Vendor Bill', readonly=True) purchase_order_id = fields.Many2one('purchase.order', string='Purchase Order', readonly=True) - @api.model_cr def init(self): tools.drop_view_if_exists(self.env.cr, 'purchase_bill_union') self.env.cr.execute(""" diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index d3a04e7d06e..1385d7c12bd 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -50,7 +50,6 @@ class PurchaseReport(models.Model): qty_billed = fields.Float('Qty Billed', readonly=True) qty_to_be_billed = fields.Float('Qty to be Billed', readonly=True) - @api.model_cr def init(self): # self._table = sale_report tools.drop_view_if_exists(self.env.cr, self._table) diff --git a/addons/sale/report/report_all_channels_sales.py b/addons/sale/report/report_all_channels_sales.py index 473ab1f1362..1aa6e96006d 100644 --- a/addons/sale/report/report_all_channels_sales.py +++ b/addons/sale/report/report_all_channels_sales.py @@ -82,7 +82,6 @@ class PosSaleReport(models.Model): AS foo""" % (self._table, self._from()) return request - @api.model_cr def init(self): tools.drop_view_if_exists(self.env.cr, self._table) self.env.cr.execute(self.get_main_request()) diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index 4936a9401ed..e1fa1ce8620 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -144,7 +144,6 @@ class SaleReport(models.Model): return '%s (SELECT %s FROM %s WHERE l.product_id IS NOT NULL GROUP BY %s)' % (with_, select_, from_, groupby_) - @api.model_cr def init(self): # self._table = sale_report tools.drop_view_if_exists(self.env.cr, self._table) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 531324a45c0..14e62ac4e58 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -354,7 +354,6 @@ class StockMove(models.Model): user_warning += _('\n\nBlocking: %s') % ' ,'.join(moves_error.mapped('name')) raise UserError(user_warning) - @api.model_cr def init(self): self._cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('stock_move_product_location_index',)) if not self._cr.fetchone(): diff --git a/addons/stock/report/report_stock_forecast.py b/addons/stock/report/report_stock_forecast.py index 1bf69ab5719..b3cca6a6ecb 100644 --- a/addons/stock/report/report_stock_forecast.py +++ b/addons/stock/report/report_stock_forecast.py @@ -17,7 +17,6 @@ class ReportStockForecat(models.Model): picking_id = fields.Many2one('stock.picking', string='Picking', readonly=True) reference = fields.Char('Reference') - @api.model_cr def init(self): tools.drop_view_if_exists(self._cr, 'report_stock_forecast') query = """ diff --git a/addons/website/models/res_users.py b/addons/website/models/res_users.py index 8902e4c34b6..c5fb684888c 100644 --- a/addons/website/models/res_users.py +++ b/addons/website/models/res_users.py @@ -47,7 +47,6 @@ class ResUsers(models.Model): current_website = self.env['website'].get_current_website() return current_website.auth_signup_uninvited or super(ResUsers, self)._get_signup_invitation_scope() - @api.model_cr_context def _auto_init(self): result = super(ResUsers, self)._auto_init() # Use unique index to implement unique constraint per website, even if website_id is null diff --git a/addons/website_crm_partner_assign/report/crm_partner_report.py b/addons/website_crm_partner_assign/report/crm_partner_report.py index d78f1b1dd67..05043f7b313 100644 --- a/addons/website_crm_partner_assign/report/crm_partner_report.py +++ b/addons/website_crm_partner_assign/report/crm_partner_report.py @@ -30,7 +30,6 @@ class CrmPartnerReportAssign(models.Model): 'grade_id', 'parent_id', 'team_id', 'user_id'], } - @api.model_cr def init(self): """ CRM Lead Report diff --git a/addons/website_event_questions/report/report_event_registrations_questions.py b/addons/website_event_questions/report/report_event_registrations_questions.py index 8d229c55469..6bbd52d043f 100644 --- a/addons/website_event_questions/report/report_event_registrations_questions.py +++ b/addons/website_event_questions/report/report_event_registrations_questions.py @@ -14,7 +14,6 @@ class ReportEventRegistrationQuestions(models.Model): answer_id = fields.Many2one(comodel_name='event.answer', string='Answer') event_id = fields.Many2one(comodel_name='event.event', string='Event') - @api.model_cr def init(self): """ Event Question main report """ tools.drop_view_if_exists(self._cr, 'event_question_report') diff --git a/addons/website_form/models/models.py b/addons/website_form/models/models.py index 8f7f148de75..c3755143daa 100644 --- a/addons/website_form/models/models.py +++ b/addons/website_form/models/models.py @@ -79,7 +79,6 @@ class website_form_model_fields(models.Model): _description = 'Fields' _inherit = 'ir.model.fields' - @api.model_cr def init(self): # set all existing unset website_form_blacklisted fields to ``true`` # (so that we can use it as a whitelist rather than a blacklist) diff --git a/addons/website_slides/models/slide_channel.py b/addons/website_slides/models/slide_channel.py index c157f692599..d3614c4a845 100644 --- a/addons/website_slides/models/slide_channel.py +++ b/addons/website_slides/models/slide_channel.py @@ -294,7 +294,6 @@ class Channel(models.Model): # ORM Overrides # --------------------------------------------------------- - @api.model_cr_context def _init_column(self, column_name): """ Initialize the value of the given column for existing rows. Overridden here because we need to generate different access tokens |
