diff --git a/addons/account/demo/account_demo.py b/addons/account/demo/account_demo.py
index 748d11e9611c2..48ef693a51bc4 100644
--- a/addons/account/demo/account_demo.py
+++ b/addons/account/demo/account_demo.py
@@ -12,7 +12,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@api.model
def _get_demo_data(self, company=False):
diff --git a/addons/account/models/account_account.py b/addons/account/models/account_account.py
index 1d28096a9b154..cccb55312003a 100644
--- a/addons/account/models/account_account.py
+++ b/addons/account/models/account_account.py
@@ -17,7 +17,6 @@
class AccountAccount(models.Model):
- _name = "account.account"
_inherit = ['mail.thread']
_description = "Account"
_order = "code, placeholder_code"
@@ -1398,7 +1397,6 @@ def _get_query_company_id(model):
class AccountGroup(models.Model):
- _name = "account.group"
_description = 'Account Group'
_order = 'code_prefix_start'
_check_company_auto = True
diff --git a/addons/account/models/account_account_tag.py b/addons/account/models/account_account_tag.py
index ea71b4021ddc3..5ab08f36c820f 100644
--- a/addons/account/models/account_account_tag.py
+++ b/addons/account/models/account_account_tag.py
@@ -5,7 +5,6 @@
class AccountAccountTag(models.Model):
- _name = 'account.account.tag'
_description = 'Account Tag'
name = fields.Char('Tag Name', required=True, translate=True)
diff --git a/addons/account/models/account_analytic_account.py b/addons/account/models/account_analytic_account.py
index 999d8122be66e..8c76bedc65f96 100644
--- a/addons/account/models/account_analytic_account.py
+++ b/addons/account/models/account_analytic_account.py
@@ -4,7 +4,7 @@
class AccountAnalyticAccount(models.Model):
- _inherit = 'account.analytic.account'
+ _inherit = ['account.analytic.account']
invoice_count = fields.Integer(
"Invoice Count",
diff --git a/addons/account/models/account_analytic_distribution_model.py b/addons/account/models/account_analytic_distribution_model.py
index df973700087f0..fe013db4a8c28 100644
--- a/addons/account/models/account_analytic_distribution_model.py
+++ b/addons/account/models/account_analytic_distribution_model.py
@@ -4,7 +4,7 @@
class AccountAnalyticDistributionModel(models.Model):
- _inherit = 'account.analytic.distribution.model'
+ _inherit = ['account.analytic.distribution.model']
account_prefix = fields.Char(
string='Accounts Prefix',
diff --git a/addons/account/models/account_analytic_line.py b/addons/account/models/account_analytic_line.py
index 9180f812080ef..a96315545af52 100644
--- a/addons/account/models/account_analytic_line.py
+++ b/addons/account/models/account_analytic_line.py
@@ -3,8 +3,9 @@
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
+
class AccountAnalyticLine(models.Model):
- _inherit = 'account.analytic.line'
+ _inherit = ['account.analytic.line']
_description = 'Analytic Line'
product_id = fields.Many2one(
diff --git a/addons/account/models/account_analytic_plan.py b/addons/account/models/account_analytic_plan.py
index 1f8e3613c9b8c..ea2a10ee5ceae 100644
--- a/addons/account/models/account_analytic_plan.py
+++ b/addons/account/models/account_analytic_plan.py
@@ -4,7 +4,7 @@
class AccountAnalyticApplicability(models.Model):
- _inherit = 'account.analytic.applicability'
+ _inherit = ['account.analytic.applicability']
_description = "Analytic Plan's Applicabilities"
business_domain = fields.Selection(
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
index 7a5941edba881..45348c76765f2 100644
--- a/addons/account/models/account_bank_statement.py
+++ b/addons/account/models/account_bank_statement.py
@@ -6,8 +6,8 @@
from odoo.tools import create_index
from odoo.tools.misc import formatLang
+
class AccountBankStatement(models.Model):
- _name = "account.bank.statement"
_description = "Bank Statement"
_order = "first_line_index desc"
_check_company_auto = True
diff --git a/addons/account/models/account_bank_statement_line.py b/addons/account/models/account_bank_statement_line.py
index bb310f79ab196..01c5eec052802 100644
--- a/addons/account/models/account_bank_statement_line.py
+++ b/addons/account/models/account_bank_statement_line.py
@@ -7,7 +7,6 @@
class AccountBankStatementLine(models.Model):
- _name = "account.bank.statement.line"
_inherits = {'account.move': 'move_id'}
_description = "Bank Statement Line"
_order = "internal_index desc"
@@ -832,9 +831,10 @@ def _synchronize_to_moves(self, changed_fields):
# For optimization purpose, creating the reverse relation of m2o in _inherits saves
+
+
# a lot of SQL queries
class AccountMove(models.Model):
- _name = "account.move"
_inherit = ['account.move']
statement_line_ids = fields.One2many('account.bank.statement.line', 'move_id', string='Statements')
diff --git a/addons/account/models/account_cash_rounding.py b/addons/account/models/account_cash_rounding.py
index c3abce53a89e9..0c1a435760b7a 100644
--- a/addons/account/models/account_cash_rounding.py
+++ b/addons/account/models/account_cash_rounding.py
@@ -12,7 +12,6 @@ class AccountCashRounding(models.Model):
0.05 CHF because coins of 0.01 CHF and 0.02 CHF aren't used anymore.
see https://en.wikipedia.org/wiki/Cash_rounding for more details.
"""
- _name = 'account.cash.rounding'
_description = 'Account Cash Rounding'
_check_company_auto = True
diff --git a/addons/account/models/account_code_mapping.py b/addons/account/models/account_code_mapping.py
index 40344545bf980..f9017771781fa 100644
--- a/addons/account/models/account_code_mapping.py
+++ b/addons/account/models/account_code_mapping.py
@@ -7,7 +7,6 @@ class AccountCodeMapping(models.Model):
# It is not stored in DB. Instead, records are only populated in cache by the
# `_search` override when accessing the One2many on `account.account`.
- _name = 'account.code.mapping'
_description = "Mapping of account codes per company"
_auto = False
_table_query = '0'
diff --git a/addons/account/models/account_full_reconcile.py b/addons/account/models/account_full_reconcile.py
index 519a7c0e78b9e..742624288a0f4 100644
--- a/addons/account/models/account_full_reconcile.py
+++ b/addons/account/models/account_full_reconcile.py
@@ -3,7 +3,6 @@
class AccountFullReconcile(models.Model):
- _name = "account.full.reconcile"
_description = "Full Reconcile"
partial_reconcile_ids = fields.One2many('account.partial.reconcile', 'full_reconcile_id', string='Reconciliation Parts')
diff --git a/addons/account/models/account_incoterms.py b/addons/account/models/account_incoterms.py
index 3c64715458717..e14c24f97f2d9 100644
--- a/addons/account/models/account_incoterms.py
+++ b/addons/account/models/account_incoterms.py
@@ -5,7 +5,6 @@
class AccountIncoterms(models.Model):
- _name = 'account.incoterms'
_description = 'Incoterms'
name = fields.Char(
diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py
index 196e2e7cda2ac..90b13e8c53f0a 100644
--- a/addons/account/models/account_journal.py
+++ b/addons/account/models/account_journal.py
@@ -12,7 +12,6 @@
class AccountJournalGroup(models.Model):
- _name = 'account.journal.group'
_description = "Account Journal Group"
_check_company_auto = True
_check_company_domain = models.check_company_domain_parent_of
@@ -30,8 +29,8 @@ class AccountJournalGroup(models.Model):
('uniq_name', 'unique(company_id, name)', 'A Ledger group name must be unique per company.'),
]
+
class AccountJournal(models.Model):
- _name = "account.journal"
_description = "Journal"
_order = 'sequence, type, code'
_inherit = ['portal.mixin',
diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py
index ba9f85fd83720..c56d2f49e83e7 100644
--- a/addons/account/models/account_journal_dashboard.py
+++ b/addons/account/models/account_journal_dashboard.py
@@ -21,8 +21,8 @@ def group_by_journal(vals_list):
return res
-class account_journal(models.Model):
- _inherit = "account.journal"
+class AccountJournal(models.Model):
+ _inherit = ["account.journal"]
kanban_dashboard = fields.Text(compute='_kanban_dashboard')
kanban_dashboard_graph = fields.Text(compute='_kanban_dashboard_graph')
diff --git a/addons/account/models/account_lock_exception.py b/addons/account/models/account_lock_exception.py
index 8c1cac4665c8b..44dd2f79a5173 100644
--- a/addons/account/models/account_lock_exception.py
+++ b/addons/account/models/account_lock_exception.py
@@ -9,8 +9,7 @@
from datetime import date
-class AccountLockException(models.Model):
- _name = "account.lock_exception"
+class AccountLock_Exception(models.Model):
_description = "Account Lock Exception"
active = fields.Boolean(
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 61c639b04886b..943a3c04b7e9d 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -77,7 +77,6 @@
class AccountMove(models.Model):
- _name = "account.move"
_inherit = ['portal.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin', 'sequence.mixin', 'product.catalog.mixin']
_description = "Journal Entry"
_order = 'date desc, name desc, invoice_date desc, id desc'
diff --git a/addons/account/models/account_move_line.py b/addons/account/models/account_move_line.py
index 4da3eaf95edf9..e8aa1767e24ad 100644
--- a/addons/account/models/account_move_line.py
+++ b/addons/account/models/account_move_line.py
@@ -18,8 +18,7 @@
class AccountMoveLine(models.Model):
- _name = "account.move.line"
- _inherit = "analytic.mixin"
+ _inherit = ["analytic.mixin"]
_description = "Journal Item"
_order = "date desc, move_name desc, id"
_check_company_auto = True
diff --git a/addons/account/models/account_move_line_tax_details.py b/addons/account/models/account_move_line_tax_details.py
index 40849a29ddae9..b95f7dc56400c 100644
--- a/addons/account/models/account_move_line_tax_details.py
+++ b/addons/account/models/account_move_line_tax_details.py
@@ -5,7 +5,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
@api.model
def _get_query_tax_details_from_domain(self, domain, fallback=True) -> SQL:
diff --git a/addons/account/models/account_move_send.py b/addons/account/models/account_move_send.py
index f95ac0ee1d3b6..322d7103b79fd 100644
--- a/addons/account/models/account_move_send.py
+++ b/addons/account/models/account_move_send.py
@@ -10,7 +10,6 @@ class AccountMoveSend(models.AbstractModel):
See 'account.move.send.batch.wizard' for multiple invoices sending wizard (async)
and 'account.move.send.wizard' for single invoice sending wizard (sync).
"""
- _name = 'account.move.send'
_description = "Account Move Send"
# -------------------------------------------------------------------------
diff --git a/addons/account/models/account_partial_reconcile.py b/addons/account/models/account_partial_reconcile.py
index c6095a12f4c09..1823bc8e1babf 100644
--- a/addons/account/models/account_partial_reconcile.py
+++ b/addons/account/models/account_partial_reconcile.py
@@ -7,7 +7,6 @@
class AccountPartialReconcile(models.Model):
- _name = "account.partial.reconcile"
_description = "Partial Reconcile"
# ==== Reconciliation fields ====
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py
index 2c7daca247553..8124c57f4a7dc 100644
--- a/addons/account/models/account_payment.py
+++ b/addons/account/models/account_payment.py
@@ -7,7 +7,6 @@
class AccountPayment(models.Model):
- _name = "account.payment"
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
_description = "Payments"
_order = "date desc, name desc"
@@ -1122,9 +1121,10 @@ def button_open_journal_entry(self):
# For optimization purpose, creating the reverse relation of m2o in _inherits saves
+
+
# a lot of SQL queries
class AccountMove(models.Model):
- _name = "account.move"
_inherit = ['account.move']
payment_ids = fields.One2many('account.payment', 'move_id', string='Payments')
diff --git a/addons/account/models/account_payment_method.py b/addons/account/models/account_payment_method.py
index 03d6f9aa6d074..ad44b562e87a7 100644
--- a/addons/account/models/account_payment_method.py
+++ b/addons/account/models/account_payment_method.py
@@ -6,7 +6,6 @@
class AccountPaymentMethod(models.Model):
- _name = "account.payment.method"
_description = "Payment Methods"
name = fields.Char(required=True, translate=True)
@@ -94,7 +93,6 @@ def unlink(self):
class AccountPaymentMethodLine(models.Model):
- _name = "account.payment.method.line"
_description = "Payment Methods"
_order = 'sequence, id'
diff --git a/addons/account/models/account_payment_term.py b/addons/account/models/account_payment_term.py
index 84c60add7a208..f8be5e37cec82 100644
--- a/addons/account/models/account_payment_term.py
+++ b/addons/account/models/account_payment_term.py
@@ -9,7 +9,6 @@
class AccountPaymentTerm(models.Model):
- _name = "account.payment.term"
_description = "Payment Terms"
_order = "sequence, id"
_check_company_domain = models.check_company_domain_parent_of
@@ -263,8 +262,8 @@ def _get_last_discount_date_formatted(self, date_ref):
return None
return format_date(self.env, self._get_last_discount_date(date_ref))
+
class AccountPaymentTermLine(models.Model):
- _name = "account.payment.term.line"
_description = "Payment Terms Line"
_order = "id"
diff --git a/addons/account/models/account_reconcile_model.py b/addons/account/models/account_reconcile_model.py
index adc3a6ccc1bf3..23fe376edbe0f 100644
--- a/addons/account/models/account_reconcile_model.py
+++ b/addons/account/models/account_reconcile_model.py
@@ -9,7 +9,6 @@
class AccountReconcileModelPartnerMapping(models.Model):
- _name = 'account.reconcile.model.partner.mapping'
_description = 'Partner mapping for reconciliation models'
_check_company_auto = True
@@ -37,8 +36,7 @@ def validate_regex(self):
class AccountReconcileModelLine(models.Model):
- _name = 'account.reconcile.model.line'
- _inherit = 'analytic.mixin'
+ _inherit = ['analytic.mixin']
_description = 'Rules for the reconciliation model'
_order = 'sequence, id'
_check_company_auto = True
@@ -172,7 +170,6 @@ def _validate_amount(self):
class AccountReconcileModel(models.Model):
- _name = 'account.reconcile.model'
_description = 'Preset to create journal entries during a invoices and payments matching'
_inherit = ['mail.thread']
_order = 'sequence, id'
diff --git a/addons/account/models/account_report.py b/addons/account/models/account_report.py
index e27ff1aaa0817..6f6bc51bc7530 100644
--- a/addons/account/models/account_report.py
+++ b/addons/account/models/account_report.py
@@ -21,8 +21,8 @@
DOMAIN_REGEX = re.compile(r'(-?sum)\((.*)\)')
+
class AccountReport(models.Model):
- _name = "account.report"
_description = "Accounting Report"
_order = 'sequence, id'
@@ -291,7 +291,6 @@ def _compute_display_name(self):
class AccountReportLine(models.Model):
- _name = "account.report.line"
_description = "Accounting Report Line"
_order = 'sequence, id'
@@ -519,7 +518,6 @@ def _unlink_child_expressions(self):
class AccountReportExpression(models.Model):
- _name = "account.report.expression"
_description = "Accounting Report Expression"
_rec_name = 'report_line_name'
@@ -840,7 +838,6 @@ def _get_carryover_target_expression(self, options):
class AccountReportColumn(models.Model):
- _name = "account.report.column"
_description = "Accounting Report Column"
_order = 'sequence, id'
@@ -855,7 +852,6 @@ class AccountReportColumn(models.Model):
class AccountReportExternalValue(models.Model):
- _name = "account.report.external.value"
_description = 'Accounting Report External Value'
_check_company_auto = True
_order = 'date, id'
diff --git a/addons/account/models/account_root.py b/addons/account/models/account_root.py
index 884d7a7b69b7e..0a857c565acc7 100644
--- a/addons/account/models/account_root.py
+++ b/addons/account/models/account_root.py
@@ -6,7 +6,6 @@
class AccountRoot(models.Model):
- _name = 'account.root'
_description = 'Account codes first 2 digits'
_auto = False
_table_query = '0'
diff --git a/addons/account/models/account_tax.py b/addons/account/models/account_tax.py
index 6dd5939d3fece..f0ddad485d313 100644
--- a/addons/account/models/account_tax.py
+++ b/addons/account/models/account_tax.py
@@ -23,7 +23,6 @@
class AccountTaxGroup(models.Model):
- _name = 'account.tax.group'
_description = 'Tax Group'
_order = 'sequence asc, id'
_check_company_auto = True
@@ -85,7 +84,6 @@ def _check_misconfigured_tax_groups(self, company, countries):
class AccountTax(models.Model):
- _name = 'account.tax'
_inherit = ['mail.thread']
_description = 'Tax'
_order = 'sequence,id'
@@ -2490,7 +2488,6 @@ def biggest_amount(candidate, negative_line):
class AccountTaxRepartitionLine(models.Model):
- _name = "account.tax.repartition.line"
_description = "Tax Repartition Line"
_order = 'document_type, repartition_type, sequence, id'
_check_company_auto = True
diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py
index 9642e3ab053bd..a19fde7488b76 100644
--- a/addons/account/models/chart_template.py
+++ b/addons/account/models/chart_template.py
@@ -63,7 +63,6 @@ def wrapper(*args, **kwargs):
class AccountChartTemplate(models.AbstractModel):
- _name = "account.chart.template"
_description = "Account Chart Template"
@property
diff --git a/addons/account/models/company.py b/addons/account/models/company.py
index afe96c5aa71e2..623d00f7fef7e 100644
--- a/addons/account/models/company.py
+++ b/addons/account/models/company.py
@@ -51,7 +51,6 @@
class ResCompany(models.Model):
- _name = "res.company"
_inherit = ["res.company", "mail.thread"]
fiscalyear_last_day = fields.Integer(default=31, required=True)
diff --git a/addons/account/models/decimal_precision.py b/addons/account/models/decimal_precision.py
index 22c8176b257fd..6d8d14fa7e119 100644
--- a/addons/account/models/decimal_precision.py
+++ b/addons/account/models/decimal_precision.py
@@ -1,7 +1,8 @@
from odoo import models
+
class DecimalPrecision(models.Model):
- _inherit = 'decimal.precision'
+ _inherit = ['decimal.precision']
def precision_get(self, application):
if application == 'Discount' and self.env.context.get('ignore_discount_precision'):
diff --git a/addons/account/models/digest.py b/addons/account/models/digest.py
index ac00a42d43cb3..c4b8a7ea01489 100644
--- a/addons/account/models/digest.py
+++ b/addons/account/models/digest.py
@@ -5,8 +5,8 @@
from odoo.exceptions import AccessError
-class Digest(models.Model):
- _inherit = 'digest.digest'
+class DigestDigest(models.Model):
+ _inherit = ['digest.digest']
kpi_account_total_revenue = fields.Boolean('Revenue')
kpi_account_total_revenue_value = fields.Monetary(compute='_compute_kpi_account_total_revenue_value')
@@ -34,6 +34,6 @@ def _compute_kpi_account_total_revenue_value(self):
record.kpi_account_total_revenue_value = -total_per_companies.get(company, 0)
def _compute_kpis_actions(self, company, user):
- res = super(Digest, self)._compute_kpis_actions(company, user)
+ res = super()._compute_kpis_actions(company, user)
res['kpi_account_total_revenue'] = 'account.action_move_out_invoice_type&menu_id=%s' % self.env.ref('account.menu_finance').id
return res
diff --git a/addons/account/models/ir_actions_report.py b/addons/account/models/ir_actions_report.py
index 6a3e6d75cf44e..74159113eac66 100644
--- a/addons/account/models/ir_actions_report.py
+++ b/addons/account/models/ir_actions_report.py
@@ -8,7 +8,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
is_invoice_report = fields.Boolean(
string="Invoice report",
diff --git a/addons/account/models/ir_attachment.py b/addons/account/models/ir_attachment.py
index 3b5de150846f8..5d6214487b105 100644
--- a/addons/account/models/ir_attachment.py
+++ b/addons/account/models/ir_attachment.py
@@ -11,7 +11,7 @@
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
def _build_zip_from_attachments(self):
""" Return the zip bytes content resulting from compressing the attachments in `self`"""
diff --git a/addons/account/models/ir_module.py b/addons/account/models/ir_module.py
index eb2bd11de1fdb..ae99e13acb94e 100644
--- a/addons/account/models/ir_module.py
+++ b/addons/account/models/ir_module.py
@@ -20,8 +20,9 @@ def templ(env, code, name=None, country='', **kwargs):
template_class = isclass
template_function = lambda f: isfunction(f) and hasattr(f, '_l10n_template') and f._l10n_template[1] == 'template_data'
-class IrModule(models.Model):
- _inherit = "ir.module.module"
+
+class IrModuleModule(models.Model):
+ _inherit = ["ir.module.module"]
account_templates = fields.Binary(compute='_compute_account_templates', exportable=False)
diff --git a/addons/account/models/ir_ui_menu.py b/addons/account/models/ir_ui_menu.py
index 4c95efef328fe..e02aa4390821c 100644
--- a/addons/account/models/ir_ui_menu.py
+++ b/addons/account/models/ir_ui_menu.py
@@ -2,7 +2,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
def _load_menus_blacklist(self):
res = super()._load_menus_blacklist()
diff --git a/addons/account/models/mail_message.py b/addons/account/models/mail_message.py
index f0f9118ba8a3f..fb43052a18130 100644
--- a/addons/account/models/mail_message.py
+++ b/addons/account/models/mail_message.py
@@ -16,8 +16,8 @@
}
-class Message(models.Model):
- _inherit = 'mail.message'
+class MailMessage(models.Model):
+ _inherit = ['mail.message']
account_audit_log_preview = fields.Text(string="Description", compute="_compute_account_audit_log_preview")
account_audit_log_move_id = fields.Many2one(
diff --git a/addons/account/models/mail_template.py b/addons/account/models/mail_template.py
index 6b854a3c65e10..6e0417274e083 100644
--- a/addons/account/models/mail_template.py
+++ b/addons/account/models/mail_template.py
@@ -3,7 +3,7 @@
class MailTemplate(models.Model):
- _inherit = 'mail.template'
+ _inherit = ['mail.template']
@api.ondelete(at_uninstall=False)
def _unlink_except_master_mail_template(self):
diff --git a/addons/account/models/mail_tracking_value.py b/addons/account/models/mail_tracking_value.py
index e5732251a1850..ea740ae676847 100644
--- a/addons/account/models/mail_tracking_value.py
+++ b/addons/account/models/mail_tracking_value.py
@@ -3,8 +3,8 @@
from odoo import api, models
-class MailTrackingValues(models.Model):
- _inherit = 'mail.tracking.value'
+class MailTrackingValue(models.Model):
+ _inherit = ['mail.tracking.value']
@api.ondelete(at_uninstall=True)
def _except_audit_log(self):
diff --git a/addons/account/models/merge_partner_automatic.py b/addons/account/models/merge_partner_automatic.py
index 072ab752b2440..ef68a98535f70 100644
--- a/addons/account/models/merge_partner_automatic.py
+++ b/addons/account/models/merge_partner_automatic.py
@@ -2,8 +2,8 @@
from .mail_message import bypass_token
-class MergePartnerAutomatic(models.TransientModel):
- _inherit = 'base.partner.merge.automatic.wizard'
+class BasePartnerMergeAutomaticWizard(models.TransientModel):
+ _inherit = ['base.partner.merge.automatic.wizard']
def _update_reference_fields(self, src_partners, dst_partner):
- return super(MergePartnerAutomatic, self.with_context(bypass_audit=bypass_token))._update_reference_fields(src_partners, dst_partner)
+ return super(BasePartnerMergeAutomaticWizard, self.with_context(bypass_audit=bypass_token))._update_reference_fields(src_partners, dst_partner)
diff --git a/addons/account/models/onboarding_onboarding.py b/addons/account/models/onboarding_onboarding.py
index 623e195363c9c..d71a79a839073 100644
--- a/addons/account/models/onboarding_onboarding.py
+++ b/addons/account/models/onboarding_onboarding.py
@@ -3,8 +3,8 @@
from odoo import api, models
-class Onboarding(models.Model):
- _inherit = 'onboarding.onboarding'
+class OnboardingOnboarding(models.Model):
+ _inherit = ['onboarding.onboarding']
# Invoice Onboarding
@api.model
diff --git a/addons/account/models/onboarding_onboarding_step.py b/addons/account/models/onboarding_onboarding_step.py
index 1a71f1ca1c885..45aa05426107e 100644
--- a/addons/account/models/onboarding_onboarding_step.py
+++ b/addons/account/models/onboarding_onboarding_step.py
@@ -3,8 +3,8 @@
from odoo import _, api, models
-class OnboardingStep(models.Model):
- _inherit = 'onboarding.onboarding.step'
+class OnboardingOnboardingStep(models.Model):
+ _inherit = ['onboarding.onboarding.step']
# COMMON STEPS
@api.model
diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py
index fa346581b8020..a0007a94faf52 100644
--- a/addons/account/models/partner.py
+++ b/addons/account/models/partner.py
@@ -18,8 +18,8 @@
_logger = logging.getLogger(__name__)
+
class AccountFiscalPosition(models.Model):
- _name = 'account.fiscal.position'
_description = 'Fiscal Position'
_order = 'sequence'
_check_company_auto = True
@@ -284,8 +284,8 @@ def action_create_foreign_taxes(self):
localization_module.sudo().button_immediate_install()
self.env["account.chart.template"]._instantiate_foreign_taxes(self.country_id, self.company_id)
+
class AccountFiscalPositionTax(models.Model):
- _name = 'account.fiscal.position.tax'
_description = 'Tax Mapping of Fiscal Position'
_rec_name = 'position_id'
_check_company_auto = True
@@ -306,7 +306,6 @@ class AccountFiscalPositionTax(models.Model):
class AccountFiscalPositionAccount(models.Model):
- _name = 'account.fiscal.position.account'
_description = 'Accounts Mapping of Fiscal Position'
_rec_name = 'position_id'
_check_company_auto = True
@@ -330,8 +329,7 @@ class AccountFiscalPositionAccount(models.Model):
class ResPartner(models.Model):
- _name = 'res.partner'
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
fiscal_country_codes = fields.Char(compute='_compute_fiscal_country_codes')
partner_vat_placeholder = fields.Char(compute='_compute_partner_vat_placeholder')
diff --git a/addons/account/models/product.py b/addons/account/models/product.py
index 90d4638a2d730..c253c1603217e 100644
--- a/addons/account/models/product.py
+++ b/addons/account/models/product.py
@@ -7,8 +7,9 @@
ACCOUNT_DOMAIN = "['&', ('deprecated', '=', False), ('account_type', 'not in', ('asset_receivable','liability_payable','asset_cash','liability_credit_card','off_balance'))]"
+
class ProductCategory(models.Model):
- _inherit = "product.category"
+ _inherit = ["product.category"]
property_account_income_categ_id = fields.Many2one('account.account', company_dependent=True,
string="Income Account",
@@ -28,8 +29,10 @@ class ProductCategory(models.Model):
#----------------------------------------------------------
# Products
#----------------------------------------------------------
+
+
class ProductTemplate(models.Model):
- _inherit = "product.template"
+ _inherit = ["product.template"]
taxes_id = fields.Many2many('account.tax', 'product_taxes_rel', 'prod_id', 'tax_id',
string="Sales Taxes",
@@ -180,7 +183,7 @@ def _get_list_price(self, price):
class ProductProduct(models.Model):
- _inherit = "product.product"
+ _inherit = ["product.product"]
tax_string = fields.Char(compute='_compute_tax_string')
diff --git a/addons/account/models/res_config_settings.py b/addons/account/models/res_config_settings.py
index d15b904ab25d0..7f20dff000520 100644
--- a/addons/account/models/res_config_settings.py
+++ b/addons/account/models/res_config_settings.py
@@ -6,7 +6,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
has_accounting_entries = fields.Boolean(compute='_compute_has_chart_of_accounts')
currency_id = fields.Many2one('res.currency', related="company_id.currency_id", required=True, readonly=False,
diff --git a/addons/account/models/res_currency.py b/addons/account/models/res_currency.py
index 404b62c172b7f..a5da0ca20d627 100644
--- a/addons/account/models/res_currency.py
+++ b/addons/account/models/res_currency.py
@@ -7,7 +7,7 @@
class ResCurrency(models.Model):
- _inherit = 'res.currency'
+ _inherit = ['res.currency']
def _get_fiscal_country_codes(self):
return ','.join(self.env.companies.mapped('account_fiscal_country_id.code'))
diff --git a/addons/account/models/res_partner_bank.py b/addons/account/models/res_partner_bank.py
index b9aea2e0de958..eb6ef4d28c632 100644
--- a/addons/account/models/res_partner_bank.py
+++ b/addons/account/models/res_partner_bank.py
@@ -10,7 +10,6 @@
class ResPartnerBank(models.Model):
- _name = 'res.partner.bank'
_inherit = ['res.partner.bank', 'mail.thread', 'mail.activity.mixin']
journal_id = fields.One2many(
diff --git a/addons/account/models/res_users.py b/addons/account/models/res_users.py
index b251f4cc6cc73..1d8cc1000351f 100644
--- a/addons/account/models/res_users.py
+++ b/addons/account/models/res_users.py
@@ -5,8 +5,8 @@
from odoo.exceptions import ValidationError
-class GroupsView(models.Model):
- _inherit = 'res.groups'
+class ResGroups(models.Model):
+ _inherit = ['res.groups']
@api.model
def get_application_groups(self, domain):
diff --git a/addons/account/models/sequence_mixin.py b/addons/account/models/sequence_mixin.py
index 8951b5cd54aa3..ea825730f8046 100644
--- a/addons/account/models/sequence_mixin.py
+++ b/addons/account/models/sequence_mixin.py
@@ -18,7 +18,6 @@ class SequenceMixin(models.AbstractModel):
docstring of _get_last_sequence.
"""
- _name = 'sequence.mixin'
_description = "Automatic sequence"
_sequence_field = "name"
diff --git a/addons/account/models/template_generic_coa.py b/addons/account/models/template_generic_coa.py
index a6f88a1f3e89d..bbbcd7bf278c9 100644
--- a/addons/account/models/template_generic_coa.py
+++ b/addons/account/models/template_generic_coa.py
@@ -2,9 +2,8 @@
from odoo.addons.account.models.chart_template import template
-
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@template('generic_coa')
def _get_generic_coa_template_data(self):
diff --git a/addons/account/models/uom_uom.py b/addons/account/models/uom_uom.py
index 2d104f6cd2386..6b24a28aa2939 100644
--- a/addons/account/models/uom_uom.py
+++ b/addons/account/models/uom_uom.py
@@ -4,8 +4,8 @@
from odoo import fields, models, api
-class UoM(models.Model):
- _inherit = "uom.uom"
+class UomUom(models.Model):
+ _inherit = ["uom.uom"]
fiscal_country_codes = fields.Char(compute="_compute_fiscal_country_codes")
diff --git a/addons/account/report/account_hash_integrity_templates.py b/addons/account/report/account_hash_integrity_templates.py
index fe2468415222f..328c2c8a72a3e 100644
--- a/addons/account/report/account_hash_integrity_templates.py
+++ b/addons/account/report/account_hash_integrity_templates.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class ReportAccountHashIntegrity(models.AbstractModel):
- _name = 'report.account.report_hash_integrity'
+class ReportAccountReport_Hash_Integrity(models.AbstractModel):
_description = 'Get hash integrity result as PDF.'
@api.model
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 8a31558ae065c..7423327c04cb8 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -8,7 +8,6 @@
class AccountInvoiceReport(models.Model):
- _name = "account.invoice.report"
_description = "Invoices Statistics"
_auto = False
_rec_name = 'invoice_date'
@@ -152,8 +151,7 @@ def _where(self) -> SQL:
)
-class ReportInvoiceWithoutPayment(models.AbstractModel):
- _name = 'report.account.report_invoice'
+class ReportAccountReport_Invoice(models.AbstractModel):
_description = 'Account report without payment lines'
@api.model
@@ -174,10 +172,10 @@ def _get_report_values(self, docids, data=None):
'qr_code_urls': qr_code_urls,
}
-class ReportInvoiceWithPayment(models.AbstractModel):
- _name = 'report.account.report_invoice_with_payments'
+
+class ReportAccountReport_Invoice_With_Payments(models.AbstractModel):
_description = 'Account report with payment lines'
- _inherit = 'report.account.report_invoice'
+ _inherit = ['report.account.report_invoice']
@api.model
def _get_report_values(self, docids, data=None):
diff --git a/addons/account/wizard/account_automatic_entry_wizard.py b/addons/account/wizard/account_automatic_entry_wizard.py
index e1ea1ae0eded4..1314addc8e127 100644
--- a/addons/account/wizard/account_automatic_entry_wizard.py
+++ b/addons/account/wizard/account_automatic_entry_wizard.py
@@ -10,8 +10,8 @@
from odoo.tools import frozendict
import json
-class AutomaticEntryWizard(models.TransientModel):
- _name = 'account.automatic.entry.wizard'
+
+class AccountAutomaticEntryWizard(models.TransientModel):
_description = 'Create Automatic Entries'
_check_company_auto = True
diff --git a/addons/account/wizard/account_autopost_bills_wizard.py b/addons/account/wizard/account_autopost_bills_wizard.py
index 2ba35334e910d..9a16632cf1d47 100644
--- a/addons/account/wizard/account_autopost_bills_wizard.py
+++ b/addons/account/wizard/account_autopost_bills_wizard.py
@@ -1,8 +1,7 @@
from odoo import models, fields
-class AutoPostBillsWizard(models.TransientModel):
- _name = "account.autopost.bills.wizard"
+class AccountAutopostBillsWizard(models.TransientModel):
_description = "Autopost Bills Wizard"
partner_id = fields.Many2one("res.partner")
diff --git a/addons/account/wizard/account_merge_wizard.py b/addons/account/wizard/account_merge_wizard.py
index 6202ea123b68c..33ee94706a0b0 100644
--- a/addons/account/wizard/account_merge_wizard.py
+++ b/addons/account/wizard/account_merge_wizard.py
@@ -4,7 +4,6 @@
class AccountMergeWizard(models.TransientModel):
- _name = 'account.merge.wizard'
_description = "Account merge wizard"
account_ids = fields.Many2many('account.account')
@@ -184,7 +183,6 @@ def _action_merge(self, accounts):
class AccountMergeWizardLine(models.TransientModel):
- _name = 'account.merge.wizard.line'
_description = "Account merge wizard line"
_order = 'sequence, id'
diff --git a/addons/account/wizard/account_move_reversal.py b/addons/account/wizard/account_move_reversal.py
index 3750117c5adac..0bf322d65bfdd 100644
--- a/addons/account/wizard/account_move_reversal.py
+++ b/addons/account/wizard/account_move_reversal.py
@@ -8,7 +8,6 @@ class AccountMoveReversal(models.TransientModel):
"""
Account move reversal wizard, it cancel an account move by reversing it.
"""
- _name = 'account.move.reversal'
_description = 'Account Move Reversal'
_check_company_auto = True
diff --git a/addons/account/wizard/account_move_send_batch_wizard.py b/addons/account/wizard/account_move_send_batch_wizard.py
index f5787bf98998a..7c15588c016c6 100644
--- a/addons/account/wizard/account_move_send_batch_wizard.py
+++ b/addons/account/wizard/account_move_send_batch_wizard.py
@@ -3,7 +3,6 @@
class AccountMoveSendBatchWizard(models.TransientModel):
"""Wizard that handles the sending of multiple invoices."""
- _name = 'account.move.send.batch.wizard'
_inherit = ['account.move.send']
_description = "Account Move Send Batch Wizard"
diff --git a/addons/account/wizard/account_move_send_wizard.py b/addons/account/wizard/account_move_send_wizard.py
index c7d5a598ad343..ddfe63189337d 100644
--- a/addons/account/wizard/account_move_send_wizard.py
+++ b/addons/account/wizard/account_move_send_wizard.py
@@ -4,7 +4,6 @@
class AccountMoveSendWizard(models.TransientModel):
"""Wizard that handles the sending a single invoice."""
- _name = 'account.move.send.wizard'
_inherit = ['account.move.send']
_description = "Account Move Send Wizard"
diff --git a/addons/account/wizard/account_payment_register.py b/addons/account/wizard/account_payment_register.py
index 85caabb6839e0..00e0ed9cf839e 100644
--- a/addons/account/wizard/account_payment_register.py
+++ b/addons/account/wizard/account_payment_register.py
@@ -8,7 +8,6 @@
class AccountPaymentRegister(models.TransientModel):
- _name = 'account.payment.register'
_description = 'Pay'
_check_company_auto = True
diff --git a/addons/account/wizard/account_resequence.py b/addons/account/wizard/account_resequence.py
index 7af58c9f871d2..36b563fda9e78 100644
--- a/addons/account/wizard/account_resequence.py
+++ b/addons/account/wizard/account_resequence.py
@@ -8,8 +8,7 @@
import json
-class ReSequenceWizard(models.TransientModel):
- _name = 'account.resequence.wizard'
+class AccountResequenceWizard(models.TransientModel):
_description = 'Remake the sequence of Journal Entries.'
sequence_number_reset = fields.Char(compute='_compute_sequence_number_reset')
@@ -23,7 +22,7 @@ class ReSequenceWizard(models.TransientModel):
@api.model
def default_get(self, fields_list):
- values = super(ReSequenceWizard, self).default_get(fields_list)
+ values = super().default_get(fields_list)
if 'move_ids' not in fields_list:
return values
active_move_ids = self.env['account.move']
diff --git a/addons/account/wizard/account_secure_entries_wizard.py b/addons/account/wizard/account_secure_entries_wizard.py
index bb3aa84b9ef4d..098ff43f1c72a 100644
--- a/addons/account/wizard/account_secure_entries_wizard.py
+++ b/addons/account/wizard/account_secure_entries_wizard.py
@@ -6,11 +6,10 @@
from odoo.tools import format_list
-class AccountSecureEntries(models.TransientModel):
+class AccountSecureEntriesWizard(models.TransientModel):
"""
This wizard is used to secure journal entries (with a hash)
"""
- _name = 'account.secure.entries.wizard'
_description = 'Secure Journal Entries'
company_id = fields.Many2one(
diff --git a/addons/account/wizard/account_validate_account_move.py b/addons/account/wizard/account_validate_account_move.py
index c985ba6317b97..e81d33217b236 100644
--- a/addons/account/wizard/account_validate_account_move.py
+++ b/addons/account/wizard/account_validate_account_move.py
@@ -4,7 +4,6 @@
class ValidateAccountMove(models.TransientModel):
- _name = "validate.account.move"
_description = "Validate Account Move"
move_ids = fields.Many2many('account.move')
diff --git a/addons/account/wizard/accrued_orders.py b/addons/account/wizard/accrued_orders.py
index 7502a0935e0df..02daea840db03 100644
--- a/addons/account/wizard/accrued_orders.py
+++ b/addons/account/wizard/accrued_orders.py
@@ -7,8 +7,8 @@
from odoo.tools import date_utils
from odoo.tools.misc import formatLang
-class AccruedExpenseRevenue(models.TransientModel):
- _name = 'account.accrued.orders.wizard'
+
+class AccountAccruedOrdersWizard(models.TransientModel):
_description = 'Accrued Orders Wizard'
_check_company_auto = True
diff --git a/addons/account/wizard/base_document_layout.py b/addons/account/wizard/base_document_layout.py
index e4bd2ce8b5cd3..33b8943be8702 100644
--- a/addons/account/wizard/base_document_layout.py
+++ b/addons/account/wizard/base_document_layout.py
@@ -2,7 +2,7 @@
class BaseDocumentLayout(models.TransientModel):
- _inherit = 'base.document.layout'
+ _inherit = ['base.document.layout']
from_invoice = fields.Boolean()
qr_code = fields.Boolean(related='company_id.qr_code', readonly=False)
diff --git a/addons/account/wizard/base_partner_merge.py b/addons/account/wizard/base_partner_merge.py
index b0618717e3c47..f77e11aafedf0 100644
--- a/addons/account/wizard/base_partner_merge.py
+++ b/addons/account/wizard/base_partner_merge.py
@@ -1,8 +1,8 @@
from odoo import models
-class MergePartnerAutomatic(models.TransientModel):
- _inherit = 'base.partner.merge.automatic.wizard'
+class BasePartnerMergeAutomaticWizard(models.TransientModel):
+ _inherit = ['base.partner.merge.automatic.wizard']
def _get_summable_fields(self):
"""Add to summable fields list, fields created in this module.
diff --git a/addons/account/wizard/setup_wizards.py b/addons/account/wizard/setup_wizards.py
index af443fe27fee5..bd55baf26aa4f 100644
--- a/addons/account/wizard/setup_wizards.py
+++ b/addons/account/wizard/setup_wizards.py
@@ -7,8 +7,7 @@
from odoo.exceptions import ValidationError
-class FinancialYearOpeningWizard(models.TransientModel):
- _name = 'account.financial.year.op'
+class AccountFinancialYearOp(models.TransientModel):
_description = 'Opening Balance of Financial Year'
company_id = fields.Many2one(comodel_name='res.company', required=True)
@@ -67,9 +66,8 @@ def action_save_onboarding_fiscal_year(self):
return {'type': 'ir.actions.client', 'tag': 'soft_reload'}
-class SetupBarBankConfigWizard(models.TransientModel):
+class AccountSetupBankManualConfig(models.TransientModel):
_inherits = {'res.partner.bank': 'res_partner_bank_id'}
- _name = 'account.setup.bank.manual.config'
_description = 'Bank setup manual config'
_check_company_auto = True
diff --git a/addons/account_check_printing/models/account_journal.py b/addons/account_check_printing/models/account_journal.py
index 1d62091559215..357979c7127c1 100644
--- a/addons/account_check_printing/models/account_journal.py
+++ b/addons/account_check_printing/models/account_journal.py
@@ -7,7 +7,7 @@
class AccountJournal(models.Model):
- _inherit = "account.journal"
+ _inherit = ["account.journal"]
def _default_outbound_payment_methods(self):
res = super()._default_outbound_payment_methods()
diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py
index fb3b62749ca98..2a4b15c4dee58 100644
--- a/addons/account_check_printing/models/account_payment.py
+++ b/addons/account_check_printing/models/account_payment.py
@@ -10,7 +10,7 @@
class AccountPayment(models.Model):
- _inherit = "account.payment"
+ _inherit = ["account.payment"]
check_amount_in_words = fields.Char(
string="Amount in Words",
diff --git a/addons/account_check_printing/models/account_payment_method.py b/addons/account_check_printing/models/account_payment_method.py
index 65232e82605f8..f9031c20aa7b3 100644
--- a/addons/account_check_printing/models/account_payment_method.py
+++ b/addons/account_check_printing/models/account_payment_method.py
@@ -5,7 +5,7 @@
class AccountPaymentMethod(models.Model):
- _inherit = 'account.payment.method'
+ _inherit = ['account.payment.method']
@api.model
def _get_payment_method_information(self):
diff --git a/addons/account_check_printing/models/res_company.py b/addons/account_check_printing/models/res_company.py
index a96ad9a559966..785e194e9e4f0 100644
--- a/addons/account_check_printing/models/res_company.py
+++ b/addons/account_check_printing/models/res_company.py
@@ -3,8 +3,8 @@
from odoo import models, fields
-class res_company(models.Model):
- _inherit = "res.company"
+class ResCompany(models.Model):
+ _inherit = ["res.company"]
# This field needs to be overridden with `selection_add` in the modules which intends to add report layouts.
# The xmlID of all the report actions which are actually Check Layouts has to be kept as key of the selection.
diff --git a/addons/account_check_printing/models/res_config_settings.py b/addons/account_check_printing/models/res_config_settings.py
index 5716e12801f86..719432cf1db12 100644
--- a/addons/account_check_printing/models/res_config_settings.py
+++ b/addons/account_check_printing/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
account_check_printing_layout = fields.Selection(
related='company_id.account_check_printing_layout',
diff --git a/addons/account_check_printing/wizard/print_prenumbered_checks.py b/addons/account_check_printing/wizard/print_prenumbered_checks.py
index 97c0d465d7173..ccbbd28016d34 100644
--- a/addons/account_check_printing/wizard/print_prenumbered_checks.py
+++ b/addons/account_check_printing/wizard/print_prenumbered_checks.py
@@ -6,8 +6,7 @@
from odoo.exceptions import ValidationError
-class PrintPreNumberedChecks(models.TransientModel):
- _name = 'print.prenumbered.checks'
+class PrintPrenumberedChecks(models.TransientModel):
_description = 'Print Pre-numbered Checks'
next_check_number = fields.Char('Next Check Number', required=True)
diff --git a/addons/account_debit_note/models/account_journal.py b/addons/account_debit_note/models/account_journal.py
index 1b8d8fed7cdc5..17c155ff44011 100644
--- a/addons/account_debit_note/models/account_journal.py
+++ b/addons/account_debit_note/models/account_journal.py
@@ -2,7 +2,7 @@
class AccountJournal(models.Model):
- _inherit = "account.journal"
+ _inherit = ["account.journal"]
debit_sequence = fields.Boolean(
string="Dedicated Debit Note Sequence",
diff --git a/addons/account_debit_note/models/account_move.py b/addons/account_debit_note/models/account_move.py
index b27a73726c7f0..9910f6aac86f8 100644
--- a/addons/account_debit_note/models/account_move.py
+++ b/addons/account_debit_note/models/account_move.py
@@ -3,8 +3,9 @@
from odoo import models, fields, api, _
+
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
debit_origin_id = fields.Many2one('account.move', 'Original Invoice Debited', readonly=True, copy=False, index='btree_not_null')
debit_note_ids = fields.One2many('account.move', 'debit_origin_id', 'Debit Notes',
diff --git a/addons/account_debit_note/wizard/account_debit_note.py b/addons/account_debit_note/wizard/account_debit_note.py
index aa3e945e2dac9..36b6e479f3725 100644
--- a/addons/account_debit_note/wizard/account_debit_note.py
+++ b/addons/account_debit_note/wizard/account_debit_note.py
@@ -10,7 +10,6 @@ class AccountDebitNote(models.TransientModel):
Opposite of a Credit Note, but different from a regular invoice as you need the link to the original invoice.
In some cases, also used to cancel Credit Notes
"""
- _name = 'account.debit.note'
_description = 'Add Debit Note wizard'
move_ids = fields.Many2many('account.move', 'account_move_debit_move', 'debit_id', 'move_id',
diff --git a/addons/account_edi/models/account_edi_document.py b/addons/account_edi/models/account_edi_document.py
index 3eb6ba14ae5b2..8a97e8e863b85 100644
--- a/addons/account_edi/models/account_edi_document.py
+++ b/addons/account_edi/models/account_edi_document.py
@@ -15,7 +15,6 @@
class AccountEdiDocument(models.Model):
- _name = 'account.edi.document'
_description = 'Electronic Document for an account.move'
# == Stored fields ==
diff --git a/addons/account_edi/models/account_edi_format.py b/addons/account_edi/models/account_edi_format.py
index 3d318e87c5d72..6a9515234d54b 100644
--- a/addons/account_edi/models/account_edi_format.py
+++ b/addons/account_edi/models/account_edi_format.py
@@ -19,7 +19,6 @@
class AccountEdiFormat(models.Model):
- _name = 'account.edi.format'
_description = 'EDI format'
name = fields.Char()
diff --git a/addons/account_edi/models/account_journal.py b/addons/account_edi/models/account_journal.py
index be5d975d79fc0..83d890808f77d 100644
--- a/addons/account_edi/models/account_journal.py
+++ b/addons/account_edi/models/account_journal.py
@@ -8,7 +8,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
edi_format_ids = fields.Many2many(comodel_name='account.edi.format',
string='Electronic invoicing',
diff --git a/addons/account_edi/models/account_move.py b/addons/account_edi/models/account_move.py
index 38a720380df52..0e90ddc2f6f5e 100644
--- a/addons/account_edi/models/account_move.py
+++ b/addons/account_edi/models/account_move.py
@@ -10,7 +10,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
edi_document_ids = fields.One2many(
comodel_name='account.edi.document',
diff --git a/addons/account_edi/models/account_move_send.py b/addons/account_edi/models/account_move_send.py
index dff0b376d3f47..b4f6bb4b0be61 100644
--- a/addons/account_edi/models/account_move_send.py
+++ b/addons/account_edi/models/account_move_send.py
@@ -2,7 +2,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
@api.model
def _get_mail_attachment_from_doc(self, doc):
diff --git a/addons/account_edi/models/ir_actions_report.py b/addons/account_edi/models/ir_actions_report.py
index 2831321d41077..720fe5d8749e4 100644
--- a/addons/account_edi/models/ir_actions_report.py
+++ b/addons/account_edi/models/ir_actions_report.py
@@ -7,7 +7,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
def _render_qweb_pdf_prepare_streams(self, report_ref, data, res_ids=None):
# EXTENDS base
diff --git a/addons/account_edi/models/ir_attachment.py b/addons/account_edi/models/ir_attachment.py
index 491c56fe96bcd..2b18ccd425864 100644
--- a/addons/account_edi/models/ir_attachment.py
+++ b/addons/account_edi/models/ir_attachment.py
@@ -5,7 +5,7 @@
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
@api.ondelete(at_uninstall=False)
def _unlink_except_government_document(self):
diff --git a/addons/account_edi/wizard/account_resequence.py b/addons/account_edi/wizard/account_resequence.py
index f7af5f82c466e..1e64ccd3f9b47 100644
--- a/addons/account_edi/wizard/account_resequence.py
+++ b/addons/account_edi/wizard/account_resequence.py
@@ -2,8 +2,8 @@
from odoo.exceptions import UserError
-class ReSequenceWizard(models.TransientModel):
- _inherit = 'account.resequence.wizard'
+class AccountResequenceWizard(models.TransientModel):
+ _inherit = ['account.resequence.wizard']
def resequence(self):
edi_sent_moves = self.move_ids.edi_document_ids.filtered(lambda d: d.edi_format_id._needs_web_services() and d.state == 'sent')
diff --git a/addons/account_edi_proxy_client/models/account_edi_proxy_user.py b/addons/account_edi_proxy_client/models/account_edi_proxy_user.py
index 5d6fb429d22b8..2ba2ca5739343 100644
--- a/addons/account_edi_proxy_client/models/account_edi_proxy_user.py
+++ b/addons/account_edi_proxy_client/models/account_edi_proxy_user.py
@@ -23,14 +23,13 @@ def __init__(self, code, message=False):
super().__init__(message or code)
-class AccountEdiProxyClientUser(models.Model):
+class Account_Edi_Proxy_ClientUser(models.Model):
"""Represents a user of the proxy for an electronic invoicing format.
An edi_proxy_user has a unique identification on a specific format (for example, the vat for Peppol) which
allows to identify him when receiving a document addressed to him. It is linked to a specific company on a specific
Odoo database.
It also owns a key with which each file should be decrypted with (the proxy encrypt all the files with the public key).
"""
- _name = 'account_edi_proxy_client.user'
_description = 'Account EDI proxy user'
active = fields.Boolean(default=True)
diff --git a/addons/account_edi_proxy_client/models/key.py b/addons/account_edi_proxy_client/models/key.py
index e2e99112b78b6..a17c70b370807 100644
--- a/addons/account_edi_proxy_client/models/key.py
+++ b/addons/account_edi_proxy_client/models/key.py
@@ -3,8 +3,8 @@
from odoo import api, models
-class Key(models.Model):
- _inherit = 'certificate.key'
+class CertificateKey(models.Model):
+ _inherit = ['certificate.key']
@api.model
def _account_edi_fernet_decrypt(self, key, message):
diff --git a/addons/account_edi_proxy_client/models/res_company.py b/addons/account_edi_proxy_client/models/res_company.py
index 69e8ce4dc1a95..c1cc27b6c8017 100644
--- a/addons/account_edi_proxy_client/models/res_company.py
+++ b/addons/account_edi_proxy_client/models/res_company.py
@@ -4,6 +4,6 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
account_edi_proxy_client_ids = fields.One2many('account_edi_proxy_client.user', inverse_name='company_id')
diff --git a/addons/account_edi_ubl_cii/models/account_edi_common.py b/addons/account_edi_ubl_cii/models/account_edi_common.py
index 216c0572369a6..39878332a5303 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_common.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_common.py
@@ -92,7 +92,6 @@
class AccountEdiCommon(models.AbstractModel):
- _name = "account.edi.common"
_description = "Common functions for EDI documents: generate the data, the constraints, etc"
# -------------------------------------------------------------------------
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py b/addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py
index df1d93578f55c..fbc09864d0afd 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_cii_facturx.py
@@ -16,9 +16,8 @@
}
-class AccountEdiXmlCII(models.AbstractModel):
- _name = "account.edi.xml.cii"
- _inherit = 'account.edi.common'
+class AccountEdiXmlCii(models.AbstractModel):
+ _inherit = ['account.edi.common']
_description = "Factur-x/XRechnung CII 2.2.0"
def _find_value(self, xpath, tree, nsmap=False):
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py
index 4285a0e74b189..175092bbacf3e 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py
@@ -10,9 +10,8 @@
}
-class AccountEdiXmlUBL20(models.AbstractModel):
- _name = "account.edi.xml.ubl_20"
- _inherit = 'account.edi.common'
+class AccountEdiXmlUbl_20(models.AbstractModel):
+ _inherit = ['account.edi.common']
_description = "UBL 2.0"
def _find_value(self, xpath, tree, nsmap=False):
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_21.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_21.py
index eb589c700169e..8f2cb3595d21b 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_21.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_21.py
@@ -2,9 +2,8 @@
from odoo import api, models
-class AccountEdiXmlUBL21(models.AbstractModel):
- _name = "account.edi.xml.ubl_21"
- _inherit = 'account.edi.xml.ubl_20'
+class AccountEdiXmlUbl_21(models.AbstractModel):
+ _inherit = ['account.edi.xml.ubl_20']
_description = "UBL 2.1"
# -------------------------------------------------------------------------
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_a_nz.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_a_nz.py
index 2730670edb54c..3104b1a431282 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_a_nz.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_a_nz.py
@@ -3,9 +3,8 @@
from odoo import models
-class AccountEdiXmlUBLANZ(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = 'account.edi.xml.ubl_a_nz'
+class AccountEdiXmlUbl_A_Nz(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "A-NZ BIS Billing 3.0"
"""
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_bis3.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_bis3.py
index dc65e1ec828de..86483bac261ea 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_bis3.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_bis3.py
@@ -6,9 +6,8 @@
from stdnum.no import mva
-class AccountEdiXmlUBLBIS3(models.AbstractModel):
- _name = "account.edi.xml.ubl_bis3"
- _inherit = 'account.edi.xml.ubl_21'
+class AccountEdiXmlUbl_Bis3(models.AbstractModel):
+ _inherit = ['account.edi.xml.ubl_21']
_description = "UBL BIS Billing 3.0.12"
"""
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_efff.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_efff.py
index 66dada039f8e8..994013ceb416d 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_efff.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_efff.py
@@ -5,9 +5,8 @@
import re
-class AccountEdiXmlUBLEFFF(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_20"
- _name = 'account.edi.xml.ubl_efff'
+class AccountEdiXmlUbl_Efff(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_20"]
_description = "E-FFF (BE)"
# -------------------------------------------------------------------------
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_nlcius.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_nlcius.py
index 498ecb7901a0a..3628f0d9f9907 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_nlcius.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_nlcius.py
@@ -3,9 +3,8 @@
from odoo import models
-class AccountEdiXmlUBLNL(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = 'account.edi.xml.ubl_nl'
+class AccountEdiXmlUbl_Nl(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "SI-UBL 2.0 (NLCIUS)"
"""
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_sg.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_sg.py
index 6393a064f1536..3d6ac9051712e 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_sg.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_sg.py
@@ -2,9 +2,8 @@
from odoo import models
-class AccountEdiXmlUBLSG(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = "account.edi.xml.ubl_sg"
+class AccountEdiXmlUbl_Sg(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "SG BIS Billing 3.0"
"""
diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_xrechnung.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_xrechnung.py
index 798ec9b6bf45a..2db8a766022f7 100644
--- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_xrechnung.py
+++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_xrechnung.py
@@ -2,9 +2,8 @@
from odoo import models
-class AccountEdiXmlUBLDE(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = 'account.edi.xml.ubl_de'
+class AccountEdiXmlUbl_De(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "BIS3 DE (XRechnung)"
# -------------------------------------------------------------------------
diff --git a/addons/account_edi_ubl_cii/models/account_move.py b/addons/account_edi_ubl_cii/models/account_move.py
index 14c2b913688b6..a2b12acb416d4 100644
--- a/addons/account_edi_ubl_cii/models/account_move.py
+++ b/addons/account_edi_ubl_cii/models/account_move.py
@@ -2,7 +2,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
ubl_cii_xml_id = fields.Many2one(
comodel_name='ir.attachment',
diff --git a/addons/account_edi_ubl_cii/models/account_move_send.py b/addons/account_edi_ubl_cii/models/account_move_send.py
index ac39ece2982cc..a3823ac0457d2 100644
--- a/addons/account_edi_ubl_cii/models/account_move_send.py
+++ b/addons/account_edi_ubl_cii/models/account_move_send.py
@@ -13,7 +13,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
# -------------------------------------------------------------------------
# ALERTS
diff --git a/addons/account_edi_ubl_cii/models/res_partner.py b/addons/account_edi_ubl_cii/models/res_partner.py
index f91c645d94ad3..801d76a6430f3 100644
--- a/addons/account_edi_ubl_cii/models/res_partner.py
+++ b/addons/account_edi_ubl_cii/models/res_partner.py
@@ -8,7 +8,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(
selection_add=[
diff --git a/addons/account_edi_ubl_cii_tax_extension/models/account_edi_common.py b/addons/account_edi_ubl_cii_tax_extension/models/account_edi_common.py
index bb197af112706..87cd3ac5c4ef7 100644
--- a/addons/account_edi_ubl_cii_tax_extension/models/account_edi_common.py
+++ b/addons/account_edi_ubl_cii_tax_extension/models/account_edi_common.py
@@ -64,7 +64,7 @@
class AccountEdiCommon(models.AbstractModel):
- _inherit = "account.edi.common"
+ _inherit = ["account.edi.common"]
def _get_tax_unece_codes(self, customer, supplier, tax):
if tax.ubl_cii_tax_category_code:
diff --git a/addons/account_edi_ubl_cii_tax_extension/models/account_tax.py b/addons/account_edi_ubl_cii_tax_extension/models/account_tax.py
index caeda6eeeeeaf..fc0bf9b366a41 100644
--- a/addons/account_edi_ubl_cii_tax_extension/models/account_tax.py
+++ b/addons/account_edi_ubl_cii_tax_extension/models/account_tax.py
@@ -2,7 +2,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
ubl_cii_tax_category_code = fields.Selection(
help="The VAT category code used for electronic invoicing purposes.",
diff --git a/addons/account_fleet/models/account_move.py b/addons/account_fleet/models/account_move.py
index 851095d66442a..fac5c623b6002 100644
--- a/addons/account_fleet/models/account_move.py
+++ b/addons/account_fleet/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _post(self, soft=True):
vendor_bill_service = self.env.ref('account_fleet.data_fleet_service_type_vendor_bill', raise_if_not_found=False)
@@ -30,7 +30,7 @@ def _post(self, soft=True):
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
vehicle_id = fields.Many2one('fleet.vehicle', string='Vehicle', index='btree_not_null')
# used to decide whether the vehicle_id field is editable
diff --git a/addons/account_fleet/models/fleet_vehicle.py b/addons/account_fleet/models/fleet_vehicle.py
index 00e67f353af96..8cf0fa92b37e4 100644
--- a/addons/account_fleet/models/fleet_vehicle.py
+++ b/addons/account_fleet/models/fleet_vehicle.py
@@ -5,7 +5,7 @@
class FleetVehicle(models.Model):
- _inherit = 'fleet.vehicle'
+ _inherit = ['fleet.vehicle']
bill_count = fields.Integer(compute='_compute_move_ids', string="Bills Count")
account_move_ids = fields.One2many('account.move', compute='_compute_move_ids')
diff --git a/addons/account_fleet/models/fleet_vehicle_log_services.py b/addons/account_fleet/models/fleet_vehicle_log_services.py
index 6915617dc8ab7..dbd66318614ca 100644
--- a/addons/account_fleet/models/fleet_vehicle_log_services.py
+++ b/addons/account_fleet/models/fleet_vehicle_log_services.py
@@ -3,8 +3,9 @@
from odoo import api, fields, models, _
from odoo.exceptions import UserError
+
class FleetVehicleLogServices(models.Model):
- _inherit = 'fleet.vehicle.log.services'
+ _inherit = ['fleet.vehicle.log.services']
account_move_line_id = fields.Many2one(comodel_name='account.move.line') # One2one
account_move_state = fields.Selection(related='account_move_line_id.parent_state')
diff --git a/addons/account_fleet/wizard/account_automatic_entry_wizard.py b/addons/account_fleet/wizard/account_automatic_entry_wizard.py
index db2206fdf7ac5..9dffbd38741b6 100644
--- a/addons/account_fleet/wizard/account_automatic_entry_wizard.py
+++ b/addons/account_fleet/wizard/account_automatic_entry_wizard.py
@@ -3,8 +3,8 @@
from odoo import models
-class AutomaticEntryWizard(models.TransientModel):
- _inherit = 'account.automatic.entry.wizard'
+class AccountAutomaticEntryWizard(models.TransientModel):
+ _inherit = ['account.automatic.entry.wizard']
def _get_move_line_dict_vals_change_period(self, aml, date):
res = super()._get_move_line_dict_vals_change_period(aml, date)
diff --git a/addons/account_payment/models/account_journal.py b/addons/account_payment/models/account_journal.py
index a469ded0a6179..52413d6c6027e 100644
--- a/addons/account_payment/models/account_journal.py
+++ b/addons/account_payment/models/account_journal.py
@@ -6,7 +6,7 @@
class AccountJournal(models.Model):
- _inherit = "account.journal"
+ _inherit = ["account.journal"]
def _get_available_payment_method_lines(self, payment_type):
lines = super()._get_available_payment_method_lines(payment_type)
diff --git a/addons/account_payment/models/account_move.py b/addons/account_payment/models/account_move.py
index ffec57e76df67..d3d2ffe398fda 100644
--- a/addons/account_payment/models/account_move.py
+++ b/addons/account_payment/models/account_move.py
@@ -7,7 +7,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
transaction_ids = fields.Many2many(
string="Transactions", comodel_name='payment.transaction',
diff --git a/addons/account_payment/models/account_payment.py b/addons/account_payment/models/account_payment.py
index 7bdb2ea0abf0c..69047d2c74a51 100644
--- a/addons/account_payment/models/account_payment.py
+++ b/addons/account_payment/models/account_payment.py
@@ -5,7 +5,7 @@
class AccountPayment(models.Model):
- _inherit = 'account.payment'
+ _inherit = ['account.payment']
# == Business fields ==
payment_transaction_id = fields.Many2one(
diff --git a/addons/account_payment/models/account_payment_method.py b/addons/account_payment/models/account_payment_method.py
index ef2dcdd0893c6..3df688eaabb15 100644
--- a/addons/account_payment/models/account_payment_method.py
+++ b/addons/account_payment/models/account_payment_method.py
@@ -5,7 +5,7 @@
class AccountPaymentMethod(models.Model):
- _inherit = 'account.payment.method'
+ _inherit = ['account.payment.method']
@api.model
def _get_payment_method_information(self):
diff --git a/addons/account_payment/models/account_payment_method_line.py b/addons/account_payment/models/account_payment_method_line.py
index 7ae0be65bbf60..0ad703dff66f9 100644
--- a/addons/account_payment/models/account_payment_method_line.py
+++ b/addons/account_payment/models/account_payment_method_line.py
@@ -7,7 +7,7 @@
class AccountPaymentMethodLine(models.Model):
- _inherit = "account.payment.method.line"
+ _inherit = ["account.payment.method.line"]
payment_provider_id = fields.Many2one(
comodel_name='payment.provider',
diff --git a/addons/account_payment/models/onboarding_onboarding_step.py b/addons/account_payment/models/onboarding_onboarding_step.py
index 59bb6d2a668f2..aa5e6ef5c6de8 100644
--- a/addons/account_payment/models/onboarding_onboarding_step.py
+++ b/addons/account_payment/models/onboarding_onboarding_step.py
@@ -3,8 +3,8 @@
from odoo import api, models
-class OnboardingStep(models.Model):
- _inherit = 'onboarding.onboarding.step'
+class OnboardingOnboardingStep(models.Model):
+ _inherit = ['onboarding.onboarding.step']
@api.model
def action_open_step_payment_provider(self):
diff --git a/addons/account_payment/models/payment_provider.py b/addons/account_payment/models/payment_provider.py
index 5d52e557614a4..5ab298356907b 100644
--- a/addons/account_payment/models/payment_provider.py
+++ b/addons/account_payment/models/payment_provider.py
@@ -5,7 +5,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
journal_id = fields.Many2one(
string="Payment Journal",
diff --git a/addons/account_payment/models/payment_transaction.py b/addons/account_payment/models/payment_transaction.py
index 56ae98077baf7..0d98a1f3ce023 100644
--- a/addons/account_payment/models/payment_transaction.py
+++ b/addons/account_payment/models/payment_transaction.py
@@ -4,7 +4,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
payment_id = fields.Many2one(
string="Payment", comodel_name='account.payment', readonly=True)
diff --git a/addons/account_payment/wizards/account_payment_register.py b/addons/account_payment/wizards/account_payment_register.py
index 5a4189c4aefb1..07b830d0c216b 100644
--- a/addons/account_payment/wizards/account_payment_register.py
+++ b/addons/account_payment/wizards/account_payment_register.py
@@ -2,7 +2,7 @@
class AccountPaymentRegister(models.TransientModel):
- _inherit = 'account.payment.register'
+ _inherit = ['account.payment.register']
# == Business fields ==
payment_token_id = fields.Many2one(
diff --git a/addons/account_payment/wizards/payment_link_wizard.py b/addons/account_payment/wizards/payment_link_wizard.py
index a47074cdf7fc2..a177d7b735461 100644
--- a/addons/account_payment/wizards/payment_link_wizard.py
+++ b/addons/account_payment/wizards/payment_link_wizard.py
@@ -7,7 +7,7 @@
class PaymentLinkWizard(models.TransientModel):
- _inherit = 'payment.link.wizard'
+ _inherit = ['payment.link.wizard']
invoice_amount_due = fields.Monetary(
string="Amount Due",
diff --git a/addons/account_payment/wizards/payment_refund_wizard.py b/addons/account_payment/wizards/payment_refund_wizard.py
index 14084c47a30a6..f06afc56bae2d 100644
--- a/addons/account_payment/wizards/payment_refund_wizard.py
+++ b/addons/account_payment/wizards/payment_refund_wizard.py
@@ -5,7 +5,6 @@
class PaymentRefundWizard(models.TransientModel):
- _name = 'payment.refund.wizard'
_description = "Payment Refund Wizard"
payment_id = fields.Many2one(
diff --git a/addons/account_payment/wizards/res_config_settings.py b/addons/account_payment/wizards/res_config_settings.py
index 871a41af5068d..03b02c16ff00d 100644
--- a/addons/account_payment/wizards/res_config_settings.py
+++ b/addons/account_payment/wizards/res_config_settings.py
@@ -4,6 +4,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
pay_invoices_online = fields.Boolean(config_parameter='account_payment.enable_portal_payment')
diff --git a/addons/account_peppol/models/account_edi_proxy_user.py b/addons/account_peppol/models/account_edi_proxy_user.py
index d4c04bd952eb8..7c654571b5577 100644
--- a/addons/account_peppol/models/account_edi_proxy_user.py
+++ b/addons/account_peppol/models/account_edi_proxy_user.py
@@ -12,8 +12,8 @@
BATCH_SIZE = 50
-class AccountEdiProxyClientUser(models.Model):
- _inherit = 'account_edi_proxy_client.user'
+class Account_Edi_Proxy_ClientUser(models.Model):
+ _inherit = ['account_edi_proxy_client.user']
peppol_verification_code = fields.Char(string='SMS verification code')
proxy_type = fields.Selection(selection_add=[('peppol', 'PEPPOL')], ondelete={'peppol': 'cascade'})
diff --git a/addons/account_peppol/models/account_journal.py b/addons/account_peppol/models/account_journal.py
index 6a7c584aa24f4..b865a48b7dd3f 100644
--- a/addons/account_peppol/models/account_journal.py
+++ b/addons/account_peppol/models/account_journal.py
@@ -2,7 +2,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
account_peppol_proxy_state = fields.Selection(related='company_id.account_peppol_proxy_state')
is_peppol_journal = fields.Boolean(string="Account used for Peppol", default=False)
diff --git a/addons/account_peppol/models/account_move.py b/addons/account_peppol/models/account_move.py
index 0068eabf88958..23058027a4560 100644
--- a/addons/account_peppol/models/account_move.py
+++ b/addons/account_peppol/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
peppol_message_uuid = fields.Char(string='PEPPOL message ID')
peppol_move_state = fields.Selection(
diff --git a/addons/account_peppol/models/account_move_send.py b/addons/account_peppol/models/account_move_send.py
index d3e6e56552bef..cac67013ece2c 100644
--- a/addons/account_peppol/models/account_move_send.py
+++ b/addons/account_peppol/models/account_move_send.py
@@ -5,7 +5,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
# -------------------------------------------------------------------------
# ALERTS
diff --git a/addons/account_peppol/models/res_company.py b/addons/account_peppol/models/res_company.py
index 2a89135738467..5f37570ac39c6 100644
--- a/addons/account_peppol/models/res_company.py
+++ b/addons/account_peppol/models/res_company.py
@@ -47,7 +47,7 @@ def _re_sanitizer(expression):
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
account_peppol_contact_email = fields.Char(
string='Primary contact email',
diff --git a/addons/account_peppol/models/res_config_settings.py b/addons/account_peppol/models/res_config_settings.py
index cf99ab311abe8..d0aaef70fdadc 100644
--- a/addons/account_peppol/models/res_config_settings.py
+++ b/addons/account_peppol/models/res_config_settings.py
@@ -7,7 +7,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
account_peppol_edi_user = fields.Many2one(
comodel_name='account_edi_proxy_client.user',
diff --git a/addons/account_peppol/models/res_partner.py b/addons/account_peppol/models/res_partner.py
index bc09dc8eb395c..eccf907c244d8 100644
--- a/addons/account_peppol/models/res_partner.py
+++ b/addons/account_peppol/models/res_partner.py
@@ -16,7 +16,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_sending_method = fields.Selection(
selection_add=[('peppol', 'by Peppol')],
diff --git a/addons/account_peppol/wizard/account_move_send_batch_wizard.py b/addons/account_peppol/wizard/account_move_send_batch_wizard.py
index a18d765c7b706..8bf929587ecd7 100644
--- a/addons/account_peppol/wizard/account_move_send_batch_wizard.py
+++ b/addons/account_peppol/wizard/account_move_send_batch_wizard.py
@@ -2,7 +2,7 @@
class AccountMoveSendBatchWizard(models.TransientModel):
- _inherit = 'account.move.send.batch.wizard'
+ _inherit = ['account.move.send.batch.wizard']
def action_send_and_print(self, force_synchronous=False, allow_fallback_pdf=False):
# EXTENDS 'account'
diff --git a/addons/account_peppol/wizard/account_move_send_wizard.py b/addons/account_peppol/wizard/account_move_send_wizard.py
index 78f425cad2bab..c37338a4559cb 100644
--- a/addons/account_peppol/wizard/account_move_send_wizard.py
+++ b/addons/account_peppol/wizard/account_move_send_wizard.py
@@ -3,7 +3,7 @@
class AccountMoveSendWizard(models.TransientModel):
- _inherit = 'account.move.send.wizard'
+ _inherit = ['account.move.send.wizard']
def action_send_and_print(self, allow_fallback_pdf=False):
# EXTENDS 'account'
diff --git a/addons/account_peppol/wizard/peppol_registration.py b/addons/account_peppol/wizard/peppol_registration.py
index 62be9d2db3afe..0474bcba1d996 100644
--- a/addons/account_peppol/wizard/peppol_registration.py
+++ b/addons/account_peppol/wizard/peppol_registration.py
@@ -13,7 +13,6 @@
class PeppolRegistration(models.TransientModel):
- _name = 'peppol.registration'
_description = "Peppol Registration"
company_id = fields.Many2one(
diff --git a/addons/account_peppol/wizard/service_wizard.py b/addons/account_peppol/wizard/service_wizard.py
index 32e83683d0799..58b91a6ac59e4 100644
--- a/addons/account_peppol/wizard/service_wizard.py
+++ b/addons/account_peppol/wizard/service_wizard.py
@@ -8,8 +8,7 @@
_logger = logging.getLogger(__name__)
-class PeppolService(models.TransientModel):
- _name = 'account_peppol.service'
+class Account_PeppolService(models.TransientModel):
_order = 'document_name, id'
_description = 'Peppol Service'
@@ -19,8 +18,7 @@ class PeppolService(models.TransientModel):
enabled = fields.Boolean()
-class PeppolServiceConfig(models.TransientModel):
- _name = 'account_peppol.service.wizard'
+class Account_PeppolServiceWizard(models.TransientModel):
_description = 'Peppol Services Wizard'
edi_user_id = fields.Many2one(comodel_name='account_edi_proxy_client.user', string='EDI user')
diff --git a/addons/account_qr_code_emv/models/res_bank.py b/addons/account_qr_code_emv/models/res_bank.py
index e062e2a8d9d00..0f40ff009d1e7 100644
--- a/addons/account_qr_code_emv/models/res_bank.py
+++ b/addons/account_qr_code_emv/models/res_bank.py
@@ -8,7 +8,7 @@
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
display_qr_setting = fields.Boolean(compute='_compute_display_qr_setting')
include_reference = fields.Boolean(string="Include Reference", help="Include the reference in the QR code.")
diff --git a/addons/account_qr_code_sepa/models/res_bank.py b/addons/account_qr_code_sepa/models/res_bank.py
index 2eef919c1d39d..b282fe28ba977 100644
--- a/addons/account_qr_code_sepa/models/res_bank.py
+++ b/addons/account_qr_code_sepa/models/res_bank.py
@@ -4,7 +4,7 @@
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
def _get_qr_vals(self, qr_method, amount, currency, debtor_partner, free_communication, structured_communication):
if qr_method == 'sct_qr':
diff --git a/addons/account_tax_python/models/account_tax.py b/addons/account_tax_python/models/account_tax.py
index d099a66ac736d..58fde1be7edbf 100644
--- a/addons/account_tax_python/models/account_tax.py
+++ b/addons/account_tax_python/models/account_tax.py
@@ -18,8 +18,8 @@
}
-class AccountTaxPython(models.Model):
- _inherit = "account.tax"
+class AccountTax(models.Model):
+ _inherit = ["account.tax"]
amount_type = fields.Selection(
selection_add=[('code', "Custom Formula")],
diff --git a/addons/account_test/models/accounting_assert_test.py b/addons/account_test/models/accounting_assert_test.py
index 69d6f15949512..42efeaf4161e1 100644
--- a/addons/account_test/models/accounting_assert_test.py
+++ b/addons/account_test/models/accounting_assert_test.py
@@ -13,7 +13,6 @@
class AccountingAssertTest(models.Model):
- _name = "accounting.assert.test"
_description = 'Accounting Assert Test'
_order = "sequence"
diff --git a/addons/account_test/report/report_account_test.py b/addons/account_test/report/report_account_test.py
index e7c5c668d621f..2d167743c16bd 100644
--- a/addons/account_test/report/report_account_test.py
+++ b/addons/account_test/report/report_account_test.py
@@ -9,8 +9,7 @@
#
-class ReportAssertAccount(models.AbstractModel):
- _name = 'report.account_test.report_accounttest'
+class ReportAccount_TestReport_Accounttest(models.AbstractModel):
_description = 'Account Test Report'
@api.model
diff --git a/addons/account_update_tax_tags/wizard/account_update_tax_tags_wizard.py b/addons/account_update_tax_tags/wizard/account_update_tax_tags_wizard.py
index b8e40ad31c35a..604e48ce6c407 100644
--- a/addons/account_update_tax_tags/wizard/account_update_tax_tags_wizard.py
+++ b/addons/account_update_tax_tags/wizard/account_update_tax_tags_wizard.py
@@ -4,7 +4,6 @@
class AccountUpdateTaxTagsWizard(models.TransientModel):
- _name = 'account.update.tax.tags.wizard'
_description = 'Update Tax Tags Wizard'
company_id = fields.Many2one(comodel_name='res.company', required=True, readonly=True, default=lambda self: self.env.company)
diff --git a/addons/analytic/models/analytic_account.py b/addons/analytic/models/analytic_account.py
index 269736c40f327..30db4909798a1 100644
--- a/addons/analytic/models/analytic_account.py
+++ b/addons/analytic/models/analytic_account.py
@@ -9,7 +9,6 @@
class AccountAnalyticAccount(models.Model):
- _name = 'account.analytic.account'
_inherit = ['mail.thread']
_description = 'Analytic Account'
_order = 'plan_id, name asc'
diff --git a/addons/analytic/models/analytic_distribution_model.py b/addons/analytic/models/analytic_distribution_model.py
index 096b547c01ff2..8e969c81ebddb 100644
--- a/addons/analytic/models/analytic_distribution_model.py
+++ b/addons/analytic/models/analytic_distribution_model.py
@@ -7,8 +7,7 @@
class AccountAnalyticDistributionModel(models.Model):
- _name = 'account.analytic.distribution.model'
- _inherit = 'analytic.mixin'
+ _inherit = ['analytic.mixin']
_description = 'Analytic Distribution Model'
_rec_name = 'create_date'
_order = 'sequence, id desc'
diff --git a/addons/analytic/models/analytic_line.py b/addons/analytic/models/analytic_line.py
index c33dbb32466c5..62fa32ca5b865 100644
--- a/addons/analytic/models/analytic_line.py
+++ b/addons/analytic/models/analytic_line.py
@@ -7,9 +7,8 @@
from odoo.osv.expression import OR
-class AnalyticPlanFields(models.AbstractModel):
+class AnalyticPlanFieldsMixin(models.AbstractModel):
""" Add one field per analytic plan to the model """
- _name = 'analytic.plan.fields.mixin'
_description = 'Analytic Plan Fields'
account_id = fields.Many2one(
@@ -129,8 +128,7 @@ def _patch_view(self, arch, view, view_type):
class AccountAnalyticLine(models.Model):
- _name = 'account.analytic.line'
- _inherit = 'analytic.plan.fields.mixin'
+ _inherit = ['analytic.plan.fields.mixin']
_description = 'Analytic Line'
_order = 'date desc, id desc'
_check_company_auto = True
diff --git a/addons/analytic/models/analytic_mixin.py b/addons/analytic/models/analytic_mixin.py
index b2ce90e9aee10..6d6c91d2fc9c7 100644
--- a/addons/analytic/models/analytic_mixin.py
+++ b/addons/analytic/models/analytic_mixin.py
@@ -5,8 +5,8 @@
from odoo.tools.float_utils import float_round, float_compare
from odoo.exceptions import UserError, ValidationError
+
class AnalyticMixin(models.AbstractModel):
- _name = 'analytic.mixin'
_description = 'Analytic Mixin'
analytic_distribution = fields.Json(
diff --git a/addons/analytic/models/analytic_plan.py b/addons/analytic/models/analytic_plan.py
index b689023eb0cf8..1f411a8bb14c8 100644
--- a/addons/analytic/models/analytic_plan.py
+++ b/addons/analytic/models/analytic_plan.py
@@ -8,7 +8,6 @@
class AccountAnalyticPlan(models.Model):
- _name = 'account.analytic.plan'
_description = 'Analytic Plans'
_parent_store = True
_rec_name = 'complete_name'
@@ -284,7 +283,6 @@ def _sync_plan_column(self, model):
class AccountAnalyticApplicability(models.Model):
- _name = 'account.analytic.applicability'
_description = "Analytic Plan's Applicabilities"
analytic_plan_id = fields.Many2one('account.analytic.plan')
diff --git a/addons/analytic/models/res_config_settings.py b/addons/analytic/models/res_config_settings.py
index abe5e7e96a0cd..af914a1878a15 100644
--- a/addons/analytic/models/res_config_settings.py
+++ b/addons/analytic/models/res_config_settings.py
@@ -3,7 +3,8 @@
from odoo import fields, models
+
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
group_analytic_accounting = fields.Boolean(string='Analytic Accounting', implied_group='analytic.group_analytic_accounting')
diff --git a/addons/attachment_indexation/models/ir_attachment.py b/addons/attachment_indexation/models/ir_attachment.py
index b4b286bde048d..654269d6a0ffd 100644
--- a/addons/attachment_indexation/models/ir_attachment.py
+++ b/addons/attachment_indexation/models/ir_attachment.py
@@ -35,7 +35,7 @@ def textToString(element):
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
def _index_docx(self, bin_data):
'''Index Microsoft .docx documents'''
diff --git a/addons/auth_ldap/models/res_company.py b/addons/auth_ldap/models/res_company.py
index f6a519ffd1d88..1185a2d99822a 100644
--- a/addons/auth_ldap/models/res_company.py
+++ b/addons/auth_ldap/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
ldaps = fields.One2many('res.company.ldap', 'company', string='LDAP Parameters',
copy=True, groups="base.group_system")
diff --git a/addons/auth_ldap/models/res_company_ldap.py b/addons/auth_ldap/models/res_company_ldap.py
index 89f536c79c0df..59add55892867 100644
--- a/addons/auth_ldap/models/res_company_ldap.py
+++ b/addons/auth_ldap/models/res_company_ldap.py
@@ -12,8 +12,7 @@
_logger = logging.getLogger(__name__)
-class CompanyLDAP(models.Model):
- _name = 'res.company.ldap'
+class ResCompanyLdap(models.Model):
_description = 'Company LDAP configuration'
_order = 'sequence'
_rec_name = 'ldap_server'
diff --git a/addons/auth_ldap/models/res_config_settings.py b/addons/auth_ldap/models/res_config_settings.py
index 4cc12be31e1ef..a341ff366c164 100644
--- a/addons/auth_ldap/models/res_config_settings.py
+++ b/addons/auth_ldap/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
ldaps = fields.One2many(related='company_id.ldaps', string="LDAP Parameters", readonly=False)
diff --git a/addons/auth_ldap/models/res_users.py b/addons/auth_ldap/models/res_users.py
index 44622a749a5cb..37e7d80346397 100644
--- a/addons/auth_ldap/models/res_users.py
+++ b/addons/auth_ldap/models/res_users.py
@@ -7,8 +7,8 @@
from odoo.modules.registry import Registry
-class Users(models.Model):
- _inherit = "res.users"
+class ResUsers(models.Model):
+ _inherit = ["res.users"]
@classmethod
def _login(cls, db, credential, user_agent_env):
@@ -59,7 +59,7 @@ def change_password(self, old_passwd, new_passwd):
if changed:
self.env.user._set_empty_password()
return True
- return super(Users, self).change_password(old_passwd, new_passwd)
+ return super().change_password(old_passwd, new_passwd)
def _set_empty_password(self):
self.flush_recordset(['password'])
diff --git a/addons/auth_oauth/models/auth_oauth.py b/addons/auth_oauth/models/auth_oauth.py
index 268d50b388cd8..583affe2615c9 100644
--- a/addons/auth_oauth/models/auth_oauth.py
+++ b/addons/auth_oauth/models/auth_oauth.py
@@ -3,10 +3,9 @@
from odoo import fields, models
-class AuthOAuthProvider(models.Model):
+class AuthOauthProvider(models.Model):
"""Class defining the configuration values of an OAuth2 provider"""
- _name = 'auth.oauth.provider'
_description = 'OAuth2 provider'
_order = 'sequence, name'
diff --git a/addons/auth_oauth/models/ir_config_parameter.py b/addons/auth_oauth/models/ir_config_parameter.py
index 6a302e2b39865..b7fd68b87a17b 100644
--- a/addons/auth_oauth/models/ir_config_parameter.py
+++ b/addons/auth_oauth/models/ir_config_parameter.py
@@ -4,11 +4,11 @@
from odoo import models
-class IrConfigParameter(models.Model):
- _inherit = 'ir.config_parameter'
+class IrConfig_Parameter(models.Model):
+ _inherit = ['ir.config_parameter']
def init(self, force=False):
- super(IrConfigParameter, self).init(force=force)
+ super().init(force=force)
if force:
oauth_oe = self.env.ref('auth_oauth.provider_openerp')
if not oauth_oe:
diff --git a/addons/auth_oauth/models/res_config_settings.py b/addons/auth_oauth/models/res_config_settings.py
index 2962fccc422bb..84a6a582aae63 100644
--- a/addons/auth_oauth/models/res_config_settings.py
+++ b/addons/auth_oauth/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
@api.model
def get_uri(self):
diff --git a/addons/auth_oauth/models/res_users.py b/addons/auth_oauth/models/res_users.py
index 818403590ae46..289f60a351ecf 100644
--- a/addons/auth_oauth/models/res_users.py
+++ b/addons/auth_oauth/models/res_users.py
@@ -13,8 +13,9 @@
from odoo.addons import base
base.models.res_users.USER_PRIVATE_FIELDS.append('oauth_access_token')
+
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
oauth_provider_id = fields.Many2one('auth.oauth.provider', string='OAuth Provider')
oauth_uid = fields.Char(string='OAuth User ID', help="Oauth Provider user_id", copy=False)
diff --git a/addons/auth_passkey/models/auth_passkey_key.py b/addons/auth_passkey/models/auth_passkey_key.py
index fc0819c9f05c1..7d229caa462c9 100644
--- a/addons/auth_passkey/models/auth_passkey_key.py
+++ b/addons/auth_passkey/models/auth_passkey_key.py
@@ -17,8 +17,7 @@
_logger = logging.getLogger(__name__)
-class PassKey(models.Model):
- _name = 'auth.passkey.key'
+class AuthPasskeyKey(models.Model):
_description = 'Passkey'
_order = 'id desc'
@@ -152,8 +151,7 @@ def action_rename_passkey(self):
}
-class PassKeyCreate(models.TransientModel):
- _name = 'auth.passkey.key.create'
+class AuthPasskeyKeyCreate(models.TransientModel):
_description = 'Create a Passkey'
name = fields.Char('Name', required=True)
diff --git a/addons/auth_passkey/models/res_users.py b/addons/auth_passkey/models/res_users.py
index 625ee9327c492..defa5b8c84cf0 100644
--- a/addons/auth_passkey/models/res_users.py
+++ b/addons/auth_passkey/models/res_users.py
@@ -9,8 +9,8 @@
from .._vendor.webauthn.helpers.exceptions import InvalidAuthenticationResponse
-class UsersPasskey(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
auth_passkey_key_ids = fields.One2many('auth.passkey.key', 'create_uid')
diff --git a/addons/auth_password_policy/models/res_config_settings.py b/addons/auth_password_policy/models/res_config_settings.py
index 1583bb0f0dc0c..1d61bba0d62cc 100644
--- a/addons/auth_password_policy/models/res_config_settings.py
+++ b/addons/auth_password_policy/models/res_config_settings.py
@@ -2,7 +2,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
minlength = fields.Integer(
"Minimum Password Length", config_parameter="auth_password_policy.minlength", default=0,
diff --git a/addons/auth_password_policy/models/res_users.py b/addons/auth_password_policy/models/res_users.py
index c4e9fd0e61fed..b1641d8a5ff79 100644
--- a/addons/auth_password_policy/models/res_users.py
+++ b/addons/auth_password_policy/models/res_users.py
@@ -4,7 +4,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
@api.model
def get_password_policy(self):
diff --git a/addons/auth_password_policy_portal/models/ir_http.py b/addons/auth_password_policy_portal/models/ir_http.py
index ab55fe2cd260e..0459664a53198 100644
--- a/addons/auth_password_policy_portal/models/ir_http.py
+++ b/addons/auth_password_policy_portal/models/ir_http.py
@@ -3,7 +3,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _get_translation_frontend_modules_name(cls):
diff --git a/addons/auth_password_policy_signup/models/ir_http.py b/addons/auth_password_policy_signup/models/ir_http.py
index ab55fe2cd260e..0459664a53198 100644
--- a/addons/auth_password_policy_signup/models/ir_http.py
+++ b/addons/auth_password_policy_signup/models/ir_http.py
@@ -3,7 +3,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _get_translation_frontend_modules_name(cls):
diff --git a/addons/auth_signup/models/ir_http.py b/addons/auth_signup/models/ir_http.py
index 0e0f08fb5b668..85ae84b64a86c 100644
--- a/addons/auth_signup/models/ir_http.py
+++ b/addons/auth_signup/models/ir_http.py
@@ -5,8 +5,8 @@
from odoo.http import request
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
@classmethod
def _pre_dispatch(cls, rule, args):
diff --git a/addons/auth_signup/models/res_config_settings.py b/addons/auth_signup/models/res_config_settings.py
index f72a458da9b10..759f3ed8011ac 100644
--- a/addons/auth_signup/models/res_config_settings.py
+++ b/addons/auth_signup/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
auth_signup_reset_password = fields.Boolean(
string='Enable password reset from Login page',
diff --git a/addons/auth_signup/models/res_partner.py b/addons/auth_signup/models/res_partner.py
index 0b6cf9abb5727..df0531bd9e5af 100644
--- a/addons/auth_signup/models/res_partner.py
+++ b/addons/auth_signup/models/res_partner.py
@@ -22,7 +22,7 @@ def now(**kwargs):
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
signup_type = fields.Char(string='Signup Token Type', copy=False, groups="base.group_erp_manager")
diff --git a/addons/auth_signup/models/res_users.py b/addons/auth_signup/models/res_users.py
index ab816c7daa439..2f731f58893b7 100644
--- a/addons/auth_signup/models/res_users.py
+++ b/addons/auth_signup/models/res_users.py
@@ -17,8 +17,9 @@
_logger = logging.getLogger(__name__)
+
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
state = fields.Selection(compute='_compute_state', search='_search_state', string='Status',
selection=[('new', 'Never Connected'), ('active', 'Confirmed')])
diff --git a/addons/auth_totp/models/auth_totp.py b/addons/auth_totp/models/auth_totp.py
index dbcef1f26a93c..9ef4eee1e7377 100644
--- a/addons/auth_totp/models/auth_totp.py
+++ b/addons/auth_totp/models/auth_totp.py
@@ -5,14 +5,13 @@
_logger = logging.getLogger(__name__)
-class AuthTotpDevice(models.Model):
+class Auth_TotpDevice(models.Model):
# init is overriden in res.users.apikeys to create a secret column 'key'
# use a different model to benefit from the secured methods while not mixing
# two different concepts
- _name = "auth_totp.device"
- _inherit = "res.users.apikeys"
+ _inherit = ["res.users.apikeys"]
_description = "Authentication Device"
_auto = False
diff --git a/addons/auth_totp/models/res_users.py b/addons/auth_totp/models/res_users.py
index b8ded71c0b58e..de74f2a5d8775 100644
--- a/addons/auth_totp/models/res_users.py
+++ b/addons/auth_totp/models/res_users.py
@@ -18,8 +18,10 @@
_logger = logging.getLogger(__name__)
compress = functools.partial(re.sub, r'\s', '')
-class Users(models.Model):
- _inherit = 'res.users'
+
+
+class ResUsers(models.Model):
+ _inherit = ['res.users']
totp_secret = fields.Char(copy=False, groups=fields.NO_ACCESS, compute='_compute_totp_secret', inverse='_inverse_token')
totp_enabled = fields.Boolean(string="Two-factor authentication", compute='_compute_totp_enabled', search='_totp_enable_search')
diff --git a/addons/auth_totp/wizard/auth_totp_wizard.py b/addons/auth_totp/wizard/auth_totp_wizard.py
index a8be71df27b2f..5630e4fe666fb 100644
--- a/addons/auth_totp/wizard/auth_totp_wizard.py
+++ b/addons/auth_totp/wizard/auth_totp_wizard.py
@@ -17,8 +17,8 @@
compress = functools.partial(re.sub, r'\s', '')
-class TOTPWizard(models.TransientModel):
- _name = 'auth_totp.wizard'
+
+class Auth_TotpWizard(models.TransientModel):
_description = "2-Factor Setup Wizard"
user_id = fields.Many2one('res.users', required=True, readonly=True)
diff --git a/addons/auth_totp_mail/models/auth_totp_device.py b/addons/auth_totp_mail/models/auth_totp_device.py
index f537426ec6048..aab63dd35fb67 100644
--- a/addons/auth_totp_mail/models/auth_totp_device.py
+++ b/addons/auth_totp_mail/models/auth_totp_device.py
@@ -5,8 +5,8 @@
from collections import defaultdict
-class AuthTotpDevice(models.Model):
- _inherit = "auth_totp.device"
+class Auth_TotpDevice(models.Model):
+ _inherit = ["auth_totp.device"]
def unlink(self):
""" Notify users when trusted devices are removed from their account. """
diff --git a/addons/auth_totp_mail/models/res_users.py b/addons/auth_totp_mail/models/res_users.py
index 2654bc5807ca9..0763a7b01b97a 100644
--- a/addons/auth_totp_mail/models/res_users.py
+++ b/addons/auth_totp_mail/models/res_users.py
@@ -4,8 +4,8 @@
from odoo import _, models
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
def write(self, vals):
res = super().write(vals)
diff --git a/addons/auth_totp_mail_enforce/models/auth_totp_rate_limit_log.py b/addons/auth_totp_mail_enforce/models/auth_totp_rate_limit_log.py
index ab5fe2745d855..1ef1243740b78 100644
--- a/addons/auth_totp_mail_enforce/models/auth_totp_rate_limit_log.py
+++ b/addons/auth_totp_mail_enforce/models/auth_totp_rate_limit_log.py
@@ -2,7 +2,6 @@
class AuthTotpRateLimitLog(models.TransientModel):
- _name = 'auth.totp.rate.limit.log'
_description = 'TOTP rate limit logs'
def init(self):
diff --git a/addons/auth_totp_mail_enforce/models/res_config_settings.py b/addons/auth_totp_mail_enforce/models/res_config_settings.py
index 90b2b8aed3766..9f70a0061bc9f 100644
--- a/addons/auth_totp_mail_enforce/models/res_config_settings.py
+++ b/addons/auth_totp_mail_enforce/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
auth_totp_enforce = fields.Boolean(
string="Enforce two-factor authentication",
diff --git a/addons/auth_totp_mail_enforce/models/res_users.py b/addons/auth_totp_mail_enforce/models/res_users.py
index 063e193dc37d4..2f1eca037f821 100644
--- a/addons/auth_totp_mail_enforce/models/res_users.py
+++ b/addons/auth_totp_mail_enforce/models/res_users.py
@@ -20,8 +20,8 @@
}
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
def _mfa_type(self):
r = super()._mfa_type()
diff --git a/addons/auth_totp_portal/models/res_users.py b/addons/auth_totp_portal/models/res_users.py
index 284ae932a59fe..3013667bf1b7f 100644
--- a/addons/auth_totp_portal/models/res_users.py
+++ b/addons/auth_totp_portal/models/res_users.py
@@ -4,11 +4,11 @@
from odoo import models
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
def get_totp_invite_url(self):
if not self._is_internal():
return '/my/security'
else:
- return super(Users, self).get_totp_invite_url()
+ return super().get_totp_invite_url()
diff --git a/addons/barcodes/models/barcode_events_mixin.py b/addons/barcodes/models/barcode_events_mixin.py
index e0e37f69ad3af..3770ffba43a6f 100644
--- a/addons/barcodes/models/barcode_events_mixin.py
+++ b/addons/barcodes/models/barcode_events_mixin.py
@@ -2,14 +2,14 @@
from odoo import models, fields, api
-class BarcodeEventsMixin(models.AbstractModel):
+
+class BarcodesBarcode_Events_Mixin(models.AbstractModel):
""" Mixin class for objects reacting when a barcode is scanned in their form views
which contains ``.
Models using this mixin must implement the method on_barcode_scanned. It works
like an onchange and receives the scanned barcode in parameter.
"""
- _name = 'barcodes.barcode_events_mixin'
_description = 'Barcode Event Mixin'
_barcode_scanned = fields.Char("Barcode Scanned", help="Value of the last barcode scanned.", store=False)
diff --git a/addons/barcodes/models/barcode_nomenclature.py b/addons/barcodes/models/barcode_nomenclature.py
index ab6a277453a9d..e1718d4fa91fb 100644
--- a/addons/barcodes/models/barcode_nomenclature.py
+++ b/addons/barcodes/models/barcode_nomenclature.py
@@ -13,7 +13,6 @@
class BarcodeNomenclature(models.Model):
- _name = 'barcode.nomenclature'
_description = 'Barcode Nomenclature'
name = fields.Char(string='Barcode Nomenclature', required=True, help='An internal identification of the barcode nomenclature')
diff --git a/addons/barcodes/models/barcode_rule.py b/addons/barcodes/models/barcode_rule.py
index ee620ae31fd7e..bc3d371f2dca9 100644
--- a/addons/barcodes/models/barcode_rule.py
+++ b/addons/barcodes/models/barcode_rule.py
@@ -5,7 +5,6 @@
class BarcodeRule(models.Model):
- _name = 'barcode.rule'
_description = 'Barcode Rule'
_order = 'sequence asc, id'
diff --git a/addons/barcodes/models/ir_http.py b/addons/barcodes/models/ir_http.py
index 7731df8534589..2ef0d0eca0006 100644
--- a/addons/barcodes/models/ir_http.py
+++ b/addons/barcodes/models/ir_http.py
@@ -5,7 +5,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
def session_info(self):
res = super(IrHttp, self).session_info()
diff --git a/addons/barcodes/models/res_company.py b/addons/barcodes/models/res_company.py
index b510c6e0c1df7..f69f3d0b16577 100644
--- a/addons/barcodes/models/res_company.py
+++ b/addons/barcodes/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
def _get_default_nomenclature(self):
return self.env.ref('barcodes.default_barcode_nomenclature', raise_if_not_found=False)
diff --git a/addons/barcodes_gs1_nomenclature/models/barcode_nomenclature.py b/addons/barcodes_gs1_nomenclature/models/barcode_nomenclature.py
index 1bd335f43fd47..33584394d21b7 100644
--- a/addons/barcodes_gs1_nomenclature/models/barcode_nomenclature.py
+++ b/addons/barcodes_gs1_nomenclature/models/barcode_nomenclature.py
@@ -10,7 +10,7 @@
class BarcodeNomenclature(models.Model):
- _inherit = 'barcode.nomenclature'
+ _inherit = ['barcode.nomenclature']
is_gs1_nomenclature = fields.Boolean(
string="Is GS1 Nomenclature",
diff --git a/addons/barcodes_gs1_nomenclature/models/barcode_rule.py b/addons/barcodes_gs1_nomenclature/models/barcode_rule.py
index bdd49940b92dc..5a4486ee1acab 100644
--- a/addons/barcodes_gs1_nomenclature/models/barcode_rule.py
+++ b/addons/barcodes_gs1_nomenclature/models/barcode_rule.py
@@ -5,7 +5,7 @@
class BarcodeRule(models.Model):
- _inherit = 'barcode.rule'
+ _inherit = ['barcode.rule']
def _default_encoding(self):
return 'gs1-128' if self.env.context.get('is_gs1') else 'any'
diff --git a/addons/barcodes_gs1_nomenclature/models/ir_http.py b/addons/barcodes_gs1_nomenclature/models/ir_http.py
index 9a42eb94a7239..b3b78c5946174 100644
--- a/addons/barcodes_gs1_nomenclature/models/ir_http.py
+++ b/addons/barcodes_gs1_nomenclature/models/ir_http.py
@@ -5,7 +5,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
def session_info(self):
res = super().session_info()
diff --git a/addons/base_address_extended/models/res_city.py b/addons/base_address_extended/models/res_city.py
index bedc8bf87f3e1..69afb5163d470 100644
--- a/addons/base_address_extended/models/res_city.py
+++ b/addons/base_address_extended/models/res_city.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
from odoo.osv import expression
-class City(models.Model):
- _name = 'res.city'
+
+class ResCity(models.Model):
_description = 'City'
_order = 'name'
_rec_names_search = ['name', 'zipcode']
diff --git a/addons/base_address_extended/models/res_country.py b/addons/base_address_extended/models/res_country.py
index a3de7de697a7c..4e4322c678b97 100644
--- a/addons/base_address_extended/models/res_country.py
+++ b/addons/base_address_extended/models/res_country.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class Country(models.Model):
- _inherit = 'res.country'
+class ResCountry(models.Model):
+ _inherit = ['res.country']
enforce_cities = fields.Boolean(
string='Enforce Cities',
diff --git a/addons/base_address_extended/models/res_partner.py b/addons/base_address_extended/models/res_partner.py
index 2503e6f085a0c..9a739b0eab615 100644
--- a/addons/base_address_extended/models/res_partner.py
+++ b/addons/base_address_extended/models/res_partner.py
@@ -3,6 +3,7 @@
from odoo import api, fields, models, tools
+
class Partner(models.Model):
_inherit = ['res.partner']
diff --git a/addons/base_automation/models/base_automation.py b/addons/base_automation/models/base_automation.py
index 71fd356df7d7f..bb406d8ee2af3 100644
--- a/addons/base_automation/models/base_automation.py
+++ b/addons/base_automation/models/base_automation.py
@@ -76,7 +76,6 @@ def get_webhook_request_payload():
class BaseAutomation(models.Model):
- _name = 'base.automation'
_description = 'Automation Rule'
name = fields.Char(string="Automation Rule Name", required=True, translate=True)
diff --git a/addons/base_automation/models/ir_actions_server.py b/addons/base_automation/models/ir_actions_server.py
index 7cbfe65492d0d..93a463bd4ae91 100644
--- a/addons/base_automation/models/ir_actions_server.py
+++ b/addons/base_automation/models/ir_actions_server.py
@@ -6,8 +6,9 @@
from .base_automation import get_webhook_request_payload
-class ServerAction(models.Model):
- _inherit = "ir.actions.server"
+
+class IrActionsServer(models.Model):
+ _inherit = ["ir.actions.server"]
name = fields.Char(compute='_compute_name', store=True, readonly=False)
diff --git a/addons/base_geolocalize/models/base_geocoder.py b/addons/base_geolocalize/models/base_geocoder.py
index 8a3d7570c1e83..de2eff0f3bca6 100644
--- a/addons/base_geolocalize/models/base_geocoder.py
+++ b/addons/base_geolocalize/models/base_geocoder.py
@@ -10,20 +10,18 @@
_logger = logging.getLogger(__name__)
-class GeoProvider(models.Model):
- _name = "base.geo_provider"
+class BaseGeo_Provider(models.Model):
_description = "Geo Provider"
tech_name = fields.Char(string="Technical Name")
name = fields.Char()
-class GeoCoder(models.AbstractModel):
+class BaseGeocoder(models.AbstractModel):
"""
Abstract class used to call Geolocalization API and convert addresses
into GPS coordinates.
"""
- _name = "base.geocoder"
_description = "Geo Coder"
@api.model
diff --git a/addons/base_geolocalize/models/res_config_settings.py b/addons/base_geolocalize/models/res_config_settings.py
index 5cef30c54725b..f7eb91b3aae21 100644
--- a/addons/base_geolocalize/models/res_config_settings.py
+++ b/addons/base_geolocalize/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
geoloc_provider_id = fields.Many2one(
'base.geo_provider',
diff --git a/addons/base_geolocalize/models/res_partner.py b/addons/base_geolocalize/models/res_partner.py
index 0390eb7500eda..33e20acbad03e 100644
--- a/addons/base_geolocalize/models/res_partner.py
+++ b/addons/base_geolocalize/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
date_localization = fields.Date(string='Geolocation Date')
diff --git a/addons/base_iban/models/res_partner_bank.py b/addons/base_iban/models/res_partner_bank.py
index 4a3712026882d..0161e2ae30d44 100644
--- a/addons/base_iban/models/res_partner_bank.py
+++ b/addons/base_iban/models/res_partner_bank.py
@@ -49,7 +49,7 @@ def validate_iban(iban):
class ResPartnerBank(models.Model):
- _inherit = "res.partner.bank"
+ _inherit = ["res.partner.bank"]
@api.model
def _get_supported_account_types(self):
diff --git a/addons/base_import/models/base_import.py b/addons/base_import/models/base_import.py
index 41ae1eb6aa959..053d729499cec 100644
--- a/addons/base_import/models/base_import.py
+++ b/addons/base_import/models/base_import.py
@@ -118,7 +118,7 @@ def __init__(self, message, **kwargs):
class Base(models.AbstractModel):
- _inherit = 'base'
+ _inherit = ['base']
@api.model
def get_import_templates(self):
@@ -130,7 +130,8 @@ def get_import_templates(self):
"""
return []
-class ImportMapping(models.Model):
+
+class Base_ImportMapping(models.Model):
""" mapping of previous column:field selections
This is useful when repeatedly importing from a third-party
@@ -142,7 +143,6 @@ class ImportMapping(models.Model):
without them having to re-enter the mapping every single
time.
"""
- _name = 'base_import.mapping'
_description = 'Base Import Mapping'
res_model = fields.Char(index=True)
@@ -151,7 +151,7 @@ class ImportMapping(models.Model):
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
def _can_import_remote_urls(self):
""" Hook to decide whether the current user is allowed to import
@@ -163,7 +163,8 @@ def _can_import_remote_urls(self):
self.ensure_one()
return self._is_admin()
-class Import(models.TransientModel):
+
+class Base_ImportImport(models.TransientModel):
"""
This model is used to prepare the loading of data coming from a user file.
@@ -211,7 +212,6 @@ class Import(models.TransientModel):
- Return import result to the UI (success or errors if any).
"""
- _name = 'base_import.import'
_description = 'Base Import'
# allow imports to survive for 12h in case user is slow
@@ -1029,7 +1029,7 @@ def parse_preview(self, options, count=10):
try:
file_length, rows = self._read_file(options)
if file_length <= 0:
- raise ImportValidationError(_("Import file has no content or is corrupt"))
+ raise ImportValidationError(_("Base_ImportImport file has no content or is corrupt"))
preview = rows[:count]
diff --git a/addons/base_import_module/models/base_import_module.py b/addons/base_import_module/models/base_import_module.py
index 06c1d098fd9d3..7d2564cf7e4d7 100644
--- a/addons/base_import_module/models/base_import_module.py
+++ b/addons/base_import_module/models/base_import_module.py
@@ -6,7 +6,6 @@
class BaseImportModule(models.TransientModel):
""" Import Module """
- _name = "base.import.module"
_description = "Import Module"
module_file = fields.Binary(string='Module .ZIP file', required=True, attachment=False)
diff --git a/addons/base_import_module/models/ir_module.py b/addons/base_import_module/models/ir_module.py
index 4dc2c6530f8a6..d4436c166bf54 100644
--- a/addons/base_import_module/models/ir_module.py
+++ b/addons/base_import_module/models/ir_module.py
@@ -28,8 +28,8 @@
MAX_FILE_SIZE = 100 * 1024 * 1024 # in megabytes
-class IrModule(models.Model):
- _inherit = "ir.module.module"
+class IrModuleModule(models.Model):
+ _inherit = ["ir.module.module"]
imported = fields.Boolean(string="Imported Module")
module_type = fields.Selection([
@@ -46,7 +46,7 @@ def _get_latest_version(self):
imported_modules = self.filtered(lambda m: m.imported and m.latest_version)
for module in imported_modules:
module.installed_version = module.latest_version
- super(IrModule, self - imported_modules)._get_latest_version()
+ super(IrModuleModule, self - imported_modules)._get_latest_version()
@api.depends('icon')
def _get_icon_image(self):
diff --git a/addons/base_import_module/models/ir_ui_view.py b/addons/base_import_module/models/ir_ui_view.py
index adaa6651f5b8b..9bca2cb6356ba 100644
--- a/addons/base_import_module/models/ir_ui_view.py
+++ b/addons/base_import_module/models/ir_ui_view.py
@@ -4,8 +4,9 @@
from operator import itemgetter
from odoo import api, models
+
class IrUiView(models.Model):
- _inherit = 'ir.ui.view'
+ _inherit = ['ir.ui.view']
@api.model
def _validate_custom_views(self, model):
diff --git a/addons/base_import_module/wizard/base_module_uninstall.py b/addons/base_import_module/wizard/base_module_uninstall.py
index c982ec485e29c..bba004e987376 100644
--- a/addons/base_import_module/wizard/base_module_uninstall.py
+++ b/addons/base_import_module/wizard/base_module_uninstall.py
@@ -4,7 +4,7 @@
class BaseModuleUninstall(models.TransientModel):
- _inherit = "base.module.uninstall"
+ _inherit = ["base.module.uninstall"]
def _modules_to_display(self, modules):
return super()._modules_to_display(modules) | modules.filtered('imported')
diff --git a/addons/base_install_request/models/ir_module_module.py b/addons/base_install_request/models/ir_module_module.py
index 494b4c8c43ada..c6f303c385242 100644
--- a/addons/base_install_request/models/ir_module_module.py
+++ b/addons/base_install_request/models/ir_module_module.py
@@ -5,7 +5,7 @@
class IrModuleModule(models.Model):
- _inherit = 'ir.module.module'
+ _inherit = ['ir.module.module']
def action_open_install_request(self):
self.ensure_one()
diff --git a/addons/base_install_request/wizard/base_module_install_request.py b/addons/base_install_request/wizard/base_module_install_request.py
index 3b7b38402e79a..16650e84c7b1c 100644
--- a/addons/base_install_request/wizard/base_module_install_request.py
+++ b/addons/base_install_request/wizard/base_module_install_request.py
@@ -6,7 +6,6 @@
class BaseModuleInstallRequest(models.TransientModel):
- _name = "base.module.install.request"
_description = "Module Activation Request"
_rec_name = "module_id"
@@ -45,7 +44,6 @@ def action_send_request(self):
class BaseModuleInstallReview(models.TransientModel):
- _name = "base.module.install.review"
_description = "Module Activation Review"
_rec_name = "module_id"
diff --git a/addons/base_setup/models/ir_http.py b/addons/base_setup/models/ir_http.py
index 4e7bb7df171c1..709ac09945dbc 100644
--- a/addons/base_setup/models/ir_http.py
+++ b/addons/base_setup/models/ir_http.py
@@ -4,7 +4,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
def session_info(self):
result = super(IrHttp, self).session_info()
diff --git a/addons/base_setup/models/res_config_settings.py b/addons/base_setup/models/res_config_settings.py
index ae04a4bd680ba..76191077efa6a 100644
--- a/addons/base_setup/models/res_config_settings.py
+++ b/addons/base_setup/models/res_config_settings.py
@@ -7,7 +7,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.company)
diff --git a/addons/base_setup/models/res_users.py b/addons/base_setup/models/res_users.py
index 6d99a71cf243f..e5faec42551bb 100644
--- a/addons/base_setup/models/res_users.py
+++ b/addons/base_setup/models/res_users.py
@@ -6,7 +6,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
@api.model
def web_create_users(self, emails):
diff --git a/addons/base_sparse_field/models/models.py b/addons/base_sparse_field/models/models.py
index 6a9d0f12c5233..ef6c0c6320320 100644
--- a/addons/base_sparse_field/models/models.py
+++ b/addons/base_sparse_field/models/models.py
@@ -7,14 +7,14 @@
class Base(models.AbstractModel):
- _inherit = 'base'
+ _inherit = ['base']
def _valid_field_parameter(self, field, name):
return name == 'sparse' or super()._valid_field_parameter(field, name)
class IrModelFields(models.Model):
- _inherit = 'ir.model.fields'
+ _inherit = ['ir.model.fields']
ttype = fields.Selection(selection_add=[
('serialized', 'serialized'),
@@ -89,8 +89,7 @@ def _instanciate_attrs(self, field_data):
return attrs
-class TestSparse(models.TransientModel):
- _name = 'sparse_fields.test'
+class Sparse_FieldsTest(models.TransientModel):
_description = 'Sparse fields Test'
data = fields.Serialized()
diff --git a/addons/base_vat/models/account_fiscal_position.py b/addons/base_vat/models/account_fiscal_position.py
index d20c1fa1536f7..7e47633eebbb6 100644
--- a/addons/base_vat/models/account_fiscal_position.py
+++ b/addons/base_vat/models/account_fiscal_position.py
@@ -5,7 +5,7 @@
class AccountFiscalPosition(models.Model):
- _inherit = 'account.fiscal.position'
+ _inherit = ['account.fiscal.position']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/base_vat/models/res_company.py b/addons/base_vat/models/res_company.py
index d9a063d37fef2..d4aa4cabae34b 100644
--- a/addons/base_vat/models/res_company.py
+++ b/addons/base_vat/models/res_company.py
@@ -5,6 +5,6 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
vat_check_vies = fields.Boolean(string='Verify VAT Numbers')
diff --git a/addons/base_vat/models/res_config_settings.py b/addons/base_vat/models/res_config_settings.py
index c5a06f872d428..70fbc876bbc1c 100644
--- a/addons/base_vat/models/res_config_settings.py
+++ b/addons/base_vat/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
vat_check_vies = fields.Boolean(related='company_id.vat_check_vies', readonly=False,
string='Verify VAT Numbers')
diff --git a/addons/base_vat/models/res_partner.py b/addons/base_vat/models/res_partner.py
index 0ef695fda890e..6c1444a3ef2ca 100644
--- a/addons/base_vat/models/res_partner.py
+++ b/addons/base_vat/models/res_partner.py
@@ -87,7 +87,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
vies_valid = fields.Boolean(
string="Intra-Community Valid",
diff --git a/addons/board/models/board.py b/addons/board/models/board.py
index 52b09a5430890..e044ee3de3dd1 100644
--- a/addons/board/models/board.py
+++ b/addons/board/models/board.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class Board(models.AbstractModel):
- _name = 'board.board'
+class BoardBoard(models.AbstractModel):
_description = "Board"
_auto = False
diff --git a/addons/bus/models/bus.py b/addons/bus/models/bus.py
index dd0d812e9054e..acea021649475 100644
--- a/addons/bus/models/bus.py
+++ b/addons/bus/models/bus.py
@@ -81,9 +81,8 @@ def get_notify_payloads(channels):
get_notify_payloads(channels[pivot:]))
-class ImBus(models.Model):
+class BusBus(models.Model):
- _name = 'bus.bus'
_description = 'Communication Bus'
channel = fields.Char('Channel')
diff --git a/addons/bus/models/bus_listener_mixin.py b/addons/bus/models/bus_listener_mixin.py
index 930e83087f46e..c29549e42b955 100644
--- a/addons/bus/models/bus_listener_mixin.py
+++ b/addons/bus/models/bus_listener_mixin.py
@@ -9,7 +9,6 @@ class BusListenerMixin(models.AbstractModel):
The model needs to be allowed as a valid channel for the bus in `_build_bus_channel_list`.
"""
- _name = "bus.listener.mixin"
_description = "Can send messages via bus.bus"
def _bus_send(self, notification_type, message, /, *, subchannel=None):
diff --git a/addons/bus/models/bus_presence.py b/addons/bus/models/bus_presence.py
index f578931e51519..ac12ac84cefa8 100644
--- a/addons/bus/models/bus_presence.py
+++ b/addons/bus/models/bus_presence.py
@@ -18,7 +18,6 @@ class BusPresence(models.Model):
at each poll, if the user have multiple opened tabs, concurrence errors can happend, but are 'muted-logged'.
"""
- _name = 'bus.presence'
_description = 'User Presence'
_log_access = False
diff --git a/addons/bus/models/ir_attachment.py b/addons/bus/models/ir_attachment.py
index 1d50a459ec7f3..3273f76ac7796 100644
--- a/addons/bus/models/ir_attachment.py
+++ b/addons/bus/models/ir_attachment.py
@@ -4,7 +4,6 @@
class IrAttachment(models.Model):
- _name = "ir.attachment"
_inherit = ["ir.attachment", "bus.listener.mixin"]
def _bus_channel(self):
diff --git a/addons/bus/models/ir_http.py b/addons/bus/models/ir_http.py
index 9cd83718d3422..f53a3e3883a51 100644
--- a/addons/bus/models/ir_http.py
+++ b/addons/bus/models/ir_http.py
@@ -4,8 +4,8 @@
from ..websocket import WebsocketConnectionHandler
-class Http(models.AbstractModel):
- _inherit = "ir.http"
+class IrHttp(models.AbstractModel):
+ _inherit = ["ir.http"]
@api.model
def get_frontend_session_info(self):
diff --git a/addons/bus/models/ir_model.py b/addons/bus/models/ir_model.py
index d16a890966bae..4d216531cdba7 100644
--- a/addons/bus/models/ir_model.py
+++ b/addons/bus/models/ir_model.py
@@ -4,7 +4,7 @@
class IrModel(models.Model):
- _inherit = 'ir.model'
+ _inherit = ['ir.model']
def _get_model_definitions(self, model_names_to_fetch):
model_definitions = {}
diff --git a/addons/bus/models/ir_websocket.py b/addons/bus/models/ir_websocket.py
index 81f2f7e7913fe..afd61c7164219 100644
--- a/addons/bus/models/ir_websocket.py
+++ b/addons/bus/models/ir_websocket.py
@@ -10,7 +10,6 @@
class IrWebsocket(models.AbstractModel):
- _name = 'ir.websocket'
_description = 'websocket message handling'
def _get_missed_presences_identity_domains(self, presence_channels):
diff --git a/addons/bus/models/res_groups.py b/addons/bus/models/res_groups.py
index 74fb08da1642d..90f8251456d05 100644
--- a/addons/bus/models/res_groups.py
+++ b/addons/bus/models/res_groups.py
@@ -4,5 +4,4 @@
class ResGroups(models.Model):
- _name = "res.groups"
_inherit = ["res.groups", "bus.listener.mixin"]
diff --git a/addons/bus/models/res_partner.py b/addons/bus/models/res_partner.py
index 624dd484a2159..0d97c237453fb 100644
--- a/addons/bus/models/res_partner.py
+++ b/addons/bus/models/res_partner.py
@@ -4,7 +4,6 @@
class ResPartner(models.Model):
- _name = "res.partner"
_inherit = ["res.partner", "bus.listener.mixin"]
im_status = fields.Char('IM Status', compute='_compute_im_status')
diff --git a/addons/bus/models/res_users.py b/addons/bus/models/res_users.py
index 167a3ede1e38b..69e862a27403f 100644
--- a/addons/bus/models/res_users.py
+++ b/addons/bus/models/res_users.py
@@ -4,7 +4,6 @@
class ResUsers(models.Model):
- _name = "res.users"
_inherit = ["res.users", "bus.listener.mixin"]
im_status = fields.Char("IM Status", compute="_compute_im_status")
diff --git a/addons/bus/models/res_users_settings.py b/addons/bus/models/res_users_settings.py
index facacf12630de..b44f8dfaeae25 100644
--- a/addons/bus/models/res_users_settings.py
+++ b/addons/bus/models/res_users_settings.py
@@ -4,7 +4,6 @@
class ResUsersSettings(models.Model):
- _name = "res.users.settings"
_inherit = ["res.users.settings", "bus.listener.mixin"]
def _bus_channel(self):
diff --git a/addons/calendar/models/calendar_alarm.py b/addons/calendar/models/calendar_alarm.py
index 55eceb1f280ef..a9f5e51f3f372 100644
--- a/addons/calendar/models/calendar_alarm.py
+++ b/addons/calendar/models/calendar_alarm.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class Alarm(models.Model):
- _name = 'calendar.alarm'
+class CalendarAlarm(models.Model):
_description = 'Event Alarm'
_interval_selection = {'minutes': 'Minutes', 'hours': 'Hours', 'days': 'Days'}
diff --git a/addons/calendar/models/calendar_alarm_manager.py b/addons/calendar/models/calendar_alarm_manager.py
index d178151fee3f2..8829a07832345 100644
--- a/addons/calendar/models/calendar_alarm_manager.py
+++ b/addons/calendar/models/calendar_alarm_manager.py
@@ -8,8 +8,7 @@
from odoo.tools import plaintext2html
-class AlarmManager(models.AbstractModel):
- _name = 'calendar.alarm_manager'
+class CalendarAlarm_Manager(models.AbstractModel):
_description = 'Event Alarm Manager'
def _get_next_potential_limit_alarm(self, alarm_type, seconds=None, partners=None):
diff --git a/addons/calendar/models/calendar_attendee.py b/addons/calendar/models/calendar_attendee.py
index 6472cd2301a5a..ce7f01839c1c5 100644
--- a/addons/calendar/models/calendar_attendee.py
+++ b/addons/calendar/models/calendar_attendee.py
@@ -14,9 +14,8 @@
_logger = logging.getLogger(__name__)
-class Attendee(models.Model):
+class CalendarAttendee(models.Model):
""" Calendar Attendee Information """
- _name = 'calendar.attendee'
_rec_name = 'common_name'
_description = 'Calendar Attendee Information'
_order = 'create_date ASC'
diff --git a/addons/calendar/models/calendar_event.py b/addons/calendar/models/calendar_event.py
index bced38c8870ce..7a0cc7b65a0bc 100644
--- a/addons/calendar/models/calendar_event.py
+++ b/addons/calendar/models/calendar_event.py
@@ -64,8 +64,7 @@ def get_weekday_occurence(date):
return occurence_in_month
-class Meeting(models.Model):
- _name = 'calendar.event'
+class CalendarEvent(models.Model):
_description = "Calendar Event"
_order = "start desc"
_inherit = ["mail.thread"]
@@ -85,7 +84,7 @@ def default_get(self, fields):
default_res_model_id=self.env['ir.model']._get_id(self.env.context['default_res_model'])
)
- defaults = super(Meeting, self).default_get(fields)
+ defaults = super().default_get(fields)
# support active_model / active_id as replacement of default_* if not already given
if 'res_model_id' not in defaults and 'res_model_id' in fields and \
@@ -596,7 +595,7 @@ def create(self, vals_list):
def _compute_field_value(self, field):
if field.compute_sudo:
- return super(Meeting, self.with_context(prefetch_fields=False))._compute_field_value(field)
+ return super(CalendarEvent, self.with_context(prefetch_fields=False))._compute_field_value(field)
return super()._compute_field_value(field)
def _fetch_query(self, query, fields):
@@ -758,7 +757,7 @@ def _compute_display_name(self):
""" Hide private events' name for events which don't belong to the current user. """
hidden = self.filtered(lambda event: event._check_private_event_conditions())
hidden.display_name = _('Busy')
- super(Meeting, self - hidden)._compute_display_name()
+ super(CalendarEvent, self - hidden)._compute_display_name()
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
@@ -771,8 +770,8 @@ def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=Fals
private_fields = grouped_fields - self._get_public_fields()
if not self.env.su and private_fields:
domain = AND([domain, self._get_default_privacy_domain()])
- return super(Meeting, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
- return super(Meeting, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
+ return super().read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
+ return super().read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
def unlink(self):
if not self:
diff --git a/addons/calendar/models/calendar_event_type.py b/addons/calendar/models/calendar_event_type.py
index 16b7ccf95519b..9d267370c4102 100644
--- a/addons/calendar/models/calendar_event_type.py
+++ b/addons/calendar/models/calendar_event_type.py
@@ -6,9 +6,8 @@
from odoo import fields, models
-class MeetingType(models.Model):
+class CalendarEventType(models.Model):
- _name = 'calendar.event.type'
_description = 'Event Meeting Type'
def _default_color(self):
diff --git a/addons/calendar/models/calendar_filter.py b/addons/calendar/models/calendar_filter.py
index d18a6b4c65dbe..bf550796b83e6 100644
--- a/addons/calendar/models/calendar_filter.py
+++ b/addons/calendar/models/calendar_filter.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class Contacts(models.Model):
- _name = 'calendar.filters'
+class CalendarFilters(models.Model):
_description = 'Calendar Filters'
user_id = fields.Many2one('res.users', 'Me', required=True, default=lambda self: self.env.user, index=True, ondelete='cascade')
diff --git a/addons/calendar/models/calendar_recurrence.py b/addons/calendar/models/calendar_recurrence.py
index 4edde758a5398..2655bcb1a24b9 100644
--- a/addons/calendar/models/calendar_recurrence.py
+++ b/addons/calendar/models/calendar_recurrence.py
@@ -91,8 +91,7 @@ def weekday_to_field(weekday_index):
return RRULE_WEEKDAY_TO_FIELD.get(weekday_index)
-class RecurrenceRule(models.Model):
- _name = 'calendar.recurrence'
+class CalendarRecurrence(models.Model):
_description = 'Event Recurrence Rule'
name = fields.Char(compute='_compute_name', store=True)
diff --git a/addons/calendar/models/ir_http.py b/addons/calendar/models/ir_http.py
index cdc2544774c21..3fc863107a918 100644
--- a/addons/calendar/models/ir_http.py
+++ b/addons/calendar/models/ir_http.py
@@ -8,7 +8,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _auth_method_calendar(cls):
diff --git a/addons/calendar/models/mail_activity.py b/addons/calendar/models/mail_activity.py
index b8a71d4a29b3b..9d863f7de1d40 100644
--- a/addons/calendar/models/mail_activity.py
+++ b/addons/calendar/models/mail_activity.py
@@ -6,7 +6,7 @@
class MailActivity(models.Model):
- _inherit = "mail.activity"
+ _inherit = ["mail.activity"]
calendar_event_id = fields.Many2one('calendar.event', string="Calendar Meeting", ondelete='cascade')
diff --git a/addons/calendar/models/mail_activity_mixin.py b/addons/calendar/models/mail_activity_mixin.py
index e0f0eaed1b0b3..41b8b94ae6f04 100644
--- a/addons/calendar/models/mail_activity_mixin.py
+++ b/addons/calendar/models/mail_activity_mixin.py
@@ -3,8 +3,9 @@
from odoo import api, fields, models
+
class MailActivityMixin(models.AbstractModel):
- _inherit = 'mail.activity.mixin'
+ _inherit = ['mail.activity.mixin']
activity_calendar_event_id = fields.Many2one(
'calendar.event', string="Next Activity Calendar Event",
diff --git a/addons/calendar/models/mail_activity_type.py b/addons/calendar/models/mail_activity_type.py
index 0ad70222d4088..d2db1c0a197d9 100644
--- a/addons/calendar/models/mail_activity_type.py
+++ b/addons/calendar/models/mail_activity_type.py
@@ -5,6 +5,6 @@
class MailActivityType(models.Model):
- _inherit = "mail.activity.type"
+ _inherit = ["mail.activity.type"]
category = fields.Selection(selection_add=[('meeting', 'Meeting')])
diff --git a/addons/calendar/models/res_partner.py b/addons/calendar/models/res_partner.py
index de2a99b055141..9947a9ec06b9c 100644
--- a/addons/calendar/models/res_partner.py
+++ b/addons/calendar/models/res_partner.py
@@ -7,8 +7,8 @@
from odoo.tools import SQL
-class Partner(models.Model):
- _inherit = 'res.partner'
+class ResPartner(models.Model):
+ _inherit = ['res.partner']
meeting_count = fields.Integer("# Meetings", compute='_compute_meeting_count')
meeting_ids = fields.Many2many('calendar.event', 'calendar_event_res_partner_rel', 'res_partner_id',
diff --git a/addons/calendar/models/res_users.py b/addons/calendar/models/res_users.py
index c4ada0a656453..45c680f0c09a5 100644
--- a/addons/calendar/models/res_users.py
+++ b/addons/calendar/models/res_users.py
@@ -9,8 +9,8 @@
from pytz import timezone, UTC
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
calendar_default_privacy = fields.Selection(
[('public', 'Public'),
diff --git a/addons/calendar/models/res_users_settings.py b/addons/calendar/models/res_users_settings.py
index 6723d5f86802e..077d59a07718e 100644
--- a/addons/calendar/models/res_users_settings.py
+++ b/addons/calendar/models/res_users_settings.py
@@ -2,8 +2,9 @@
from odoo import api, fields, models
+
class ResUsersSettings(models.Model):
- _inherit = "res.users.settings"
+ _inherit = ["res.users.settings"]
# Calendar module settings.
calendar_default_privacy = fields.Selection(
diff --git a/addons/calendar/wizard/calendar_popover_delete_wizard.py b/addons/calendar/wizard/calendar_popover_delete_wizard.py
index 92de385fbeec1..c6414146058fd 100644
--- a/addons/calendar/wizard/calendar_popover_delete_wizard.py
+++ b/addons/calendar/wizard/calendar_popover_delete_wizard.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class CalendarProviderConfig(models.TransientModel):
- _name = 'calendar.popover.delete.wizard'
+class CalendarPopoverDeleteWizard(models.TransientModel):
_description = 'Calendar Popover Delete Wizard'
diff --git a/addons/calendar/wizard/calendar_provider_config.py b/addons/calendar/wizard/calendar_provider_config.py
index a800e69f9cc28..421c7297e9ef5 100644
--- a/addons/calendar/wizard/calendar_provider_config.py
+++ b/addons/calendar/wizard/calendar_provider_config.py
@@ -7,7 +7,6 @@
class CalendarProviderConfig(models.TransientModel):
- _name = 'calendar.provider.config'
_description = 'Calendar Provider Configuration Wizard'
external_calendar_provider = fields.Selection([
diff --git a/addons/calendar/wizard/mail_activity_schedule.py b/addons/calendar/wizard/mail_activity_schedule.py
index 190c1bb2cf3ba..1b89af4b769eb 100644
--- a/addons/calendar/wizard/mail_activity_schedule.py
+++ b/addons/calendar/wizard/mail_activity_schedule.py
@@ -7,7 +7,7 @@
class MailActivitySchedule(models.TransientModel):
- _inherit = 'mail.activity.schedule'
+ _inherit = ['mail.activity.schedule']
def action_create_calendar_event(self):
self.ensure_one()
diff --git a/addons/calendar_sms/models/calendar_alarm.py b/addons/calendar_sms/models/calendar_alarm.py
index b4ddd8555406b..cb52d4bf60104 100644
--- a/addons/calendar_sms/models/calendar_alarm.py
+++ b/addons/calendar_sms/models/calendar_alarm.py
@@ -5,7 +5,7 @@
class CalendarAlarm(models.Model):
- _inherit = 'calendar.alarm'
+ _inherit = ['calendar.alarm']
alarm_type = fields.Selection(selection_add=[
('sms', 'SMS Text Message')
diff --git a/addons/calendar_sms/models/calendar_alarm_manager.py b/addons/calendar_sms/models/calendar_alarm_manager.py
index 98fb8f4a40dcc..372375610302c 100644
--- a/addons/calendar_sms/models/calendar_alarm_manager.py
+++ b/addons/calendar_sms/models/calendar_alarm_manager.py
@@ -4,8 +4,8 @@
from odoo import api, models
-class AlarmManager(models.AbstractModel):
- _inherit = 'calendar.alarm_manager'
+class CalendarAlarm_Manager(models.AbstractModel):
+ _inherit = ['calendar.alarm_manager']
@api.model
def _send_reminder(self):
diff --git a/addons/calendar_sms/models/calendar_event.py b/addons/calendar_sms/models/calendar_event.py
index 6b8b045286dc6..5a9b199014f5a 100644
--- a/addons/calendar_sms/models/calendar_event.py
+++ b/addons/calendar_sms/models/calendar_event.py
@@ -4,8 +4,9 @@
from odoo import models, _
from odoo.exceptions import UserError
+
class CalendarEvent(models.Model):
- _inherit = 'calendar.event'
+ _inherit = ['calendar.event']
def _do_sms_reminder(self, alarms):
""" Send an SMS text reminder to attendees that haven't declined the event """
diff --git a/addons/certificate/models/certificate.py b/addons/certificate/models/certificate.py
index e1953bbd48512..45247adfa7bd4 100644
--- a/addons/certificate/models/certificate.py
+++ b/addons/certificate/models/certificate.py
@@ -13,8 +13,7 @@
from odoo.tools import parse_version
-class Certificate(models.Model):
- _name = 'certificate.certificate'
+class CertificateCertificate(models.Model):
_description = 'Certificate'
_order = 'date_end DESC'
_check_company_auto = True
diff --git a/addons/certificate/models/key.py b/addons/certificate/models/key.py
index 4fc6013049c4f..8f10b3ddeca4b 100644
--- a/addons/certificate/models/key.py
+++ b/addons/certificate/models/key.py
@@ -31,8 +31,7 @@ def _int_to_bytes(value, byteorder='big'):
return value.to_bytes((value.bit_length() + 7) // 8, byteorder=byteorder)
-class Key(models.Model):
- _name = 'certificate.key'
+class CertificateKey(models.Model):
_description = 'Cryptographic Keys'
name = fields.Char(string='Name', default="New key")
diff --git a/addons/cloud_storage/models/ir_attachment.py b/addons/cloud_storage/models/ir_attachment.py
index 8deeac5232ac8..aa69da2850599 100644
--- a/addons/cloud_storage/models/ir_attachment.py
+++ b/addons/cloud_storage/models/ir_attachment.py
@@ -7,8 +7,8 @@
from odoo.http import Stream
-class CloudStorageAttachment(models.Model):
- _inherit = 'ir.attachment'
+class IrAttachment(models.Model):
+ _inherit = ['ir.attachment']
_cloud_storage_upload_url_time_to_expiry = 300 # 300 seconds
_cloud_storage_download_url_time_to_expiry = 300 # 300 seconds
diff --git a/addons/cloud_storage/models/ir_http.py b/addons/cloud_storage/models/ir_http.py
index 0a61a267e7c92..531102a3a64a1 100644
--- a/addons/cloud_storage/models/ir_http.py
+++ b/addons/cloud_storage/models/ir_http.py
@@ -5,7 +5,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
def session_info(self):
res = super().session_info()
diff --git a/addons/cloud_storage/models/res_config_settings.py b/addons/cloud_storage/models/res_config_settings.py
index cf5d5b53df47b..11c1cf84810c8 100644
--- a/addons/cloud_storage/models/res_config_settings.py
+++ b/addons/cloud_storage/models/res_config_settings.py
@@ -7,7 +7,7 @@
DEFAULT_CLOUD_STORAGE_MIN_FILE_SIZE = 20_000_000
-class CloudStorageSettings(models.TransientModel):
+class ResConfigSettings(models.TransientModel):
"""
Instructions:
cloud_storage_provider: Once set, new attachments from the web client can
@@ -18,7 +18,7 @@ class CloudStorageSettings(models.TransientModel):
cloud_storage_mim_file_size: a soft limit for the file size that can be
uploaded as the cloud storage attachments for web client.
"""
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
cloud_storage_provider = fields.Selection(
selection=[],
diff --git a/addons/cloud_storage_azure/models/ir_attachment.py b/addons/cloud_storage_azure/models/ir_attachment.py
index 570f5400c3d95..c8ccd5b4ed53b 100644
--- a/addons/cloud_storage_azure/models/ir_attachment.py
+++ b/addons/cloud_storage_azure/models/ir_attachment.py
@@ -59,7 +59,7 @@ def get_cloud_storage_azure_user_delegation_key(env):
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
_cloud_storage_azure_url_pattern = re.compile(r'https://(?P[\w]+).blob.core.windows.net/(?P[\w]+)/(?P[^?]+)')
def _get_cloud_storage_azure_info(self):
diff --git a/addons/cloud_storage_azure/models/res_config_settings.py b/addons/cloud_storage_azure/models/res_config_settings.py
index 925d9d1ef9754..16042098082fa 100644
--- a/addons/cloud_storage_azure/models/res_config_settings.py
+++ b/addons/cloud_storage_azure/models/res_config_settings.py
@@ -7,7 +7,7 @@
from odoo.exceptions import ValidationError, UserError
-class CloudStorageSettings(models.TransientModel):
+class ResConfigSettings(models.TransientModel):
"""
Instructions:
cloud_storage_azure_account_name, cloud_storage_azure_container_name:
@@ -18,7 +18,7 @@ class CloudStorageSettings(models.TransientModel):
invalidate the cached value for
get_cloud_storage_azure_user_delegation_key
"""
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
cloud_storage_provider = fields.Selection(selection_add=[('azure', 'Azure Cloud Storage')])
diff --git a/addons/cloud_storage_google/models/ir_attachment.py b/addons/cloud_storage_google/models/ir_attachment.py
index a9be6eeff9d7f..5b1979041baf9 100644
--- a/addons/cloud_storage_google/models/ir_attachment.py
+++ b/addons/cloud_storage_google/models/ir_attachment.py
@@ -32,7 +32,7 @@ def get_cloud_storage_google_credential(env):
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
_cloud_storage_google_url_pattern = re.compile(r'https://storage\.googleapis\.com/(?P[\w\-.]+)/(?P[^?]+)')
def _get_cloud_storage_google_info(self):
diff --git a/addons/cloud_storage_google/models/res_config_settings.py b/addons/cloud_storage_google/models/res_config_settings.py
index 066d6d3faab97..f2b4a0816e9b7 100644
--- a/addons/cloud_storage_google/models/res_config_settings.py
+++ b/addons/cloud_storage_google/models/res_config_settings.py
@@ -17,14 +17,14 @@
from .ir_attachment import get_cloud_storage_google_credential
-class CloudStorageSettings(models.TransientModel):
+class ResConfigSettings(models.TransientModel):
"""
Instructions:
cloud_storage_google_bucket_name: if changed and the old bucket name
are still in use, you should promise the current service account
has the permission to access the old bucket.
"""
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
cloud_storage_provider = fields.Selection(selection_add=[('google', 'Google Cloud Storage')])
diff --git a/addons/contacts/models/res_partner.py b/addons/contacts/models/res_partner.py
index be9fc03741d70..fc24ff5803a04 100644
--- a/addons/contacts/models/res_partner.py
+++ b/addons/contacts/models/res_partner.py
@@ -3,8 +3,8 @@
from odoo import models
-class Partner(models.Model):
- _inherit = "res.partner"
+class ResPartner(models.Model):
+ _inherit = ["res.partner"]
def _get_backend_root_menu_ids(self):
return super()._get_backend_root_menu_ids() + [self.env.ref('contacts.menu_contacts').id]
diff --git a/addons/contacts/models/res_users.py b/addons/contacts/models/res_users.py
index 268bbc69334dc..22944ab76eef1 100644
--- a/addons/contacts/models/res_users.py
+++ b/addons/contacts/models/res_users.py
@@ -4,8 +4,7 @@
from odoo import api, models, modules
-class Users(models.Model):
- _name = 'res.users'
+class ResUsers(models.Model):
_inherit = ['res.users']
@api.model
diff --git a/addons/crm/models/calendar.py b/addons/crm/models/calendar.py
index 4493fd9f30813..e6012f7fc40b7 100644
--- a/addons/crm/models/calendar.py
+++ b/addons/crm/models/calendar.py
@@ -5,7 +5,7 @@
class CalendarEvent(models.Model):
- _inherit = 'calendar.event'
+ _inherit = ['calendar.event']
@api.model
def default_get(self, fields):
diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py
index dd129923b76dc..574992f1f627b 100644
--- a/addons/crm/models/crm_lead.py
+++ b/addons/crm/models/crm_lead.py
@@ -85,8 +85,7 @@
PLS_UPDATE_BATCH_STEP = 5000
-class Lead(models.Model):
- _name = "crm.lead"
+class CrmLead(models.Model):
_description = "Lead/Opportunity"
_order = "priority desc, id desc"
_inherit = ['mail.thread.cc',
@@ -733,7 +732,7 @@ def create(self, vals_list):
for vals in vals_list:
if vals.get('website'):
vals['website'] = self.env['res.partner']._clean_website(vals['website'])
- leads = super(Lead, self).create(vals_list)
+ leads = super().create(vals_list)
for lead, values in zip(leads, vals_list):
if any(field in ['active', 'stage_id'] for field in values):
@@ -779,16 +778,16 @@ def write(self, vals):
self._handle_won_lost(vals)
if not stage_is_won:
- return super(Lead, self).write(vals)
+ return super().write(vals)
# stage change between two won stages: does not change the date_closed
leads_already_won = self.filtered(lambda lead: lead.stage_id.is_won)
remaining = self - leads_already_won
if remaining:
- result = super(Lead, remaining).write(vals)
+ result = super(CrmLead, remaining).write(vals)
if leads_already_won:
vals.pop('date_closed', False)
- result = super(Lead, leads_already_won).write(vals)
+ result = super(CrmLead, leads_already_won).write(vals)
return result
@api.model
@@ -879,11 +878,11 @@ def _handle_won_lost(self, vals):
in scoring frequency table.
- From won to lost : We need to decrement corresponding won count + increment corresponding lost count
in scoring frequency table."""
- Lead = self.env['crm.lead']
- leads_reach_won = Lead
- leads_leave_won = Lead
- leads_reach_lost = Lead
- leads_leave_lost = Lead
+ CrmLead = self.env['crm.lead']
+ leads_reach_won = CrmLead
+ leads_leave_won = CrmLead
+ leads_reach_lost = CrmLead
+ leads_leave_lost = CrmLead
won_stage_ids = self.env['crm.stage'].search([('is_won', '=', True)]).ids
for lead in self:
if 'stage_id' in vals:
@@ -935,7 +934,7 @@ def unlink(self):
'res_id': False,
'res_model_id': False,
})
- return super(Lead, self).unlink()
+ return super().unlink()
@api.model
def _read_group_stage_ids(self, stages, domain):
@@ -986,7 +985,7 @@ def _stage_find(self, team_id=False, domain=None, order='sequence, id', limit=1)
def toggle_active(self):
""" When archiving: mark probability as 0. When re-activating
update probability again, for leads and opportunities. """
- res = super(Lead, self).toggle_active()
+ res = super().toggle_active()
activated = self.filtered(lambda lead: lead.active)
archived = self.filtered(lambda lead: not lead.active)
if activated:
@@ -1920,7 +1919,7 @@ def _track_subtype(self, init_values):
return self.env.ref('crm.mt_lead_restored')
elif 'active' in init_values and not self.active:
return self.env.ref('crm.mt_lead_lost')
- return super(Lead, self)._track_subtype(init_values)
+ return super()._track_subtype(init_values)
def _notify_by_email_prepare_rendering_context(self, message, msg_vals=False, model_description=False,
force_email_company=False, force_email_lang=False):
@@ -1974,7 +1973,7 @@ def _notify_get_reply_to(self, default=None):
res = {lead.id: aliases.get(lead.team_id.id) for lead in self}
leftover = self.filtered(lambda rec: not rec.team_id)
if leftover:
- res.update(super(Lead, leftover)._notify_get_reply_to(default=default))
+ res.update(super(CrmLead, leftover)._notify_get_reply_to(default=default))
return res
def _message_get_default_recipients(self):
@@ -2025,7 +2024,7 @@ def message_new(self, msg_dict, custom_values=None):
defaults['priority'] = msg_dict.get('priority')
defaults.update(custom_values)
- return super(Lead, self).message_new(msg_dict, custom_values=defaults)
+ return super().message_new(msg_dict, custom_values=defaults)
def _message_post_after_hook(self, message, msg_vals):
if self.email_from and not self.partner_id:
@@ -2043,14 +2042,14 @@ def _message_post_after_hook(self, message, msg_vals):
self.search([
('partner_id', '=', False), email_domain, ('stage_id.fold', '=', False)
]).write({'partner_id': new_partner[0].id})
- return super(Lead, self)._message_post_after_hook(message, msg_vals)
+ return super()._message_post_after_hook(message, msg_vals)
def _message_partner_info_from_emails(self, emails, link_mail=False):
""" Try to propose a better recipient when having only an email by populating
it with the partner_name / contact_name field of the lead e.g. if lead
contact_name is "Raoul" and email is "raoul@raoul.fr", suggest
"Raoul" as recipient. """
- result = super(Lead, self)._message_partner_info_from_emails(emails, link_mail=link_mail)
+ result = super()._message_partner_info_from_emails(emails, link_mail=link_mail)
if not (self.partner_name or self.contact_name) or not self.email_from:
return result
for email, partner_info in zip(emails, result):
diff --git a/addons/crm/models/crm_lead_scoring_frequency.py b/addons/crm/models/crm_lead_scoring_frequency.py
index b54fe92289887..ea8a5a0ce0016 100644
--- a/addons/crm/models/crm_lead_scoring_frequency.py
+++ b/addons/crm/models/crm_lead_scoring_frequency.py
@@ -2,8 +2,7 @@
from odoo import fields, models
-class LeadScoringFrequency(models.Model):
- _name = 'crm.lead.scoring.frequency'
+class CrmLeadScoringFrequency(models.Model):
_description = 'Lead Scoring Frequency'
variable = fields.Char('Variable', index=True)
@@ -12,8 +11,8 @@ class LeadScoringFrequency(models.Model):
lost_count = fields.Float('Lost Count', digits=(16, 1)) # Float because we add 0.1 to avoid zero Frequency issue
team_id = fields.Many2one('crm.team', 'Sales Team', ondelete="cascade")
-class FrequencyField(models.Model):
- _name = 'crm.lead.scoring.frequency.field'
+
+class CrmLeadScoringFrequencyField(models.Model):
_description = 'Fields that can be used for predictive lead scoring computation'
name = fields.Char(related="field_id.field_description")
diff --git a/addons/crm/models/crm_lost_reason.py b/addons/crm/models/crm_lost_reason.py
index dbe5624328364..82065eab32436 100644
--- a/addons/crm/models/crm_lost_reason.py
+++ b/addons/crm/models/crm_lost_reason.py
@@ -4,8 +4,7 @@
from odoo import fields, models, _
-class LostReason(models.Model):
- _name = "crm.lost.reason"
+class CrmLostReason(models.Model):
_description = 'Opp. Lost Reason'
name = fields.Char('Description', required=True, translate=True)
diff --git a/addons/crm/models/crm_recurring_plan.py b/addons/crm/models/crm_recurring_plan.py
index aa9e7f91a53c8..dc12d1c5b8f9c 100644
--- a/addons/crm/models/crm_recurring_plan.py
+++ b/addons/crm/models/crm_recurring_plan.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class RecurringPlan(models.Model):
- _name = "crm.recurring.plan"
+class CrmRecurringPlan(models.Model):
_description = "CRM Recurring revenue plans"
_order = "sequence"
diff --git a/addons/crm/models/crm_stage.py b/addons/crm/models/crm_stage.py
index 678ae3e268eb0..3a148f37f2907 100644
--- a/addons/crm/models/crm_stage.py
+++ b/addons/crm/models/crm_stage.py
@@ -11,13 +11,12 @@
]
-class Stage(models.Model):
+class CrmStage(models.Model):
""" Model for case stages. This models the main stages of a document
management flow. Main CRM objects (leads, opportunities, project
issues, ...) will now use only stages, instead of state and stages.
Stages are for example used to display the kanban view of records.
"""
- _name = "crm.stage"
_description = "CRM Stages"
_rec_name = 'name'
_order = "sequence, name, id"
@@ -32,7 +31,7 @@ def default_get(self, fields):
ctx = dict(self.env.context)
ctx.pop('default_team_id')
self = self.with_context(ctx)
- return super(Stage, self).default_get(fields)
+ return super().default_get(fields)
name = fields.Char('Stage Name', required=True, translate=True)
sequence = fields.Integer('Sequence', default=1, help="Used to order stages. Lower is better.")
diff --git a/addons/crm/models/crm_team.py b/addons/crm/models/crm_team.py
index 128d8bd96c51b..f1116c709223b 100644
--- a/addons/crm/models/crm_team.py
+++ b/addons/crm/models/crm_team.py
@@ -17,8 +17,7 @@
_logger = logging.getLogger(__name__)
-class Team(models.Model):
- _name = 'crm.team'
+class CrmTeam(models.Model):
_inherit = ['mail.alias.mixin', 'crm.team']
_description = 'Sales Team'
@@ -126,7 +125,7 @@ def _constrains_assignment_domain(self):
# ------------------------------------------------------------
def write(self, vals):
- result = super(Team, self).write(vals)
+ result = super().write(vals)
if 'use_leads' in vals or 'use_opportunities' in vals:
for team in self:
alias_vals = team._alias_get_creation_values()
@@ -170,14 +169,14 @@ def unlink(self):
'variable': frequency.variable,
'won_count': frequency.won_count if float_compare(frequency.won_count, 0.1, 2) == 1 else 0.1,
})
- return super(Team, self).unlink()
+ return super().unlink()
# ------------------------------------------------------------
# MESSAGING
# ------------------------------------------------------------
def _alias_get_creation_values(self):
- values = super(Team, self)._alias_get_creation_values()
+ values = super()._alias_get_creation_values()
values['alias_model_id'] = self.env['ir.model']._get('crm.lead').id
if self.id:
if not self.use_leads and not self.use_opportunities:
@@ -699,7 +698,7 @@ def _action_update_to_pipeline(self, action):
return action
def _compute_dashboard_button_name(self):
- super(Team, self)._compute_dashboard_button_name()
+ super()._compute_dashboard_button_name()
team_with_pipelines = self.filtered(lambda el: el.use_opportunities)
team_with_pipelines.update({'dashboard_button_name': _("Pipeline")})
@@ -712,29 +711,29 @@ def action_primary_channel_button(self):
}
action['help'] = self.env['ir.ui.view']._render_template('crm.crm_action_helper', values=rcontext)
return action
- return super(Team,self).action_primary_channel_button()
+ return super().action_primary_channel_button()
def _graph_get_model(self):
if self.use_opportunities:
return 'crm.lead'
- return super(Team,self)._graph_get_model()
+ return super()._graph_get_model()
def _graph_date_column(self):
if self.use_opportunities:
return SQL('create_date')
- return super(Team,self)._graph_date_column()
+ return super()._graph_date_column()
def _graph_y_query(self):
if self.use_opportunities:
return SQL('count(*)')
- return super(Team,self)._graph_y_query()
+ return super()._graph_y_query()
def _extra_sql_conditions(self):
if self.use_opportunities:
return SQL("type LIKE 'opportunity'")
- return super(Team,self)._extra_sql_conditions()
+ return super()._extra_sql_conditions()
def _graph_title_and_key(self):
if self.use_opportunities:
return ['', _('New Opportunities')] # no more title
- return super(Team, self)._graph_title_and_key()
+ return super()._graph_title_and_key()
diff --git a/addons/crm/models/crm_team_member.py b/addons/crm/models/crm_team_member.py
index f79b66a151cfc..5b7a1858a0e66 100644
--- a/addons/crm/models/crm_team_member.py
+++ b/addons/crm/models/crm_team_member.py
@@ -12,8 +12,8 @@
_logger = logging.getLogger(__name__)
-class TeamMember(models.Model):
- _inherit = 'crm.team.member'
+class CrmTeamMember(models.Model):
+ _inherit = ['crm.team.member']
# assignment
assignment_enabled = fields.Boolean(related="crm_team_id.assignment_enabled")
diff --git a/addons/crm/models/digest.py b/addons/crm/models/digest.py
index 25c4299f35816..ec78952d06827 100644
--- a/addons/crm/models/digest.py
+++ b/addons/crm/models/digest.py
@@ -5,8 +5,8 @@
from odoo.exceptions import AccessError
-class Digest(models.Model):
- _inherit = 'digest.digest'
+class DigestDigest(models.Model):
+ _inherit = ['digest.digest']
kpi_crm_lead_created = fields.Boolean('New Leads')
kpi_crm_lead_created_value = fields.Integer(compute='_compute_kpi_crm_lead_created_value')
@@ -31,7 +31,7 @@ def _compute_kpi_crm_opportunities_won_value(self):
)
def _compute_kpis_actions(self, company, user):
- res = super(Digest, self)._compute_kpis_actions(company, user)
+ res = super()._compute_kpis_actions(company, user)
res['kpi_crm_lead_created'] = 'crm.crm_lead_action_pipeline&menu_id=%s' % self.env.ref('crm.crm_menu_root').id
res['kpi_crm_opportunities_won'] = 'crm.crm_lead_action_pipeline&menu_id=%s' % self.env.ref('crm.crm_menu_root').id
if user.has_group('crm.group_use_lead'):
diff --git a/addons/crm/models/ir_config_parameter.py b/addons/crm/models/ir_config_parameter.py
index 4f78f6184bbf9..5b07a818a8250 100644
--- a/addons/crm/models/ir_config_parameter.py
+++ b/addons/crm/models/ir_config_parameter.py
@@ -5,11 +5,11 @@
from odoo.addons.base.models.ir_model import MODULE_UNINSTALL_FLAG
-class IrConfigParameter(models.Model):
- _inherit = 'ir.config_parameter'
+class IrConfig_Parameter(models.Model):
+ _inherit = ['ir.config_parameter']
def write(self, vals):
- result = super(IrConfigParameter, self).write(vals)
+ result = super().write(vals)
if any(record.key == "crm.pls_fields" for record in self):
self.env.flush_all()
self.env.registry.setup_models(self.env.cr)
@@ -17,7 +17,7 @@ def write(self, vals):
@api.model_create_multi
def create(self, vals_list):
- records = super(IrConfigParameter, self).create(vals_list)
+ records = super().create(vals_list)
if any(record.key == "crm.pls_fields" for record in records):
self.env.flush_all()
self.env.registry.setup_models(self.env.cr)
@@ -25,7 +25,7 @@ def create(self, vals_list):
def unlink(self):
pls_emptied = any(record.key == "crm.pls_fields" for record in self)
- result = super(IrConfigParameter, self).unlink()
+ result = super().unlink()
if pls_emptied and not self._context.get(MODULE_UNINSTALL_FLAG):
self.env.flush_all()
self.env.registry.setup_models(self.env.cr)
diff --git a/addons/crm/models/mail_activity.py b/addons/crm/models/mail_activity.py
index 85f7e45016f2d..67562abb42df6 100644
--- a/addons/crm/models/mail_activity.py
+++ b/addons/crm/models/mail_activity.py
@@ -5,7 +5,7 @@
class MailActivity(models.Model):
- _inherit = "mail.activity"
+ _inherit = ["mail.activity"]
def action_create_calendar_event(self):
""" Small override of the action that creates a calendar.
diff --git a/addons/crm/models/res_config_settings.py b/addons/crm/models/res_config_settings.py
index 4e1559ad6b51f..e5adcfcbb430d 100644
--- a/addons/crm/models/res_config_settings.py
+++ b/addons/crm/models/res_config_settings.py
@@ -9,7 +9,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
group_use_lead = fields.Boolean(string="Leads", implied_group='crm.group_use_lead')
group_use_recurring_revenues = fields.Boolean(string="Recurring Revenues", implied_group='crm.group_use_recurring_revenues')
diff --git a/addons/crm/models/res_partner.py b/addons/crm/models/res_partner.py
index 7c8120440f713..5ce18dbfb647c 100644
--- a/addons/crm/models/res_partner.py
+++ b/addons/crm/models/res_partner.py
@@ -4,9 +4,8 @@
from odoo.osv import expression
-class Partner(models.Model):
- _name = 'res.partner'
- _inherit = 'res.partner'
+class ResPartner(models.Model):
+ _inherit = ['res.partner']
opportunity_ids = fields.One2many('crm.lead', 'partner_id', string='Opportunities', domain=[('type', '=', 'opportunity')])
opportunity_count = fields.Integer(
@@ -17,7 +16,7 @@ class Partner(models.Model):
@api.model
def default_get(self, fields):
- rec = super(Partner, self).default_get(fields)
+ rec = super().default_get(fields)
active_model = self.env.context.get('active_model')
if active_model == 'crm.lead' and len(self.env.context.get('active_ids', [])) <= 1:
lead = self.env[active_model].browse(self.env.context.get('active_id')).exists()
diff --git a/addons/crm/models/res_users.py b/addons/crm/models/res_users.py
index 951287d59588c..92995641b6b95 100644
--- a/addons/crm/models/res_users.py
+++ b/addons/crm/models/res_users.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
target_sales_won = fields.Integer('Won in Opportunities Target')
target_sales_done = fields.Integer('Activities Done Target')
diff --git a/addons/crm/models/utm.py b/addons/crm/models/utm.py
index e44a7121fb20a..7ec333310d9fe 100644
--- a/addons/crm/models/utm.py
+++ b/addons/crm/models/utm.py
@@ -5,7 +5,7 @@
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
use_leads = fields.Boolean('Use Leads', compute='_compute_use_leads')
crm_lead_count = fields.Integer('Leads/Opportunities count', groups='sales_team.group_sale_salesman', compute="_compute_crm_lead_count")
diff --git a/addons/crm/report/crm_activity_report.py b/addons/crm/report/crm_activity_report.py
index 990066b56430a..5c997990ec0cb 100644
--- a/addons/crm/report/crm_activity_report.py
+++ b/addons/crm/report/crm_activity_report.py
@@ -4,10 +4,9 @@
from odoo import fields, models, tools
-class ActivityReport(models.Model):
+class CrmActivityReport(models.Model):
""" CRM Lead Analysis """
- _name = "crm.activity.report"
_auto = False
_description = "CRM Activity Analysis"
_rec_name = 'id'
diff --git a/addons/crm/wizard/crm_lead_lost.py b/addons/crm/wizard/crm_lead_lost.py
index c4ad0ab1d058f..fe55eb8d0aaa2 100644
--- a/addons/crm/wizard/crm_lead_lost.py
+++ b/addons/crm/wizard/crm_lead_lost.py
@@ -7,7 +7,6 @@
class CrmLeadLost(models.TransientModel):
- _name = 'crm.lead.lost'
_description = 'Get Lost Reason'
lead_ids = fields.Many2many('crm.lead', string='Leads')
diff --git a/addons/crm/wizard/crm_lead_pls_update.py b/addons/crm/wizard/crm_lead_pls_update.py
index 870513b880662..96353d48c5cd4 100644
--- a/addons/crm/wizard/crm_lead_pls_update.py
+++ b/addons/crm/wizard/crm_lead_pls_update.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class CrmUpdateProbabilities(models.TransientModel):
- _name = 'crm.lead.pls.update'
+class CrmLeadPlsUpdate(models.TransientModel):
_description = "Update the probabilities"
def _get_default_pls_start_date(self):
diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py
index 73bbd9dc2e12d..5586851bce01d 100644
--- a/addons/crm/wizard/crm_lead_to_opportunity.py
+++ b/addons/crm/wizard/crm_lead_to_opportunity.py
@@ -6,15 +6,14 @@
from odoo.tools.translate import _
-class Lead2OpportunityPartner(models.TransientModel):
- _name = 'crm.lead2opportunity.partner'
+class CrmLead2opportunityPartner(models.TransientModel):
_description = 'Convert Lead to Opportunity (not in mass)'
@api.model
def default_get(self, fields):
""" Allow support of active_id / active_model instead of jut default_lead_id
to ease window action definitions, and be backward compatible. """
- result = super(Lead2OpportunityPartner, self).default_get(fields)
+ result = super().default_get(fields)
if 'lead_id' in fields and not result.get('lead_id') and self.env.context.get('active_id'):
result['lead_id'] = self.env.context.get('active_id')
diff --git a/addons/crm/wizard/crm_lead_to_opportunity_mass.py b/addons/crm/wizard/crm_lead_to_opportunity_mass.py
index eb4b8c4181592..b28804e1b3588 100644
--- a/addons/crm/wizard/crm_lead_to_opportunity_mass.py
+++ b/addons/crm/wizard/crm_lead_to_opportunity_mass.py
@@ -4,10 +4,9 @@
from odoo import api, fields, models
-class Lead2OpportunityMassConvert(models.TransientModel):
- _name = 'crm.lead2opportunity.partner.mass'
+class CrmLead2opportunityPartnerMass(models.TransientModel):
_description = 'Convert Lead to Opportunity (in mass)'
- _inherit = 'crm.lead2opportunity.partner'
+ _inherit = ['crm.lead2opportunity.partner']
lead_id = fields.Many2one(required=False)
lead_tomerge_ids = fields.Many2many(
@@ -75,7 +74,7 @@ def _convert_and_allocate(self, leads, user_ids, team_id=False):
salesmen_ids = []
if self.user_ids:
salesmen_ids = self.user_ids.ids
- return super(Lead2OpportunityMassConvert, self)._convert_and_allocate(leads, salesmen_ids, team_id=team_id)
+ return super()._convert_and_allocate(leads, salesmen_ids, team_id=team_id)
def action_mass_convert(self):
self.ensure_one()
@@ -106,4 +105,4 @@ def _convert_handle_partner(self, lead, action, partner_id):
if self.action == 'each_exist_or_create':
partner_id = lead._find_matching_partner(email_only=True).id
action = 'create'
- return super(Lead2OpportunityMassConvert, self)._convert_handle_partner(lead, action, partner_id)
+ return super()._convert_handle_partner(lead, action, partner_id)
diff --git a/addons/crm/wizard/crm_merge_opportunities.py b/addons/crm/wizard/crm_merge_opportunities.py
index 9ec723b0b9966..c91f79ac6fc75 100644
--- a/addons/crm/wizard/crm_merge_opportunities.py
+++ b/addons/crm/wizard/crm_merge_opportunities.py
@@ -4,7 +4,7 @@
from odoo import api, fields, models
-class MergeOpportunity(models.TransientModel):
+class CrmMergeOpportunity(models.TransientModel):
"""
Merge opportunities together.
If we're talking about opportunities, it's just because it makes more sense
@@ -14,7 +14,6 @@ class MergeOpportunity(models.TransientModel):
in a new opp).
"""
- _name = 'crm.merge.opportunity'
_description = 'Merge Opportunities'
@api.model
@@ -23,7 +22,7 @@ def default_get(self, fields):
In order to get merged, these leads/opps can't be in 'Dead' or 'Closed'
"""
record_ids = self._context.get('active_ids')
- result = super(MergeOpportunity, self).default_get(fields)
+ result = super().default_get(fields)
if record_ids:
if 'opportunity_ids' in fields:
diff --git a/addons/crm_iap_enrich/models/crm_lead.py b/addons/crm_iap_enrich/models/crm_lead.py
index 003c5824c0e74..21f4a22c61db1 100644
--- a/addons/crm_iap_enrich/models/crm_lead.py
+++ b/addons/crm_iap_enrich/models/crm_lead.py
@@ -12,8 +12,8 @@
_logger = logging.getLogger(__name__)
-class Lead(models.Model):
- _inherit = 'crm.lead'
+class CrmLead(models.Model):
+ _inherit = ['crm.lead']
iap_enrich_done = fields.Boolean(string='Enrichment done', help='Whether IAP service for lead enrichment based on email has been performed on this lead.')
show_enrich_button = fields.Boolean(string='Allow manual enrich', compute="_compute_show_enrich_button")
@@ -40,7 +40,7 @@ def _iap_enrich_leads_cron(self, enrich_hours_delay=1, leads_batch_size=1000):
@api.model_create_multi
def create(self, vals_list):
- leads = super(Lead, self).create(vals_list)
+ leads = super().create(vals_list)
enrich_mode = self.env['ir.config_parameter'].sudo().get_param('crm.iap.lead.enrich.setting', 'auto')
if enrich_mode == 'auto':
cron = self.env.ref('crm_iap_enrich.ir_cron_lead_enrichment', raise_if_not_found=False)
@@ -165,6 +165,6 @@ def _iap_enrich_from_response(self, iap_response):
def _merge_get_fields_specific(self):
return {
- ** super(Lead, self)._merge_get_fields_specific(),
+ ** super()._merge_get_fields_specific(),
'iap_enrich_done': lambda fname, leads: any(lead.iap_enrich_done for lead in leads),
}
diff --git a/addons/crm_iap_enrich/models/res_config_settings.py b/addons/crm_iap_enrich/models/res_config_settings.py
index 658fc7fd207dd..58ec233793dfd 100644
--- a/addons/crm_iap_enrich/models/res_config_settings.py
+++ b/addons/crm_iap_enrich/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = "res.config.settings"
+ _inherit = ["res.config.settings"]
@api.model
def get_values(self):
diff --git a/addons/crm_iap_mine/models/crm_iap_lead_helpers.py b/addons/crm_iap_mine/models/crm_iap_lead_helpers.py
index 9dc4baa0c1130..1af236394c641 100644
--- a/addons/crm_iap_mine/models/crm_iap_lead_helpers.py
+++ b/addons/crm_iap_mine/models/crm_iap_lead_helpers.py
@@ -2,8 +2,7 @@
from odoo import api, models
-class CRMHelpers(models.Model):
- _name = 'crm.iap.lead.helpers'
+class CrmIapLeadHelpers(models.Model):
_description = 'Helper methods for crm_iap_mine modules'
@api.model
diff --git a/addons/crm_iap_mine/models/crm_iap_lead_industry.py b/addons/crm_iap_mine/models/crm_iap_lead_industry.py
index 23ad067322bf4..0d0d1520b9697 100644
--- a/addons/crm_iap_mine/models/crm_iap_lead_industry.py
+++ b/addons/crm_iap_mine/models/crm_iap_lead_industry.py
@@ -6,7 +6,6 @@
class CrmIapLeadIndustry(models.Model):
""" Industry Tags of Acquisition Rules """
- _name = 'crm.iap.lead.industry'
_description = 'CRM IAP Lead Industry'
_order = 'sequence,id'
diff --git a/addons/crm_iap_mine/models/crm_iap_lead_mining_request.py b/addons/crm_iap_mine/models/crm_iap_lead_mining_request.py
index 59393fc76cd97..c9d2b9c903057 100644
--- a/addons/crm_iap_mine/models/crm_iap_lead_mining_request.py
+++ b/addons/crm_iap_mine/models/crm_iap_lead_mining_request.py
@@ -20,8 +20,7 @@
CREDIT_PER_CONTACT = 1
-class CRMLeadMiningRequest(models.Model):
- _name = 'crm.iap.lead.mining.request'
+class CrmIapLeadMiningRequest(models.Model):
_description = 'CRM Lead Mining Request'
def _default_lead_type(self):
diff --git a/addons/crm_iap_mine/models/crm_iap_lead_role.py b/addons/crm_iap_mine/models/crm_iap_lead_role.py
index 034cc5e33a350..524a634bf30b4 100644
--- a/addons/crm_iap_mine/models/crm_iap_lead_role.py
+++ b/addons/crm_iap_mine/models/crm_iap_lead_role.py
@@ -4,9 +4,8 @@
from odoo import api, fields, models
-class PeopleRole(models.Model):
+class CrmIapLeadRole(models.Model):
""" CRM Reveal People Roles for People """
- _name = 'crm.iap.lead.role'
_description = 'People Role'
name = fields.Char(string='Role Name', required=True, translate=True)
diff --git a/addons/crm_iap_mine/models/crm_iap_lead_seniority.py b/addons/crm_iap_mine/models/crm_iap_lead_seniority.py
index 63e24b13f7ced..4a3f71c0f7d48 100644
--- a/addons/crm_iap_mine/models/crm_iap_lead_seniority.py
+++ b/addons/crm_iap_mine/models/crm_iap_lead_seniority.py
@@ -4,9 +4,8 @@
from odoo import api, fields, models
-class PeopleSeniority(models.Model):
+class CrmIapLeadSeniority(models.Model):
""" Seniority for People Rules """
- _name = 'crm.iap.lead.seniority'
_description = 'People Seniority'
name = fields.Char(string='Name', required=True, translate=True)
diff --git a/addons/crm_iap_mine/models/crm_lead.py b/addons/crm_iap_mine/models/crm_lead.py
index 1fbc48aaf91d4..90daf3a24c0b6 100644
--- a/addons/crm_iap_mine/models/crm_lead.py
+++ b/addons/crm_iap_mine/models/crm_lead.py
@@ -4,13 +4,13 @@
from odoo import fields, models, _
-class Lead(models.Model):
- _inherit = 'crm.lead'
+class CrmLead(models.Model):
+ _inherit = ['crm.lead']
lead_mining_request_id = fields.Many2one('crm.iap.lead.mining.request', string='Lead Mining Request', index='btree_not_null')
def _merge_get_fields(self):
- return super(Lead, self)._merge_get_fields() + ['lead_mining_request_id']
+ return super()._merge_get_fields() + ['lead_mining_request_id']
def action_generate_leads(self):
return {
diff --git a/addons/crm_livechat/models/chatbot_script.py b/addons/crm_livechat/models/chatbot_script.py
index 07e50d705a69a..ea8690ac6d623 100644
--- a/addons/crm_livechat/models/chatbot_script.py
+++ b/addons/crm_livechat/models/chatbot_script.py
@@ -5,7 +5,7 @@
class ChatbotScript(models.Model):
- _inherit = 'chatbot.script'
+ _inherit = ['chatbot.script']
lead_count = fields.Integer(
string='Generated Lead Count', compute='_compute_lead_count')
diff --git a/addons/crm_livechat/models/chatbot_script_step.py b/addons/crm_livechat/models/chatbot_script_step.py
index 7d9acf2b11e39..47182bbfb333f 100644
--- a/addons/crm_livechat/models/chatbot_script_step.py
+++ b/addons/crm_livechat/models/chatbot_script_step.py
@@ -5,7 +5,7 @@
class ChatbotScriptStep(models.Model):
- _inherit = 'chatbot.script.step'
+ _inherit = ['chatbot.script.step']
step_type = fields.Selection(
selection_add=[('create_lead', 'Create Lead')], ondelete={'create_lead': 'cascade'})
diff --git a/addons/crm_livechat/models/discuss_channel.py b/addons/crm_livechat/models/discuss_channel.py
index 92c6b63174e82..3e2b4be0f7cfe 100644
--- a/addons/crm_livechat/models/discuss_channel.py
+++ b/addons/crm_livechat/models/discuss_channel.py
@@ -7,7 +7,7 @@
class DiscussChannel(models.Model):
- _inherit = 'discuss.channel'
+ _inherit = ['discuss.channel']
def execute_command_lead(self, **kwargs):
key = kwargs['body']
diff --git a/addons/crm_mail_plugin/models/crm_lead.py b/addons/crm_mail_plugin/models/crm_lead.py
index 588504bf9ab4d..dc156039d8ce9 100644
--- a/addons/crm_mail_plugin/models/crm_lead.py
+++ b/addons/crm_mail_plugin/models/crm_lead.py
@@ -4,8 +4,8 @@
from odoo import api, models
-class Lead(models.Model):
- _inherit = 'crm.lead'
+class CrmLead(models.Model):
+ _inherit = ['crm.lead']
@api.model
def _form_view_auto_fill(self):
diff --git a/addons/data_recycle/models/data_recycle_model.py b/addons/data_recycle/models/data_recycle_model.py
index b67409998d062..c980ac14620ed 100644
--- a/addons/data_recycle/models/data_recycle_model.py
+++ b/addons/data_recycle/models/data_recycle_model.py
@@ -17,8 +17,7 @@
DR_CREATE_STEP_MANUAL = 50000
-class DataRecycleModel(models.Model):
- _name = 'data_recycle.model'
+class Data_RecycleModel(models.Model):
_description = 'Recycling Model'
_order = 'name'
diff --git a/addons/data_recycle/models/data_recycle_record.py b/addons/data_recycle/models/data_recycle_record.py
index 5a3a995b29935..46cb4339b8cae 100644
--- a/addons/data_recycle/models/data_recycle_record.py
+++ b/addons/data_recycle/models/data_recycle_record.py
@@ -6,8 +6,7 @@
from odoo import models, api, fields, _
-class DataRecycleRecord(models.Model):
- _name = 'data_recycle.record'
+class Data_RecycleRecord(models.Model):
_description = 'Recycling Record'
active = fields.Boolean('Active', default=True)
diff --git a/addons/delivery/models/delivery_carrier.py b/addons/delivery/models/delivery_carrier.py
index f773da6ab3926..9e513c22cc991 100644
--- a/addons/delivery/models/delivery_carrier.py
+++ b/addons/delivery/models/delivery_carrier.py
@@ -10,7 +10,6 @@
class DeliveryCarrier(models.Model):
- _name = 'delivery.carrier'
_description = "Shipping Methods"
_order = 'sequence, id'
diff --git a/addons/delivery/models/delivery_price_rule.py b/addons/delivery/models/delivery_price_rule.py
index ab381b59ddb0e..21fae9e98244f 100644
--- a/addons/delivery/models/delivery_price_rule.py
+++ b/addons/delivery/models/delivery_price_rule.py
@@ -13,8 +13,7 @@
]
-class PriceRule(models.Model):
- _name = "delivery.price.rule"
+class DeliveryPriceRule(models.Model):
_description = "Delivery Price Rules"
_order = 'sequence, list_price, id'
diff --git a/addons/delivery/models/delivery_zip_prefix.py b/addons/delivery/models/delivery_zip_prefix.py
index 39c88901bcc00..b360cc67e4f82 100644
--- a/addons/delivery/models/delivery_zip_prefix.py
+++ b/addons/delivery/models/delivery_zip_prefix.py
@@ -5,7 +5,6 @@
class DeliveryZipPrefix(models.Model):
""" Zip prefix that a delivery.carrier will deliver to. """
- _name = 'delivery.zip.prefix'
_description = 'Delivery Zip Prefix'
_order = 'name, id'
diff --git a/addons/delivery/models/product_category.py b/addons/delivery/models/product_category.py
index c45f8593b6fe3..b49d58a2be9dc 100644
--- a/addons/delivery/models/product_category.py
+++ b/addons/delivery/models/product_category.py
@@ -6,7 +6,7 @@
class ProductCategory(models.Model):
- _inherit = "product.category"
+ _inherit = ["product.category"]
@api.ondelete(at_uninstall=False)
def _unlink_except_delivery_category(self):
diff --git a/addons/delivery/models/res_partner.py b/addons/delivery/models/res_partner.py
index 42a49c5ae2114..558aa631c850b 100644
--- a/addons/delivery/models/res_partner.py
+++ b/addons/delivery/models/res_partner.py
@@ -4,6 +4,6 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
property_delivery_carrier_id = fields.Many2one('delivery.carrier', company_dependent=True, string="Delivery Method", help="Default delivery method used in sales orders.")
diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py
index b16890bc9639c..a7d3c67a29f74 100644
--- a/addons/delivery/models/sale_order.py
+++ b/addons/delivery/models/sale_order.py
@@ -7,7 +7,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
pickup_location_data = fields.Json()
carrier_id = fields.Many2one('delivery.carrier', string="Delivery Method", check_company=True, help="Fill this field if you plan to invoice the shipping based on picking.")
diff --git a/addons/delivery/models/sale_order_line.py b/addons/delivery/models/sale_order_line.py
index 1406465830e74..21e48aac63892 100644
--- a/addons/delivery/models/sale_order_line.py
+++ b/addons/delivery/models/sale_order_line.py
@@ -4,7 +4,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
is_delivery = fields.Boolean(string="Is a Delivery", default=False)
product_qty = fields.Float(
diff --git a/addons/delivery/wizard/choose_delivery_carrier.py b/addons/delivery/wizard/choose_delivery_carrier.py
index 00206b620fd54..a200ece4647c1 100644
--- a/addons/delivery/wizard/choose_delivery_carrier.py
+++ b/addons/delivery/wizard/choose_delivery_carrier.py
@@ -5,7 +5,6 @@
class ChooseDeliveryCarrier(models.TransientModel):
- _name = 'choose.delivery.carrier'
_description = 'Delivery Carrier Selection Wizard'
def _get_default_weight_uom(self):
diff --git a/addons/delivery_mondialrelay/models/delivery_carrier.py b/addons/delivery_mondialrelay/models/delivery_carrier.py
index 7459300f05640..011ce56421b33 100644
--- a/addons/delivery_mondialrelay/models/delivery_carrier.py
+++ b/addons/delivery_mondialrelay/models/delivery_carrier.py
@@ -5,8 +5,8 @@
from odoo.exceptions import UserError
-class DeliveryCarrierMondialRelay(models.Model):
- _inherit = 'delivery.carrier'
+class DeliveryCarrier(models.Model):
+ _inherit = ['delivery.carrier']
is_mondialrelay = fields.Boolean(compute='_compute_is_mondialrelay', search='_search_is_mondialrelay')
mondialrelay_brand = fields.Char(string='Brand Code', default='BDTEST ')
diff --git a/addons/delivery_mondialrelay/models/res_partner.py b/addons/delivery_mondialrelay/models/res_partner.py
index 3c73479415981..6e63d4848bd29 100644
--- a/addons/delivery_mondialrelay/models/res_partner.py
+++ b/addons/delivery_mondialrelay/models/res_partner.py
@@ -4,8 +4,8 @@
from odoo import fields, models, api
-class ResPartnerMondialRelay(models.Model):
- _inherit = 'res.partner'
+class ResPartner(models.Model):
+ _inherit = ['res.partner']
is_mondialrelay = fields.Boolean(compute='_compute_is_mondialrelay')
diff --git a/addons/delivery_mondialrelay/models/sale_order.py b/addons/delivery_mondialrelay/models/sale_order.py
index c492e31fc5753..9d8a2620e7dba 100644
--- a/addons/delivery_mondialrelay/models/sale_order.py
+++ b/addons/delivery_mondialrelay/models/sale_order.py
@@ -5,8 +5,8 @@
from odoo.exceptions import UserError
-class SaleOrderMondialRelay(models.Model):
- _inherit = 'sale.order'
+class SaleOrder(models.Model):
+ _inherit = ['sale.order']
def action_confirm(self):
unmatch = self.filtered(lambda so: so.carrier_id.is_mondialrelay != so.partner_shipping_id.is_mondialrelay)
diff --git a/addons/delivery_mondialrelay/wizard/choose_delivery_carrier.py b/addons/delivery_mondialrelay/wizard/choose_delivery_carrier.py
index 89f3a5c2de3a3..faa6bdca53dbb 100644
--- a/addons/delivery_mondialrelay/wizard/choose_delivery_carrier.py
+++ b/addons/delivery_mondialrelay/wizard/choose_delivery_carrier.py
@@ -7,7 +7,7 @@
class ChooseDeliveryCarrier(models.TransientModel):
- _inherit = 'choose.delivery.carrier'
+ _inherit = ['choose.delivery.carrier']
shipping_zip = fields.Char(related='order_id.partner_shipping_id.zip')
shipping_country_code = fields.Char(related='order_id.partner_shipping_id.country_id.code')
diff --git a/addons/delivery_stock_picking_batch/models/stock_picking.py b/addons/delivery_stock_picking_batch/models/stock_picking.py
index 04bd7fdf01d20..2ee7df7f93e35 100644
--- a/addons/delivery_stock_picking_batch/models/stock_picking.py
+++ b/addons/delivery_stock_picking_batch/models/stock_picking.py
@@ -6,7 +6,7 @@
class StockPickingType(models.Model):
- _inherit = "stock.picking.type"
+ _inherit = ["stock.picking.type"]
def _get_default_weight_uom(self):
return self.env['product.template']._get_weight_uom_name_from_ir_config_parameter()
@@ -27,7 +27,7 @@ def _get_batch_group_by_keys(self):
class StockPicking(models.Model):
- _inherit = "stock.picking"
+ _inherit = ["stock.picking"]
def _get_possible_pickings_domain(self):
domain = super()._get_possible_pickings_domain()
diff --git a/addons/delivery_stock_picking_batch/models/stock_picking_batch.py b/addons/delivery_stock_picking_batch/models/stock_picking_batch.py
index 03c92fda06c9d..01bbb7aa26b15 100644
--- a/addons/delivery_stock_picking_batch/models/stock_picking_batch.py
+++ b/addons/delivery_stock_picking_batch/models/stock_picking_batch.py
@@ -3,8 +3,9 @@
from odoo import models
+
class StockPickingBatch(models.Model):
- _inherit = "stock.picking.batch"
+ _inherit = ["stock.picking.batch"]
def _is_picking_auto_mergeable(self, picking):
""" Verifies if a picking can be safely inserted into the batch without violating auto_batch_constrains.
diff --git a/addons/digest/models/digest.py b/addons/digest/models/digest.py
index bf652856442f5..cdfbc8db8a6cc 100644
--- a/addons/digest/models/digest.py
+++ b/addons/digest/models/digest.py
@@ -18,8 +18,7 @@
_logger = logging.getLogger(__name__)
-class Digest(models.Model):
- _name = 'digest.digest'
+class DigestDigest(models.Model):
_description = 'Digest'
# Digest description
diff --git a/addons/digest/models/digest_tip.py b/addons/digest/models/digest_tip.py
index 8c0208db9ad28..b1db2a698858e 100644
--- a/addons/digest/models/digest_tip.py
+++ b/addons/digest/models/digest_tip.py
@@ -5,7 +5,6 @@
class DigestTip(models.Model):
- _name = 'digest.tip'
_description = 'Digest Tips'
_order = 'sequence'
diff --git a/addons/digest/models/res_config_settings.py b/addons/digest/models/res_config_settings.py
index 59f13bdff4ec4..5a64aa6fce9df 100644
--- a/addons/digest/models/res_config_settings.py
+++ b/addons/digest/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
digest_emails = fields.Boolean(string="Digest Emails", config_parameter='digest.default_digest_emails')
digest_id = fields.Many2one('digest.digest', string='Digest Email', config_parameter='digest.default_digest_id')
diff --git a/addons/digest/models/res_users.py b/addons/digest/models/res_users.py
index 4488455454832..f50a1d34e12c5 100644
--- a/addons/digest/models/res_users.py
+++ b/addons/digest/models/res_users.py
@@ -4,7 +4,7 @@
class ResUsers(models.Model):
- _inherit = "res.users"
+ _inherit = ["res.users"]
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/event/models/event_event.py b/addons/event/models/event_event.py
index 5af7ffe833fd0..57f0978f4bd3b 100644
--- a/addons/event/models/event_event.py
+++ b/addons/event/models/event_event.py
@@ -27,7 +27,6 @@
class EventType(models.Model):
- _name = 'event.type'
_description = 'Event Template'
_order = 'sequence, id'
@@ -92,7 +91,6 @@ def _compute_seats_max(self):
class EventEvent(models.Model):
"""Event"""
- _name = 'event.event'
_description = 'Event'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'date_begin, id'
diff --git a/addons/event/models/event_mail.py b/addons/event/models/event_mail.py
index 576b1b75fad42..926861cd21a23 100644
--- a/addons/event/models/event_mail.py
+++ b/addons/event/models/event_mail.py
@@ -23,10 +23,10 @@
'now': lambda interval: relativedelta(hours=0),
}
+
class EventTypeMail(models.Model):
""" Template of event.mail to attach to event.type. Those will be copied
upon all events created in that type to ease event creation. """
- _name = 'event.type.mail'
_description = 'Mail Scheduling on Event Category'
event_type_id = fields.Many2one(
@@ -60,11 +60,11 @@ def _prepare_event_mail_values(self):
'template_ref': '%s,%i' % (self.template_ref._name, self.template_ref.id),
}
-class EventMailScheduler(models.Model):
+
+class EventMail(models.Model):
""" Event automated mailing. This model replaces all existing fields and
configuration allowing to send emails on events since Odoo 9. A cron exists
that periodically checks for mailing to run. """
- _name = 'event.mail'
_rec_name = 'event_id'
_description = 'Event Automated Mailing'
diff --git a/addons/event/models/event_mail_registration.py b/addons/event/models/event_mail_registration.py
index b5f2a8635edbd..3b751ba090be8 100644
--- a/addons/event/models/event_mail_registration.py
+++ b/addons/event/models/event_mail_registration.py
@@ -9,7 +9,6 @@
class EventMailRegistration(models.Model):
- _name = 'event.mail.registration'
_description = 'Registration Mail Scheduler'
_rec_name = 'scheduler_id'
_order = 'scheduled_date DESC, id ASC'
diff --git a/addons/event/models/event_question.py b/addons/event/models/event_question.py
index d93b7f6477f4c..31ec78f1c3629 100644
--- a/addons/event/models/event_question.py
+++ b/addons/event/models/event_question.py
@@ -5,7 +5,6 @@
class EventQuestion(models.Model):
- _name = 'event.question'
_rec_name = 'title'
_order = 'sequence,id'
_description = 'Event Question'
diff --git a/addons/event/models/event_question_answer.py b/addons/event/models/event_question_answer.py
index b6005b3ebd721..fbe097240d6f4 100644
--- a/addons/event/models/event_question_answer.py
+++ b/addons/event/models/event_question_answer.py
@@ -7,7 +7,6 @@
class EventQuestionAnswer(models.Model):
""" Contains suggested answers to a 'simple_choice' event.question. """
- _name = 'event.question.answer'
_order = 'sequence,id'
_description = 'Event Question Answer'
diff --git a/addons/event/models/event_registration.py b/addons/event/models/event_registration.py
index 5568f85453078..f568e15b6dc5a 100644
--- a/addons/event/models/event_registration.py
+++ b/addons/event/models/event_registration.py
@@ -11,7 +11,6 @@
class EventRegistration(models.Model):
- _name = 'event.registration'
_description = 'Event Registration'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'id desc'
diff --git a/addons/event/models/event_registration_answer.py b/addons/event/models/event_registration_answer.py
index ecac2abc24d7b..d11d9380f0f62 100644
--- a/addons/event/models/event_registration_answer.py
+++ b/addons/event/models/event_registration_answer.py
@@ -6,7 +6,6 @@
class EventRegistrationAnswer(models.Model):
""" Represents the user input answer for a single event.question """
- _name = 'event.registration.answer'
_description = 'Event Registration Answer'
_rec_names_search = ['value_answer_id', 'value_text_box']
diff --git a/addons/event/models/event_stage.py b/addons/event/models/event_stage.py
index 6f7c6f3fcd791..c290e343356a4 100644
--- a/addons/event/models/event_stage.py
+++ b/addons/event/models/event_stage.py
@@ -5,7 +5,6 @@
class EventStage(models.Model):
- _name = 'event.stage'
_description = 'Event Stage'
_order = 'sequence, name'
diff --git a/addons/event/models/event_tag.py b/addons/event/models/event_tag.py
index 64c9d993e95f4..0ac1f90873293 100644
--- a/addons/event/models/event_tag.py
+++ b/addons/event/models/event_tag.py
@@ -7,7 +7,6 @@
class EventTagCategory(models.Model):
- _name = "event.tag.category"
_description = "Event Tag Category"
_order = "sequence"
@@ -25,7 +24,6 @@ def _default_sequence(self):
class EventTag(models.Model):
- _name = "event.tag"
_description = "Event Tag"
_order = "category_sequence, sequence, id"
diff --git a/addons/event/models/event_ticket.py b/addons/event/models/event_ticket.py
index affd82fe22480..c961c7bb3f520 100644
--- a/addons/event/models/event_ticket.py
+++ b/addons/event/models/event_ticket.py
@@ -8,8 +8,7 @@
from odoo.tools.misc import formatLang
-class EventTemplateTicket(models.Model):
- _name = 'event.type.ticket'
+class EventTypeTicket(models.Model):
_description = 'Event Template Ticket'
_order = 'sequence, name, id'
@@ -43,19 +42,18 @@ def _get_event_ticket_fields_whitelist(self):
return ['sequence', 'name', 'description', 'seats_max']
-class EventTicket(models.Model):
+class EventEventTicket(models.Model):
""" Ticket model allowing to have different kind of registrations for a given
event. Ticket are based on ticket type as they share some common fields
and behavior. Those models come from <= v13 Odoo event.event.ticket that
modeled both concept: tickets for event templates, and tickets for events. """
- _name = 'event.event.ticket'
- _inherit = 'event.type.ticket'
+ _inherit = ['event.type.ticket']
_description = 'Event Ticket'
_order = "event_id, sequence, name, id"
@api.model
def default_get(self, fields):
- res = super(EventTicket, self).default_get(fields)
+ res = super().default_get(fields)
if 'name' in fields and (not res.get('name') or res['name'] == _('Registration')) and self.env.context.get('default_event_name'):
res['name'] = _('Registration for %s', self.env.context['default_event_name'])
return res
diff --git a/addons/event/models/mail_template.py b/addons/event/models/mail_template.py
index 8d1b5fa290458..1071f397419dd 100644
--- a/addons/event/models/mail_template.py
+++ b/addons/event/models/mail_template.py
@@ -6,7 +6,7 @@
class MailTemplate(models.Model):
- _inherit = 'mail.template'
+ _inherit = ['mail.template']
@api.model
def _search_display_name(self, operator, value):
diff --git a/addons/event/models/res_config_settings.py b/addons/event/models/res_config_settings.py
index 8691b667af97f..aa16a90e129e4 100644
--- a/addons/event/models/res_config_settings.py
+++ b/addons/event/models/res_config_settings.py
@@ -6,8 +6,9 @@
from odoo import _, api, exceptions, fields, models
+
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
def _default_use_google_maps_static_api(self):
api_key = self.env['ir.config_parameter'].sudo().get_param('google_maps.signed_static_api_key')
diff --git a/addons/event/models/res_partner.py b/addons/event/models/res_partner.py
index 191e9193450ac..9726d80d8569b 100644
--- a/addons/event/models/res_partner.py
+++ b/addons/event/models/res_partner.py
@@ -12,7 +12,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
event_count = fields.Integer(
'# Events', compute='_compute_event_count', groups='event.group_event_registration_desk')
diff --git a/addons/event_booth/models/event_booth.py b/addons/event_booth/models/event_booth.py
index 498ae4b05ebc6..62734d17540fc 100644
--- a/addons/event_booth/models/event_booth.py
+++ b/addons/event_booth/models/event_booth.py
@@ -6,7 +6,6 @@
class EventBooth(models.Model):
- _name = 'event.booth'
_description = 'Event Booth'
_inherit = [
'event.type.booth',
diff --git a/addons/event_booth/models/event_booth_category.py b/addons/event_booth/models/event_booth_category.py
index be27ceaf5d039..eeb4320de4d1c 100644
--- a/addons/event_booth/models/event_booth_category.py
+++ b/addons/event_booth/models/event_booth_category.py
@@ -5,7 +5,6 @@
class EventBoothCategory(models.Model):
- _name = 'event.booth.category'
_description = 'Event Booth Category'
_inherit = ['image.mixin']
_order = 'sequence ASC'
diff --git a/addons/event_booth/models/event_event.py b/addons/event_booth/models/event_event.py
index 207be9185c7af..104c0b7abb7c2 100644
--- a/addons/event_booth/models/event_event.py
+++ b/addons/event_booth/models/event_event.py
@@ -6,8 +6,8 @@
from odoo import Command
-class Event(models.Model):
- _inherit = 'event.event'
+class EventEvent(models.Model):
+ _inherit = ['event.event']
event_booth_ids = fields.One2many(
'event.booth', 'event_id', string='Booths', copy=True,
diff --git a/addons/event_booth/models/event_type.py b/addons/event_booth/models/event_type.py
index e557aa1f7a1a5..24347cac9acb2 100644
--- a/addons/event_booth/models/event_type.py
+++ b/addons/event_booth/models/event_type.py
@@ -5,7 +5,7 @@
class EventType(models.Model):
- _inherit = 'event.type'
+ _inherit = ['event.type']
event_type_booth_ids = fields.One2many(
'event.type.booth', 'event_type_id',
diff --git a/addons/event_booth/models/event_type_booth.py b/addons/event_booth/models/event_type_booth.py
index 2c8fe63696066..ef590462625e5 100644
--- a/addons/event_booth/models/event_type_booth.py
+++ b/addons/event_booth/models/event_type_booth.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class EventBooth(models.Model):
- _name = 'event.type.booth'
+class EventTypeBooth(models.Model):
_description = 'Event Booth Template'
def _get_default_booth_category(self):
diff --git a/addons/event_booth_sale/models/account_move.py b/addons/event_booth_sale/models/account_move.py
index 4c8ae8220f17d..a4c92fc596e38 100644
--- a/addons/event_booth_sale/models/account_move.py
+++ b/addons/event_booth_sale/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _invoice_paid_hook(self):
""" When an invoice linked to a sales order selling registrations is
diff --git a/addons/event_booth_sale/models/event_booth.py b/addons/event_booth_sale/models/event_booth.py
index ecf1ea26f48b4..30e14c1c3e5dd 100644
--- a/addons/event_booth_sale/models/event_booth.py
+++ b/addons/event_booth_sale/models/event_booth.py
@@ -6,7 +6,7 @@
class EventBooth(models.Model):
- _inherit = 'event.booth'
+ _inherit = ['event.booth']
# registrations
event_booth_registration_ids = fields.One2many('event.booth.registration', 'event_booth_id')
diff --git a/addons/event_booth_sale/models/event_booth_category.py b/addons/event_booth_sale/models/event_booth_category.py
index ff3d6cb16e63e..a8876b1c0f538 100644
--- a/addons/event_booth_sale/models/event_booth_category.py
+++ b/addons/event_booth_sale/models/event_booth_category.py
@@ -10,7 +10,7 @@
class EventBoothCategory(models.Model):
- _inherit = 'event.booth.category'
+ _inherit = ['event.booth.category']
def _default_product_id(self):
return self.env.ref('event_booth_sale.product_product_event_booth', raise_if_not_found=False)
diff --git a/addons/event_booth_sale/models/event_booth_registration.py b/addons/event_booth_sale/models/event_booth_registration.py
index 3f0b160636d69..0e3a40a9cb745 100644
--- a/addons/event_booth_sale/models/event_booth_registration.py
+++ b/addons/event_booth_sale/models/event_booth_registration.py
@@ -9,7 +9,6 @@ class EventBoothRegistration(models.Model):
"""event.booth.registrations are used to allow multiple partners to book the same booth.
Whenever a partner has paid their registration all the others linked to the booth will be deleted."""
- _name = 'event.booth.registration'
_description = 'Event Booth Registration'
sale_order_line_id = fields.Many2one('sale.order.line', string='Sale Order Line', required=True, ondelete='cascade')
diff --git a/addons/event_booth_sale/models/event_type_booth.py b/addons/event_booth_sale/models/event_type_booth.py
index 397a6ed4b057f..7cfabcd835924 100644
--- a/addons/event_booth_sale/models/event_type_booth.py
+++ b/addons/event_booth_sale/models/event_type_booth.py
@@ -5,7 +5,7 @@
class EventTypeBooth(models.Model):
- _inherit = 'event.type.booth'
+ _inherit = ['event.type.booth']
product_id = fields.Many2one(related='booth_category_id.product_id')
price = fields.Float(related='booth_category_id.price', store=True)
diff --git a/addons/event_booth_sale/models/product_product.py b/addons/event_booth_sale/models/product_product.py
index 9cdae22245d6d..ce8d118cd9ca1 100644
--- a/addons/event_booth_sale/models/product_product.py
+++ b/addons/event_booth_sale/models/product_product.py
@@ -1,8 +1,8 @@
from odoo import api, models
-class Product(models.Model):
- _inherit = 'product.product'
+class ProductProduct(models.Model):
+ _inherit = ['product.product']
@api.onchange('service_tracking')
def _onchange_type_event_booth(self):
diff --git a/addons/event_booth_sale/models/product_template.py b/addons/event_booth_sale/models/product_template.py
index bc505d7253fa9..46530ba5a5537 100644
--- a/addons/event_booth_sale/models/product_template.py
+++ b/addons/event_booth_sale/models/product_template.py
@@ -2,7 +2,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
service_tracking = fields.Selection(selection_add=[
('event_booth', 'Event Booth'),
diff --git a/addons/event_booth_sale/models/sale_order.py b/addons/event_booth_sale/models/sale_order.py
index c0a0343dc40a6..6223b1b1a30f2 100644
--- a/addons/event_booth_sale/models/sale_order.py
+++ b/addons/event_booth_sale/models/sale_order.py
@@ -7,7 +7,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
event_booth_ids = fields.One2many('event.booth', 'sale_order_id', string='Booths')
event_booth_count = fields.Integer(string='Booth Count', compute='_compute_event_booth_count')
diff --git a/addons/event_booth_sale/models/sale_order_line.py b/addons/event_booth_sale/models/sale_order_line.py
index 431353eac65bf..6c0944bcb93c6 100644
--- a/addons/event_booth_sale/models/sale_order_line.py
+++ b/addons/event_booth_sale/models/sale_order_line.py
@@ -6,7 +6,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
event_booth_category_id = fields.Many2one('event.booth.category', string='Booths Category', ondelete='set null')
event_booth_pending_ids = fields.Many2many(
diff --git a/addons/event_booth_sale/wizard/event_booth_configurator.py b/addons/event_booth_sale/wizard/event_booth_configurator.py
index c53986305cebe..b5732f5abc3d0 100644
--- a/addons/event_booth_sale/wizard/event_booth_configurator.py
+++ b/addons/event_booth_sale/wizard/event_booth_configurator.py
@@ -6,7 +6,6 @@
class EventBoothConfigurator(models.TransientModel):
- _name = 'event.booth.configurator'
_description = 'Event Booth Configurator'
product_id = fields.Many2one('product.product', string='Product', readonly=True)
diff --git a/addons/event_crm/models/crm_lead.py b/addons/event_crm/models/crm_lead.py
index 07a67e90f4d90..99b34d1c19c72 100644
--- a/addons/event_crm/models/crm_lead.py
+++ b/addons/event_crm/models/crm_lead.py
@@ -4,8 +4,8 @@
from odoo import fields, models, api
-class Lead(models.Model):
- _inherit = 'crm.lead'
+class CrmLead(models.Model):
+ _inherit = ['crm.lead']
event_lead_rule_id = fields.Many2one('event.lead.rule', string="Registration Rule", help="Rule that created this lead")
event_id = fields.Many2one('event.event', string="Source Event", help="Event triggering the rule that created this lead")
@@ -24,7 +24,7 @@ def _compute_registration_count(self):
record.registration_count = len(record.registration_ids)
def _merge_dependences(self, opportunities):
- super(Lead, self)._merge_dependences(opportunities)
+ super()._merge_dependences(opportunities)
# merge registrations as sudo, as crm people may not have access to event rights
self.sudo().write({
@@ -32,4 +32,4 @@ def _merge_dependences(self, opportunities):
})
def _merge_get_fields(self):
- return super(Lead, self)._merge_get_fields() + ['event_lead_rule_id', 'event_id']
+ return super()._merge_get_fields() + ['event_lead_rule_id', 'event_id']
diff --git a/addons/event_crm/models/event_event.py b/addons/event_crm/models/event_event.py
index 301d507b7c7d1..b3ecc0afa2f1b 100644
--- a/addons/event_crm/models/event_event.py
+++ b/addons/event_crm/models/event_event.py
@@ -4,9 +4,9 @@
from odoo import _, api, fields, models
from odoo.exceptions import UserError
+
class EventEvent(models.Model):
- _name = "event.event"
- _inherit = "event.event"
+ _inherit = ["event.event"]
lead_ids = fields.One2many(
'crm.lead', 'event_id', string="Leads", groups='sales_team.group_sale_salesman',
diff --git a/addons/event_crm/models/event_lead_request.py b/addons/event_crm/models/event_lead_request.py
index 764d091ca9d1d..9f8f4c5b45288 100644
--- a/addons/event_crm/models/event_lead_request.py
+++ b/addons/event_crm/models/event_lead_request.py
@@ -15,7 +15,6 @@ class EventLeadRequest(models.Model):
To benefit from a background processing, we use a CRON that calls itself with a CRON trigger
until the batch is completed, which unlinks this technical generation record. """
- _name = "event.lead.request"
_description = "Event Lead Request"
_log_access = False
_rec_name = "event_id"
diff --git a/addons/event_crm/models/event_lead_rule.py b/addons/event_crm/models/event_lead_rule.py
index 37118619ab694..8b2f29907a7df 100644
--- a/addons/event_crm/models/event_lead_rule.py
+++ b/addons/event_crm/models/event_lead_rule.py
@@ -64,7 +64,6 @@ class EventLeadRule(models.Model):
intended in order to give more freedom to the user using the automatic
lead generation.
"""
- _name = "event.lead.rule"
_description = "Event Lead Rules"
# Definition
diff --git a/addons/event_crm/models/event_registration.py b/addons/event_crm/models/event_registration.py
index 5c39c4c213c32..2b90aea7281c0 100644
--- a/addons/event_crm/models/event_registration.py
+++ b/addons/event_crm/models/event_registration.py
@@ -9,7 +9,7 @@
class EventRegistration(models.Model):
- _inherit = 'event.registration'
+ _inherit = ['event.registration']
lead_ids = fields.Many2many(
'crm.lead', string='Leads', copy=False, readonly=True,
diff --git a/addons/event_crm_sale/models/event_registration.py b/addons/event_crm_sale/models/event_registration.py
index 480d4a0e41f20..fb70d5c283d2a 100644
--- a/addons/event_crm_sale/models/event_registration.py
+++ b/addons/event_crm_sale/models/event_registration.py
@@ -7,7 +7,7 @@
class EventRegistration(models.Model):
- _inherit = 'event.registration'
+ _inherit = ['event.registration']
def _get_lead_grouping(self, rules, rule_to_new_regs):
""" Override to support sale-order based grouping and update.
diff --git a/addons/event_product/models/event_event.py b/addons/event_product/models/event_event.py
index 61957e6de91ba..aa4029e56c91a 100644
--- a/addons/event_product/models/event_event.py
+++ b/addons/event_product/models/event_event.py
@@ -1,8 +1,8 @@
from odoo import fields, models
-class Event(models.Model):
- _inherit = 'event.event'
+class EventEvent(models.Model):
+ _inherit = ['event.event']
currency_id = fields.Many2one(
'res.currency', string='Currency',
diff --git a/addons/event_product/models/event_event_ticket.py b/addons/event_product/models/event_event_ticket.py
index b50bdfae6044d..5755791b4abca 100644
--- a/addons/event_product/models/event_event_ticket.py
+++ b/addons/event_product/models/event_event_ticket.py
@@ -2,8 +2,8 @@
from odoo import api, models, fields
-class EventTicket(models.Model):
- _inherit = 'event.event.ticket'
+class EventEventTicket(models.Model):
+ _inherit = ['event.event.ticket']
_order = "event_id, sequence, price, name, id"
price_reduce_taxinc = fields.Float(
@@ -18,7 +18,7 @@ def _compute_sale_available(self):
inactive_product_tickets = self.filtered(lambda ticket: not ticket.product_id.active)
for ticket in inactive_product_tickets:
ticket.sale_available = False
- super(EventTicket, self - inactive_product_tickets)._compute_sale_available()
+ super(EventEventTicket, self - inactive_product_tickets)._compute_sale_available()
def _compute_price_reduce_taxinc(self):
for event in self:
diff --git a/addons/event_product/models/event_type_ticket.py b/addons/event_product/models/event_type_ticket.py
index 467708f9d8f65..d579f97b20993 100644
--- a/addons/event_product/models/event_type_ticket.py
+++ b/addons/event_product/models/event_type_ticket.py
@@ -8,8 +8,8 @@
_logger = logging.getLogger(__name__)
-class EventTemplateTicket(models.Model):
- _inherit = 'event.type.ticket'
+class EventTypeTicket(models.Model):
+ _inherit = ['event.type.ticket']
_order = "sequence, price, name, id"
def _default_product_id(self):
diff --git a/addons/event_product/models/product_product.py b/addons/event_product/models/product_product.py
index 6d59dc65ccece..d0e17ed2268bc 100644
--- a/addons/event_product/models/product_product.py
+++ b/addons/event_product/models/product_product.py
@@ -1,7 +1,7 @@
from odoo import fields, models
-class Product(models.Model):
- _inherit = 'product.product'
+class ProductProduct(models.Model):
+ _inherit = ['product.product']
event_ticket_ids = fields.One2many('event.event.ticket', 'product_id', string='Event Tickets')
diff --git a/addons/event_product/models/product_template.py b/addons/event_product/models/product_template.py
index 1a09a8428e020..f55a111f7144a 100644
--- a/addons/event_product/models/product_template.py
+++ b/addons/event_product/models/product_template.py
@@ -2,7 +2,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
service_tracking = fields.Selection(selection_add=[
('event', 'Event Registration'),
diff --git a/addons/event_sale/models/event_event.py b/addons/event_sale/models/event_event.py
index bcb40ef356f09..7c5da79dcf466 100644
--- a/addons/event_sale/models/event_event.py
+++ b/addons/event_sale/models/event_event.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Event(models.Model):
- _inherit = 'event.event'
+class EventEvent(models.Model):
+ _inherit = ['event.event']
sale_order_lines_ids = fields.One2many(
'sale.order.line', 'event_id',
diff --git a/addons/event_sale/models/event_registration.py b/addons/event_sale/models/event_registration.py
index a67e81efd5ebb..3073f7b1663fc 100644
--- a/addons/event_sale/models/event_registration.py
+++ b/addons/event_sale/models/event_registration.py
@@ -6,7 +6,7 @@
class EventRegistration(models.Model):
- _inherit = 'event.registration'
+ _inherit = ['event.registration']
# TDE FIXME: maybe add an onchange on sale_order_id
sale_order_id = fields.Many2one('sale.order', string='Sales Order', ondelete='cascade', copy=False)
diff --git a/addons/event_sale/models/event_ticket.py b/addons/event_sale/models/event_ticket.py
index 05dd06c2339b3..3a68af4191446 100644
--- a/addons/event_sale/models/event_ticket.py
+++ b/addons/event_sale/models/event_ticket.py
@@ -1,8 +1,8 @@
from odoo import models
-class EventTicket(models.Model):
- _inherit = 'event.event.ticket'
+class EventEventTicket(models.Model):
+ _inherit = ['event.event.ticket']
_order = "event_id, sequence, price, name, id"
def _get_ticket_multiline_description(self):
@@ -11,4 +11,4 @@ def _get_ticket_multiline_description(self):
self.ensure_one()
if self.product_id.description_sale:
return '%s\n%s' % (self.product_id.description_sale, self.event_id.display_name)
- return super(EventTicket, self)._get_ticket_multiline_description()
+ return super()._get_ticket_multiline_description()
diff --git a/addons/event_sale/models/product_template.py b/addons/event_sale/models/product_template.py
index bf75ae80adf6c..9de145a1ab86f 100644
--- a/addons/event_sale/models/product_template.py
+++ b/addons/event_sale/models/product_template.py
@@ -2,7 +2,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
def _prepare_service_tracking_tooltip(self):
if self.service_tracking == 'event':
diff --git a/addons/event_sale/models/sale_order.py b/addons/event_sale/models/sale_order.py
index 7c614a9ad95b8..139f57d4d8439 100644
--- a/addons/event_sale/models/sale_order.py
+++ b/addons/event_sale/models/sale_order.py
@@ -8,7 +8,7 @@
class SaleOrder(models.Model):
- _inherit = "sale.order"
+ _inherit = ["sale.order"]
attendee_count = fields.Integer('Attendee Count', compute='_compute_attendee_count')
diff --git a/addons/event_sale/models/sale_order_line.py b/addons/event_sale/models/sale_order_line.py
index 0e8f2a739f5b7..b4a29949c9ea1 100644
--- a/addons/event_sale/models/sale_order_line.py
+++ b/addons/event_sale/models/sale_order_line.py
@@ -5,7 +5,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
event_id = fields.Many2one(
'event.event', string='Event',
diff --git a/addons/event_sale/report/event_sale_report.py b/addons/event_sale/report/event_sale_report.py
index 1fd4f8c56a780..c4dcbad8079f5 100644
--- a/addons/event_sale/report/event_sale_report.py
+++ b/addons/event_sale/report/event_sale_report.py
@@ -8,7 +8,6 @@
class EventSaleReport(models.Model):
"""Event Registrations-based sales report, allowing to analyze sales and number of seats
by event (type), ticket, etc. Each opened record will also give access to all this information."""
- _name = 'event.sale.report'
_description = 'Event Sales Report'
_auto = False
_rec_name = 'sale_order_line_id'
diff --git a/addons/event_sale/wizard/event_configurator.py b/addons/event_sale/wizard/event_configurator.py
index 1dd68d73ce434..270e7b60f7ff5 100644
--- a/addons/event_sale/wizard/event_configurator.py
+++ b/addons/event_sale/wizard/event_configurator.py
@@ -5,8 +5,7 @@
from odoo.exceptions import ValidationError
-class EventConfigurator(models.TransientModel):
- _name = 'event.event.configurator'
+class EventEventConfigurator(models.TransientModel):
_description = 'Event Configurator'
product_id = fields.Many2one('product.product', string="Product", readonly=True)
diff --git a/addons/event_sale/wizard/event_edit_registration.py b/addons/event_sale/wizard/event_edit_registration.py
index 55aae28ac0f41..17ced8f2974fb 100644
--- a/addons/event_sale/wizard/event_edit_registration.py
+++ b/addons/event_sale/wizard/event_edit_registration.py
@@ -7,7 +7,6 @@
class RegistrationEditor(models.TransientModel):
- _name = "registration.editor"
_description = 'Edit Attendee Details on Sales Confirmation'
sale_order_id = fields.Many2one('sale.order', 'Sales Order', required=True, ondelete='cascade')
@@ -69,7 +68,6 @@ def action_make_registration(self):
class RegistrationEditorLine(models.TransientModel):
"""Event Registration"""
- _name = "registration.editor.line"
_description = 'Edit Attendee Line on Sales Confirmation'
_order = "id desc"
diff --git a/addons/event_sms/models/event_mail.py b/addons/event_sms/models/event_mail.py
index 133a0e25da1b4..423f1c0a5ce95 100644
--- a/addons/event_sms/models/event_mail.py
+++ b/addons/event_sms/models/event_mail.py
@@ -5,7 +5,7 @@
class EventTypeMail(models.Model):
- _inherit = 'event.type.mail'
+ _inherit = ['event.type.mail']
notification_type = fields.Selection(selection_add=[('sms', 'SMS')])
template_ref = fields.Reference(ondelete={'sms.template': 'cascade'}, selection_add=[('sms.template', 'SMS')])
@@ -16,8 +16,8 @@ def _compute_notification_type(self):
sms_schedulers.notification_type = 'sms'
-class EventMailScheduler(models.Model):
- _inherit = 'event.mail'
+class EventMail(models.Model):
+ _inherit = ['event.mail']
notification_type = fields.Selection(selection_add=[('sms', 'SMS')])
template_ref = fields.Reference(ondelete={'sms.template': 'cascade'}, selection_add=[('sms.template', 'SMS')])
diff --git a/addons/event_sms/models/event_mail_registration.py b/addons/event_sms/models/event_mail_registration.py
index e1ad66c4edb1f..5851ac1122929 100644
--- a/addons/event_sms/models/event_mail_registration.py
+++ b/addons/event_sms/models/event_mail_registration.py
@@ -2,7 +2,7 @@
class EventMailRegistration(models.Model):
- _inherit = 'event.mail.registration'
+ _inherit = ['event.mail.registration']
def _execute_on_registrations(self):
todo = self.filtered(
diff --git a/addons/event_sms/models/sms_template.py b/addons/event_sms/models/sms_template.py
index 333ba5aaa2e4d..01da17321655b 100644
--- a/addons/event_sms/models/sms_template.py
+++ b/addons/event_sms/models/sms_template.py
@@ -6,7 +6,7 @@
class SmsTemplate(models.Model):
- _inherit = 'sms.template'
+ _inherit = ['sms.template']
@api.model
def _search_display_name(self, operator, value):
diff --git a/addons/fleet/models/fleet_service_type.py b/addons/fleet/models/fleet_service_type.py
index 686124d800499..b2df033abaa4d 100644
--- a/addons/fleet/models/fleet_service_type.py
+++ b/addons/fleet/models/fleet_service_type.py
@@ -5,7 +5,6 @@
class FleetServiceType(models.Model):
- _name = 'fleet.service.type'
_description = 'Fleet Service Type'
_order = 'name'
diff --git a/addons/fleet/models/fleet_vehicle.py b/addons/fleet/models/fleet_vehicle.py
index 6705fad0a64c2..f998e4fa37d92 100644
--- a/addons/fleet/models/fleet_vehicle.py
+++ b/addons/fleet/models/fleet_vehicle.py
@@ -18,9 +18,9 @@
'vehicle_range': 'vehicle_range', 'power_unit': 'power_unit'
}
+
class FleetVehicle(models.Model):
_inherit = ['mail.thread', 'mail.activity.mixin', 'avatar.mixin']
- _name = 'fleet.vehicle'
_description = 'Vehicle'
_order = 'license_plate asc, acquisition_date asc'
_rec_names_search = ['name', 'driver_id.name']
diff --git a/addons/fleet/models/fleet_vehicle_assignation_log.py b/addons/fleet/models/fleet_vehicle_assignation_log.py
index fa05ba6deb0bd..a908d54752bb1 100644
--- a/addons/fleet/models/fleet_vehicle_assignation_log.py
+++ b/addons/fleet/models/fleet_vehicle_assignation_log.py
@@ -5,7 +5,6 @@
class FleetVehicleAssignationLog(models.Model):
- _name = "fleet.vehicle.assignation.log"
_description = "Drivers history on a vehicle"
_order = "create_date desc, date_start desc"
diff --git a/addons/fleet/models/fleet_vehicle_log_contract.py b/addons/fleet/models/fleet_vehicle_log_contract.py
index 0cfc71fbe4c81..52b2ff3bafcb2 100644
--- a/addons/fleet/models/fleet_vehicle_log_contract.py
+++ b/addons/fleet/models/fleet_vehicle_log_contract.py
@@ -8,7 +8,6 @@
class FleetVehicleLogContract(models.Model):
_inherit = ['mail.thread', 'mail.activity.mixin']
- _name = 'fleet.vehicle.log.contract'
_description = 'Vehicle Contract'
_order = 'state desc,expiration_date'
diff --git a/addons/fleet/models/fleet_vehicle_log_services.py b/addons/fleet/models/fleet_vehicle_log_services.py
index b5a1c4d83de23..e635a10a45100 100644
--- a/addons/fleet/models/fleet_vehicle_log_services.py
+++ b/addons/fleet/models/fleet_vehicle_log_services.py
@@ -6,7 +6,6 @@
class FleetVehicleLogServices(models.Model):
- _name = 'fleet.vehicle.log.services'
_inherit = ['mail.thread', 'mail.activity.mixin']
_rec_name = 'service_type_id'
_description = 'Services for vehicles'
diff --git a/addons/fleet/models/fleet_vehicle_model.py b/addons/fleet/models/fleet_vehicle_model.py
index 2a631e9a2602c..73ef173e46d70 100644
--- a/addons/fleet/models/fleet_vehicle_model.py
+++ b/addons/fleet/models/fleet_vehicle_model.py
@@ -17,8 +17,8 @@
('electric', 'Electric'),
]
+
class FleetVehicleModel(models.Model):
- _name = 'fleet.vehicle.model'
_inherit = ['mail.thread', 'mail.activity.mixin', 'avatar.mixin']
_description = 'Model of a vehicle'
_order = 'name asc'
diff --git a/addons/fleet/models/fleet_vehicle_model_brand.py b/addons/fleet/models/fleet_vehicle_model_brand.py
index be6f38f973d92..57ac3a264a99a 100644
--- a/addons/fleet/models/fleet_vehicle_model_brand.py
+++ b/addons/fleet/models/fleet_vehicle_model_brand.py
@@ -5,7 +5,6 @@
class FleetVehicleModelBrand(models.Model):
- _name = 'fleet.vehicle.model.brand'
_description = 'Brand of the vehicle'
_order = 'name asc'
diff --git a/addons/fleet/models/fleet_vehicle_model_category.py b/addons/fleet/models/fleet_vehicle_model_category.py
index 587ee63ffe65c..784154c6d4e22 100644
--- a/addons/fleet/models/fleet_vehicle_model_category.py
+++ b/addons/fleet/models/fleet_vehicle_model_category.py
@@ -5,7 +5,6 @@
class FleetVehicleModelCategory(models.Model):
- _name = 'fleet.vehicle.model.category'
_description = 'Category of the model'
_order = 'sequence asc, id asc'
diff --git a/addons/fleet/models/fleet_vehicle_odometer.py b/addons/fleet/models/fleet_vehicle_odometer.py
index 3ea6e8fcf5933..b6b06526e5d36 100644
--- a/addons/fleet/models/fleet_vehicle_odometer.py
+++ b/addons/fleet/models/fleet_vehicle_odometer.py
@@ -5,7 +5,6 @@
class FleetVehicleOdometer(models.Model):
- _name = 'fleet.vehicle.odometer'
_description = 'Odometer log for a vehicle'
_order = 'date desc'
diff --git a/addons/fleet/models/fleet_vehicle_state.py b/addons/fleet/models/fleet_vehicle_state.py
index bcd62322dd23c..938ab6825987a 100644
--- a/addons/fleet/models/fleet_vehicle_state.py
+++ b/addons/fleet/models/fleet_vehicle_state.py
@@ -5,7 +5,6 @@
class FleetVehicleState(models.Model):
- _name = 'fleet.vehicle.state'
_order = 'sequence asc'
_description = 'Vehicle Status'
diff --git a/addons/fleet/models/fleet_vehicle_tag.py b/addons/fleet/models/fleet_vehicle_tag.py
index 8825765eda24f..7eab15ae96aa6 100644
--- a/addons/fleet/models/fleet_vehicle_tag.py
+++ b/addons/fleet/models/fleet_vehicle_tag.py
@@ -5,7 +5,6 @@
class FleetVehicleTag(models.Model):
- _name = 'fleet.vehicle.tag'
_description = 'Vehicle Tag'
name = fields.Char('Tag Name', required=True, translate=True)
diff --git a/addons/fleet/models/res_partner.py b/addons/fleet/models/res_partner.py
index 04602928bdc2e..9ff95417dd4a1 100644
--- a/addons/fleet/models/res_partner.py
+++ b/addons/fleet/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
plan_to_change_car = fields.Boolean('Plan To Change Car', default=False, tracking=True)
plan_to_change_bike = fields.Boolean('Plan To Change Bike', default=False)
diff --git a/addons/fleet/report/fleet_report.py b/addons/fleet/report/fleet_report.py
index c3c245fe0e56d..9e7fe0ef3091d 100644
--- a/addons/fleet/report/fleet_report.py
+++ b/addons/fleet/report/fleet_report.py
@@ -5,8 +5,7 @@
from odoo.tools.sql import drop_view_if_exists, SQL
-class FleetReport(models.Model):
- _name = "fleet.vehicle.cost.report"
+class FleetVehicleCostReport(models.Model):
_description = "Fleet Analysis Report"
_auto = False
_order = 'date_start desc'
diff --git a/addons/fleet/wizard/fleet_vehicle_send_mail.py b/addons/fleet/wizard/fleet_vehicle_send_mail.py
index 8bfb302febca0..efe5dbf8d6adb 100644
--- a/addons/fleet/wizard/fleet_vehicle_send_mail.py
+++ b/addons/fleet/wizard/fleet_vehicle_send_mail.py
@@ -4,8 +4,7 @@
class FleetVehicleSendMail(models.TransientModel):
- _name = 'fleet.vehicle.send.mail'
- _inherit = 'mail.composer.mixin'
+ _inherit = ['mail.composer.mixin']
_description = 'Send mails to Drivers'
vehicle_ids = fields.Many2many('fleet.vehicle', string='Vehicles', required=True)
diff --git a/addons/gamification/models/gamification_badge.py b/addons/gamification/models/gamification_badge.py
index 86b11ceb49196..ad1ea9835ab72 100644
--- a/addons/gamification/models/gamification_badge.py
+++ b/addons/gamification/models/gamification_badge.py
@@ -20,7 +20,6 @@ class GamificationBadge(models.Model):
BADGE_REQUIRED = 4
TOO_MANY = 5
- _name = 'gamification.badge'
_description = 'Gamification Badge'
_inherit = ['mail.thread', 'image.mixin']
diff --git a/addons/gamification/models/gamification_badge_user.py b/addons/gamification/models/gamification_badge_user.py
index 364046e1812b6..d79343b2964dd 100644
--- a/addons/gamification/models/gamification_badge_user.py
+++ b/addons/gamification/models/gamification_badge_user.py
@@ -4,10 +4,9 @@
from odoo import api, fields, models
-class BadgeUser(models.Model):
+class GamificationBadgeUser(models.Model):
"""User having received a badge"""
- _name = 'gamification.badge.user'
_description = 'Gamification User Badge'
_order = "create_date desc"
_rec_name = "badge_name"
diff --git a/addons/gamification/models/gamification_challenge.py b/addons/gamification/models/gamification_challenge.py
index 264f4fa26205f..0e41543528e4d 100644
--- a/addons/gamification/models/gamification_challenge.py
+++ b/addons/gamification/models/gamification_challenge.py
@@ -45,7 +45,8 @@ def start_end_date_for_period(period, default_start_date=False, default_end_date
return fields.Datetime.to_string(start_date), fields.Datetime.to_string(end_date)
-class Challenge(models.Model):
+
+class GamificationChallenge(models.Model):
"""Gamification challenge
Set of predifined objectives assigned to people with rules for recurrence and
@@ -56,9 +57,8 @@ class Challenge(models.Model):
'monthly' is selected)
"""
- _name = 'gamification.challenge'
_description = 'Gamification Challenge'
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
_order = 'end_date, start_date, name, id'
@api.model
diff --git a/addons/gamification/models/gamification_challenge_line.py b/addons/gamification/models/gamification_challenge_line.py
index f90f04ae09d54..429b35963aa95 100644
--- a/addons/gamification/models/gamification_challenge_line.py
+++ b/addons/gamification/models/gamification_challenge_line.py
@@ -4,14 +4,13 @@
from odoo import models, fields
-class ChallengeLine(models.Model):
+class GamificationChallengeLine(models.Model):
"""Gamification challenge line
Predefined goal for 'gamification_challenge'
These are generic list of goals with only the target goal defined
Should only be created for the gamification.challenge object
"""
- _name = 'gamification.challenge.line'
_description = 'Gamification generic goal for challenge'
_order = "sequence, id"
diff --git a/addons/gamification/models/gamification_goal.py b/addons/gamification/models/gamification_goal.py
index 4cb5a727a8345..60b8f38098230 100644
--- a/addons/gamification/models/gamification_goal.py
+++ b/addons/gamification/models/gamification_goal.py
@@ -11,12 +11,11 @@
_logger = logging.getLogger(__name__)
-class Goal(models.Model):
+class GamificationGoal(models.Model):
"""Goal instance for a user
An individual goal for a user on a specified time period"""
- _name = 'gamification.goal'
_description = 'Gamification Goal'
_rec_name = 'definition_id'
_order = 'start_date desc, end_date desc, definition_id, id'
@@ -274,7 +273,7 @@ def action_cancel(self):
@api.model_create_multi
def create(self, vals_list):
- return super(Goal, self.with_context(no_remind_goal=True)).create(vals_list)
+ return super(GamificationGoal, self.with_context(no_remind_goal=True)).create(vals_list)
def write(self, vals):
"""Overwrite the write method to update the last_update field to today
@@ -283,7 +282,7 @@ def write(self, vals):
change, a report is generated
"""
vals['last_update'] = fields.Date.context_today(self)
- result = super(Goal, self).write(vals)
+ result = super().write(vals)
for goal in self:
if goal.state != "draft" and ('definition_id' in vals or 'user_id' in vals):
# avoid drag&drop in kanban view
diff --git a/addons/gamification/models/gamification_goal_definition.py b/addons/gamification/models/gamification_goal_definition.py
index 444dcbe24fc6c..2d666aee54fa5 100644
--- a/addons/gamification/models/gamification_goal_definition.py
+++ b/addons/gamification/models/gamification_goal_definition.py
@@ -7,14 +7,13 @@
DOMAIN_TEMPLATE = "[('store', '=', True), '|', ('model_id', '=', model_id), ('model_id', 'in', model_inherited_ids)%s]"
-class GoalDefinition(models.Model):
+class GamificationGoalDefinition(models.Model):
"""Goal definition
A goal definition contains the way to evaluate an objective
Each module wanting to be able to set goals to the users needs to create
a new gamification_goal_definition
"""
- _name = 'gamification.goal.definition'
_description = 'Gamification Goal Definition'
name = fields.Char("Goal Definition", required=True, translate=True)
@@ -122,7 +121,7 @@ def _check_model_validity(self):
@api.model_create_multi
def create(self, vals_list):
- definitions = super(GoalDefinition, self).create(vals_list)
+ definitions = super().create(vals_list)
definitions.filtered_domain([
('computation_mode', 'in', ['count', 'sum']),
])._check_domain_validity()
@@ -132,7 +131,7 @@ def create(self, vals_list):
return definitions
def write(self, vals):
- res = super(GoalDefinition, self).write(vals)
+ res = super().write(vals)
if vals.get('computation_mode', 'count') in ('count', 'sum') and (vals.get('domain') or vals.get('model_id')):
self._check_domain_validity()
if vals.get('field_id') or vals.get('model_id') or vals.get('batch_mode'):
diff --git a/addons/gamification/models/gamification_karma_rank.py b/addons/gamification/models/gamification_karma_rank.py
index ca7994bf004b5..397c963c30a33 100644
--- a/addons/gamification/models/gamification_karma_rank.py
+++ b/addons/gamification/models/gamification_karma_rank.py
@@ -4,10 +4,9 @@
from odoo.tools.translate import html_translate
-class KarmaRank(models.Model):
- _name = 'gamification.karma.rank'
+class GamificationKarmaRank(models.Model):
_description = 'Rank based on karma'
- _inherit = 'image.mixin'
+ _inherit = ['image.mixin']
_order = 'karma_min'
name = fields.Text(string='Rank Name', translate=True, required=True)
@@ -33,7 +32,7 @@ def _compute_rank_users_count(self):
@api.model_create_multi
def create(self, values_list):
- res = super(KarmaRank, self).create(values_list)
+ res = super().create(values_list)
if any(res.mapped('karma_min')) > 0:
users = self.env['res.users'].sudo().search([('karma', '>=', max(min(res.mapped('karma_min')), 1))])
if users:
@@ -46,7 +45,7 @@ def write(self, vals):
low = min(vals['karma_min'], min(self.mapped('karma_min')))
high = max(vals['karma_min'], max(self.mapped('karma_min')))
- res = super(KarmaRank, self).write(vals)
+ res = super().write(vals)
if 'karma_min' in vals:
after_ranks = self.env['gamification.karma.rank'].search([], order="karma_min DESC").ids
diff --git a/addons/gamification/models/gamification_karma_tracking.py b/addons/gamification/models/gamification_karma_tracking.py
index 9da49cce7e1d4..09a80a6d29c66 100644
--- a/addons/gamification/models/gamification_karma_tracking.py
+++ b/addons/gamification/models/gamification_karma_tracking.py
@@ -7,8 +7,7 @@
from odoo.tools import date_utils
-class KarmaTracking(models.Model):
- _name = 'gamification.karma.tracking'
+class GamificationKarmaTracking(models.Model):
_description = 'Track Karma Changes'
_rec_name = 'user_id'
_order = 'tracking_date desc, id desc'
diff --git a/addons/gamification/models/res_users.py b/addons/gamification/models/res_users.py
index 1762c786208a6..6a82b5a45852c 100644
--- a/addons/gamification/models/res_users.py
+++ b/addons/gamification/models/res_users.py
@@ -5,8 +5,8 @@
from odoo.tools import SQL
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
karma = fields.Integer('Karma', compute='_compute_karma', store=True, readonly=False)
karma_tracking_ids = fields.One2many('gamification.karma.tracking', 'user_id', string='Karma Changes', groups="base.group_system")
@@ -69,7 +69,7 @@ def _get_user_badge_level(self):
@api.model_create_multi
def create(self, values_list):
- res = super(Users, self).create(values_list)
+ res = super().create(values_list)
self._add_karma_batch({
user: {
diff --git a/addons/gamification/wizard/grant_badge.py b/addons/gamification/wizard/grant_badge.py
index 84b764c5d5361..ae995ad8fe910 100644
--- a/addons/gamification/wizard/grant_badge.py
+++ b/addons/gamification/wizard/grant_badge.py
@@ -4,9 +4,8 @@
from odoo import api, fields, models, _, exceptions
-class grant_badge_wizard(models.TransientModel):
+class GamificationBadgeUserWizard(models.TransientModel):
""" Wizard allowing to grant a badge to a user"""
- _name = 'gamification.badge.user.wizard'
_description = 'Gamification User Badge Wizard'
user_id = fields.Many2one("res.users", string='User', required=True)
diff --git a/addons/gamification/wizard/update_goal.py b/addons/gamification/wizard/update_goal.py
index e9664e05205a1..f5fbebd0cbd81 100644
--- a/addons/gamification/wizard/update_goal.py
+++ b/addons/gamification/wizard/update_goal.py
@@ -3,9 +3,9 @@
from odoo import api, models, fields
-class goal_manual_wizard(models.TransientModel):
+
+class GamificationGoalWizard(models.TransientModel):
"""Wizard to update a manual goal"""
- _name = 'gamification.goal.wizard'
_description = 'Gamification Goal Wizard'
goal_id = fields.Many2one("gamification.goal", string='Goal', required=True)
diff --git a/addons/google_account/models/google_service.py b/addons/google_account/models/google_service.py
index fba27a498fc2c..1ac8d782782a5 100644
--- a/addons/google_account/models/google_service.py
+++ b/addons/google_account/models/google_service.py
@@ -33,8 +33,8 @@ def _get_client_secret(ICP_sudo, service):
"""
return ICP_sudo.get_param('google_%s_client_secret' % service)
+
class GoogleService(models.AbstractModel):
- _name = 'google.service'
_description = 'Google Service'
def _get_client_id(self, service):
diff --git a/addons/google_calendar/models/calendar.py b/addons/google_calendar/models/calendar.py
index 93145bd03479b..75c3a2dee6ca3 100644
--- a/addons/google_calendar/models/calendar.py
+++ b/addons/google_calendar/models/calendar.py
@@ -11,8 +11,8 @@
from odoo.addons.google_calendar.utils.google_calendar import GoogleCalendarService
-class Meeting(models.Model):
- _name = 'calendar.event'
+
+class CalendarEvent(models.Model):
_inherit = ['calendar.event', 'google.calendar.sync']
MEET_ROUTE = 'meet.google.com'
@@ -40,7 +40,7 @@ def _compute_google_id(self):
def _compute_videocall_source(self):
events_with_google_url = self.filtered(lambda event: self.MEET_ROUTE in (event.videocall_location or ''))
events_with_google_url.videocall_source = 'google_meet'
- super(Meeting, self - events_with_google_url)._compute_videocall_source()
+ super(CalendarEvent, self - events_with_google_url)._compute_videocall_source()
@api.model
def _get_google_synced_fields(self):
@@ -56,7 +56,7 @@ def _restart_google_sync(self):
@api.model_create_multi
def create(self, vals_list):
notify_context = self.env.context.get('dont_notify', False)
- return super(Meeting, self.with_context(dont_notify=notify_context)).create([
+ return super(CalendarEvent, self.with_context(dont_notify=notify_context)).create([
dict(vals, need_sync=False) if vals.get('recurrence_id') or vals.get('recurrency') else vals
for vals in vals_list
])
@@ -93,7 +93,7 @@ def write(self, values):
notify_context = self.env.context.get('dont_notify', False)
if not notify_context and ([self.env.user.id != record.user_id.id for record in self]):
self._check_modify_event_permission(values)
- res = super(Meeting, self.with_context(dont_notify=notify_context)).write(values)
+ res = super(CalendarEvent, self.with_context(dont_notify=notify_context)).write(values)
if recurrence_update_setting in ('all_events',) and len(self) == 1 and values.keys() & self._get_google_synced_fields():
self.recurrence_id.need_sync = True
return res
@@ -282,7 +282,7 @@ def action_mass_archive(self, recurrence_update_setting):
# Increase performance handling 'future_events' edge case as it was an 'all_events' update.
if archive_future_events:
recurrence_update_setting = 'all_events'
- super(Meeting, self).action_mass_archive(recurrence_update_setting)
+ super().action_mass_archive(recurrence_update_setting)
def _google_values(self):
if self.allday:
@@ -361,7 +361,7 @@ def _cancel(self):
for event in self:
# remove the tracking data to avoid calling _track_template in the pre-commit phase
self.env.cr.precommit.data.pop(f'mail.tracking.create.{event._name}.{event.id}', None)
- super(Meeting, my_cancelled_records)._cancel()
+ super(CalendarEvent, my_cancelled_records)._cancel()
attendees = (self - my_cancelled_records).attendee_ids.filtered(lambda a: a.partner_id == user.partner_id)
attendees.state = 'declined'
diff --git a/addons/google_calendar/models/calendar_attendee.py b/addons/google_calendar/models/calendar_attendee.py
index 108c48f234edd..865f7d9e2d6c8 100644
--- a/addons/google_calendar/models/calendar_attendee.py
+++ b/addons/google_calendar/models/calendar_attendee.py
@@ -5,9 +5,9 @@
from odoo.addons.google_calendar.utils.google_calendar import GoogleCalendarService
-class Attendee(models.Model):
- _name = 'calendar.attendee'
- _inherit = 'calendar.attendee'
+
+class CalendarAttendee(models.Model):
+ _inherit = ['calendar.attendee']
def do_tentative(self):
# Synchronize event after state change
diff --git a/addons/google_calendar/models/calendar_recurrence_rule.py b/addons/google_calendar/models/calendar_recurrence_rule.py
index aa0ad6f5f74ca..385e78ec2a914 100644
--- a/addons/google_calendar/models/calendar_recurrence_rule.py
+++ b/addons/google_calendar/models/calendar_recurrence_rule.py
@@ -11,8 +11,8 @@
_logger = logging.getLogger(__name__)
-class RecurrenceRule(models.Model):
- _name = 'calendar.recurrence'
+
+class CalendarRecurrence(models.Model):
_inherit = ['calendar.recurrence', 'google.calendar.sync']
@@ -184,7 +184,7 @@ def _create_from_google(self, gevents, vals_list):
vals['event_tz'] = gevent.start.get('timeZone')
attendee_values[base_event.id] = {'attendee_ids': base_values.get('attendee_ids')}
- recurrence = super(RecurrenceRule, self.with_context(dont_notify=True))._create_from_google(gevents, vals_list)
+ recurrence = super(CalendarRecurrence, self.with_context(dont_notify=True))._create_from_google(gevents, vals_list)
generic_values_creation = {
rec.id: attendee_values[rec.base_event_id.id]
for rec in recurrence if attendee_values.get(rec.base_event_id.id)
diff --git a/addons/google_calendar/models/google_sync.py b/addons/google_calendar/models/google_sync.py
index 317467cabe29b..35783e25427de 100644
--- a/addons/google_calendar/models/google_sync.py
+++ b/addons/google_calendar/models/google_sync.py
@@ -53,8 +53,7 @@ def google_calendar_token(user):
yield user._get_google_calendar_token()
-class GoogleSync(models.AbstractModel):
- _name = 'google.calendar.sync'
+class GoogleCalendarSync(models.AbstractModel):
_description = "Synchronize a record with Google Calendar"
google_id = fields.Char('Google Calendar Id', copy=False)
diff --git a/addons/google_calendar/models/res_config_settings.py b/addons/google_calendar/models/res_config_settings.py
index 510cc7da764a3..91b6ae439de6c 100644
--- a/addons/google_calendar/models/res_config_settings.py
+++ b/addons/google_calendar/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
cal_client_id = fields.Char("Client_id", config_parameter='google_calendar_client_id', default='')
cal_client_secret = fields.Char("Client_key", config_parameter='google_calendar_client_secret', default='')
diff --git a/addons/google_calendar/models/res_users.py b/addons/google_calendar/models/res_users.py
index 346c48bd7b4d4..45ab16207c618 100644
--- a/addons/google_calendar/models/res_users.py
+++ b/addons/google_calendar/models/res_users.py
@@ -13,8 +13,9 @@
_logger = logging.getLogger(__name__)
-class User(models.Model):
- _inherit = 'res.users'
+
+class ResUsers(models.Model):
+ _inherit = ['res.users']
google_calendar_rtoken = fields.Char(related='res_users_settings_id.google_calendar_rtoken', groups="base.group_system")
google_calendar_token = fields.Char(related='res_users_settings_id.google_calendar_token', groups="base.group_system")
diff --git a/addons/google_calendar/models/res_users_settings.py b/addons/google_calendar/models/res_users_settings.py
index df4f6443a5655..a424faadce5b3 100644
--- a/addons/google_calendar/models/res_users_settings.py
+++ b/addons/google_calendar/models/res_users_settings.py
@@ -8,8 +8,9 @@
from odoo.exceptions import UserError
from odoo.addons.google_account.models.google_service import GOOGLE_TOKEN_ENDPOINT
+
class ResUsersSettings(models.Model):
- _inherit = "res.users.settings"
+ _inherit = ["res.users.settings"]
# Google Calendar tokens and synchronization information.
google_calendar_rtoken = fields.Char('Refresh Token', copy=False, groups='base.group_system')
diff --git a/addons/google_calendar/wizard/reset_account.py b/addons/google_calendar/wizard/reset_account.py
index 129115eb9e84e..164c0e7038aa8 100644
--- a/addons/google_calendar/wizard/reset_account.py
+++ b/addons/google_calendar/wizard/reset_account.py
@@ -7,8 +7,7 @@
from odoo.addons.google_calendar.utils.google_calendar import GoogleCalendarService
-class ResetGoogleAccount(models.TransientModel):
- _name = 'google.calendar.account.reset'
+class GoogleCalendarAccountReset(models.TransientModel):
_description = 'Google Calendar Account Reset'
user_id = fields.Many2one('res.users', required=True)
diff --git a/addons/google_gmail/models/fetchmail_server.py b/addons/google_gmail/models/fetchmail_server.py
index 1669d63694415..ba97a013251e6 100644
--- a/addons/google_gmail/models/fetchmail_server.py
+++ b/addons/google_gmail/models/fetchmail_server.py
@@ -5,7 +5,6 @@
class FetchmailServer(models.Model):
- _name = 'fetchmail.server'
_inherit = ['fetchmail.server', 'google.gmail.mixin']
server_type = fields.Selection(selection_add=[('gmail', 'Gmail OAuth Authentication')], ondelete={'gmail': 'set default'})
diff --git a/addons/google_gmail/models/google_gmail_mixin.py b/addons/google_gmail/models/google_gmail_mixin.py
index 1a41e915bf490..24d8c1049c8cd 100644
--- a/addons/google_gmail/models/google_gmail_mixin.py
+++ b/addons/google_gmail/models/google_gmail_mixin.py
@@ -16,7 +16,6 @@
class GoogleGmailMixin(models.AbstractModel):
- _name = 'google.gmail.mixin'
_description = 'Google Gmail Mixin'
_SERVICE_SCOPE = 'https://mail.google.com/'
diff --git a/addons/google_gmail/models/ir_mail_server.py b/addons/google_gmail/models/ir_mail_server.py
index 5e92b702a54de..e8a1d00f9c4f2 100644
--- a/addons/google_gmail/models/ir_mail_server.py
+++ b/addons/google_gmail/models/ir_mail_server.py
@@ -7,10 +7,9 @@
from odoo.exceptions import UserError
-class IrMailServer(models.Model):
+class IrMail_Server(models.Model):
"""Represents an SMTP server, able to send outgoing emails, with SSL and TLS capabilities."""
- _name = 'ir.mail_server'
_inherit = ['ir.mail_server', 'google.gmail.mixin']
smtp_authentication = fields.Selection(
@@ -23,14 +22,14 @@ def _compute_smtp_authentication_info(self):
'Connect your Gmail account with the OAuth Authentication process. \n'
'By default, only a user with a matching email address will be able to use this server. '
'To extend its use, you should set a "mail.default.from" system parameter.')
- super(IrMailServer, self - gmail_servers)._compute_smtp_authentication_info()
+ super(IrMail_Server, self - gmail_servers)._compute_smtp_authentication_info()
@api.onchange('smtp_encryption')
def _onchange_encryption(self):
"""Do not change the SMTP configuration if it's a Gmail server
(e.g. the port which is already set)"""
if self.smtp_authentication != 'gmail':
- super(IrMailServer, self)._onchange_encryption()
+ super()._onchange_encryption()
@api.onchange('smtp_authentication')
def _onchange_smtp_authentication_gmail(self):
@@ -76,4 +75,4 @@ def _smtp_login(self, connection, smtp_user, smtp_password):
connection.ehlo()
connection.docmd('AUTH', f'XOAUTH2 {oauth_param}')
else:
- super(IrMailServer, self)._smtp_login(connection, smtp_user, smtp_password)
+ super()._smtp_login(connection, smtp_user, smtp_password)
diff --git a/addons/google_gmail/models/res_config_settings.py b/addons/google_gmail/models/res_config_settings.py
index 81ae768f88f13..aa9d50cfffe7b 100644
--- a/addons/google_gmail/models/res_config_settings.py
+++ b/addons/google_gmail/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
google_gmail_client_identifier = fields.Char('Gmail Client Id', config_parameter='google_gmail_client_id')
google_gmail_client_secret = fields.Char('Gmail Client Secret', config_parameter='google_gmail_client_secret')
diff --git a/addons/google_recaptcha/models/ir_http.py b/addons/google_recaptcha/models/ir_http.py
index ef18056f7622c..2aba2c26c5720 100644
--- a/addons/google_recaptcha/models/ir_http.py
+++ b/addons/google_recaptcha/models/ir_http.py
@@ -10,8 +10,8 @@
logger = logging.getLogger(__name__)
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
def session_info(self):
session_info = super().session_info()
diff --git a/addons/google_recaptcha/models/res_config_settings.py b/addons/google_recaptcha/models/res_config_settings.py
index bfd663c2e7699..3b54531f690ea 100644
--- a/addons/google_recaptcha/models/res_config_settings.py
+++ b/addons/google_recaptcha/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
recaptcha_public_key = fields.Char("Site Key", config_parameter='recaptcha_public_key', groups='base.group_system')
recaptcha_private_key = fields.Char("Secret Key", config_parameter='recaptcha_private_key', groups='base.group_system')
diff --git a/addons/hr/models/discuss_channel.py b/addons/hr/models/discuss_channel.py
index fbaa4ec4bb1ff..5fcb5f33f9a53 100644
--- a/addons/hr/models/discuss_channel.py
+++ b/addons/hr/models/discuss_channel.py
@@ -5,8 +5,8 @@
from odoo.exceptions import ValidationError
-class Channel(models.Model):
- _inherit = 'discuss.channel'
+class DiscussChannel(models.Model):
+ _inherit = ['discuss.channel']
subscription_department_ids = fields.Many2many(
'hr.department', string='HR Departments',
@@ -20,7 +20,7 @@ def _constraint_subscription_department_ids_channel(self):
def _subscribe_users_automatically_get_members(self):
""" Auto-subscribe members of a department to a channel """
- new_members = super(Channel, self)._subscribe_users_automatically_get_members()
+ new_members = super()._subscribe_users_automatically_get_members()
for channel in self:
new_members[channel.id] = list(
set(new_members[channel.id]) |
@@ -29,7 +29,7 @@ def _subscribe_users_automatically_get_members(self):
return new_members
def write(self, vals):
- res = super(Channel, self).write(vals)
+ res = super().write(vals)
if vals.get('subscription_department_ids'):
self._subscribe_users_automatically()
return res
diff --git a/addons/hr/models/hr_contract_type.py b/addons/hr/models/hr_contract_type.py
index 7e540b7b16f82..1599b8a27472b 100644
--- a/addons/hr/models/hr_contract_type.py
+++ b/addons/hr/models/hr_contract_type.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class ContractType(models.Model):
- _name = 'hr.contract.type'
+class HrContractType(models.Model):
_description = 'Contract Type'
_order = 'sequence'
diff --git a/addons/hr/models/hr_department.py b/addons/hr/models/hr_department.py
index c625ebbc15080..467fbe99cd268 100644
--- a/addons/hr/models/hr_department.py
+++ b/addons/hr/models/hr_department.py
@@ -5,8 +5,7 @@
from odoo.exceptions import ValidationError
-class Department(models.Model):
- _name = "hr.department"
+class HrDepartment(models.Model):
_description = "Department"
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = "name"
@@ -91,7 +90,7 @@ def create(self, vals_list):
# TDE note: auto-subscription of manager done by hand, because currently
# the tracking allows to track+subscribe fields linked to a res.user record
# An update of the limited behavior should come, but not currently done.
- departments = super(Department, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
+ departments = super(HrDepartment, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
for department, vals in zip(departments, vals_list):
manager = self.env['hr.employee'].browse(vals.get("manager_id"))
if manager.user_id:
@@ -119,7 +118,7 @@ def write(self, vals):
self.message_unsubscribe(partner_ids=list(manager_to_unsubscribe))
# set the employees's parent to the new manager
self._update_employee_manager(manager_id)
- return super(Department, self).write(vals)
+ return super().write(vals)
def _update_employee_manager(self, manager_id):
employees = self.env['hr.employee']
diff --git a/addons/hr/models/hr_departure_reason.py b/addons/hr/models/hr_departure_reason.py
index cfb88cbf2d455..1701da0a661f7 100644
--- a/addons/hr/models/hr_departure_reason.py
+++ b/addons/hr/models/hr_departure_reason.py
@@ -5,8 +5,7 @@
from odoo.exceptions import UserError
-class DepartureReason(models.Model):
- _name = "hr.departure.reason"
+class HrDepartureReason(models.Model):
_description = "Departure Reason"
_order = "sequence"
diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py
index 90a33deaa7282..2c8af075d9ca9 100644
--- a/addons/hr/models/hr_employee.py
+++ b/addons/hr/models/hr_employee.py
@@ -15,7 +15,7 @@
from odoo.tools import convert, format_date
-class HrEmployeePrivate(models.Model):
+class HrEmployee(models.Model):
"""
NB: Any field only available on the model hr.employee (i.e. not on the
hr.employee.public model) should have `groups="hr.group_hr_user"` on its
@@ -23,7 +23,6 @@ class HrEmployeePrivate(models.Model):
hr.employee model. Indeed, the prefetch loads the data for all the fields
that are available according to the group defined on them.
"""
- _name = "hr.employee"
_description = "Employee"
_order = 'name'
_inherit = ['hr.employee.base', 'mail.thread.main.attachment', 'mail.activity.mixin', 'resource.mixin', 'avatar.mixin']
@@ -226,7 +225,7 @@ def _compute_avatar(self, avatar_field, image_field):
if not avatar and employee.user_id:
avatar = employee.user_id.sudo()[avatar_field]
employee[avatar_field] = avatar
- super(HrEmployeePrivate, employee_wo_user_and_image)._compute_avatar(avatar_field, image_field)
+ super(HrEmployee, employee_wo_user_and_image)._compute_avatar(avatar_field, image_field)
@api.depends('name', 'permit_no')
def _compute_work_permit_name(self):
@@ -393,7 +392,7 @@ def _search(self, domain, offset=0, limit=None, order=None):
except ValueError:
raise AccessError(_('You do not have access to this document.'))
# the result is expected from this table, so we should link tables
- return super(HrEmployeePrivate, self.sudo())._search([('id', 'in', ids)], order=order)
+ return super(HrEmployee, self.sudo())._search([('id', 'in', ids)], order=order)
def get_formview_id(self, access_uid=None):
""" Override this method in order to redirect many2one towards the right model depending on access_uid """
@@ -403,13 +402,13 @@ def get_formview_id(self, access_uid=None):
self_sudo = self
if self_sudo.browse().has_access('read'):
- return super(HrEmployeePrivate, self).get_formview_id(access_uid=access_uid)
+ return super().get_formview_id(access_uid=access_uid)
# Hardcode the form view for public employee
return self.env.ref('hr.hr_employee_public_view_form').id
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)
+ res = super().get_formview_action(access_uid=access_uid)
if access_uid:
self_sudo = self.with_user(access_uid)
else:
@@ -525,7 +524,7 @@ def write(self, vals):
(bool(all(emp.image_1920 for emp in self)))))
if 'work_permit_expiration_date' in vals:
vals['work_permit_scheduled_activity'] = False
- res = super(HrEmployeePrivate, self).write(vals)
+ res = super().write(vals)
if vals.get('department_id') or vals.get('user_id'):
department_id = vals['department_id'] if vals.get('department_id') else self[:1].department_id.id
# When added to a department or changing user, subscribe to the channels auto-subscribed by department
@@ -540,7 +539,7 @@ def write(self, vals):
def unlink(self):
resources = self.mapped('resource_id')
- super(HrEmployeePrivate, self).unlink()
+ super().unlink()
return resources.unlink()
def _get_employee_m2o_to_empty_on_archived_employees(self):
@@ -550,7 +549,7 @@ def _get_user_m2o_to_empty_on_archived_employees(self):
return []
def toggle_active(self):
- res = super(HrEmployeePrivate, self).toggle_active()
+ res = super().toggle_active()
unarchived_employees = self.filtered(lambda employee: employee.active)
unarchived_employees.write({
'departure_reason_id': False,
diff --git a/addons/hr/models/hr_employee_base.py b/addons/hr/models/hr_employee_base.py
index 9ba23ae391e29..eeff3be6f8707 100644
--- a/addons/hr/models/hr_employee_base.py
+++ b/addons/hr/models/hr_employee_base.py
@@ -9,7 +9,6 @@
class HrEmployeeBase(models.AbstractModel):
- _name = "hr.employee.base"
_description = "Basic Employee"
_order = 'name'
diff --git a/addons/hr/models/hr_employee_category.py b/addons/hr/models/hr_employee_category.py
index a7842b7b40b9a..a5f70c6157073 100644
--- a/addons/hr/models/hr_employee_category.py
+++ b/addons/hr/models/hr_employee_category.py
@@ -6,9 +6,8 @@
from odoo import fields, models
-class EmployeeCategory(models.Model):
+class HrEmployeeCategory(models.Model):
- _name = "hr.employee.category"
_description = "Employee Category"
def _get_default_color(self):
diff --git a/addons/hr/models/hr_employee_public.py b/addons/hr/models/hr_employee_public.py
index e7a18f1c985fe..459d9c37f3d6c 100644
--- a/addons/hr/models/hr_employee_public.py
+++ b/addons/hr/models/hr_employee_public.py
@@ -5,7 +5,6 @@
class HrEmployeePublic(models.Model):
- _name = "hr.employee.public"
_inherit = ["hr.employee.base"]
_description = 'Public Employee'
_order = 'name'
diff --git a/addons/hr/models/hr_job.py b/addons/hr/models/hr_job.py
index be4220832d21d..1120b824d21b2 100644
--- a/addons/hr/models/hr_job.py
+++ b/addons/hr/models/hr_job.py
@@ -5,8 +5,7 @@
from odoo.addons.web_editor.tools import handle_history_divergence
-class Job(models.Model):
- _name = "hr.job"
+class HrJob(models.Model):
_description = "Job Position"
_inherit = ['mail.thread']
_order = 'sequence'
@@ -43,7 +42,7 @@ def _compute_employees(self):
@api.model_create_multi
def create(self, vals_list):
""" 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(vals_list)
+ return super(HrJob, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
def copy_data(self, default=None):
vals_list = super().copy_data(default=default)
@@ -52,4 +51,4 @@ def copy_data(self, default=None):
def write(self, vals):
if len(self) == 1:
handle_history_divergence(self, 'description', vals)
- return super(Job, self).write(vals)
+ return super().write(vals)
diff --git a/addons/hr/models/hr_work_location.py b/addons/hr/models/hr_work_location.py
index bbba32028e2f7..444042a44f881 100644
--- a/addons/hr/models/hr_work_location.py
+++ b/addons/hr/models/hr_work_location.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class WorkLocation(models.Model):
- _name = "hr.work.location"
+class HrWorkLocation(models.Model):
_description = "Work Location"
_order = 'name'
diff --git a/addons/hr/models/ir_ui_menu.py b/addons/hr/models/ir_ui_menu.py
index 224274be2dc09..0e26963e3010b 100644
--- a/addons/hr/models/ir_ui_menu.py
+++ b/addons/hr/models/ir_ui_menu.py
@@ -5,7 +5,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
def _load_menus_blacklist(self):
res = super()._load_menus_blacklist()
diff --git a/addons/hr/models/mail_activity_plan.py b/addons/hr/models/mail_activity_plan.py
index ff9c6861803ed..c5651fa683497 100644
--- a/addons/hr/models/mail_activity_plan.py
+++ b/addons/hr/models/mail_activity_plan.py
@@ -6,7 +6,7 @@
class MailActivityPlan(models.Model):
- _inherit = 'mail.activity.plan'
+ _inherit = ['mail.activity.plan']
department_id = fields.Many2one(
'hr.department', check_company=True,
diff --git a/addons/hr/models/mail_activity_plan_template.py b/addons/hr/models/mail_activity_plan_template.py
index 03638ad02a277..cd72660af8453 100644
--- a/addons/hr/models/mail_activity_plan_template.py
+++ b/addons/hr/models/mail_activity_plan_template.py
@@ -5,8 +5,8 @@
from odoo.exceptions import ValidationError
-class MailActivityPLanTemplate(models.Model):
- _inherit = 'mail.activity.plan.template'
+class MailActivityPlanTemplate(models.Model):
+ _inherit = ['mail.activity.plan.template']
responsible_type = fields.Selection(selection_add=[
('coach', 'Coach'),
diff --git a/addons/hr/models/mail_alias.py b/addons/hr/models/mail_alias.py
index a250e246b2d0c..71680bbe46b64 100644
--- a/addons/hr/models/mail_alias.py
+++ b/addons/hr/models/mail_alias.py
@@ -4,8 +4,8 @@
from odoo import fields, models, _
-class Alias(models.Model):
- _inherit = 'mail.alias'
+class MailAlias(models.Model):
+ _inherit = ['mail.alias']
alias_contact = fields.Selection(selection_add=[
('employees', 'Authenticated Employees'),
@@ -14,4 +14,4 @@ class Alias(models.Model):
def _get_alias_contact_description(self):
if self.alias_contact == 'employees':
return _('addresses linked to registered employees')
- return super(Alias, self)._get_alias_contact_description()
+ return super()._get_alias_contact_description()
diff --git a/addons/hr/models/models.py b/addons/hr/models/models.py
index 02b8a2d81f447..59f3d81236b3f 100644
--- a/addons/hr/models/models.py
+++ b/addons/hr/models/models.py
@@ -6,7 +6,9 @@
class BaseModel(models.AbstractModel):
- _inherit = 'base'
+ _name = "base"
+
+ _inherit = ['base']
def _alias_get_error(self, message, message_dict, alias):
if alias.alias_contact == 'employees':
diff --git a/addons/hr/models/res_company.py b/addons/hr/models/res_company.py
index 7d4497e9e21ce..c920731b11ca5 100644
--- a/addons/hr/models/res_company.py
+++ b/addons/hr/models/res_company.py
@@ -3,8 +3,8 @@
from odoo import fields, models
-class Company(models.Model):
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
hr_presence_control_email_amount = fields.Integer(string="# emails to send")
hr_presence_control_ip_list = fields.Char(string="Valid IP addresses")
diff --git a/addons/hr/models/res_config_settings.py b/addons/hr/models/res_config_settings.py
index 89094fd14fed7..b46cd77d17cc4 100644
--- a/addons/hr/models/res_config_settings.py
+++ b/addons/hr/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
resource_calendar_id = fields.Many2one(
'resource.calendar', 'Company Working Hours',
diff --git a/addons/hr/models/resource.py b/addons/hr/models/resource.py
index 1023c977193d6..39e44bbb60dfc 100644
--- a/addons/hr/models/resource.py
+++ b/addons/hr/models/resource.py
@@ -5,7 +5,7 @@
class ResourceResource(models.Model):
- _inherit = "resource.resource"
+ _inherit = ["resource.resource"]
user_id = fields.Many2one(copy=False)
employee_id = fields.One2many('hr.employee', 'resource_id', check_company=True, context={'active_test': False})
diff --git a/addons/hr/report/hr_manager_department_report.py b/addons/hr/report/hr_manager_department_report.py
index 46bd79159b9a0..b6b1d48c08bb6 100644
--- a/addons/hr/report/hr_manager_department_report.py
+++ b/addons/hr/report/hr_manager_department_report.py
@@ -4,7 +4,6 @@
class HrManagerDepartmentReport(models.AbstractModel):
- _name = 'hr.manager.department.report'
_description = 'Hr Manager Department Report'
_auto = False
diff --git a/addons/hr/wizard/hr_departure_wizard.py b/addons/hr/wizard/hr_departure_wizard.py
index 119ca0caf58d0..8f51ef9215dcb 100644
--- a/addons/hr/wizard/hr_departure_wizard.py
+++ b/addons/hr/wizard/hr_departure_wizard.py
@@ -5,7 +5,6 @@
class HrDepartureWizard(models.TransientModel):
- _name = 'hr.departure.wizard'
_description = 'Departure Wizard'
def _get_employee_departure_date(self):
diff --git a/addons/hr/wizard/mail_activity_schedule.py b/addons/hr/wizard/mail_activity_schedule.py
index 67fd968451619..72cdaaa5b83a2 100644
--- a/addons/hr/wizard/mail_activity_schedule.py
+++ b/addons/hr/wizard/mail_activity_schedule.py
@@ -7,7 +7,7 @@
class MailActivitySchedule(models.TransientModel):
- _inherit = 'mail.activity.schedule'
+ _inherit = ['mail.activity.schedule']
department_id = fields.Many2one('hr.department', compute='_compute_department_id')
plan_department_filterable = fields.Boolean(compute='_compute_plan_department_filterable')
diff --git a/addons/hr_attendance/models/hr_attendance.py b/addons/hr_attendance/models/hr_attendance.py
index 3938360542b3c..5b5dac399f396 100644
--- a/addons/hr_attendance/models/hr_attendance.py
+++ b/addons/hr_attendance/models/hr_attendance.py
@@ -23,10 +23,9 @@ def get_google_maps_url(latitude, longitude):
class HrAttendance(models.Model):
- _name = "hr.attendance"
_description = "Attendance"
_order = "check_in desc"
- _inherit = "mail.thread"
+ _inherit = ["mail.thread"]
def _default_employee(self):
return self.env.user.employee_id
diff --git a/addons/hr_attendance/models/hr_attendance_overtime.py b/addons/hr_attendance/models/hr_attendance_overtime.py
index 8106b9f6e9d5b..f97952df51299 100644
--- a/addons/hr_attendance/models/hr_attendance_overtime.py
+++ b/addons/hr_attendance/models/hr_attendance_overtime.py
@@ -5,7 +5,6 @@
class HrAttendanceOvertime(models.Model):
- _name = "hr.attendance.overtime"
_description = "Attendance Overtime"
_rec_name = 'employee_id'
_order = 'date desc'
diff --git a/addons/hr_attendance/models/hr_employee.py b/addons/hr_attendance/models/hr_employee.py
index 066a762ae3055..98fc8e5292c26 100644
--- a/addons/hr_attendance/models/hr_employee.py
+++ b/addons/hr_attendance/models/hr_employee.py
@@ -9,7 +9,7 @@
class HrEmployee(models.Model):
- _inherit = "hr.employee"
+ _inherit = ["hr.employee"]
attendance_manager_id = fields.Many2one(
'res.users', store=True, readonly=False,
diff --git a/addons/hr_attendance/models/hr_employee_base.py b/addons/hr_attendance/models/hr_employee_base.py
index cbaf53e52f457..6af24b0190d04 100644
--- a/addons/hr_attendance/models/hr_employee_base.py
+++ b/addons/hr_attendance/models/hr_employee_base.py
@@ -4,7 +4,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
@api.depends("user_id.im_status", "attendance_state")
def _compute_presence_state(self):
diff --git a/addons/hr_attendance/models/hr_employee_public.py b/addons/hr_attendance/models/hr_employee_public.py
index 7b4d6f90ceded..6261eabdc9697 100644
--- a/addons/hr_attendance/models/hr_employee_public.py
+++ b/addons/hr_attendance/models/hr_employee_public.py
@@ -3,8 +3,9 @@
from odoo import fields, models
+
class HrEmployeePublic(models.Model):
- _inherit = 'hr.employee.public'
+ _inherit = ['hr.employee.public']
# These are required for manual attendance
attendance_state = fields.Selection(related='employee_id.attendance_state', readonly=True,
diff --git a/addons/hr_attendance/models/res_company.py b/addons/hr_attendance/models/res_company.py
index 5692149c5821d..f8128697b262a 100644
--- a/addons/hr_attendance/models/res_company.py
+++ b/addons/hr_attendance/models/res_company.py
@@ -8,7 +8,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
def _default_company_token(self):
return str(uuid.uuid4())
diff --git a/addons/hr_attendance/models/res_config_settings.py b/addons/hr_attendance/models/res_config_settings.py
index 273b642f071c3..90361af58d426 100644
--- a/addons/hr_attendance/models/res_config_settings.py
+++ b/addons/hr_attendance/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
overtime_company_threshold = fields.Integer(
string="Tolerance Time In Favor Of Company", readonly=False)
diff --git a/addons/hr_attendance/models/res_users.py b/addons/hr_attendance/models/res_users.py
index 3071a2881679d..ac459f79c84bc 100644
--- a/addons/hr_attendance/models/res_users.py
+++ b/addons/hr_attendance/models/res_users.py
@@ -3,6 +3,7 @@
from odoo import models, fields, _
+
class User(models.Model):
_inherit = ['res.users']
diff --git a/addons/hr_calendar/models/calendar_event.py b/addons/hr_calendar/models/calendar_event.py
index 498255f1909bc..b076bb56c2dbe 100644
--- a/addons/hr_calendar/models/calendar_event.py
+++ b/addons/hr_calendar/models/calendar_event.py
@@ -8,7 +8,7 @@
class CalendarEvent(models.Model):
- _inherit = "calendar.event"
+ _inherit = ["calendar.event"]
unavailable_partner_ids = fields.Many2many('res.partner', compute='_compute_unavailable_partner_ids')
diff --git a/addons/hr_contract/models/hr_contract.py b/addons/hr_contract/models/hr_contract.py
index 9287cab0190a4..ca6d2295f7d77 100644
--- a/addons/hr_contract/models/hr_contract.py
+++ b/addons/hr_contract/models/hr_contract.py
@@ -15,8 +15,7 @@
_logger = logging.getLogger(__name__)
-class Contract(models.Model):
- _name = 'hr.contract'
+class HrContract(models.Model):
_description = 'Contract'
_inherit = ['mail.thread', 'mail.activity.mixin']
_mail_post_access = 'read'
@@ -301,7 +300,7 @@ def _is_fully_flexible(self):
def write(self, vals):
old_state = {c.id: c.state for c in self}
- res = super(Contract, self).write(vals)
+ res = super().write(vals)
new_state = {c.id: c.state for c in self}
if vals.get('state') == 'open':
self._assign_open_contract()
@@ -354,7 +353,7 @@ def _track_subtype(self, init_values):
return self.env.ref('hr_contract.mt_contract_pending')
elif 'state' in init_values and self.state == 'close':
return self.env.ref('hr_contract.mt_contract_close')
- return super(Contract, self)._track_subtype(init_values)
+ return super()._track_subtype(init_values)
def _is_struct_from_country(self, country_code):
self.ensure_one()
diff --git a/addons/hr_contract/models/hr_employee.py b/addons/hr_contract/models/hr_employee.py
index 58ac99bfbf414..93dc641627141 100644
--- a/addons/hr_contract/models/hr_employee.py
+++ b/addons/hr_contract/models/hr_employee.py
@@ -12,8 +12,8 @@
from odoo.exceptions import UserError
-class EmployeePublic(models.Model):
- _inherit = 'hr.employee.public'
+class HrEmployeePublic(models.Model):
+ _inherit = ['hr.employee.public']
first_contract_date = fields.Date(compute='_compute_manager_only_fields', search='_search_first_contract_date')
@@ -25,16 +25,16 @@ def _search_first_contract_date(self, operator, value):
return [('id', 'in', employees.ids)]
-class EmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+class HrEmployeeBase(models.AbstractModel):
+ _inherit = ["hr.employee.base"]
@api.model
def _get_new_hire_field(self):
return 'first_contract_date'
-class Employee(models.Model):
- _inherit = "hr.employee"
+class HrEmployee(models.Model):
+ _inherit = ["hr.employee"]
legal_name = fields.Char(compute='_compute_legal_name', store=True, readonly=False, groups="hr.group_hr_user")
vehicle = fields.Char(string='Company Vehicle', groups="hr.group_hr_user")
diff --git a/addons/hr_contract/models/hr_payroll_structure_type.py b/addons/hr_contract/models/hr_payroll_structure_type.py
index 1ffbf1135800e..17c6ff391408a 100644
--- a/addons/hr_contract/models/hr_payroll_structure_type.py
+++ b/addons/hr_contract/models/hr_payroll_structure_type.py
@@ -5,7 +5,6 @@
class HrPayrollStructureType(models.Model):
- _name = 'hr.payroll.structure.type'
_description = 'Salary Structure Type'
name = fields.Char('Salary Structure Type')
diff --git a/addons/hr_contract/models/ir_ui_menu.py b/addons/hr_contract/models/ir_ui_menu.py
index 9bebf4c8dea73..261c612ed22f4 100644
--- a/addons/hr_contract/models/ir_ui_menu.py
+++ b/addons/hr_contract/models/ir_ui_menu.py
@@ -5,7 +5,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
def _load_menus_blacklist(self):
res = super()._load_menus_blacklist()
diff --git a/addons/hr_contract/models/res_company.py b/addons/hr_contract/models/res_company.py
index ee3ad952e514f..fff4bcbd23380 100644
--- a/addons/hr_contract/models/res_company.py
+++ b/addons/hr_contract/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
contract_expiration_notice_period = fields.Integer("Contract Expiry Notice Period", default=7)
work_permit_expiration_notice_period = fields.Integer("Work Permit Expiry Notice Period", default=60)
diff --git a/addons/hr_contract/models/res_config_settings.py b/addons/hr_contract/models/res_config_settings.py
index e17c969d1317b..def8cbfc4481c 100644
--- a/addons/hr_contract/models/res_config_settings.py
+++ b/addons/hr_contract/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
contract_expiration_notice_period = fields.Integer(string="Contract Expiry Notice Period", related='company_id.contract_expiration_notice_period', readonly=False)
work_permit_expiration_notice_period = fields.Integer(string="Work Permit Expiry Notice Period", related='company_id.work_permit_expiration_notice_period', readonly=False)
diff --git a/addons/hr_contract/models/resource.py b/addons/hr_contract/models/resource.py
index a6d7677c1cbef..a692f989aab3e 100644
--- a/addons/hr_contract/models/resource.py
+++ b/addons/hr_contract/models/resource.py
@@ -7,7 +7,7 @@
class ResourceCalendar(models.Model):
- _inherit = 'resource.calendar'
+ _inherit = ['resource.calendar']
contracts_count = fields.Integer("# Contracts using it", compute='_compute_contracts_count', groups="hr_contract.group_hr_contract_manager")
diff --git a/addons/hr_contract/models/resource_calendar_leaves.py b/addons/hr_contract/models/resource_calendar_leaves.py
index 741dfed5e4d0a..59d1c72ef319e 100644
--- a/addons/hr_contract/models/resource_calendar_leaves.py
+++ b/addons/hr_contract/models/resource_calendar_leaves.py
@@ -7,7 +7,7 @@
class ResourceCalendarLeaves(models.Model):
- _inherit = 'resource.calendar.leaves'
+ _inherit = ['resource.calendar.leaves']
def _compute_calendar_id(self):
def date2datetime(date, tz):
diff --git a/addons/hr_contract/models/resource_resource.py b/addons/hr_contract/models/resource_resource.py
index 680a8b2436e3e..2ec30608b593a 100644
--- a/addons/hr_contract/models/resource_resource.py
+++ b/addons/hr_contract/models/resource_resource.py
@@ -7,8 +7,9 @@
from odoo import models
from odoo.addons.resource.models.utils import Intervals
+
class ResourceResource(models.Model):
- _inherit = 'resource.resource'
+ _inherit = ['resource.resource']
def _get_calendars_validity_within_period(self, start, end, default_company=None):
assert start.tzinfo and end.tzinfo
diff --git a/addons/hr_contract/report/hr_contract_history.py b/addons/hr_contract/report/hr_contract_history.py
index 4b0b2530b0b2d..765736a07fd53 100644
--- a/addons/hr_contract/report/hr_contract_history.py
+++ b/addons/hr_contract/report/hr_contract_history.py
@@ -6,8 +6,7 @@
from collections import defaultdict
-class ContractHistory(models.Model):
- _name = 'hr.contract.history'
+class HrContractHistory(models.Model):
_description = 'Contract history'
_auto = False
_order = 'is_under_contract'
diff --git a/addons/hr_contract/wizard/hr_departure_wizard.py b/addons/hr_contract/wizard/hr_departure_wizard.py
index 964ca4691d66d..80b24839168a5 100644
--- a/addons/hr_contract/wizard/hr_departure_wizard.py
+++ b/addons/hr_contract/wizard/hr_departure_wizard.py
@@ -6,7 +6,7 @@
class HrDepartureWizard(models.TransientModel):
- _inherit = 'hr.departure.wizard'
+ _inherit = ['hr.departure.wizard']
def _get_employee_departure_date(self):
employee = self.env['hr.employee'].browse(self.env.context['active_id'])
diff --git a/addons/hr_contract/wizard/mail_activity_schedule.py b/addons/hr_contract/wizard/mail_activity_schedule.py
index d15ceceb86f20..dd422fee416df 100644
--- a/addons/hr_contract/wizard/mail_activity_schedule.py
+++ b/addons/hr_contract/wizard/mail_activity_schedule.py
@@ -6,7 +6,7 @@
class MailActivitySchedule(models.TransientModel):
- _inherit = 'mail.activity.schedule'
+ _inherit = ['mail.activity.schedule']
def _compute_plan_date(self):
todo = self.filtered(lambda s: s.res_model == 'hr.employee')
diff --git a/addons/hr_expense/models/account_move.py b/addons/hr_expense/models/account_move.py
index 7c984bb0f058c..a202d816a87b3 100644
--- a/addons/hr_expense/models/account_move.py
+++ b/addons/hr_expense/models/account_move.py
@@ -7,7 +7,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
expense_sheet_id = fields.Many2one(comodel_name='hr.expense.sheet', ondelete='set null', copy=False, index='btree_not_null')
show_commercial_partner_warning = fields.Boolean(compute='_compute_show_commercial_partner_warning')
diff --git a/addons/hr_expense/models/account_move_line.py b/addons/hr_expense/models/account_move_line.py
index bacd5fcf35733..e99ca0355d40a 100644
--- a/addons/hr_expense/models/account_move_line.py
+++ b/addons/hr_expense/models/account_move_line.py
@@ -7,7 +7,7 @@
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
expense_id = fields.Many2one('hr.expense', string='Expense', copy=True) # copy=True, else we don't know price is tax incl.
diff --git a/addons/hr_expense/models/account_payment.py b/addons/hr_expense/models/account_payment.py
index b6dd153875ffe..5fb0c451438f7 100644
--- a/addons/hr_expense/models/account_payment.py
+++ b/addons/hr_expense/models/account_payment.py
@@ -6,7 +6,7 @@
class AccountPayment(models.Model):
- _inherit = "account.payment"
+ _inherit = ["account.payment"]
expense_sheet_id = fields.Many2one(related='move_id.expense_sheet_id')
diff --git a/addons/hr_expense/models/account_tax.py b/addons/hr_expense/models/account_tax.py
index 27f7bd3f65d09..3147008013057 100644
--- a/addons/hr_expense/models/account_tax.py
+++ b/addons/hr_expense/models/account_tax.py
@@ -4,7 +4,7 @@
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
def _hook_compute_is_used(self, taxes_to_compute):
# OVERRIDE in order to fetch taxes used in expenses
diff --git a/addons/hr_expense/models/analytic.py b/addons/hr_expense/models/analytic.py
index 70da9e5f133af..563c78ffe0d7b 100644
--- a/addons/hr_expense/models/analytic.py
+++ b/addons/hr_expense/models/analytic.py
@@ -7,7 +7,7 @@
class AccountAnalyticApplicability(models.Model):
- _inherit = 'account.analytic.applicability'
+ _inherit = ['account.analytic.applicability']
_description = "Analytic Plan's Applicabilities"
business_domain = fields.Selection(
@@ -25,7 +25,7 @@ def _compute_display_account_prefix(self):
class AccountAnalyticAccount(models.Model):
- _inherit = 'account.analytic.account'
+ _inherit = ['account.analytic.account']
@api.ondelete(at_uninstall=False)
def _unlink_except_account_in_analytic_distribution(self):
diff --git a/addons/hr_expense/models/hr_department.py b/addons/hr_expense/models/hr_department.py
index b426002a33a6c..5a8d6cd54828e 100644
--- a/addons/hr_expense/models/hr_department.py
+++ b/addons/hr_expense/models/hr_department.py
@@ -5,7 +5,7 @@
class HrDepartment(models.Model):
- _inherit = 'hr.department'
+ _inherit = ['hr.department']
def _compute_expense_sheets_to_approve(self):
expense_sheet_data = self.env['hr.expense.sheet']._read_group([('department_id', 'in', self.ids), ('state', '=', 'submit')], ['department_id'], ['__count'])
diff --git a/addons/hr_expense/models/hr_employee.py b/addons/hr_expense/models/hr_employee.py
index 88ae36aa96c97..ffcba9fa15fdb 100644
--- a/addons/hr_expense/models/hr_employee.py
+++ b/addons/hr_expense/models/hr_employee.py
@@ -3,8 +3,8 @@
from odoo import fields, models, api
-class EmployeeBase(models.AbstractModel):
- _inherit = 'hr.employee.base'
+class HrEmployeeBase(models.AbstractModel):
+ _inherit = ['hr.employee.base']
filter_for_expense = fields.Boolean(store=False, search='_search_filter_for_expense', groups="hr.group_hr_user")
@@ -30,8 +30,8 @@ def _search_filter_for_expense(self, operator, value):
return res
-class Employee(models.Model):
- _inherit = 'hr.employee'
+class HrEmployee(models.Model):
+ _inherit = ['hr.employee']
def _group_hr_expense_user_domain(self):
# We return the domain only if the group exists for the following reason:
@@ -67,8 +67,8 @@ def _get_user_m2o_to_empty_on_archived_employees(self):
return super()._get_user_m2o_to_empty_on_archived_employees() + ['expense_manager_id']
-class EmployeePublic(models.Model):
- _inherit = 'hr.employee.public'
+class HrEmployeePublic(models.Model):
+ _inherit = ['hr.employee.public']
expense_manager_id = fields.Many2one('res.users', readonly=True)
diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py
index cd080061d0bfd..f30875764dc4c 100644
--- a/addons/hr_expense/models/hr_expense.py
+++ b/addons/hr_expense/models/hr_expense.py
@@ -10,7 +10,6 @@
class HrExpense(models.Model):
- _name = "hr.expense"
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'analytic.mixin']
_description = "Expense"
_order = "date desc, id desc"
diff --git a/addons/hr_expense/models/hr_expense_sheet.py b/addons/hr_expense/models/hr_expense_sheet.py
index 4c562a81c2f67..69bb7d8b3ea09 100644
--- a/addons/hr_expense/models/hr_expense_sheet.py
+++ b/addons/hr_expense/models/hr_expense_sheet.py
@@ -26,7 +26,6 @@ class HrExpenseSheet(models.Model):
Manager Always
=================================================================================
"""
- _name = "hr.expense.sheet"
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
_description = "Expense Report"
_order = "accounting_date desc, id desc"
diff --git a/addons/hr_expense/models/ir_actions_report.py b/addons/hr_expense/models/ir_actions_report.py
index 7de973bea84fb..414e02a3eae46 100644
--- a/addons/hr_expense/models/ir_actions_report.py
+++ b/addons/hr_expense/models/ir_actions_report.py
@@ -5,7 +5,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
def _render_qweb_pdf_prepare_streams(self, report_ref, data, res_ids=None):
# OVERRIDE
diff --git a/addons/hr_expense/models/ir_attachment.py b/addons/hr_expense/models/ir_attachment.py
index 842f9e1679fc0..a32b5fddb6de5 100644
--- a/addons/hr_expense/models/ir_attachment.py
+++ b/addons/hr_expense/models/ir_attachment.py
@@ -2,7 +2,7 @@
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/hr_expense/models/product_product.py b/addons/hr_expense/models/product_product.py
index 97701d652b55f..090a2f1eeb79c 100644
--- a/addons/hr_expense/models/product_product.py
+++ b/addons/hr_expense/models/product_product.py
@@ -2,7 +2,7 @@
class ProductProduct(models.Model):
- _inherit = "product.product"
+ _inherit = ["product.product"]
standard_price_update_warning = fields.Char(compute="_compute_standard_price_update_warning")
diff --git a/addons/hr_expense/models/product_template.py b/addons/hr_expense/models/product_template.py
index 6647220257f41..cbdf4dd2c2abb 100644
--- a/addons/hr_expense/models/product_template.py
+++ b/addons/hr_expense/models/product_template.py
@@ -6,7 +6,7 @@
class ProductTemplate(models.Model):
- _inherit = "product.template"
+ _inherit = ["product.template"]
@api.model
def default_get(self, fields):
diff --git a/addons/hr_expense/models/res_company.py b/addons/hr_expense/models/res_company.py
index a7da7d0dba37c..a54a7cee5f101 100644
--- a/addons/hr_expense/models/res_company.py
+++ b/addons/hr_expense/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
expense_journal_id = fields.Many2one(
"account.journal",
diff --git a/addons/hr_expense/models/res_config_settings.py b/addons/hr_expense/models/res_config_settings.py
index b0e7137600e09..d923cc3e29dbe 100644
--- a/addons/hr_expense/models/res_config_settings.py
+++ b/addons/hr_expense/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
hr_expense_alias_prefix = fields.Char(
'Default Alias Name for Expenses',
diff --git a/addons/hr_expense/wizard/account_payment_register.py b/addons/hr_expense/wizard/account_payment_register.py
index e712bc44d1c64..d973b1099f9fb 100644
--- a/addons/hr_expense/wizard/account_payment_register.py
+++ b/addons/hr_expense/wizard/account_payment_register.py
@@ -4,7 +4,7 @@
class AccountPaymentRegister(models.TransientModel):
- _inherit = 'account.payment.register'
+ _inherit = ['account.payment.register']
# -------------------------------------------------------------------------
# BUSINESS METHODS
diff --git a/addons/hr_expense/wizard/hr_expense_approve_duplicate.py b/addons/hr_expense/wizard/hr_expense_approve_duplicate.py
index 02de0115a4121..d8919013334e6 100644
--- a/addons/hr_expense/wizard/hr_expense_approve_duplicate.py
+++ b/addons/hr_expense/wizard/hr_expense_approve_duplicate.py
@@ -10,7 +10,6 @@ class HrExpenseApproveDuplicate(models.TransientModel):
approved. The user has the opportunity to still validate it or decline.
"""
- _name = "hr.expense.approve.duplicate"
_description = "Expense Approve Duplicate"
sheet_ids = fields.Many2many('hr.expense.sheet')
diff --git a/addons/hr_expense/wizard/hr_expense_refuse_reason.py b/addons/hr_expense/wizard/hr_expense_refuse_reason.py
index bce989fc8d6a0..b83364075dd7a 100644
--- a/addons/hr_expense/wizard/hr_expense_refuse_reason.py
+++ b/addons/hr_expense/wizard/hr_expense_refuse_reason.py
@@ -7,7 +7,6 @@
class HrExpenseRefuseWizard(models.TransientModel):
""" Wizard to specify reason on expense sheet refusal """
- _name = "hr.expense.refuse.wizard"
_description = "Expense Refuse Reason Wizard"
reason = fields.Char(string='Reason', required=True)
diff --git a/addons/hr_expense/wizard/hr_expense_split.py b/addons/hr_expense/wizard/hr_expense_split.py
index 403ac26fabe03..1193f63d060b5 100644
--- a/addons/hr_expense/wizard/hr_expense_split.py
+++ b/addons/hr_expense/wizard/hr_expense_split.py
@@ -6,7 +6,6 @@
class HrExpenseSplit(models.TransientModel):
- _name = 'hr.expense.split'
_inherit = ['analytic.mixin']
_description = 'Expense Split'
_check_company_auto = True
diff --git a/addons/hr_expense/wizard/hr_expense_split_wizard.py b/addons/hr_expense/wizard/hr_expense_split_wizard.py
index caf315fc0d851..392cc07e4e8fe 100644
--- a/addons/hr_expense/wizard/hr_expense_split_wizard.py
+++ b/addons/hr_expense/wizard/hr_expense_split_wizard.py
@@ -4,7 +4,6 @@
class HrExpenseSplitWizard(models.TransientModel):
- _name = 'hr.expense.split.wizard'
_description = 'Expense Split Wizard'
expense_id = fields.Many2one(comodel_name='hr.expense', string='Expense', required=True)
diff --git a/addons/hr_fleet/models/employee.py b/addons/hr_fleet/models/employee.py
index 8e5533a04f993..f12dc8b097b98 100644
--- a/addons/hr_fleet/models/employee.py
+++ b/addons/hr_fleet/models/employee.py
@@ -5,8 +5,8 @@
from odoo.exceptions import ValidationError
-class Employee(models.Model):
- _inherit = 'hr.employee'
+class HrEmployee(models.Model):
+ _inherit = ['hr.employee']
employee_cars_count = fields.Integer(compute="_compute_employee_cars_count", string="Cars", groups="fleet.fleet_group_manager")
car_ids = fields.One2many(
@@ -86,7 +86,7 @@ def _sync_employee_cars(self, user):
car.driver_id = user.partner_id
-class EmployeePublic(models.Model):
- _inherit = 'hr.employee.public'
+class HrEmployeePublic(models.Model):
+ _inherit = ['hr.employee.public']
mobility_card = fields.Char(readonly=True)
diff --git a/addons/hr_fleet/models/fleet_vehicle.py b/addons/hr_fleet/models/fleet_vehicle.py
index 44ed3fa6c1eea..fa56ce5f89c27 100644
--- a/addons/hr_fleet/models/fleet_vehicle.py
+++ b/addons/hr_fleet/models/fleet_vehicle.py
@@ -4,8 +4,9 @@
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
+
class FleetVehicle(models.Model):
- _inherit = 'fleet.vehicle'
+ _inherit = ['fleet.vehicle']
mobility_card = fields.Char(compute='_compute_mobility_card', store=True)
driver_employee_id = fields.Many2one(
diff --git a/addons/hr_fleet/models/fleet_vehicle_assignation_log.py b/addons/hr_fleet/models/fleet_vehicle_assignation_log.py
index dbcdf40e86212..0695a60f961c9 100644
--- a/addons/hr_fleet/models/fleet_vehicle_assignation_log.py
+++ b/addons/hr_fleet/models/fleet_vehicle_assignation_log.py
@@ -5,7 +5,7 @@
class FleetVehicleAssignationLog(models.Model):
- _inherit = 'fleet.vehicle.assignation.log'
+ _inherit = ['fleet.vehicle.assignation.log']
driver_employee_id = fields.Many2one('hr.employee', string='Driver (Employee)', compute='_compute_driver_employee_id', store=True, readonly=False)
attachment_number = fields.Integer('Number of Attachments', compute='_compute_attachment_number')
diff --git a/addons/hr_fleet/models/fleet_vehicle_log_contract.py b/addons/hr_fleet/models/fleet_vehicle_log_contract.py
index 42a2ce742549d..64745df5b4381 100644
--- a/addons/hr_fleet/models/fleet_vehicle_log_contract.py
+++ b/addons/hr_fleet/models/fleet_vehicle_log_contract.py
@@ -3,8 +3,9 @@
from odoo import fields, models, _
+
class FleetVehicleLogContract(models.Model):
- _inherit = 'fleet.vehicle.log.contract'
+ _inherit = ['fleet.vehicle.log.contract']
purchaser_employee_id = fields.Many2one(
related='vehicle_id.driver_employee_id',
diff --git a/addons/hr_fleet/models/fleet_vehicle_log_services.py b/addons/hr_fleet/models/fleet_vehicle_log_services.py
index 8bf089bf6c48e..f4a68e0d9be69 100644
--- a/addons/hr_fleet/models/fleet_vehicle_log_services.py
+++ b/addons/hr_fleet/models/fleet_vehicle_log_services.py
@@ -3,8 +3,9 @@
from odoo import api, fields, models
+
class FleetVehicleLogServices(models.Model):
- _inherit = 'fleet.vehicle.log.services'
+ _inherit = ['fleet.vehicle.log.services']
purchaser_employee_id = fields.Many2one(
'hr.employee', string="Driver (Employee)",
diff --git a/addons/hr_fleet/models/fleet_vehicle_odometer.py b/addons/hr_fleet/models/fleet_vehicle_odometer.py
index 474b5ba03f268..987e2de2e03ea 100644
--- a/addons/hr_fleet/models/fleet_vehicle_odometer.py
+++ b/addons/hr_fleet/models/fleet_vehicle_odometer.py
@@ -5,7 +5,7 @@
class FleetVehicleOdometer(models.Model):
- _inherit = 'fleet.vehicle.odometer'
+ _inherit = ['fleet.vehicle.odometer']
driver_employee_id = fields.Many2one(
related='vehicle_id.driver_employee_id', string='Driver (Employee)',
diff --git a/addons/hr_fleet/models/mail_activity_plan_template.py b/addons/hr_fleet/models/mail_activity_plan_template.py
index 5312ae52db5e8..975c5f234f8df 100644
--- a/addons/hr_fleet/models/mail_activity_plan_template.py
+++ b/addons/hr_fleet/models/mail_activity_plan_template.py
@@ -6,7 +6,7 @@
class MailActivityPlanTemplate(models.Model):
- _inherit = 'mail.activity.plan.template'
+ _inherit = ['mail.activity.plan.template']
responsible_type = fields.Selection(
selection_add=[('fleet_manager', "Fleet Manager")],
diff --git a/addons/hr_fleet/wizard/hr_departure_wizard.py b/addons/hr_fleet/wizard/hr_departure_wizard.py
index fe7030596a98a..52af47b8321d9 100644
--- a/addons/hr_fleet/wizard/hr_departure_wizard.py
+++ b/addons/hr_fleet/wizard/hr_departure_wizard.py
@@ -5,7 +5,7 @@
class HrDepartureWizard(models.TransientModel):
- _inherit = 'hr.departure.wizard'
+ _inherit = ['hr.departure.wizard']
release_campany_car = fields.Boolean("Release Company Car", default=lambda self: self.env.user.has_group('fleet.fleet_group_user'))
diff --git a/addons/hr_gamification/models/gamification.py b/addons/hr_gamification/models/gamification.py
index 735619a8530b2..d7825c488daf7 100644
--- a/addons/hr_gamification/models/gamification.py
+++ b/addons/hr_gamification/models/gamification.py
@@ -7,7 +7,7 @@
class GamificationBadgeUser(models.Model):
"""User having received a badge"""
- _inherit = 'gamification.badge.user'
+ _inherit = ['gamification.badge.user']
employee_id = fields.Many2one('hr.employee', string='Employee', index=True)
@@ -27,8 +27,9 @@ def action_open_badge(self):
'res_id': self.badge_id.id,
}
+
class GamificationBadge(models.Model):
- _inherit = 'gamification.badge'
+ _inherit = ['gamification.badge']
granted_employees_count = fields.Integer(compute="_compute_granted_employees_count")
diff --git a/addons/hr_gamification/models/hr_employee.py b/addons/hr_gamification/models/hr_employee.py
index a8591caaf982a..245c4f05a5087 100644
--- a/addons/hr_gamification/models/hr_employee.py
+++ b/addons/hr_gamification/models/hr_employee.py
@@ -5,7 +5,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
goal_ids = fields.One2many('gamification.goal', string='Employee HR Goals', compute='_compute_employee_goals')
badge_ids = fields.One2many(
diff --git a/addons/hr_gamification/models/res_users.py b/addons/hr_gamification/models/res_users.py
index f5a301f7b1542..73e72680ce365 100644
--- a/addons/hr_gamification/models/res_users.py
+++ b/addons/hr_gamification/models/res_users.py
@@ -5,7 +5,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
goal_ids = fields.One2many('gamification.goal', 'user_id')
badge_ids = fields.One2many('gamification.badge.user', 'user_id')
diff --git a/addons/hr_gamification/wizard/gamification_badge_user_wizard.py b/addons/hr_gamification/wizard/gamification_badge_user_wizard.py
index d281827383d52..ff1a6f716dcc1 100644
--- a/addons/hr_gamification/wizard/gamification_badge_user_wizard.py
+++ b/addons/hr_gamification/wizard/gamification_badge_user_wizard.py
@@ -6,7 +6,7 @@
class GamificationBadgeUserWizard(models.TransientModel):
- _inherit = 'gamification.badge.user.wizard'
+ _inherit = ['gamification.badge.user.wizard']
employee_id = fields.Many2one('hr.employee', string='Employee', required=False)
user_id = fields.Many2one('res.users', string='User', compute='_compute_user_id',
diff --git a/addons/hr_holidays/models/calendar_event.py b/addons/hr_holidays/models/calendar_event.py
index 35b2907bc7918..6cdd7e5bd954a 100644
--- a/addons/hr_holidays/models/calendar_event.py
+++ b/addons/hr_holidays/models/calendar_event.py
@@ -2,7 +2,7 @@
class CalendarEvent(models.Model):
- _inherit = 'calendar.event'
+ _inherit = ['calendar.event']
def _need_video_call(self):
""" Determine if the event needs a video call or not depending
diff --git a/addons/hr_holidays/models/hr_department.py b/addons/hr_holidays/models/hr_department.py
index 0bc594e8eef95..7697c06c93c35 100644
--- a/addons/hr_holidays/models/hr_department.py
+++ b/addons/hr_holidays/models/hr_department.py
@@ -8,9 +8,9 @@
import ast
-class Department(models.Model):
+class HrDepartment(models.Model):
- _inherit = 'hr.department'
+ _inherit = ['hr.department']
absence_of_today = fields.Integer(
compute='_compute_leave_count', string='Absence by Today')
diff --git a/addons/hr_holidays/models/hr_employee.py b/addons/hr_holidays/models/hr_employee.py
index 05a4bd9ca394f..1c37561a3cf06 100644
--- a/addons/hr_holidays/models/hr_employee.py
+++ b/addons/hr_holidays/models/hr_employee.py
@@ -12,7 +12,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
leave_manager_id = fields.Many2one(
'res.users', string='Time Off',
@@ -271,8 +271,9 @@ def write(self, values):
allocations.write(hr_vals)
return res
+
class HrEmployee(models.Model):
- _inherit = 'hr.employee'
+ _inherit = ['hr.employee']
current_leave_id = fields.Many2one('hr.leave.type', compute='_compute_current_leave', string="Current Time Off Type",
groups="hr.group_hr_user")
diff --git a/addons/hr_holidays/models/hr_employee_base.py b/addons/hr_holidays/models/hr_employee_base.py
index f13f2578d8aa8..d6b54639f6471 100644
--- a/addons/hr_holidays/models/hr_employee_base.py
+++ b/addons/hr_holidays/models/hr_employee_base.py
@@ -5,7 +5,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
def _compute_presence_state(self):
super()._compute_presence_state()
diff --git a/addons/hr_holidays/models/hr_leave.py b/addons/hr_holidays/models/hr_leave.py
index 260c8ed16fdb6..b60c973f84ff3 100644
--- a/addons/hr_holidays/models/hr_leave.py
+++ b/addons/hr_holidays/models/hr_leave.py
@@ -31,7 +31,8 @@ def get_employee_from_context(values, context, user_employee_id):
employee_id_value = employee_ids[0] if employee_ids else False
return employee_id_value or context.get('default_employee_id', context.get('employee_id', user_employee_id))
-class HolidaysRequest(models.Model):
+
+class HrLeave(models.Model):
""" Time Off Requests Access specifications
- a regular employee / user
@@ -66,7 +67,6 @@ class HolidaysRequest(models.Model):
On top of that multicompany rules apply based on company defined on the
leave request leave type.
"""
- _name = "hr.leave"
_description = "Time Off"
_order = "date_from desc"
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
@@ -74,7 +74,7 @@ class HolidaysRequest(models.Model):
@api.model
def default_get(self, fields_list):
- defaults = super(HolidaysRequest, self).default_get(fields_list)
+ defaults = super().default_get(fields_list)
defaults = self._default_get_request_dates(defaults)
lt = self.env['hr.leave.type']
@@ -226,7 +226,7 @@ def _default_get_request_dates(self, values):
]
def _auto_init(self):
- res = super(HolidaysRequest, self)._auto_init()
+ res = super()._auto_init()
tools.create_index(self._cr, 'hr_leave_date_to_date_from_index',
self._table, ['date_to', 'date_from'])
return res
@@ -727,7 +727,7 @@ def create(self, vals_list):
if mapped_validation_type[leave_type_id] == 'both':
self._check_double_validation_rules(employee_id, values.get('state', False))
- holidays = super(HolidaysRequest, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
+ holidays = super(HrLeave, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
holidays._check_validity()
for holiday in holidays:
@@ -776,7 +776,7 @@ def write(self, values):
values['request_date_from'] = values['date_from']
if 'date_to' in values:
values['request_date_to'] = values['date_to']
- result = super(HolidaysRequest, self).write(values)
+ result = super().write(values)
if any(field in values for field in ['request_date_from', 'date_from', 'request_date_from', 'date_to', 'holiday_status_id', 'employee_id', 'state']):
self._check_validity()
if not self.env.context.get('leave_fast_create'):
@@ -804,7 +804,7 @@ def _unlink_if_correct_states(self):
def unlink(self):
self.sudo()._post_leave_cancel()
- return super(HolidaysRequest, self.with_context(leave_skip_date_check=True)).unlink()
+ return super(HrLeave, self.with_context(leave_skip_date_check=True)).unlink()
def copy_data(self, default=None):
vals_list = super().copy_data(default=default)
@@ -1318,7 +1318,7 @@ 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)
+ return super()._track_subtype(init_values)
def _notify_get_recipients_groups(self, message, model_description, msg_vals=None):
""" Handle HR users and officers recipients that can validate or refuse holidays
@@ -1360,8 +1360,8 @@ def message_subscribe(self, partner_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 any(holiday.state in ['validate', 'validate1'] for holiday in self):
self.check_access('read')
- return super(HolidaysRequest, self.sudo()).message_subscribe(partner_ids=partner_ids, subtype_ids=subtype_ids)
- return super(HolidaysRequest, self).message_subscribe(partner_ids=partner_ids, subtype_ids=subtype_ids)
+ return super(HrLeave, self.sudo()).message_subscribe(partner_ids=partner_ids, subtype_ids=subtype_ids)
+ return super().message_subscribe(partner_ids=partner_ids, subtype_ids=subtype_ids)
@api.model
def get_unusual_days(self, date_from, date_to=None):
diff --git a/addons/hr_holidays/models/hr_leave_accrual_plan.py b/addons/hr_holidays/models/hr_leave_accrual_plan.py
index 8a607fa407251..33ebc7fe2cb1f 100644
--- a/addons/hr_holidays/models/hr_leave_accrual_plan.py
+++ b/addons/hr_holidays/models/hr_leave_accrual_plan.py
@@ -10,8 +10,7 @@
DAY_SELECT_SELECTION_NO_LAST = tuple(zip(DAY_SELECT_VALUES, (str(i) for i in range(1, 29))))
-class AccrualPlan(models.Model):
- _name = "hr.leave.accrual.plan"
+class HrLeaveAccrualPlan(models.Model):
_description = "Accrual Plan"
active = fields.Boolean(default=True)
diff --git a/addons/hr_holidays/models/hr_leave_accrual_plan_level.py b/addons/hr_holidays/models/hr_leave_accrual_plan_level.py
index f13067aebfedc..cc31f78c2d20d 100644
--- a/addons/hr_holidays/models/hr_leave_accrual_plan_level.py
+++ b/addons/hr_holidays/models/hr_leave_accrual_plan_level.py
@@ -16,8 +16,7 @@ def _get_selection_days(self):
return DAY_SELECT_SELECTION_NO_LAST + (("last", _("last day")),)
-class AccrualPlanLevel(models.Model):
- _name = "hr.leave.accrual.level"
+class HrLeaveAccrualLevel(models.Model):
_description = "Accrual Plan Level"
_order = 'sequence asc'
diff --git a/addons/hr_holidays/models/hr_leave_allocation.py b/addons/hr_holidays/models/hr_leave_allocation.py
index 242e11eed9137..dbe6de1254c91 100644
--- a/addons/hr_holidays/models/hr_leave_allocation.py
+++ b/addons/hr_holidays/models/hr_leave_allocation.py
@@ -15,9 +15,9 @@
MONTHS_TO_INTEGER = {"jan": 1, "feb": 2, "mar": 3, "apr": 4, "may": 5, "jun": 6, "jul": 7, "aug": 8, "sep": 9, "oct": 10, "nov": 11, "dec": 12}
-class HolidaysAllocation(models.Model):
+
+class HrLeaveAllocation(models.Model):
""" Allocation Requests Access specifications: similar to leave requests """
- _name = "hr.leave.allocation"
_description = "Time Off Allocation"
_order = "create_date desc"
_inherit = ['mail.thread', 'mail.activity.mixin']
@@ -670,7 +670,7 @@ def create(self, vals_list):
employee_id = values.get('employee_id', False)
if not values.get('department_id'):
values.update({'department_id': self.env['hr.employee'].browse(employee_id).department_id.id})
- allocations = super(HolidaysAllocation, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
+ allocations = super(HrLeaveAllocation, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
allocations._add_lastcalls()
for allocation in allocations:
partners_to_subscribe = set()
@@ -936,7 +936,7 @@ 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)
+ return super()._track_subtype(init_values)
def _notify_get_recipients_groups(self, message, model_description, msg_vals=None):
""" Handle HR users and officers recipients that can validate or refuse holidays
@@ -975,5 +975,5 @@ def message_subscribe(self, partner_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 any(state in ['validate'] for state in self.mapped('state')):
self.check_access('read')
- return super(HolidaysAllocation, self.sudo()).message_subscribe(partner_ids=partner_ids, subtype_ids=subtype_ids)
+ return super(HrLeaveAllocation, self.sudo()).message_subscribe(partner_ids=partner_ids, subtype_ids=subtype_ids)
return super().message_subscribe(partner_ids=partner_ids, subtype_ids=subtype_ids)
diff --git a/addons/hr_holidays/models/hr_leave_mandatory_day.py b/addons/hr_holidays/models/hr_leave_mandatory_day.py
index fe8f067f536f4..d335f2e1062de 100644
--- a/addons/hr_holidays/models/hr_leave_mandatory_day.py
+++ b/addons/hr_holidays/models/hr_leave_mandatory_day.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class MandatoryDay(models.Model):
- _name = 'hr.leave.mandatory.day'
+class HrLeaveMandatoryDay(models.Model):
_description = 'Mandatory Day'
_order = 'start_date desc, end_date desc'
diff --git a/addons/hr_holidays/models/hr_leave_type.py b/addons/hr_holidays/models/hr_leave_type.py
index 05723cb662874..971ba729a18ac 100644
--- a/addons/hr_holidays/models/hr_leave_type.py
+++ b/addons/hr_holidays/models/hr_leave_type.py
@@ -18,8 +18,7 @@
_logger = logging.getLogger(__name__)
-class HolidaysType(models.Model):
- _name = "hr.leave.type"
+class HrLeaveType(models.Model):
_description = "Time Off Type"
_order = 'sequence'
diff --git a/addons/hr_holidays/models/mail_message_subtype.py b/addons/hr_holidays/models/mail_message_subtype.py
index 6f09c01663806..75b1a72ca7b0b 100644
--- a/addons/hr_holidays/models/mail_message_subtype.py
+++ b/addons/hr_holidays/models/mail_message_subtype.py
@@ -9,7 +9,7 @@
class MailMessageSubtype(models.Model):
- _inherit = 'mail.message.subtype'
+ _inherit = ['mail.message.subtype']
def _get_department_subtype(self):
return self.search([
diff --git a/addons/hr_holidays/models/res_partner.py b/addons/hr_holidays/models/res_partner.py
index 5cbf1650c8896..71b0283f3f9b0 100644
--- a/addons/hr_holidays/models/res_partner.py
+++ b/addons/hr_holidays/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
def _compute_im_status(self):
super(ResPartner, self)._compute_im_status()
diff --git a/addons/hr_holidays/models/res_users.py b/addons/hr_holidays/models/res_users.py
index 41594dd963cbf..7eb571620d2fc 100644
--- a/addons/hr_holidays/models/res_users.py
+++ b/addons/hr_holidays/models/res_users.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models, Command
-class User(models.Model):
- _inherit = "res.users"
+class ResUsers(models.Model):
+ _inherit = ["res.users"]
leave_manager_id = fields.Many2one(related='employee_id.leave_manager_id')
show_leaves = fields.Boolean(related='employee_id.show_leaves')
@@ -32,7 +32,7 @@ def SELF_READABLE_FIELDS(self):
]
def _compute_im_status(self):
- super(User, self)._compute_im_status()
+ super()._compute_im_status()
on_leave_user_ids = self._get_on_leave_ids()
for user in self:
if user.id in on_leave_user_ids:
diff --git a/addons/hr_holidays/models/resource.py b/addons/hr_holidays/models/resource.py
index 4fb7cfb46b1eb..b81f5e4886cfb 100644
--- a/addons/hr_holidays/models/resource.py
+++ b/addons/hr_holidays/models/resource.py
@@ -6,8 +6,9 @@
import pytz
from datetime import datetime
-class CalendarLeaves(models.Model):
- _inherit = "resource.calendar.leaves"
+
+class ResourceCalendarLeaves(models.Model):
+ _inherit = ["resource.calendar.leaves"]
holiday_id = fields.Many2one("hr.leave", string='Time Off Request')
@@ -153,8 +154,9 @@ def unlink(self):
return res
+
class ResourceCalendar(models.Model):
- _inherit = "resource.calendar"
+ _inherit = ["resource.calendar"]
associated_leaves_count = fields.Integer("Time Off Count", compute='_compute_associated_leaves_count')
diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py
index d15a8626791ea..186d1673086e4 100644
--- a/addons/hr_holidays/report/holidays_summary_report.py
+++ b/addons/hr_holidays/report/holidays_summary_report.py
@@ -26,8 +26,7 @@
}
-class HrHolidaySummaryReport(models.AbstractModel):
- _name = 'report.hr_holidays.report_holidayssummary'
+class ReportHr_HolidaysReport_Holidayssummary(models.AbstractModel):
_description = 'Holidays Summary Report'
def _get_header_info(self, start_date, holiday_type):
diff --git a/addons/hr_holidays/report/hr_leave_employee_type_report.py b/addons/hr_holidays/report/hr_leave_employee_type_report.py
index f445162894853..ed82e7322f95c 100644
--- a/addons/hr_holidays/report/hr_leave_employee_type_report.py
+++ b/addons/hr_holidays/report/hr_leave_employee_type_report.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, tools, _
-class LeaveReport(models.Model):
- _name = "hr.leave.employee.type.report"
+class HrLeaveEmployeeTypeReport(models.Model):
_description = 'Time Off Summary / Report'
_auto = False
_order = "date_from DESC, employee_id"
diff --git a/addons/hr_holidays/report/hr_leave_report.py b/addons/hr_holidays/report/hr_leave_report.py
index e123db39a6cbf..5e0d623dc2895 100644
--- a/addons/hr_holidays/report/hr_leave_report.py
+++ b/addons/hr_holidays/report/hr_leave_report.py
@@ -4,10 +4,9 @@
from odoo.osv import expression
-class LeaveReport(models.Model):
- _name = "hr.leave.report"
+class HrLeaveReport(models.Model):
_description = 'Time Off Summary / Report'
- _inherit = "hr.manager.department.report"
+ _inherit = ["hr.manager.department.report"]
_auto = False
_order = "date_from DESC, employee_id"
diff --git a/addons/hr_holidays/report/hr_leave_report_calendar.py b/addons/hr_holidays/report/hr_leave_report_calendar.py
index c16d222979abb..b018212e87c36 100644
--- a/addons/hr_holidays/report/hr_leave_report_calendar.py
+++ b/addons/hr_holidays/report/hr_leave_report_calendar.py
@@ -5,8 +5,7 @@
from odoo.addons.base.models.res_partner import _tz_get
-class LeaveReportCalendar(models.Model):
- _name = "hr.leave.report.calendar"
+class HrLeaveReportCalendar(models.Model):
_description = 'Time Off Calendar'
_auto = False
_order = "start_datetime DESC, employee_id"
diff --git a/addons/hr_holidays/wizard/hr_departure_wizard.py b/addons/hr_holidays/wizard/hr_departure_wizard.py
index 4208f357710e4..389d80ba0aa86 100644
--- a/addons/hr_holidays/wizard/hr_departure_wizard.py
+++ b/addons/hr_holidays/wizard/hr_departure_wizard.py
@@ -6,7 +6,7 @@
class HrDepartureWizard(models.TransientModel):
- _inherit = 'hr.departure.wizard'
+ _inherit = ['hr.departure.wizard']
def action_register_departure(self):
super(HrDepartureWizard, self).action_register_departure()
diff --git a/addons/hr_holidays/wizard/hr_holidays_cancel_leave.py b/addons/hr_holidays/wizard/hr_holidays_cancel_leave.py
index 09d27226ee383..7b820a82b95a3 100644
--- a/addons/hr_holidays/wizard/hr_holidays_cancel_leave.py
+++ b/addons/hr_holidays/wizard/hr_holidays_cancel_leave.py
@@ -5,7 +5,6 @@
class HrHolidaysCancelLeave(models.TransientModel):
- _name = 'hr.holidays.cancel.leave'
_description = 'Cancel Time Off Wizard'
leave_id = fields.Many2one('hr.leave', string="Time Off Request", required=True)
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_employees.py b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
index fccc926996dd1..f24a0f3d5ce0a 100644
--- a/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
@@ -5,9 +5,8 @@
from odoo import api, fields, models
-class HolidaysSummaryEmployee(models.TransientModel):
+class HrHolidaysSummaryEmployee(models.TransientModel):
- _name = 'hr.holidays.summary.employee'
_description = 'HR Time Off Summary Report By Employee'
date_from = fields.Date(string='From', required=True, default=lambda *a: time.strftime('%Y-%m-01'))
diff --git a/addons/hr_holidays/wizard/hr_leave_allocation_generate_multi_wizard.py b/addons/hr_holidays/wizard/hr_leave_allocation_generate_multi_wizard.py
index e53d8084ca9a5..fa3645a7c9139 100644
--- a/addons/hr_holidays/wizard/hr_leave_allocation_generate_multi_wizard.py
+++ b/addons/hr_holidays/wizard/hr_leave_allocation_generate_multi_wizard.py
@@ -5,7 +5,6 @@
class HrLeaveAllocationGenerateMultiWizard(models.TransientModel):
- _name = "hr.leave.allocation.generate.multi.wizard"
_description = 'Generate time off allocations for multiple employees'
name = fields.Char("Description", compute="_compute_name", store=True, readonly=False)
diff --git a/addons/hr_holidays/wizard/hr_leave_generate_multi_wizard.py b/addons/hr_holidays/wizard/hr_leave_generate_multi_wizard.py
index ea4b7f14dfbb0..ca3aa587d94ff 100644
--- a/addons/hr_holidays/wizard/hr_leave_generate_multi_wizard.py
+++ b/addons/hr_holidays/wizard/hr_leave_generate_multi_wizard.py
@@ -8,7 +8,6 @@
class HrLeaveGenerateMultiWizard(models.TransientModel):
- _name = "hr.leave.generate.multi.wizard"
_description = 'Generate time off for multiple employees'
name = fields.Char("Description")
diff --git a/addons/hr_holidays_attendance/models/hr_attendance.py b/addons/hr_holidays_attendance/models/hr_attendance.py
index e98e21f8a62c6..9aea73a0bd20a 100644
--- a/addons/hr_holidays_attendance/models/hr_attendance.py
+++ b/addons/hr_holidays_attendance/models/hr_attendance.py
@@ -6,7 +6,7 @@
class HrAttendance(models.Model):
- _inherit = "hr.attendance"
+ _inherit = ["hr.attendance"]
def _get_overtime_leave_domain(self):
domain = super()._get_overtime_leave_domain()
diff --git a/addons/hr_holidays_attendance/models/hr_leave.py b/addons/hr_holidays_attendance/models/hr_leave.py
index fbe8bfcd18c14..3d46ecf3ad184 100644
--- a/addons/hr_holidays_attendance/models/hr_leave.py
+++ b/addons/hr_holidays_attendance/models/hr_leave.py
@@ -9,8 +9,8 @@
from odoo.tools import float_round
-class HRLeave(models.Model):
- _inherit = 'hr.leave'
+class HrLeave(models.Model):
+ _inherit = ['hr.leave']
overtime_id = fields.Many2one('hr.attendance.overtime', string='Extra Hours')
employee_overtime = fields.Float(related='employee_id.total_overtime', groups='base.group_user')
diff --git a/addons/hr_holidays_attendance/models/hr_leave_accrual_plan_level.py b/addons/hr_holidays_attendance/models/hr_leave_accrual_plan_level.py
index a1e5b3e2cf887..031ac08c9f1e3 100644
--- a/addons/hr_holidays_attendance/models/hr_leave_accrual_plan_level.py
+++ b/addons/hr_holidays_attendance/models/hr_leave_accrual_plan_level.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class AccrualPlanLevel(models.Model):
- _inherit = "hr.leave.accrual.level"
+class HrLeaveAccrualLevel(models.Model):
+ _inherit = ["hr.leave.accrual.level"]
frequency_hourly_source = fields.Selection(
selection=[
diff --git a/addons/hr_holidays_attendance/models/hr_leave_allocation.py b/addons/hr_holidays_attendance/models/hr_leave_allocation.py
index 1b962540e9fd5..9f38842610178 100644
--- a/addons/hr_holidays_attendance/models/hr_leave_allocation.py
+++ b/addons/hr_holidays_attendance/models/hr_leave_allocation.py
@@ -8,8 +8,8 @@
from odoo.osv import expression
-class HolidaysAllocation(models.Model):
- _inherit = 'hr.leave.allocation'
+class HrLeaveAllocation(models.Model):
+ _inherit = ['hr.leave.allocation']
def default_get(self, fields):
res = super().default_get(fields)
diff --git a/addons/hr_holidays_attendance/models/hr_leave_type.py b/addons/hr_holidays_attendance/models/hr_leave_type.py
index 8a4c5f5633b49..9db8fd2ad84ff 100644
--- a/addons/hr_holidays_attendance/models/hr_leave_type.py
+++ b/addons/hr_holidays_attendance/models/hr_leave_type.py
@@ -5,8 +5,8 @@
from odoo import _, api, fields, models
-class HRLeaveType(models.Model):
- _inherit = 'hr.leave.type'
+class HrLeaveType(models.Model):
+ _inherit = ['hr.leave.type']
overtime_deductible = fields.Boolean(
"Deduct Extra Hours", default=False,
@@ -30,7 +30,7 @@ def _compute_display_name(self):
'count': _('%s hours available',
format_duration(employee.total_overtime)),
}
- super(HRLeaveType, self - overtime_leaves)._compute_display_name()
+ super(HrLeaveType, self - overtime_leaves)._compute_display_name()
def get_allocation_data(self, employees, date=None):
res = super().get_allocation_data(employees, date)
diff --git a/addons/hr_holidays_attendance/models/res_users.py b/addons/hr_holidays_attendance/models/res_users.py
index 0a0f8a15c21f0..b5d611b2dd86a 100644
--- a/addons/hr_holidays_attendance/models/res_users.py
+++ b/addons/hr_holidays_attendance/models/res_users.py
@@ -5,7 +5,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
request_overtime = fields.Boolean(compute='_compute_request_overtime')
diff --git a/addons/hr_holidays_contract/models/hr_contract.py b/addons/hr_holidays_contract/models/hr_contract.py
index ad3333b0a48b9..73cd141de490b 100644
--- a/addons/hr_holidays_contract/models/hr_contract.py
+++ b/addons/hr_holidays_contract/models/hr_contract.py
@@ -6,7 +6,7 @@
class HrContract(models.Model):
- _inherit = 'hr.contract'
+ _inherit = ['hr.contract']
_description = 'Employee Contract'
@api.constrains('date_start', 'date_end', 'state')
diff --git a/addons/hr_holidays_contract/models/hr_employee_base.py b/addons/hr_holidays_contract/models/hr_employee_base.py
index d43af14aa8562..ed717359166be 100644
--- a/addons/hr_holidays_contract/models/hr_employee_base.py
+++ b/addons/hr_holidays_contract/models/hr_employee_base.py
@@ -4,7 +4,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
def write(self, vals):
# Prevent the resource calendar of leaves to be updated by a write to
diff --git a/addons/hr_holidays_contract/models/hr_leave.py b/addons/hr_holidays_contract/models/hr_leave.py
index 7e34b608c3f27..8a08412b7ab3a 100644
--- a/addons/hr_holidays_contract/models/hr_leave.py
+++ b/addons/hr_holidays_contract/models/hr_leave.py
@@ -8,7 +8,7 @@
class HrLeave(models.Model):
- _inherit = 'hr.leave'
+ _inherit = ['hr.leave']
def _compute_resource_calendar_id(self):
super()._compute_resource_calendar_id()
diff --git a/addons/hr_homeworking/models/hr_employee.py b/addons/hr_homeworking/models/hr_employee.py
index eddece80bf864..8bfdff3ce4a47 100644
--- a/addons/hr_homeworking/models/hr_employee.py
+++ b/addons/hr_homeworking/models/hr_employee.py
@@ -6,7 +6,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
monday_location_id = fields.Many2one('hr.work.location', string='Monday')
tuesday_location_id = fields.Many2one('hr.work.location', string='Tuesday')
diff --git a/addons/hr_homeworking/models/hr_homeworking.py b/addons/hr_homeworking/models/hr_homeworking.py
index 831573b03303a..f2abc146a0b69 100644
--- a/addons/hr_homeworking/models/hr_homeworking.py
+++ b/addons/hr_homeworking/models/hr_homeworking.py
@@ -6,7 +6,6 @@
class HrEmployeeLocation(models.Model):
- _name = "hr.employee.location"
_description = "Employee Location"
work_location_id = fields.Many2one('hr.work.location', required=True, string="Location")
diff --git a/addons/hr_homeworking/models/hr_work_location.py b/addons/hr_homeworking/models/hr_work_location.py
index 35e8b52472bff..fc64373e03231 100644
--- a/addons/hr_homeworking/models/hr_work_location.py
+++ b/addons/hr_homeworking/models/hr_work_location.py
@@ -5,8 +5,9 @@
from odoo.exceptions import UserError
from odoo.addons.hr_homeworking.models.hr_homeworking import DAYS
-class WorkLocation(models.Model):
- _inherit = "hr.work.location"
+
+class HrWorkLocation(models.Model):
+ _inherit = ["hr.work.location"]
@api.ondelete(at_uninstall=False)
def _unlink_except_used_by_employee(self):
diff --git a/addons/hr_homeworking/models/res_partner.py b/addons/hr_homeworking/models/res_partner.py
index 61b0324ae2c96..03730a61f538d 100644
--- a/addons/hr_homeworking/models/res_partner.py
+++ b/addons/hr_homeworking/models/res_partner.py
@@ -2,8 +2,9 @@
from odoo import models
+
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
def _compute_im_status(self):
super()._compute_im_status()
diff --git a/addons/hr_homeworking/models/res_users.py b/addons/hr_homeworking/models/res_users.py
index 16bf282650864..800fe4911953d 100644
--- a/addons/hr_homeworking/models/res_users.py
+++ b/addons/hr_homeworking/models/res_users.py
@@ -3,6 +3,7 @@
from .hr_homeworking import DAYS
+
class User(models.Model):
_inherit = ['res.users']
diff --git a/addons/hr_homeworking_calendar/models/hr_employee.py b/addons/hr_homeworking_calendar/models/hr_employee.py
index 520b9dbe96bd2..69fa87125cf70 100644
--- a/addons/hr_homeworking_calendar/models/hr_employee.py
+++ b/addons/hr_homeworking_calendar/models/hr_employee.py
@@ -9,7 +9,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
def _get_worklocation(self, start_date, end_date):
work_locations_by_employee = defaultdict(dict)
diff --git a/addons/hr_homeworking_calendar/models/res_partner.py b/addons/hr_homeworking_calendar/models/res_partner.py
index 3d2ad9583bcb2..b69a40ece80ce 100644
--- a/addons/hr_homeworking_calendar/models/res_partner.py
+++ b/addons/hr_homeworking_calendar/models/res_partner.py
@@ -2,8 +2,9 @@
from odoo import models
+
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
def get_worklocation(self, start_date, end_date):
employee_id = self.env['hr.employee'].search([
diff --git a/addons/hr_homeworking_calendar/wizard/homework_location_wizard.py b/addons/hr_homeworking_calendar/wizard/homework_location_wizard.py
index 43ea805f04494..5bfcd7305b42f 100644
--- a/addons/hr_homeworking_calendar/wizard/homework_location_wizard.py
+++ b/addons/hr_homeworking_calendar/wizard/homework_location_wizard.py
@@ -4,8 +4,8 @@
from odoo.addons.hr_homeworking.models.hr_homeworking import DAYS
+
class HomeworkLocationWizard(models.TransientModel):
- _name = 'homework.location.wizard'
_description = 'Set Homework Location Wizard'
work_location_id = fields.Many2one('hr.work.location', required=True, string="Location")
diff --git a/addons/hr_hourly_cost/models/hr_employee.py b/addons/hr_hourly_cost/models/hr_employee.py
index ac29965feaaca..70c8b73622991 100644
--- a/addons/hr_hourly_cost/models/hr_employee.py
+++ b/addons/hr_hourly_cost/models/hr_employee.py
@@ -4,7 +4,7 @@
class HrEmployee(models.Model):
- _inherit = 'hr.employee'
+ _inherit = ['hr.employee']
hourly_cost = fields.Monetary('Hourly Cost', currency_field='currency_id',
groups="hr.group_hr_user", default=0.0)
diff --git a/addons/hr_maintenance/models/equipment.py b/addons/hr_maintenance/models/equipment.py
index d6e727cf18f5b..55ebe5545ba8e 100644
--- a/addons/hr_maintenance/models/equipment.py
+++ b/addons/hr_maintenance/models/equipment.py
@@ -4,7 +4,7 @@
class MaintenanceEquipment(models.Model):
- _inherit = 'maintenance.equipment'
+ _inherit = ['maintenance.equipment']
employee_id = fields.Many2one('hr.employee', compute='_compute_equipment_assign',
store=True, readonly=False, string='Assigned Employee', tracking=True)
@@ -78,7 +78,7 @@ def _track_subtype(self, init_values):
class MaintenanceRequest(models.Model):
- _inherit = 'maintenance.request'
+ _inherit = ['maintenance.request']
@api.returns('self')
def _default_employee_get(self):
diff --git a/addons/hr_maintenance/models/res_users.py b/addons/hr_maintenance/models/res_users.py
index 853fc3d4dc705..8074d9e26b7eb 100644
--- a/addons/hr_maintenance/models/res_users.py
+++ b/addons/hr_maintenance/models/res_users.py
@@ -1,8 +1,8 @@
from odoo import api, models, fields
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
equipment_ids = fields.One2many('maintenance.equipment', 'owner_user_id', string="Managed Equipment")
equipment_count = fields.Integer(related='employee_id.equipment_count', string="Assigned Equipment")
@@ -12,8 +12,8 @@ def SELF_READABLE_FIELDS(self):
return super().SELF_READABLE_FIELDS + ['equipment_count']
-class Employee(models.Model):
- _inherit = 'hr.employee'
+class HrEmployee(models.Model):
+ _inherit = ['hr.employee']
equipment_ids = fields.One2many('maintenance.equipment', 'employee_id', groups="hr.group_hr_user")
equipment_count = fields.Integer('Equipment Count', compute='_compute_equipment_count', groups="hr.group_hr_user")
diff --git a/addons/hr_maintenance/wizard/hr_departure_wizard.py b/addons/hr_maintenance/wizard/hr_departure_wizard.py
index 9fa0d61454e07..4dfb1df17ff70 100644
--- a/addons/hr_maintenance/wizard/hr_departure_wizard.py
+++ b/addons/hr_maintenance/wizard/hr_departure_wizard.py
@@ -4,7 +4,7 @@
class HrDepartureWizard(models.TransientModel):
- _inherit = 'hr.departure.wizard'
+ _inherit = ['hr.departure.wizard']
unassign_equipment = fields.Boolean("Free Equiments", default=True, help="Unassign Employee from Equipments")
diff --git a/addons/hr_org_chart/models/hr_org_chart_mixin.py b/addons/hr_org_chart/models/hr_org_chart_mixin.py
index 3668a4dfdefdb..2264cb17f9c33 100644
--- a/addons/hr_org_chart/models/hr_org_chart_mixin.py
+++ b/addons/hr_org_chart/models/hr_org_chart_mixin.py
@@ -6,7 +6,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
child_all_count = fields.Integer(
'Indirect Subordinates Count',
diff --git a/addons/hr_presence/models/hr_employee.py b/addons/hr_presence/models/hr_employee.py
index df8f6637d2357..c1d826b2d4e7c 100644
--- a/addons/hr_presence/models/hr_employee.py
+++ b/addons/hr_presence/models/hr_employee.py
@@ -10,8 +10,8 @@
_logger = logging.getLogger(__name__)
-class Employee(models.AbstractModel):
- _inherit = 'hr.employee.base'
+class HrEmployeeBase(models.AbstractModel):
+ _inherit = ['hr.employee.base']
email_sent = fields.Boolean(default=False)
ip_connected = fields.Boolean(default=False)
diff --git a/addons/hr_presence/models/hr_employee_base.py b/addons/hr_presence/models/hr_employee_base.py
index 5bf5e30427587..8bb7f11e23265 100644
--- a/addons/hr_presence/models/hr_employee_base.py
+++ b/addons/hr_presence/models/hr_employee_base.py
@@ -3,7 +3,7 @@
class HrEmployeeBase(models.AbstractModel):
- _inherit = "hr.employee.base"
+ _inherit = ["hr.employee.base"]
@api.depends("user_id.im_status", "hr_presence_state_display")
def _compute_presence_state(self):
diff --git a/addons/hr_presence/models/ir_websocket.py b/addons/hr_presence/models/ir_websocket.py
index ecea4e71c81c0..bad3056bb7234 100644
--- a/addons/hr_presence/models/ir_websocket.py
+++ b/addons/hr_presence/models/ir_websocket.py
@@ -7,8 +7,9 @@
from odoo.modules.registry import Registry
from odoo.addons.bus.websocket import wsrequest
+
class IrWebsocket(models.AbstractModel):
- _inherit = 'ir.websocket'
+ _inherit = ['ir.websocket']
def _update_bus_presence(self, inactivity_period, im_status_ids_by_model):
super()._update_bus_presence(inactivity_period, im_status_ids_by_model)
diff --git a/addons/hr_presence/models/res_company.py b/addons/hr_presence/models/res_company.py
index 834fd26cf2165..49e3153ad47d3 100644
--- a/addons/hr_presence/models/res_company.py
+++ b/addons/hr_presence/models/res_company.py
@@ -5,6 +5,6 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
hr_presence_last_compute_date = fields.Datetime()
diff --git a/addons/hr_presence/models/res_config_settings.py b/addons/hr_presence/models/res_config_settings.py
index 7edfba9289888..939d9758f5cf0 100644
--- a/addons/hr_presence/models/res_config_settings.py
+++ b/addons/hr_presence/models/res_config_settings.py
@@ -3,7 +3,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
def create(self, vals):
configs = super().create(vals)
diff --git a/addons/hr_presence/models/res_users_log.py b/addons/hr_presence/models/res_users_log.py
index 9ad3c97df6ed4..72e2457de2da7 100644
--- a/addons/hr_presence/models/res_users_log.py
+++ b/addons/hr_presence/models/res_users_log.py
@@ -4,7 +4,7 @@
class ResUsersLog(models.Model):
- _inherit = 'res.users.log'
+ _inherit = ['res.users.log']
create_uid = fields.Integer(index=True)
ip = fields.Char(string="IP Address")
diff --git a/addons/hr_recruitment/models/calendar.py b/addons/hr_recruitment/models/calendar.py
index 868a90d409631..ff1688231d295 100644
--- a/addons/hr_recruitment/models/calendar.py
+++ b/addons/hr_recruitment/models/calendar.py
@@ -5,7 +5,7 @@
class CalendarEvent(models.Model):
- _inherit = 'calendar.event'
+ _inherit = ['calendar.event']
@api.model
def default_get(self, fields):
diff --git a/addons/hr_recruitment/models/digest.py b/addons/hr_recruitment/models/digest.py
index 398ba9132d9e0..473c8d12c46b2 100644
--- a/addons/hr_recruitment/models/digest.py
+++ b/addons/hr_recruitment/models/digest.py
@@ -5,8 +5,8 @@
from odoo.exceptions import AccessError
-class Digest(models.Model):
- _inherit = 'digest.digest'
+class DigestDigest(models.Model):
+ _inherit = ['digest.digest']
kpi_hr_recruitment_new_colleagues = fields.Boolean('New Employees')
kpi_hr_recruitment_new_colleagues_value = fields.Integer(compute='_compute_kpi_hr_recruitment_new_colleagues_value')
diff --git a/addons/hr_recruitment/models/hr_applicant.py b/addons/hr_recruitment/models/hr_applicant.py
index d9d551175f2aa..c0b6475372f31 100644
--- a/addons/hr_recruitment/models/hr_applicant.py
+++ b/addons/hr_recruitment/models/hr_applicant.py
@@ -19,8 +19,7 @@
]
-class Applicant(models.Model):
- _name = "hr.applicant"
+class HrApplicant(models.Model):
_description = "Applicant"
_order = "priority desc, id desc"
_inherit = ['mail.thread.cc',
@@ -511,7 +510,7 @@ def action_open_other_applications(self):
}
def _track_template(self, changes):
- res = super(Applicant, self)._track_template(changes)
+ res = super()._track_template(changes)
applicant = self[0]
# When applcant is unarchived, they are put back to the default stage automatically. In this case,
# don't post automated message related to the stage change.
@@ -533,7 +532,7 @@ def _track_subtype(self, init_values):
record = self[0]
if 'stage_id' in init_values and record.stage_id:
return self.env.ref('hr_recruitment.mt_applicant_stage_changed')
- return super(Applicant, self)._track_subtype(init_values)
+ return super()._track_subtype(init_values)
def _notify_get_reply_to(self, default=None):
""" Override to set alias of applicants to their job definition if any. """
@@ -541,7 +540,7 @@ def _notify_get_reply_to(self, default=None):
res = {app.id: aliases.get(app.job_id.id) for app in self}
leftover = self.filtered(lambda rec: not rec.job_id)
if leftover:
- res.update(super(Applicant, leftover)._notify_get_reply_to(default=default))
+ res.update(super(HrApplicant, leftover)._notify_get_reply_to(default=default))
return res
def _message_get_suggested_recipients(self):
@@ -623,7 +622,7 @@ def _message_post_after_hook(self, message, msg_vals):
self.search([
('partner_id', '=', False), email_domain, ('stage_id.fold', '=', False)
]).write({'partner_id': new_partner[0].id})
- return super(Applicant, self)._message_post_after_hook(message, msg_vals)
+ return super()._message_post_after_hook(message, msg_vals)
def create_employee_from_applicant(self):
self.ensure_one()
@@ -667,7 +666,7 @@ def reset_applicant(self):
def toggle_active(self):
self = self.with_context(just_unarchived=True)
- res = super(Applicant, self).toggle_active()
+ res = super().toggle_active()
active_applicants = self.filtered(lambda applicant: applicant.active)
if active_applicants:
active_applicants.reset_applicant()
diff --git a/addons/hr_recruitment/models/hr_applicant_category.py b/addons/hr_recruitment/models/hr_applicant_category.py
index b01e4a8ae5a19..148702486db24 100644
--- a/addons/hr_recruitment/models/hr_applicant_category.py
+++ b/addons/hr_recruitment/models/hr_applicant_category.py
@@ -6,8 +6,7 @@
from odoo import fields, models
-class ApplicantCategory(models.Model):
- _name = "hr.applicant.category"
+class HrApplicantCategory(models.Model):
_description = "Category of applicant"
def _get_default_color(self):
diff --git a/addons/hr_recruitment/models/hr_applicant_refuse_reason.py b/addons/hr_recruitment/models/hr_applicant_refuse_reason.py
index 3849872683597..80a95e9cd358c 100644
--- a/addons/hr_recruitment/models/hr_applicant_refuse_reason.py
+++ b/addons/hr_recruitment/models/hr_applicant_refuse_reason.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class ApplicantRefuseReason(models.Model):
- _name = "hr.applicant.refuse.reason"
+class HrApplicantRefuseReason(models.Model):
_description = 'Refuse Reason of Applicant'
_order = 'sequence'
diff --git a/addons/hr_recruitment/models/hr_candidate.py b/addons/hr_recruitment/models/hr_candidate.py
index f9ba17a1c6e88..5652f6d6c1809 100644
--- a/addons/hr_recruitment/models/hr_candidate.py
+++ b/addons/hr_recruitment/models/hr_candidate.py
@@ -10,7 +10,6 @@
class HrCandidate(models.Model):
- _name = "hr.candidate"
_description = "Candidate"
_inherit = ['mail.thread.cc',
'mail.thread.main.attachment',
diff --git a/addons/hr_recruitment/models/hr_department.py b/addons/hr_recruitment/models/hr_department.py
index 29722ab617574..34b80e083166a 100644
--- a/addons/hr_recruitment/models/hr_department.py
+++ b/addons/hr_recruitment/models/hr_department.py
@@ -4,7 +4,7 @@
class HrDepartment(models.Model):
- _inherit = 'hr.department'
+ _inherit = ['hr.department']
new_applicant_count = fields.Integer(
compute='_compute_new_applicant_count', string='New Applicant', compute_sudo=True)
diff --git a/addons/hr_recruitment/models/hr_employee.py b/addons/hr_recruitment/models/hr_employee.py
index 75ce8c2408f5b..d95c8b319ab82 100644
--- a/addons/hr_recruitment/models/hr_employee.py
+++ b/addons/hr_recruitment/models/hr_employee.py
@@ -4,7 +4,7 @@
class HrEmployee(models.Model):
- _inherit = "hr.employee"
+ _inherit = ["hr.employee"]
# YTI Rename into candidate_ids
candidate_id = fields.One2many('hr.candidate', 'employee_id', 'Candidate', groups="hr.group_hr_user")
diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py
index cb2aab14a09a5..6d8f0d1cd7293 100644
--- a/addons/hr_recruitment/models/hr_job.py
+++ b/addons/hr_recruitment/models/hr_job.py
@@ -9,8 +9,7 @@
from odoo.tools.convert import convert_file
-class Job(models.Model):
- _name = "hr.job"
+class HrJob(models.Model):
_inherit = ["mail.alias.mixin", "hr.job"]
_order = "sequence, name asc"
diff --git a/addons/hr_recruitment/models/hr_job_platform.py b/addons/hr_recruitment/models/hr_job_platform.py
index e0d1399f1ef2b..859bbbe7ef839 100644
--- a/addons/hr_recruitment/models/hr_job_platform.py
+++ b/addons/hr_recruitment/models/hr_job_platform.py
@@ -4,8 +4,7 @@
from odoo.tools import email_normalize
-class JobPlatform(models.Model):
- _name = "hr.job.platform"
+class HrJobPlatform(models.Model):
_description = 'Job Platforms'
name = fields.Char(required=True)
diff --git a/addons/hr_recruitment/models/hr_recruitment_degree.py b/addons/hr_recruitment/models/hr_recruitment_degree.py
index 5b3dc7240adc1..fb94ec6b55dc7 100644
--- a/addons/hr_recruitment/models/hr_recruitment_degree.py
+++ b/addons/hr_recruitment/models/hr_recruitment_degree.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class RecruitmentDegree(models.Model):
- _name = "hr.recruitment.degree"
+class HrRecruitmentDegree(models.Model):
_description = "Applicant Degree"
name = fields.Char("Degree Name", required=True, translate=True)
diff --git a/addons/hr_recruitment/models/hr_recruitment_source.py b/addons/hr_recruitment/models/hr_recruitment_source.py
index ed4a64316dffc..71b5ea34bc0d0 100644
--- a/addons/hr_recruitment/models/hr_recruitment_source.py
+++ b/addons/hr_recruitment/models/hr_recruitment_source.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class RecruitmentSource(models.Model):
- _name = "hr.recruitment.source"
+class HrRecruitmentSource(models.Model):
_description = "Source of Applicants"
_inherit = ['utm.source.mixin']
diff --git a/addons/hr_recruitment/models/hr_recruitment_stage.py b/addons/hr_recruitment/models/hr_recruitment_stage.py
index 3d554f190ff07..8c6f25b521662 100644
--- a/addons/hr_recruitment/models/hr_recruitment_stage.py
+++ b/addons/hr_recruitment/models/hr_recruitment_stage.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, _
-class RecruitmentStage(models.Model):
- _name = "hr.recruitment.stage"
+class HrRecruitmentStage(models.Model):
_description = "Recruitment Stages"
_order = 'sequence'
@@ -38,7 +37,7 @@ def default_get(self, fields):
context = dict(self._context)
context.pop('default_job_id')
self = self.with_context(context)
- return super(RecruitmentStage, self).default_get(fields)
+ return super().default_get(fields)
@api.depends('hired_stage')
def _compute_is_warning_visible(self):
diff --git a/addons/hr_recruitment/models/ir_ui_menu.py b/addons/hr_recruitment/models/ir_ui_menu.py
index 2be3ae527f314..19e608786cf14 100644
--- a/addons/hr_recruitment/models/ir_ui_menu.py
+++ b/addons/hr_recruitment/models/ir_ui_menu.py
@@ -5,7 +5,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
def _load_menus_blacklist(self):
res = super()._load_menus_blacklist()
diff --git a/addons/hr_recruitment/models/mail_activity_plan.py b/addons/hr_recruitment/models/mail_activity_plan.py
index becdab2b0f3fb..04b4ccab5d35b 100644
--- a/addons/hr_recruitment/models/mail_activity_plan.py
+++ b/addons/hr_recruitment/models/mail_activity_plan.py
@@ -4,7 +4,7 @@
class MailActivityPlan(models.Model):
- _inherit = 'mail.activity.plan'
+ _inherit = ['mail.activity.plan']
def _compute_department_assignable(self):
super()._compute_department_assignable()
diff --git a/addons/hr_recruitment/models/res_company.py b/addons/hr_recruitment/models/res_company.py
index 4695c4d0a915b..0bbd171c95c6d 100644
--- a/addons/hr_recruitment/models/res_company.py
+++ b/addons/hr_recruitment/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
candidate_properties_definition = fields.PropertiesDefinition('Candidate Properties')
job_properties_definition = fields.PropertiesDefinition("Job Properties")
diff --git a/addons/hr_recruitment/models/res_users.py b/addons/hr_recruitment/models/res_users.py
index 77b7002aacc5b..d9a6d3f12f390 100644
--- a/addons/hr_recruitment/models/res_users.py
+++ b/addons/hr_recruitment/models/res_users.py
@@ -3,8 +3,9 @@
from odoo import models
+
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
def _create_recruitment_interviewers(self):
if not self:
diff --git a/addons/hr_recruitment/models/utm_campaign.py b/addons/hr_recruitment/models/utm_campaign.py
index 7ad0ec6328bea..0465df846368b 100644
--- a/addons/hr_recruitment/models/utm_campaign.py
+++ b/addons/hr_recruitment/models/utm_campaign.py
@@ -7,7 +7,7 @@
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
@api.ondelete(at_uninstall=False)
def _unlink_except_utm_campaign_job(self):
diff --git a/addons/hr_recruitment/models/utm_source.py b/addons/hr_recruitment/models/utm_source.py
index 9904059b9a09e..a36d94b3f800e 100644
--- a/addons/hr_recruitment/models/utm_source.py
+++ b/addons/hr_recruitment/models/utm_source.py
@@ -7,7 +7,7 @@
class UtmSource(models.Model):
- _inherit = 'utm.source'
+ _inherit = ['utm.source']
@api.ondelete(at_uninstall=False)
def _unlink_except_linked_recruitment_sources(self):
diff --git a/addons/hr_recruitment/wizard/applicant_refuse_reason.py b/addons/hr_recruitment/wizard/applicant_refuse_reason.py
index 6b0c3db21bda5..d26432bb53bd7 100644
--- a/addons/hr_recruitment/wizard/applicant_refuse_reason.py
+++ b/addons/hr_recruitment/wizard/applicant_refuse_reason.py
@@ -9,7 +9,6 @@
class ApplicantGetRefuseReason(models.TransientModel):
- _name = 'applicant.get.refuse.reason'
_description = 'Get Refuse Reason'
refuse_reason_id = fields.Many2one('hr.applicant.refuse.reason', 'Refuse Reason', required=True)
diff --git a/addons/hr_recruitment/wizard/applicant_send_mail.py b/addons/hr_recruitment/wizard/applicant_send_mail.py
index 66c2a89779227..6f1296e5f50c4 100644
--- a/addons/hr_recruitment/wizard/applicant_send_mail.py
+++ b/addons/hr_recruitment/wizard/applicant_send_mail.py
@@ -4,8 +4,7 @@
class ApplicantSendMail(models.TransientModel):
- _name = 'applicant.send.mail'
- _inherit = 'mail.composer.mixin'
+ _inherit = ['mail.composer.mixin']
_description = 'Send mails to applicants'
applicant_ids = fields.Many2many('hr.applicant', string='Applications', required=True)
diff --git a/addons/hr_recruitment/wizard/candidate_send_mail.py b/addons/hr_recruitment/wizard/candidate_send_mail.py
index 5d1330fe280f7..4a30ac3118232 100644
--- a/addons/hr_recruitment/wizard/candidate_send_mail.py
+++ b/addons/hr_recruitment/wizard/candidate_send_mail.py
@@ -2,8 +2,7 @@
class CandidateSendMail(models.TransientModel):
- _name = "candidate.send.mail"
- _inherit = "mail.composer.mixin"
+ _inherit = ["mail.composer.mixin"]
_description = "Send mails to candidates"
candidate_ids = fields.Many2many("hr.candidate", string="Candidates", required=True)
diff --git a/addons/hr_recruitment/wizard/mail_activity_schedule.py b/addons/hr_recruitment/wizard/mail_activity_schedule.py
index 71f4cca694387..cf00e450002ac 100644
--- a/addons/hr_recruitment/wizard/mail_activity_schedule.py
+++ b/addons/hr_recruitment/wizard/mail_activity_schedule.py
@@ -4,7 +4,7 @@
class MailActivitySchedule(models.TransientModel):
- _inherit = 'mail.activity.schedule'
+ _inherit = ['mail.activity.schedule']
def _compute_plan_department_filterable(self):
super()._compute_plan_department_filterable()
diff --git a/addons/hr_recruitment_skills/models/hr_applicant.py b/addons/hr_recruitment_skills/models/hr_applicant.py
index 9b5fb943b4742..af69293073c35 100644
--- a/addons/hr_recruitment_skills/models/hr_applicant.py
+++ b/addons/hr_recruitment_skills/models/hr_applicant.py
@@ -4,7 +4,7 @@
class HrApplicant(models.Model):
- _inherit = 'hr.applicant'
+ _inherit = ['hr.applicant']
candidate_skill_ids = fields.One2many(related="candidate_id.candidate_skill_ids", readonly=False)
skill_ids = fields.Many2many(related="candidate_id.skill_ids", readonly=False)
diff --git a/addons/hr_recruitment_skills/models/hr_candidate.py b/addons/hr_recruitment_skills/models/hr_candidate.py
index 8116e846ae699..c91e460e2277e 100644
--- a/addons/hr_recruitment_skills/models/hr_candidate.py
+++ b/addons/hr_recruitment_skills/models/hr_candidate.py
@@ -6,7 +6,7 @@
class HrCandidate(models.Model):
- _inherit = 'hr.candidate'
+ _inherit = ['hr.candidate']
candidate_skill_ids = fields.One2many('hr.candidate.skill', 'candidate_id', string="Skills")
skill_ids = fields.Many2many('hr.skill', compute='_compute_skill_ids', store=True)
diff --git a/addons/hr_recruitment_skills/models/hr_candidate_skill.py b/addons/hr_recruitment_skills/models/hr_candidate_skill.py
index ed018f834cdb2..030d8056161c5 100644
--- a/addons/hr_recruitment_skills/models/hr_candidate_skill.py
+++ b/addons/hr_recruitment_skills/models/hr_candidate_skill.py
@@ -4,8 +4,7 @@
from odoo.exceptions import ValidationError
-class CandidateSkill(models.Model):
- _name = 'hr.candidate.skill'
+class HrCandidateSkill(models.Model):
_description = "Skill level for a candidate"
_rec_name = 'skill_id'
_order = "skill_level_id"
diff --git a/addons/hr_recruitment_skills/models/hr_job.py b/addons/hr_recruitment_skills/models/hr_job.py
index 43ceace3edb9d..984372c2cafd1 100644
--- a/addons/hr_recruitment_skills/models/hr_job.py
+++ b/addons/hr_recruitment_skills/models/hr_job.py
@@ -5,7 +5,7 @@
class HrJob(models.Model):
- _inherit = "hr.job"
+ _inherit = ["hr.job"]
skill_ids = fields.Many2many(comodel_name='hr.skill', string="Expected Skills")
diff --git a/addons/hr_recruitment_survey/models/hr_applicant.py b/addons/hr_recruitment_survey/models/hr_applicant.py
index 6b51042099850..dade24001fea0 100644
--- a/addons/hr_recruitment_survey/models/hr_applicant.py
+++ b/addons/hr_recruitment_survey/models/hr_applicant.py
@@ -5,8 +5,8 @@
from odoo.exceptions import UserError
-class Applicant(models.Model):
- _inherit = "hr.applicant"
+class HrApplicant(models.Model):
+ _inherit = ["hr.applicant"]
survey_id = fields.Many2one('survey.survey', related='job_id.survey_id', string="Survey", readonly=True)
response_ids = fields.One2many('survey.user_input', 'applicant_id', string="Responses")
diff --git a/addons/hr_recruitment_survey/models/hr_job.py b/addons/hr_recruitment_survey/models/hr_job.py
index 128f0f7436a5c..25ef574ffc04e 100644
--- a/addons/hr_recruitment_survey/models/hr_job.py
+++ b/addons/hr_recruitment_survey/models/hr_job.py
@@ -3,8 +3,8 @@
from odoo import fields, models, _
-class Job(models.Model):
- _inherit = "hr.job"
+class HrJob(models.Model):
+ _inherit = ["hr.job"]
survey_id = fields.Many2one(
'survey.survey', "Interview Form",
diff --git a/addons/hr_recruitment_survey/models/survey_survey.py b/addons/hr_recruitment_survey/models/survey_survey.py
index b6211e9bd9f45..8aa0f8b6fbc1d 100644
--- a/addons/hr_recruitment_survey/models/survey_survey.py
+++ b/addons/hr_recruitment_survey/models/survey_survey.py
@@ -2,8 +2,9 @@
from odoo import api, fields, models
+
class SurveySurvey(models.Model):
- _inherit = 'survey.survey'
+ _inherit = ['survey.survey']
survey_type = fields.Selection(selection_add=[('recruitment', 'Recruitment')], ondelete={'recruitment': 'set default'})
hr_job_ids = fields.One2many("hr.job", "survey_id", string="Job Position")
diff --git a/addons/hr_recruitment_survey/models/survey_user_input.py b/addons/hr_recruitment_survey/models/survey_user_input.py
index 06c259352b6ac..885ccc63a5abd 100644
--- a/addons/hr_recruitment_survey/models/survey_user_input.py
+++ b/addons/hr_recruitment_survey/models/survey_user_input.py
@@ -3,8 +3,8 @@
from odoo import fields, models, _
-class SurveyUserInput(models.Model):
- _inherit = "survey.user_input"
+class SurveyUser_Input(models.Model):
+ _inherit = ["survey.user_input"]
applicant_id = fields.Many2one('hr.applicant', string='Applicant', index='btree_not_null')
diff --git a/addons/hr_recruitment_survey/wizard/survey_invite.py b/addons/hr_recruitment_survey/wizard/survey_invite.py
index e4b44b151f1c4..17d0d65cb8401 100644
--- a/addons/hr_recruitment_survey/wizard/survey_invite.py
+++ b/addons/hr_recruitment_survey/wizard/survey_invite.py
@@ -7,7 +7,7 @@
class SurveyInvite(models.TransientModel):
- _inherit = "survey.invite"
+ _inherit = ["survey.invite"]
applicant_id = fields.Many2one('hr.applicant', string='Applicant')
diff --git a/addons/hr_skills/models/hr_employee.py b/addons/hr_skills/models/hr_employee.py
index 3dbdb257d9610..8b33d319e3dc9 100644
--- a/addons/hr_skills/models/hr_employee.py
+++ b/addons/hr_skills/models/hr_employee.py
@@ -4,8 +4,8 @@
from odoo.tools import convert
-class Employee(models.Model):
- _inherit = 'hr.employee'
+class HrEmployee(models.Model):
+ _inherit = ['hr.employee']
resume_line_ids = fields.One2many('hr.resume.line', 'employee_id', string="Resume lines")
employee_skill_ids = fields.One2many('hr.employee.skill', 'employee_id', string="Skills",
@@ -19,7 +19,7 @@ def _compute_skill_ids(self):
@api.model_create_multi
def create(self, vals_list):
- res = super(Employee, self).create(vals_list)
+ res = super().create(vals_list)
if self.env.context.get('salary_simulation'):
return res
resume_lines_values = []
diff --git a/addons/hr_skills/models/hr_employee_public.py b/addons/hr_skills/models/hr_employee_public.py
index 2bf42989296dd..900a9e1bbb098 100644
--- a/addons/hr_skills/models/hr_employee_public.py
+++ b/addons/hr_skills/models/hr_employee_public.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class EmployeePublic(models.Model):
- _inherit = 'hr.employee.public'
+class HrEmployeePublic(models.Model):
+ _inherit = ['hr.employee.public']
resume_line_ids = fields.One2many('hr.resume.line', 'employee_id', string="Resume lines")
employee_skill_ids = fields.One2many('hr.employee.skill', 'employee_id', string="Skills",
diff --git a/addons/hr_skills/models/hr_employee_skill.py b/addons/hr_skills/models/hr_employee_skill.py
index d7928398d11c1..956b1903d52c2 100644
--- a/addons/hr_skills/models/hr_employee_skill.py
+++ b/addons/hr_skills/models/hr_employee_skill.py
@@ -6,8 +6,8 @@
from collections import defaultdict
-class EmployeeSkill(models.Model):
- _name = 'hr.employee.skill'
+
+class HrEmployeeSkill(models.Model):
_description = "Skill level for an employee"
_order = "skill_type_id, skill_level_id"
_rec_name = "skill_id"
diff --git a/addons/hr_skills/models/hr_employee_skill_log.py b/addons/hr_skills/models/hr_employee_skill_log.py
index 3d33a44bfbdaf..27f1b01d43bc1 100644
--- a/addons/hr_skills/models/hr_employee_skill_log.py
+++ b/addons/hr_skills/models/hr_employee_skill_log.py
@@ -5,7 +5,6 @@
class HrEmployeeSkillLog(models.Model):
- _name = 'hr.employee.skill.log'
_description = "Skills History"
_rec_name = 'skill_id'
_order = "employee_id,date"
diff --git a/addons/hr_skills/models/hr_resume_line.py b/addons/hr_skills/models/hr_resume_line.py
index 035c68be4cb31..ba3ffb29e1335 100644
--- a/addons/hr_skills/models/hr_resume_line.py
+++ b/addons/hr_skills/models/hr_resume_line.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class ResumeLine(models.Model):
- _name = 'hr.resume.line'
+class HrResumeLine(models.Model):
_description = "Resume line of an employee"
_order = "line_type_id, date_end desc, date_start desc"
diff --git a/addons/hr_skills/models/hr_resume_line_type.py b/addons/hr_skills/models/hr_resume_line_type.py
index cd86b7fa3cb54..3472604eceef7 100644
--- a/addons/hr_skills/models/hr_resume_line_type.py
+++ b/addons/hr_skills/models/hr_resume_line_type.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class ResumeLineType(models.Model):
- _name = 'hr.resume.line.type'
+class HrResumeLineType(models.Model):
_description = "Type of a resume line"
_order = "sequence"
diff --git a/addons/hr_skills/models/hr_skill.py b/addons/hr_skills/models/hr_skill.py
index 6b1f33f96ddbe..90d0c44410d85 100644
--- a/addons/hr_skills/models/hr_skill.py
+++ b/addons/hr_skills/models/hr_skill.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class Skill(models.Model):
- _name = 'hr.skill'
+class HrSkill(models.Model):
_description = "Skill"
_order = "sequence, name"
diff --git a/addons/hr_skills/models/hr_skill_level.py b/addons/hr_skills/models/hr_skill_level.py
index 4053b4e85879b..5ac4b2a01539d 100644
--- a/addons/hr_skills/models/hr_skill_level.py
+++ b/addons/hr_skills/models/hr_skill_level.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, _
-class SkillLevel(models.Model):
- _name = 'hr.skill.level'
+class HrSkillLevel(models.Model):
_description = "Skill Level"
_order = "level_progress desc"
diff --git a/addons/hr_skills/models/hr_skill_type.py b/addons/hr_skills/models/hr_skill_type.py
index 8c6d1f3e13b9f..efe3b6fd72fee 100644
--- a/addons/hr_skills/models/hr_skill_type.py
+++ b/addons/hr_skills/models/hr_skill_type.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class SkillType(models.Model):
- _name = 'hr.skill.type'
+class HrSkillType(models.Model):
_description = "Skill Type"
_order = "name"
diff --git a/addons/hr_skills/report/hr_employee_cv_report.py b/addons/hr_skills/report/hr_employee_cv_report.py
index df59da34139ff..fa0e1eede6c7c 100644
--- a/addons/hr_skills/report/hr_employee_cv_report.py
+++ b/addons/hr_skills/report/hr_employee_cv_report.py
@@ -4,8 +4,8 @@
from odoo import _, models
-class EmployeeResumeReport(models.AbstractModel):
- _name = 'report.hr_skills.report_employee_cv'
+
+class ReportHr_SkillsReport_Employee_Cv(models.AbstractModel):
_description = 'Employee Resume'
def _get_report_values(self, docids, data=None):
diff --git a/addons/hr_skills/report/hr_employee_skill_report.py b/addons/hr_skills/report/hr_employee_skill_report.py
index 92cc4e09cbea7..5e9d90ddfa347 100644
--- a/addons/hr_skills/report/hr_employee_skill_report.py
+++ b/addons/hr_skills/report/hr_employee_skill_report.py
@@ -2,10 +2,10 @@
from odoo import fields, models, tools
+
class HrEmployeeSkillReport(models.BaseModel):
_auto = False
- _name = 'hr.employee.skill.report'
- _inherit = "hr.manager.department.report"
+ _inherit = ["hr.manager.department.report"]
_description = 'Employee Skills Report'
_order = 'employee_id, level_progress desc'
diff --git a/addons/hr_skills/wizard/hr_employee_cv_wizard.py b/addons/hr_skills/wizard/hr_employee_cv_wizard.py
index e0ec12e17331f..5bce5166375ac 100644
--- a/addons/hr_skills/wizard/hr_employee_cv_wizard.py
+++ b/addons/hr_skills/wizard/hr_employee_cv_wizard.py
@@ -6,8 +6,7 @@
from odoo import _, api, fields, models
-class HrEmployeeCVWizard(models.TransientModel):
- _name = 'hr.employee.cv.wizard'
+class HrEmployeeCvWizard(models.TransientModel):
_description = 'Print Resume'
employee_ids = fields.Many2many('hr.employee')
diff --git a/addons/hr_skills_slides/models/hr_employee.py b/addons/hr_skills_slides/models/hr_employee.py
index 2295c551c9c07..c5c5b94f250f2 100644
--- a/addons/hr_skills_slides/models/hr_employee.py
+++ b/addons/hr_skills_slides/models/hr_employee.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models, _
-class Employee(models.Model):
- _inherit = 'hr.employee'
+class HrEmployee(models.Model):
+ _inherit = ['hr.employee']
subscribed_courses = fields.Many2many('slide.channel', related='user_partner_id.slide_channel_ids')
has_subscribed_courses = fields.Boolean(compute='_compute_courses_completion_text', groups="hr.group_hr_user,base.group_system")
diff --git a/addons/hr_skills_slides/models/hr_resume_line.py b/addons/hr_skills_slides/models/hr_resume_line.py
index 66d3f71846b2e..0b9b596d1ed85 100644
--- a/addons/hr_skills_slides/models/hr_resume_line.py
+++ b/addons/hr_skills_slides/models/hr_resume_line.py
@@ -4,8 +4,8 @@
from odoo import fields, models, api
-class ResumeLine(models.Model):
- _inherit = 'hr.resume.line'
+class HrResumeLine(models.Model):
+ _inherit = ['hr.resume.line']
display_type = fields.Selection(selection_add=[('course', 'Course')])
channel_id = fields.Many2one('slide.channel', string="Course", readonly=True, index='btree_not_null')
diff --git a/addons/hr_skills_slides/models/slide_channel.py b/addons/hr_skills_slides/models/slide_channel.py
index 4375f584f6194..2b5341f6965aa 100644
--- a/addons/hr_skills_slides/models/slide_channel.py
+++ b/addons/hr_skills_slides/models/slide_channel.py
@@ -8,7 +8,7 @@
class SlideChannelPartner(models.Model):
- _inherit = 'slide.channel.partner'
+ _inherit = ['slide.channel.partner']
def _recompute_completion(self):
res = super(SlideChannelPartner, self)._recompute_completion()
@@ -64,8 +64,9 @@ def _send_completed_mail(self):
})
self.env.user.employee_id.message_post(body=msg)
-class Channel(models.Model):
- _inherit = 'slide.channel'
+
+class SlideChannel(models.Model):
+ _inherit = ['slide.channel']
def _action_add_members(self, target_partners, member_status='joined', raise_on_access=False):
res = super()._action_add_members(target_partners, member_status=member_status, raise_on_access=raise_on_access)
diff --git a/addons/hr_skills_survey/models/hr_resume_line.py b/addons/hr_skills_survey/models/hr_resume_line.py
index cd586e7eb1c35..4a346da7629d8 100644
--- a/addons/hr_skills_survey/models/hr_resume_line.py
+++ b/addons/hr_skills_survey/models/hr_resume_line.py
@@ -5,8 +5,8 @@
from odoo import api, fields, models
-class ResumeLine(models.Model):
- _inherit = 'hr.resume.line'
+class HrResumeLine(models.Model):
+ _inherit = ['hr.resume.line']
display_type = fields.Selection(selection_add=[('certification', 'Certification')])
department_id = fields.Many2one(related="employee_id.department_id", store=True)
diff --git a/addons/hr_skills_survey/models/survey_survey.py b/addons/hr_skills_survey/models/survey_survey.py
index b7923e502d146..b81cdf1926665 100644
--- a/addons/hr_skills_survey/models/survey_survey.py
+++ b/addons/hr_skills_survey/models/survey_survey.py
@@ -2,8 +2,9 @@
from odoo import fields, models
+
class SurveySurvey(models.Model):
- _inherit = 'survey.survey'
+ _inherit = ['survey.survey']
certification_validity_months = fields.Integer(
'Validity', required=False,
diff --git a/addons/hr_skills_survey/models/survey_user.py b/addons/hr_skills_survey/models/survey_user.py
index eaad9f165be7e..96b27f2e2b461 100644
--- a/addons/hr_skills_survey/models/survey_user.py
+++ b/addons/hr_skills_survey/models/survey_user.py
@@ -8,8 +8,8 @@
from odoo.tools import html2plaintext
-class SurveyUserInput(models.Model):
- _inherit = 'survey.user_input'
+class SurveyUser_Input(models.Model):
+ _inherit = ['survey.user_input']
def _mark_done(self):
""" Will add certification to employee's resume if
@@ -17,7 +17,7 @@ def _mark_done(self):
- The user is linked to an employee
- The user succeeded the test """
- super(SurveyUserInput, self)._mark_done()
+ super()._mark_done()
certification_user_inputs = self.filtered(lambda user_input: user_input.survey_id.certification and user_input.scoring_success)
user_inputs_by_partner = certification_user_inputs.grouped('partner_id')
diff --git a/addons/hr_timesheet/models/analytic_applicability.py b/addons/hr_timesheet/models/analytic_applicability.py
index ab111387ee786..8559a712740ba 100644
--- a/addons/hr_timesheet/models/analytic_applicability.py
+++ b/addons/hr_timesheet/models/analytic_applicability.py
@@ -4,7 +4,7 @@
class AccountAnalyticApplicability(models.Model):
- _inherit = 'account.analytic.applicability'
+ _inherit = ['account.analytic.applicability']
_description = "Analytic Plan's Applicabilities"
business_domain = fields.Selection(
diff --git a/addons/hr_timesheet/models/hr_employee.py b/addons/hr_timesheet/models/hr_employee.py
index 7865b8dec82de..8123120d3fe61 100644
--- a/addons/hr_timesheet/models/hr_employee.py
+++ b/addons/hr_timesheet/models/hr_employee.py
@@ -7,7 +7,7 @@
class HrEmployee(models.Model):
- _inherit = 'hr.employee'
+ _inherit = ['hr.employee']
has_timesheet = fields.Boolean(compute='_compute_has_timesheet', groups="hr.group_hr_user,base.group_system", export_string_translation=False)
diff --git a/addons/hr_timesheet/models/hr_timesheet.py b/addons/hr_timesheet/models/hr_timesheet.py
index b2d06c887f4f6..3f64a4b143859 100644
--- a/addons/hr_timesheet/models/hr_timesheet.py
+++ b/addons/hr_timesheet/models/hr_timesheet.py
@@ -12,7 +12,7 @@
class AccountAnalyticLine(models.Model):
- _inherit = 'account.analytic.line'
+ _inherit = ['account.analytic.line']
def _get_favorite_project_id_domain(self, employee_id=False):
employee_id = employee_id or self.env.user.employee_id.id
diff --git a/addons/hr_timesheet/models/ir_http.py b/addons/hr_timesheet/models/ir_http.py
index 639e7826995fe..6b226602c32bf 100644
--- a/addons/hr_timesheet/models/ir_http.py
+++ b/addons/hr_timesheet/models/ir_http.py
@@ -4,8 +4,8 @@
from odoo import api, models
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
def session_info(self):
""" The widget 'timesheet_uom' needs to know which UoM conversion factor and which javascript
diff --git a/addons/hr_timesheet/models/ir_ui_menu.py b/addons/hr_timesheet/models/ir_ui_menu.py
index 6eddc5e8085a6..6eeed8af7283a 100644
--- a/addons/hr_timesheet/models/ir_ui_menu.py
+++ b/addons/hr_timesheet/models/ir_ui_menu.py
@@ -5,7 +5,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
def _load_menus_blacklist(self):
res = super()._load_menus_blacklist()
diff --git a/addons/hr_timesheet/models/project_collaborator.py b/addons/hr_timesheet/models/project_collaborator.py
index 9afd974497541..def310504729a 100644
--- a/addons/hr_timesheet/models/project_collaborator.py
+++ b/addons/hr_timesheet/models/project_collaborator.py
@@ -5,7 +5,7 @@
class ProjectCollaborator(models.Model):
- _inherit = 'project.collaborator'
+ _inherit = ['project.collaborator']
@api.model
def _toggle_project_sharing_portal_rules(self, active):
diff --git a/addons/hr_timesheet/models/project_project.py b/addons/hr_timesheet/models/project_project.py
index b20815908f0e1..70dcf0100fc0d 100644
--- a/addons/hr_timesheet/models/project_project.py
+++ b/addons/hr_timesheet/models/project_project.py
@@ -8,8 +8,8 @@
from odoo.tools.translate import _
-class Project(models.Model):
- _inherit = "project.project"
+class ProjectProject(models.Model):
+ _inherit = ["project.project"]
allow_timesheets = fields.Boolean(
"Timesheets", compute='_compute_allow_timesheets', store=True, readonly=False,
@@ -102,7 +102,7 @@ def _search_is_project_overtime(self, operator, value):
AND Task.parent_id IS NULL
AND Task.state IN ('01_in_progress', '02_changes_requested', '03_approved', '04_waiting_normal')
GROUP BY Project.id
- HAVING Project.allocated_hours - SUM(Task.effective_hours) < 0
+ HAVING ProjectProject.allocated_hours - SUM(Task.effective_hours) < 0
)""")
if (operator == '=' and value is True) or (operator == '!=' and value is False):
operator_new = 'in'
diff --git a/addons/hr_timesheet/models/project_task.py b/addons/hr_timesheet/models/project_task.py
index 444b4dabda97f..583d510b40a46 100644
--- a/addons/hr_timesheet/models/project_task.py
+++ b/addons/hr_timesheet/models/project_task.py
@@ -25,9 +25,9 @@
'total_hours_spent',
}
-class Task(models.Model):
- _name = "project.task"
- _inherit = "project.task"
+
+class ProjectTask(models.Model):
+ _inherit = ["project.task"]
project_id = fields.Many2one(domain="['|', ('company_id', '=', False), ('company_id', '=?', company_id), ('is_internal_project', '=', False)]")
analytic_account_active = fields.Boolean("Active Analytic Account", related='project_id.analytic_account_active', export_string_translation=False)
diff --git a/addons/hr_timesheet/models/project_update.py b/addons/hr_timesheet/models/project_update.py
index 523c885cab6cb..c930983cd1f83 100644
--- a/addons/hr_timesheet/models/project_update.py
+++ b/addons/hr_timesheet/models/project_update.py
@@ -4,7 +4,7 @@
class ProjectUpdate(models.Model):
- _inherit = "project.update"
+ _inherit = ["project.update"]
display_timesheet_stats = fields.Boolean(compute="_compute_display_timesheet_stats", export_string_translation=False)
allocated_time = fields.Integer("Allocated Time", readonly=True)
diff --git a/addons/hr_timesheet/models/res_company.py b/addons/hr_timesheet/models/res_company.py
index 401f8839d8644..dde8375293940 100644
--- a/addons/hr_timesheet/models/res_company.py
+++ b/addons/hr_timesheet/models/res_company.py
@@ -6,7 +6,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
@api.model
def _default_project_time_mode_id(self):
diff --git a/addons/hr_timesheet/models/res_config_settings.py b/addons/hr_timesheet/models/res_config_settings.py
index 2b3bf72b014d4..8648d2bf57c56 100644
--- a/addons/hr_timesheet/models/res_config_settings.py
+++ b/addons/hr_timesheet/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
module_project_timesheet_holidays = fields.Boolean("Time Off",
compute="_compute_timesheet_modules", store=True, readonly=False)
diff --git a/addons/hr_timesheet/models/uom_uom.py b/addons/hr_timesheet/models/uom_uom.py
index dde23ec7cf2c2..e234bafb743cf 100644
--- a/addons/hr_timesheet/models/uom_uom.py
+++ b/addons/hr_timesheet/models/uom_uom.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class Uom(models.Model):
- _inherit = 'uom.uom'
+class UomUom(models.Model):
+ _inherit = ['uom.uom']
def _unprotected_uom_xml_ids(self):
# Override
diff --git a/addons/hr_timesheet/report/project_report.py b/addons/hr_timesheet/report/project_report.py
index f40d1cdfb9e1e..1591550feb90a 100644
--- a/addons/hr_timesheet/report/project_report.py
+++ b/addons/hr_timesheet/report/project_report.py
@@ -5,7 +5,7 @@
class ReportProjectTaskUser(models.Model):
- _inherit = "report.project.task.user"
+ _inherit = ["report.project.task.user"]
allocated_hours = fields.Float('Allocated Time', readonly=True, groups="hr_timesheet.group_hr_timesheet_user")
effective_hours = fields.Float('Time Spent', readonly=True, groups="hr_timesheet.group_hr_timesheet_user")
diff --git a/addons/hr_timesheet/report/timesheets_analysis_report.py b/addons/hr_timesheet/report/timesheets_analysis_report.py
index 835d8f00e150f..c93d7a70316a7 100644
--- a/addons/hr_timesheet/report/timesheets_analysis_report.py
+++ b/addons/hr_timesheet/report/timesheets_analysis_report.py
@@ -6,8 +6,7 @@
class TimesheetsAnalysisReport(models.Model):
- _name = "timesheets.analysis.report"
- _inherit = "hr.manager.department.report"
+ _inherit = ["hr.manager.department.report"]
_description = "Timesheets Analysis Report"
_auto = False
diff --git a/addons/hr_timesheet/wizard/hr_employee_delete_wizard.py b/addons/hr_timesheet/wizard/hr_employee_delete_wizard.py
index c945e557777e4..2e5bee6f10e06 100644
--- a/addons/hr_timesheet/wizard/hr_employee_delete_wizard.py
+++ b/addons/hr_timesheet/wizard/hr_employee_delete_wizard.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, _
-class HrEmployeDeleteWizard(models.TransientModel):
- _name = 'hr.employee.delete.wizard'
+class HrEmployeeDeleteWizard(models.TransientModel):
_description = 'Employee Delete Wizard'
employee_ids = fields.Many2many('hr.employee', string='Employees', context={'active_test': False}, export_string_translation=False)
diff --git a/addons/hr_timesheet_attendance/models/ir_ui_menu.py b/addons/hr_timesheet_attendance/models/ir_ui_menu.py
index 78492633193f8..1dfb39c7162ce 100644
--- a/addons/hr_timesheet_attendance/models/ir_ui_menu.py
+++ b/addons/hr_timesheet_attendance/models/ir_ui_menu.py
@@ -5,7 +5,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
def _load_menus_blacklist(self):
res = super()._load_menus_blacklist()
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 acf54b097517e..0387825622d36 100644
--- a/addons/hr_timesheet_attendance/report/hr_timesheet_attendance_report.py
+++ b/addons/hr_timesheet_attendance/report/hr_timesheet_attendance_report.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, tools
-class TimesheetAttendance(models.Model):
- _name = 'hr.timesheet.attendance.report'
+class HrTimesheetAttendanceReport(models.Model):
_auto = False
_description = 'Timesheet Attendance Report'
diff --git a/addons/hr_work_entry/models/hr_employee.py b/addons/hr_work_entry/models/hr_employee.py
index 33f4273f53073..40273477a1eac 100644
--- a/addons/hr_work_entry/models/hr_employee.py
+++ b/addons/hr_work_entry/models/hr_employee.py
@@ -3,8 +3,9 @@
from odoo import models, fields, _
+
class HrEmployee(models.Model):
- _inherit = 'hr.employee'
+ _inherit = ['hr.employee']
has_work_entries = fields.Boolean(compute='_compute_has_work_entries', groups="base.group_system,hr.group_hr_user")
diff --git a/addons/hr_work_entry/models/hr_work_entry.py b/addons/hr_work_entry/models/hr_work_entry.py
index 64d169de9cd72..5d9a331ca9679 100644
--- a/addons/hr_work_entry/models/hr_work_entry.py
+++ b/addons/hr_work_entry/models/hr_work_entry.py
@@ -13,7 +13,6 @@
class HrWorkEntry(models.Model):
- _name = 'hr.work.entry'
_description = 'HR Work Entry'
_order = 'conflict desc,state,date_start'
@@ -242,7 +241,6 @@ def _error_checking(self, start=None, stop=None, skip=False, employee_ids=False)
class HrWorkEntryType(models.Model):
- _name = 'hr.work.entry.type'
_description = 'HR Work Entry Type'
name = fields.Char(required=True, translate=True)
@@ -278,10 +276,9 @@ def _check_code_unicity(self):
raise UserError(_("The same code cannot be associated to multiple work entry types."))
-class Contacts(models.Model):
+class HrUserWorkEntryEmployee(models.Model):
""" Personnal calendar filter """
- _name = 'hr.user.work.entry.employee'
_description = 'Work Entries Employees'
user_id = fields.Many2one('res.users', 'Me', required=True, default=lambda self: self.env.user, ondelete='cascade')
diff --git a/addons/hr_work_entry/models/resource.py b/addons/hr_work_entry/models/resource.py
index f1f15f6901b9c..726e57bc47b7b 100644
--- a/addons/hr_work_entry/models/resource.py
+++ b/addons/hr_work_entry/models/resource.py
@@ -5,7 +5,7 @@
class ResourceCalendarAttendance(models.Model):
- _inherit = 'resource.calendar.attendance'
+ _inherit = ['resource.calendar.attendance']
def _default_work_entry_type_id(self):
return self.env.ref('hr_work_entry.work_entry_type_attendance', raise_if_not_found=False)
@@ -20,8 +20,8 @@ def _copy_attendance_vals(self):
return res
-class ResourceCalendarLeave(models.Model):
- _inherit = 'resource.calendar.leaves'
+class ResourceCalendarLeaves(models.Model):
+ _inherit = ['resource.calendar.leaves']
work_entry_type_id = fields.Many2one(
'hr.work.entry.type', 'Work Entry Type',
diff --git a/addons/hr_work_entry_contract/models/hr_contract.py b/addons/hr_work_entry_contract/models/hr_contract.py
index 3ea9a20067bb1..b9f897360283d 100644
--- a/addons/hr_work_entry_contract/models/hr_contract.py
+++ b/addons/hr_work_entry_contract/models/hr_contract.py
@@ -18,7 +18,7 @@
class HrContract(models.Model):
- _inherit = 'hr.contract'
+ _inherit = ['hr.contract']
_description = 'Employee Contract'
date_generated_from = fields.Datetime(string='Generated From', readonly=True, required=True,
diff --git a/addons/hr_work_entry_contract/models/hr_employee.py b/addons/hr_work_entry_contract/models/hr_employee.py
index 8c8400e2cc801..95455c0d65c6e 100644
--- a/addons/hr_work_entry_contract/models/hr_employee.py
+++ b/addons/hr_work_entry_contract/models/hr_employee.py
@@ -5,7 +5,7 @@
class HrEmployee(models.Model):
- _inherit = 'hr.employee'
+ _inherit = ['hr.employee']
def generate_work_entries(self, date_start, date_stop, force=False):
date_start = fields.Date.to_date(date_start)
diff --git a/addons/hr_work_entry_contract/models/hr_work_entry.py b/addons/hr_work_entry_contract/models/hr_work_entry.py
index 969d8651859e8..0048e681a615d 100644
--- a/addons/hr_work_entry_contract/models/hr_work_entry.py
+++ b/addons/hr_work_entry_contract/models/hr_work_entry.py
@@ -12,7 +12,7 @@
class HrWorkEntry(models.Model):
- _inherit = 'hr.work.entry'
+ _inherit = ['hr.work.entry']
contract_id = fields.Many2one('hr.contract', string="Contract", required=True)
employee_id = fields.Many2one(domain=[('contract_ids.state', 'in', ('open', 'pending'))])
@@ -186,7 +186,7 @@ def _from_intervals(self, intervals):
class HrWorkEntryType(models.Model):
- _inherit = 'hr.work.entry.type'
+ _inherit = ['hr.work.entry.type']
_description = 'HR Work Entry Type'
is_leave = fields.Boolean(
diff --git a/addons/hr_work_entry_contract/models/resource_calendar.py b/addons/hr_work_entry_contract/models/resource_calendar.py
index a8487804abdb3..bd090207aef46 100644
--- a/addons/hr_work_entry_contract/models/resource_calendar.py
+++ b/addons/hr_work_entry_contract/models/resource_calendar.py
@@ -2,8 +2,9 @@
from odoo import models
+
class ResourceCalendar(models.Model):
- _inherit = 'resource.calendar'
+ _inherit = ['resource.calendar']
def _get_global_attendances(self):
return super()._get_global_attendances().filtered(lambda a: not a.work_entry_type_id.is_leave)
diff --git a/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard.py b/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard.py
index afdb5e6514894..71c117c14d1b1 100644
--- a/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard.py
+++ b/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard.py
@@ -6,8 +6,8 @@
from dateutil.relativedelta import relativedelta
+
class HrWorkEntryRegenerationWizard(models.TransientModel):
- _name = 'hr.work.entry.regeneration.wizard'
_description = 'Regenerate Employee Work Entries'
earliest_available_date = fields.Date('Earliest date', compute='_compute_earliest_available_date')
diff --git a/addons/hr_work_entry_holidays/models/hr_contract.py b/addons/hr_work_entry_holidays/models/hr_contract.py
index 6c4d8ab9b2768..09aff7a4e8957 100644
--- a/addons/hr_work_entry_holidays/models/hr_contract.py
+++ b/addons/hr_work_entry_holidays/models/hr_contract.py
@@ -8,7 +8,7 @@
class HrContract(models.Model):
- _inherit = 'hr.contract'
+ _inherit = ['hr.contract']
_description = 'Employee Contract'
# override to add work_entry_type from leave
diff --git a/addons/hr_work_entry_holidays/models/hr_leave.py b/addons/hr_work_entry_holidays/models/hr_leave.py
index 9800feea5848a..131e306c5731e 100644
--- a/addons/hr_work_entry_holidays/models/hr_leave.py
+++ b/addons/hr_work_entry_holidays/models/hr_leave.py
@@ -12,13 +12,13 @@
class HrLeaveType(models.Model):
- _inherit = 'hr.leave.type'
+ _inherit = ['hr.leave.type']
work_entry_type_id = fields.Many2one('hr.work.entry.type', string='Work Entry Type')
class HrLeave(models.Model):
- _inherit = 'hr.leave'
+ _inherit = ['hr.leave']
def _prepare_resource_leave_vals(self):
vals = super(HrLeave, self)._prepare_resource_leave_vals()
diff --git a/addons/hr_work_entry_holidays/models/hr_work_entry.py b/addons/hr_work_entry_holidays/models/hr_work_entry.py
index d85e62561c2f4..427422bfb8167 100644
--- a/addons/hr_work_entry_holidays/models/hr_work_entry.py
+++ b/addons/hr_work_entry_holidays/models/hr_work_entry.py
@@ -7,7 +7,7 @@
class HrWorkEntry(models.Model):
- _inherit = 'hr.work.entry'
+ _inherit = ['hr.work.entry']
leave_id = fields.Many2one('hr.leave', string='Time Off')
leave_state = fields.Selection(related='leave_id.state')
@@ -101,7 +101,7 @@ def _get_leaves_duration_between_two_dates(self, employee_id, date_from, date_to
class HrWorkEntryType(models.Model):
- _inherit = 'hr.work.entry.type'
+ _inherit = ['hr.work.entry.type']
_description = 'HR Work Entry Type'
leave_type_ids = fields.One2many(
diff --git a/addons/html_editor/models/ir_attachment.py b/addons/html_editor/models/ir_attachment.py
index b65ee028f9eac..3d64933abafc9 100644
--- a/addons/html_editor/models/ir_attachment.py
+++ b/addons/html_editor/models/ir_attachment.py
@@ -19,7 +19,7 @@
class IrAttachment(models.Model):
- _inherit = "ir.attachment"
+ _inherit = ["ir.attachment"]
local_url = fields.Char("Attachment URL", compute='_compute_local_url')
image_src = fields.Char(compute='_compute_image_src')
diff --git a/addons/http_routing/models/ir_qweb.py b/addons/http_routing/models/ir_qweb.py
index 6b74fea0ffe69..b896156b05658 100644
--- a/addons/http_routing/models/ir_qweb.py
+++ b/addons/http_routing/models/ir_qweb.py
@@ -30,8 +30,9 @@
temporary hide the incoming http request.
"""
+
class IrQweb(models.AbstractModel):
- _inherit = "ir.qweb"
+ _inherit = ["ir.qweb"]
def _prepare_environment(self, values):
irQweb = super()._prepare_environment(values)
diff --git a/addons/http_routing/models/res_lang.py b/addons/http_routing/models/res_lang.py
index e82c025e55338..c4a044e1afd42 100644
--- a/addons/http_routing/models/res_lang.py
+++ b/addons/http_routing/models/res_lang.py
@@ -5,7 +5,7 @@
class ResLang(models.Model):
- _inherit = "res.lang"
+ _inherit = ["res.lang"]
def _get_frontend(self) -> LangDataDict:
""" Return the available languages for current request
diff --git a/addons/iap/models/iap_account.py b/addons/iap/models/iap_account.py
index 95d605bc3a426..a1153562e659f 100644
--- a/addons/iap/models/iap_account.py
+++ b/addons/iap/models/iap_account.py
@@ -17,7 +17,6 @@
class IapAccount(models.Model):
- _name = 'iap.account'
_description = 'IAP Account'
name = fields.Char()
diff --git a/addons/iap/models/iap_enrich_api.py b/addons/iap/models/iap_enrich_api.py
index f6a85d287ed51..034198da9177a 100644
--- a/addons/iap/models/iap_enrich_api.py
+++ b/addons/iap/models/iap_enrich_api.py
@@ -5,8 +5,7 @@
from odoo.addons.iap.tools import iap_tools
-class IapEnrichAPI(models.AbstractModel):
- _name = 'iap.enrich.api'
+class IapEnrichApi(models.AbstractModel):
_description = 'IAP Lead Enrichment API'
_DEFAULT_ENDPOINT = 'https://iap-services.odoo.com'
diff --git a/addons/iap/models/iap_service.py b/addons/iap/models/iap_service.py
index 107d0750a858a..a4a4a14715dd2 100644
--- a/addons/iap/models/iap_service.py
+++ b/addons/iap/models/iap_service.py
@@ -4,7 +4,6 @@
class IapService(models.Model):
- _name = 'iap.service'
_description = 'IAP Service'
name = fields.Char(required=True)
diff --git a/addons/iap_crm/models/crm_lead.py b/addons/iap_crm/models/crm_lead.py
index ea8a0fd2f22c3..61e6228dceb9d 100644
--- a/addons/iap_crm/models/crm_lead.py
+++ b/addons/iap_crm/models/crm_lead.py
@@ -4,10 +4,10 @@
from odoo import fields, models
-class Lead(models.Model):
- _inherit = 'crm.lead'
+class CrmLead(models.Model):
+ _inherit = ['crm.lead']
reveal_id = fields.Char(string='Reveal ID') # Technical ID of reveal request done by IAP
def _merge_get_fields(self):
- return super(Lead, self)._merge_get_fields() + ['reveal_id']
+ return super()._merge_get_fields() + ['reveal_id']
diff --git a/addons/iap_mail/models/iap_account.py b/addons/iap_mail/models/iap_account.py
index 43a617b87942d..ce3a02cc81678 100644
--- a/addons/iap_mail/models/iap_account.py
+++ b/addons/iap_mail/models/iap_account.py
@@ -4,7 +4,6 @@
class IapAccount(models.Model):
- _name = 'iap.account'
_inherit = ['iap.account', 'mail.thread']
# Add tracking to the base fields
diff --git a/addons/im_livechat/models/chatbot_message.py b/addons/im_livechat/models/chatbot_message.py
index 48d5a839f3c2e..f9cfa28a8c788 100644
--- a/addons/im_livechat/models/chatbot_message.py
+++ b/addons/im_livechat/models/chatbot_message.py
@@ -4,13 +4,12 @@
from odoo import models, fields
-class ChatbotMailMessage(models.Model):
+class ChatbotMessage(models.Model):
""" Chatbot Mail Message
We create a new model to store the related step to a mail.message and the user's answer.
We do this in a new model to avoid bloating the 'mail.message' model.
"""
- _name = 'chatbot.message'
_description = 'Chatbot Message'
_order = 'create_date desc, id desc'
_rec_name = 'discuss_channel_id'
diff --git a/addons/im_livechat/models/chatbot_script.py b/addons/im_livechat/models/chatbot_script.py
index 31325b9ba4796..0b0476dc23570 100644
--- a/addons/im_livechat/models/chatbot_script.py
+++ b/addons/im_livechat/models/chatbot_script.py
@@ -7,7 +7,6 @@
class ChatbotScript(models.Model):
- _name = 'chatbot.script'
_description = 'Chatbot Script'
_inherit = ['image.mixin', 'utm.source.mixin']
_rec_name = 'title'
diff --git a/addons/im_livechat/models/chatbot_script_answer.py b/addons/im_livechat/models/chatbot_script_answer.py
index be8a91f0c6711..b3e72b9d44375 100644
--- a/addons/im_livechat/models/chatbot_script_answer.py
+++ b/addons/im_livechat/models/chatbot_script_answer.py
@@ -9,7 +9,6 @@
class ChatbotScriptAnswer(models.Model):
- _name = 'chatbot.script.answer'
_description = 'Chatbot Script Answer'
_order = 'script_step_id, sequence, id'
diff --git a/addons/im_livechat/models/chatbot_script_step.py b/addons/im_livechat/models/chatbot_script_step.py
index d9c0258d60642..834346f37ddba 100644
--- a/addons/im_livechat/models/chatbot_script_step.py
+++ b/addons/im_livechat/models/chatbot_script_step.py
@@ -13,7 +13,6 @@
class ChatbotScriptStep(models.Model):
- _name = 'chatbot.script.step'
_description = 'Chatbot Script Step'
_order = 'sequence, id'
_rec_name = 'message'
diff --git a/addons/im_livechat/models/digest.py b/addons/im_livechat/models/digest.py
index a11dac0d7b054..fc599b3336f85 100644
--- a/addons/im_livechat/models/digest.py
+++ b/addons/im_livechat/models/digest.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class Digest(models.Model):
- _inherit = 'digest.digest'
+class DigestDigest(models.Model):
+ _inherit = ['digest.digest']
kpi_livechat_rating = fields.Boolean('% of Happiness')
kpi_livechat_rating_value = fields.Float(digits=(16, 2), compute='_compute_kpi_livechat_rating_value')
@@ -43,7 +43,7 @@ def _compute_kpi_livechat_response_value(self):
self.kpi_livechat_response_value = response_time[0][0]
def _compute_kpis_actions(self, company, user):
- res = super(Digest, self)._compute_kpis_actions(company, user)
+ res = super()._compute_kpis_actions(company, user)
res['kpi_livechat_rating'] = 'im_livechat.rating_rating_action_livechat_report'
res['kpi_livechat_conversations'] = 'im_livechat.im_livechat_report_operator_action'
res['kpi_livechat_response'] = 'im_livechat.im_livechat_report_channel_time_to_answer_action'
diff --git a/addons/im_livechat/models/discuss_channel.py b/addons/im_livechat/models/discuss_channel.py
index d49798ba9793e..6e6a007d66144 100644
--- a/addons/im_livechat/models/discuss_channel.py
+++ b/addons/im_livechat/models/discuss_channel.py
@@ -13,7 +13,6 @@ class DiscussChannel(models.Model):
It extends the base method for anonymous usage.
"""
- _name = 'discuss.channel'
_inherit = ['rating.mixin', 'discuss.channel']
anonymous_name = fields.Char('Anonymous Name')
diff --git a/addons/im_livechat/models/discuss_channel_member.py b/addons/im_livechat/models/discuss_channel_member.py
index e4504e7b4d695..693beabe34285 100644
--- a/addons/im_livechat/models/discuss_channel_member.py
+++ b/addons/im_livechat/models/discuss_channel_member.py
@@ -6,8 +6,8 @@
from odoo.addons.mail.tools.discuss import Store
-class ChannelMember(models.Model):
- _inherit = 'discuss.channel.member'
+class DiscussChannelMember(models.Model):
+ _inherit = ['discuss.channel.member']
@api.autovacuum
def _gc_unpin_livechat_sessions(self):
diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py
index 90a7e7a9e8047..d9e2a71df3cc7 100644
--- a/addons/im_livechat/models/im_livechat_channel.py
+++ b/addons/im_livechat/models/im_livechat_channel.py
@@ -9,14 +9,13 @@
from odoo.addons.bus.websocket import WebsocketConnectionHandler
-class ImLivechatChannel(models.Model):
+class Im_LivechatChannel(models.Model):
""" Livechat Channel
Define a communication channel, which can be accessed with 'script_external' (script tag to put on
external website), 'script_internal' (code to be integrated with odoo website) or via 'web_page' link.
It provides rating tools, and access rules for anonymous people.
"""
- _name = 'im_livechat.channel'
_inherit = ['rating.parent.mixin']
_description = 'Livechat Channel'
_rating_satisfaction_days = 14 # include only last 14 days to compute satisfaction
@@ -338,13 +337,12 @@ def _to_store(self, store: Store, /, *, fields=None):
store.add(self._name, self._read_format(fields))
-class ImLivechatChannelRule(models.Model):
+class Im_LivechatChannelRule(models.Model):
""" Channel Rules
Rules defining access to the channel (countries, and url matching). It also provide the 'auto pop'
option to open automatically the conversation.
"""
- _name = 'im_livechat.channel.rule'
_description = 'Livechat Channel Rules'
_order = 'sequence asc'
diff --git a/addons/im_livechat/models/ir_binary.py b/addons/im_livechat/models/ir_binary.py
index f6c0d4d297f32..3aab79f177caf 100644
--- a/addons/im_livechat/models/ir_binary.py
+++ b/addons/im_livechat/models/ir_binary.py
@@ -4,7 +4,7 @@
class IrBinary(models.AbstractModel):
- _inherit = "ir.binary"
+ _inherit = ["ir.binary"]
def _find_record_check_access(self, record, access_token, field):
"""Custom access check allowing to retrieve an operator's avatar.
diff --git a/addons/im_livechat/models/mail_message.py b/addons/im_livechat/models/mail_message.py
index 14ac305d71ac8..118d44ec2e1c8 100644
--- a/addons/im_livechat/models/mail_message.py
+++ b/addons/im_livechat/models/mail_message.py
@@ -5,7 +5,7 @@
class MailMessage(models.Model):
- _inherit = 'mail.message'
+ _inherit = ['mail.message']
parent_author_name = fields.Char(compute="_compute_parent_author_name")
parent_body = fields.Html(compute="_compute_parent_body")
diff --git a/addons/im_livechat/models/rating_rating.py b/addons/im_livechat/models/rating_rating.py
index d60fe45c7c7c8..0b037b862a81b 100644
--- a/addons/im_livechat/models/rating_rating.py
+++ b/addons/im_livechat/models/rating_rating.py
@@ -4,9 +4,9 @@
from odoo import api, models
-class Rating(models.Model):
+class RatingRating(models.Model):
- _inherit = "rating.rating"
+ _inherit = ["rating.rating"]
@api.depends('res_model', 'res_id')
def _compute_res_name(self):
@@ -17,10 +17,10 @@ def _compute_res_name(self):
current_object = self.env[rating.res_model].sudo().browse(rating.res_id)
rating.res_name = ('%s / %s') % (current_object.livechat_channel_id.name, current_object.id)
else:
- super(Rating, rating)._compute_res_name()
+ super(RatingRating, rating)._compute_res_name()
def action_open_rated_object(self):
- action = super(Rating, self).action_open_rated_object()
+ action = super().action_open_rated_object()
if self.res_model == 'discuss.channel':
if self.env[self.res_model].browse(self.res_id):
ctx = self.env.context.copy()
diff --git a/addons/im_livechat/models/res_partner.py b/addons/im_livechat/models/res_partner.py
index 25ed75052ea2f..a98cf55154e5f 100644
--- a/addons/im_livechat/models/res_partner.py
+++ b/addons/im_livechat/models/res_partner.py
@@ -6,9 +6,9 @@
from odoo.addons.mail.tools.discuss import Store
-class Partners(models.Model):
+class ResPartner(models.Model):
"""Update of res.partner class to take into account the livechat username."""
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
user_livechat_username = fields.Char(compute='_compute_user_livechat_username')
@@ -47,7 +47,7 @@ def _to_store(self, store: Store, /, *, fields=None, **kwargs):
super()._to_store(store, fields=fields, **kwargs)
if fields and "user_livechat_username" in fields:
if partners := self.filtered(lambda p: not p.user_livechat_username):
- super(Partners, partners)._to_store(store, fields=["name"])
+ super(ResPartner, partners)._to_store(store, fields=["name"])
def _bus_send_history_message(self, channel, page_history):
message_body = _("No history found")
diff --git a/addons/im_livechat/models/res_users.py b/addons/im_livechat/models/res_users.py
index 89d71b53ff713..2ec656177d211 100644
--- a/addons/im_livechat/models/res_users.py
+++ b/addons/im_livechat/models/res_users.py
@@ -4,11 +4,11 @@
from odoo import fields, models, api
-class Users(models.Model):
+class ResUsers(models.Model):
""" Update of res.users class
- add a preference about username for livechat purpose
"""
- _inherit = 'res.users'
+ _inherit = ['res.users']
livechat_username = fields.Char(string='Livechat Username', compute='_compute_livechat_username', inverse='_inverse_livechat_username', store=False)
livechat_lang_ids = fields.Many2many('res.lang', string='Livechat Languages', compute='_compute_livechat_lang_ids', inverse='_inverse_livechat_lang_ids', store=False)
diff --git a/addons/im_livechat/models/res_users_settings.py b/addons/im_livechat/models/res_users_settings.py
index 3bc74b719ab47..b49b3101e84a7 100644
--- a/addons/im_livechat/models/res_users_settings.py
+++ b/addons/im_livechat/models/res_users_settings.py
@@ -5,7 +5,7 @@
class ResUsersSettings(models.Model):
- _inherit = 'res.users.settings'
+ _inherit = ['res.users.settings']
livechat_username = fields.Char("Livechat Username", help="This username will be used as your name in the livechat channels.")
livechat_lang_ids = fields.Many2many(comodel_name='res.lang', string='Livechat languages',
diff --git a/addons/im_livechat/report/im_livechat_report_channel.py b/addons/im_livechat/report/im_livechat_report_channel.py
index 25a66a82d41e1..362a16b966199 100644
--- a/addons/im_livechat/report/im_livechat_report_channel.py
+++ b/addons/im_livechat/report/im_livechat_report_channel.py
@@ -4,10 +4,9 @@
from odoo import api, fields, models, tools
-class ImLivechatReportChannel(models.Model):
+class Im_LivechatReportChannel(models.Model):
""" Livechat Support Report on the Channels """
- _name = "im_livechat.report.channel"
_description = "Livechat Support Channel Report"
_order = 'start_date, technical_name'
_auto = False
diff --git a/addons/im_livechat/report/im_livechat_report_operator.py b/addons/im_livechat/report/im_livechat_report_operator.py
index 7f0580fc7ca4a..af8a342978e9e 100644
--- a/addons/im_livechat/report/im_livechat_report_operator.py
+++ b/addons/im_livechat/report/im_livechat_report_operator.py
@@ -4,10 +4,9 @@
from odoo import api, fields, models, tools
-class ImLivechatReportOperator(models.Model):
+class Im_LivechatReportOperator(models.Model):
""" Livechat Support Report on the Operator """
- _name = "im_livechat.report.operator"
_description = "Livechat Support Operator Report"
_order = 'livechat_channel_id, partner_id'
_auto = False
diff --git a/addons/l10n_ae/models/account_move_line.py b/addons/l10n_ae/models/account_move_line.py
index 6ccb1ba5795be..507abd4f0c693 100644
--- a/addons/l10n_ae/models/account_move_line.py
+++ b/addons/l10n_ae/models/account_move_line.py
@@ -4,7 +4,7 @@
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
l10n_ae_vat_amount = fields.Monetary(compute='_compute_vat_amount', string='VAT Amount')
diff --git a/addons/l10n_ae/models/template_ae.py b/addons/l10n_ae/models/template_ae.py
index 72bb2507531b7..761f23dbaa433 100644
--- a/addons/l10n_ae/models/template_ae.py
+++ b/addons/l10n_ae/models/template_ae.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ae')
def _get_ae_template_data(self):
diff --git a/addons/l10n_anz_ubl_pint/models/account_edi_xml_pint_anz.py b/addons/l10n_anz_ubl_pint/models/account_edi_xml_pint_anz.py
index 885abf0b366f5..8ef2bca7fffa4 100644
--- a/addons/l10n_anz_ubl_pint/models/account_edi_xml_pint_anz.py
+++ b/addons/l10n_anz_ubl_pint/models/account_edi_xml_pint_anz.py
@@ -4,9 +4,8 @@
ANZ_TAX_CATEGORIES = {'S', 'E', 'Z', 'G', 'O'}
-class AccountEdiXmlUBLPINTANZ(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = "account.edi.xml.pint_anz"
+class AccountEdiXmlPint_Anz(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "Australia & New Zealand implementation of Peppol International (PINT) model for Billing"
"""
Pint is a standard for International Billing from Peppol. It is based on Peppol BIS Billing 3.
diff --git a/addons/l10n_anz_ubl_pint/models/res_partner.py b/addons/l10n_anz_ubl_pint/models/res_partner.py
index 7d8d0c065145d..d114ee16e39fe 100644
--- a/addons/l10n_anz_ubl_pint/models/res_partner.py
+++ b/addons/l10n_anz_ubl_pint/models/res_partner.py
@@ -3,7 +3,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('pint_anz', "PINT Australia & New Zealand")])
diff --git a/addons/l10n_ar/demo/account_demo.py b/addons/l10n_ar/demo/account_demo.py
index e5f4f64a20477..166ce35831148 100644
--- a/addons/l10n_ar/demo/account_demo.py
+++ b/addons/l10n_ar/demo/account_demo.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@api.model
def _get_demo_data(self, company=False):
diff --git a/addons/l10n_ar/models/account_chart_template.py b/addons/l10n_ar/models/account_chart_template.py
index 66ea5bb5bdf76..3390b9f820475 100644
--- a/addons/l10n_ar/models/account_chart_template.py
+++ b/addons/l10n_ar/models/account_chart_template.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@api.model
def _get_ar_responsibility_match(self, chart_template):
diff --git a/addons/l10n_ar/models/account_fiscal_position.py b/addons/l10n_ar/models/account_fiscal_position.py
index a5b7ff885d8fe..71a5e1c439758 100644
--- a/addons/l10n_ar/models/account_fiscal_position.py
+++ b/addons/l10n_ar/models/account_fiscal_position.py
@@ -4,7 +4,7 @@
class AccountFiscalPosition(models.Model):
- _inherit = 'account.fiscal.position'
+ _inherit = ['account.fiscal.position']
l10n_ar_afip_responsibility_type_ids = fields.Many2many(
'l10n_ar.afip.responsibility.type', 'l10n_ar_afip_reponsibility_type_fiscal_pos_rel',
diff --git a/addons/l10n_ar/models/account_journal.py b/addons/l10n_ar/models/account_journal.py
index 9ace967e1ad30..96bd956920c22 100644
--- a/addons/l10n_ar/models/account_journal.py
+++ b/addons/l10n_ar/models/account_journal.py
@@ -6,7 +6,7 @@
class AccountJournal(models.Model):
- _inherit = "account.journal"
+ _inherit = ["account.journal"]
l10n_ar_afip_pos_system = fields.Selection(
selection='_get_l10n_ar_afip_pos_types_selection', string='AFIP POS System',
diff --git a/addons/l10n_ar/models/account_move.py b/addons/l10n_ar/models/account_move.py
index 4245fede80724..29ea40225bdae 100644
--- a/addons/l10n_ar/models/account_move.py
+++ b/addons/l10n_ar/models/account_move.py
@@ -9,7 +9,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
@api.model
def _l10n_ar_get_document_number_parts(self, document_number, document_type_code):
diff --git a/addons/l10n_ar/models/account_move_line.py b/addons/l10n_ar/models/account_move_line.py
index 4d7e7a557ceb3..7df576bfabb9d 100644
--- a/addons/l10n_ar/models/account_move_line.py
+++ b/addons/l10n_ar/models/account_move_line.py
@@ -4,7 +4,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _l10n_ar_prices_and_taxes(self):
self.ensure_one()
diff --git a/addons/l10n_ar/models/account_tax_group.py b/addons/l10n_ar/models/account_tax_group.py
index f59fcc47890e6..4e25f69dd4b65 100644
--- a/addons/l10n_ar/models/account_tax_group.py
+++ b/addons/l10n_ar/models/account_tax_group.py
@@ -4,7 +4,7 @@
class AccountTaxGroup(models.Model):
- _inherit = 'account.tax.group'
+ _inherit = ['account.tax.group']
# values from http://www.afip.gob.ar/fe/documentos/otros_Tributos.xlsx
l10n_ar_tribute_afip_code = fields.Selection([
diff --git a/addons/l10n_ar/models/l10n_ar_afip_responsibility_type.py b/addons/l10n_ar/models/l10n_ar_afip_responsibility_type.py
index 843380ee89a68..add4141497c67 100644
--- a/addons/l10n_ar/models/l10n_ar_afip_responsibility_type.py
+++ b/addons/l10n_ar/models/l10n_ar_afip_responsibility_type.py
@@ -3,9 +3,8 @@
from odoo import models, fields
-class L10nArAfipResponsibilityType(models.Model):
+class L10n_ArAfipResponsibilityType(models.Model):
- _name = 'l10n_ar.afip.responsibility.type'
_description = 'AFIP Responsibility Type'
_order = 'sequence'
diff --git a/addons/l10n_ar/models/l10n_latam_document_type.py b/addons/l10n_ar/models/l10n_latam_document_type.py
index d8f30de3247ba..8216c50ba3ad7 100644
--- a/addons/l10n_ar/models/l10n_latam_document_type.py
+++ b/addons/l10n_ar/models/l10n_latam_document_type.py
@@ -2,9 +2,9 @@
from odoo.exceptions import UserError
-class L10nLatamDocumentType(models.Model):
+class L10n_LatamDocumentType(models.Model):
- _inherit = 'l10n_latam.document.type'
+ _inherit = ['l10n_latam.document.type']
l10n_ar_letter = fields.Selection(
selection='_get_l10n_ar_letters',
diff --git a/addons/l10n_ar/models/l10n_latam_identification_type.py b/addons/l10n_ar/models/l10n_latam_identification_type.py
index 7158fe2feb3d1..db7bb9180d957 100644
--- a/addons/l10n_ar/models/l10n_latam_identification_type.py
+++ b/addons/l10n_ar/models/l10n_latam_identification_type.py
@@ -2,8 +2,8 @@
from odoo import models, fields
-class L10nLatamIdentificationType(models.Model):
+class L10n_LatamIdentificationType(models.Model):
- _inherit = "l10n_latam.identification.type"
+ _inherit = ["l10n_latam.identification.type"]
l10n_ar_afip_code = fields.Char("AFIP Code")
diff --git a/addons/l10n_ar/models/res_company.py b/addons/l10n_ar/models/res_company.py
index b4216b790997b..311e06fcbf3e4 100644
--- a/addons/l10n_ar/models/res_company.py
+++ b/addons/l10n_ar/models/res_company.py
@@ -2,9 +2,10 @@
from odoo import fields, models, api, _
from odoo.exceptions import UserError
+
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
l10n_ar_gross_income_number = fields.Char(
related='partner_id.l10n_ar_gross_income_number', string='Gross Income Number', readonly=False,
diff --git a/addons/l10n_ar/models/res_country.py b/addons/l10n_ar/models/res_country.py
index 15c1aaf6554cd..1ad4b131e0b8e 100644
--- a/addons/l10n_ar/models/res_country.py
+++ b/addons/l10n_ar/models/res_country.py
@@ -5,7 +5,7 @@
class ResCountry(models.Model):
- _inherit = 'res.country'
+ _inherit = ['res.country']
l10n_ar_afip_code = fields.Char('AFIP Code', size=3, help='This code will be used on electronic invoice')
l10n_ar_natural_vat = fields.Char(
diff --git a/addons/l10n_ar/models/res_currency.py b/addons/l10n_ar/models/res_currency.py
index 24ef449c6df63..ea908c288ff76 100644
--- a/addons/l10n_ar/models/res_currency.py
+++ b/addons/l10n_ar/models/res_currency.py
@@ -4,6 +4,6 @@
class ResCurrency(models.Model):
- _inherit = "res.currency"
+ _inherit = ["res.currency"]
l10n_ar_afip_code = fields.Char('AFIP Code', size=4, help='This code will be used on electronic invoice')
diff --git a/addons/l10n_ar/models/res_partner.py b/addons/l10n_ar/models/res_partner.py
index 256c4a4991773..4a356d8fff858 100644
--- a/addons/l10n_ar/models/res_partner.py
+++ b/addons/l10n_ar/models/res_partner.py
@@ -10,7 +10,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_ar_vat = fields.Char(
compute='_compute_l10n_ar_vat', string="VAT", help='Computed field that returns VAT or nothing if this one'
diff --git a/addons/l10n_ar/models/res_partner_bank.py b/addons/l10n_ar/models/res_partner_bank.py
index e6a7277c7406a..e047a15b5004c 100644
--- a/addons/l10n_ar/models/res_partner_bank.py
+++ b/addons/l10n_ar/models/res_partner_bank.py
@@ -31,7 +31,7 @@ def _check_digit(number):
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
@api.model
def _get_supported_account_types(self):
diff --git a/addons/l10n_ar/models/template_ar_base.py b/addons/l10n_ar/models/template_ar_base.py
index 2f76a14067a12..fef7be4f42205 100644
--- a/addons/l10n_ar/models/template_ar_base.py
+++ b/addons/l10n_ar/models/template_ar_base.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ar_base')
def _get_ar_base_template_data(self):
diff --git a/addons/l10n_ar/models/template_ar_ex.py b/addons/l10n_ar/models/template_ar_ex.py
index 5edda899cb748..eee426f1e1e29 100644
--- a/addons/l10n_ar/models/template_ar_ex.py
+++ b/addons/l10n_ar/models/template_ar_ex.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ar_ex')
def _get_ar_ex_template_data(self):
diff --git a/addons/l10n_ar/models/template_ar_ri.py b/addons/l10n_ar/models/template_ar_ri.py
index 97476aeb392d3..87d8a57ad5274 100644
--- a/addons/l10n_ar/models/template_ar_ri.py
+++ b/addons/l10n_ar/models/template_ar_ri.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ar_ri')
def _get_ar_ri_template_data(self):
diff --git a/addons/l10n_ar/models/uom_uom.py b/addons/l10n_ar/models/uom_uom.py
index 0bc0f9d98c940..0b05af6b7b061 100644
--- a/addons/l10n_ar/models/uom_uom.py
+++ b/addons/l10n_ar/models/uom_uom.py
@@ -2,8 +2,8 @@
from odoo import fields, models
-class Uom(models.Model):
+class UomUom(models.Model):
- _inherit = 'uom.uom'
+ _inherit = ['uom.uom']
l10n_ar_afip_code = fields.Char('Code', help='Argentina: This code will be used on electronic invoice.')
diff --git a/addons/l10n_ar/report/invoice_report.py b/addons/l10n_ar/report/invoice_report.py
index db35fb6e2c9e9..531dda55bc9f6 100644
--- a/addons/l10n_ar/report/invoice_report.py
+++ b/addons/l10n_ar/report/invoice_report.py
@@ -5,7 +5,7 @@
class AccountInvoiceReport(models.Model):
- _inherit = 'account.invoice.report'
+ _inherit = ['account.invoice.report']
l10n_ar_state_id = fields.Many2one('res.country.state', 'Delivery Province', readonly=True)
date = fields.Date(readonly=True, string="Accounting Date")
diff --git a/addons/l10n_ar_pos/models/l10n_ar_afip_responsibility_type.py b/addons/l10n_ar_pos/models/l10n_ar_afip_responsibility_type.py
index c7f1d04778e0b..6760c009dc80a 100644
--- a/addons/l10n_ar_pos/models/l10n_ar_afip_responsibility_type.py
+++ b/addons/l10n_ar_pos/models/l10n_ar_afip_responsibility_type.py
@@ -3,8 +3,7 @@
from odoo import models, api
-class L10nArAfipResponsibilityType(models.Model):
- _name = 'l10n_ar.afip.responsibility.type'
+class L10n_ArAfipResponsibilityType(models.Model):
_inherit = ['l10n_ar.afip.responsibility.type', 'pos.load.mixin']
@api.model
diff --git a/addons/l10n_ar_pos/models/l10n_latam_identification_type.py b/addons/l10n_ar_pos/models/l10n_latam_identification_type.py
index 90e1f8de7e9df..b3718c446396d 100644
--- a/addons/l10n_ar_pos/models/l10n_latam_identification_type.py
+++ b/addons/l10n_ar_pos/models/l10n_latam_identification_type.py
@@ -3,8 +3,7 @@
from odoo import models, api
-class L10nArAfipResponsibilityType(models.Model):
- _name = 'l10n_latam.identification.type'
+class L10n_LatamIdentificationType(models.Model):
_inherit = ['l10n_latam.identification.type', 'pos.load.mixin']
@api.model
diff --git a/addons/l10n_ar_pos/models/pos_config.py b/addons/l10n_ar_pos/models/pos_config.py
index 0a875a4f961a6..27d7fb800920e 100644
--- a/addons/l10n_ar_pos/models/pos_config.py
+++ b/addons/l10n_ar_pos/models/pos_config.py
@@ -2,7 +2,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
def get_limited_partners_loading(self):
partner_ids = super().get_limited_partners_loading()
diff --git a/addons/l10n_ar_pos/models/pos_session.py b/addons/l10n_ar_pos/models/pos_session.py
index e55e3750b5a16..9b191ef7caf75 100644
--- a/addons/l10n_ar_pos/models/pos_session.py
+++ b/addons/l10n_ar_pos/models/pos_session.py
@@ -3,7 +3,7 @@
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
@api.model
def _load_pos_data_models(self, config_id):
diff --git a/addons/l10n_ar_pos/models/res_partner.py b/addons/l10n_ar_pos/models/res_partner.py
index 604e0cb1d33bd..f744cd5ee84d8 100644
--- a/addons/l10n_ar_pos/models/res_partner.py
+++ b/addons/l10n_ar_pos/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
@api.ondelete(at_uninstall=False)
def _ar_unlink_except_master_data(self):
diff --git a/addons/l10n_ar_website_sale/models/website.py b/addons/l10n_ar_website_sale/models/website.py
index 18c6fed9dfe15..8c2fa740adf06 100644
--- a/addons/l10n_ar_website_sale/models/website.py
+++ b/addons/l10n_ar_website_sale/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def _display_partner_b2b_fields(self):
""" Argentinean localization must always display b2b fields """
diff --git a/addons/l10n_ar_withholding/demo/account_demo.py b/addons/l10n_ar_withholding/demo/account_demo.py
index 9c80909df98a2..51f91cfab81d3 100644
--- a/addons/l10n_ar_withholding/demo/account_demo.py
+++ b/addons/l10n_ar_withholding/demo/account_demo.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
def _post_load_demo_data(self, company=False):
result = super()._post_load_demo_data(company)
diff --git a/addons/l10n_ar_withholding/models/account_chart_template.py b/addons/l10n_ar_withholding/models/account_chart_template.py
index 450489c1fbba7..a37b5d6d744fb 100644
--- a/addons/l10n_ar_withholding/models/account_chart_template.py
+++ b/addons/l10n_ar_withholding/models/account_chart_template.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
# ar base
@template('ar_base', 'account.account')
diff --git a/addons/l10n_ar_withholding/models/account_move.py b/addons/l10n_ar_withholding/models/account_move.py
index 724aa87f9d88c..6b4934c21cd27 100644
--- a/addons/l10n_ar_withholding/models/account_move.py
+++ b/addons/l10n_ar_withholding/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_ar_withholding_ids = fields.One2many(
'account.move.line', 'move_id', string='Withholdings',
diff --git a/addons/l10n_ar_withholding/models/account_payment.py b/addons/l10n_ar_withholding/models/account_payment.py
index 379faeb83f386..db2c3d4959e8d 100644
--- a/addons/l10n_ar_withholding/models/account_payment.py
+++ b/addons/l10n_ar_withholding/models/account_payment.py
@@ -4,6 +4,6 @@
class AccountPayment(models.Model):
- _inherit = 'account.payment'
+ _inherit = ['account.payment']
l10n_ar_withholding_ids = fields.One2many(related='move_id.l10n_ar_withholding_ids')
diff --git a/addons/l10n_ar_withholding/models/account_tax.py b/addons/l10n_ar_withholding/models/account_tax.py
index 312bbc2599ce7..b7a76ad29aef0 100644
--- a/addons/l10n_ar_withholding/models/account_tax.py
+++ b/addons/l10n_ar_withholding/models/account_tax.py
@@ -4,7 +4,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_ar_type_tax_use = fields.Selection(
selection=[
diff --git a/addons/l10n_ar_withholding/models/l10n_ar_earnings_scale.py b/addons/l10n_ar_withholding/models/l10n_ar_earnings_scale.py
index 84ee9dfbc0299..1a5bffb96930a 100644
--- a/addons/l10n_ar_withholding/models/l10n_ar_earnings_scale.py
+++ b/addons/l10n_ar_withholding/models/l10n_ar_earnings_scale.py
@@ -1,16 +1,14 @@
from odoo import models, fields, api
-class L10nArEarningsScale(models.Model):
- _name = 'l10n_ar.earnings.scale'
+class L10n_ArEarningsScale(models.Model):
_description = 'l10n_ar.earnings.scale'
name = fields.Char(required=True, translate=True)
line_ids = fields.One2many('l10n_ar.earnings.scale.line', 'scale_id')
-class L10nArEarningsScaleLine(models.Model):
- _name = 'l10n_ar.earnings.scale.line'
+class L10n_ArEarningsScaleLine(models.Model):
_description = 'l10n_ar.earnings.scale.line'
_order = 'to_amount'
diff --git a/addons/l10n_ar_withholding/models/l10n_ar_partner_tax.py b/addons/l10n_ar_withholding/models/l10n_ar_partner_tax.py
index 21d18b8d18001..ecff1bb1f04b7 100644
--- a/addons/l10n_ar_withholding/models/l10n_ar_partner_tax.py
+++ b/addons/l10n_ar_withholding/models/l10n_ar_partner_tax.py
@@ -5,8 +5,7 @@
_logger = logging.getLogger(__name__)
-class L10nArPartnerTax(models.Model):
- _name = "l10n_ar.partner.tax"
+class L10n_ArPartnerTax(models.Model):
_description = "Argentinean Partner Taxes"
_order = "to_date desc, from_date desc, tax_id"
_check_company_auto = True
diff --git a/addons/l10n_ar_withholding/models/res_company.py b/addons/l10n_ar_withholding/models/res_company.py
index 75c47f5a0635c..22f4616c2faab 100644
--- a/addons/l10n_ar_withholding/models/res_company.py
+++ b/addons/l10n_ar_withholding/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_ar_tax_base_account_id = fields.Many2one(
comodel_name='account.account',
diff --git a/addons/l10n_ar_withholding/models/res_config_settings.py b/addons/l10n_ar_withholding/models/res_config_settings.py
index 1c9e97bd30f7d..e48b86b826416 100644
--- a/addons/l10n_ar_withholding/models/res_config_settings.py
+++ b/addons/l10n_ar_withholding/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_ar_tax_base_account_id = fields.Many2one(
comodel_name='account.account',
diff --git a/addons/l10n_ar_withholding/models/res_partner.py b/addons/l10n_ar_withholding/models/res_partner.py
index 9d5cef29e0834..e150181ab18c6 100644
--- a/addons/l10n_ar_withholding/models/res_partner.py
+++ b/addons/l10n_ar_withholding/models/res_partner.py
@@ -2,7 +2,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
l10n_ar_partner_tax_ids = fields.One2many(
'l10n_ar.partner.tax',
diff --git a/addons/l10n_ar_withholding/wizards/account_payment_register.py b/addons/l10n_ar_withholding/wizards/account_payment_register.py
index 78d55ef3ec56b..ac00579f3ba36 100644
--- a/addons/l10n_ar_withholding/wizards/account_payment_register.py
+++ b/addons/l10n_ar_withholding/wizards/account_payment_register.py
@@ -9,7 +9,7 @@
class AccountPaymentRegister(models.TransientModel):
- _inherit = 'account.payment.register'
+ _inherit = ['account.payment.register']
l10n_ar_withholding_ids = fields.One2many(
'l10n_ar.payment.register.withholding', 'payment_register_id', string="Withholdings",
diff --git a/addons/l10n_ar_withholding/wizards/l10n_ar_payment_register_withholding.py b/addons/l10n_ar_withholding/wizards/l10n_ar_payment_register_withholding.py
index 6cd4ab8ada1f1..60a291ac13280 100644
--- a/addons/l10n_ar_withholding/wizards/l10n_ar_payment_register_withholding.py
+++ b/addons/l10n_ar_withholding/wizards/l10n_ar_payment_register_withholding.py
@@ -9,8 +9,7 @@
_logger = logging.getLogger(__name__)
-class l10nArPaymentRegisterWithholding(models.TransientModel):
- _name = 'l10n_ar.payment.register.withholding'
+class L10n_ArPaymentRegisterWithholding(models.TransientModel):
_description = 'Payment register withholding lines'
_check_company_auto = True
diff --git a/addons/l10n_at/models/account_journal.py b/addons/l10n_at/models/account_journal.py
index f9300862f6afa..fb6120003ea60 100644
--- a/addons/l10n_at/models/account_journal.py
+++ b/addons/l10n_at/models/account_journal.py
@@ -4,7 +4,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
@api.model
def _prepare_liquidity_account_vals(self, company, code, vals):
diff --git a/addons/l10n_at/models/template_at.py b/addons/l10n_at/models/template_at.py
index b4ae402e1ad1a..233c61df34128 100644
--- a/addons/l10n_at/models/template_at.py
+++ b/addons/l10n_at/models/template_at.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('at')
def _get_at_template_data(self):
diff --git a/addons/l10n_au/models/account_move.py b/addons/l10n_au/models/account_move.py
index 35e4d8c00b0b0..bdb62ea5db11e 100644
--- a/addons/l10n_au/models/account_move.py
+++ b/addons/l10n_au/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _get_name_invoice_report(self):
if self.company_id.account_fiscal_country_id.code == 'AU':
diff --git a/addons/l10n_au/models/account_payment.py b/addons/l10n_au/models/account_payment.py
index 0de1a3561edb9..4b800892b2940 100644
--- a/addons/l10n_au/models/account_payment.py
+++ b/addons/l10n_au/models/account_payment.py
@@ -3,7 +3,7 @@
class AccountPayment(models.Model):
- _inherit = 'account.payment'
+ _inherit = ['account.payment']
@api.depends('country_code', 'partner_type')
def _compute_payment_receipt_title(self):
diff --git a/addons/l10n_au/models/res_partner_bank.py b/addons/l10n_au/models/res_partner_bank.py
index ea2f4f380a29c..ea49d8cded049 100644
--- a/addons/l10n_au/models/res_partner_bank.py
+++ b/addons/l10n_au/models/res_partner_bank.py
@@ -8,7 +8,7 @@
class ResPartnerBank(models.Model):
- _inherit = "res.partner.bank"
+ _inherit = ["res.partner.bank"]
aba_bsb = fields.Char(string='BSB', help='Bank State Branch code - needed if payment is to be made using ABA files')
diff --git a/addons/l10n_au/models/template_au.py b/addons/l10n_au/models/template_au.py
index ec5a7ba7ffe73..64af00a31e205 100644
--- a/addons/l10n_au/models/template_au.py
+++ b/addons/l10n_au/models/template_au.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('au')
def _get_au_template_data(self):
diff --git a/addons/l10n_bd/models/template_bd.py b/addons/l10n_bd/models/template_bd.py
index 3a71615dc7bc0..c0cf5b5e3f844 100644
--- a/addons/l10n_bd/models/template_bd.py
+++ b/addons/l10n_bd/models/template_bd.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('bd')
def _get_bd_template_data(self):
diff --git a/addons/l10n_be/demo/account_demo.py b/addons/l10n_be/demo/account_demo.py
index c0cde7edc603d..afd0504efa913 100644
--- a/addons/l10n_be/demo/account_demo.py
+++ b/addons/l10n_be/demo/account_demo.py
@@ -2,7 +2,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@api.model
def _get_demo_data(self, company=False):
diff --git a/addons/l10n_be/models/account_journal.py b/addons/l10n_be/models/account_journal.py
index 9ec4f408cbdbf..55d7d1f386914 100644
--- a/addons/l10n_be/models/account_journal.py
+++ b/addons/l10n_be/models/account_journal.py
@@ -4,7 +4,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
invoice_reference_model = fields.Selection(selection_add=[
('be', 'Belgium')
diff --git a/addons/l10n_be/models/account_move.py b/addons/l10n_be/models/account_move.py
index 7393d194e3c2f..2bb61c7f76740 100644
--- a/addons/l10n_be/models/account_move.py
+++ b/addons/l10n_be/models/account_move.py
@@ -15,7 +15,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _get_invoice_reference_be_partner(self):
""" This computes the reference based on the belgian national standard
diff --git a/addons/l10n_be/models/account_tax.py b/addons/l10n_be/models/account_tax.py
index c8ac64a38cb08..22912c49a8601 100644
--- a/addons/l10n_be/models/account_tax.py
+++ b/addons/l10n_be/models/account_tax.py
@@ -2,7 +2,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
tax_scope = fields.Selection(
selection_add=[('merch', 'Merchandise'), ('invest', 'Investment')],
diff --git a/addons/l10n_be/models/res_partner.py b/addons/l10n_be/models/res_partner.py
index 02b1969708064..0468233e50d5e 100644
--- a/addons/l10n_be/models/res_partner.py
+++ b/addons/l10n_be/models/res_partner.py
@@ -7,7 +7,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
@api.depends('vat', 'country_id')
def _compute_company_registry(self):
diff --git a/addons/l10n_be/models/template_be.py b/addons/l10n_be/models/template_be.py
index 09ffa45268f6e..b5983208733a6 100644
--- a/addons/l10n_be/models/template_be.py
+++ b/addons/l10n_be/models/template_be.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('be')
def _get_be_template_data(self):
diff --git a/addons/l10n_be/models/template_be_asso.py b/addons/l10n_be/models/template_be_asso.py
index e5a9805060f64..fc3686a9756f9 100644
--- a/addons/l10n_be/models/template_be_asso.py
+++ b/addons/l10n_be/models/template_be_asso.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('be_asso')
def _get_be_asso_template_data(self):
diff --git a/addons/l10n_be/models/template_be_comp.py b/addons/l10n_be/models/template_be_comp.py
index 626802946a004..d2e48df2f61d6 100644
--- a/addons/l10n_be/models/template_be_comp.py
+++ b/addons/l10n_be/models/template_be_comp.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('be_comp')
def _get_be_comp_template_data(self):
diff --git a/addons/l10n_bf/models/template_bf.py b/addons/l10n_bf/models/template_bf.py
index 0c2b31cde23f4..77150637d4b71 100644
--- a/addons/l10n_bf/models/template_bf.py
+++ b/addons/l10n_bf/models/template_bf.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('bf')
def _get_bf_template_data(self):
diff --git a/addons/l10n_bf/models/template_bf_syscebnl.py b/addons/l10n_bf/models/template_bf_syscebnl.py
index a4456ec27e58b..6bdf23600fef2 100644
--- a/addons/l10n_bf/models/template_bf_syscebnl.py
+++ b/addons/l10n_bf/models/template_bf_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('bf_syscebnl')
def _get_bf_syscebnl_template_data(self):
diff --git a/addons/l10n_bg/models/template_bg.py b/addons/l10n_bg/models/template_bg.py
index 7505b1e345b33..3f03cae0dd2b6 100644
--- a/addons/l10n_bg/models/template_bg.py
+++ b/addons/l10n_bg/models/template_bg.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('bg')
def _get_bg_template_data(self):
diff --git a/addons/l10n_bj/models/template_bj.py b/addons/l10n_bj/models/template_bj.py
index 216fb0a00ed86..4490b2c27109c 100644
--- a/addons/l10n_bj/models/template_bj.py
+++ b/addons/l10n_bj/models/template_bj.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('bj')
def _get_bj_template_data(self):
diff --git a/addons/l10n_bj/models/template_bj_syscebnl.py b/addons/l10n_bj/models/template_bj_syscebnl.py
index e08ec047431ca..0185dc2b73557 100644
--- a/addons/l10n_bj/models/template_bj_syscebnl.py
+++ b/addons/l10n_bj/models/template_bj_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('bj_syscebnl')
def _get_bj_syscebnl_template_data(self):
diff --git a/addons/l10n_bo/models/template_bo.py b/addons/l10n_bo/models/template_bo.py
index 67bc80a360b2b..85cc5364c6b39 100644
--- a/addons/l10n_bo/models/template_bo.py
+++ b/addons/l10n_bo/models/template_bo.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('bo')
def _get_bo_template_data(self):
diff --git a/addons/l10n_br/demo/account_demo.py b/addons/l10n_br/demo/account_demo.py
index 3fb01d069343f..4f4c5a51ed513 100644
--- a/addons/l10n_br/demo/account_demo.py
+++ b/addons/l10n_br/demo/account_demo.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@api.model
def _get_demo_data_move(self, company=False):
diff --git a/addons/l10n_br/models/account.py b/addons/l10n_br/models/account.py
index c433eae9bf73f..28ac2c78a7ae9 100644
--- a/addons/l10n_br/models/account.py
+++ b/addons/l10n_br/models/account.py
@@ -6,7 +6,7 @@
class AccountTax(models.Model):
""" Add fields used to define some brazilian taxes """
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
tax_discount = fields.Boolean(string='Discount this Tax in Price',
help="Mark it for (ICMS, PIS e etc.).")
diff --git a/addons/l10n_br/models/account_fiscal_position.py b/addons/l10n_br/models/account_fiscal_position.py
index 4b672ace31ee9..f332401ec80a3 100644
--- a/addons/l10n_br/models/account_fiscal_position.py
+++ b/addons/l10n_br/models/account_fiscal_position.py
@@ -10,7 +10,7 @@
class AccountFiscalPosition(models.Model):
- _inherit = 'account.fiscal.position'
+ _inherit = ['account.fiscal.position']
l10n_br_fp_type = fields.Selection(
selection=[
diff --git a/addons/l10n_br/models/account_journal.py b/addons/l10n_br/models/account_journal.py
index 7deb68ca4510b..695f0dca36037 100644
--- a/addons/l10n_br/models/account_journal.py
+++ b/addons/l10n_br/models/account_journal.py
@@ -3,7 +3,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
l10n_br_invoice_serial = fields.Char(
'Series', copy=False,
diff --git a/addons/l10n_br/models/account_move.py b/addons/l10n_br/models/account_move.py
index 4016ffe766f7c..8f6f9c7263ea5 100644
--- a/addons/l10n_br/models/account_move.py
+++ b/addons/l10n_br/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
def _compute_l10n_latam_document_type(self):
""" Override for debit notes. This sets the same document type as the one on the origin. Cannot
diff --git a/addons/l10n_br/models/l10n_br_zip_range.py b/addons/l10n_br/models/l10n_br_zip_range.py
index 50b3cc1d30723..ae14c0bf29405 100644
--- a/addons/l10n_br/models/l10n_br_zip_range.py
+++ b/addons/l10n_br/models/l10n_br_zip_range.py
@@ -5,8 +5,7 @@
from odoo.exceptions import ValidationError
-class L10nBrZipRange(models.Model):
- _name = "l10n_br.zip.range"
+class L10n_BrZipRange(models.Model):
_description = "Brazilian city zip range"
city_id = fields.Many2one("res.city", string="City", required=True)
diff --git a/addons/l10n_br/models/res_city.py b/addons/l10n_br/models/res_city.py
index 04e2dac4c4e61..6478544ed31fb 100644
--- a/addons/l10n_br/models/res_city.py
+++ b/addons/l10n_br/models/res_city.py
@@ -3,7 +3,7 @@
class ResCity(models.Model):
- _inherit = "res.city"
+ _inherit = ["res.city"]
l10n_br_zip_range_ids = fields.One2many(
string="Zip Ranges",
diff --git a/addons/l10n_br/models/res_company.py b/addons/l10n_br/models/res_company.py
index 192f26f31c2d7..12071ff4038f8 100644
--- a/addons/l10n_br/models/res_company.py
+++ b/addons/l10n_br/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
# ==== Business fields ====
l10n_br_cpf_code = fields.Char(string="CPF", help="Natural Persons Register.")
diff --git a/addons/l10n_br/models/res_partner.py b/addons/l10n_br/models/res_partner.py
index a4f245c1e1d87..4b215f2ef938a 100644
--- a/addons/l10n_br/models/res_partner.py
+++ b/addons/l10n_br/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_br_ie_code = fields.Char(string="IE", help="State Tax Identification Number. Should contain 9-14 digits.")
l10n_br_im_code = fields.Char(string="IM", help="Municipal Tax Identification Number")
diff --git a/addons/l10n_br/models/res_partner_bank.py b/addons/l10n_br/models/res_partner_bank.py
index eb94979736241..5fba35eca77a6 100644
--- a/addons/l10n_br/models/res_partner_bank.py
+++ b/addons/l10n_br/models/res_partner_bank.py
@@ -8,7 +8,7 @@
class ResPartnerBank(models.Model):
- _inherit = "res.partner.bank"
+ _inherit = ["res.partner.bank"]
proxy_type = fields.Selection(
selection_add=[
diff --git a/addons/l10n_br/models/template_br.py b/addons/l10n_br/models/template_br.py
index d817a54578659..3e54b64a857d3 100644
--- a/addons/l10n_br/models/template_br.py
+++ b/addons/l10n_br/models/template_br.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('br')
def _get_br_template_data(self):
diff --git a/addons/l10n_br/wizard/account_move_reversal.py b/addons/l10n_br/wizard/account_move_reversal.py
index aa99da5b89ba7..1fc853c6fcca6 100644
--- a/addons/l10n_br/wizard/account_move_reversal.py
+++ b/addons/l10n_br/wizard/account_move_reversal.py
@@ -3,7 +3,7 @@
class AccountMoveReversal(models.TransientModel):
- _inherit = "account.move.reversal"
+ _inherit = ["account.move.reversal"]
def _compute_document_type(self):
""" If a l10n_latam_document_type_id was set, change it in the case of Brazil to be
diff --git a/addons/l10n_br_sales/models/sale_order.py b/addons/l10n_br_sales/models/sale_order.py
index 9c870946170cf..79b57bd9f3123 100644
--- a/addons/l10n_br_sales/models/sale_order.py
+++ b/addons/l10n_br_sales/models/sale_order.py
@@ -2,8 +2,9 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
+
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
def _get_name_portal_content_view(self):
self.ensure_one()
diff --git a/addons/l10n_br_website_sale/models/website.py b/addons/l10n_br_website_sale/models/website.py
index 2108a1a5e377e..26a0e2a499164 100644
--- a/addons/l10n_br_website_sale/models/website.py
+++ b/addons/l10n_br_website_sale/models/website.py
@@ -3,7 +3,7 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/l10n_ca/models/res_company.py b/addons/l10n_ca/models/res_company.py
index 89b34f6e35d3b..9d6a57548ca76 100644
--- a/addons/l10n_ca/models/res_company.py
+++ b/addons/l10n_ca/models/res_company.py
@@ -2,13 +2,13 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_ca_pst = fields.Char(related='partner_id.l10n_ca_pst', string='PST Number', store=False, readonly=False)
class BaseDocumentLayout(models.TransientModel):
- _inherit = 'base.document.layout'
+ _inherit = ['base.document.layout']
l10n_ca_pst = fields.Char(related='company_id.l10n_ca_pst', readonly=True)
account_fiscal_country_id = fields.Many2one(related="company_id.account_fiscal_country_id", readonly=True)
diff --git a/addons/l10n_ca/models/res_partner.py b/addons/l10n_ca/models/res_partner.py
index c93757a69e650..ba7ccdeaa1054 100644
--- a/addons/l10n_ca/models/res_partner.py
+++ b/addons/l10n_ca/models/res_partner.py
@@ -2,6 +2,6 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_ca_pst = fields.Char(string='PST number', help='Canadian Provincial Tax Identification Number')
diff --git a/addons/l10n_ca/models/template_ca.py b/addons/l10n_ca/models/template_ca.py
index be5f3a6fecf43..62837005ab3ba 100644
--- a/addons/l10n_ca/models/template_ca.py
+++ b/addons/l10n_ca/models/template_ca.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ca_2023')
def _get_ca_template_data(self):
diff --git a/addons/l10n_cd/models/template_cd.py b/addons/l10n_cd/models/template_cd.py
index 921329a45fd98..fab3da8c76ec0 100644
--- a/addons/l10n_cd/models/template_cd.py
+++ b/addons/l10n_cd/models/template_cd.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cd')
def _get_cd_template_data(self):
diff --git a/addons/l10n_cd/models/template_cd_syscebnl.py b/addons/l10n_cd/models/template_cd_syscebnl.py
index efbe5511cbb8d..5ea3f2ddfac07 100644
--- a/addons/l10n_cd/models/template_cd_syscebnl.py
+++ b/addons/l10n_cd/models/template_cd_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cd_syscebnl')
def _get_cd_syscebnl_template_data(self):
diff --git a/addons/l10n_cf/models/template_cf.py b/addons/l10n_cf/models/template_cf.py
index 4e5d39ccfc809..1e7f6e7ee06d1 100644
--- a/addons/l10n_cf/models/template_cf.py
+++ b/addons/l10n_cf/models/template_cf.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cf')
def _get_cf_template_data(self):
diff --git a/addons/l10n_cf/models/template_cf_syscebnl.py b/addons/l10n_cf/models/template_cf_syscebnl.py
index 9804c3050129d..967c29818506a 100644
--- a/addons/l10n_cf/models/template_cf_syscebnl.py
+++ b/addons/l10n_cf/models/template_cf_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cf_syscebnl')
def _get_cf_template_data(self):
diff --git a/addons/l10n_cg/models/template_cg.py b/addons/l10n_cg/models/template_cg.py
index a67ec73ad9d68..ad9cf8f334b2b 100644
--- a/addons/l10n_cg/models/template_cg.py
+++ b/addons/l10n_cg/models/template_cg.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cg')
def _get_cg_template_data(self):
diff --git a/addons/l10n_cg/models/template_cg_syscebnl.py b/addons/l10n_cg/models/template_cg_syscebnl.py
index 6720162f23dca..055b32ba29791 100644
--- a/addons/l10n_cg/models/template_cg_syscebnl.py
+++ b/addons/l10n_cg/models/template_cg_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cg_syscebnl')
def _get_cg_syscebnl_template_data(self):
diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py
index bf2fe51645bae..4c1ec75128b19 100644
--- a/addons/l10n_ch/models/account_invoice.py
+++ b/addons/l10n_ch/models/account_invoice.py
@@ -8,8 +8,9 @@
L10N_CH_QRR_NUMBER_LENGTH = 27
+
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_ch_is_qr_valid = fields.Boolean(compute='_compute_l10n_ch_qr_is_valid', help="Determines whether an invoice can be printed as a QR or not")
diff --git a/addons/l10n_ch/models/account_journal.py b/addons/l10n_ch/models/account_journal.py
index e17fadceb1445..3f81d0448d9d1 100644
--- a/addons/l10n_ch/models/account_journal.py
+++ b/addons/l10n_ch/models/account_journal.py
@@ -10,7 +10,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
invoice_reference_model = fields.Selection(selection_add=[
('ch', 'Switzerland')
diff --git a/addons/l10n_ch/models/account_payment.py b/addons/l10n_ch/models/account_payment.py
index 224a83be6bf68..eff13c2887e8d 100644
--- a/addons/l10n_ch/models/account_payment.py
+++ b/addons/l10n_ch/models/account_payment.py
@@ -6,7 +6,7 @@
class AccountPayment(models.Model):
- _inherit = "account.payment"
+ _inherit = ["account.payment"]
l10n_ch_reference_warning_msg = fields.Char(compute='_compute_l10n_ch_reference_warning_msg')
diff --git a/addons/l10n_ch/models/ir_actions_report.py b/addons/l10n_ch/models/ir_actions_report.py
index 06b748609f9b4..4d859fa732487 100644
--- a/addons/l10n_ch/models/ir_actions_report.py
+++ b/addons/l10n_ch/models/ir_actions_report.py
@@ -10,8 +10,9 @@
CH_QR_CROSS_SIZE_RATIO = 0.1522 # Ratio between the side length of the Swiss QR-code cross image and the QR-code's
CH_QR_CROSS_FILE = Path('../static/src/img/CH-Cross_7mm.png') # Image file containing the Swiss QR-code cross to add on top of the QR-code
+
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
@api.model
def get_available_barcode_masks(self):
diff --git a/addons/l10n_ch/models/res_bank.py b/addons/l10n_ch/models/res_bank.py
index a5260b547c2ec..7a95b5465decf 100644
--- a/addons/l10n_ch/models/res_bank.py
+++ b/addons/l10n_ch/models/res_bank.py
@@ -40,7 +40,7 @@ def check_qr_iban_range(iban):
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
l10n_ch_qr_iban = fields.Char(string='QR-IBAN',
compute='_compute_l10n_ch_qr_iban',
diff --git a/addons/l10n_ch/models/template_ch.py b/addons/l10n_ch/models/template_ch.py
index 5c008414cfd64..9176f2bb05a15 100644
--- a/addons/l10n_ch/models/template_ch.py
+++ b/addons/l10n_ch/models/template_ch.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ch')
def _get_ch_template_data(self):
diff --git a/addons/l10n_ch/report/swissqr_report.py b/addons/l10n_ch/report/swissqr_report.py
index c10e3959a1206..4ff1f6bd2df4f 100644
--- a/addons/l10n_ch/report/swissqr_report.py
+++ b/addons/l10n_ch/report/swissqr_report.py
@@ -1,8 +1,8 @@
# -*- coding:utf-8 -*-
from odoo import api, models
-class ReportSwissQR(models.AbstractModel):
- _name = 'report.l10n_ch.qr_report_main'
+
+class ReportL10n_ChQr_Report_Main(models.AbstractModel):
_description = 'Swiss QR-bill report'
@api.model
diff --git a/addons/l10n_ch/wizard/qr_invoice_wizard.py b/addons/l10n_ch/wizard/qr_invoice_wizard.py
index 114bc39a6f417..e0dc8e2dccf5f 100644
--- a/addons/l10n_ch/wizard/qr_invoice_wizard.py
+++ b/addons/l10n_ch/wizard/qr_invoice_wizard.py
@@ -3,7 +3,7 @@
from odoo.exceptions import UserError
-class QrInvoiceWizard(models.TransientModel):
+class L10n_ChQr_InvoiceWizard(models.TransientModel):
'''
Wizard :
When multiple invoices are selected to be printed in the QR-Iban format,
@@ -12,7 +12,6 @@ class QrInvoiceWizard(models.TransientModel):
to see a list of those.
The non-QR invoices will have a note logged in their chatter, detailing the reason of the failure.
'''
- _name = 'l10n_ch.qr_invoice.wizard'
_description = 'Handles problems occurring while creating multiple QR-invoices at once'
nb_qr_inv = fields.Integer(readonly=True)
diff --git a/addons/l10n_ch/wizard/setup_wizards.py b/addons/l10n_ch/wizard/setup_wizards.py
index efc2b6ac19a03..23224ee9fd696 100644
--- a/addons/l10n_ch/wizard/setup_wizards.py
+++ b/addons/l10n_ch/wizard/setup_wizards.py
@@ -2,8 +2,8 @@
from odoo import api, models, fields
-class SwissSetupBarBankConfigWizard(models.TransientModel):
- _inherit = 'account.setup.bank.manual.config'
+class AccountSetupBankManualConfig(models.TransientModel):
+ _inherit = ['account.setup.bank.manual.config']
@api.onchange('acc_number')
def _onchange_recompute_qr_iban(self):
diff --git a/addons/l10n_ch_pos/models/pos_order.py b/addons/l10n_ch_pos/models/pos_order.py
index a77a8e7565f8c..6991df0b35f89 100644
--- a/addons/l10n_ch_pos/models/pos_order.py
+++ b/addons/l10n_ch_pos/models/pos_order.py
@@ -3,7 +3,6 @@
class PosOrder(models.Model):
- _name = "pos.order"
_inherit = ["pos.order"]
def _get_partner_bank_id(self):
diff --git a/addons/l10n_ci/models/template_ci.py b/addons/l10n_ci/models/template_ci.py
index 96ba9d6a53e05..688d0f6b23806 100644
--- a/addons/l10n_ci/models/template_ci.py
+++ b/addons/l10n_ci/models/template_ci.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ci')
def _get_ci_template_data(self):
diff --git a/addons/l10n_ci/models/template_ci_syscebnl.py b/addons/l10n_ci/models/template_ci_syscebnl.py
index f1ae8a2ed87df..5299c1d9f8438 100644
--- a/addons/l10n_ci/models/template_ci_syscebnl.py
+++ b/addons/l10n_ci/models/template_ci_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ci_syscebnl')
def _get_ci_syscebnl_template_data(self):
diff --git a/addons/l10n_cl/demo/account_demo.py b/addons/l10n_cl/demo/account_demo.py
index 8468b773fd0dd..f16c766944f59 100644
--- a/addons/l10n_cl/demo/account_demo.py
+++ b/addons/l10n_cl/demo/account_demo.py
@@ -7,7 +7,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@api.model
def _get_demo_data_move(self, company=False):
diff --git a/addons/l10n_cl/models/account_move.py b/addons/l10n_cl/models/account_move.py
index a84b97153af91..87b26c927269d 100644
--- a/addons/l10n_cl/models/account_move.py
+++ b/addons/l10n_cl/models/account_move.py
@@ -9,7 +9,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
partner_id_vat = fields.Char(related='partner_id.vat', string='VAT No')
l10n_latam_internal_type = fields.Selection(
diff --git a/addons/l10n_cl/models/account_move_line.py b/addons/l10n_cl/models/account_move_line.py
index 97cb3d71669f8..e0128e4c9a0c1 100644
--- a/addons/l10n_cl/models/account_move_line.py
+++ b/addons/l10n_cl/models/account_move_line.py
@@ -6,7 +6,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _l10n_cl_prices_and_taxes(self):
""" this method is preserved here to allow compatibility with old templates,
diff --git a/addons/l10n_cl/models/account_tax.py b/addons/l10n_cl/models/account_tax.py
index 01c7e576524e9..5588111e5f012 100644
--- a/addons/l10n_cl/models/account_tax.py
+++ b/addons/l10n_cl/models/account_tax.py
@@ -4,6 +4,6 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_cl_sii_code = fields.Integer('SII Code', aggregator=False)
diff --git a/addons/l10n_cl/models/l10n_latam_document_type.py b/addons/l10n_cl/models/l10n_latam_document_type.py
index defdb088786ad..23361ba955122 100644
--- a/addons/l10n_cl/models/l10n_latam_document_type.py
+++ b/addons/l10n_cl/models/l10n_latam_document_type.py
@@ -3,9 +3,9 @@
from odoo import models, fields
-class L10nLatamDocumentType(models.Model):
+class L10n_LatamDocumentType(models.Model):
- _inherit = 'l10n_latam.document.type'
+ _inherit = ['l10n_latam.document.type']
internal_type = fields.Selection(
selection_add=[
diff --git a/addons/l10n_cl/models/res_company.py b/addons/l10n_cl/models/res_company.py
index 64ac94a09342e..0a19e9cf94ea4 100644
--- a/addons/l10n_cl/models/res_company.py
+++ b/addons/l10n_cl/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
l10n_cl_activity_description = fields.Char(
string='Company Activity Description', related='partner_id.l10n_cl_activity_description', readonly=False)
diff --git a/addons/l10n_cl/models/res_country.py b/addons/l10n_cl/models/res_country.py
index 7e78a0caafe67..6aab7ed47e69d 100644
--- a/addons/l10n_cl/models/res_country.py
+++ b/addons/l10n_cl/models/res_country.py
@@ -3,9 +3,8 @@
from odoo import fields, models
-class ResPartner(models.Model):
- _name = 'res.country'
- _inherit = 'res.country'
+class ResCountry(models.Model):
+ _inherit = ['res.country']
l10n_cl_customs_code = fields.Char('Customs Code')
l10n_cl_customs_name = fields.Char('Customs Name')
diff --git a/addons/l10n_cl/models/res_currency.py b/addons/l10n_cl/models/res_currency.py
index 7b6f504b74bd3..4b26098357a3a 100644
--- a/addons/l10n_cl/models/res_currency.py
+++ b/addons/l10n_cl/models/res_currency.py
@@ -3,8 +3,7 @@
class ResCurrency(models.Model):
- _name = "res.currency"
- _inherit = "res.currency"
+ _inherit = ["res.currency"]
l10n_cl_currency_code = fields.Char('Currency Code', translate=True)
l10n_cl_short_name = fields.Char('Short Name', translate=True)
diff --git a/addons/l10n_cl/models/res_partner.py b/addons/l10n_cl/models/res_partner.py
index 3ed70d25c3144..a26c3c1486555 100644
--- a/addons/l10n_cl/models/res_partner.py
+++ b/addons/l10n_cl/models/res_partner.py
@@ -5,8 +5,7 @@
class ResPartner(models.Model):
- _name = 'res.partner'
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_cl_sii_taxpayer_type = fields.Selection(
[
diff --git a/addons/l10n_cl/models/res_partner_bank.py b/addons/l10n_cl/models/res_partner_bank.py
index 825a372d4f346..d6b06d97da537 100644
--- a/addons/l10n_cl/models/res_partner_bank.py
+++ b/addons/l10n_cl/models/res_partner_bank.py
@@ -3,8 +3,7 @@
class ResBank(models.Model):
- _name = 'res.bank'
- _inherit = 'res.bank'
+ _inherit = ['res.bank']
def _get_fiscal_country_codes(self):
return ','.join(self.env.companies.mapped('account_fiscal_country_id.code'))
diff --git a/addons/l10n_cl/models/template_cl.py b/addons/l10n_cl/models/template_cl.py
index 3373c0ae23489..55d44455a8e4e 100644
--- a/addons/l10n_cl/models/template_cl.py
+++ b/addons/l10n_cl/models/template_cl.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cl')
def _get_cl_template_data(self):
diff --git a/addons/l10n_cl/models/uom_uom.py b/addons/l10n_cl/models/uom_uom.py
index f4ec5de0a58b4..59c9106915f6f 100644
--- a/addons/l10n_cl/models/uom_uom.py
+++ b/addons/l10n_cl/models/uom_uom.py
@@ -4,6 +4,6 @@
class UomUom(models.Model):
- _inherit = 'uom.uom'
+ _inherit = ['uom.uom']
l10n_cl_sii_code = fields.Char('SII Code')
diff --git a/addons/l10n_cm/models/template_cm.py b/addons/l10n_cm/models/template_cm.py
index dd175ea41ca00..06ff5e17d37d2 100644
--- a/addons/l10n_cm/models/template_cm.py
+++ b/addons/l10n_cm/models/template_cm.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cm')
def _get_cm_template_data(self):
diff --git a/addons/l10n_cm/models/template_cm_syscebnl.py b/addons/l10n_cm/models/template_cm_syscebnl.py
index 834c247089041..86709a8328f0f 100644
--- a/addons/l10n_cm/models/template_cm_syscebnl.py
+++ b/addons/l10n_cm/models/template_cm_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cm_syscebnl')
def _get_cm_syscebnl_template_data(self):
diff --git a/addons/l10n_cn/models/account_move.py b/addons/l10n_cn/models/account_move.py
index 50cde9a77c040..3f4229ac1fab5 100644
--- a/addons/l10n_cn/models/account_move.py
+++ b/addons/l10n_cn/models/account_move.py
@@ -10,8 +10,9 @@
except ImportError:
an2cn = None
+
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
fapiao = fields.Char(string='Fapiao Number', size=8, copy=False, tracking=True)
diff --git a/addons/l10n_cn/models/template_cn.py b/addons/l10n_cn/models/template_cn.py
index f173f317bc43e..a5b73eeb94672 100644
--- a/addons/l10n_cn/models/template_cn.py
+++ b/addons/l10n_cn/models/template_cn.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cn')
def _get_cn_template_data(self):
diff --git a/addons/l10n_cn/models/template_cn_common.py b/addons/l10n_cn/models/template_cn_common.py
index 31225ae617003..d770314222019 100644
--- a/addons/l10n_cn/models/template_cn_common.py
+++ b/addons/l10n_cn/models/template_cn_common.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cn_common')
def _get_cn_common_template_data(self):
diff --git a/addons/l10n_cn/models/template_cn_large_bis.py b/addons/l10n_cn/models/template_cn_large_bis.py
index dc7177731ca00..e13a59aab3b8f 100644
--- a/addons/l10n_cn/models/template_cn_large_bis.py
+++ b/addons/l10n_cn/models/template_cn_large_bis.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cn_large_bis')
def _get_cn_large_bis_template_data(self):
diff --git a/addons/l10n_co/models/l10n_latam_identification_type.py b/addons/l10n_co/models/l10n_latam_identification_type.py
index a860f632aea3a..9516d90fb3095 100644
--- a/addons/l10n_co/models/l10n_latam_identification_type.py
+++ b/addons/l10n_co/models/l10n_latam_identification_type.py
@@ -2,7 +2,7 @@
from odoo import models, fields
-class L10nCoDocumentType(models.Model):
- _inherit = "l10n_latam.identification.type"
+class L10n_LatamIdentificationType(models.Model):
+ _inherit = ["l10n_latam.identification.type"]
l10n_co_document_code = fields.Char("Document Code")
diff --git a/addons/l10n_co/models/res_partner.py b/addons/l10n_co/models/res_partner.py
index 160eacb73e12e..944b04bc10ff4 100644
--- a/addons/l10n_co/models/res_partner.py
+++ b/addons/l10n_co/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
@api.constrains('vat', 'country_id', 'l10n_latam_identification_type_id')
def check_vat(self):
diff --git a/addons/l10n_co/models/template_co.py b/addons/l10n_co/models/template_co.py
index 137e8a1f4442a..92e5bc8b855f0 100644
--- a/addons/l10n_co/models/template_co.py
+++ b/addons/l10n_co/models/template_co.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('co')
def _get_co_template_data(self):
diff --git a/addons/l10n_co_pos/models/pos_order.py b/addons/l10n_co_pos/models/pos_order.py
index 42f6a4e097711..db2dc32eb223e 100644
--- a/addons/l10n_co_pos/models/pos_order.py
+++ b/addons/l10n_co_pos/models/pos_order.py
@@ -2,7 +2,7 @@
class PosOrder(models.Model):
- _inherit = "pos.order"
+ _inherit = ["pos.order"]
def _prepare_invoice_vals(self):
move_vals = super()._prepare_invoice_vals()
diff --git a/addons/l10n_cr/models/template_cr.py b/addons/l10n_cr/models/template_cr.py
index d09315d0071d8..1bd680f37d7c9 100644
--- a/addons/l10n_cr/models/template_cr.py
+++ b/addons/l10n_cr/models/template_cr.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cr')
def _get_cr_template_data(self):
diff --git a/addons/l10n_cy/models/template_cy.py b/addons/l10n_cy/models/template_cy.py
index 514dea2ce9159..f3877c3540008 100644
--- a/addons/l10n_cy/models/template_cy.py
+++ b/addons/l10n_cy/models/template_cy.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cy')
def _get_cy_template_data(self):
diff --git a/addons/l10n_cz/models/account_move.py b/addons/l10n_cz/models/account_move.py
index b719861d7f184..79e928a5c5693 100644
--- a/addons/l10n_cz/models/account_move.py
+++ b/addons/l10n_cz/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
taxable_supply_date = fields.Date(default=fields.Date.today())
diff --git a/addons/l10n_cz/models/account_move_line.py b/addons/l10n_cz/models/account_move_line.py
index b6550e14ebaa6..3a12f85c1c084 100644
--- a/addons/l10n_cz/models/account_move_line.py
+++ b/addons/l10n_cz/models/account_move_line.py
@@ -3,7 +3,7 @@
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
def _compute_currency_rate(self):
super()._compute_currency_rate()
diff --git a/addons/l10n_cz/models/res_company.py b/addons/l10n_cz/models/res_company.py
index d3620918f8c81..eb15bac27e8f4 100644
--- a/addons/l10n_cz/models/res_company.py
+++ b/addons/l10n_cz/models/res_company.py
@@ -4,12 +4,13 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
trade_registry = fields.Char()
+
class BaseDocumentLayout(models.TransientModel):
- _inherit = 'base.document.layout'
+ _inherit = ['base.document.layout']
account_fiscal_country_id = fields.Many2one(related="company_id.account_fiscal_country_id")
company_registry = fields.Char(related='company_id.company_registry')
diff --git a/addons/l10n_cz/models/template_cz.py b/addons/l10n_cz/models/template_cz.py
index 32c5e09fae501..dcfb80c44eaf3 100644
--- a/addons/l10n_cz/models/template_cz.py
+++ b/addons/l10n_cz/models/template_cz.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('cz')
def _get_cz_template_data(self):
diff --git a/addons/l10n_de/models/account_journal.py b/addons/l10n_de/models/account_journal.py
index cebb44c9b5fee..e87b4cf7a3c72 100644
--- a/addons/l10n_de/models/account_journal.py
+++ b/addons/l10n_de/models/account_journal.py
@@ -2,8 +2,9 @@
from odoo import api, models
+
class AccountJournal(models.Model):
- _inherit = "account.journal"
+ _inherit = ["account.journal"]
@api.model
def _prepare_liquidity_account_vals(self, company, code, vals):
diff --git a/addons/l10n_de/models/account_move.py b/addons/l10n_de/models/account_move.py
index 833a84ced0af5..e4b2a56847613 100644
--- a/addons/l10n_de/models/account_move.py
+++ b/addons/l10n_de/models/account_move.py
@@ -1,7 +1,8 @@
from odoo import models, api
+
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
@api.depends('invoice_date')
def _compute_delivery_date(self):
diff --git a/addons/l10n_de/models/chart_template.py b/addons/l10n_de/models/chart_template.py
index 3fc9b85fa3e63..8299516cd2462 100644
--- a/addons/l10n_de/models/chart_template.py
+++ b/addons/l10n_de/models/chart_template.py
@@ -2,8 +2,9 @@
from odoo.addons.account.models.chart_template import template
from odoo import models
+
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('de_skr03', 'res.company')
@template('de_skr04', 'res.company')
diff --git a/addons/l10n_de/models/datev.py b/addons/l10n_de/models/datev.py
index cb58c885d35d7..b1a2e24b62814 100644
--- a/addons/l10n_de/models/datev.py
+++ b/addons/l10n_de/models/datev.py
@@ -2,13 +2,13 @@
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
l10n_de_datev_code = fields.Char(size=4, help="4 digits code use by Datev", tracking=True)
class ProductTemplate(models.Model):
- _inherit = "product.template"
+ _inherit = ["product.template"]
def _get_product_accounts(self):
""" As taxes with a different rate need a different income/expense account, we add this logic in case people only use
diff --git a/addons/l10n_de/models/ir_actions_report.py b/addons/l10n_de/models/ir_actions_report.py
index 2590b75a98f8d..c8e1d476381f1 100644
--- a/addons/l10n_de/models/ir_actions_report.py
+++ b/addons/l10n_de/models/ir_actions_report.py
@@ -2,7 +2,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
def _get_rendering_context(self, report, docids, data):
data = super()._get_rendering_context(report, docids, data)
diff --git a/addons/l10n_de/models/ir_attachment.py b/addons/l10n_de/models/ir_attachment.py
index 4243dcdbc5bf4..28f261b89a91d 100644
--- a/addons/l10n_de/models/ir_attachment.py
+++ b/addons/l10n_de/models/ir_attachment.py
@@ -7,7 +7,7 @@
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
@api.ondelete(at_uninstall=True)
def _except_audit_trail(self):
diff --git a/addons/l10n_de/models/res_company.py b/addons/l10n_de/models/res_company.py
index b932c1113ea94..e2e871e2aed94 100644
--- a/addons/l10n_de/models/res_company.py
+++ b/addons/l10n_de/models/res_company.py
@@ -8,7 +8,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_de_stnr = fields.Char(
string="St.-Nr.",
diff --git a/addons/l10n_de/models/template_de_skr03.py b/addons/l10n_de/models/template_de_skr03.py
index 08b2e250ec38e..f61d3519a03bb 100644
--- a/addons/l10n_de/models/template_de_skr03.py
+++ b/addons/l10n_de/models/template_de_skr03.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('de_skr03')
def _get_de_skr03_template_data(self):
diff --git a/addons/l10n_de/models/template_de_skr04.py b/addons/l10n_de/models/template_de_skr04.py
index 39301bc484807..2bb075935f57e 100644
--- a/addons/l10n_de/models/template_de_skr04.py
+++ b/addons/l10n_de/models/template_de_skr04.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('de_skr04')
def _get_de_skr04_template_data(self):
diff --git a/addons/l10n_din5008/models/base_document_layout.py b/addons/l10n_din5008/models/base_document_layout.py
index f68ae1fd9b696..048f35f804474 100644
--- a/addons/l10n_din5008/models/base_document_layout.py
+++ b/addons/l10n_din5008/models/base_document_layout.py
@@ -6,7 +6,7 @@
class BaseDocumentLayout(models.TransientModel):
- _inherit = 'base.document.layout'
+ _inherit = ['base.document.layout']
@api.model
def _default_report_footer(self):
diff --git a/addons/l10n_din5008_repair/models/repair.py b/addons/l10n_din5008_repair/models/repair.py
index 52cdd444d2164..46586834daba4 100644
--- a/addons/l10n_din5008_repair/models/repair.py
+++ b/addons/l10n_din5008_repair/models/repair.py
@@ -2,6 +2,6 @@
class RepairOrder(models.Model):
- _inherit = 'repair.order'
+ _inherit = ['repair.order']
l10n_din5008_printing_date = fields.Date(default=fields.Date.today, store=False)
diff --git a/addons/l10n_dk/models/account_journal.py b/addons/l10n_dk/models/account_journal.py
index 02fac114574cb..1257e624efd25 100644
--- a/addons/l10n_dk/models/account_journal.py
+++ b/addons/l10n_dk/models/account_journal.py
@@ -5,7 +5,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
@api.model
def _prepare_liquidity_account_vals(self, company, code, vals):
diff --git a/addons/l10n_dk/models/res_partner.py b/addons/l10n_dk/models/res_partner.py
index d63dd3640e61f..b2027af6e25b5 100644
--- a/addons/l10n_dk/models/res_partner.py
+++ b/addons/l10n_dk/models/res_partner.py
@@ -2,7 +2,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
@api.depends('vat', 'country_id')
def _compute_company_registry(self):
diff --git a/addons/l10n_dk/models/template_dk.py b/addons/l10n_dk/models/template_dk.py
index 2c0e9062c6e4d..14dd234e16680 100644
--- a/addons/l10n_dk/models/template_dk.py
+++ b/addons/l10n_dk/models/template_dk.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('dk')
def _get_dk_template_data(self):
diff --git a/addons/l10n_dk_oioubl/models/account_edi_xml_oioubl_201.py b/addons/l10n_dk_oioubl/models/account_edi_xml_oioubl_201.py
index f08e29c5d15be..a25577bf638e3 100644
--- a/addons/l10n_dk_oioubl/models/account_edi_xml_oioubl_201.py
+++ b/addons/l10n_dk_oioubl/models/account_edi_xml_oioubl_201.py
@@ -38,9 +38,8 @@ def format_vat_number(partner):
return vat
-class AccountEdiXmlOIOUBL201(models.AbstractModel):
- _name = "account.edi.xml.oioubl_201"
- _inherit = 'account.edi.xml.ubl_20'
+class AccountEdiXmlOioubl_201(models.AbstractModel):
+ _inherit = ['account.edi.xml.ubl_20']
_description = "OIOUBL 2.01"
# Data validation Schematron available at the following URL:
diff --git a/addons/l10n_dk_oioubl/models/account_move.py b/addons/l10n_dk_oioubl/models/account_move.py
index 3f6476a8914f4..26e5f8a07409b 100644
--- a/addons/l10n_dk_oioubl/models/account_move.py
+++ b/addons/l10n_dk_oioubl/models/account_move.py
@@ -2,7 +2,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
@api.model
def _get_ubl_cii_builder_from_xml_tree(self, tree):
diff --git a/addons/l10n_dk_oioubl/models/res_partner.py b/addons/l10n_dk_oioubl/models/res_partner.py
index 20bb64cdc03d8..d7812fcf7d424 100644
--- a/addons/l10n_dk_oioubl/models/res_partner.py
+++ b/addons/l10n_dk_oioubl/models/res_partner.py
@@ -2,7 +2,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('oioubl_201', "OIOUBL 2.01")])
diff --git a/addons/l10n_do/models/template_do.py b/addons/l10n_do/models/template_do.py
index 0c20366f4ac92..1316641cd28ae 100644
--- a/addons/l10n_do/models/template_do.py
+++ b/addons/l10n_do/models/template_do.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('do')
def _get_do_template_data(self):
diff --git a/addons/l10n_dz/models/template_dz.py b/addons/l10n_dz/models/template_dz.py
index 19c2fd24b5011..1ec64512063ad 100644
--- a/addons/l10n_dz/models/template_dz.py
+++ b/addons/l10n_dz/models/template_dz.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('dz')
def _get_dz_template_data(self):
diff --git a/addons/l10n_ec/demo/account_demo.py b/addons/l10n_ec/demo/account_demo.py
index 6e82c10c50bb8..0c7050066d71e 100644
--- a/addons/l10n_ec/demo/account_demo.py
+++ b/addons/l10n_ec/demo/account_demo.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@api.model
def _get_demo_data_move(self, company=False):
diff --git a/addons/l10n_ec/models/account_journal.py b/addons/l10n_ec/models/account_journal.py
index 4d42fa67685f3..ce97f2620ef8e 100644
--- a/addons/l10n_ec/models/account_journal.py
+++ b/addons/l10n_ec/models/account_journal.py
@@ -2,7 +2,7 @@
class AccountJournal(models.Model):
- _inherit = "account.journal"
+ _inherit = ["account.journal"]
l10n_ec_require_emission = fields.Boolean(
string='Require Emission',
diff --git a/addons/l10n_ec/models/account_move.py b/addons/l10n_ec/models/account_move.py
index 2e073fb67da0f..1c6e9f5e42544 100644
--- a/addons/l10n_ec/models/account_move.py
+++ b/addons/l10n_ec/models/account_move.py
@@ -128,7 +128,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
l10n_ec_sri_payment_id = fields.Many2one(
comodel_name="l10n_ec.sri.payment",
diff --git a/addons/l10n_ec/models/account_tax.py b/addons/l10n_ec/models/account_tax.py
index 1144e94917b24..8948f0c6b7c89 100644
--- a/addons/l10n_ec/models/account_tax.py
+++ b/addons/l10n_ec/models/account_tax.py
@@ -6,7 +6,7 @@
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
l10n_ec_code_base = fields.Char(
string="Code base",
diff --git a/addons/l10n_ec/models/account_tax_group.py b/addons/l10n_ec/models/account_tax_group.py
index c5ca236a00e68..f7eeae2ce7e08 100644
--- a/addons/l10n_ec/models/account_tax_group.py
+++ b/addons/l10n_ec/models/account_tax_group.py
@@ -25,7 +25,7 @@
class AccountTaxGroup(models.Model):
- _inherit = "account.tax.group"
+ _inherit = ["account.tax.group"]
l10n_ec_type = fields.Selection(
_TYPE_EC, string="Type Ecuadorian Tax", help="Ecuadorian taxes subtype"
diff --git a/addons/l10n_ec/models/l10n_ec_sri_payment.py b/addons/l10n_ec/models/l10n_ec_sri_payment.py
index f583de1a057ee..49d879ada5c99 100644
--- a/addons/l10n_ec/models/l10n_ec_sri_payment.py
+++ b/addons/l10n_ec/models/l10n_ec_sri_payment.py
@@ -4,9 +4,8 @@
from odoo import fields, models
-class SriPayment(models.Model):
+class L10n_EcSriPayment(models.Model):
- _name = "l10n_ec.sri.payment"
_description = "SRI Payment Method"
_order = "sequence, id"
diff --git a/addons/l10n_ec/models/l10n_latam_document_type.py b/addons/l10n_ec/models/l10n_latam_document_type.py
index ac4ced60a29a6..cdb1a9b8ead62 100644
--- a/addons/l10n_ec/models/l10n_latam_document_type.py
+++ b/addons/l10n_ec/models/l10n_latam_document_type.py
@@ -5,8 +5,8 @@
import re
-class L10nLatamDocumentType(models.Model):
- _inherit = "l10n_latam.document.type"
+class L10n_LatamDocumentType(models.Model):
+ _inherit = ["l10n_latam.document.type"]
internal_type = fields.Selection(
selection_add=[
diff --git a/addons/l10n_ec/models/res_company.py b/addons/l10n_ec/models/res_company.py
index 05dc2571dcf43..d46710286ca13 100644
--- a/addons/l10n_ec/models/res_company.py
+++ b/addons/l10n_ec/models/res_company.py
@@ -3,7 +3,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
def _localization_use_documents(self):
self.ensure_one()
diff --git a/addons/l10n_ec/models/res_partner.py b/addons/l10n_ec/models/res_partner.py
index 51d5e9f42e57d..5f5f31608281b 100644
--- a/addons/l10n_ec/models/res_partner.py
+++ b/addons/l10n_ec/models/res_partner.py
@@ -50,7 +50,7 @@ def get_ats_code_for_partner(cls, partner, move_type):
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
l10n_ec_vat_validation = fields.Char(
string="VAT Error message validation",
diff --git a/addons/l10n_ec/models/template_ec.py b/addons/l10n_ec/models/template_ec.py
index 82af26d7e7d9f..3ea5f3ed26ac8 100644
--- a/addons/l10n_ec/models/template_ec.py
+++ b/addons/l10n_ec/models/template_ec.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ec')
def _get_ec_template_data(self):
diff --git a/addons/l10n_ec_sale/models/sale_order.py b/addons/l10n_ec_sale/models/sale_order.py
index 4028e16699eab..efed4f8251339 100644
--- a/addons/l10n_ec_sale/models/sale_order.py
+++ b/addons/l10n_ec_sale/models/sale_order.py
@@ -2,7 +2,7 @@
class SaleOrder(models.Model):
- _inherit = "sale.order"
+ _inherit = ["sale.order"]
l10n_ec_sri_payment_id = fields.Many2one(
comodel_name="l10n_ec.sri.payment",
diff --git a/addons/l10n_ec_website_sale/models/payment_method.py b/addons/l10n_ec_website_sale/models/payment_method.py
index 40e0f6ae764e9..1772bf99229a6 100644
--- a/addons/l10n_ec_website_sale/models/payment_method.py
+++ b/addons/l10n_ec_website_sale/models/payment_method.py
@@ -2,8 +2,9 @@
from odoo import fields, models
+
class PaymentMethod(models.Model):
- _inherit = 'payment.method'
+ _inherit = ['payment.method']
def _get_fiscal_country_codes(self):
return ','.join(self.env.companies.mapped('account_fiscal_country_id.code'))
diff --git a/addons/l10n_ec_website_sale/models/sale_order.py b/addons/l10n_ec_website_sale/models/sale_order.py
index 4b4da445bed83..180ab21296871 100644
--- a/addons/l10n_ec_website_sale/models/sale_order.py
+++ b/addons/l10n_ec_website_sale/models/sale_order.py
@@ -2,8 +2,9 @@
from odoo import models
+
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
def _create_invoices(self, grouped=False, final=False, date=None):
""" Create invoice(s) for the given Sales Order(s).
diff --git a/addons/l10n_ec_website_sale/models/website.py b/addons/l10n_ec_website_sale/models/website.py
index 825d026431487..774c4db4ae565 100644
--- a/addons/l10n_ec_website_sale/models/website.py
+++ b/addons/l10n_ec_website_sale/models/website.py
@@ -4,7 +4,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def _display_partner_b2b_fields(self):
"""Ecuadorian localization must always display b2b fields"""
diff --git a/addons/l10n_ee/models/account_tax.py b/addons/l10n_ee/models/account_tax.py
index 6343542d0e7b0..67e0ab8b69269 100644
--- a/addons/l10n_ee/models/account_tax.py
+++ b/addons/l10n_ee/models/account_tax.py
@@ -2,7 +2,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_ee_kmd_inf_code = fields.Selection(
selection=[
diff --git a/addons/l10n_ee/models/template_ee.py b/addons/l10n_ee/models/template_ee.py
index cbb21a863fff3..7fc825e6d16d3 100644
--- a/addons/l10n_ee/models/template_ee.py
+++ b/addons/l10n_ee/models/template_ee.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ee')
def _get_ee_template_data(self):
diff --git a/addons/l10n_eg/models/account_tax.py b/addons/l10n_eg/models/account_tax.py
index 025e053428716..e8c9c25dd91ab 100644
--- a/addons/l10n_eg/models/account_tax.py
+++ b/addons/l10n_eg/models/account_tax.py
@@ -2,7 +2,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
_description = 'ETA tax codes mixin'
l10n_eg_eta_code = fields.Selection(
diff --git a/addons/l10n_eg/models/template_eg.py b/addons/l10n_eg/models/template_eg.py
index 26b4e8e05ea7b..2654fe4058828 100644
--- a/addons/l10n_eg/models/template_eg.py
+++ b/addons/l10n_eg/models/template_eg.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('eg')
def _get_eg_template_data(self):
diff --git a/addons/l10n_eg_edi_eta/models/account_edi_format.py b/addons/l10n_eg_edi_eta/models/account_edi_format.py
index 4ab468b1510b7..f23fac9a80cd4 100644
--- a/addons/l10n_eg_edi_eta/models/account_edi_format.py
+++ b/addons/l10n_eg_edi_eta/models/account_edi_format.py
@@ -27,7 +27,7 @@
class AccountEdiFormat(models.Model):
- _inherit = 'account.edi.format'
+ _inherit = ['account.edi.format']
@api.model
def _l10n_eg_get_eta_qr_domain(self, production_enviroment=False):
diff --git a/addons/l10n_eg_edi_eta/models/account_journal.py b/addons/l10n_eg_edi_eta/models/account_journal.py
index 8174bb7726d2c..ddc46ac5dafef 100644
--- a/addons/l10n_eg_edi_eta/models/account_journal.py
+++ b/addons/l10n_eg_edi_eta/models/account_journal.py
@@ -6,7 +6,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
l10n_eg_branch_id = fields.Many2one('res.partner', string='Branch', copy=False,
help="Address of the subdivision of the company. You can just put the "
diff --git a/addons/l10n_eg_edi_eta/models/account_move.py b/addons/l10n_eg_edi_eta/models/account_move.py
index 42149fbdf221d..95bf009118a41 100644
--- a/addons/l10n_eg_edi_eta/models/account_move.py
+++ b/addons/l10n_eg_edi_eta/models/account_move.py
@@ -13,7 +13,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_eg_long_id = fields.Char(string='ETA Long ID', compute='_compute_eta_long_id')
l10n_eg_qr_code = fields.Char(string='ETA QR Code', compute='_compute_eta_qr_code_str')
diff --git a/addons/l10n_eg_edi_eta/models/eta_activity_type.py b/addons/l10n_eg_edi_eta/models/eta_activity_type.py
index 77cf5a9bd9c21..cd33107e26810 100644
--- a/addons/l10n_eg_edi_eta/models/eta_activity_type.py
+++ b/addons/l10n_eg_edi_eta/models/eta_activity_type.py
@@ -5,8 +5,7 @@
from odoo import fields, models
-class EtaActivityType(models.Model):
- _name = 'l10n_eg_edi.activity.type'
+class L10n_Eg_EdiActivityType(models.Model):
_description = 'ETA code for activity type'
_rec_name = 'name'
_rec_names_search = ['name', 'code']
diff --git a/addons/l10n_eg_edi_eta/models/eta_thumb_drive.py b/addons/l10n_eg_edi_eta/models/eta_thumb_drive.py
index 19db1e0d5ccd3..35339d2323ee8 100644
--- a/addons/l10n_eg_edi_eta/models/eta_thumb_drive.py
+++ b/addons/l10n_eg_edi_eta/models/eta_thumb_drive.py
@@ -12,8 +12,7 @@
from odoo.exceptions import ValidationError
-class EtaThumbDrive(models.Model):
- _name = 'l10n_eg_edi.thumb.drive'
+class L10n_Eg_EdiThumbDrive(models.Model):
_description = 'Thumb drive used to sign invoices in Egypt'
user_id = fields.Many2one('res.users', required=True, default=lambda self: self.env.user)
diff --git a/addons/l10n_eg_edi_eta/models/product_template.py b/addons/l10n_eg_edi_eta/models/product_template.py
index 0de9f98ad478b..25f7ac49ae88d 100644
--- a/addons/l10n_eg_edi_eta/models/product_template.py
+++ b/addons/l10n_eg_edi_eta/models/product_template.py
@@ -6,7 +6,7 @@
class ProductTemplate(models.Model):
- _inherit = "product.template"
+ _inherit = ["product.template"]
l10n_eg_eta_code = fields.Char('ETA Item code', compute='_compute_l10n_eg_eta_code',
inverse='_set_l10n_eg_eta_code',
@@ -40,7 +40,7 @@ def create(self, vals_list):
class ProductProduct(models.Model):
- _inherit = "product.product"
+ _inherit = ["product.product"]
l10n_eg_eta_code = fields.Char('ETA Code', copy=False,
help="This can be an EGS or GS1 product code, which is needed for the e-invoice. "
diff --git a/addons/l10n_eg_edi_eta/models/res_company.py b/addons/l10n_eg_edi_eta/models/res_company.py
index 74b75361a7ee3..a5f80e575030d 100644
--- a/addons/l10n_eg_edi_eta/models/res_company.py
+++ b/addons/l10n_eg_edi_eta/models/res_company.py
@@ -6,7 +6,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_eg_client_identifier = fields.Char('ETA Client ID', groups="base.group_erp_manager")
l10n_eg_client_secret = fields.Char('ETA Secret', groups="base.group_erp_manager")
diff --git a/addons/l10n_eg_edi_eta/models/res_config_settings.py b/addons/l10n_eg_edi_eta/models/res_config_settings.py
index b8a393c485ba1..e26a44bfb83b4 100644
--- a/addons/l10n_eg_edi_eta/models/res_config_settings.py
+++ b/addons/l10n_eg_edi_eta/models/res_config_settings.py
@@ -1,7 +1,8 @@
from odoo import models, fields
+
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_eg_client_identifier = fields.Char(related='company_id.l10n_eg_client_identifier', readonly=False)
l10n_eg_client_secret = fields.Char(related='company_id.l10n_eg_client_secret', readonly=False)
diff --git a/addons/l10n_eg_edi_eta/models/res_currency_rate.py b/addons/l10n_eg_edi_eta/models/res_currency_rate.py
index 9d4415ae7dff7..790b6ed75e2c6 100644
--- a/addons/l10n_eg_edi_eta/models/res_currency_rate.py
+++ b/addons/l10n_eg_edi_eta/models/res_currency_rate.py
@@ -7,7 +7,7 @@
class ResCurrencyRate(models.Model):
- _inherit = 'res.currency.rate'
+ _inherit = ['res.currency.rate']
@api.onchange('company_rate')
def _onchange_rate_warning(self):
diff --git a/addons/l10n_eg_edi_eta/models/res_partner.py b/addons/l10n_eg_edi_eta/models/res_partner.py
index 9a57dc76ab884..b9439ffe3ead6 100644
--- a/addons/l10n_eg_edi_eta/models/res_partner.py
+++ b/addons/l10n_eg_edi_eta/models/res_partner.py
@@ -6,7 +6,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_eg_building_no = fields.Char('Building No.')
diff --git a/addons/l10n_eg_edi_eta/models/uom_uom.py b/addons/l10n_eg_edi_eta/models/uom_uom.py
index efcb0cb8e874e..fec9fa7ccd6cc 100644
--- a/addons/l10n_eg_edi_eta/models/uom_uom.py
+++ b/addons/l10n_eg_edi_eta/models/uom_uom.py
@@ -4,8 +4,7 @@
from odoo import models, fields
-class UomCode(models.Model):
- _name = 'l10n_eg_edi.uom.code'
+class L10n_Eg_EdiUomCode(models.Model):
_description = 'ETA code for the unit of measures'
name = fields.Char(required=True, translate=True)
@@ -13,7 +12,7 @@ class UomCode(models.Model):
class UomUom(models.Model):
- _inherit = 'uom.uom'
+ _inherit = ['uom.uom']
l10n_eg_unit_code_id = fields.Many2one('l10n_eg_edi.uom.code', string='ETA Unit Code',
help='This is the type of unit according to egyptian tax authority')
diff --git a/addons/l10n_es/models/account_move.py b/addons/l10n_es/models/account_move.py
index 02d49832d16a6..cc77f4137b14c 100644
--- a/addons/l10n_es/models/account_move.py
+++ b/addons/l10n_es/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_es_is_simplified = fields.Boolean("Is Simplified",
compute="_compute_l10n_es_is_simplified", readonly=False, store=True)
diff --git a/addons/l10n_es/models/account_tax.py b/addons/l10n_es/models/account_tax.py
index ab12d1f457b59..10d08a51364f3 100644
--- a/addons/l10n_es/models/account_tax.py
+++ b/addons/l10n_es/models/account_tax.py
@@ -4,7 +4,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_es_exempt_reason = fields.Selection(
selection=[
diff --git a/addons/l10n_es/models/res_company.py b/addons/l10n_es/models/res_company.py
index fb6ca3af9d158..4b4270de1bb0a 100644
--- a/addons/l10n_es/models/res_company.py
+++ b/addons/l10n_es/models/res_company.py
@@ -2,7 +2,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_es_simplified_invoice_limit = fields.Float(
string="Simplified Invoice limit amount",
diff --git a/addons/l10n_es/models/res_config_settings.py b/addons/l10n_es/models/res_config_settings.py
index 4cedf18e1fea8..708d1c1daede8 100644
--- a/addons/l10n_es/models/res_config_settings.py
+++ b/addons/l10n_es/models/res_config_settings.py
@@ -2,7 +2,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_es_simplified_invoice_limit = fields.Float(
related='company_id.l10n_es_simplified_invoice_limit',
diff --git a/addons/l10n_es/models/res_partner.py b/addons/l10n_es/models/res_partner.py
index 5cde5430c4818..3737b2453a38b 100644
--- a/addons/l10n_es/models/res_partner.py
+++ b/addons/l10n_es/models/res_partner.py
@@ -2,7 +2,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
def _l10n_es_is_foreign(self):
self.ensure_one()
diff --git a/addons/l10n_es/models/template_es_assec.py b/addons/l10n_es/models/template_es_assec.py
index 0551cfc292342..6118389cc315a 100644
--- a/addons/l10n_es/models/template_es_assec.py
+++ b/addons/l10n_es/models/template_es_assec.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('es_assec')
def _get_es_assec_template_data(self):
diff --git a/addons/l10n_es/models/template_es_common.py b/addons/l10n_es/models/template_es_common.py
index ff8c259ae3b39..51489deb2fdd0 100644
--- a/addons/l10n_es/models/template_es_common.py
+++ b/addons/l10n_es/models/template_es_common.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('es_common')
def _get_es_common_template_data(self):
diff --git a/addons/l10n_es/models/template_es_coop_full.py b/addons/l10n_es/models/template_es_coop_full.py
index 6d440378fd2a9..9c2aee48c950d 100644
--- a/addons/l10n_es/models/template_es_coop_full.py
+++ b/addons/l10n_es/models/template_es_coop_full.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('es_coop_full')
def _get_es_coop_full_template_data(self):
diff --git a/addons/l10n_es/models/template_es_coop_pymes.py b/addons/l10n_es/models/template_es_coop_pymes.py
index 9708fa1d2e888..0d0136c6ae504 100644
--- a/addons/l10n_es/models/template_es_coop_pymes.py
+++ b/addons/l10n_es/models/template_es_coop_pymes.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('es_coop_pymes')
def _get_es_coop_pymes_template_data(self):
diff --git a/addons/l10n_es/models/template_es_full.py b/addons/l10n_es/models/template_es_full.py
index 4070abf90b981..0e51e287ca825 100644
--- a/addons/l10n_es/models/template_es_full.py
+++ b/addons/l10n_es/models/template_es_full.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('es_full')
def _get_es_full_template_data(self):
diff --git a/addons/l10n_es/models/template_es_pymes.py b/addons/l10n_es/models/template_es_pymes.py
index f25091f26d430..67df77b9e6362 100644
--- a/addons/l10n_es/models/template_es_pymes.py
+++ b/addons/l10n_es/models/template_es_pymes.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('es_pymes')
def _get_es_pymes_template_data(self):
diff --git a/addons/l10n_es_edi_facturae/models/account_move.py b/addons/l10n_es_edi_facturae/models/account_move.py
index 444fcef9bc257..08b04d03845b7 100644
--- a/addons/l10n_es_edi_facturae/models/account_move.py
+++ b/addons/l10n_es_edi_facturae/models/account_move.py
@@ -50,8 +50,9 @@
}
REVERSED_COUNTRY_CODE = {v: k for k, v in COUNTRY_CODE_MAP.items()}
+
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_es_edi_facturae_xml_id = fields.Many2one(
comodel_name='ir.attachment',
diff --git a/addons/l10n_es_edi_facturae/models/account_move_send.py b/addons/l10n_es_edi_facturae/models/account_move_send.py
index 3fc3c114f2f30..2a3754f560d9b 100644
--- a/addons/l10n_es_edi_facturae/models/account_move_send.py
+++ b/addons/l10n_es_edi_facturae/models/account_move_send.py
@@ -7,7 +7,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
# -------------------------------------------------------------------------
# ATTACHMENTS
diff --git a/addons/l10n_es_edi_facturae/models/account_tax.py b/addons/l10n_es_edi_facturae/models/account_tax.py
index 02e35841f0b4d..d1e2e5bd60a6f 100644
--- a/addons/l10n_es_edi_facturae/models/account_tax.py
+++ b/addons/l10n_es_edi_facturae/models/account_tax.py
@@ -2,7 +2,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_es_edi_facturae_tax_type = fields.Selection([
('01', 'Value-Added Tax'),
diff --git a/addons/l10n_es_edi_facturae/models/certificate.py b/addons/l10n_es_edi_facturae/models/certificate.py
index ad36a45c1dfc3..d8e909b3a84b4 100644
--- a/addons/l10n_es_edi_facturae/models/certificate.py
+++ b/addons/l10n_es_edi_facturae/models/certificate.py
@@ -5,8 +5,8 @@
from odoo import fields, models
-class Certificate(models.Model):
- _inherit = 'certificate.certificate'
+class CertificateCertificate(models.Model):
+ _inherit = ['certificate.certificate']
scope = fields.Selection(
selection_add=[
diff --git a/addons/l10n_es_edi_facturae/models/res_company.py b/addons/l10n_es_edi_facturae/models/res_company.py
index 9434e97969b8c..1ce5059186a40 100644
--- a/addons/l10n_es_edi_facturae/models/res_company.py
+++ b/addons/l10n_es_edi_facturae/models/res_company.py
@@ -1,8 +1,8 @@
from odoo import fields, models
-class Company(models.Model):
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
l10n_es_edi_facturae_residence_type = fields.Char(string='Facturae EDI Residency Type Code', related='partner_id.l10n_es_edi_facturae_residence_type')
l10n_es_edi_facturae_certificate_ids = fields.One2many(string='Facturae EDI signing certificate',
diff --git a/addons/l10n_es_edi_facturae/models/res_partner.py b/addons/l10n_es_edi_facturae/models/res_partner.py
index 1e29f995e152b..9baacf03401b3 100644
--- a/addons/l10n_es_edi_facturae/models/res_partner.py
+++ b/addons/l10n_es_edi_facturae/models/res_partner.py
@@ -3,16 +3,15 @@
from odoo.tools import check_barcode_encoding
-class AcRoleType(models.Model):
- _name = 'l10n_es_edi_facturae.ac_role_type'
+class L10n_Es_Edi_FacturaeAc_Role_Type(models.Model):
_description = 'Administrative Center Role Type'
code = fields.Char(required=True)
name = fields.Char(required=True, translate=True)
-class Partner(models.Model):
- _inherit = 'res.partner'
+class ResPartner(models.Model):
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('es_facturae', 'Facturae')])
type = fields.Selection(selection_add=[('facturae_ac', 'FACe Center'), ('other',)])
diff --git a/addons/l10n_es_edi_facturae/models/uom_uom.py b/addons/l10n_es_edi_facturae/models/uom_uom.py
index 824f9fcf687cf..8be0f174c6ee6 100644
--- a/addons/l10n_es_edi_facturae/models/uom_uom.py
+++ b/addons/l10n_es_edi_facturae/models/uom_uom.py
@@ -1,8 +1,8 @@
from odoo import fields, models
-class UoM(models.Model):
- _inherit = 'uom.uom'
+class UomUom(models.Model):
+ _inherit = ['uom.uom']
l10n_es_edi_facturae_uom_code = fields.Selection(
selection=[
diff --git a/addons/l10n_es_edi_facturae/wizard/account_move_reversal.py b/addons/l10n_es_edi_facturae/wizard/account_move_reversal.py
index 71e7d1cf05e9d..004185c51d82b 100644
--- a/addons/l10n_es_edi_facturae/wizard/account_move_reversal.py
+++ b/addons/l10n_es_edi_facturae/wizard/account_move_reversal.py
@@ -2,7 +2,7 @@
class AccountMoveReversal(models.TransientModel):
- _inherit = 'account.move.reversal'
+ _inherit = ['account.move.reversal']
l10n_es_edi_facturae_reason_code = fields.Selection(
selection=lambda self: self.env['account.move']._fields['l10n_es_edi_facturae_reason_code']._description_selection(self.env),
diff --git a/addons/l10n_es_edi_sii/models/account_edi_format.py b/addons/l10n_es_edi_sii/models/account_edi_format.py
index d407aca55b7c0..65048dad48a43 100644
--- a/addons/l10n_es_edi_sii/models/account_edi_format.py
+++ b/addons/l10n_es_edi_sii/models/account_edi_format.py
@@ -60,7 +60,7 @@ def patched_load_cert_chain(l10n_es_odoo_certificate, keyfile=None, password=Non
class AccountEdiFormat(models.Model):
- _inherit = 'account.edi.format'
+ _inherit = ['account.edi.format']
# -------------------------------------------------------------------------
# ES EDI
diff --git a/addons/l10n_es_edi_sii/models/account_move.py b/addons/l10n_es_edi_sii/models/account_move.py
index 22f651635b509..71f6ab637d078 100644
--- a/addons/l10n_es_edi_sii/models/account_move.py
+++ b/addons/l10n_es_edi_sii/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_es_edi_is_required = fields.Boolean(
string="Is the Spanish EDI needed",
diff --git a/addons/l10n_es_edi_sii/models/account_move_send.py b/addons/l10n_es_edi_sii/models/account_move_send.py
index e2fd4669edaf6..f2235b3c12902 100644
--- a/addons/l10n_es_edi_sii/models/account_move_send.py
+++ b/addons/l10n_es_edi_sii/models/account_move_send.py
@@ -2,7 +2,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
def _get_mail_attachment_from_doc(self, doc):
if doc.name == 'jsondump.json' and doc.edi_format_id.code == 'es_sii':
diff --git a/addons/l10n_es_edi_sii/models/certificate.py b/addons/l10n_es_edi_sii/models/certificate.py
index 70af9ff9a4602..a47b62a2deb8e 100644
--- a/addons/l10n_es_edi_sii/models/certificate.py
+++ b/addons/l10n_es_edi_sii/models/certificate.py
@@ -1,8 +1,8 @@
from odoo import fields, models
-class Certificate(models.Model):
- _inherit = 'certificate.certificate'
+class CertificateCertificate(models.Model):
+ _inherit = ['certificate.certificate']
scope = fields.Selection(
selection_add=[
diff --git a/addons/l10n_es_edi_sii/models/res_company.py b/addons/l10n_es_edi_sii/models/res_company.py
index cd73b48c2d365..f1d98683873f2 100644
--- a/addons/l10n_es_edi_sii/models/res_company.py
+++ b/addons/l10n_es_edi_sii/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_es_sii_certificate_id = fields.Many2one(
string="Certificate (SII)",
diff --git a/addons/l10n_es_edi_sii/models/res_config_settings.py b/addons/l10n_es_edi_sii/models/res_config_settings.py
index c0365bac14c05..c88ad95a011b2 100644
--- a/addons/l10n_es_edi_sii/models/res_config_settings.py
+++ b/addons/l10n_es_edi_sii/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_es_sii_certificate_ids = fields.One2many(related='company_id.l10n_es_sii_certificate_ids', readonly=False)
l10n_es_sii_tax_agency = fields.Selection(related='company_id.l10n_es_sii_tax_agency', readonly=False)
diff --git a/addons/l10n_es_edi_tbai/models/account_move.py b/addons/l10n_es_edi_tbai/models/account_move.py
index 8f04e202d3c66..af689deb2a08f 100644
--- a/addons/l10n_es_edi_tbai/models/account_move.py
+++ b/addons/l10n_es_edi_tbai/models/account_move.py
@@ -19,7 +19,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_es_tbai_state = fields.Selection([
('to_send', 'To Send'),
diff --git a/addons/l10n_es_edi_tbai/models/account_move_line.py b/addons/l10n_es_edi_tbai/models/account_move_line.py
index 8399773195c37..78484162c7cd0 100644
--- a/addons/l10n_es_edi_tbai/models/account_move_line.py
+++ b/addons/l10n_es_edi_tbai/models/account_move_line.py
@@ -2,7 +2,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _l10n_es_tbai_is_ignored(self):
self.ensure_one()
diff --git a/addons/l10n_es_edi_tbai/models/account_move_send.py b/addons/l10n_es_edi_tbai/models/account_move_send.py
index fbffa87a42941..1444c5ae44c4b 100644
--- a/addons/l10n_es_edi_tbai/models/account_move_send.py
+++ b/addons/l10n_es_edi_tbai/models/account_move_send.py
@@ -2,7 +2,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
@api.model
def _is_tbai_applicable(self, move):
diff --git a/addons/l10n_es_edi_tbai/models/certificate.py b/addons/l10n_es_edi_tbai/models/certificate.py
index e1646f1e9cc69..b4a1449b8c569 100644
--- a/addons/l10n_es_edi_tbai/models/certificate.py
+++ b/addons/l10n_es_edi_tbai/models/certificate.py
@@ -5,8 +5,8 @@
from odoo import fields, models
-class Certificate(models.Model):
- _inherit = 'certificate.certificate'
+class CertificateCertificate(models.Model):
+ _inherit = ['certificate.certificate']
scope = fields.Selection(
selection_add=[
diff --git a/addons/l10n_es_edi_tbai/models/l10n_es_edi_tbai_document.py b/addons/l10n_es_edi_tbai/models/l10n_es_edi_tbai_document.py
index 1bffdf9e21342..ff386f355febc 100644
--- a/addons/l10n_es_edi_tbai/models/l10n_es_edi_tbai_document.py
+++ b/addons/l10n_es_edi_tbai/models/l10n_es_edi_tbai_document.py
@@ -44,8 +44,7 @@
]
-class L10nEsEdiTbaiDocument(models.Model):
- _name = 'l10n_es_edi_tbai.document'
+class L10n_Es_Edi_TbaiDocument(models.Model):
_description = 'TicketBAI Document'
name = fields.Char(
diff --git a/addons/l10n_es_edi_tbai/models/res_company.py b/addons/l10n_es_edi_tbai/models/res_company.py
index f914efbb40d11..9688ac57674d5 100644
--- a/addons/l10n_es_edi_tbai/models/res_company.py
+++ b/addons/l10n_es_edi_tbai/models/res_company.py
@@ -39,8 +39,9 @@
},
}
+
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_es_tbai_certificate_id = fields.Many2one(
string="Certificate (TicketBAI)",
diff --git a/addons/l10n_es_edi_tbai/models/res_config_settings.py b/addons/l10n_es_edi_tbai/models/res_config_settings.py
index 9bca632413f27..c166ed8b42030 100644
--- a/addons/l10n_es_edi_tbai/models/res_config_settings.py
+++ b/addons/l10n_es_edi_tbai/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_es_tbai_certificate_ids = fields.One2many(related='company_id.l10n_es_tbai_certificate_ids', readonly=False)
l10n_es_tbai_tax_agency = fields.Selection(related='company_id.l10n_es_tbai_tax_agency', readonly=False)
diff --git a/addons/l10n_es_edi_tbai/wizards/account_move_reversal.py b/addons/l10n_es_edi_tbai/wizards/account_move_reversal.py
index a65737722068a..5c8a7e8fee14b 100644
--- a/addons/l10n_es_edi_tbai/wizards/account_move_reversal.py
+++ b/addons/l10n_es_edi_tbai/wizards/account_move_reversal.py
@@ -6,7 +6,7 @@
class AccountMoveReversal(models.TransientModel):
- _inherit = 'account.move.reversal'
+ _inherit = ['account.move.reversal']
l10n_es_tbai_is_required = fields.Boolean(
compute="_compute_l10n_es_tbai_is_required", readonly=True,
diff --git a/addons/l10n_es_edi_tbai_pos/models/pos_order.py b/addons/l10n_es_edi_tbai_pos/models/pos_order.py
index c08839a01f121..7f815ca1a79f0 100644
--- a/addons/l10n_es_edi_tbai_pos/models/pos_order.py
+++ b/addons/l10n_es_edi_tbai_pos/models/pos_order.py
@@ -4,7 +4,7 @@
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
l10n_es_tbai_state = fields.Selection([
('to_send', 'To Send'),
diff --git a/addons/l10n_es_edi_tbai_pos/models/pos_session.py b/addons/l10n_es_edi_tbai_pos/models/pos_session.py
index 8ad1dd0f6cadf..713baaaf1963c 100644
--- a/addons/l10n_es_edi_tbai_pos/models/pos_session.py
+++ b/addons/l10n_es_edi_tbai_pos/models/pos_session.py
@@ -2,7 +2,7 @@
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
def _load_pos_data(self, models_to_load):
data = super()._load_pos_data(models_to_load)
diff --git a/addons/l10n_es_edi_tbai_pos/models/res_company.py b/addons/l10n_es_edi_tbai_pos/models/res_company.py
index 92c76ac81b79a..84918f757122c 100644
--- a/addons/l10n_es_edi_tbai_pos/models/res_company.py
+++ b/addons/l10n_es_edi_tbai_pos/models/res_company.py
@@ -2,7 +2,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/l10n_es_pos/models/account_move.py b/addons/l10n_es_pos/models/account_move.py
index 62c502ee8bd53..2d84da3c0b8e8 100644
--- a/addons/l10n_es_pos/models/account_move.py
+++ b/addons/l10n_es_pos/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _compute_l10n_es_is_simplified(self):
super()._compute_l10n_es_is_simplified()
diff --git a/addons/l10n_es_pos/models/pos_config.py b/addons/l10n_es_pos/models/pos_config.py
index 9cff05502c24e..befbb776242c8 100644
--- a/addons/l10n_es_pos/models/pos_config.py
+++ b/addons/l10n_es_pos/models/pos_config.py
@@ -2,7 +2,7 @@
class PosConfig(models.Model):
- _inherit = "pos.config"
+ _inherit = ["pos.config"]
is_spanish = fields.Boolean(string="Company located in Spain", compute="_compute_is_spanish")
l10n_es_simplified_invoice_journal_id = fields.Many2one(
diff --git a/addons/l10n_es_pos/models/pos_order.py b/addons/l10n_es_pos/models/pos_order.py
index d10fff87b9f83..c579f094bc7c8 100644
--- a/addons/l10n_es_pos/models/pos_order.py
+++ b/addons/l10n_es_pos/models/pos_order.py
@@ -1,7 +1,8 @@
from odoo import api, fields, models
+
class PosOrder(models.Model):
- _inherit = "pos.order"
+ _inherit = ["pos.order"]
is_l10n_es_simplified_invoice = fields.Boolean("Simplified invoice")
l10n_es_simplified_invoice_number = fields.Char("Simplified invoice number", compute="_compute_l10n_es_simplified_invoice_number")
diff --git a/addons/l10n_es_pos/models/res_company.py b/addons/l10n_es_pos/models/res_company.py
index 0c27e899530e2..50df824db6c56 100644
--- a/addons/l10n_es_pos/models/res_company.py
+++ b/addons/l10n_es_pos/models/res_company.py
@@ -2,7 +2,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/l10n_es_pos/models/res_config_settings.py b/addons/l10n_es_pos/models/res_config_settings.py
index f1b0eb78a04c5..320a4e072c81d 100644
--- a/addons/l10n_es_pos/models/res_config_settings.py
+++ b/addons/l10n_es_pos/models/res_config_settings.py
@@ -2,7 +2,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = "res.config.settings"
+ _inherit = ["res.config.settings"]
pos_l10n_es_simplified_invoice_journal_id = fields.Many2one(
related="pos_config_id.l10n_es_simplified_invoice_journal_id",
diff --git a/addons/l10n_et/models/template_et.py b/addons/l10n_et/models/template_et.py
index 2411393522a31..d46bfd2b437bb 100644
--- a/addons/l10n_et/models/template_et.py
+++ b/addons/l10n_et/models/template_et.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('et')
def _get_et_template_data(self):
diff --git a/addons/l10n_eu_oss/models/res_company.py b/addons/l10n_eu_oss/models/res_company.py
index 58a06f79826ea..bb09a84303a0d 100644
--- a/addons/l10n_eu_oss/models/res_company.py
+++ b/addons/l10n_eu_oss/models/res_company.py
@@ -9,8 +9,8 @@
from .eu_tax_map import EU_TAX_MAP
-class Company(models.Model):
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
@api.model
def _map_all_eu_companies_taxes(self):
diff --git a/addons/l10n_eu_oss/models/res_config_settings.py b/addons/l10n_eu_oss/models/res_config_settings.py
index f7fe7092994b6..df2a2240e4856 100644
--- a/addons/l10n_eu_oss/models/res_config_settings.py
+++ b/addons/l10n_eu_oss/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_eu_oss_eu_country = fields.Boolean('Is European country?', compute='_compute_l10n_eu_oss_european_country')
diff --git a/addons/l10n_fi/models/account_journal.py b/addons/l10n_fi/models/account_journal.py
index aab269d803575..153f47b9ef53a 100644
--- a/addons/l10n_fi/models/account_journal.py
+++ b/addons/l10n_fi/models/account_journal.py
@@ -4,7 +4,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
invoice_reference_model = fields.Selection(selection_add=[
('fi', 'Finnish Standard Reference'),
diff --git a/addons/l10n_fi/models/account_move.py b/addons/l10n_fi/models/account_move.py
index cd34a73c67a46..0eeba5bd4d067 100644
--- a/addons/l10n_fi/models/account_move.py
+++ b/addons/l10n_fi/models/account_move.py
@@ -7,8 +7,8 @@
log = logging.getLogger(__name__)
-class AccountInvoiceFinnish(models.Model):
- _inherit = 'account.move'
+class AccountMove(models.Model):
+ _inherit = ['account.move']
@api.model
def number2numeric(self, number):
diff --git a/addons/l10n_fi/models/template_fi.py b/addons/l10n_fi/models/template_fi.py
index f57d66ad29d3a..4c82fac6db246 100644
--- a/addons/l10n_fi/models/template_fi.py
+++ b/addons/l10n_fi/models/template_fi.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('fi')
def _get_fi_template_data(self):
diff --git a/addons/l10n_fi_sale/models/sale.py b/addons/l10n_fi_sale/models/sale.py
index ff370b0e23e2a..5d040d449046c 100644
--- a/addons/l10n_fi_sale/models/sale.py
+++ b/addons/l10n_fi_sale/models/sale.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = "sale.order"
+ _inherit = ["sale.order"]
def write(self, values):
# We compute the l10n_fi/SaleOrder.reference from itself the same way
diff --git a/addons/l10n_fr/models/res_company.py b/addons/l10n_fr/models/res_company.py
index ce4a8396796fa..7d827c157c0f9 100644
--- a/addons/l10n_fr/models/res_company.py
+++ b/addons/l10n_fr/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_fr_closing_sequence_id = fields.Many2one('ir.sequence', 'Sequence to use to build sale closings', readonly=True)
siret = fields.Char(related='partner_id.siret', string='SIRET', size=14, readonly=False)
diff --git a/addons/l10n_fr/models/res_partner.py b/addons/l10n_fr/models/res_partner.py
index 069cc68cb2a83..4b5aeb014c391 100644
--- a/addons/l10n_fr/models/res_partner.py
+++ b/addons/l10n_fr/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
siret = fields.Char(string='SIRET', size=14)
diff --git a/addons/l10n_fr_account/models/account_move.py b/addons/l10n_fr_account/models/account_move.py
index a77a5b8cfad0c..b51f1fc78d89f 100644
--- a/addons/l10n_fr_account/models/account_move.py
+++ b/addons/l10n_fr_account/models/account_move.py
@@ -2,7 +2,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
l10n_fr_is_company_french = fields.Boolean(compute='_compute_l10n_fr_is_company_french')
diff --git a/addons/l10n_fr_account/models/res_company.py b/addons/l10n_fr_account/models/res_company.py
index 26c0d26beb08b..b219922555dd1 100644
--- a/addons/l10n_fr_account/models/res_company.py
+++ b/addons/l10n_fr_account/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_fr_rounding_difference_loss_account_id = fields.Many2one('account.account', check_company=True)
l10n_fr_rounding_difference_profit_account_id = fields.Many2one('account.account', check_company=True)
diff --git a/addons/l10n_fr_account/models/template_fr.py b/addons/l10n_fr_account/models/template_fr.py
index b00a7f02a4187..35582cf99218d 100644
--- a/addons/l10n_fr_account/models/template_fr.py
+++ b/addons/l10n_fr_account/models/template_fr.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('fr')
def _get_fr_template_data(self):
diff --git a/addons/l10n_fr_account/wizard/account_fr_fec_export_wizard.py b/addons/l10n_fr_account/wizard/account_fr_fec_export_wizard.py
index 6fc8319fb7b66..19e19c1c16326 100644
--- a/addons/l10n_fr_account/wizard/account_fr_fec_export_wizard.py
+++ b/addons/l10n_fr_account/wizard/account_fr_fec_export_wizard.py
@@ -8,8 +8,7 @@
from stdnum.fr import siren
-class FecExportWizard(models.TransientModel):
- _name = 'l10n_fr.fec.export.wizard'
+class L10n_FrFecExportWizard(models.TransientModel):
_description = 'Fichier Echange Informatise'
date_from = fields.Date(string='Start Date', required=True, default=lambda self: self._context.get('report_dates', {}).get('date_from'))
diff --git a/addons/l10n_fr_facturx_chorus_pro/models/account_edi_xml_ubl_bis3.py b/addons/l10n_fr_facturx_chorus_pro/models/account_edi_xml_ubl_bis3.py
index 6580f11c0677c..bd73b16365dc5 100644
--- a/addons/l10n_fr_facturx_chorus_pro/models/account_edi_xml_ubl_bis3.py
+++ b/addons/l10n_fr_facturx_chorus_pro/models/account_edi_xml_ubl_bis3.py
@@ -4,8 +4,8 @@
CHORUS_PRO_PEPPOL_ID = "0009:11000201100044"
-class AccountEdiXmlUBLBIS3(models.AbstractModel):
- _inherit = 'account.edi.xml.ubl_bis3'
+class AccountEdiXmlUbl_Bis3(models.AbstractModel):
+ _inherit = ['account.edi.xml.ubl_bis3']
""" See Pagero documentation: https://www.pagero.com/onboarding/aife/aife-en#requirements """
diff --git a/addons/l10n_fr_facturx_chorus_pro/models/account_move.py b/addons/l10n_fr_facturx_chorus_pro/models/account_move.py
index 9f50b5973a452..004a105cab46f 100644
--- a/addons/l10n_fr_facturx_chorus_pro/models/account_move.py
+++ b/addons/l10n_fr_facturx_chorus_pro/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
buyer_reference = fields.Char(help="'Service Exécutant' in Chorus PRO.")
contract_reference = fields.Char(help="'Numéro de Marché' in Chorus PRO.")
diff --git a/addons/l10n_fr_hr_holidays/models/hr_leave.py b/addons/l10n_fr_hr_holidays/models/hr_leave.py
index df9cd7758724f..a250aba07a32e 100644
--- a/addons/l10n_fr_hr_holidays/models/hr_leave.py
+++ b/addons/l10n_fr_hr_holidays/models/hr_leave.py
@@ -7,8 +7,9 @@
from odoo import fields, models, api, _
from odoo.exceptions import UserError
+
class HrLeave(models.Model):
- _inherit = 'hr.leave'
+ _inherit = ['hr.leave']
l10n_fr_date_to_changed = fields.Boolean(export_string_translation=False)
diff --git a/addons/l10n_fr_hr_holidays/models/res_company.py b/addons/l10n_fr_hr_holidays/models/res_company.py
index dfe6017d5a56a..ab91a8aeb1f17 100644
--- a/addons/l10n_fr_hr_holidays/models/res_company.py
+++ b/addons/l10n_fr_hr_holidays/models/res_company.py
@@ -6,7 +6,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_fr_reference_leave_type = fields.Many2one(
'hr.leave.type',
diff --git a/addons/l10n_fr_hr_holidays/models/res_config_settings.py b/addons/l10n_fr_hr_holidays/models/res_config_settings.py
index e7b36abbf6edf..797c4838436e0 100644
--- a/addons/l10n_fr_hr_holidays/models/res_config_settings.py
+++ b/addons/l10n_fr_hr_holidays/models/res_config_settings.py
@@ -3,8 +3,9 @@
from odoo import fields, models
+
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_fr_reference_leave_type = fields.Many2one(
'hr.leave.type',
diff --git a/addons/l10n_fr_hr_work_entry_holidays/models/hr_contract.py b/addons/l10n_fr_hr_work_entry_holidays/models/hr_contract.py
index b13bb5e793b0e..f8ae9e159d30a 100644
--- a/addons/l10n_fr_hr_work_entry_holidays/models/hr_contract.py
+++ b/addons/l10n_fr_hr_work_entry_holidays/models/hr_contract.py
@@ -9,7 +9,7 @@
class HrContract(models.Model):
- _inherit = 'hr.contract'
+ _inherit = ['hr.contract']
def _get_contract_work_entries_values(self, date_start, date_stop):
# Add the work entries difference for french payroll
diff --git a/addons/l10n_fr_hr_work_entry_holidays/models/hr_work_entry.py b/addons/l10n_fr_hr_work_entry_holidays/models/hr_work_entry.py
index 4e430596422a6..4202e8e591514 100644
--- a/addons/l10n_fr_hr_work_entry_holidays/models/hr_work_entry.py
+++ b/addons/l10n_fr_hr_work_entry_holidays/models/hr_work_entry.py
@@ -3,8 +3,9 @@
from odoo import models
+
class HrWorkEntry(models.Model):
- _inherit = 'hr.work.entry'
+ _inherit = ['hr.work.entry']
def _filter_french_part_time_entries(self):
french_part_time_work_entries = self.filtered(lambda w:
diff --git a/addons/l10n_fr_pos_cert/models/account_closing.py b/addons/l10n_fr_pos_cert/models/account_closing.py
index a08058fae90ae..af3ee466521fe 100644
--- a/addons/l10n_fr_pos_cert/models/account_closing.py
+++ b/addons/l10n_fr_pos_cert/models/account_closing.py
@@ -10,14 +10,13 @@
from odoo.osv.expression import AND
-class AccountClosing(models.Model):
+class AccountSaleClosing(models.Model):
"""
This object holds an interval total and a grand total of the accounts of type receivable for a company,
as well as the last account_move that has been counted in a previous object
It takes its earliest brother to infer from when the computation needs to be done
in order to compute its own data.
"""
- _name = 'account.sale.closing'
_order = 'date_closing_stop desc, sequence_number desc'
_description = "Sale Closing"
diff --git a/addons/l10n_fr_pos_cert/models/account_fiscal_position.py b/addons/l10n_fr_pos_cert/models/account_fiscal_position.py
index 17661e209c652..935e4452e50a7 100644
--- a/addons/l10n_fr_pos_cert/models/account_fiscal_position.py
+++ b/addons/l10n_fr_pos_cert/models/account_fiscal_position.py
@@ -5,7 +5,7 @@
class AccountFiscalPosition(models.Model):
- _inherit = "account.fiscal.position"
+ _inherit = ["account.fiscal.position"]
def write(self, vals):
if "tax_ids" in vals:
diff --git a/addons/l10n_fr_pos_cert/models/pos.py b/addons/l10n_fr_pos_cert/models/pos.py
index 8c863f927575b..7695a49091628 100644
--- a/addons/l10n_fr_pos_cert/models/pos.py
+++ b/addons/l10n_fr_pos_cert/models/pos.py
@@ -10,8 +10,8 @@
_logger = logging.getLogger(__name__)
-class pos_config(models.Model):
- _inherit = 'pos.config'
+class PosConfig(models.Model):
+ _inherit = ['pos.config']
def open_ui(self):
for config in self:
@@ -20,11 +20,11 @@ def open_ui(self):
if config.company_id._is_accounting_unalterable():
if config.current_session_id:
config.current_session_id._check_session_timing()
- return super(pos_config, self).open_ui()
+ return super().open_ui()
-class pos_session(models.Model):
- _inherit = 'pos.session'
+class PosSession(models.Model):
+ _inherit = ['pos.session']
def _check_session_timing(self):
self.ensure_one()
@@ -35,7 +35,7 @@ def open_frontend_cb(self):
sessions_to_check.filtered(lambda s: s.state == 'opening_control').start_at = fields.Datetime.now()
for session in sessions_to_check:
session._check_session_timing()
- return super(pos_session, self).open_frontend_cb()
+ return super().open_frontend_cb()
ORDER_FIELDS_BEFORE_17_4 = ['date_order', 'user_id', 'lines', 'payment_ids', 'pricelist_id', 'session_id', 'pos_reference', 'sale_journal', 'fiscal_position_id', 'partner_id']
@@ -43,8 +43,8 @@ def open_frontend_cb(self):
LINE_FIELDS = ['notice', 'product_id', 'qty', 'price_unit', 'discount', 'tax_ids', 'tax_ids_after_fiscal_position']
-class pos_order(models.Model):
- _inherit = 'pos.order'
+class PosOrder(models.Model):
+ _inherit = ['pos.order']
l10n_fr_hash = fields.Char(string="Inalteralbility Hash", readonly=True, copy=False)
l10n_fr_secure_sequence_number = fields.Integer(string="Inalteralbility No Gap Sequence #", readonly=True, copy=False)
@@ -138,14 +138,14 @@ def write(self, vals):
# restrict the operation in case we are trying to overwrite existing hash
if (order.l10n_fr_hash and 'l10n_fr_hash' in vals) or (order.l10n_fr_secure_sequence_number and 'l10n_fr_secure_sequence_number' in vals):
raise UserError(_('You cannot overwrite the values ensuring the inalterability of the point of sale.'))
- res = super(pos_order, self).write(vals)
+ res = super().write(vals)
# write the hash and the secure_sequence_number when posting or invoicing a pos order
if has_been_posted:
for order in self.filtered(lambda o: o.company_id._is_accounting_unalterable() and
not (o.l10n_fr_secure_sequence_number or o.l10n_fr_hash)):
new_number = order.company_id.l10n_fr_pos_cert_sequence_id.next_by_id()
- res |= super(pos_order, order).write({'l10n_fr_secure_sequence_number': new_number})
- res |= super(pos_order, order).write({'l10n_fr_hash': order._get_new_hash()})
+ res |= super(PosOrder, order).write({'l10n_fr_secure_sequence_number': new_number})
+ res |= super(PosOrder, order).write({'l10n_fr_hash': order._get_new_hash()})
return res
@api.ondelete(at_uninstall=True)
@@ -154,8 +154,9 @@ def _unlink_except_pos_so(self):
if order.company_id._is_accounting_unalterable():
raise UserError(_("According to French law, you cannot delete a point of sale order."))
+
class PosOrderLine(models.Model):
- _inherit = "pos.order.line"
+ _inherit = ["pos.order.line"]
def write(self, vals):
# restrict the operation in case we are trying to write a forbidden field
diff --git a/addons/l10n_fr_pos_cert/models/res_company.py b/addons/l10n_fr_pos_cert/models/res_company.py
index a7ebaf781e928..a9edfdb83ac99 100644
--- a/addons/l10n_fr_pos_cert/models/res_company.py
+++ b/addons/l10n_fr_pos_cert/models/res_company.py
@@ -22,7 +22,7 @@ def ctx_tz(record, field):
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_fr_pos_cert_sequence_id = fields.Many2one('ir.sequence')
diff --git a/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py b/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py
index 348cbac473ae0..61c80255a3202 100644
--- a/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py
+++ b/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class ReportPosHashIntegrity(models.AbstractModel):
- _name = 'report.l10n_fr_pos_cert.report_pos_hash_integrity'
+class ReportL10n_Fr_Pos_CertReport_Pos_Hash_Integrity(models.AbstractModel):
_description = 'Get french pos hash integrity result as PDF.'
@api.model
diff --git a/addons/l10n_ga/models/template_ga.py b/addons/l10n_ga/models/template_ga.py
index 0d04f1388f03b..1d5a97bed5025 100644
--- a/addons/l10n_ga/models/template_ga.py
+++ b/addons/l10n_ga/models/template_ga.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ga')
def _get_ga_template_data(self):
diff --git a/addons/l10n_ga/models/template_ga_syscebnl.py b/addons/l10n_ga/models/template_ga_syscebnl.py
index cd177187d9b78..a8376241062e2 100644
--- a/addons/l10n_ga/models/template_ga_syscebnl.py
+++ b/addons/l10n_ga/models/template_ga_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ga_syscebnl')
def _get_ga_syscebnl_template_data(self):
diff --git a/addons/l10n_gcc_invoice/models/account_move.py b/addons/l10n_gcc_invoice/models/account_move.py
index ef956914ae1a6..75d699e70cbc5 100644
--- a/addons/l10n_gcc_invoice/models/account_move.py
+++ b/addons/l10n_gcc_invoice/models/account_move.py
@@ -14,8 +14,9 @@
_logger.warning("The num2words python library is not installed, amount-to-text features won't be fully available.")
num2words = None
+
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
narration = fields.Html(translate=True)
@@ -65,8 +66,9 @@ def _compute_narration(self):
# Only update translations of real records
self.filtered('id')._load_narration_translation()
+
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
l10n_gcc_invoice_tax_amount = fields.Float(string='Tax Amount', compute='_compute_tax_amount', digits='Product Price')
l10n_gcc_line_name = fields.Char(compute='_compute_l10n_gcc_line_name')
diff --git a/addons/l10n_gcc_invoice/models/product.py b/addons/l10n_gcc_invoice/models/product.py
index 85da62f23d9c8..94a49ade1400a 100644
--- a/addons/l10n_gcc_invoice/models/product.py
+++ b/addons/l10n_gcc_invoice/models/product.py
@@ -6,7 +6,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def _compute_display_name(self):
""" In a string consisting of space-delimited substrings, force a double-space between
diff --git a/addons/l10n_gn/models/template_gn.py b/addons/l10n_gn/models/template_gn.py
index 014ec6b3204d5..2f97c4ba0dc48 100644
--- a/addons/l10n_gn/models/template_gn.py
+++ b/addons/l10n_gn/models/template_gn.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('gn')
def _get_gn_template_data(self):
diff --git a/addons/l10n_gn/models/template_gn_syscebnl.py b/addons/l10n_gn/models/template_gn_syscebnl.py
index 1371ff2e47c10..7f0c9c471464b 100644
--- a/addons/l10n_gn/models/template_gn_syscebnl.py
+++ b/addons/l10n_gn/models/template_gn_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('gn_syscebnl')
def _get_gn_syscebnl_template_data(self):
diff --git a/addons/l10n_gq/models/template_gq.py b/addons/l10n_gq/models/template_gq.py
index 5bbfd7b699048..493de4ec1e014 100644
--- a/addons/l10n_gq/models/template_gq.py
+++ b/addons/l10n_gq/models/template_gq.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('gq')
def _get_gq_template_data(self):
diff --git a/addons/l10n_gq/models/template_gq_syscebnl.py b/addons/l10n_gq/models/template_gq_syscebnl.py
index 857a9bb42e25f..412ff48a9726c 100644
--- a/addons/l10n_gq/models/template_gq_syscebnl.py
+++ b/addons/l10n_gq/models/template_gq_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('gq_syscebnl')
def _get_gq_syscebnl_template_data(self):
diff --git a/addons/l10n_gr/models/template_gr.py b/addons/l10n_gr/models/template_gr.py
index f3a197264dffe..5265c326cad6f 100644
--- a/addons/l10n_gr/models/template_gr.py
+++ b/addons/l10n_gr/models/template_gr.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('gr')
def _get_gr_template_data(self):
diff --git a/addons/l10n_gt/models/template_gt.py b/addons/l10n_gt/models/template_gt.py
index e3eec73f0b8ff..4873c24de9671 100644
--- a/addons/l10n_gt/models/template_gt.py
+++ b/addons/l10n_gt/models/template_gt.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('gt')
def _get_gt_template_data(self):
diff --git a/addons/l10n_gw/models/template_gw.py b/addons/l10n_gw/models/template_gw.py
index 590167a96f121..88f9c661c5e98 100644
--- a/addons/l10n_gw/models/template_gw.py
+++ b/addons/l10n_gw/models/template_gw.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('gw')
def _get_gw_template_data(self):
diff --git a/addons/l10n_gw/models/template_gw_syscebnl.py b/addons/l10n_gw/models/template_gw_syscebnl.py
index f0041539fdb05..1f638bd09c4af 100644
--- a/addons/l10n_gw/models/template_gw_syscebnl.py
+++ b/addons/l10n_gw/models/template_gw_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('gw_syscebnl')
def _get_gw_syscebnl_template_data(self):
diff --git a/addons/l10n_hk/models/res_bank.py b/addons/l10n_hk/models/res_bank.py
index 34669c5d6cfdf..a8c8d3c800400 100644
--- a/addons/l10n_hk/models/res_bank.py
+++ b/addons/l10n_hk/models/res_bank.py
@@ -8,7 +8,7 @@
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
proxy_type = fields.Selection(selection_add=[('id', "FPS ID"), ('mobile', "Mobile Number"), ('email', "Email Address")],
ondelete={'id': 'set default', 'mobile': 'set default', 'email': 'set default'})
diff --git a/addons/l10n_hk/models/template_hk.py b/addons/l10n_hk/models/template_hk.py
index 4776564384d75..16ce6a32cd274 100644
--- a/addons/l10n_hk/models/template_hk.py
+++ b/addons/l10n_hk/models/template_hk.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('hk')
def _get_hk_template_data(self):
diff --git a/addons/l10n_hn/models/template_hn.py b/addons/l10n_hn/models/template_hn.py
index e96ad9c92241e..affefe6a0b03d 100644
--- a/addons/l10n_hn/models/template_hn.py
+++ b/addons/l10n_hn/models/template_hn.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('hn')
def _get_hn_template_data(self):
diff --git a/addons/l10n_hr/models/template_hr.py b/addons/l10n_hr/models/template_hr.py
index e0e855190c9d9..4fb9996a966be 100644
--- a/addons/l10n_hr/models/template_hr.py
+++ b/addons/l10n_hr/models/template_hr.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('hr')
def _get_hr_template_data(self):
diff --git a/addons/l10n_hr_kuna/models/template_hr_kuna.py b/addons/l10n_hr_kuna/models/template_hr_kuna.py
index 66367531b2d7e..8233857f34e2c 100644
--- a/addons/l10n_hr_kuna/models/template_hr_kuna.py
+++ b/addons/l10n_hr_kuna/models/template_hr_kuna.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('hr_kuna')
def _get_hr_kuna_template_data(self):
diff --git a/addons/l10n_hu/models/account_move.py b/addons/l10n_hu/models/account_move.py
index b7e7e5e17aa43..8c38a17f88d9e 100644
--- a/addons/l10n_hu/models/account_move.py
+++ b/addons/l10n_hu/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
@api.depends('country_code', 'move_type')
def _compute_show_delivery_date(self):
diff --git a/addons/l10n_hu/models/template_hu.py b/addons/l10n_hu/models/template_hu.py
index 93caf7e88cb60..da2671d447788 100644
--- a/addons/l10n_hu/models/template_hu.py
+++ b/addons/l10n_hu/models/template_hu.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('hu')
def _get_hu_template_data(self):
diff --git a/addons/l10n_hu_edi/models/account_move.py b/addons/l10n_hu_edi/models/account_move.py
index f9e860c69faaa..e41ab34144612 100644
--- a/addons/l10n_hu_edi/models/account_move.py
+++ b/addons/l10n_hu_edi/models/account_move.py
@@ -20,7 +20,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_hu_payment_mode = fields.Selection(
[
@@ -1030,8 +1030,8 @@ def invert_dict(dictionary, keys_to_invert):
return tax_totals
-class AccountInvoiceLine(models.Model):
- _inherit = 'account.move.line'
+class AccountMoveLine(models.Model):
+ _inherit = ['account.move.line']
@api.depends('move_id.delivery_date')
def _compute_currency_rate(self):
diff --git a/addons/l10n_hu_edi/models/account_move_send.py b/addons/l10n_hu_edi/models/account_move_send.py
index eceeebec2bea0..11333cb1ae2d4 100644
--- a/addons/l10n_hu_edi/models/account_move_send.py
+++ b/addons/l10n_hu_edi/models/account_move_send.py
@@ -6,7 +6,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
@api.model
def _is_hu_edi_applicable(self, move):
diff --git a/addons/l10n_hu_edi/models/account_tax.py b/addons/l10n_hu_edi/models/account_tax.py
index ef4600d2875f0..a979ff68c28f8 100644
--- a/addons/l10n_hu_edi/models/account_tax.py
+++ b/addons/l10n_hu_edi/models/account_tax.py
@@ -45,7 +45,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_hu_tax_type = fields.Selection(
_SELECTION_TAX_TYPE,
diff --git a/addons/l10n_hu_edi/models/product.py b/addons/l10n_hu_edi/models/product.py
index ad92be64a7f94..dacb05c972dbd 100644
--- a/addons/l10n_hu_edi/models/product.py
+++ b/addons/l10n_hu_edi/models/product.py
@@ -4,7 +4,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
l10n_hu_product_code_type = fields.Selection(
selection=[
diff --git a/addons/l10n_hu_edi/models/res_company.py b/addons/l10n_hu_edi/models/res_company.py
index ed4a27ef6ac8e..e6daf99842c24 100644
--- a/addons/l10n_hu_edi/models/res_company.py
+++ b/addons/l10n_hu_edi/models/res_company.py
@@ -12,7 +12,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_hu_group_vat = fields.Char(
related='partner_id.l10n_hu_group_vat',
diff --git a/addons/l10n_hu_edi/models/res_config_settings.py b/addons/l10n_hu_edi/models/res_config_settings.py
index 430b53bb91843..e62d6dbd86260 100644
--- a/addons/l10n_hu_edi/models/res_config_settings.py
+++ b/addons/l10n_hu_edi/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_hu_tax_regime = fields.Selection(
related='company_id.l10n_hu_tax_regime',
diff --git a/addons/l10n_hu_edi/models/res_partner.py b/addons/l10n_hu_edi/models/res_partner.py
index 21f258d01cd4b..3e70426492742 100644
--- a/addons/l10n_hu_edi/models/res_partner.py
+++ b/addons/l10n_hu_edi/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_hu_group_vat = fields.Char(
string='Group Tax ID',
diff --git a/addons/l10n_hu_edi/models/template_hu.py b/addons/l10n_hu_edi/models/template_hu.py
index 12d00a8af5265..695755286e137 100644
--- a/addons/l10n_hu_edi/models/template_hu.py
+++ b/addons/l10n_hu_edi/models/template_hu.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
def _load(self, template_code, company, install_demo):
res = super()._load(template_code, company, install_demo)
diff --git a/addons/l10n_hu_edi/models/uom_uom.py b/addons/l10n_hu_edi/models/uom_uom.py
index 5c1e82e7d4b64..3a75f64395c7d 100644
--- a/addons/l10n_hu_edi/models/uom_uom.py
+++ b/addons/l10n_hu_edi/models/uom_uom.py
@@ -3,8 +3,8 @@
from odoo import fields, models
-class ProductUoM(models.Model):
- _inherit = 'uom.uom'
+class UomUom(models.Model):
+ _inherit = ['uom.uom']
l10n_hu_edi_code = fields.Selection(
selection=[
diff --git a/addons/l10n_hu_edi/wizard/account_move_reversal.py b/addons/l10n_hu_edi/wizard/account_move_reversal.py
index e30de5fa9d308..ddf33c4f0c3d7 100644
--- a/addons/l10n_hu_edi/wizard/account_move_reversal.py
+++ b/addons/l10n_hu_edi/wizard/account_move_reversal.py
@@ -2,7 +2,7 @@
class AccountMoveReversal(models.TransientModel):
- _inherit = 'account.move.reversal'
+ _inherit = ['account.move.reversal']
def reverse_moves(self, is_modify=False):
action = super().reverse_moves(is_modify=is_modify)
diff --git a/addons/l10n_hu_edi/wizard/l10n_hu_edi_cancellation.py b/addons/l10n_hu_edi/wizard/l10n_hu_edi_cancellation.py
index 9d1b9e0eabd33..63badb005d124 100644
--- a/addons/l10n_hu_edi/wizard/l10n_hu_edi_cancellation.py
+++ b/addons/l10n_hu_edi/wizard/l10n_hu_edi_cancellation.py
@@ -7,8 +7,7 @@
from odoo.addons.l10n_hu_edi.models.l10n_hu_edi_connection import L10nHuEdiConnection
-class L10nHuEdiCancellation(models.TransientModel):
- _name = 'l10n_hu_edi.cancellation'
+class L10n_Hu_EdiCancellation(models.TransientModel):
_description = 'Technical Annulment Wizard'
invoice_id = fields.Many2one(
diff --git a/addons/l10n_hu_edi/wizard/l10n_hu_edi_tax_audit_export.py b/addons/l10n_hu_edi/wizard/l10n_hu_edi_tax_audit_export.py
index 364802b61eb6e..c29bcac80de9e 100644
--- a/addons/l10n_hu_edi/wizard/l10n_hu_edi_tax_audit_export.py
+++ b/addons/l10n_hu_edi/wizard/l10n_hu_edi_tax_audit_export.py
@@ -9,8 +9,7 @@
from odoo.exceptions import UserError
-class L10nHuEdiTaxAuditExport(models.TransientModel):
- _name = 'l10n_hu_edi.tax_audit_export'
+class L10n_Hu_EdiTax_Audit_Export(models.TransientModel):
_description = 'Tax audit export - Adóhatósági Ellenőrzési Adatszolgáltatás'
selection_mode = fields.Selection(
diff --git a/addons/l10n_id/models/account_move.py b/addons/l10n_id/models/account_move.py
index 8d2c4aabe6348..8216fa34ba906 100644
--- a/addons/l10n_id/models/account_move.py
+++ b/addons/l10n_id/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_id_qris_transaction_ids = fields.Many2many('l10n_id.qris.transaction')
diff --git a/addons/l10n_id/models/qris_transaction.py b/addons/l10n_id/models/qris_transaction.py
index 190fb94ab8873..bb809d09df0d7 100644
--- a/addons/l10n_id/models/qris_transaction.py
+++ b/addons/l10n_id/models/qris_transaction.py
@@ -4,12 +4,11 @@
from odoo.exceptions import ValidationError
-class QRISTransaction(models.Model):
+class L10n_IdQrisTransaction(models.Model):
"""QRIS Transaction
General table to store a certian unique transaction with QRIS details attached
"""
- _name = "l10n_id.qris.transaction"
_description = "Record of QRIS transactions"
model = fields.Char(string="Model") # payment in respond to which model
diff --git a/addons/l10n_id/models/res_bank.py b/addons/l10n_id/models/res_bank.py
index 83f9bcabb6eb2..688821a8d54ee 100644
--- a/addons/l10n_id/models/res_bank.py
+++ b/addons/l10n_id/models/res_bank.py
@@ -25,8 +25,8 @@ def _l10n_id_make_qris_request(endpoint, params):
return response
-class ResBank(models.Model):
- _inherit = "res.partner.bank"
+class ResPartnerBank(models.Model):
+ _inherit = ["res.partner.bank"]
l10n_id_qris_api_key = fields.Char("QRIS API Key", groups="base.group_system")
l10n_id_qris_mid = fields.Char("QRIS Merchant ID", groups="base.group_system")
diff --git a/addons/l10n_id/models/template_id.py b/addons/l10n_id/models/template_id.py
index 4a2f198d82ba2..aa0681571254e 100644
--- a/addons/l10n_id/models/template_id.py
+++ b/addons/l10n_id/models/template_id.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('id')
def _get_id_template_data(self):
diff --git a/addons/l10n_id_efaktur/models/account_move.py b/addons/l10n_id_efaktur/models/account_move.py
index 0bf5c1431936a..bf1150b553e78 100644
--- a/addons/l10n_id_efaktur/models/account_move.py
+++ b/addons/l10n_id_efaktur/models/account_move.py
@@ -8,7 +8,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
l10n_id_tax_number = fields.Char(string="Tax Number", copy=False)
l10n_id_replace_invoice_id = fields.Many2one('account.move', string="Replace Invoice", domain="['|', '&', '&', ('state', '=', 'posted'), ('partner_id', '=', partner_id), ('reversal_move_ids', '!=', False), ('state', '=', 'cancel')]", copy=False, index='btree_not_null')
diff --git a/addons/l10n_id_efaktur/models/efaktur.py b/addons/l10n_id_efaktur/models/efaktur.py
index fef378654194e..036d07b177cbb 100644
--- a/addons/l10n_id_efaktur/models/efaktur.py
+++ b/addons/l10n_id_efaktur/models/efaktur.py
@@ -7,8 +7,7 @@
import re
-class Efaktur(models.Model):
- _name = "l10n_id_efaktur.efaktur.range"
+class L10n_Id_EfakturEfakturRange(models.Model):
_description = "Available E-faktur range"
_rec_names_search = ["min", "max"]
diff --git a/addons/l10n_id_efaktur/models/efaktur_document.py b/addons/l10n_id_efaktur/models/efaktur_document.py
index 103726727fb20..a2f8594c8ab4c 100644
--- a/addons/l10n_id_efaktur/models/efaktur_document.py
+++ b/addons/l10n_id_efaktur/models/efaktur_document.py
@@ -15,8 +15,7 @@ def _csv_row(data, delimiter=',', quote='"'):
return quote + (quote + delimiter + quote).join([str(x).replace(quote, '\\' + quote) for x in data]) + quote + '\n'
-class EfakturDocument(models.Model):
- _name = "l10n_id_efaktur.document"
+class L10n_Id_EfakturDocument(models.Model):
_description = "E-faktur Document"
_inherit = ["mail.thread", "mail.activity.mixin"]
diff --git a/addons/l10n_id_efaktur/models/res_partner.py b/addons/l10n_id_efaktur/models/res_partner.py
index 421668ca143cc..4a94b218ee016 100644
--- a/addons/l10n_id_efaktur/models/res_partner.py
+++ b/addons/l10n_id_efaktur/models/res_partner.py
@@ -6,7 +6,7 @@
class ResPartner(models.Model):
"""Inherit res.partner object to add NPWP field and Kode Transaksi"""
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
l10n_id_pkp = fields.Boolean(string="Is PKP", compute='_compute_l10n_id_pkp', store=True, readonly=False, help="Denoting whether the following partner is taxable")
l10n_id_nik = fields.Char(string='NIK')
diff --git a/addons/l10n_id_efaktur/wizard/account_move_reversal.py b/addons/l10n_id_efaktur/wizard/account_move_reversal.py
index ce3f7d553c013..78987e5c139e3 100644
--- a/addons/l10n_id_efaktur/wizard/account_move_reversal.py
+++ b/addons/l10n_id_efaktur/wizard/account_move_reversal.py
@@ -4,7 +4,7 @@
class AccountMoveReversal(models.TransientModel):
- _inherit = "account.move.reversal"
+ _inherit = ["account.move.reversal"]
def _modify_default_reverse_values(self, origin_move):
# EXTEND 'account'
diff --git a/addons/l10n_id_pos/models/pos_order.py b/addons/l10n_id_pos/models/pos_order.py
index 9ee39cda66261..18908b2ab334c 100644
--- a/addons/l10n_id_pos/models/pos_order.py
+++ b/addons/l10n_id_pos/models/pos_order.py
@@ -3,7 +3,7 @@
class PosOrder(models.Model):
- _inherit = "pos.order"
+ _inherit = ["pos.order"]
# referenced in l10n_id/models/res_bank.py where we will link QRIS transactions
# to the record that initiates the payment flow
diff --git a/addons/l10n_id_pos/models/pos_payment_method.py b/addons/l10n_id_pos/models/pos_payment_method.py
index 5b0e5f9a189a3..7c875ad787bf8 100644
--- a/addons/l10n_id_pos/models/pos_payment_method.py
+++ b/addons/l10n_id_pos/models/pos_payment_method.py
@@ -4,7 +4,7 @@
class PosPaymentMethod(models.Model):
- _inherit = "pos.payment.method"
+ _inherit = ["pos.payment.method"]
def l10n_id_verify_qris_status(self, trx_uuid):
""" Verify qris payment status from the provided transaction UUID
diff --git a/addons/l10n_id_pos/models/qris_transaction.py b/addons/l10n_id_pos/models/qris_transaction.py
index d9a1003b90f57..95d44289ca7cc 100644
--- a/addons/l10n_id_pos/models/qris_transaction.py
+++ b/addons/l10n_id_pos/models/qris_transaction.py
@@ -1,8 +1,8 @@
from odoo import models
-class QRISTransaction(models.Model):
- _inherit = "l10n_id.qris.transaction"
+class L10n_IdQrisTransaction(models.Model):
+ _inherit = ["l10n_id.qris.transaction"]
def _get_supported_models(self):
return super()._get_supported_models() + ['pos.order']
diff --git a/addons/l10n_ie/models/template_ie.py b/addons/l10n_ie/models/template_ie.py
index 80a6e7012d059..64790e6ce924c 100644
--- a/addons/l10n_ie/models/template_ie.py
+++ b/addons/l10n_ie/models/template_ie.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ie')
def _get_ie_template_data(self):
diff --git a/addons/l10n_il/models/template_il.py b/addons/l10n_il/models/template_il.py
index 406225a37c166..e6f351c4f36ab 100644
--- a/addons/l10n_il/models/template_il.py
+++ b/addons/l10n_il/models/template_il.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('il')
def _get_il_template_data(self):
diff --git a/addons/l10n_in/demo/account_demo.py b/addons/l10n_in/demo/account_demo.py
index 6d8bb9ec6d968..a558b3606ebee 100644
--- a/addons/l10n_in/demo/account_demo.py
+++ b/addons/l10n_in/demo/account_demo.py
@@ -12,7 +12,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@api.model
def _get_demo_data(self, company=False):
diff --git a/addons/l10n_in/models/account_invoice.py b/addons/l10n_in/models/account_invoice.py
index 8935eb8068bd0..235b767598046 100644
--- a/addons/l10n_in/models/account_invoice.py
+++ b/addons/l10n_in/models/account_invoice.py
@@ -9,7 +9,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
l10n_in_gst_treatment = fields.Selection([
('regular', 'Registered Business - Regular'),
diff --git a/addons/l10n_in/models/account_move_line.py b/addons/l10n_in/models/account_move_line.py
index 3c5feac90acb2..77e8b5add9f73 100644
--- a/addons/l10n_in/models/account_move_line.py
+++ b/addons/l10n_in/models/account_move_line.py
@@ -2,7 +2,7 @@
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
l10n_in_hsn_code = fields.Char(string="HSN/SAC Code", compute="_compute_l10n_in_hsn_code", store=True, readonly=False, copy=False)
diff --git a/addons/l10n_in/models/account_tax.py b/addons/l10n_in/models/account_tax.py
index bdafb13c4a7ce..2124eef6c5671 100644
--- a/addons/l10n_in/models/account_tax.py
+++ b/addons/l10n_in/models/account_tax.py
@@ -2,9 +2,8 @@
from odoo.tools import frozendict
-
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_in_reverse_charge = fields.Boolean("Reverse charge", help="Tick this if this tax is reverse charge. Only for Indian accounting")
l10n_in_tax_type = fields.Selection(
diff --git a/addons/l10n_in/models/company.py b/addons/l10n_in/models/company.py
index cd348c7bbe3f8..0510b46affb3a 100644
--- a/addons/l10n_in/models/company.py
+++ b/addons/l10n_in/models/company.py
@@ -3,8 +3,9 @@
from odoo.exceptions import ValidationError
from stdnum.in_ import pan, gstin
+
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_in_upi_id = fields.Char(string="UPI Id")
l10n_in_hsn_code_digit = fields.Selection(
diff --git a/addons/l10n_in/models/iap_account.py b/addons/l10n_in/models/iap_account.py
index 810e3fdb305f9..2adbe4c77ec30 100644
--- a/addons/l10n_in/models/iap_account.py
+++ b/addons/l10n_in/models/iap_account.py
@@ -9,7 +9,7 @@
class IapAccount(models.Model):
- _inherit = 'iap.account'
+ _inherit = ['iap.account']
@api.model
def _l10n_in_connect_to_server(self, is_production, params, url_path, config_parameter, timeout=25):
diff --git a/addons/l10n_in/models/port_code.py b/addons/l10n_in/models/port_code.py
index dfd54f34d1832..7f4383fd71bba 100644
--- a/addons/l10n_in/models/port_code.py
+++ b/addons/l10n_in/models/port_code.py
@@ -4,9 +4,8 @@
from odoo import fields, models
-class L10nInPortCode(models.Model):
+class L10n_InPortCode(models.Model):
"""Port code must be mentioned in export and import of goods under GST."""
- _name = 'l10n_in.port.code'
_description = "Indian port code"
_rec_name = 'code'
diff --git a/addons/l10n_in/models/product_template.py b/addons/l10n_in/models/product_template.py
index 9ff089eca8e80..93aabf4c7d3b2 100644
--- a/addons/l10n_in/models/product_template.py
+++ b/addons/l10n_in/models/product_template.py
@@ -6,7 +6,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
l10n_in_hsn_code = fields.Char(string="HSN/SAC Code", help="Harmonized System Nomenclature/Services Accounting Code")
l10n_in_hsn_warning = fields.Text(string="HSC/SAC warning", compute="_compute_l10n_in_hsn_warning")
diff --git a/addons/l10n_in/models/res_config_settings.py b/addons/l10n_in/models/res_config_settings.py
index 7d35936f2f7a9..90aec3009b21e 100644
--- a/addons/l10n_in/models/res_config_settings.py
+++ b/addons/l10n_in/models/res_config_settings.py
@@ -7,7 +7,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
group_l10n_in_reseller = fields.Boolean(implied_group='l10n_in.group_l10n_in_reseller', string="Manage Reseller(E-Commerce)")
l10n_in_edi_production_env = fields.Boolean(
diff --git a/addons/l10n_in/models/res_country_state.py b/addons/l10n_in/models/res_country_state.py
index 6cb495a73656b..d263e2a5796cd 100644
--- a/addons/l10n_in/models/res_country_state.py
+++ b/addons/l10n_in/models/res_country_state.py
@@ -4,7 +4,7 @@
from odoo import fields, models
-class CountryState(models.Model):
- _inherit = 'res.country.state'
+class ResCountryState(models.Model):
+ _inherit = ['res.country.state']
l10n_in_tin = fields.Char('TIN Number', size=2, help="TIN number-first two digits")
diff --git a/addons/l10n_in/models/res_partner.py b/addons/l10n_in/models/res_partner.py
index 7dc6203bae909..c332d58564253 100644
--- a/addons/l10n_in/models/res_partner.py
+++ b/addons/l10n_in/models/res_partner.py
@@ -5,8 +5,9 @@
TEST_GST_NUMBER = "36AABCT1332L011"
+
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_in_gst_treatment = fields.Selection([
('regular', 'Registered Business - Regular'),
diff --git a/addons/l10n_in/models/template_in.py b/addons/l10n_in/models/template_in.py
index 6bc6e784ccb16..f140c4fff9572 100644
--- a/addons/l10n_in/models/template_in.py
+++ b/addons/l10n_in/models/template_in.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('in')
def _get_in_template_data(self):
diff --git a/addons/l10n_in/models/uom_uom.py b/addons/l10n_in/models/uom_uom.py
index b9b3fcc5e30e2..b0abb4e786a1a 100644
--- a/addons/l10n_in/models/uom_uom.py
+++ b/addons/l10n_in/models/uom_uom.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class UoM(models.Model):
- _inherit = "uom.uom"
+class UomUom(models.Model):
+ _inherit = ["uom.uom"]
# As per GST Rules you need to Specify UQC given by GST.
l10n_in_code = fields.Char("Indian GST UQC", help="Unique Quantity Code (UQC) under GST")
diff --git a/addons/l10n_in_edi/models/account_edi_format.py b/addons/l10n_in_edi/models/account_edi_format.py
index 43cf4fa93ba7a..abf73d74526a4 100644
--- a/addons/l10n_in_edi/models/account_edi_format.py
+++ b/addons/l10n_in_edi/models/account_edi_format.py
@@ -19,7 +19,7 @@
class AccountEdiFormat(models.Model):
- _inherit = "account.edi.format"
+ _inherit = ["account.edi.format"]
def _is_enabled_by_default_on_journal(self, journal):
self.ensure_one()
diff --git a/addons/l10n_in_edi/models/account_move.py b/addons/l10n_in_edi/models/account_move.py
index 090811810527f..ddb9523089c07 100644
--- a/addons/l10n_in_edi/models/account_move.py
+++ b/addons/l10n_in_edi/models/account_move.py
@@ -8,7 +8,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
l10n_in_edi_cancel_reason = fields.Selection(selection=[
("1", "Duplicate"),
diff --git a/addons/l10n_in_edi/models/res_company.py b/addons/l10n_in_edi/models/res_company.py
index 2581fb09c2b22..fd043f2ddc678 100644
--- a/addons/l10n_in_edi/models/res_company.py
+++ b/addons/l10n_in_edi/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
l10n_in_edi_username = fields.Char("E-invoice (IN) Username", groups="base.group_system")
l10n_in_edi_password = fields.Char("E-invoice (IN) Password", groups="base.group_system")
diff --git a/addons/l10n_in_edi/models/res_config_settings.py b/addons/l10n_in_edi/models/res_config_settings.py
index 296d349ab0ad7..3c7706b6e505b 100644
--- a/addons/l10n_in_edi/models/res_config_settings.py
+++ b/addons/l10n_in_edi/models/res_config_settings.py
@@ -6,7 +6,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = "res.config.settings"
+ _inherit = ["res.config.settings"]
l10n_in_edi_username = fields.Char("Indian EDI username", related="company_id.l10n_in_edi_username", readonly=False)
l10n_in_edi_password = fields.Char("Indian EDI password", related="company_id.l10n_in_edi_password", readonly=False)
diff --git a/addons/l10n_in_edi_ewaybill/demo/account_demo.py b/addons/l10n_in_edi_ewaybill/demo/account_demo.py
index c2cf7a295d01c..fa6a9fb56fa69 100644
--- a/addons/l10n_in_edi_ewaybill/demo/account_demo.py
+++ b/addons/l10n_in_edi_ewaybill/demo/account_demo.py
@@ -5,8 +5,9 @@
_logger = logging.getLogger(__name__)
+
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
def _post_load_demo_data(self, company=False):
if company and company.account_fiscal_country_id.code == 'IN':
diff --git a/addons/l10n_in_edi_ewaybill/models/account_edi_format.py b/addons/l10n_in_edi_ewaybill/models/account_edi_format.py
index caec922b0844e..7f528ab58f88e 100755
--- a/addons/l10n_in_edi_ewaybill/models/account_edi_format.py
+++ b/addons/l10n_in_edi_ewaybill/models/account_edi_format.py
@@ -18,7 +18,7 @@
class AccountEdiFormat(models.Model):
- _inherit = "account.edi.format"
+ _inherit = ["account.edi.format"]
def _l10n_in_edi_ewaybill_base_irn_or_direct(self, move):
"""
diff --git a/addons/l10n_in_edi_ewaybill/models/account_move.py b/addons/l10n_in_edi_ewaybill/models/account_move.py
index 1ea466d2645c3..6a0b9ca43ad4c 100755
--- a/addons/l10n_in_edi_ewaybill/models/account_move.py
+++ b/addons/l10n_in_edi_ewaybill/models/account_move.py
@@ -7,7 +7,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
# Transaction Details
l10n_in_type_id = fields.Many2one("l10n.in.ewaybill.type", "E-waybill Document Type", tracking=True)
diff --git a/addons/l10n_in_edi_ewaybill/models/ewaybill_type.py b/addons/l10n_in_edi_ewaybill/models/ewaybill_type.py
index 145df15d4a98d..ef23ae9ffe396 100755
--- a/addons/l10n_in_edi_ewaybill/models/ewaybill_type.py
+++ b/addons/l10n_in_edi_ewaybill/models/ewaybill_type.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, _
-class EWayBillType(models.Model):
- _name = "l10n.in.ewaybill.type"
+class L10nInEwaybillType(models.Model):
_description = "E-Waybill Document Type"
name = fields.Char("Type")
diff --git a/addons/l10n_in_edi_ewaybill/models/res_company.py b/addons/l10n_in_edi_ewaybill/models/res_company.py
index 427c97a922239..edbd66971f34a 100755
--- a/addons/l10n_in_edi_ewaybill/models/res_company.py
+++ b/addons/l10n_in_edi_ewaybill/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
l10n_in_edi_ewaybill_username = fields.Char("E-Waybill (IN) Username", groups="base.group_system")
l10n_in_edi_ewaybill_password = fields.Char("E-Waybill (IN) Password", groups="base.group_system")
diff --git a/addons/l10n_in_edi_ewaybill/models/res_config_settings.py b/addons/l10n_in_edi_ewaybill/models/res_config_settings.py
index f84105b509144..c4cb4fe5307a4 100755
--- a/addons/l10n_in_edi_ewaybill/models/res_config_settings.py
+++ b/addons/l10n_in_edi_ewaybill/models/res_config_settings.py
@@ -7,7 +7,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = "res.config.settings"
+ _inherit = ["res.config.settings"]
l10n_in_edi_ewaybill_username = fields.Char("Indian EDI Stock username",
related="company_id.l10n_in_edi_ewaybill_username", readonly=False)
diff --git a/addons/l10n_in_ewaybill_stock/models/l10n_in_ewaybill.py b/addons/l10n_in_ewaybill_stock/models/l10n_in_ewaybill.py
index 459085575365b..ef3a530e91435 100644
--- a/addons/l10n_in_ewaybill_stock/models/l10n_in_ewaybill.py
+++ b/addons/l10n_in_ewaybill_stock/models/l10n_in_ewaybill.py
@@ -18,8 +18,7 @@
_logger = logging.getLogger(__name__)
-class Ewaybill(models.Model):
- _name = "l10n.in.ewaybill"
+class L10nInEwaybill(models.Model):
_description = "e-Waybill"
_inherit = ['portal.mixin', 'mail.thread', 'mail.activity.mixin']
_check_company_auto = True
@@ -300,7 +299,7 @@ def _check_partners(self):
@api.model
def _l10n_in_validate_partner(self, partner):
"""
- Validation method for Stock Ewaybill (different from the one in EDI Ewaybill)
+ Validation method for Stock L10nInEwaybill (different from the one in EDI L10nInEwaybill)
"""
message = []
if partner.country_id.code == "IN":
diff --git a/addons/l10n_in_ewaybill_stock/models/stock_move.py b/addons/l10n_in_ewaybill_stock/models/stock_move.py
index 349750470ec67..03dcbceb80c41 100644
--- a/addons/l10n_in_ewaybill_stock/models/stock_move.py
+++ b/addons/l10n_in_ewaybill_stock/models/stock_move.py
@@ -7,7 +7,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
_description = "Stock Move Ewaybill"
l10n_in_ewaybill_id = fields.One2many(related="picking_id.l10n_in_ewaybill_id")
diff --git a/addons/l10n_in_ewaybill_stock/models/stock_picking.py b/addons/l10n_in_ewaybill_stock/models/stock_picking.py
index 77bce7e716e23..044237e457a9a 100644
--- a/addons/l10n_in_ewaybill_stock/models/stock_picking.py
+++ b/addons/l10n_in_ewaybill_stock/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = "stock.picking"
+ _inherit = ["stock.picking"]
l10n_in_ewaybill_id = fields.One2many('l10n.in.ewaybill', 'picking_id', string='Ewaybill')
diff --git a/addons/l10n_in_ewaybill_stock/wizard/l10n_in_ewaybill_cancel.py b/addons/l10n_in_ewaybill_stock/wizard/l10n_in_ewaybill_cancel.py
index 3e102a944d14e..be307d9298eb4 100644
--- a/addons/l10n_in_ewaybill_stock/wizard/l10n_in_ewaybill_cancel.py
+++ b/addons/l10n_in_ewaybill_stock/wizard/l10n_in_ewaybill_cancel.py
@@ -2,9 +2,8 @@
from odoo import fields, models
-class EwaybillCancel(models.TransientModel):
+class L10nInEwaybillCancel(models.TransientModel):
- _name = 'l10n.in.ewaybill.cancel'
_description = 'Cancel Ewaybill'
l10n_in_ewaybill_id = fields.Many2one('l10n.in.ewaybill', string='Ewaybill', required=True)
diff --git a/addons/l10n_in_gstin_status/models/account_move.py b/addons/l10n_in_gstin_status/models/account_move.py
index 78b301b3fb5e1..29a4cf2fd2d25 100644
--- a/addons/l10n_in_gstin_status/models/account_move.py
+++ b/addons/l10n_in_gstin_status/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
l10n_in_partner_gstin_status = fields.Boolean(
string="GST Status",
diff --git a/addons/l10n_in_gstin_status/models/res_partner.py b/addons/l10n_in_gstin_status/models/res_partner.py
index 7207cc0a4df95..5229ae5d413b7 100644
--- a/addons/l10n_in_gstin_status/models/res_partner.py
+++ b/addons/l10n_in_gstin_status/models/res_partner.py
@@ -11,7 +11,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_in_gstin_verified_status = fields.Boolean(
string="GST Status",
diff --git a/addons/l10n_in_hr_holidays/models/hr_leave.py b/addons/l10n_in_hr_holidays/models/hr_leave.py
index e7c9a0849344f..c66097e0c4744 100644
--- a/addons/l10n_in_hr_holidays/models/hr_leave.py
+++ b/addons/l10n_in_hr_holidays/models/hr_leave.py
@@ -5,8 +5,8 @@
from odoo import models, fields
-class HolidaysRequest(models.Model):
- _inherit = "hr.leave"
+class HrLeave(models.Model):
+ _inherit = ["hr.leave"]
l10n_in_contains_sandwich_leaves = fields.Boolean()
diff --git a/addons/l10n_in_hr_holidays/models/hr_leave_type.py b/addons/l10n_in_hr_holidays/models/hr_leave_type.py
index d5d6aae176e5f..b5178c6420eff 100644
--- a/addons/l10n_in_hr_holidays/models/hr_leave_type.py
+++ b/addons/l10n_in_hr_holidays/models/hr_leave_type.py
@@ -3,8 +3,8 @@
from odoo import fields, models
-class HolidaysType(models.Model):
- _inherit = "hr.leave.type"
+class HrLeaveType(models.Model):
+ _inherit = ["hr.leave.type"]
l10n_in_is_sandwich_leave = fields.Boolean(
help="""If a leave is covering holidays, the holiday period will be included in the requested time.
diff --git a/addons/l10n_in_pos/models/account_move.py b/addons/l10n_in_pos/models/account_move.py
index a47e4a65f81ac..38c3656f82602 100644
--- a/addons/l10n_in_pos/models/account_move.py
+++ b/addons/l10n_in_pos/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
@api.depends('pos_session_ids')
def _compute_l10n_in_state_id(self):
diff --git a/addons/l10n_in_pos/models/account_tax.py b/addons/l10n_in_pos/models/account_tax.py
index fb8cb2ca38370..96e7d1e462b1b 100644
--- a/addons/l10n_in_pos/models/account_tax.py
+++ b/addons/l10n_in_pos/models/account_tax.py
@@ -2,7 +2,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/l10n_in_pos/models/pos_order.py b/addons/l10n_in_pos/models/pos_order.py
index b9daabc99d158..bc54650b6cc16 100644
--- a/addons/l10n_in_pos/models/pos_order.py
+++ b/addons/l10n_in_pos/models/pos_order.py
@@ -5,7 +5,7 @@
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
def _prepare_invoice_vals(self):
vals = super()._prepare_invoice_vals()
diff --git a/addons/l10n_in_pos/models/pos_order_line.py b/addons/l10n_in_pos/models/pos_order_line.py
index 55225817731ec..42b4a2e2d3dae 100644
--- a/addons/l10n_in_pos/models/pos_order_line.py
+++ b/addons/l10n_in_pos/models/pos_order_line.py
@@ -5,7 +5,7 @@
class PosOrderLine(models.Model):
- _inherit = "pos.order.line"
+ _inherit = ["pos.order.line"]
l10n_in_hsn_code = fields.Char(string="HSN/SAC Code", compute="_compute_l10n_in_hsn_code", store=True, readonly=False, copy=False)
diff --git a/addons/l10n_in_pos/models/product_product.py b/addons/l10n_in_pos/models/product_product.py
index 05c6092006231..37e5bdb709241 100644
--- a/addons/l10n_in_pos/models/product_product.py
+++ b/addons/l10n_in_pos/models/product_product.py
@@ -4,7 +4,7 @@
class ProductProduct(models.Model):
- _inherit = "product.product"
+ _inherit = ["product.product"]
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/l10n_in_purchase/models/account_move.py b/addons/l10n_in_purchase/models/account_move.py
index ed90ad0a89236..c5463fefff81c 100644
--- a/addons/l10n_in_purchase/models/account_move.py
+++ b/addons/l10n_in_purchase/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
@api.onchange('purchase_vendor_bill_id', 'purchase_id')
def _onchange_purchase_auto_complete(self):
diff --git a/addons/l10n_in_purchase/models/purchase_order.py b/addons/l10n_in_purchase/models/purchase_order.py
index f84c4e1c2cbe9..e783ddbc5f592 100644
--- a/addons/l10n_in_purchase/models/purchase_order.py
+++ b/addons/l10n_in_purchase/models/purchase_order.py
@@ -5,7 +5,7 @@
class PurchaseOrder(models.Model):
- _inherit = "purchase.order"
+ _inherit = ["purchase.order"]
l10n_in_gst_treatment = fields.Selection([
('regular', 'Registered Business - Regular'),
diff --git a/addons/l10n_in_purchase_stock/models/account_move.py b/addons/l10n_in_purchase_stock/models/account_move.py
index ea377c95af5d5..7b8c9a05fa386 100644
--- a/addons/l10n_in_purchase_stock/models/account_move.py
+++ b/addons/l10n_in_purchase_stock/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
def _l10n_in_get_warehouse_address(self):
res = super()._l10n_in_get_warehouse_address()
diff --git a/addons/l10n_in_purchase_stock/models/stock_move.py b/addons/l10n_in_purchase_stock/models/stock_move.py
index 5a4465e1473c4..340612a382145 100644
--- a/addons/l10n_in_purchase_stock/models/stock_move.py
+++ b/addons/l10n_in_purchase_stock/models/stock_move.py
@@ -4,7 +4,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
def _l10n_in_get_product_price_unit(self):
self.ensure_one()
diff --git a/addons/l10n_in_purchase_stock/models/stock_picking.py b/addons/l10n_in_purchase_stock/models/stock_picking.py
index fa15d7d8ee672..09427ca54fda0 100644
--- a/addons/l10n_in_purchase_stock/models/stock_picking.py
+++ b/addons/l10n_in_purchase_stock/models/stock_picking.py
@@ -4,7 +4,7 @@
class StockPicking(models.Model):
- _inherit = "stock.picking"
+ _inherit = ["stock.picking"]
def _get_l10n_in_dropship_dest_partner(self):
self.ensure_one()
diff --git a/addons/l10n_in_sale/models/sale_order.py b/addons/l10n_in_sale/models/sale_order.py
index 51cf937dc99c6..2aa90b203a7b6 100644
--- a/addons/l10n_in_sale/models/sale_order.py
+++ b/addons/l10n_in_sale/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = "sale.order"
+ _inherit = ["sale.order"]
l10n_in_reseller_partner_id = fields.Many2one('res.partner',
string='Reseller', domain="[('vat', '!=', False), '|', ('company_id', '=', False), ('company_id', '=', company_id)]", readonly=False)
diff --git a/addons/l10n_in_sale/wizard/sale_make_invoice_advance.py b/addons/l10n_in_sale/wizard/sale_make_invoice_advance.py
index de8fe74b1eec0..a1423160a3c12 100644
--- a/addons/l10n_in_sale/wizard/sale_make_invoice_advance.py
+++ b/addons/l10n_in_sale/wizard/sale_make_invoice_advance.py
@@ -5,7 +5,7 @@
class SaleAdvancePaymentInv(models.TransientModel):
- _inherit = "sale.advance.payment.inv"
+ _inherit = ["sale.advance.payment.inv"]
def _prepare_invoice_values(self, order, so_line, accounts):
res = super()._prepare_invoice_values(order, so_line, accounts)
diff --git a/addons/l10n_in_sale_stock/models/account_move.py b/addons/l10n_in_sale_stock/models/account_move.py
index af510725e713b..b4634c8bf89ff 100644
--- a/addons/l10n_in_sale_stock/models/account_move.py
+++ b/addons/l10n_in_sale_stock/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
def _l10n_in_get_warehouse_address(self):
res = super()._l10n_in_get_warehouse_address()
diff --git a/addons/l10n_in_sale_stock/models/stock_move.py b/addons/l10n_in_sale_stock/models/stock_move.py
index 52799086c1ffc..6973b73b8cccd 100644
--- a/addons/l10n_in_sale_stock/models/stock_move.py
+++ b/addons/l10n_in_sale_stock/models/stock_move.py
@@ -4,7 +4,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
def _l10n_in_get_product_price_unit(self):
self.ensure_one()
diff --git a/addons/l10n_in_sale_stock/models/stock_picking.py b/addons/l10n_in_sale_stock/models/stock_picking.py
index 6ec10f3a51c95..c21f9359d28fc 100644
--- a/addons/l10n_in_sale_stock/models/stock_picking.py
+++ b/addons/l10n_in_sale_stock/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
def _l10n_in_get_invoice_partner(self):
self.ensure_one()
diff --git a/addons/l10n_in_stock/models/stock_move.py b/addons/l10n_in_stock/models/stock_move.py
index e25ba3ea6d354..53f84a70ab701 100644
--- a/addons/l10n_in_stock/models/stock_move.py
+++ b/addons/l10n_in_stock/models/stock_move.py
@@ -4,7 +4,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
def _l10n_in_get_product_price_unit(self):
self.ensure_one()
diff --git a/addons/l10n_in_stock/models/stock_picking.py b/addons/l10n_in_stock/models/stock_picking.py
index fa740e5143c59..e960df94a04c4 100644
--- a/addons/l10n_in_stock/models/stock_picking.py
+++ b/addons/l10n_in_stock/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
def _should_generate_commercial_invoice(self):
super(StockPicking, self)._should_generate_commercial_invoice()
diff --git a/addons/l10n_in_withholding/models/account_account.py b/addons/l10n_in_withholding/models/account_account.py
index 395be139bd346..1ad6444fa6eef 100644
--- a/addons/l10n_in_withholding/models/account_account.py
+++ b/addons/l10n_in_withholding/models/account_account.py
@@ -2,6 +2,6 @@
class AccountAccount(models.Model):
- _inherit = 'account.account'
+ _inherit = ['account.account']
l10n_in_tds_tcs_section_id = fields.Many2one('l10n_in.section.alert', string="TCS/TDS Section")
diff --git a/addons/l10n_in_withholding/models/account_chart_template.py b/addons/l10n_in_withholding/models/account_chart_template.py
index 3c361ef09680e..194e11f260d73 100644
--- a/addons/l10n_in_withholding/models/account_chart_template.py
+++ b/addons/l10n_in_withholding/models/account_chart_template.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('in', 'account.account')
def _get_in_withholding_account_account(self):
diff --git a/addons/l10n_in_withholding/models/account_move.py b/addons/l10n_in_withholding/models/account_move.py
index 8ad90df9cc025..8ff4f6849007f 100644
--- a/addons/l10n_in_withholding/models/account_move.py
+++ b/addons/l10n_in_withholding/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
l10n_in_is_withholding = fields.Boolean(
string="Is Indian TDS Entry",
diff --git a/addons/l10n_in_withholding/models/account_move_line.py b/addons/l10n_in_withholding/models/account_move_line.py
index 07bc97f6980fe..939e1cc3d3f1f 100644
--- a/addons/l10n_in_withholding/models/account_move_line.py
+++ b/addons/l10n_in_withholding/models/account_move_line.py
@@ -2,7 +2,7 @@
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
l10n_in_withhold_tax_amount = fields.Monetary(string="TDS Tax Amount", compute='_compute_withhold_tax_amount')
diff --git a/addons/l10n_in_withholding/models/account_payment.py b/addons/l10n_in_withholding/models/account_payment.py
index 6ac1582f6865b..3e8c69f9e13eb 100644
--- a/addons/l10n_in_withholding/models/account_payment.py
+++ b/addons/l10n_in_withholding/models/account_payment.py
@@ -2,7 +2,7 @@
class AccountPayment(models.Model):
- _inherit = "account.payment"
+ _inherit = ["account.payment"]
l10n_in_total_withholding_amount = fields.Monetary(related='move_id.l10n_in_total_withholding_amount')
l10n_in_withhold_move_ids = fields.One2many(related='move_id.l10n_in_withhold_move_ids')
diff --git a/addons/l10n_in_withholding/models/account_tax.py b/addons/l10n_in_withholding/models/account_tax.py
index c29d157d71a57..9d46b0f9b51ec 100644
--- a/addons/l10n_in_withholding/models/account_tax.py
+++ b/addons/l10n_in_withholding/models/account_tax.py
@@ -2,7 +2,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_in_tds_tax_type = fields.Selection([
('sale', 'Sale'),
diff --git a/addons/l10n_in_withholding/models/l10n_in_section_alert.py b/addons/l10n_in_withholding/models/l10n_in_section_alert.py
index 96a1721c9aed7..7b25f11032491 100644
--- a/addons/l10n_in_withholding/models/l10n_in_section_alert.py
+++ b/addons/l10n_in_withholding/models/l10n_in_section_alert.py
@@ -1,8 +1,7 @@
from odoo import api, fields, models, _
-class L10nInSectionAlert(models.Model):
- _name = "l10n_in.section.alert"
+class L10n_InSectionAlert(models.Model):
_description = "indian section alert"
name = fields.Char("Section Name")
diff --git a/addons/l10n_in_withholding/models/res_company.py b/addons/l10n_in_withholding/models/res_company.py
index 74a5e672a666c..a4cfbcead949f 100644
--- a/addons/l10n_in_withholding/models/res_company.py
+++ b/addons/l10n_in_withholding/models/res_company.py
@@ -2,7 +2,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_in_withholding_account_id = fields.Many2one(
comodel_name='account.account',
diff --git a/addons/l10n_in_withholding/models/res_config_settings.py b/addons/l10n_in_withholding/models/res_config_settings.py
index 9242de67f3219..c256452aa25aa 100644
--- a/addons/l10n_in_withholding/models/res_config_settings.py
+++ b/addons/l10n_in_withholding/models/res_config_settings.py
@@ -2,7 +2,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_in_withholding_account_id = fields.Many2one(
related='company_id.l10n_in_withholding_account_id',
diff --git a/addons/l10n_in_withholding/wizard/l10n_in_withhold_wizard.py b/addons/l10n_in_withholding/wizard/l10n_in_withhold_wizard.py
index 49d2d0f60beaf..39761a21b66c5 100644
--- a/addons/l10n_in_withholding/wizard/l10n_in_withhold_wizard.py
+++ b/addons/l10n_in_withholding/wizard/l10n_in_withhold_wizard.py
@@ -5,8 +5,7 @@
from odoo.tools import float_compare
-class L10nInWithholdWizard(models.TransientModel):
- _name = 'l10n_in.withhold.wizard'
+class L10n_InWithholdWizard(models.TransientModel):
_description = "Withhold Wizard"
_check_company_auto = True
@@ -243,8 +242,7 @@ def _validate_withhold_data_on_post(self, withholding_account_id):
raise ValidationError(_("You must input at least one withhold line"))
-class L10nInWithholdWizardLine(models.TransientModel):
- _name = 'l10n_in.withhold.wizard.line'
+class L10n_InWithholdWizardLine(models.TransientModel):
_description = "Withhold Wizard Lines"
base = fields.Monetary(string="Base")
diff --git a/addons/l10n_in_withholding_payment/models/account_move.py b/addons/l10n_in_withholding_payment/models/account_move.py
index 7445cc7d052ec..e049c09cc7363 100644
--- a/addons/l10n_in_withholding_payment/models/account_move.py
+++ b/addons/l10n_in_withholding_payment/models/account_move.py
@@ -2,7 +2,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
l10n_in_withholding_ref_payment_id = fields.Many2one(
comodel_name='account.payment',
diff --git a/addons/l10n_in_withholding_payment/models/account_payment.py b/addons/l10n_in_withholding_payment/models/account_payment.py
index 36e71e8eb054a..de7228cf6d36a 100644
--- a/addons/l10n_in_withholding_payment/models/account_payment.py
+++ b/addons/l10n_in_withholding_payment/models/account_payment.py
@@ -2,7 +2,7 @@
class AccountPayment(models.Model):
- _inherit = "account.payment"
+ _inherit = ["account.payment"]
l10n_in_withhold_move_ids = fields.One2many(
'account.move', 'l10n_in_withholding_ref_payment_id',
diff --git a/addons/l10n_in_withholding_payment/wizard/l10n_in_withhold_wizard.py b/addons/l10n_in_withholding_payment/wizard/l10n_in_withhold_wizard.py
index b931d226ecfb7..a839b3baa64e3 100644
--- a/addons/l10n_in_withholding_payment/wizard/l10n_in_withhold_wizard.py
+++ b/addons/l10n_in_withholding_payment/wizard/l10n_in_withhold_wizard.py
@@ -1,8 +1,8 @@
from odoo import models
-class L10nInWithholdWizard(models.TransientModel):
- _inherit = 'l10n_in.withhold.wizard'
+class L10n_InWithholdWizard(models.TransientModel):
+ _inherit = ['l10n_in.withhold.wizard']
def _prepare_withhold_header(self):
res = super()._prepare_withhold_header()
diff --git a/addons/l10n_it/models/account_move.py b/addons/l10n_it/models/account_move.py
index 933851e981971..9503c77be463d 100644
--- a/addons/l10n_it/models/account_move.py
+++ b/addons/l10n_it/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _message_set_main_attachment_id(self, attachments, force=False, filter_xml=False):
if self.message_main_attachment_id.mimetype == "application/pkcs7-mime":
diff --git a/addons/l10n_it/models/account_report.py b/addons/l10n_it/models/account_report.py
index 3b2d89e7d96fa..ab6dea9ccfd2b 100644
--- a/addons/l10n_it/models/account_report.py
+++ b/addons/l10n_it/models/account_report.py
@@ -5,7 +5,7 @@
class AccountReportExpression(models.AbstractModel):
- _inherit = "account.report.expression"
+ _inherit = ["account.report.expression"]
def _get_carryover_target_expression(self, options):
if self.report_line_id.code == 'VP14b' and fields.Date.from_string(options['date']['date_to']).month == 12:
diff --git a/addons/l10n_it/models/account_tax.py b/addons/l10n_it/models/account_tax.py
index d3468d826292b..05a950817fe15 100644
--- a/addons/l10n_it/models/account_tax.py
+++ b/addons/l10n_it/models/account_tax.py
@@ -3,8 +3,9 @@
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError, UserError
+
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
l10n_it_exempt_reason = fields.Selection(
selection=[
diff --git a/addons/l10n_it/models/template_it.py b/addons/l10n_it/models/template_it.py
index 21ccb300a12d9..8d733d12558d9 100644
--- a/addons/l10n_it/models/template_it.py
+++ b/addons/l10n_it/models/template_it.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('it')
def _get_it_template_data(self):
diff --git a/addons/l10n_it_edi/models/account_edi_proxy_user.py b/addons/l10n_it_edi/models/account_edi_proxy_user.py
index 95cf6016b00b9..fe1dd55c91b43 100644
--- a/addons/l10n_it_edi/models/account_edi_proxy_user.py
+++ b/addons/l10n_it_edi/models/account_edi_proxy_user.py
@@ -8,8 +8,8 @@
_logger = logging.getLogger(__name__)
-class AccountEdiProxyClientUser(models.Model):
- _inherit = 'account_edi_proxy_client.user'
+class Account_Edi_Proxy_ClientUser(models.Model):
+ _inherit = ['account_edi_proxy_client.user']
proxy_type = fields.Selection(selection_add=[('l10n_it_edi', 'Italian EDI')], ondelete={'l10n_it_edi': 'cascade'})
diff --git a/addons/l10n_it_edi/models/account_move.py b/addons/l10n_it_edi/models/account_move.py
index ff4ce10429af4..8027b211c32e9 100644
--- a/addons/l10n_it_edi/models/account_move.py
+++ b/addons/l10n_it_edi/models/account_move.py
@@ -50,7 +50,7 @@ def get_datetime(tree, xpath):
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_it_edi_state = fields.Selection(
string="SDI State",
diff --git a/addons/l10n_it_edi/models/account_move_send.py b/addons/l10n_it_edi/models/account_move_send.py
index bdaaff1d6dd73..158986e492a1b 100644
--- a/addons/l10n_it_edi/models/account_move_send.py
+++ b/addons/l10n_it_edi/models/account_move_send.py
@@ -4,7 +4,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
@api.model
def _is_it_edi_applicable(self, move):
diff --git a/addons/l10n_it_edi/models/ddt.py b/addons/l10n_it_edi/models/ddt.py
index 2a53d9edb6104..b999cd4e25d80 100644
--- a/addons/l10n_it_edi/models/ddt.py
+++ b/addons/l10n_it_edi/models/ddt.py
@@ -3,8 +3,8 @@
from odoo import fields, models, api
-class L10nItDdt(models.Model):
- _name = 'l10n_it.ddt'
+
+class L10n_ItDdt(models.Model):
_description = 'Transport Document'
invoice_id = fields.One2many('account.move', 'l10n_it_ddt_id', string='Invoice Reference')
diff --git a/addons/l10n_it_edi/models/ir_attachment.py b/addons/l10n_it_edi/models/ir_attachment.py
index b49098a222fd3..4f3b207b020fc 100644
--- a/addons/l10n_it_edi/models/ir_attachment.py
+++ b/addons/l10n_it_edi/models/ir_attachment.py
@@ -13,7 +13,7 @@
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
def _decode_edi_l10n_it_edi(self, name, content):
""" Decodes a into a list of one dictionary representing an attachment.
diff --git a/addons/l10n_it_edi/models/res_company.py b/addons/l10n_it_edi/models/res_company.py
index 2cbcc3c980219..2d3783da5bd9f 100644
--- a/addons/l10n_it_edi/models/res_company.py
+++ b/addons/l10n_it_edi/models/res_company.py
@@ -24,9 +24,9 @@
("RF19", "[RF19] Regime forfettario (art.1, c.54-89, L. 190/2014)"),
]
+
class ResCompany(models.Model):
- _name = 'res.company'
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_it_codice_fiscale = fields.Char(string="Codice Fiscale", size=16, related='partner_id.l10n_it_codice_fiscale',
store=True, readonly=False, help="Fiscal code of your company")
diff --git a/addons/l10n_it_edi/models/res_config_settings.py b/addons/l10n_it_edi/models/res_config_settings.py
index f0aeeafb86240..ff4e5f3d08911 100644
--- a/addons/l10n_it_edi/models/res_config_settings.py
+++ b/addons/l10n_it_edi/models/res_config_settings.py
@@ -3,8 +3,9 @@
from odoo import api, models, fields, _
from odoo.exceptions import UserError
+
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
is_edi_proxy_active = fields.Boolean(compute='_compute_is_edi_proxy_active')
l10n_it_edi_proxy_current_state = fields.Char(compute='_compute_l10n_it_edi_proxy_current_state')
diff --git a/addons/l10n_it_edi/models/res_partner.py b/addons/l10n_it_edi/models/res_partner.py
index dce461c1eede0..12ea988973a11 100644
--- a/addons/l10n_it_edi/models/res_partner.py
+++ b/addons/l10n_it_edi/models/res_partner.py
@@ -8,8 +8,7 @@
class ResPartner(models.Model):
- _name = 'res.partner'
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('it_edi_xml', 'FatturaPA')])
l10n_it_pec_email = fields.Char(string="PEC e-mail")
diff --git a/addons/l10n_it_edi_doi/models/account_chart_template.py b/addons/l10n_it_edi_doi/models/account_chart_template.py
index 350b253b48c09..5b0006acb38aa 100644
--- a/addons/l10n_it_edi_doi/models/account_chart_template.py
+++ b/addons/l10n_it_edi_doi/models/account_chart_template.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('it', 'account.tax')
def _get_it_edi_doi_account_tax(self):
diff --git a/addons/l10n_it_edi_doi/models/account_fiscal_position.py b/addons/l10n_it_edi_doi/models/account_fiscal_position.py
index 196c757a7f11b..6f2145ebfd753 100644
--- a/addons/l10n_it_edi_doi/models/account_fiscal_position.py
+++ b/addons/l10n_it_edi_doi/models/account_fiscal_position.py
@@ -5,7 +5,7 @@
class AccountFiscalPosition(models.Model):
- _inherit = 'account.fiscal.position'
+ _inherit = ['account.fiscal.position']
@api.ondelete(at_uninstall=False)
def _never_unlink_declaration_of_intent_fiscal_position(self):
diff --git a/addons/l10n_it_edi_doi/models/account_move.py b/addons/l10n_it_edi_doi/models/account_move.py
index b7cdf6ba17694..83014bf366d3c 100644
--- a/addons/l10n_it_edi_doi/models/account_move.py
+++ b/addons/l10n_it_edi_doi/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_it_edi_doi_date = fields.Date(
string="Date on which Declaration of Intent is applied",
diff --git a/addons/l10n_it_edi_doi/models/account_tax.py b/addons/l10n_it_edi_doi/models/account_tax.py
index 62eec2fbb495e..42a7b55f3f5a2 100644
--- a/addons/l10n_it_edi_doi/models/account_tax.py
+++ b/addons/l10n_it_edi_doi/models/account_tax.py
@@ -3,7 +3,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
@api.ondelete(at_uninstall=False)
def _never_unlink_declaration_of_intent_tax(self):
diff --git a/addons/l10n_it_edi_doi/models/declaration_of_intent.py b/addons/l10n_it_edi_doi/models/declaration_of_intent.py
index afbeef6fa33ce..ab10fbe985a77 100644
--- a/addons/l10n_it_edi_doi/models/declaration_of_intent.py
+++ b/addons/l10n_it_edi_doi/models/declaration_of_intent.py
@@ -5,8 +5,7 @@
from odoo.tools.misc import formatLang
-class L10nItDeclarationOfIntent(models.Model):
- _name = "l10n_it_edi_doi.declaration_of_intent"
+class L10n_It_Edi_DoiDeclaration_Of_Intent(models.Model):
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
_description = "Declaration of Intent"
_order = 'protocol_number_part1, protocol_number_part2'
diff --git a/addons/l10n_it_edi_doi/models/res_company.py b/addons/l10n_it_edi_doi/models/res_company.py
index 0d5ec4f2d1283..1780f56bb4c57 100644
--- a/addons/l10n_it_edi_doi/models/res_company.py
+++ b/addons/l10n_it_edi_doi/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_it_edi_doi_tax_id = fields.Many2one(
comodel_name='account.tax',
diff --git a/addons/l10n_it_edi_doi/models/res_partner.py b/addons/l10n_it_edi_doi/models/res_partner.py
index fa25eb9471bc9..9cb4ca373a981 100644
--- a/addons/l10n_it_edi_doi/models/res_partner.py
+++ b/addons/l10n_it_edi_doi/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_it_edi_doi_ids = fields.One2many(
'l10n_it_edi_doi.declaration_of_intent',
diff --git a/addons/l10n_it_edi_doi/models/sale_order.py b/addons/l10n_it_edi_doi/models/sale_order.py
index e654740ca7633..b7d5cb3c731ea 100644
--- a/addons/l10n_it_edi_doi/models/sale_order.py
+++ b/addons/l10n_it_edi_doi/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
l10n_it_edi_doi_date = fields.Date(
string="Date on which Declaration of Intent is applied",
diff --git a/addons/l10n_it_edi_ndd/models/account_move.py b/addons/l10n_it_edi_ndd/models/account_move.py
index 62978096edc95..ea3577ea4359a 100644
--- a/addons/l10n_it_edi_ndd/models/account_move.py
+++ b/addons/l10n_it_edi_ndd/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_it_payment_method = fields.Selection(
selection=L10N_IT_PAYMENT_METHOD_SELECTION,
diff --git a/addons/l10n_it_edi_ndd/models/account_payment_methode_line.py b/addons/l10n_it_edi_ndd/models/account_payment_methode_line.py
index 691adfd8c737a..c1d33a9fe0da6 100644
--- a/addons/l10n_it_edi_ndd/models/account_payment_methode_line.py
+++ b/addons/l10n_it_edi_ndd/models/account_payment_methode_line.py
@@ -28,7 +28,7 @@
class AccountPaymentMethodLine(models.Model):
- _inherit = "account.payment.method.line"
+ _inherit = ["account.payment.method.line"]
l10n_it_payment_method = fields.Selection(
selection=L10N_IT_PAYMENT_METHOD_SELECTION,
diff --git a/addons/l10n_it_edi_ndd/models/l10n_it_document_type.py b/addons/l10n_it_edi_ndd/models/l10n_it_document_type.py
index b8ea14b3cd4c9..05579b84282ef 100644
--- a/addons/l10n_it_edi_ndd/models/l10n_it_document_type.py
+++ b/addons/l10n_it_edi_ndd/models/l10n_it_document_type.py
@@ -1,8 +1,7 @@
from odoo import fields, models
-class L10nItDocumentType(models.Model):
- _name = 'l10n_it.document.type'
+class L10n_ItDocumentType(models.Model):
_description = 'Italian Document Type'
name = fields.Char(required=True, help='The document type name', translate=True)
diff --git a/addons/l10n_it_edi_withholding/models/account_chart_template.py b/addons/l10n_it_edi_withholding/models/account_chart_template.py
index b605dbbdfa8de..89613fcccf82b 100644
--- a/addons/l10n_it_edi_withholding/models/account_chart_template.py
+++ b/addons/l10n_it_edi_withholding/models/account_chart_template.py
@@ -6,7 +6,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('it', 'account.account')
def _get_it_withholding_account_account(self):
diff --git a/addons/l10n_it_edi_withholding/models/account_move.py b/addons/l10n_it_edi_withholding/models/account_move.py
index b036b3a7decf6..716bbdc8e91a6 100644
--- a/addons/l10n_it_edi_withholding/models/account_move.py
+++ b/addons/l10n_it_edi_withholding/models/account_move.py
@@ -9,7 +9,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_it_amount_vat_signed = fields.Monetary(string='VAT', compute='_compute_amount_extended', currency_field='company_currency_id')
l10n_it_amount_pension_fund_signed = fields.Monetary(string='Pension Fund', compute='_compute_amount_extended', currency_field='company_currency_id')
diff --git a/addons/l10n_it_edi_withholding/models/account_tax.py b/addons/l10n_it_edi_withholding/models/account_tax.py
index b4c8c76cff887..63ff6c3594864 100644
--- a/addons/l10n_it_edi_withholding/models/account_tax.py
+++ b/addons/l10n_it_edi_withholding/models/account_tax.py
@@ -80,7 +80,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_it_withholding_type = fields.Selection(WITHHOLDING_TYPE_SELECTION, string="Withholding tax type (Italy)", help="Withholding tax type. Only for Italian accounting EDI.")
l10n_it_withholding_reason = fields.Selection(WITHHOLDING_REASON_SELECTION, string="Withholding tax reason (Italy)", help="Withholding tax reason. Only for Italian accounting EDI.")
diff --git a/addons/l10n_it_stock_ddt/models/account_invoice.py b/addons/l10n_it_stock_ddt/models/account_invoice.py
index a19dfa7156730..143c5648aeb55 100644
--- a/addons/l10n_it_stock_ddt/models/account_invoice.py
+++ b/addons/l10n_it_stock_ddt/models/account_invoice.py
@@ -6,7 +6,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_it_ddt_ids = fields.Many2many('stock.picking', compute="_compute_ddt_ids")
l10n_it_ddt_count = fields.Integer(compute="_compute_ddt_ids")
diff --git a/addons/l10n_it_stock_ddt/models/stock_picking.py b/addons/l10n_it_stock_ddt/models/stock_picking.py
index 988a40a6d7e5f..964d6bb256c30 100644
--- a/addons/l10n_it_stock_ddt/models/stock_picking.py
+++ b/addons/l10n_it_stock_ddt/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = "stock.picking"
+ _inherit = ["stock.picking"]
l10n_it_transport_reason = fields.Selection([('sale', 'Sale'),
('outsourcing', 'Outsourcing'),
@@ -55,7 +55,7 @@ def _action_done(self):
class StockPickingType(models.Model):
- _inherit = 'stock.picking.type'
+ _inherit = ['stock.picking.type']
l10n_it_ddt_sequence_id = fields.Many2one('ir.sequence')
diff --git a/addons/l10n_jo/models/template_jo_standard.py b/addons/l10n_jo/models/template_jo_standard.py
index 47699e8b5f9b9..9be061325d86a 100644
--- a/addons/l10n_jo/models/template_jo_standard.py
+++ b/addons/l10n_jo/models/template_jo_standard.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('jo_standard')
def _get_jo_standard_template_data(self):
diff --git a/addons/l10n_jp/models/template_jp.py b/addons/l10n_jp/models/template_jp.py
index 972b6f786f729..bd1beb5ff5adc 100644
--- a/addons/l10n_jp/models/template_jp.py
+++ b/addons/l10n_jp/models/template_jp.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('jp')
def _get_jp_template_data(self):
diff --git a/addons/l10n_jp_ubl_pint/models/account_edi_xml_pint_jp.py b/addons/l10n_jp_ubl_pint/models/account_edi_xml_pint_jp.py
index 673eca295f746..cf1b07de2dfb4 100644
--- a/addons/l10n_jp_ubl_pint/models/account_edi_xml_pint_jp.py
+++ b/addons/l10n_jp_ubl_pint/models/account_edi_xml_pint_jp.py
@@ -1,9 +1,8 @@
from odoo import fields, models
-class AccountEdiXmlUBLPINTJP(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = 'account.edi.xml.pint_jp'
+class AccountEdiXmlPint_Jp(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "Japanese implementation of Peppol International (PINT) model for Billing"
"""
Pint is a standard for International Billing from Peppol. It is based on Peppol BIS Billing 3.
diff --git a/addons/l10n_jp_ubl_pint/models/res_partner.py b/addons/l10n_jp_ubl_pint/models/res_partner.py
index ff1b79cb9569f..06ce374e6e3b2 100644
--- a/addons/l10n_jp_ubl_pint/models/res_partner.py
+++ b/addons/l10n_jp_ubl_pint/models/res_partner.py
@@ -2,7 +2,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('pint_jp', "PINT Japan")])
diff --git a/addons/l10n_ke/models/account_move.py b/addons/l10n_ke/models/account_move.py
index 5d849dc56853f..79b66d8bd8588 100644
--- a/addons/l10n_ke/models/account_move.py
+++ b/addons/l10n_ke/models/account_move.py
@@ -2,7 +2,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_ke_wh_certificate_number = fields.Char(
string="Withholding Certificate Number",
diff --git a/addons/l10n_ke/models/account_tax.py b/addons/l10n_ke/models/account_tax.py
index dec7b82d56a1b..3b21b16342c8e 100644
--- a/addons/l10n_ke/models/account_tax.py
+++ b/addons/l10n_ke/models/account_tax.py
@@ -3,7 +3,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_ke_item_code_id = fields.Many2one(
'l10n_ke.item.code',
diff --git a/addons/l10n_ke/models/l10n_ke_item_code.py b/addons/l10n_ke/models/l10n_ke_item_code.py
index a79824157f69d..ffb5c9954da39 100644
--- a/addons/l10n_ke/models/l10n_ke_item_code.py
+++ b/addons/l10n_ke/models/l10n_ke_item_code.py
@@ -4,8 +4,7 @@
from odoo import models, fields, api
-class L10nKeItemCode(models.Model):
- _name = 'l10n_ke.item.code'
+class L10n_KeItemCode(models.Model):
_description = "KRA defined codes that justify a given tax rate / exemption"
_rec_names_search = ['code', 'description']
diff --git a/addons/l10n_ke/models/res_company.py b/addons/l10n_ke/models/res_company.py
index b46dbe89b7033..41cd109d57b5d 100644
--- a/addons/l10n_ke/models/res_company.py
+++ b/addons/l10n_ke/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_ke_oscu_is_active = fields.Boolean(
string="Is OSCU active?",
diff --git a/addons/l10n_ke/models/template_ke.py b/addons/l10n_ke/models/template_ke.py
index 02e8367a88d73..0093ca2587540 100644
--- a/addons/l10n_ke/models/template_ke.py
+++ b/addons/l10n_ke/models/template_ke.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ke')
def _get_ke_template_data(self):
diff --git a/addons/l10n_ke_edi_tremol/models/account_move.py b/addons/l10n_ke_edi_tremol/models/account_move.py
index 6ca131a66b50e..7d1293348023d 100644
--- a/addons/l10n_ke_edi_tremol/models/account_move.py
+++ b/addons/l10n_ke_edi_tremol/models/account_move.py
@@ -10,8 +10,9 @@
_logger = logging.getLogger(__name__)
+
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_ke_cu_datetime = fields.Datetime(string='CU Signing Date and Time', copy=False)
l10n_ke_cu_serial_number = fields.Char(string='CU Serial Number', copy=False)
diff --git a/addons/l10n_ke_edi_tremol/models/account_move_send.py b/addons/l10n_ke_edi_tremol/models/account_move_send.py
index de3faa4ab8c1d..0e8afffbeb367 100644
--- a/addons/l10n_ke_edi_tremol/models/account_move_send.py
+++ b/addons/l10n_ke_edi_tremol/models/account_move_send.py
@@ -2,7 +2,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
@api.model
def _get_l10n_ke_edi_tremol_warning_moves(self, moves):
diff --git a/addons/l10n_ke_edi_tremol/models/res_company.py b/addons/l10n_ke_edi_tremol/models/res_company.py
index 4be2e98f7c863..fe9449603b1cf 100644
--- a/addons/l10n_ke_edi_tremol/models/res_company.py
+++ b/addons/l10n_ke_edi_tremol/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_ke_cu_proxy_address = fields.Char(
default="http://localhost:8069",
diff --git a/addons/l10n_ke_edi_tremol/models/res_config_settings.py b/addons/l10n_ke_edi_tremol/models/res_config_settings.py
index 3614cae3e150e..f9b0b74ae1aba 100644
--- a/addons/l10n_ke_edi_tremol/models/res_config_settings.py
+++ b/addons/l10n_ke_edi_tremol/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_ke_cu_proxy_address = fields.Char(related='company_id.l10n_ke_cu_proxy_address', readonly=False)
diff --git a/addons/l10n_ke_edi_tremol/models/res_partner.py b/addons/l10n_ke_edi_tremol/models/res_partner.py
index 9a1c9788800c9..3db7c410c87e0 100644
--- a/addons/l10n_ke_edi_tremol/models/res_partner.py
+++ b/addons/l10n_ke_edi_tremol/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_ke_exemption_number = fields.Char(
string='Exemption Number',
diff --git a/addons/l10n_ke_edi_tremol/wizard/account_move_send_wizard.py b/addons/l10n_ke_edi_tremol/wizard/account_move_send_wizard.py
index 69df249cb31ca..d11ef60eeed21 100644
--- a/addons/l10n_ke_edi_tremol/wizard/account_move_send_wizard.py
+++ b/addons/l10n_ke_edi_tremol/wizard/account_move_send_wizard.py
@@ -3,7 +3,7 @@
class AccountMoveSendWizard(models.TransientModel):
- _inherit = 'account.move.send.wizard'
+ _inherit = ['account.move.send.wizard']
def action_send_and_print(self, allow_fallback_pdf=False):
# EXTENDS account - prevent Send & Print if KE invoices aren't validated and no fallback is allowed.
diff --git a/addons/l10n_km/models/template_km.py b/addons/l10n_km/models/template_km.py
index 188954ea5242a..82b379e2a299b 100644
--- a/addons/l10n_km/models/template_km.py
+++ b/addons/l10n_km/models/template_km.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('km')
def _get_km_template_data(self):
diff --git a/addons/l10n_km/models/template_km_syscebnl.py b/addons/l10n_km/models/template_km_syscebnl.py
index 2102abc37016e..dc643c8e68c40 100644
--- a/addons/l10n_km/models/template_km_syscebnl.py
+++ b/addons/l10n_km/models/template_km_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('km_syscebnl')
def _get_km_syscebnl_template_data(self):
diff --git a/addons/l10n_kw/models/template_kw.py b/addons/l10n_kw/models/template_kw.py
index 8537cc6444659..bbca2b56df29f 100644
--- a/addons/l10n_kw/models/template_kw.py
+++ b/addons/l10n_kw/models/template_kw.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('kw')
def _get_kw_template_data(self):
diff --git a/addons/l10n_kz/models/template_kz.py b/addons/l10n_kz/models/template_kz.py
index d7d0f7762337b..29675d59eb371 100644
--- a/addons/l10n_kz/models/template_kz.py
+++ b/addons/l10n_kz/models/template_kz.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('kz')
def _get_kz_template_data(self):
diff --git a/addons/l10n_latam_base/models/l10n_latam_identification_type.py b/addons/l10n_latam_base/models/l10n_latam_identification_type.py
index 7be4fea3bf7e0..b71373e478844 100644
--- a/addons/l10n_latam_base/models/l10n_latam_identification_type.py
+++ b/addons/l10n_latam_base/models/l10n_latam_identification_type.py
@@ -4,8 +4,7 @@
from odoo.osv import expression
-class L10nLatamIdentificationType(models.Model):
- _name = 'l10n_latam.identification.type'
+class L10n_LatamIdentificationType(models.Model):
_description = "Identification Types"
_order = 'sequence'
diff --git a/addons/l10n_latam_base/models/res_company.py b/addons/l10n_latam_base/models/res_company.py
index 40dfee1532462..12048a89bd846 100644
--- a/addons/l10n_latam_base/models/res_company.py
+++ b/addons/l10n_latam_base/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/l10n_latam_base/models/res_partner.py b/addons/l10n_latam_base/models/res_partner.py
index 767c637af213e..216dd374c3349 100644
--- a/addons/l10n_latam_base/models/res_partner.py
+++ b/addons/l10n_latam_base/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_latam_identification_type_id = fields.Many2one('l10n_latam.identification.type',
string="Identification Type", index='btree_not_null', auto_join=True,
diff --git a/addons/l10n_latam_check/models/account_chart_template.py b/addons/l10n_latam_check/models/account_chart_template.py
index 4acdd0bbf83e9..c2f033c5f4ca0 100644
--- a/addons/l10n_latam_check/models/account_chart_template.py
+++ b/addons/l10n_latam_check/models/account_chart_template.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@api.model
def _get_third_party_checks_country_codes(self):
diff --git a/addons/l10n_latam_check/models/account_journal.py b/addons/l10n_latam_check/models/account_journal.py
index 09f9f4f111118..06dea9f1b6531 100644
--- a/addons/l10n_latam_check/models/account_journal.py
+++ b/addons/l10n_latam_check/models/account_journal.py
@@ -2,7 +2,7 @@
class AccountJournal(models.Model):
- _inherit = "account.journal"
+ _inherit = ["account.journal"]
def _default_outbound_payment_methods(self):
res = super()._default_outbound_payment_methods()
diff --git a/addons/l10n_latam_check/models/account_move.py b/addons/l10n_latam_check/models/account_move.py
index dea154575fa3a..30f636dd2c921 100644
--- a/addons/l10n_latam_check/models/account_move.py
+++ b/addons/l10n_latam_check/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def button_draft(self):
super().button_draft()
diff --git a/addons/l10n_latam_check/models/account_move_line.py b/addons/l10n_latam_check/models/account_move_line.py
index 64b01fb0d6856..47ec123c8737a 100644
--- a/addons/l10n_latam_check/models/account_move_line.py
+++ b/addons/l10n_latam_check/models/account_move_line.py
@@ -4,6 +4,6 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
l10n_latam_check_ids = fields.One2many('l10n_latam.check', 'outstanding_line_id', string='Checks')
diff --git a/addons/l10n_latam_check/models/account_payment.py b/addons/l10n_latam_check/models/account_payment.py
index 2d5fa10e2c043..a6b22b22e5ba8 100644
--- a/addons/l10n_latam_check/models/account_payment.py
+++ b/addons/l10n_latam_check/models/account_payment.py
@@ -4,7 +4,7 @@
class AccountPayment(models.Model):
- _inherit = 'account.payment'
+ _inherit = ['account.payment']
l10n_latam_new_check_ids = fields.One2many('l10n_latam.check', 'payment_id', string='Checks')
l10n_latam_move_check_ids = fields.Many2many(
diff --git a/addons/l10n_latam_check/models/account_payment_method.py b/addons/l10n_latam_check/models/account_payment_method.py
index f8144a0d945e7..f3740013e4630 100644
--- a/addons/l10n_latam_check/models/account_payment_method.py
+++ b/addons/l10n_latam_check/models/account_payment_method.py
@@ -2,7 +2,7 @@
class AccountPaymentMethod(models.Model):
- _inherit = 'account.payment.method'
+ _inherit = ['account.payment.method']
@api.model
def _get_payment_method_information(self):
diff --git a/addons/l10n_latam_check/models/l10n_latam_check.py b/addons/l10n_latam_check/models/l10n_latam_check.py
index ba96e2623fa21..f85f9e40c3fd4 100644
--- a/addons/l10n_latam_check/models/l10n_latam_check.py
+++ b/addons/l10n_latam_check/models/l10n_latam_check.py
@@ -11,8 +11,7 @@
_logger = logging.getLogger(__name__)
-class l10nLatamAccountPaymentCheck(models.Model):
- _name = 'l10n_latam.check'
+class L10n_LatamCheck(models.Model):
_description = 'Account payment check'
_check_company_auto = True
_inherit = ['mail.thread', 'mail.activity.mixin']
diff --git a/addons/l10n_latam_check/wizards/account_payment_register.py b/addons/l10n_latam_check/wizards/account_payment_register.py
index cb48aa129a016..ff7369542db1d 100644
--- a/addons/l10n_latam_check/wizards/account_payment_register.py
+++ b/addons/l10n_latam_check/wizards/account_payment_register.py
@@ -2,7 +2,7 @@
class AccountPaymentRegister(models.TransientModel):
- _inherit = 'account.payment.register'
+ _inherit = ['account.payment.register']
l10n_latam_new_check_ids = fields.One2many('l10n_latam.payment.register.check', 'payment_register_id', string="New Checks")
l10n_latam_move_check_ids = fields.Many2many(
diff --git a/addons/l10n_latam_check/wizards/l10n_latam_payment_mass_transfer.py b/addons/l10n_latam_check/wizards/l10n_latam_payment_mass_transfer.py
index 9b0dfcd7e6af4..2193f429ec0b2 100644
--- a/addons/l10n_latam_check/wizards/l10n_latam_payment_mass_transfer.py
+++ b/addons/l10n_latam_check/wizards/l10n_latam_payment_mass_transfer.py
@@ -4,8 +4,7 @@
from odoo.exceptions import UserError
-class L10nLatamPaymentMassTransfer(models.TransientModel):
- _name = 'l10n_latam.payment.mass.transfer'
+class L10n_LatamPaymentMassTransfer(models.TransientModel):
_description = 'Checks Mass Transfers'
_check_company_auto = True
diff --git a/addons/l10n_latam_check/wizards/l10n_latam_payment_register_check.py b/addons/l10n_latam_check/wizards/l10n_latam_payment_register_check.py
index 95f974b98a35b..f66454cd95146 100644
--- a/addons/l10n_latam_check/wizards/l10n_latam_payment_register_check.py
+++ b/addons/l10n_latam_check/wizards/l10n_latam_payment_register_check.py
@@ -8,8 +8,7 @@
_logger = logging.getLogger(__name__)
-class l10nLatamCheckPaymentRegisterCheck(models.TransientModel):
- _name = 'l10n_latam.payment.register.check'
+class L10n_LatamPaymentRegisterCheck(models.TransientModel):
_description = 'Payment register check'
_check_company_auto = True
diff --git a/addons/l10n_latam_invoice_document/models/account_chart_template.py b/addons/l10n_latam_invoice_document/models/account_chart_template.py
index d7e83f27954a1..067e59d155aee 100644
--- a/addons/l10n_latam_invoice_document/models/account_chart_template.py
+++ b/addons/l10n_latam_invoice_document/models/account_chart_template.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template(model='account.journal')
def _get_latam_document_account_journal(self, template_code):
diff --git a/addons/l10n_latam_invoice_document/models/account_journal.py b/addons/l10n_latam_invoice_document/models/account_journal.py
index a1f86ae429dde..715eb29c9aa76 100644
--- a/addons/l10n_latam_invoice_document/models/account_journal.py
+++ b/addons/l10n_latam_invoice_document/models/account_journal.py
@@ -3,9 +3,10 @@
from odoo import fields, models, api, _
from odoo.exceptions import ValidationError
+
class AccountJournal(models.Model):
- _inherit = "account.journal"
+ _inherit = ["account.journal"]
l10n_latam_use_documents = fields.Boolean(
'Use Documents?', help="If active: will be using for legal invoicing (invoices, debit/credit notes)."
diff --git a/addons/l10n_latam_invoice_document/models/account_move.py b/addons/l10n_latam_invoice_document/models/account_move.py
index 0c189f616bc13..b7b5f81a01d73 100644
--- a/addons/l10n_latam_invoice_document/models/account_move.py
+++ b/addons/l10n_latam_invoice_document/models/account_move.py
@@ -9,7 +9,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
_sql_constraints = [(
'unique_name', "", "Another entry with the same name already exists.",
diff --git a/addons/l10n_latam_invoice_document/models/account_move_line.py b/addons/l10n_latam_invoice_document/models/account_move_line.py
index f763866941bec..b681c3779d51f 100644
--- a/addons/l10n_latam_invoice_document/models/account_move_line.py
+++ b/addons/l10n_latam_invoice_document/models/account_move_line.py
@@ -6,7 +6,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _auto_init(self):
# Skip the computation of the field `l10n_latam_document_type_id` at the module installation
diff --git a/addons/l10n_latam_invoice_document/models/l10n_latam_document_type.py b/addons/l10n_latam_invoice_document/models/l10n_latam_document_type.py
index 2e8fefe84bf67..eb8f63871bab7 100644
--- a/addons/l10n_latam_invoice_document/models/l10n_latam_document_type.py
+++ b/addons/l10n_latam_invoice_document/models/l10n_latam_document_type.py
@@ -3,9 +3,8 @@
from odoo.osv import expression
-class L10nLatamDocumentType(models.Model):
+class L10n_LatamDocumentType(models.Model):
- _name = 'l10n_latam.document.type'
_description = 'Latam Document Type'
_order = 'sequence, id'
_rec_names_search = ['name', 'code']
diff --git a/addons/l10n_latam_invoice_document/models/res_company.py b/addons/l10n_latam_invoice_document/models/res_company.py
index b37c24ef9aeb8..d2865951b4510 100644
--- a/addons/l10n_latam_invoice_document/models/res_company.py
+++ b/addons/l10n_latam_invoice_document/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
def _localization_use_documents(self):
""" This method is to be inherited by localizations and return True if localization use documents """
diff --git a/addons/l10n_latam_invoice_document/report/invoice_report.py b/addons/l10n_latam_invoice_document/report/invoice_report.py
index 0a980c130719f..27172c5a82b05 100644
--- a/addons/l10n_latam_invoice_document/report/invoice_report.py
+++ b/addons/l10n_latam_invoice_document/report/invoice_report.py
@@ -5,7 +5,7 @@
class AccountInvoiceReport(models.Model):
- _inherit = 'account.invoice.report'
+ _inherit = ['account.invoice.report']
l10n_latam_document_type_id = fields.Many2one('l10n_latam.document.type', 'Document Type', index=True)
_depends = {'account.move': ['l10n_latam_document_type_id'],}
diff --git a/addons/l10n_latam_invoice_document/wizards/account_debit_note.py b/addons/l10n_latam_invoice_document/wizards/account_debit_note.py
index 99110804b51f6..5ae03cbdb3022 100644
--- a/addons/l10n_latam_invoice_document/wizards/account_debit_note.py
+++ b/addons/l10n_latam_invoice_document/wizards/account_debit_note.py
@@ -3,7 +3,7 @@
class AccountDebitNote(models.TransientModel):
- _inherit = 'account.debit.note'
+ _inherit = ['account.debit.note']
def create_debit(self):
""" Properly compute the latam document type of type debit note. """
diff --git a/addons/l10n_latam_invoice_document/wizards/account_move_reversal.py b/addons/l10n_latam_invoice_document/wizards/account_move_reversal.py
index a56e049d56fe4..5e8752c96cc65 100644
--- a/addons/l10n_latam_invoice_document/wizards/account_move_reversal.py
+++ b/addons/l10n_latam_invoice_document/wizards/account_move_reversal.py
@@ -5,7 +5,7 @@
class AccountMoveReversal(models.TransientModel):
- _inherit = "account.move.reversal"
+ _inherit = ["account.move.reversal"]
l10n_latam_use_documents = fields.Boolean(compute='_compute_documents_info')
l10n_latam_document_type_id = fields.Many2one('l10n_latam.document.type', 'Document Type', ondelete='cascade', domain="[('id', 'in', l10n_latam_available_document_type_ids)]", compute='_compute_document_type', readonly=False, store=True)
diff --git a/addons/l10n_lt/models/account_journal.py b/addons/l10n_lt/models/account_journal.py
index 43af8275068d5..a6c9e64e1c74a 100644
--- a/addons/l10n_lt/models/account_journal.py
+++ b/addons/l10n_lt/models/account_journal.py
@@ -2,7 +2,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
@api.model
def _prepare_liquidity_account_vals(self, company, code, vals):
diff --git a/addons/l10n_lt/models/template_lt.py b/addons/l10n_lt/models/template_lt.py
index 421db1aa21dbf..91058754f42e3 100644
--- a/addons/l10n_lt/models/template_lt.py
+++ b/addons/l10n_lt/models/template_lt.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('lt')
def _get_lt_template_data(self):
diff --git a/addons/l10n_lu/models/template_lu.py b/addons/l10n_lu/models/template_lu.py
index 08ea53031cc78..a7edf5353f734 100644
--- a/addons/l10n_lu/models/template_lu.py
+++ b/addons/l10n_lu/models/template_lu.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('lu')
def _get_lu_template_data(self):
diff --git a/addons/l10n_lv/models/template_lv.py b/addons/l10n_lv/models/template_lv.py
index afdc92279774b..744b3d5f20e71 100644
--- a/addons/l10n_lv/models/template_lv.py
+++ b/addons/l10n_lv/models/template_lv.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('lv')
def _get_lv_template_data(self):
diff --git a/addons/l10n_ma/models/base_document_layout.py b/addons/l10n_ma/models/base_document_layout.py
index c86d346ed1a78..fd044eb93b18d 100644
--- a/addons/l10n_ma/models/base_document_layout.py
+++ b/addons/l10n_ma/models/base_document_layout.py
@@ -5,7 +5,7 @@
class BaseDocumentLayout(models.TransientModel):
- _inherit = 'base.document.layout'
+ _inherit = ['base.document.layout']
@api.model
def _default_company_details(self):
diff --git a/addons/l10n_ma/models/template_ma.py b/addons/l10n_ma/models/template_ma.py
index f783e00ee9fd5..3aaeb44b7cd9f 100644
--- a/addons/l10n_ma/models/template_ma.py
+++ b/addons/l10n_ma/models/template_ma.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ma')
def _get_ma_template_data(self):
diff --git a/addons/l10n_ml/models/template_ml.py b/addons/l10n_ml/models/template_ml.py
index ed631c82c45a5..d102853aae126 100644
--- a/addons/l10n_ml/models/template_ml.py
+++ b/addons/l10n_ml/models/template_ml.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ml')
def _get_ml_template_data(self):
diff --git a/addons/l10n_ml/models/template_ml_syscebnl.py b/addons/l10n_ml/models/template_ml_syscebnl.py
index 3a08948fda7d2..90a48e104f3d3 100644
--- a/addons/l10n_ml/models/template_ml_syscebnl.py
+++ b/addons/l10n_ml/models/template_ml_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ml_syscebnl')
def _get_ml_syscebnl_template_data(self):
diff --git a/addons/l10n_mn/models/template_mn.py b/addons/l10n_mn/models/template_mn.py
index 81ae8d08cecff..719a17c2aefe1 100644
--- a/addons/l10n_mn/models/template_mn.py
+++ b/addons/l10n_mn/models/template_mn.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('mn')
def _get_mn_template_data(self):
diff --git a/addons/l10n_mt/models/template_mt.py b/addons/l10n_mt/models/template_mt.py
index 5ed8ca0f57b3f..9a9151e0890b5 100644
--- a/addons/l10n_mt/models/template_mt.py
+++ b/addons/l10n_mt/models/template_mt.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('mt')
def _get_mt_template_data(self):
diff --git a/addons/l10n_mu_account/models/account_move.py b/addons/l10n_mu_account/models/account_move.py
index fe106e13c144f..ce1cbf9fce594 100644
--- a/addons/l10n_mu_account/models/account_move.py
+++ b/addons/l10n_mu_account/models/account_move.py
@@ -2,7 +2,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _get_name_invoice_report(self):
# EXTENDS account
diff --git a/addons/l10n_mu_account/models/template_mu.py b/addons/l10n_mu_account/models/template_mu.py
index 9db985a21027f..9123b4e8ff803 100644
--- a/addons/l10n_mu_account/models/template_mu.py
+++ b/addons/l10n_mu_account/models/template_mu.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('mu')
def _get_mu_template_data(self):
diff --git a/addons/l10n_mx/models/account_account.py b/addons/l10n_mx/models/account_account.py
index 150c12be73080..1d7c21d3b8832 100644
--- a/addons/l10n_mx/models/account_account.py
+++ b/addons/l10n_mx/models/account_account.py
@@ -2,7 +2,7 @@
class AccountAccount(models.Model):
- _inherit = 'account.account'
+ _inherit = ['account.account']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/l10n_mx/models/account_tax.py b/addons/l10n_mx/models/account_tax.py
index fcc973bab9744..b909ecc279c44 100644
--- a/addons/l10n_mx/models/account_tax.py
+++ b/addons/l10n_mx/models/account_tax.py
@@ -3,7 +3,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_mx_factor_type = fields.Selection(
selection=[
diff --git a/addons/l10n_mx/models/res_bank.py b/addons/l10n_mx/models/res_bank.py
index 176502c184176..203b64628f3df 100644
--- a/addons/l10n_mx/models/res_bank.py
+++ b/addons/l10n_mx/models/res_bank.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class Bank(models.Model):
- _inherit = "res.bank"
+class ResBank(models.Model):
+ _inherit = ["res.bank"]
def _get_fiscal_country_codes(self):
return ','.join(self.env.companies.mapped('account_fiscal_country_id.code'))
@@ -18,7 +18,7 @@ def _get_fiscal_country_codes(self):
class ResPartnerBank(models.Model):
- _inherit = "res.partner.bank"
+ _inherit = ["res.partner.bank"]
def _get_fiscal_country_codes(self):
return ','.join(self.env.companies.mapped('account_fiscal_country_id.code'))
diff --git a/addons/l10n_mx/models/template_mx.py b/addons/l10n_mx/models/template_mx.py
index 034bd752bbf28..75f0e580b3426 100644
--- a/addons/l10n_mx/models/template_mx.py
+++ b/addons/l10n_mx/models/template_mx.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('mx')
def _get_mx_template_data(self):
diff --git a/addons/l10n_mx_hr/models/hr_employee.py b/addons/l10n_mx_hr/models/hr_employee.py
index 053e73aa9610a..c11989f0704d3 100644
--- a/addons/l10n_mx_hr/models/hr_employee.py
+++ b/addons/l10n_mx_hr/models/hr_employee.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class Employee(models.Model):
- _inherit = 'hr.employee'
+class HrEmployee(models.Model):
+ _inherit = ['hr.employee']
l10n_mx_curp = fields.Char('CURP', groups="hr.group_hr_user", tracking=True)
l10n_mx_rfc = fields.Char('RFC', groups="hr.group_hr_user", tracking=True)
diff --git a/addons/l10n_my/models/template_my.py b/addons/l10n_my/models/template_my.py
index ceee5fe64c079..ce8f110902277 100644
--- a/addons/l10n_my/models/template_my.py
+++ b/addons/l10n_my/models/template_my.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('my')
def _get_my_template_data(self):
diff --git a/addons/l10n_my_ubl_pint/models/account_edi_xml_pint_my.py b/addons/l10n_my_ubl_pint/models/account_edi_xml_pint_my.py
index 57beff3fb3796..ca4481b5bd141 100644
--- a/addons/l10n_my_ubl_pint/models/account_edi_xml_pint_my.py
+++ b/addons/l10n_my_ubl_pint/models/account_edi_xml_pint_my.py
@@ -3,9 +3,8 @@
from odoo import models, _
-class AccountEdiXmlUBLPINTMY(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = 'account.edi.xml.pint_my'
+class AccountEdiXmlPint_My(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "Malaysian implementation of Peppol International (PINT) model for Billing"
"""
* PINT Official documentation: https://docs.peppol.eu/poac/pint/pint/
diff --git a/addons/l10n_my_ubl_pint/models/res_company.py b/addons/l10n_my_ubl_pint/models/res_company.py
index 22cfa53db5d63..5f5f742a62620 100644
--- a/addons/l10n_my_ubl_pint/models/res_company.py
+++ b/addons/l10n_my_ubl_pint/models/res_company.py
@@ -3,14 +3,14 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
sst_registration_number = fields.Char(related='partner_id.sst_registration_number', readonly=False)
ttx_registration_number = fields.Char(related='partner_id.ttx_registration_number', readonly=False)
class BaseDocumentLayout(models.TransientModel):
- _inherit = 'base.document.layout'
+ _inherit = ['base.document.layout']
account_fiscal_country_id = fields.Many2one(related="company_id.account_fiscal_country_id")
sst_registration_number = fields.Char(related='company_id.sst_registration_number')
diff --git a/addons/l10n_my_ubl_pint/models/res_partner.py b/addons/l10n_my_ubl_pint/models/res_partner.py
index b0e1ee32a1890..72ef1f630d7d0 100644
--- a/addons/l10n_my_ubl_pint/models/res_partner.py
+++ b/addons/l10n_my_ubl_pint/models/res_partner.py
@@ -3,7 +3,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('pint_my', "PINT Malaysia")])
sst_registration_number = fields.Char(string="SST")
diff --git a/addons/l10n_mz/models/template_mz.py b/addons/l10n_mz/models/template_mz.py
index 00645231c8b51..d30126a7ec1c0 100644
--- a/addons/l10n_mz/models/template_mz.py
+++ b/addons/l10n_mz/models/template_mz.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('mz')
def _get_mz_template_data(self):
diff --git a/addons/l10n_ne/models/template_ne.py b/addons/l10n_ne/models/template_ne.py
index f1cc8af692e27..ce882e9c95830 100644
--- a/addons/l10n_ne/models/template_ne.py
+++ b/addons/l10n_ne/models/template_ne.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ne')
def _get_ne_template_data(self):
diff --git a/addons/l10n_ne/models/template_ne_syscebnl.py b/addons/l10n_ne/models/template_ne_syscebnl.py
index ca339dd3e4b1f..e65af2fddd3dc 100644
--- a/addons/l10n_ne/models/template_ne_syscebnl.py
+++ b/addons/l10n_ne/models/template_ne_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ne_syscebnl')
def _get_ne_syscebnl_template_data(self):
diff --git a/addons/l10n_ng/models/template_ng.py b/addons/l10n_ng/models/template_ng.py
index 67cb99bb37c6b..c5bd0174eeef1 100644
--- a/addons/l10n_ng/models/template_ng.py
+++ b/addons/l10n_ng/models/template_ng.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ng', 'account.account')
def _get_ng_account_account(self):
diff --git a/addons/l10n_nl/models/account_chart_template.py b/addons/l10n_nl/models/account_chart_template.py
index 37ec654fce4cc..f5a086b3fbd8e 100644
--- a/addons/l10n_nl/models/account_chart_template.py
+++ b/addons/l10n_nl/models/account_chart_template.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
def _post_load_data(self, template_code, company, template_data):
super()._post_load_data(template_code, company, template_data)
diff --git a/addons/l10n_nl/models/account_journal.py b/addons/l10n_nl/models/account_journal.py
index 05b0b51649c5e..32dfa3a7778e5 100644
--- a/addons/l10n_nl/models/account_journal.py
+++ b/addons/l10n_nl/models/account_journal.py
@@ -4,7 +4,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
@api.model
def _prepare_liquidity_account_vals(self, company, code, vals):
diff --git a/addons/l10n_nl/models/res_company.py b/addons/l10n_nl/models/res_company.py
index 0f3353747869b..6022838f09c03 100644
--- a/addons/l10n_nl/models/res_company.py
+++ b/addons/l10n_nl/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_nl_rounding_difference_loss_account_id = fields.Many2one('account.account', check_company=True)
l10n_nl_rounding_difference_profit_account_id = fields.Many2one('account.account', check_company=True)
diff --git a/addons/l10n_nl/models/template_nl.py b/addons/l10n_nl/models/template_nl.py
index 6098b875895dc..31e6b53386736 100644
--- a/addons/l10n_nl/models/template_nl.py
+++ b/addons/l10n_nl/models/template_nl.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('nl')
def _get_nl_template_data(self):
diff --git a/addons/l10n_no/models/account_journal.py b/addons/l10n_no/models/account_journal.py
index fd75a635dd9aa..dc9825406ceaf 100644
--- a/addons/l10n_no/models/account_journal.py
+++ b/addons/l10n_no/models/account_journal.py
@@ -5,7 +5,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
invoice_reference_model = fields.Selection(selection_add=[
('no', 'Norway')
diff --git a/addons/l10n_no/models/account_move.py b/addons/l10n_no/models/account_move.py
index f88cb3fd768d5..6791daa01f6e3 100644
--- a/addons/l10n_no/models/account_move.py
+++ b/addons/l10n_no/models/account_move.py
@@ -6,7 +6,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
def _get_invoice_reference_no_invoice(self):
""" This computes the reference based on the Odoo format.
diff --git a/addons/l10n_no/models/res_company.py b/addons/l10n_no/models/res_company.py
index 2a4cb99cf5860..a64d4d57b332a 100644
--- a/addons/l10n_no/models/res_company.py
+++ b/addons/l10n_no/models/res_company.py
@@ -3,6 +3,6 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_no_bronnoysund_number = fields.Char(related='partner_id.l10n_no_bronnoysund_number', readonly=False)
diff --git a/addons/l10n_no/models/res_partner.py b/addons/l10n_no/models/res_partner.py
index 059374b6c47b9..d36171aaf0c45 100644
--- a/addons/l10n_no/models/res_partner.py
+++ b/addons/l10n_no/models/res_partner.py
@@ -3,7 +3,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_no_bronnoysund_number = fields.Char(string='Register of Legal Entities (Brønnøysund Register Center)', size=9)
diff --git a/addons/l10n_no/models/template_no.py b/addons/l10n_no/models/template_no.py
index d6312c3453b40..bcb72e59dd6b2 100644
--- a/addons/l10n_no/models/template_no.py
+++ b/addons/l10n_no/models/template_no.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('no')
def _get_no_template_data(self):
diff --git a/addons/l10n_nz/models/account_move.py b/addons/l10n_nz/models/account_move.py
index 8011c349ed2bb..4236d2464930e 100644
--- a/addons/l10n_nz/models/account_move.py
+++ b/addons/l10n_nz/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _get_name_invoice_report(self):
# Safety mechanism to avoid issues if the module has not yet been updated.
diff --git a/addons/l10n_nz/models/account_payment.py b/addons/l10n_nz/models/account_payment.py
index ed9eab71f1a69..f64a16b4ebcd8 100644
--- a/addons/l10n_nz/models/account_payment.py
+++ b/addons/l10n_nz/models/account_payment.py
@@ -3,7 +3,7 @@
class AccountPayment(models.Model):
- _inherit = 'account.payment'
+ _inherit = ['account.payment']
@api.depends('country_code', 'partner_type')
def _compute_payment_receipt_title(self):
diff --git a/addons/l10n_nz/models/template_nz.py b/addons/l10n_nz/models/template_nz.py
index 5c81086264253..3f2d3406a4dd9 100644
--- a/addons/l10n_nz/models/template_nz.py
+++ b/addons/l10n_nz/models/template_nz.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('nz')
def _get_nz_template_data(self):
diff --git a/addons/l10n_pa/models/template_pa.py b/addons/l10n_pa/models/template_pa.py
index e172270d3e0c0..0038b72beacf3 100644
--- a/addons/l10n_pa/models/template_pa.py
+++ b/addons/l10n_pa/models/template_pa.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('pa')
def _get_pa_template_data(self):
diff --git a/addons/l10n_pe/demo/account_demo.py b/addons/l10n_pe/demo/account_demo.py
index f1a9f93248868..ee62da2e3a456 100644
--- a/addons/l10n_pe/demo/account_demo.py
+++ b/addons/l10n_pe/demo/account_demo.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@api.model
def _get_demo_data_move(self, company=False):
diff --git a/addons/l10n_pe/models/account_move.py b/addons/l10n_pe/models/account_move.py
index 85b0c070d3ea6..96f51681c4759 100644
--- a/addons/l10n_pe/models/account_move.py
+++ b/addons/l10n_pe/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
def _get_l10n_latam_documents_domain(self):
self.ensure_one()
diff --git a/addons/l10n_pe/models/account_tax.py b/addons/l10n_pe/models/account_tax.py
index 6027ddbdf98a4..879ab0809ffe1 100644
--- a/addons/l10n_pe/models/account_tax.py
+++ b/addons/l10n_pe/models/account_tax.py
@@ -3,7 +3,7 @@
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
l10n_pe_edi_tax_code = fields.Selection(
[
diff --git a/addons/l10n_pe/models/l10n_latam_identification_type.py b/addons/l10n_pe/models/l10n_latam_identification_type.py
index 447ef046cde4a..b7dbbeb1184c7 100644
--- a/addons/l10n_pe/models/l10n_latam_identification_type.py
+++ b/addons/l10n_pe/models/l10n_latam_identification_type.py
@@ -2,8 +2,8 @@
from odoo import models, fields
-class L10nLatamIdentificationType(models.Model):
+class L10n_LatamIdentificationType(models.Model):
- _inherit = "l10n_latam.identification.type"
+ _inherit = ["l10n_latam.identification.type"]
l10n_pe_vat_code = fields.Char()
diff --git a/addons/l10n_pe/models/res_bank.py b/addons/l10n_pe/models/res_bank.py
index 108dd7041568e..8ca2f18b401b8 100644
--- a/addons/l10n_pe/models/res_bank.py
+++ b/addons/l10n_pe/models/res_bank.py
@@ -2,7 +2,7 @@
class ResBank(models.Model):
- _inherit = 'res.bank'
+ _inherit = ['res.bank']
l10n_pe_edi_code = fields.Char(
'Code (PE)',
diff --git a/addons/l10n_pe/models/res_city.py b/addons/l10n_pe/models/res_city.py
index c9e653ae81b14..96a384f0e0949 100644
--- a/addons/l10n_pe/models/res_city.py
+++ b/addons/l10n_pe/models/res_city.py
@@ -2,8 +2,8 @@
from odoo import fields, models
-class City(models.Model):
- _inherit = "res.city"
+class ResCity(models.Model):
+ _inherit = ["res.city"]
l10n_pe_code = fields.Char('Code', help='This code will help with the '
'identification of each city in Peru.')
diff --git a/addons/l10n_pe/models/res_city_district.py b/addons/l10n_pe/models/res_city_district.py
index 52ae38c012da4..3e23c34f9a12c 100644
--- a/addons/l10n_pe/models/res_city_district.py
+++ b/addons/l10n_pe/models/res_city_district.py
@@ -2,8 +2,7 @@
from odoo import fields, models
-class L10nPeResCityDistrict(models.Model):
- _name = 'l10n_pe.res.city.district'
+class L10n_PeResCityDistrict(models.Model):
_description = 'District'
_order = 'name'
diff --git a/addons/l10n_pe/models/res_company.py b/addons/l10n_pe/models/res_company.py
index 000e8bed0ef9b..c5ccf0cc82fd1 100644
--- a/addons/l10n_pe/models/res_company.py
+++ b/addons/l10n_pe/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
def _localization_use_documents(self):
# OVERRIDE
diff --git a/addons/l10n_pe/models/res_partner.py b/addons/l10n_pe/models/res_partner.py
index 50a3fcbf94040..862fd6501cd1d 100644
--- a/addons/l10n_pe/models/res_partner.py
+++ b/addons/l10n_pe/models/res_partner.py
@@ -3,7 +3,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_pe_district = fields.Many2one(
'l10n_pe.res.city.district', string='District',
diff --git a/addons/l10n_pe/models/template_pe.py b/addons/l10n_pe/models/template_pe.py
index 084f2fdc0eb93..17cc19f29b564 100644
--- a/addons/l10n_pe/models/template_pe.py
+++ b/addons/l10n_pe/models/template_pe.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('pe')
def _get_pe_template_data(self):
diff --git a/addons/l10n_pe_pos/models/l10n_latam_identification_type.py b/addons/l10n_pe_pos/models/l10n_latam_identification_type.py
index 232d22a979827..7635a6eb5ab93 100644
--- a/addons/l10n_pe_pos/models/l10n_latam_identification_type.py
+++ b/addons/l10n_pe_pos/models/l10n_latam_identification_type.py
@@ -3,8 +3,7 @@
from odoo import models, api
-class L10nLatamIdentificationType(models.Model):
- _name = 'l10n_latam.identification.type'
+class L10n_LatamIdentificationType(models.Model):
_inherit = ['l10n_latam.identification.type', 'pos.load.mixin']
@api.model
diff --git a/addons/l10n_pe_pos/models/l10n_pe_res_city_district.py b/addons/l10n_pe_pos/models/l10n_pe_res_city_district.py
index e891c0fc3496b..aca3b07ce8f51 100644
--- a/addons/l10n_pe_pos/models/l10n_pe_res_city_district.py
+++ b/addons/l10n_pe_pos/models/l10n_pe_res_city_district.py
@@ -2,8 +2,7 @@
from odoo import fields, models, api
-class L10nPeResCityDistrict(models.Model):
- _name = "l10n_pe.res.city.district"
+class L10n_PeResCityDistrict(models.Model):
_inherit = ["l10n_pe.res.city.district", "pos.load.mixin"]
country_id = fields.Many2one(related="city_id.country_id")
diff --git a/addons/l10n_pe_pos/models/pos_config.py b/addons/l10n_pe_pos/models/pos_config.py
index ef5a61f5027d4..5412db6a32368 100644
--- a/addons/l10n_pe_pos/models/pos_config.py
+++ b/addons/l10n_pe_pos/models/pos_config.py
@@ -2,7 +2,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
def get_limited_partners_loading(self):
partner_ids = super().get_limited_partners_loading()
diff --git a/addons/l10n_pe_pos/models/pos_session.py b/addons/l10n_pe_pos/models/pos_session.py
index 88c6bdbceb55a..af6e5c99bf5b8 100644
--- a/addons/l10n_pe_pos/models/pos_session.py
+++ b/addons/l10n_pe_pos/models/pos_session.py
@@ -3,7 +3,7 @@
class PosSession(models.Model):
- _inherit = "pos.session"
+ _inherit = ["pos.session"]
@api.model
def _load_pos_data_models(self, config_id):
diff --git a/addons/l10n_pe_pos/models/res_city.py b/addons/l10n_pe_pos/models/res_city.py
index cf94135e1e1ae..5a7c669114f38 100644
--- a/addons/l10n_pe_pos/models/res_city.py
+++ b/addons/l10n_pe_pos/models/res_city.py
@@ -3,7 +3,6 @@
class ResCity(models.Model):
- _name = "res.city"
_inherit = ["res.city", "pos.load.mixin"]
@api.model
diff --git a/addons/l10n_pe_pos/models/res_partner.py b/addons/l10n_pe_pos/models/res_partner.py
index 88cecfc28e170..7b2cf88933ca0 100644
--- a/addons/l10n_pe_pos/models/res_partner.py
+++ b/addons/l10n_pe_pos/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
@api.ondelete(at_uninstall=False)
def _pe_unlink_except_master_data(self):
diff --git a/addons/l10n_pe_website_sale/models/website.py b/addons/l10n_pe_website_sale/models/website.py
index 1a28e3c8794d6..32e99df5b8191 100644
--- a/addons/l10n_pe_website_sale/models/website.py
+++ b/addons/l10n_pe_website_sale/models/website.py
@@ -4,7 +4,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def _display_partner_b2b_fields(self):
"""Peruvian localization must always display b2b fields"""
diff --git a/addons/l10n_ph/models/account_move.py b/addons/l10n_ph/models/account_move.py
index 4a435f738f4e6..aa56fa2f15144 100644
--- a/addons/l10n_ph/models/account_move.py
+++ b/addons/l10n_ph/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
def action_open_l10n_ph_2307_wizard(self):
vendor_bills = self.filtered_domain([('move_type', '=', 'in_invoice')])
diff --git a/addons/l10n_ph/models/account_payment.py b/addons/l10n_ph/models/account_payment.py
index 7af7c268b53ed..2f49f675eb636 100644
--- a/addons/l10n_ph/models/account_payment.py
+++ b/addons/l10n_ph/models/account_payment.py
@@ -5,7 +5,7 @@
class AccountPayment(models.Model):
- _inherit = "account.payment"
+ _inherit = ["account.payment"]
def action_open_l10n_ph_2307_wizard(self):
self.ensure_one()
diff --git a/addons/l10n_ph/models/account_tax.py b/addons/l10n_ph/models/account_tax.py
index cfe382a1af6ea..a74a1f71f42ea 100644
--- a/addons/l10n_ph/models/account_tax.py
+++ b/addons/l10n_ph/models/account_tax.py
@@ -4,6 +4,6 @@
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
l10n_ph_atc = fields.Char("Philippines ATC")
diff --git a/addons/l10n_ph/models/res_partner.py b/addons/l10n_ph/models/res_partner.py
index 0e1813cb26acc..7c28b20b6949c 100644
--- a/addons/l10n_ph/models/res_partner.py
+++ b/addons/l10n_ph/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
branch_code = fields.Char("Branch Code", default='000', compute='_compute_branch_code', store=True)
first_name = fields.Char("First Name")
diff --git a/addons/l10n_ph/models/template_ph.py b/addons/l10n_ph/models/template_ph.py
index 27cc62ae5d1cd..c4df1e3da29eb 100644
--- a/addons/l10n_ph/models/template_ph.py
+++ b/addons/l10n_ph/models/template_ph.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ph')
def _get_ph_template_data(self):
diff --git a/addons/l10n_ph/wizard/generate_2307_wizard.py b/addons/l10n_ph/wizard/generate_2307_wizard.py
index b2d3ab449eaa6..abbc31c36f935 100644
--- a/addons/l10n_ph/wizard/generate_2307_wizard.py
+++ b/addons/l10n_ph/wizard/generate_2307_wizard.py
@@ -6,8 +6,7 @@
from odoo.addons.l10n_ph import utils
-class Generate2307Wizard(models.TransientModel):
- _name = "l10n_ph_2307.wizard"
+class L10n_Ph_2307Wizard(models.TransientModel):
_description = "Exports 2307 data to a XLS file."
moves_to_export = fields.Many2many("account.move", string="Joural To Include")
diff --git a/addons/l10n_pk/models/template_pk.py b/addons/l10n_pk/models/template_pk.py
index 645d52721bdaa..ca2ff700c01ca 100644
--- a/addons/l10n_pk/models/template_pk.py
+++ b/addons/l10n_pk/models/template_pk.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('pk')
def _get_pk_template_data(self):
diff --git a/addons/l10n_pl/models/account_move.py b/addons/l10n_pl/models/account_move.py
index 87825d8fbfc29..8b3faac5ecfef 100644
--- a/addons/l10n_pl/models/account_move.py
+++ b/addons/l10n_pl/models/account_move.py
@@ -2,7 +2,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_pl_vat_b_spv = fields.Boolean(
string='B_SPV',
diff --git a/addons/l10n_pl/models/l10n_pl_tax_office.py b/addons/l10n_pl/models/l10n_pl_tax_office.py
index 94d754dcd4b11..eea35477998ed 100644
--- a/addons/l10n_pl/models/l10n_pl_tax_office.py
+++ b/addons/l10n_pl/models/l10n_pl_tax_office.py
@@ -1,8 +1,7 @@
from odoo import api, fields, models
-class TaxOffice(models.Model):
- _name = 'l10n_pl.l10n_pl_tax_office'
+class L10n_PlL10n_Pl_Tax_Office(models.Model):
_description = 'Tax Office in Poland'
_rec_names_search = ['name', 'code']
_order = 'code'
diff --git a/addons/l10n_pl/models/product.py b/addons/l10n_pl/models/product.py
index 9b156abb5cdc9..ec2a00782d7a4 100644
--- a/addons/l10n_pl/models/product.py
+++ b/addons/l10n_pl/models/product.py
@@ -2,7 +2,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
l10n_pl_vat_gtu = fields.Selection(
string='GTU Codes',
diff --git a/addons/l10n_pl/models/res_company.py b/addons/l10n_pl/models/res_company.py
index d4282f10d076d..92c07d73d3575 100644
--- a/addons/l10n_pl/models/res_company.py
+++ b/addons/l10n_pl/models/res_company.py
@@ -1,7 +1,7 @@
from odoo import fields, models
-class Company(models.Model):
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
l10n_pl_reports_tax_office_id = fields.Many2one('l10n_pl.l10n_pl_tax_office', string='Tax Office', groups="account.group_account_user")
diff --git a/addons/l10n_pl/models/res_config_settings.py b/addons/l10n_pl/models/res_config_settings.py
index 50b80c62bac6f..ea591d18a5978 100644
--- a/addons/l10n_pl/models/res_config_settings.py
+++ b/addons/l10n_pl/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_pl_reports_tax_office_id = fields.Many2one(related='company_id.l10n_pl_reports_tax_office_id', readonly=False)
diff --git a/addons/l10n_pl/models/res_partner.py b/addons/l10n_pl/models/res_partner.py
index ccec363e0b74f..b048d35b700b1 100644
--- a/addons/l10n_pl/models/res_partner.py
+++ b/addons/l10n_pl/models/res_partner.py
@@ -6,7 +6,7 @@
class ResPartner(models.Model):
"""Inherited to add the information needed for the JPK"""
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_pl_links_with_customer = fields.Boolean(
string='Links With Company',
diff --git a/addons/l10n_pl/models/template_pl.py b/addons/l10n_pl/models/template_pl.py
index e2a840e00e5b5..47e2bab447f6b 100644
--- a/addons/l10n_pl/models/template_pl.py
+++ b/addons/l10n_pl/models/template_pl.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('pl')
def _get_pl_template_data(self):
diff --git a/addons/l10n_pt/models/account_account.py b/addons/l10n_pt/models/account_account.py
index 59f2a4fa8c227..84836dd91065f 100644
--- a/addons/l10n_pt/models/account_account.py
+++ b/addons/l10n_pt/models/account_account.py
@@ -2,6 +2,6 @@
class AccountAccount(models.Model):
- _inherit = "account.account"
+ _inherit = ["account.account"]
l10n_pt_taxonomy_code = fields.Integer(string="Taxonomy code")
diff --git a/addons/l10n_pt/models/account_journal.py b/addons/l10n_pt/models/account_journal.py
index 5fefd099f7fff..91fd85c5220eb 100644
--- a/addons/l10n_pt/models/account_journal.py
+++ b/addons/l10n_pt/models/account_journal.py
@@ -2,7 +2,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
def _prepare_liquidity_account_vals(self, company, code, vals):
account_vals = super()._prepare_liquidity_account_vals(company, code, vals)
diff --git a/addons/l10n_pt/models/template_pt.py b/addons/l10n_pt/models/template_pt.py
index 6d4888de6b747..b46c573dba328 100644
--- a/addons/l10n_pt/models/template_pt.py
+++ b/addons/l10n_pt/models/template_pt.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('pt')
def _get_pt_template_data(self):
diff --git a/addons/l10n_qa/models/template_qa.py b/addons/l10n_qa/models/template_qa.py
index 32f4f4d9057ac..0586fb13e80ef 100644
--- a/addons/l10n_qa/models/template_qa.py
+++ b/addons/l10n_qa/models/template_qa.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('qa')
def _get_qa_template_data(self):
diff --git a/addons/l10n_ro/models/res_partner.py b/addons/l10n_ro/models/res_partner.py
index b991260a0d8ca..45fe758cfdfaa 100644
--- a/addons/l10n_ro/models/res_partner.py
+++ b/addons/l10n_ro/models/res_partner.py
@@ -11,7 +11,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
@api.model
def _commercial_fields(self):
diff --git a/addons/l10n_ro/models/template_ro.py b/addons/l10n_ro/models/template_ro.py
index 924e0e6f477e6..5e047a2d54edc 100644
--- a/addons/l10n_ro/models/template_ro.py
+++ b/addons/l10n_ro/models/template_ro.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ro')
def _get_ro_template_data(self):
diff --git a/addons/l10n_ro_edi/models/account_edi_xml_ubl_ciusro.py b/addons/l10n_ro_edi/models/account_edi_xml_ubl_ciusro.py
index e27a6dcd9744f..c3d199add2948 100644
--- a/addons/l10n_ro_edi/models/account_edi_xml_ubl_ciusro.py
+++ b/addons/l10n_ro_edi/models/account_edi_xml_ubl_ciusro.py
@@ -10,9 +10,8 @@ def get_formatted_sector_ro(city: str):
return city.upper().replace(' ', '')
-class AccountEdiXmlUBLRO(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = "account.edi.xml.ubl_ro"
+class AccountEdiXmlUbl_Ro(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "CIUS RO"
def _export_invoice_filename(self, invoice):
diff --git a/addons/l10n_ro_edi/models/account_move.py b/addons/l10n_ro_edi/models/account_move.py
index 41348728c7089..a512f5a3a2e88 100644
--- a/addons/l10n_ro_edi/models/account_move.py
+++ b/addons/l10n_ro_edi/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_ro_edi_document_ids = fields.One2many(
comodel_name='l10n_ro_edi.document',
diff --git a/addons/l10n_ro_edi/models/account_move_send.py b/addons/l10n_ro_edi/models/account_move_send.py
index fbd5957145d4a..ac4606b0f708c 100644
--- a/addons/l10n_ro_edi/models/account_move_send.py
+++ b/addons/l10n_ro_edi/models/account_move_send.py
@@ -2,7 +2,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
@api.model
def _is_ro_edi_applicable(self, move):
diff --git a/addons/l10n_ro_edi/models/ciusro_document.py b/addons/l10n_ro_edi/models/ciusro_document.py
index ca1db5853b4eb..5603436d62d98 100644
--- a/addons/l10n_ro_edi/models/ciusro_document.py
+++ b/addons/l10n_ro_edi/models/ciusro_document.py
@@ -45,8 +45,7 @@ def make_efactura_request(session, company, endpoint, method, params, data=None)
return {'content': response.content}
-class L10nRoEdiDocument(models.Model):
- _name = 'l10n_ro_edi.document'
+class L10n_Ro_EdiDocument(models.Model):
_description = "Document object for tracking CIUS-RO XML sent to E-Factura"
_order = 'datetime DESC, id DESC'
diff --git a/addons/l10n_ro_edi/models/res_company.py b/addons/l10n_ro_edi/models/res_company.py
index e1c6b42131bac..fc4f2384ed4e7 100644
--- a/addons/l10n_ro_edi/models/res_company.py
+++ b/addons/l10n_ro_edi/models/res_company.py
@@ -12,7 +12,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_ro_edi_client_id = fields.Char(string='Client ID')
l10n_ro_edi_client_secret = fields.Char(string='Client Secret')
diff --git a/addons/l10n_ro_edi/models/res_config_settings.py b/addons/l10n_ro_edi/models/res_config_settings.py
index 4f4c7bea87ecf..bf9d48effe243 100644
--- a/addons/l10n_ro_edi/models/res_config_settings.py
+++ b/addons/l10n_ro_edi/models/res_config_settings.py
@@ -2,7 +2,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_ro_edi_client_id = fields.Char(related='company_id.l10n_ro_edi_client_id', readonly=False)
l10n_ro_edi_client_secret = fields.Char(related='company_id.l10n_ro_edi_client_secret', readonly=False)
diff --git a/addons/l10n_ro_edi/models/res_partner.py b/addons/l10n_ro_edi/models/res_partner.py
index 3f07519a06366..19638a2195ee8 100644
--- a/addons/l10n_ro_edi/models/res_partner.py
+++ b/addons/l10n_ro_edi/models/res_partner.py
@@ -2,7 +2,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('ciusro', "CIUSRO")])
diff --git a/addons/l10n_ro_edi/wizard/account_move_send_wizard.py b/addons/l10n_ro_edi/wizard/account_move_send_wizard.py
index bb8842468baf6..37dbb7320dc9e 100644
--- a/addons/l10n_ro_edi/wizard/account_move_send_wizard.py
+++ b/addons/l10n_ro_edi/wizard/account_move_send_wizard.py
@@ -2,7 +2,7 @@
class AccountMoveSendWizard(models.TransientModel):
- _inherit = 'account.move.send.wizard'
+ _inherit = ['account.move.send.wizard']
def _compute_extra_edi_checkboxes(self):
super()._compute_extra_edi_checkboxes()
diff --git a/addons/l10n_rs/models/account_move.py b/addons/l10n_rs/models/account_move.py
index 651653ce74004..017f78076036d 100644
--- a/addons/l10n_rs/models/account_move.py
+++ b/addons/l10n_rs/models/account_move.py
@@ -5,6 +5,6 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_rs_turnover_date = fields.Date(string='Turnover Date')
diff --git a/addons/l10n_rs/models/template_rs.py b/addons/l10n_rs/models/template_rs.py
index 784f4446bd2d9..eeb408c1e79ae 100644
--- a/addons/l10n_rs/models/template_rs.py
+++ b/addons/l10n_rs/models/template_rs.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('rs')
def _get_rs_template_data(self):
diff --git a/addons/l10n_rw/models/template_rw.py b/addons/l10n_rw/models/template_rw.py
index 3641c209aa3c8..22608ad67d68b 100644
--- a/addons/l10n_rw/models/template_rw.py
+++ b/addons/l10n_rw/models/template_rw.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('rw')
def _get_rw_template_data(self):
diff --git a/addons/l10n_sa/models/account_move.py b/addons/l10n_sa/models/account_move.py
index 149f20fb65ff1..cf0deb9b5452b 100644
--- a/addons/l10n_sa/models/account_move.py
+++ b/addons/l10n_sa/models/account_move.py
@@ -8,7 +8,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_sa_qr_code_str = fields.Char(string='Zatka QR Code', compute='_compute_qr_code_str')
l10n_sa_confirmation_datetime = fields.Datetime(string='Confirmation Date', readonly=True, copy=False)
diff --git a/addons/l10n_sa/models/template_sa.py b/addons/l10n_sa/models/template_sa.py
index 23a70e0b3e5f8..99cb6238162fa 100644
--- a/addons/l10n_sa/models/template_sa.py
+++ b/addons/l10n_sa/models/template_sa.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('sa')
def _get_sa_template_data(self):
diff --git a/addons/l10n_sa_edi/models/account_edi_document.py b/addons/l10n_sa_edi/models/account_edi_document.py
index 9858f394861c0..84e8b947d8a95 100644
--- a/addons/l10n_sa_edi/models/account_edi_document.py
+++ b/addons/l10n_sa_edi/models/account_edi_document.py
@@ -6,7 +6,7 @@
class AccountEdiDocument(models.Model):
- _inherit = 'account.edi.document'
+ _inherit = ['account.edi.document']
def _prepare_jobs(self):
"""
diff --git a/addons/l10n_sa_edi/models/account_edi_format.py b/addons/l10n_sa_edi/models/account_edi_format.py
index 2ec6778dde2fe..5d3a4275e0069 100644
--- a/addons/l10n_sa_edi/models/account_edi_format.py
+++ b/addons/l10n_sa_edi/models/account_edi_format.py
@@ -9,7 +9,7 @@
class AccountEdiFormat(models.Model):
- _inherit = 'account.edi.format'
+ _inherit = ['account.edi.format']
"""
Once the journal has been successfully onboarded, we can clear/report invoices through the ZATCA API:
diff --git a/addons/l10n_sa_edi/models/account_edi_xml_ubl_21_zatca.py b/addons/l10n_sa_edi/models/account_edi_xml_ubl_21_zatca.py
index 3026d5d72f552..95ed79f1b6968 100644
--- a/addons/l10n_sa_edi/models/account_edi_xml_ubl_21_zatca.py
+++ b/addons/l10n_sa_edi/models/account_edi_xml_ubl_21_zatca.py
@@ -19,9 +19,8 @@
}
-class AccountEdiXmlUBL21Zatca(models.AbstractModel):
- _name = "account.edi.xml.ubl_21.zatca"
- _inherit = 'account.edi.xml.ubl_21'
+class AccountEdiXmlUbl_21Zatca(models.AbstractModel):
+ _inherit = ['account.edi.xml.ubl_21']
_description = "UBL 2.1 (ZATCA)"
def _l10n_sa_get_namespaces(self):
diff --git a/addons/l10n_sa_edi/models/account_journal.py b/addons/l10n_sa_edi/models/account_journal.py
index 3c56f42dbb2d8..3ba173ddca694 100644
--- a/addons/l10n_sa_edi/models/account_journal.py
+++ b/addons/l10n_sa_edi/models/account_journal.py
@@ -33,7 +33,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
"""
In order to clear/report an invoice through the ZATCA API, we need to onboard each journal by following
diff --git a/addons/l10n_sa_edi/models/account_move.py b/addons/l10n_sa_edi/models/account_move.py
index b123f9f5a2af4..eb680cd11a80b 100644
--- a/addons/l10n_sa_edi/models/account_move.py
+++ b/addons/l10n_sa_edi/models/account_move.py
@@ -9,7 +9,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_sa_uuid = fields.Char(string='Document UUID (SA)', copy=False, help="Universally unique identifier of the Invoice")
@@ -206,7 +206,7 @@ def _l10n_sa_is_in_chain(self):
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _apply_retention_tax_filter(self, tax_values):
return not tax_values['tax_id'].l10n_sa_is_retention
diff --git a/addons/l10n_sa_edi/models/account_tax.py b/addons/l10n_sa_edi/models/account_tax.py
index 53f9c448d8a09..ed3135aa225df 100644
--- a/addons/l10n_sa_edi/models/account_tax.py
+++ b/addons/l10n_sa_edi/models/account_tax.py
@@ -22,7 +22,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
l10n_sa_is_retention = fields.Boolean("Is Retention", default=False,
help="Determines whether or not a tax counts as a Withholding Tax")
diff --git a/addons/l10n_sa_edi/models/certificate.py b/addons/l10n_sa_edi/models/certificate.py
index 825c400960570..db7f29ba575a8 100644
--- a/addons/l10n_sa_edi/models/certificate.py
+++ b/addons/l10n_sa_edi/models/certificate.py
@@ -14,8 +14,8 @@
}
-class Certificate(models.Model):
- _inherit = 'certificate.certificate'
+class CertificateCertificate(models.Model):
+ _inherit = ['certificate.certificate']
def _l10n_sa_get_issuer_name(self):
self.ensure_one()
diff --git a/addons/l10n_sa_edi/models/res_company.py b/addons/l10n_sa_edi/models/res_company.py
index 6e76e9862142d..3d904990d531d 100644
--- a/addons/l10n_sa_edi/models/res_company.py
+++ b/addons/l10n_sa_edi/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
l10n_sa_private_key_id = fields.Many2one(string="ZATCA Private key", comodel_name='certificate.key', copy=False, domain=[('public', '=', False)],
help="The private key used to generate the CSR and obtain certificates",)
diff --git a/addons/l10n_sa_edi/models/res_config_settings.py b/addons/l10n_sa_edi/models/res_config_settings.py
index 6e7473169b303..63db48543e706 100644
--- a/addons/l10n_sa_edi/models/res_config_settings.py
+++ b/addons/l10n_sa_edi/models/res_config_settings.py
@@ -2,7 +2,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_sa_api_mode = fields.Selection(related='company_id.l10n_sa_api_mode', readonly=False)
diff --git a/addons/l10n_sa_edi/models/res_partner.py b/addons/l10n_sa_edi/models/res_partner.py
index c49d5bda4b1f0..88a5e27f28863 100644
--- a/addons/l10n_sa_edi/models/res_partner.py
+++ b/addons/l10n_sa_edi/models/res_partner.py
@@ -2,7 +2,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_sa_edi_building_number = fields.Char("Building Number")
l10n_sa_edi_plot_identification = fields.Char("Plot Identification")
diff --git a/addons/l10n_sa_edi/wizard/account_debit_note.py b/addons/l10n_sa_edi/wizard/account_debit_note.py
index f3f7b87750b3e..583fe50c6ab3c 100644
--- a/addons/l10n_sa_edi/wizard/account_debit_note.py
+++ b/addons/l10n_sa_edi/wizard/account_debit_note.py
@@ -5,7 +5,7 @@
class AccountDebitNote(models.TransientModel):
- _inherit = 'account.debit.note'
+ _inherit = ['account.debit.note']
def create_debit(self):
self.ensure_one()
diff --git a/addons/l10n_sa_edi/wizard/account_move_reversal.py b/addons/l10n_sa_edi/wizard/account_move_reversal.py
index 6bd2f82f102e2..c44e3b15b5d1d 100644
--- a/addons/l10n_sa_edi/wizard/account_move_reversal.py
+++ b/addons/l10n_sa_edi/wizard/account_move_reversal.py
@@ -5,7 +5,7 @@
class AccountMoveReversal(models.TransientModel):
- _inherit = 'account.move.reversal'
+ _inherit = ['account.move.reversal']
def reverse_moves(self, is_modify=False):
self.ensure_one()
diff --git a/addons/l10n_sa_edi/wizard/l10n_sa_edi_otp_wizard.py b/addons/l10n_sa_edi/wizard/l10n_sa_edi_otp_wizard.py
index b4dbda3d9eed3..f40a107543344 100644
--- a/addons/l10n_sa_edi/wizard/l10n_sa_edi_otp_wizard.py
+++ b/addons/l10n_sa_edi/wizard/l10n_sa_edi_otp_wizard.py
@@ -2,8 +2,7 @@
from odoo.exceptions import UserError
-class RequestZATCAOtp(models.TransientModel):
- _name = 'l10n_sa_edi.otp.wizard'
+class L10n_Sa_EdiOtpWizard(models.TransientModel):
_description = 'Request ZATCA OTP'
l10n_sa_renewal = fields.Boolean("PCSID Renewal",
diff --git a/addons/l10n_sa_pos/models/pos_config.py b/addons/l10n_sa_pos/models/pos_config.py
index 7892ebfde9e78..71d487fb9b6f2 100644
--- a/addons/l10n_sa_pos/models/pos_config.py
+++ b/addons/l10n_sa_pos/models/pos_config.py
@@ -5,11 +5,11 @@
from odoo.tools.translate import _
-class pos_config(models.Model):
- _inherit = 'pos.config'
+class PosConfig(models.Model):
+ _inherit = ['pos.config']
def open_ui(self):
for config in self:
if not config.company_id.country_id:
raise UserError(_("You have to set a country in your company setting."))
- return super(pos_config, self).open_ui()
+ return super().open_ui()
diff --git a/addons/l10n_sa_pos/models/pos_order.py b/addons/l10n_sa_pos/models/pos_order.py
index 8ee5e34296349..a3d38be18ac76 100644
--- a/addons/l10n_sa_pos/models/pos_order.py
+++ b/addons/l10n_sa_pos/models/pos_order.py
@@ -4,8 +4,8 @@
from odoo import models
-class POSOrder(models.Model):
- _inherit = 'pos.order'
+class PosOrder(models.Model):
+ _inherit = ['pos.order']
def _prepare_invoice_vals(self):
vals = super()._prepare_invoice_vals()
diff --git a/addons/l10n_se/models/account_journal.py b/addons/l10n_se/models/account_journal.py
index 074104b7394b5..563cb3a52b022 100644
--- a/addons/l10n_se/models/account_journal.py
+++ b/addons/l10n_se/models/account_journal.py
@@ -6,7 +6,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
invoice_reference_model = fields.Selection(selection_add=[('se_ocr2', 'Sweden OCR Level 1 & 2'), ('se_ocr3', 'Sweden OCR Level 3'), ('se_ocr4', 'Sweden OCR Level 4')], ondelete={'se_ocr2': 'set default', 'se_ocr3': 'set default', 'se_ocr4': 'set default'})
l10n_se_invoice_ocr_length = fields.Integer(string='OCR Number Length', help="Total length of OCR Reference Number including checksum.", default=6)
diff --git a/addons/l10n_se/models/account_move.py b/addons/l10n_se/models/account_move.py
index ae7c2e687aa69..2c88668b81c66 100644
--- a/addons/l10n_se/models/account_move.py
+++ b/addons/l10n_se/models/account_move.py
@@ -7,7 +7,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _get_invoice_reference_se_ocr2(self, reference):
self.ensure_one()
diff --git a/addons/l10n_se/models/res_company.py b/addons/l10n_se/models/res_company.py
index 1768f3cd8fe49..f853a57cc2f0a 100644
--- a/addons/l10n_se/models/res_company.py
+++ b/addons/l10n_se/models/res_company.py
@@ -6,7 +6,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
org_number = fields.Char(compute='_compute_org_number')
diff --git a/addons/l10n_se/models/res_partner.py b/addons/l10n_se/models/res_partner.py
index e42b3f1e4bdad..dcd7b8b81e148 100644
--- a/addons/l10n_se/models/res_partner.py
+++ b/addons/l10n_se/models/res_partner.py
@@ -6,7 +6,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_se_check_vendor_ocr = fields.Boolean(string='Check Vendor OCR', help='This Vendor uses OCR Number on their Vendor Bills.')
l10n_se_default_vendor_payment_ref = fields.Char(string='Default Vendor Payment Ref', help='If set, the vendor uses the same Default Payment Reference or OCR Number on all their Vendor Bills.')
diff --git a/addons/l10n_se/models/template_se.py b/addons/l10n_se/models/template_se.py
index 24ebc95aeb68e..3f17bfe9488de 100644
--- a/addons/l10n_se/models/template_se.py
+++ b/addons/l10n_se/models/template_se.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('se')
def _get_se_template_data(self):
diff --git a/addons/l10n_se/models/template_se_K2.py b/addons/l10n_se/models/template_se_K2.py
index d54ebedbbd5fe..b38a6435628aa 100644
--- a/addons/l10n_se/models/template_se_K2.py
+++ b/addons/l10n_se/models/template_se_K2.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('se_K2')
def _get_se_K2_template_data(self):
diff --git a/addons/l10n_se/models/template_se_K3.py b/addons/l10n_se/models/template_se_K3.py
index 2667e063a7bb7..7353b35e9b427 100644
--- a/addons/l10n_se/models/template_se_K3.py
+++ b/addons/l10n_se/models/template_se_K3.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('se_K3')
def _get_se_K3_template_data(self):
diff --git a/addons/l10n_sg/models/account_move.py b/addons/l10n_sg/models/account_move.py
index 9168e75bb7d59..ab1a880221818 100644
--- a/addons/l10n_sg/models/account_move.py
+++ b/addons/l10n_sg/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_sg_permit_number = fields.Char(string="Permit No.")
diff --git a/addons/l10n_sg/models/res_bank.py b/addons/l10n_sg/models/res_bank.py
index b81696d49c14f..07ae13b4357e1 100644
--- a/addons/l10n_sg/models/res_bank.py
+++ b/addons/l10n_sg/models/res_bank.py
@@ -5,7 +5,7 @@
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
proxy_type = fields.Selection(selection_add=[('mobile', 'Mobile Number'), ('uen', 'UEN')],
ondelete={'mobile': 'set default', 'uen': 'set default'})
diff --git a/addons/l10n_sg/models/res_company.py b/addons/l10n_sg/models/res_company.py
index e2759bde9f134..98bac9b737d04 100644
--- a/addons/l10n_sg/models/res_company.py
+++ b/addons/l10n_sg/models/res_company.py
@@ -2,10 +2,10 @@
from odoo import fields, models
+
class ResCompany(models.Model):
- _name = 'res.company'
_description = 'Companies'
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_sg_unique_entity_number = fields.Char(string='UEN', related="partner_id.l10n_sg_unique_entity_number", readonly=False)
diff --git a/addons/l10n_sg/models/res_partner.py b/addons/l10n_sg/models/res_partner.py
index 086824bbf2095..daa5be14a7eac 100644
--- a/addons/l10n_sg/models/res_partner.py
+++ b/addons/l10n_sg/models/res_partner.py
@@ -2,9 +2,9 @@
from odoo import fields, models
+
class ResPartner(models.Model):
- _name = 'res.partner'
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
l10n_sg_unique_entity_number = fields.Char(string='UEN')
diff --git a/addons/l10n_sg/models/template_sg.py b/addons/l10n_sg/models/template_sg.py
index cb48413cdc000..c4ac946d2bb30 100644
--- a/addons/l10n_sg/models/template_sg.py
+++ b/addons/l10n_sg/models/template_sg.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('sg')
def _get_sg_template_data(self):
diff --git a/addons/l10n_sg_ubl_pint/models/account_edi_xml_pint_sg.py b/addons/l10n_sg_ubl_pint/models/account_edi_xml_pint_sg.py
index 5237f1834a029..e38c82b3a53c6 100644
--- a/addons/l10n_sg_ubl_pint/models/account_edi_xml_pint_sg.py
+++ b/addons/l10n_sg_ubl_pint/models/account_edi_xml_pint_sg.py
@@ -6,9 +6,8 @@
SG_TAX_CATEGORIES = {'SR', 'SRCA-S', 'SRCA-C', 'SROVR-RS', 'SROVR-LVG', 'SRLVG', 'ZR', 'ES33', 'ESN33', 'DS', 'OS', 'NG', 'NA'}
-class AccountEdiXmlUBLPINTSG(models.AbstractModel):
- _inherit = "account.edi.xml.ubl_bis3"
- _name = 'account.edi.xml.pint_sg'
+class AccountEdiXmlPint_Sg(models.AbstractModel):
+ _inherit = ["account.edi.xml.ubl_bis3"]
_description = "Singapore implementation of Peppol International (PINT) model for Billing"
"""
Pint is a standard for International Billing from Peppol. It is based on Peppol BIS Billing 3.
diff --git a/addons/l10n_sg_ubl_pint/models/account_move.py b/addons/l10n_sg_ubl_pint/models/account_move.py
index 16101a3c48fa1..3e2480bb67bc5 100644
--- a/addons/l10n_sg_ubl_pint/models/account_move.py
+++ b/addons/l10n_sg_ubl_pint/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _l10n_sg_get_uuid(self):
""" SG Pint requires us to generate a uuid, to avoid storing a new field on the move,
diff --git a/addons/l10n_sg_ubl_pint/models/account_tax.py b/addons/l10n_sg_ubl_pint/models/account_tax.py
index fd607b3defc48..52b889833f4a4 100644
--- a/addons/l10n_sg_ubl_pint/models/account_tax.py
+++ b/addons/l10n_sg_ubl_pint/models/account_tax.py
@@ -3,7 +3,7 @@
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
# The classification is too precise to be able to do any kind of guessing, so we need it set.
# See https://docs.peppol.eu/poac/sg/2024-Q2/pint-sg/bis/#_goods_and_services_tax_gst
diff --git a/addons/l10n_sg_ubl_pint/models/res_partner.py b/addons/l10n_sg_ubl_pint/models/res_partner.py
index 7a144a1937118..c797cd3573cc6 100644
--- a/addons/l10n_sg_ubl_pint/models/res_partner.py
+++ b/addons/l10n_sg_ubl_pint/models/res_partner.py
@@ -3,7 +3,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('pint_sg', "PINT Singapore")])
diff --git a/addons/l10n_si/models/template_si.py b/addons/l10n_si/models/template_si.py
index f27a864e02671..a36999964eccb 100644
--- a/addons/l10n_si/models/template_si.py
+++ b/addons/l10n_si/models/template_si.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('si')
def _get_si_template_data(self):
diff --git a/addons/l10n_sk/models/account_move.py b/addons/l10n_sk/models/account_move.py
index 8f633aa476b36..453d14c0b1130 100644
--- a/addons/l10n_sk/models/account_move.py
+++ b/addons/l10n_sk/models/account_move.py
@@ -3,6 +3,6 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
taxable_supply_date = fields.Date()
diff --git a/addons/l10n_sk/models/res_company.py b/addons/l10n_sk/models/res_company.py
index b2d5cc2b50aa9..d87b8fc5d6864 100644
--- a/addons/l10n_sk/models/res_company.py
+++ b/addons/l10n_sk/models/res_company.py
@@ -4,14 +4,14 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
trade_registry = fields.Char()
income_tax_id = fields.Char(string="Income Tax ID")
class BaseDocumentLayout(models.TransientModel):
- _inherit = 'base.document.layout'
+ _inherit = ['base.document.layout']
account_fiscal_country_id = fields.Many2one(related="company_id.account_fiscal_country_id")
company_registry = fields.Char(related='company_id.company_registry')
diff --git a/addons/l10n_sk/models/template_sk.py b/addons/l10n_sk/models/template_sk.py
index bc9d2fa323b40..8a2145fa47f28 100644
--- a/addons/l10n_sk/models/template_sk.py
+++ b/addons/l10n_sk/models/template_sk.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('sk')
def _get_sk_template_data(self):
diff --git a/addons/l10n_sn/models/template_sn.py b/addons/l10n_sn/models/template_sn.py
index 25601ffd16c08..fd2e6b8525347 100644
--- a/addons/l10n_sn/models/template_sn.py
+++ b/addons/l10n_sn/models/template_sn.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('sn')
def _get_sn_template_data(self):
diff --git a/addons/l10n_sn/models/template_sn_syscebnl.py b/addons/l10n_sn/models/template_sn_syscebnl.py
index 9686ed5abc340..496d73b9901ad 100644
--- a/addons/l10n_sn/models/template_sn_syscebnl.py
+++ b/addons/l10n_sn/models/template_sn_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('sn_syscebnl')
def _get_sn_syscebnl_template_data(self):
diff --git a/addons/l10n_syscohada/models/template_syscebnl.py b/addons/l10n_syscohada/models/template_syscebnl.py
index 47734482150f0..ee0fd13321ef8 100644
--- a/addons/l10n_syscohada/models/template_syscebnl.py
+++ b/addons/l10n_syscohada/models/template_syscebnl.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('syscebnl')
def _get_syscebnl_template_data(self):
diff --git a/addons/l10n_syscohada/models/template_syscohada.py b/addons/l10n_syscohada/models/template_syscohada.py
index 100ef7f149d52..b381a3a397d2e 100644
--- a/addons/l10n_syscohada/models/template_syscohada.py
+++ b/addons/l10n_syscohada/models/template_syscohada.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('syscohada')
def _get_syscohada_template_data(self):
diff --git a/addons/l10n_td/models/template_td.py b/addons/l10n_td/models/template_td.py
index 2451d7edbb27c..87acd7346269e 100644
--- a/addons/l10n_td/models/template_td.py
+++ b/addons/l10n_td/models/template_td.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('td')
def _get_td_template_data(self):
diff --git a/addons/l10n_td/models/template_td_syscebnl.py b/addons/l10n_td/models/template_td_syscebnl.py
index 3b4138eb07b8f..1339c87ac78e2 100644
--- a/addons/l10n_td/models/template_td_syscebnl.py
+++ b/addons/l10n_td/models/template_td_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('td_syscebnl')
def _get_td_syscebnl_template_data(self):
diff --git a/addons/l10n_tg/models/template_tg.py b/addons/l10n_tg/models/template_tg.py
index 97a151c913169..b5c585c457c53 100644
--- a/addons/l10n_tg/models/template_tg.py
+++ b/addons/l10n_tg/models/template_tg.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('tg')
def _get_tg_template_data(self):
diff --git a/addons/l10n_tg/models/template_tg_syscebnl.py b/addons/l10n_tg/models/template_tg_syscebnl.py
index e7ef91eed24e8..21204b7dce17e 100644
--- a/addons/l10n_tg/models/template_tg_syscebnl.py
+++ b/addons/l10n_tg/models/template_tg_syscebnl.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('tg_syscebnl')
def _get_tg_template_data(self):
diff --git a/addons/l10n_th/models/account_move.py b/addons/l10n_th/models/account_move.py
index 6b7bf09bf819c..d20e031b711ca 100644
--- a/addons/l10n_th/models/account_move.py
+++ b/addons/l10n_th/models/account_move.py
@@ -1,7 +1,8 @@
from odoo import models
+
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
def _get_name_invoice_report(self):
self.ensure_one()
diff --git a/addons/l10n_th/models/ir_actions_report.py b/addons/l10n_th/models/ir_actions_report.py
index c943eda6e3ec8..a9d78efdd6980 100644
--- a/addons/l10n_th/models/ir_actions_report.py
+++ b/addons/l10n_th/models/ir_actions_report.py
@@ -3,7 +3,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
def _pre_render_qweb_pdf(self, report_ref, res_ids=None, data=None):
# Check for reports only available for invoices.
diff --git a/addons/l10n_th/models/res_bank.py b/addons/l10n_th/models/res_bank.py
index 8f1845daff833..282a6612d7cab 100644
--- a/addons/l10n_th/models/res_bank.py
+++ b/addons/l10n_th/models/res_bank.py
@@ -6,7 +6,7 @@
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
proxy_type = fields.Selection(selection_add=[('ewallet_id', 'Ewallet ID'),
('merchant_tax_id', 'Merchant Tax ID'),
diff --git a/addons/l10n_th/models/res_partner.py b/addons/l10n_th/models/res_partner.py
index 929f81f5b93a8..bd9f303bfad6a 100644
--- a/addons/l10n_th/models/res_partner.py
+++ b/addons/l10n_th/models/res_partner.py
@@ -2,8 +2,9 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
+
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
l10n_th_branch_name = fields.Char(compute="_compute_l10n_th_branch_name")
diff --git a/addons/l10n_th/models/template_th.py b/addons/l10n_th/models/template_th.py
index 6efb707ee83d1..292ddf4869e72 100644
--- a/addons/l10n_th/models/template_th.py
+++ b/addons/l10n_th/models/template_th.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('th')
def _get_th_template_data(self):
diff --git a/addons/l10n_tn/models/template_tn.py b/addons/l10n_tn/models/template_tn.py
index 31c2b1bde9e63..c7481d335f768 100644
--- a/addons/l10n_tn/models/template_tn.py
+++ b/addons/l10n_tn/models/template_tn.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('tn')
def _get_tn_template_data(self):
diff --git a/addons/l10n_tr/models/account_journal.py b/addons/l10n_tr/models/account_journal.py
index 3dbc2c8a48561..310d764118554 100644
--- a/addons/l10n_tr/models/account_journal.py
+++ b/addons/l10n_tr/models/account_journal.py
@@ -2,7 +2,7 @@
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
l10n_tr_default_sales_return_account_id = fields.Many2one(
comodel_name='account.account',
diff --git a/addons/l10n_tr/models/account_move_line.py b/addons/l10n_tr/models/account_move_line.py
index d32706413f391..c872e5901f921 100644
--- a/addons/l10n_tr/models/account_move_line.py
+++ b/addons/l10n_tr/models/account_move_line.py
@@ -2,7 +2,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _compute_account_id(self):
# OVERRIDE
diff --git a/addons/l10n_tr/models/product.py b/addons/l10n_tr/models/product.py
index 49977f1423476..1d1fe81b69aa5 100644
--- a/addons/l10n_tr/models/product.py
+++ b/addons/l10n_tr/models/product.py
@@ -2,7 +2,7 @@
class ProductTemplate(models.Model):
- _inherit = "product.template"
+ _inherit = ["product.template"]
l10n_tr_default_sales_return_account_id = fields.Many2one(
comodel_name="account.account",
diff --git a/addons/l10n_tr/models/template_tr.py b/addons/l10n_tr/models/template_tr.py
index 0a08210555761..16b418e05f5a6 100644
--- a/addons/l10n_tr/models/template_tr.py
+++ b/addons/l10n_tr/models/template_tr.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('tr')
def _get_tr_template_data(self):
diff --git a/addons/l10n_tw/models/template_tw.py b/addons/l10n_tw/models/template_tw.py
index 28db14aa3a544..7526b96d6d063 100644
--- a/addons/l10n_tw/models/template_tw.py
+++ b/addons/l10n_tw/models/template_tw.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('tw')
def _get_tw_template_data(self):
diff --git a/addons/l10n_tz_account/models/template_tz.py b/addons/l10n_tz_account/models/template_tz.py
index aadf766fda5a3..a8f16131bb052 100644
--- a/addons/l10n_tz_account/models/template_tz.py
+++ b/addons/l10n_tz_account/models/template_tz.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('tz')
def _get_tz_template_data(self):
diff --git a/addons/l10n_ua/models/template_ua_psbo.py b/addons/l10n_ua/models/template_ua_psbo.py
index 89a550ef30c25..45c4694a4a502 100644
--- a/addons/l10n_ua/models/template_ua_psbo.py
+++ b/addons/l10n_ua/models/template_ua_psbo.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ua_psbo')
def _get_ua_psbo_template_data(self):
diff --git a/addons/l10n_ug/models/template_ug.py b/addons/l10n_ug/models/template_ug.py
index dcc90db905f97..ba02998bd0e5c 100644
--- a/addons/l10n_ug/models/template_ug.py
+++ b/addons/l10n_ug/models/template_ug.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@template('ug')
def _get_ug_template_data(self):
diff --git a/addons/l10n_uk/models/template_uk.py b/addons/l10n_uk/models/template_uk.py
index 7400d47e4b3f6..93781e4df5d2a 100644
--- a/addons/l10n_uk/models/template_uk.py
+++ b/addons/l10n_uk/models/template_uk.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('uk')
def _get_uk_template_data(self):
diff --git a/addons/l10n_us/models/res_partner_bank.py b/addons/l10n_us/models/res_partner_bank.py
index c46e0d6341e0c..64f96431145ba 100644
--- a/addons/l10n_us/models/res_partner_bank.py
+++ b/addons/l10n_us/models/res_partner_bank.py
@@ -7,7 +7,7 @@
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
aba_routing = fields.Char(string="ABA/Routing", help="American Bankers Association Routing Number")
diff --git a/addons/l10n_uy/demo/account_demo.py b/addons/l10n_uy/demo/account_demo.py
index 84b78f4cb724e..e239311a680ca 100644
--- a/addons/l10n_uy/demo/account_demo.py
+++ b/addons/l10n_uy/demo/account_demo.py
@@ -9,7 +9,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@api.model
def _get_demo_data(self, company=False):
diff --git a/addons/l10n_uy/models/account_move.py b/addons/l10n_uy/models/account_move.py
index bf1ffdf6dbfec..1e4d209223d0f 100644
--- a/addons/l10n_uy/models/account_move.py
+++ b/addons/l10n_uy/models/account_move.py
@@ -14,7 +14,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _get_starting_sequence(self):
""" If use documents then will create a new starting sequence using the document type code prefix and the
diff --git a/addons/l10n_uy/models/account_tax.py b/addons/l10n_uy/models/account_tax.py
index 8dbf33fe2081f..f9d66a85be33a 100644
--- a/addons/l10n_uy/models/account_tax.py
+++ b/addons/l10n_uy/models/account_tax.py
@@ -4,7 +4,7 @@
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
l10n_uy_tax_category = fields.Selection([
('vat', 'VAT'),
diff --git a/addons/l10n_uy/models/l10n_latam_document_type.py b/addons/l10n_uy/models/l10n_latam_document_type.py
index c6fc6c4bfb46d..fe7a4a02e7030 100644
--- a/addons/l10n_uy/models/l10n_latam_document_type.py
+++ b/addons/l10n_uy/models/l10n_latam_document_type.py
@@ -4,9 +4,9 @@
import re
-class L10nAccountDocumentType(models.Model):
+class L10n_LatamDocumentType(models.Model):
- _inherit = 'l10n_latam.document.type'
+ _inherit = ['l10n_latam.document.type']
def _format_document_number(self, document_number):
""" format and validate the document_number"""
diff --git a/addons/l10n_uy/models/l10n_latam_identification_type.py b/addons/l10n_uy/models/l10n_latam_identification_type.py
index 0b7eb920bf0eb..19241a2b08410 100644
--- a/addons/l10n_uy/models/l10n_latam_identification_type.py
+++ b/addons/l10n_uy/models/l10n_latam_identification_type.py
@@ -2,8 +2,8 @@
from odoo import models, fields
-class L10nLatamIdentificationType(models.Model):
+class L10n_LatamIdentificationType(models.Model):
- _inherit = "l10n_latam.identification.type"
+ _inherit = ["l10n_latam.identification.type"]
l10n_uy_dgi_code = fields.Char('DGI Code')
diff --git a/addons/l10n_uy/models/res_company.py b/addons/l10n_uy/models/res_company.py
index fd34280e39ecb..abb37ae7d0015 100644
--- a/addons/l10n_uy/models/res_company.py
+++ b/addons/l10n_uy/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
def _localization_use_documents(self):
""" Uruguayan localization use documents """
diff --git a/addons/l10n_uy/models/res_partner.py b/addons/l10n_uy/models/res_partner.py
index 17c0d604e1329..1f95dbd846f01 100644
--- a/addons/l10n_uy/models/res_partner.py
+++ b/addons/l10n_uy/models/res_partner.py
@@ -9,7 +9,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
@api.constrains("vat", "l10n_latam_identification_type_id")
def check_vat(self):
diff --git a/addons/l10n_uy/models/template_uy.py b/addons/l10n_uy/models/template_uy.py
index 79eb3adf6a974..a83b4a09fa271 100644
--- a/addons/l10n_uy/models/template_uy.py
+++ b/addons/l10n_uy/models/template_uy.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('uy')
def _get_uy_template_data(self):
diff --git a/addons/l10n_ve/models/template_ve.py b/addons/l10n_ve/models/template_ve.py
index 8fb009ce19e0c..abbfadcaf0b60 100644
--- a/addons/l10n_ve/models/template_ve.py
+++ b/addons/l10n_ve/models/template_ve.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('ve')
def _get_ve_template_data(self):
diff --git a/addons/l10n_vn/models/account_move.py b/addons/l10n_vn/models/account_move.py
index a464c896edc97..5accc7d4abad8 100644
--- a/addons/l10n_vn/models/account_move.py
+++ b/addons/l10n_vn/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
l10n_vn_e_invoice_number = fields.Char(
string='eInvoice Number',
diff --git a/addons/l10n_vn/models/res_bank.py b/addons/l10n_vn/models/res_bank.py
index bf26357882a2a..8d0ceb6c03577 100644
--- a/addons/l10n_vn/models/res_bank.py
+++ b/addons/l10n_vn/models/res_bank.py
@@ -5,7 +5,7 @@
class ResPartnerBank(models.Model):
- _inherit = 'res.partner.bank'
+ _inherit = ['res.partner.bank']
proxy_type = fields.Selection(selection_add=[('merchant_id', 'Merchant ID'),
('payment_service', 'Payment Service'),
diff --git a/addons/l10n_vn/models/template_vn.py b/addons/l10n_vn/models/template_vn.py
index b4868e59a1827..8794dbb5d564a 100644
--- a/addons/l10n_vn/models/template_vn.py
+++ b/addons/l10n_vn/models/template_vn.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('vn')
def _get_vn_template_data(self):
diff --git a/addons/l10n_vn_edi_viettel/models/account_move.py b/addons/l10n_vn_edi_viettel/models/account_move.py
index b513bc86de1c4..ad8c917a05213 100644
--- a/addons/l10n_vn_edi_viettel/models/account_move.py
+++ b/addons/l10n_vn_edi_viettel/models/account_move.py
@@ -33,7 +33,7 @@ def _l10n_vn_edi_send_request(method, url, json_data=None, params=None, headers=
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
# EDI values
l10n_vn_edi_invoice_state = fields.Selection(
diff --git a/addons/l10n_vn_edi_viettel/models/account_move_send.py b/addons/l10n_vn_edi_viettel/models/account_move_send.py
index 3e1dffc8cf630..c1b249d08b548 100644
--- a/addons/l10n_vn_edi_viettel/models/account_move_send.py
+++ b/addons/l10n_vn_edi_viettel/models/account_move_send.py
@@ -7,7 +7,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
@api.model
def _is_vn_edi_applicable(self, move):
diff --git a/addons/l10n_vn_edi_viettel/models/res_company.py b/addons/l10n_vn_edi_viettel/models/res_company.py
index 74c578d2b3ba3..d369824db1640 100644
--- a/addons/l10n_vn_edi_viettel/models/res_company.py
+++ b/addons/l10n_vn_edi_viettel/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
l10n_vn_edi_username = fields.Char(
string='SInvoice Username',
diff --git a/addons/l10n_vn_edi_viettel/models/res_config_settings.py b/addons/l10n_vn_edi_viettel/models/res_config_settings.py
index e9feac09ff073..e3debc0143c75 100644
--- a/addons/l10n_vn_edi_viettel/models/res_config_settings.py
+++ b/addons/l10n_vn_edi_viettel/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
l10n_vn_edi_username = fields.Char(
related='company_id.l10n_vn_edi_username',
diff --git a/addons/l10n_vn_edi_viettel/models/res_partner.py b/addons/l10n_vn_edi_viettel/models/res_partner.py
index f85b5c8bb526a..67b29a540be4b 100644
--- a/addons/l10n_vn_edi_viettel/models/res_partner.py
+++ b/addons/l10n_vn_edi_viettel/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_edi_format = fields.Selection(selection_add=[('vn_sinvoice', 'SInvoice file')])
l10n_vn_edi_symbol = fields.Many2one(
diff --git a/addons/l10n_vn_edi_viettel/models/sinvoice.py b/addons/l10n_vn_edi_viettel/models/sinvoice.py
index c5af771d87b75..e924408c16ebe 100644
--- a/addons/l10n_vn_edi_viettel/models/sinvoice.py
+++ b/addons/l10n_vn_edi_viettel/models/sinvoice.py
@@ -7,9 +7,10 @@
# Invoice template that needs to be passed to Sinvoice and will determine the format of the resulting
+
+
# invoice pdf on their system
-class SInvoiceTemplate(models.Model):
- _name = 'l10n_vn_edi_viettel.sinvoice.template'
+class L10n_Vn_Edi_ViettelSinvoiceTemplate(models.Model):
_description = 'SInvoice template'
name = fields.Char(
@@ -48,9 +49,10 @@ def _constrains_changes(self):
# Invoice symbol that needs to be passed to Sinvoice and will determine the prefix of the
+
+
# invoice number on their system
-class SInvoiceSymbol(models.Model):
- _name = 'l10n_vn_edi_viettel.sinvoice.symbol'
+class L10n_Vn_Edi_ViettelSinvoiceSymbol(models.Model):
_description = 'SInvoice symbol'
"""
The invoice symbols are made of multiple parts.
diff --git a/addons/l10n_vn_edi_viettel/wizard/account_move_reversal.py b/addons/l10n_vn_edi_viettel/wizard/account_move_reversal.py
index e9df05c769b8b..396154c068ec5 100644
--- a/addons/l10n_vn_edi_viettel/wizard/account_move_reversal.py
+++ b/addons/l10n_vn_edi_viettel/wizard/account_move_reversal.py
@@ -5,7 +5,7 @@
class AccountMoveReversal(models.TransientModel):
- _inherit = 'account.move.reversal'
+ _inherit = ['account.move.reversal']
l10n_vn_edi_adjustment_type = fields.Selection(
selection=[
diff --git a/addons/l10n_vn_edi_viettel/wizard/l10n_vn_edi_cancellation_request.py b/addons/l10n_vn_edi_viettel/wizard/l10n_vn_edi_cancellation_request.py
index 65f8b23ddfd5e..e3d0616d79ac2 100644
--- a/addons/l10n_vn_edi_viettel/wizard/l10n_vn_edi_cancellation_request.py
+++ b/addons/l10n_vn_edi_viettel/wizard/l10n_vn_edi_cancellation_request.py
@@ -3,8 +3,7 @@
from odoo import fields, models
-class L10nVNEdiCancellation(models.TransientModel):
- _name = 'l10n_vn_edi_viettel.cancellation'
+class L10n_Vn_Edi_ViettelCancellation(models.TransientModel):
_description = 'E-invoice cancellation wizard'
invoice_id = fields.Many2one(
diff --git a/addons/l10n_za/models/template_za.py b/addons/l10n_za/models/template_za.py
index d5414cf5019db..e2e94bf112c0a 100644
--- a/addons/l10n_za/models/template_za.py
+++ b/addons/l10n_za/models/template_za.py
@@ -4,7 +4,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
@template('za')
def _get_za_template_data(self):
diff --git a/addons/l10n_zm_account/models/account_move.py b/addons/l10n_zm_account/models/account_move.py
index 6c3a3a3448af4..cb2a30c15bf47 100644
--- a/addons/l10n_zm_account/models/account_move.py
+++ b/addons/l10n_zm_account/models/account_move.py
@@ -3,7 +3,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _get_name_invoice_report(self):
if self.company_id.account_fiscal_country_id.code == 'ZM':
diff --git a/addons/l10n_zm_account/models/template_zm.py b/addons/l10n_zm_account/models/template_zm.py
index be93832c71e09..9eaee55955765 100644
--- a/addons/l10n_zm_account/models/template_zm.py
+++ b/addons/l10n_zm_account/models/template_zm.py
@@ -5,7 +5,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@template('zm')
def _get_zm_template_data(self):
diff --git a/addons/link_tracker/models/link_tracker.py b/addons/link_tracker/models/link_tracker.py
index de28e8a4d4d52..087c6be8c07cc 100644
--- a/addons/link_tracker/models/link_tracker.py
+++ b/addons/link_tracker/models/link_tracker.py
@@ -26,7 +26,6 @@ class LinkTracker(models.Model):
This model is also used in mass_mailing where each link in html body is
automatically converted into a short link that is tracked and integrates
UTMs. """
- _name = "link.tracker"
_rec_name = "short_url"
_description = "Link Tracker"
_order = "count DESC"
@@ -291,7 +290,6 @@ def get_url_from_code(self, code):
class LinkTrackerCode(models.Model):
- _name = "link.tracker.code"
_description = "Link Tracker Code"
_rec_name = 'code'
@@ -318,7 +316,6 @@ def _get_random_code_strings(self, n=1):
class LinkTrackerClick(models.Model):
- _name = "link.tracker.click"
_rec_name = "link_id"
_description = "Link Tracker Click"
diff --git a/addons/link_tracker/models/mail_render_mixin.py b/addons/link_tracker/models/mail_render_mixin.py
index 178c9499610ba..7082828c27c9e 100644
--- a/addons/link_tracker/models/mail_render_mixin.py
+++ b/addons/link_tracker/models/mail_render_mixin.py
@@ -14,7 +14,7 @@
class MailRenderMixin(models.AbstractModel):
- _inherit = "mail.render.mixin"
+ _inherit = ["mail.render.mixin"]
# ------------------------------------------------------------
# TOOLS
diff --git a/addons/loyalty/models/loyalty_card.py b/addons/loyalty/models/loyalty_card.py
index 03ce149466720..2c8c82d739433 100644
--- a/addons/loyalty/models/loyalty_card.py
+++ b/addons/loyalty/models/loyalty_card.py
@@ -9,7 +9,6 @@
class LoyaltyCard(models.Model):
- _name = 'loyalty.card'
_inherit = ['mail.thread']
_description = 'Loyalty Coupon'
_rec_name = 'code'
diff --git a/addons/loyalty/models/loyalty_history.py b/addons/loyalty/models/loyalty_history.py
index 019a2a6cb9de1..863a724c87cb0 100644
--- a/addons/loyalty/models/loyalty_history.py
+++ b/addons/loyalty/models/loyalty_history.py
@@ -4,7 +4,6 @@
class LoyaltyHistory(models.Model):
- _name = 'loyalty.history'
_description = "History for Loyalty cards and Ewallets"
_order = 'id desc'
diff --git a/addons/loyalty/models/loyalty_mail.py b/addons/loyalty/models/loyalty_mail.py
index ed03b8eb88152..1b4599090f806 100644
--- a/addons/loyalty/models/loyalty_mail.py
+++ b/addons/loyalty/models/loyalty_mail.py
@@ -6,8 +6,8 @@
# Allow promo programs to send mails upon certain triggers
# Like : 'At creation' and 'When reaching X points'
+
class LoyaltyMail(models.Model):
- _name = 'loyalty.mail'
_description = 'Loyalty Communication'
active = fields.Boolean(default=True)
diff --git a/addons/loyalty/models/loyalty_program.py b/addons/loyalty/models/loyalty_program.py
index e52288c74d4cf..f24174d9afdf9 100644
--- a/addons/loyalty/models/loyalty_program.py
+++ b/addons/loyalty/models/loyalty_program.py
@@ -7,8 +7,8 @@
from uuid import uuid4
+
class LoyaltyProgram(models.Model):
- _name = 'loyalty.program'
_description = 'Loyalty Program'
_order = 'sequence'
_rec_name = 'name'
diff --git a/addons/loyalty/models/loyalty_reward.py b/addons/loyalty/models/loyalty_reward.py
index 2e1ebfd456def..acceb271f08cd 100644
--- a/addons/loyalty/models/loyalty_reward.py
+++ b/addons/loyalty/models/loyalty_reward.py
@@ -9,7 +9,6 @@
class LoyaltyReward(models.Model):
- _name = 'loyalty.reward'
_description = 'Loyalty Reward'
_rec_name = 'description'
_order = 'required_points asc'
diff --git a/addons/loyalty/models/loyalty_rule.py b/addons/loyalty/models/loyalty_rule.py
index 2e303de0fcdbf..222d0139ae8dd 100644
--- a/addons/loyalty/models/loyalty_rule.py
+++ b/addons/loyalty/models/loyalty_rule.py
@@ -7,8 +7,8 @@
from odoo.exceptions import ValidationError
from odoo.osv import expression
+
class LoyaltyRule(models.Model):
- _name = 'loyalty.rule'
_description = 'Loyalty Rule'
@api.model
diff --git a/addons/loyalty/models/product_product.py b/addons/loyalty/models/product_product.py
index 3091066d1f34c..6f5e3755a0ab1 100644
--- a/addons/loyalty/models/product_product.py
+++ b/addons/loyalty/models/product_product.py
@@ -6,7 +6,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def write(self, vals):
if not vals.get('active', True) and any(product.active for product in self):
diff --git a/addons/loyalty/models/product_template.py b/addons/loyalty/models/product_template.py
index 0cabd7526dc6b..fd7869f712774 100644
--- a/addons/loyalty/models/product_template.py
+++ b/addons/loyalty/models/product_template.py
@@ -6,7 +6,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
@api.ondelete(at_uninstall=False)
def _unlink_except_loyalty_products(self):
diff --git a/addons/loyalty/models/res_partner.py b/addons/loyalty/models/res_partner.py
index 7991dba977ce1..1499107741186 100644
--- a/addons/loyalty/models/res_partner.py
+++ b/addons/loyalty/models/res_partner.py
@@ -2,8 +2,9 @@
from odoo import fields, models
+
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
loyalty_card_count = fields.Integer(
string="Active loyalty cards",
diff --git a/addons/loyalty/wizard/base_partner_merge.py b/addons/loyalty/wizard/base_partner_merge.py
index 59e0309fa23a1..18c8e5a65d79b 100644
--- a/addons/loyalty/wizard/base_partner_merge.py
+++ b/addons/loyalty/wizard/base_partner_merge.py
@@ -1,8 +1,8 @@
from odoo import models
-class MergePartnerAutomatic(models.TransientModel):
- _inherit = 'base.partner.merge.automatic.wizard'
+class BasePartnerMergeAutomaticWizard(models.TransientModel):
+ _inherit = ['base.partner.merge.automatic.wizard']
def _update_foreign_keys(self, src_partners, dst_partner):
""" Override of base to merge corresponding nominative loyalty cards."""
diff --git a/addons/loyalty/wizard/loyalty_card_update_balance.py b/addons/loyalty/wizard/loyalty_card_update_balance.py
index 0147434efb3ed..929da6af9ae75 100644
--- a/addons/loyalty/wizard/loyalty_card_update_balance.py
+++ b/addons/loyalty/wizard/loyalty_card_update_balance.py
@@ -5,7 +5,6 @@
class LoyaltyCardUpdateBalance(models.TransientModel):
- _name = 'loyalty.card.update.balance'
_description = "Update Loyalty Card Points"
card_id = fields.Many2one(
diff --git a/addons/loyalty/wizard/loyalty_generate_wizard.py b/addons/loyalty/wizard/loyalty_generate_wizard.py
index 0a5c320290570..755571494af1e 100644
--- a/addons/loyalty/wizard/loyalty_generate_wizard.py
+++ b/addons/loyalty/wizard/loyalty_generate_wizard.py
@@ -5,8 +5,8 @@
from odoo.exceptions import ValidationError
from odoo.osv import expression
+
class LoyaltyGenerateWizard(models.TransientModel):
- _name = 'loyalty.generate.wizard'
_description = 'Generate Coupons'
program_id = fields.Many2one('loyalty.program', required=True, default=lambda self: self.env.context.get('active_id', False) or self.env.context.get('default_program_id', False))
diff --git a/addons/lunch/models/lunch_alert.py b/addons/lunch/models/lunch_alert.py
index 3e826f253de83..9d2c31eb87545 100644
--- a/addons/lunch/models/lunch_alert.py
+++ b/addons/lunch/models/lunch_alert.py
@@ -19,7 +19,6 @@
class LunchAlert(models.Model):
""" Alerts to display during a lunch order. An alert can be specific to a
given day, weekly or daily. The alert is displayed from start to end hour. """
- _name = 'lunch.alert'
_description = 'Lunch Alert'
_order = 'write_date desc, id'
diff --git a/addons/lunch/models/lunch_cashmove.py b/addons/lunch/models/lunch_cashmove.py
index 83761121f9e08..655fe7e7e00f2 100644
--- a/addons/lunch/models/lunch_cashmove.py
+++ b/addons/lunch/models/lunch_cashmove.py
@@ -5,9 +5,8 @@
from odoo.tools import float_round
-class LunchCashMove(models.Model):
+class LunchCashmove(models.Model):
""" Two types of cashmoves: payment (credit) or order (debit) """
- _name = 'lunch.cashmove'
_description = 'Lunch Cashmove'
_order = 'date desc'
diff --git a/addons/lunch/models/lunch_location.py b/addons/lunch/models/lunch_location.py
index 5bb47de3a1089..69ba07f5b878b 100644
--- a/addons/lunch/models/lunch_location.py
+++ b/addons/lunch/models/lunch_location.py
@@ -5,7 +5,6 @@
class LunchLocation(models.Model):
- _name = 'lunch.location'
_description = 'Lunch Locations'
name = fields.Char('Location Name', required=True)
diff --git a/addons/lunch/models/lunch_order.py b/addons/lunch/models/lunch_order.py
index b3ada59f717a3..da9f4c0d84a73 100644
--- a/addons/lunch/models/lunch_order.py
+++ b/addons/lunch/models/lunch_order.py
@@ -7,7 +7,6 @@
class LunchOrder(models.Model):
- _name = 'lunch.order'
_description = 'Lunch Order'
_order = 'id desc'
_display_name = 'product_id'
diff --git a/addons/lunch/models/lunch_product.py b/addons/lunch/models/lunch_product.py
index d750cd2c40fdc..785b3bc0c94a0 100644
--- a/addons/lunch/models/lunch_product.py
+++ b/addons/lunch/models/lunch_product.py
@@ -12,9 +12,8 @@
class LunchProduct(models.Model):
""" Products available to order. A product is linked to a specific vendor. """
- _name = 'lunch.product'
_description = 'Lunch Product'
- _inherit = 'image.mixin'
+ _inherit = ['image.mixin']
_order = 'name'
_check_company_auto = True
diff --git a/addons/lunch/models/lunch_product_category.py b/addons/lunch/models/lunch_product_category.py
index be850c5a24490..1ff7681a04d98 100644
--- a/addons/lunch/models/lunch_product_category.py
+++ b/addons/lunch/models/lunch_product_category.py
@@ -10,8 +10,7 @@
class LunchProductCategory(models.Model):
""" Category of the product such as pizza, sandwich, pasta, chinese, burger... """
- _name = 'lunch.product.category'
- _inherit = 'image.mixin'
+ _inherit = ['image.mixin']
_description = 'Lunch Product Category'
@api.model
diff --git a/addons/lunch/models/lunch_supplier.py b/addons/lunch/models/lunch_supplier.py
index 6896e6d1019bc..e16565bb35e7f 100644
--- a/addons/lunch/models/lunch_supplier.py
+++ b/addons/lunch/models/lunch_supplier.py
@@ -30,8 +30,8 @@ def float_to_time(hours, moment='am'):
def time_to_float(t):
return float_round(t.hour + t.minute/60 + t.second/3600, precision_digits=2)
+
class LunchSupplier(models.Model):
- _name = 'lunch.supplier'
_description = 'Lunch Supplier'
_inherit = ['mail.thread', 'mail.activity.mixin']
diff --git a/addons/lunch/models/lunch_topping.py b/addons/lunch/models/lunch_topping.py
index efea5858d7d15..e63cd7ae4cb40 100644
--- a/addons/lunch/models/lunch_topping.py
+++ b/addons/lunch/models/lunch_topping.py
@@ -7,7 +7,6 @@
class LunchTopping(models.Model):
- _name = 'lunch.topping'
_description = 'Lunch Extras'
name = fields.Char('Name', required=True)
diff --git a/addons/lunch/models/res_company.py b/addons/lunch/models/res_company.py
index fe9df868291f6..693676aa2d9e6 100644
--- a/addons/lunch/models/res_company.py
+++ b/addons/lunch/models/res_company.py
@@ -4,8 +4,8 @@
from odoo import models, fields
-class Company(models.Model):
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
lunch_minimum_threshold = fields.Float()
lunch_notify_message = fields.Html(
diff --git a/addons/lunch/models/res_config_settings.py b/addons/lunch/models/res_config_settings.py
index 8c65ad579e474..7dcbd1ef7a472 100644
--- a/addons/lunch/models/res_config_settings.py
+++ b/addons/lunch/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
currency_id = fields.Many2one('res.currency', related='company_id.currency_id')
company_lunch_minimum_threshold = fields.Float(string="Maximum Allowed Overdraft", readonly=False, related='company_id.lunch_minimum_threshold')
diff --git a/addons/lunch/models/res_users.py b/addons/lunch/models/res_users.py
index bc7cd5aed7340..8089074c968a0 100644
--- a/addons/lunch/models/res_users.py
+++ b/addons/lunch/models/res_users.py
@@ -5,7 +5,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
last_lunch_location_id = fields.Many2one('lunch.location')
favorite_lunch_product_ids = fields.Many2many('lunch.product', 'lunch_product_favorite_user_rel', 'user_id', 'product_id')
diff --git a/addons/lunch/report/lunch_cashmove_report.py b/addons/lunch/report/lunch_cashmove_report.py
index 1f7d7728c1da5..ae010be0a49e9 100644
--- a/addons/lunch/report/lunch_cashmove_report.py
+++ b/addons/lunch/report/lunch_cashmove_report.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, tools, _
-class CashmoveReport(models.Model):
- _name = "lunch.cashmove.report"
+class LunchCashmoveReport(models.Model):
_description = 'Cashmoves report'
_auto = False
_order = "date desc"
diff --git a/addons/mail/models/bus_listener_mixin.py b/addons/mail/models/bus_listener_mixin.py
index b0779ff7205ba..3be63465e3402 100644
--- a/addons/mail/models/bus_listener_mixin.py
+++ b/addons/mail/models/bus_listener_mixin.py
@@ -5,7 +5,7 @@
class BusListenerMixin(models.AbstractModel):
- _inherit = "bus.listener.mixin"
+ _inherit = ["bus.listener.mixin"]
def _bus_send_store(
self, /, *args, notification_type="mail.record/insert", subchannel=None, **kwargs
diff --git a/addons/mail/models/discuss/bus_listener_mixin.py b/addons/mail/models/discuss/bus_listener_mixin.py
index 405a2bbfb1a7c..c6f2cf1dce510 100644
--- a/addons/mail/models/discuss/bus_listener_mixin.py
+++ b/addons/mail/models/discuss/bus_listener_mixin.py
@@ -7,7 +7,7 @@
class BusListenerMixin(models.AbstractModel):
- _inherit = "bus.listener.mixin"
+ _inherit = ["bus.listener.mixin"]
def _bus_send_transient_message(self, channel, content):
"""Posts a fake message in the given ``channel``, only visible for ``self`` listeners."""
diff --git a/addons/mail/models/discuss/discuss_channel.py b/addons/mail/models/discuss/discuss_channel.py
index 47e2f6cc27a8b..1e1c6718036fc 100644
--- a/addons/mail/models/discuss/discuss_channel.py
+++ b/addons/mail/models/discuss/discuss_channel.py
@@ -24,9 +24,8 @@
'''
-class Channel(models.Model):
+class DiscussChannel(models.Model):
_description = 'Discussion Channel'
- _name = 'discuss.channel'
_mail_flat_thread = False
_mail_post_access = 'read'
_inherit = ["mail.thread", "bus.listener.mixin"]
@@ -288,7 +287,7 @@ def create(self, vals_list):
vals.pop('channel_partner_ids', False)
# Create channel and alias
- channels = super(Channel, self.with_context(mail_create_bypass_create_check=self.env['discuss.channel.member']._bypass_create_check, mail_create_nolog=True, mail_create_nosubscribe=True)).create(vals_list)
+ channels = super(DiscussChannel, self.with_context(mail_create_bypass_create_check=self.env['discuss.channel.member']._bypass_create_check, mail_create_nolog=True, mail_create_nosubscribe=True)).create(vals_list)
# pop the mail_create_bypass_create_check key to avoid leaking it outside of create)
channels = channels.with_context(mail_create_bypass_create_check=None)
channels._subscribe_users_automatically()
@@ -693,7 +692,7 @@ def message_post(self, *, message_type='notification', **kwargs):
# The current client code might be setting the key to True on sending
# message but it is only useful when targeting customers in chatter.
# This value should simply be set to False in channels no matter what.
- return super(Channel, self.with_context(mail_create_nosubscribe=True, mail_post_autofollow=False)).message_post(message_type=message_type, **kwargs)
+ return super(DiscussChannel, self.with_context(mail_create_nosubscribe=True, mail_post_autofollow=False)).message_post(message_type=message_type, **kwargs)
def _message_post_after_hook(self, message, msg_vals):
"""
diff --git a/addons/mail/models/discuss/discuss_channel_member.py b/addons/mail/models/discuss/discuss_channel_member.py
index da81244ab30a5..52fa0c46045b9 100644
--- a/addons/mail/models/discuss/discuss_channel_member.py
+++ b/addons/mail/models/discuss/discuss_channel_member.py
@@ -16,8 +16,7 @@
SFU_MODE_THRESHOLD = 3
-class ChannelMember(models.Model):
- _name = "discuss.channel.member"
+class DiscussChannelMember(models.Model):
_inherit = ["bus.listener.mixin"]
_description = "Channel Member"
_rec_names_search = ["channel_id", "partner_id", "guest_id"]
diff --git a/addons/mail/models/discuss/discuss_channel_rtc_session.py b/addons/mail/models/discuss/discuss_channel_rtc_session.py
index 17720999b6893..4202ed47a15ba 100644
--- a/addons/mail/models/discuss/discuss_channel_rtc_session.py
+++ b/addons/mail/models/discuss/discuss_channel_rtc_session.py
@@ -13,8 +13,7 @@
_logger = logging.getLogger(__name__)
-class MailRtcSession(models.Model):
- _name = 'discuss.channel.rtc.session'
+class DiscussChannelRtcSession(models.Model):
_inherit = ["bus.listener.mixin"]
_description = 'Mail RTC session'
_rec_name = 'channel_member_id'
diff --git a/addons/mail/models/discuss/discuss_gif_favorite.py b/addons/mail/models/discuss/discuss_gif_favorite.py
index e6c96f8506770..92692b2e5cbd5 100644
--- a/addons/mail/models/discuss/discuss_gif_favorite.py
+++ b/addons/mail/models/discuss/discuss_gif_favorite.py
@@ -3,8 +3,7 @@
from odoo import fields, models
-class GifFavorite(models.Model):
- _name = "discuss.gif.favorite"
+class DiscussGifFavorite(models.Model):
_description = "Save favorite GIF from Tenor API"
tenor_gif_id = fields.Char("GIF id from Tenor", required=True)
diff --git a/addons/mail/models/discuss/discuss_voice_metadata.py b/addons/mail/models/discuss/discuss_voice_metadata.py
index 09f3ce223efae..becabad7de3ed 100644
--- a/addons/mail/models/discuss/discuss_voice_metadata.py
+++ b/addons/mail/models/discuss/discuss_voice_metadata.py
@@ -4,7 +4,6 @@
class DiscussVoiceMetadata(models.Model):
- _name = "discuss.voice.metadata"
_description = "Metadata for voice attachments"
attachment_id = fields.Many2one(
diff --git a/addons/mail/models/discuss/ir_attachment.py b/addons/mail/models/discuss/ir_attachment.py
index 2b734616bbf50..0000c29faebb5 100644
--- a/addons/mail/models/discuss/ir_attachment.py
+++ b/addons/mail/models/discuss/ir_attachment.py
@@ -5,7 +5,7 @@
class IrAttachment(models.Model):
- _inherit = "ir.attachment"
+ _inherit = ["ir.attachment"]
voice_ids = fields.One2many("discuss.voice.metadata", "attachment_id")
diff --git a/addons/mail/models/discuss/ir_binary.py b/addons/mail/models/discuss/ir_binary.py
index b249ef8af0f80..3cda75a3b8f22 100644
--- a/addons/mail/models/discuss/ir_binary.py
+++ b/addons/mail/models/discuss/ir_binary.py
@@ -4,7 +4,7 @@
class IrBinary(models.AbstractModel):
- _inherit = "ir.binary"
+ _inherit = ["ir.binary"]
def _find_record_check_access(self, record, access_token, field):
if record._name in ["res.partner", "mail.guest"] and field == "avatar_128":
diff --git a/addons/mail/models/discuss/ir_websocket.py b/addons/mail/models/discuss/ir_websocket.py
index 3fd0ef41edbd7..d33037bf8f48c 100644
--- a/addons/mail/models/discuss/ir_websocket.py
+++ b/addons/mail/models/discuss/ir_websocket.py
@@ -8,7 +8,7 @@
class IrWebsocket(models.AbstractModel):
- _inherit = "ir.websocket"
+ _inherit = ["ir.websocket"]
def _get_missed_presences_identity_domains(self, presence_channels):
identity_domain = super()._get_missed_presences_identity_domains(presence_channels)
diff --git a/addons/mail/models/discuss/mail_guest.py b/addons/mail/models/discuss/mail_guest.py
index 5ae78c584ef71..ab6765f3f2301 100644
--- a/addons/mail/models/discuss/mail_guest.py
+++ b/addons/mail/models/discuss/mail_guest.py
@@ -41,7 +41,6 @@ def wrapper(self, *args, **kwargs):
class MailGuest(models.Model):
- _name = 'mail.guest'
_description = "Guest"
_inherit = ["avatar.mixin", "bus.listener.mixin"]
_avatar_name_field = "name"
diff --git a/addons/mail/models/discuss/mail_message.py b/addons/mail/models/discuss/mail_message.py
index 4520f033e4c7e..47819e1534f64 100644
--- a/addons/mail/models/discuss/mail_message.py
+++ b/addons/mail/models/discuss/mail_message.py
@@ -5,7 +5,7 @@
class MailMessage(models.Model):
- _inherit = "mail.message"
+ _inherit = ["mail.message"]
def _extras_to_store(self, store: Store, format_reply):
super()._extras_to_store(store, format_reply=format_reply)
diff --git a/addons/mail/models/discuss/res_groups.py b/addons/mail/models/discuss/res_groups.py
index c0c049f3a1cf0..700c3347825ed 100644
--- a/addons/mail/models/discuss/res_groups.py
+++ b/addons/mail/models/discuss/res_groups.py
@@ -4,7 +4,7 @@
class ResGroups(models.Model):
- _inherit = "res.groups"
+ _inherit = ["res.groups"]
def write(self, vals):
res = super().write(vals)
diff --git a/addons/mail/models/discuss/res_partner.py b/addons/mail/models/discuss/res_partner.py
index a05478d1958fa..924d1df99f3cf 100644
--- a/addons/mail/models/discuss/res_partner.py
+++ b/addons/mail/models/discuss/res_partner.py
@@ -7,7 +7,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
channel_ids = fields.Many2many(
"discuss.channel",
diff --git a/addons/mail/models/discuss/res_users.py b/addons/mail/models/discuss/res_users.py
index e479fd8af772e..1191e165a96f4 100644
--- a/addons/mail/models/discuss/res_users.py
+++ b/addons/mail/models/discuss/res_users.py
@@ -5,7 +5,7 @@
class ResUsers(models.Model):
- _inherit = "res.users"
+ _inherit = ["res.users"]
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/mail/models/fetchmail.py b/addons/mail/models/fetchmail.py
index 6da457c5cefd4..2babbf676d85c 100644
--- a/addons/mail/models/fetchmail.py
+++ b/addons/mail/models/fetchmail.py
@@ -63,7 +63,6 @@ def __init__(self, server, port, is_ssl, timeout=MAIL_TIMEOUT):
class FetchmailServer(models.Model):
"""Incoming POP/IMAP mail server account"""
- _name = 'fetchmail.server'
_description = 'Incoming Mail Server'
_order = 'priority'
diff --git a/addons/mail/models/ir_action_act_window.py b/addons/mail/models/ir_action_act_window.py
index b95068cce4a33..302b37ec76188 100644
--- a/addons/mail/models/ir_action_act_window.py
+++ b/addons/mail/models/ir_action_act_window.py
@@ -2,8 +2,8 @@
from odoo import fields, models
-class ActWindowView(models.Model):
- _inherit = 'ir.actions.act_window.view'
+class IrActionsAct_WindowView(models.Model):
+ _inherit = ['ir.actions.act_window.view']
view_mode = fields.Selection(selection_add=[
('activity', 'Activity')
diff --git a/addons/mail/models/ir_actions_server.py b/addons/mail/models/ir_actions_server.py
index fa08bbb8627dd..33bec255d4144 100644
--- a/addons/mail/models/ir_actions_server.py
+++ b/addons/mail/models/ir_actions_server.py
@@ -7,9 +7,8 @@
from odoo.exceptions import ValidationError
-class ServerActions(models.Model):
+class IrActionsServer(models.Model):
""" Add mail.thread related options in server actions. """
- _name = 'ir.actions.server'
_description = 'Server Action'
_inherit = ['ir.actions.server']
@@ -89,7 +88,7 @@ def _compute_available_model_ids(self):
mail_models = self.env['ir.model'].search([('is_mail_thread', '=', True), ('transient', '=', False)])
for action in mail_thread_based:
action.available_model_ids = mail_models.ids
- super(ServerActions, self - mail_thread_based)._compute_available_model_ids()
+ super(IrActionsServer, self - mail_thread_based)._compute_available_model_ids()
@api.depends('model_id', 'state')
def _compute_template_id(self):
@@ -290,7 +289,7 @@ def _get_eval_context(self, action=None):
key set to False in the context. This way all notification emails linked
to the currently executed action will be set in the queue instead of
sent directly. This will avoid possible break in transactions. """
- eval_context = super(ServerActions, self)._get_eval_context(action=action)
+ eval_context = super()._get_eval_context(action=action)
ctx = dict(eval_context['env'].context)
ctx['mail_notify_force_send'] = False
eval_context['env'].context = ctx
diff --git a/addons/mail/models/ir_attachment.py b/addons/mail/models/ir_attachment.py
index 6005815acfb3c..6857c9c373e2b 100644
--- a/addons/mail/models/ir_attachment.py
+++ b/addons/mail/models/ir_attachment.py
@@ -10,7 +10,7 @@
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
def _check_attachments_access(self, attachment_tokens):
"""This method relies on access rules/rights and therefore it should not be called from a sudo env."""
diff --git a/addons/mail/models/ir_config_parameter.py b/addons/mail/models/ir_config_parameter.py
index 541c6418fb0ba..b82cd74169a06 100644
--- a/addons/mail/models/ir_config_parameter.py
+++ b/addons/mail/models/ir_config_parameter.py
@@ -4,7 +4,7 @@
from odoo import api, models
-class IrConfigParameter(models.Model):
+class IrConfig_Parameter(models.Model):
# Override of config parameter to specifically handle the template
# rendering group (de)activation through ICP.
@@ -75,7 +75,7 @@ class IrConfigParameter(models.Model):
# sfu_server_key': rtc server usage and configuration;
# * 'discuss.tenor_api_key', 'discuss.tenor_gif_limit' and 'discuss.
# tenor_content_filter' used for gif fetch service;
- _inherit = 'ir.config_parameter'
+ _inherit = ['ir.config_parameter']
@api.model
def set_param(self, key, value):
diff --git a/addons/mail/models/ir_cron.py b/addons/mail/models/ir_cron.py
index 5faa689033748..020e957036748 100644
--- a/addons/mail/models/ir_cron.py
+++ b/addons/mail/models/ir_cron.py
@@ -4,7 +4,7 @@
class IrCron(models.AbstractModel):
- _inherit = 'ir.cron'
+ _inherit = ['ir.cron']
def _notify_admin(self, message):
""" Send a notification to the admin users. """
diff --git a/addons/mail/models/ir_http.py b/addons/mail/models/ir_http.py
index ec2a2b880836d..491d1d16e2063 100644
--- a/addons/mail/models/ir_http.py
+++ b/addons/mail/models/ir_http.py
@@ -7,7 +7,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
def session_info(self):
"""Override to add the current user data (partner or guest) if applicable."""
diff --git a/addons/mail/models/ir_mail_server.py b/addons/mail/models/ir_mail_server.py
index f693d3cde1219..6b814b8e446a6 100644
--- a/addons/mail/models/ir_mail_server.py
+++ b/addons/mail/models/ir_mail_server.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class IrMailServer(models.Model):
- _name = 'ir.mail_server'
+class IrMail_Server(models.Model):
_inherit = ['ir.mail_server']
mail_template_ids = fields.One2many(
diff --git a/addons/mail/models/ir_model.py b/addons/mail/models/ir_model.py
index 0c33275c94849..c04da30e0a857 100644
--- a/addons/mail/models/ir_model.py
+++ b/addons/mail/models/ir_model.py
@@ -6,7 +6,7 @@
class IrModel(models.Model):
- _inherit = 'ir.model'
+ _inherit = ['ir.model']
_order = 'is_mail_thread DESC, name ASC'
is_mail_thread = fields.Boolean(
diff --git a/addons/mail/models/ir_model_fields.py b/addons/mail/models/ir_model_fields.py
index b1b1b3d622c13..42d22c1c48f24 100644
--- a/addons/mail/models/ir_model_fields.py
+++ b/addons/mail/models/ir_model_fields.py
@@ -5,8 +5,8 @@
from odoo.tools import groupby
-class IrModelField(models.Model):
- _inherit = 'ir.model.fields'
+class IrModelFields(models.Model):
+ _inherit = ['ir.model.fields']
tracking = fields.Integer(
string="Enable Ordered Tracking",
@@ -17,7 +17,7 @@ def _reflect_field_params(self, field, model_id):
""" Tracking value can be either a boolean enabling tracking mechanism
on field, either an integer giving the sequence. Default sequence is
set to 100. """
- vals = super(IrModelField, self)._reflect_field_params(field, model_id)
+ vals = super()._reflect_field_params(field, model_id)
tracking = getattr(field, 'tracking', None)
if tracking is True:
tracking = 100
@@ -27,7 +27,7 @@ def _reflect_field_params(self, field, model_id):
return vals
def _instanciate_attrs(self, field_data):
- attrs = super(IrModelField, self)._instanciate_attrs(field_data)
+ attrs = super()._instanciate_attrs(field_data)
if attrs and field_data.get('tracking'):
attrs['tracking'] = field_data['tracking']
return attrs
diff --git a/addons/mail/models/ir_qweb.py b/addons/mail/models/ir_qweb.py
index 884cd8b26379a..f953cf714197a 100644
--- a/addons/mail/models/ir_qweb.py
+++ b/addons/mail/models/ir_qweb.py
@@ -10,7 +10,7 @@ class IrQweb(models.AbstractModel):
is allowed for the given model.
"""
- _inherit = "ir.qweb"
+ _inherit = ["ir.qweb"]
allowed_directives = (
"out",
diff --git a/addons/mail/models/ir_ui_menu.py b/addons/mail/models/ir_ui_menu.py
index 65bc4f35434a7..841421eeda566 100644
--- a/addons/mail/models/ir_ui_menu.py
+++ b/addons/mail/models/ir_ui_menu.py
@@ -7,7 +7,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
@api.model
def _get_best_backend_root_menu_id_for_model(self, res_model):
diff --git a/addons/mail/models/ir_ui_view.py b/addons/mail/models/ir_ui_view.py
index 80afc3d31ed47..61420c8cf1713 100644
--- a/addons/mail/models/ir_ui_view.py
+++ b/addons/mail/models/ir_ui_view.py
@@ -2,8 +2,8 @@
from odoo import fields, models
-class View(models.Model):
- _inherit = 'ir.ui.view'
+class IrUiView(models.Model):
+ _inherit = ['ir.ui.view']
type = fields.Selection(selection_add=[('activity', 'Activity')])
diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py
index 8d2f6239be5a8..7c48c690e5a6e 100644
--- a/addons/mail/models/mail_activity.py
+++ b/addons/mail/models/mail_activity.py
@@ -23,7 +23,6 @@ class MailActivity(models.Model):
that can be used in kanban view to display a status. Once done activities
are unlinked and a message is posted. This message has a new activity_type_id
field that indicates the activity linked to the message. """
- _name = 'mail.activity'
_description = 'Activity'
_order = 'date_deadline ASC, id ASC'
_rec_name = 'summary'
diff --git a/addons/mail/models/mail_activity_mixin.py b/addons/mail/models/mail_activity_mixin.py
index 2c4dd67e1946c..1e629136604bb 100644
--- a/addons/mail/models/mail_activity_mixin.py
+++ b/addons/mail/models/mail_activity_mixin.py
@@ -36,7 +36,6 @@ class MailActivityMixin(models.AbstractModel):
no automated activities will be generated, updated or unlinked, allowing
to save computation and avoid generating unwanted activities;
"""
- _name = 'mail.activity.mixin'
_description = 'Activity Mixin'
def _default_activity_type(self):
diff --git a/addons/mail/models/mail_activity_plan.py b/addons/mail/models/mail_activity_plan.py
index d66a50938e9b8..6684734b4933f 100644
--- a/addons/mail/models/mail_activity_plan.py
+++ b/addons/mail/models/mail_activity_plan.py
@@ -5,7 +5,6 @@
class MailActivityPlan(models.Model):
- _name = 'mail.activity.plan'
_description = 'Activity Plan'
_order = 'id DESC'
diff --git a/addons/mail/models/mail_activity_plan_template.py b/addons/mail/models/mail_activity_plan_template.py
index 8568c5c35567b..4c894a8420ebd 100644
--- a/addons/mail/models/mail_activity_plan_template.py
+++ b/addons/mail/models/mail_activity_plan_template.py
@@ -8,7 +8,6 @@
class MailActivityPlanTemplate(models.Model):
- _name = 'mail.activity.plan.template'
_order = 'sequence,id'
_description = 'Activity plan template'
_rec_name = 'summary'
diff --git a/addons/mail/models/mail_activity_type.py b/addons/mail/models/mail_activity_type.py
index d62b5ba924985..2a315e597eb30 100644
--- a/addons/mail/models/mail_activity_type.py
+++ b/addons/mail/models/mail_activity_type.py
@@ -6,12 +6,12 @@
from odoo import api, fields, models, _
from odoo.exceptions import UserError
+
class MailActivityType(models.Model):
""" Activity Types are used to categorize activities. Each type is a different
kind of activity e.g. call, mail, meeting. An activity can be generic i.e.
available for all models using activities; or specific to a model in which
case res_model field should be used. """
- _name = 'mail.activity.type'
_description = 'Activity Type'
_rec_name = 'name'
_order = 'sequence, id'
diff --git a/addons/mail/models/mail_alias.py b/addons/mail/models/mail_alias.py
index f082ed5d84d5c..46aa4dbf15eed 100644
--- a/addons/mail/models/mail_alias.py
+++ b/addons/mail/models/mail_alias.py
@@ -16,11 +16,11 @@
dot_atom_text = re.compile(r"^%s+(\.%s+)*$" % (atext, atext))
-class Alias(models.Model):
+class MailAlias(models.Model):
"""A Mail Alias is a mapping of an email address with a given Odoo Document
model. It is used by Odoo's mail gateway when processing incoming emails
sent to the system. If the recipient address (To) of the message matches
- a Mail Alias, the message will be either processed following the rules
+ a Mail MailAlias, the message will be either processed following the rules
of that alias. If the message is a reply it will be attached to the
existing discussion on the corresponding record, otherwise a new
record of the corresponding model will be created.
@@ -29,7 +29,6 @@ class Alias(models.Model):
on the company's mail server, so that as soon as a new mail.alias is
created, it becomes immediately usable and Odoo will accept email for it.
"""
- _name = 'mail.alias'
_description = "Email Aliases"
_rec_name = 'alias_name'
_rec_names_search = ['alias_name', 'alias_domain']
diff --git a/addons/mail/models/mail_alias_domain.py b/addons/mail/models/mail_alias_domain.py
index 187e16b82e0bd..67abb33af6dfc 100644
--- a/addons/mail/models/mail_alias_domain.py
+++ b/addons/mail/models/mail_alias_domain.py
@@ -5,14 +5,13 @@
from odoo.addons.mail.models.mail_alias import dot_atom_text
-class AliasDomain(models.Model):
+class MailAliasDomain(models.Model):
""" Model alias domains, now company-specific. Alias domains are email
domains used to receive emails through catchall and bounce aliases, as
well as using mail.alias records to redirect email replies.
This replaces ``mail.alias.domain`` configuration parameter use until v16.
"""
- _name = 'mail.alias.domain'
_description = "Email Domain"
_order = 'sequence ASC, id ASC'
diff --git a/addons/mail/models/mail_alias_mixin.py b/addons/mail/models/mail_alias_mixin.py
index d9ebd41f5f2ba..cb4fe9f9916db 100644
--- a/addons/mail/models/mail_alias_mixin.py
+++ b/addons/mail/models/mail_alias_mixin.py
@@ -8,11 +8,10 @@
_logger = logging.getLogger(__name__)
-class AliasMixin(models.AbstractModel):
+class MailAliasMixin(models.AbstractModel):
""" A mixin for models that inherits mail.alias to have a one-to-one relation
between the model and its alias. """
- _name = 'mail.alias.mixin'
- _inherit = 'mail.alias.mixin.optional'
+ _inherit = ['mail.alias.mixin.optional']
_inherits = {'mail.alias': 'alias_id'}
_description = 'Email Aliases Mixin'
diff --git a/addons/mail/models/mail_alias_mixin_optional.py b/addons/mail/models/mail_alias_mixin_optional.py
index c63f3ab6fbabf..bc5afe01d25fc 100644
--- a/addons/mail/models/mail_alias_mixin_optional.py
+++ b/addons/mail/models/mail_alias_mixin_optional.py
@@ -8,13 +8,12 @@
_logger = logging.getLogger(__name__)
-class AliasMixinOptional(models.AbstractModel):
+class MailAliasMixinOptional(models.AbstractModel):
""" A mixin for models that handles underlying 'mail.alias' records to use
the mail gateway. Field is not mandatory and its creation is done dynamically
based on given 'alias_name', allowing to gradually populate the alias table
without having void aliases as when used with an inherits-like implementation.
"""
- _name = 'mail.alias.mixin.optional'
_description = 'Email Aliases Mixin (light)'
ALIAS_WRITEABLE_FIELDS = ['alias_domain_id', 'alias_name', 'alias_contact', 'alias_defaults', 'alias_bounced_content']
diff --git a/addons/mail/models/mail_blacklist.py b/addons/mail/models/mail_blacklist.py
index 64a50c26bad93..ae2f375f62c92 100644
--- a/addons/mail/models/mail_blacklist.py
+++ b/addons/mail/models/mail_blacklist.py
@@ -5,9 +5,8 @@
from odoo.exceptions import UserError
-class MailBlackList(models.Model):
+class MailBlacklist(models.Model):
""" Model of blacklisted email addresses to stop sending emails."""
- _name = 'mail.blacklist'
_inherit = ['mail.thread']
_description = 'Mail Blacklist'
_rec_name = 'email'
@@ -46,13 +45,13 @@ def create(self, values):
to_create = [v for v in new_values if v['email'] not in bl_entries]
# TODO DBE Fixme : reorder ids according to incoming ids.
- results = super(MailBlackList, self).create(to_create)
+ results = super().create(to_create)
return self.env['mail.blacklist'].browse(bl_entries.values()) | results
def write(self, values):
if 'email' in values:
values['email'] = tools.email_normalize(values['email'])
- return super(MailBlackList, self).write(values)
+ return super().write(values)
def _search(self, domain, offset=0, limit=None, order=None):
""" Override _search in order to grep search on email field and make it
diff --git a/addons/mail/models/mail_canned_response.py b/addons/mail/models/mail_canned_response.py
index d0122bd9a9032..d1e7ee14d4a1c 100644
--- a/addons/mail/models/mail_canned_response.py
+++ b/addons/mail/models/mail_canned_response.py
@@ -9,7 +9,6 @@ class MailCannedResponse(models.Model):
Canned Response: content that will automatically replace the shortcut of your choosing. This content can still be adapted before sending your message.
"""
- _name = "mail.canned.response"
_description = "Canned Response"
_order = "id desc"
_rec_name = "source"
diff --git a/addons/mail/models/mail_composer_mixin.py b/addons/mail/models/mail_composer_mixin.py
index b72458f5af55f..36c5e33745e2b 100644
--- a/addons/mail/models/mail_composer_mixin.py
+++ b/addons/mail/models/mail_composer_mixin.py
@@ -16,8 +16,7 @@ class MailComposerMixin(models.AbstractModel):
It is meant to evolve in a near future with upcoming support of qweb and fine
grain control of rendering access.
"""
- _name = 'mail.composer.mixin'
- _inherit = 'mail.render.mixin'
+ _inherit = ['mail.render.mixin']
_description = 'Mail Composer Mixin'
# Content
diff --git a/addons/mail/models/mail_followers.py b/addons/mail/models/mail_followers.py
index 19dceb5c78fc4..e6a7378647b03 100644
--- a/addons/mail/models/mail_followers.py
+++ b/addons/mail/models/mail_followers.py
@@ -8,7 +8,7 @@
from odoo.addons.mail.tools.discuss import Store
-class Followers(models.Model):
+class MailFollowers(models.Model):
""" mail_followers holds the data related to the follow mechanism inside
Odoo. Partners can choose to follow documents (records) of any kind
that inherits from mail.thread. Following documents allow to receive
@@ -17,7 +17,6 @@ class Followers(models.Model):
:param: res_model: model of the followed objects
:param: res_id: ID of resource (may be 0 for every objects)
"""
- _name = 'mail.followers'
_rec_name = 'partner_id'
_log_access = False
_description = 'Document Followers'
@@ -51,21 +50,21 @@ def _invalidate_documents(self, vals_list=None):
@api.model_create_multi
def create(self, vals_list):
- res = super(Followers, self).create(vals_list)
+ res = super().create(vals_list)
res._invalidate_documents(vals_list)
return res
def write(self, vals):
if 'res_model' in vals or 'res_id' in vals:
self._invalidate_documents()
- res = super(Followers, self).write(vals)
+ res = super().write(vals)
if any(x in vals for x in ['res_model', 'res_id', 'partner_id']):
self._invalidate_documents()
return res
def unlink(self):
self._invalidate_documents()
- return super(Followers, self).unlink()
+ return super().unlink()
_sql_constraints = [
('mail_followers_res_partner_res_model_id_uniq', 'unique(res_model,res_id,partner_id)', 'Error, a partner cannot follow twice the same object.'),
@@ -334,7 +333,7 @@ def _get_recipient_data(self, records, message_type, subtype_id, pids=None):
def _get_subscription_data(self, doc_data, pids, include_pshare=False, include_active=False):
""" Private method allowing to fetch follower data from several documents of a given model.
- Followers can be filtered given partner IDs and channel IDs.
+ MailFollowers can be filtered given partner IDs and channel IDs.
:param doc_data: list of pair (res_model, res_ids) that are the documents from which we
want to have subscription data;
diff --git a/addons/mail/models/mail_gateway_allowed.py b/addons/mail/models/mail_gateway_allowed.py
index 727269ef54c83..1e1552667d306 100644
--- a/addons/mail/models/mail_gateway_allowed.py
+++ b/addons/mail/models/mail_gateway_allowed.py
@@ -19,7 +19,6 @@ class MailGatewayAllowed(models.Model):
"""
_description = 'Mail Gateway Allowed'
- _name = 'mail.gateway.allowed'
email = fields.Char('Email Address', required=True)
email_normalized = fields.Char(
diff --git a/addons/mail/models/mail_ice_server.py b/addons/mail/models/mail_ice_server.py
index b17370cfc4db6..ea992b59e94e0 100644
--- a/addons/mail/models/mail_ice_server.py
+++ b/addons/mail/models/mail_ice_server.py
@@ -7,7 +7,6 @@
class MailIceServer(models.Model):
- _name = 'mail.ice.server'
_description = 'ICE server'
server_type = fields.Selection([('stun', 'stun:'), ('turn', 'turn:')], string='Type', required=True, default='stun')
diff --git a/addons/mail/models/mail_link_preview.py b/addons/mail/models/mail_link_preview.py
index 23fcd2733b58f..81e9ec1a2ddee 100644
--- a/addons/mail/models/mail_link_preview.py
+++ b/addons/mail/models/mail_link_preview.py
@@ -12,9 +12,8 @@
from odoo.addons.mail.tools.link_preview import get_link_preview_from_url
-class LinkPreview(models.Model):
- _name = 'mail.link.preview'
- _inherit = "bus.listener.mixin"
+class MailLinkPreview(models.Model):
+ _inherit = ["bus.listener.mixin"]
_description = "Store link preview data"
message_id = fields.Many2one('mail.message', string='Message', index=True, ondelete='cascade')
diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py
index 088c7dfd7fb13..662dabb216560 100644
--- a/addons/mail/models/mail_mail.py
+++ b/addons/mail/models/mail_mail.py
@@ -25,7 +25,6 @@
class MailMail(models.Model):
""" Model holding RFC2822 email messages to send. This model also provides
facilities to queue and send new email messages. """
- _name = 'mail.mail'
_description = 'Outgoing Mails'
_inherits = {'mail.message': 'mail_message_id'}
_order = 'id desc'
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index e9e73c2368e7f..0f92b1b2a30c3 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -18,7 +18,7 @@
_image_dataurl = re.compile(r'(data:image/[a-z]+?);base64,([a-z0-9+/\n]{3,}=*)\n*([\'"])(?: data-filename="([^"]*)")?', re.I)
-class Message(models.Model):
+class MailMessage(models.Model):
""" Message model (from notifications to user input).
Note:: State management / Error codes / Failure types summary
@@ -65,7 +65,6 @@ class Message(models.Model):
See ``mailing.trace`` model in mass_mailing application for mailing trace
information.
"""
- _name = 'mail.message'
_inherit = ["bus.listener.mixin"]
_description = 'Message'
_order = 'id desc'
@@ -73,7 +72,7 @@ class Message(models.Model):
@api.model
def default_get(self, fields):
- res = super(Message, self).default_get(fields)
+ res = super().default_get(fields)
missing_author = 'author_id' in fields and 'author_id' not in res
missing_email_from = 'email_from' in fields and 'email_from' not in res
if missing_author or missing_email_from:
@@ -634,7 +633,7 @@ def base64_to_boundary(match):
# delegate creation of tracking after the create as sudo to avoid access rights issues
tracking_values_list.append(values.pop('tracking_value_ids', False))
- messages = super(Message, self).create(values_list)
+ messages = super().create(values_list)
# link back attachments to records, to filter out attachments linked to
# the same records as the message (considered as ok if message is ok)
@@ -692,7 +691,7 @@ def read(self, fields=None, load='_classic_read'):
""" Override to explicitely call check_access(), that is not called
by the ORM. It instead directly fetches ir.rules and apply them. """
self.check_access('read')
- return super(Message, self).read(fields=fields, load=load)
+ return super().read(fields=fields, load=load)
def fetch(self, field_names):
# This freaky hack is aimed at reading data without the overhead of
@@ -709,7 +708,7 @@ def write(self, vals):
raise AccessError(_("Only administrators can modify 'model' and 'res_id' fields."))
if record_changed or 'message_type' in vals:
self._invalidate_documents()
- res = super(Message, self).write(vals)
+ res = super().write(vals)
if vals.get('attachment_ids'):
for mail in self:
mail.attachment_ids.check(mode='read')
@@ -736,13 +735,13 @@ def unlink(self):
# Notify front-end of messages deletion for partners having a user
for partner, messages in messages_by_partner.items():
partner._bus_send("mail.message/delete", {"message_ids": messages.ids})
- return super(Message, self).unlink()
+ return super().unlink()
def export_data(self, fields_to_export):
if not self.env.is_admin():
raise AccessError(_("Only administrators are allowed to export mail message"))
- return super(Message, self).export_data(fields_to_export)
+ return super().export_data(fields_to_export)
# ------------------------------------------------------
# ACTIONS
diff --git a/addons/mail/models/mail_message_reaction.py b/addons/mail/models/mail_message_reaction.py
index 308a2c9383880..1f091b360499f 100644
--- a/addons/mail/models/mail_message_reaction.py
+++ b/addons/mail/models/mail_message_reaction.py
@@ -6,7 +6,6 @@
class MailMessageReaction(models.Model):
- _name = 'mail.message.reaction'
_description = 'Message Reaction'
_order = 'id desc'
_log_access = False
diff --git a/addons/mail/models/mail_message_schedule.py b/addons/mail/models/mail_message_schedule.py
index e8fa207404ba5..bbc822715c1ac 100644
--- a/addons/mail/models/mail_message_schedule.py
+++ b/addons/mail/models/mail_message_schedule.py
@@ -19,7 +19,6 @@ class MailMessageSchedule(models.Model):
exists on the but it does not allow us to delay the sending
of the notifications.
"""
- _name = 'mail.message.schedule'
_description = 'Scheduled Messages'
_order = 'scheduled_datetime DESC, id DESC'
_rec_name = 'mail_message_id'
diff --git a/addons/mail/models/mail_message_subtype.py b/addons/mail/models/mail_message_subtype.py
index f75ab4f94d627..334c9216d297d 100644
--- a/addons/mail/models/mail_message_subtype.py
+++ b/addons/mail/models/mail_message_subtype.py
@@ -8,7 +8,6 @@ class MailMessageSubtype(models.Model):
""" Class holding subtype definition for messages. Subtypes allow to tune
the follower subscription, allowing only some subtypes to be pushed
on the Wall. """
- _name = 'mail.message.subtype'
_description = 'Message subtypes'
_order = 'sequence, id'
diff --git a/addons/mail/models/mail_message_translation.py b/addons/mail/models/mail_message_translation.py
index f20ffc41f68cb..eff8c8641e163 100644
--- a/addons/mail/models/mail_message_translation.py
+++ b/addons/mail/models/mail_message_translation.py
@@ -5,8 +5,7 @@
from odoo import api, fields, models
-class MessageTranslation(models.Model):
- _name = "mail.message.translation"
+class MailMessageTranslation(models.Model):
_description = "Message Translation"
message_id = fields.Many2one("mail.message", "Message", required=True, ondelete="cascade")
diff --git a/addons/mail/models/mail_notification.py b/addons/mail/models/mail_notification.py
index 2a701281fa898..9eb6119f24260 100644
--- a/addons/mail/models/mail_notification.py
+++ b/addons/mail/models/mail_notification.py
@@ -9,7 +9,6 @@
class MailNotification(models.Model):
- _name = 'mail.notification'
_table = 'mail_notification'
_rec_name = 'res_partner_id'
_log_access = False
diff --git a/addons/mail/models/mail_push.py b/addons/mail/models/mail_push.py
index 6bf8fc35133c9..d4dfd3e997f43 100644
--- a/addons/mail/models/mail_push.py
+++ b/addons/mail/models/mail_push.py
@@ -12,7 +12,6 @@
class MailPush(models.Model):
- _name = 'mail.push'
_description = "Push Notifications"
mail_push_device_id = fields.Many2one('mail.push.device', string='devices', required=True, ondelete="cascade")
diff --git a/addons/mail/models/mail_push_device.py b/addons/mail/models/mail_push_device.py
index 1422113c79371..8535bcd37a4c0 100644
--- a/addons/mail/models/mail_push_device.py
+++ b/addons/mail/models/mail_push_device.py
@@ -11,7 +11,6 @@
class MailPushDevice(models.Model):
- _name = 'mail.push.device'
_description = "Push Notification Device"
partner_id = fields.Many2one(
diff --git a/addons/mail/models/mail_render_mixin.py b/addons/mail/models/mail_render_mixin.py
index 112f2b0beb133..51fe24014d3ae 100644
--- a/addons/mail/models/mail_render_mixin.py
+++ b/addons/mail/models/mail_render_mixin.py
@@ -39,8 +39,8 @@ def format_time(env, time, tz=False, time_format='medium', lang_code=False):
except babel.core.UnknownLocaleError:
return time
+
class MailRenderMixin(models.AbstractModel):
- _name = 'mail.render.mixin'
_description = 'Mail Render Mixin'
# If True, we trust the value on the model for rendering
diff --git a/addons/mail/models/mail_scheduled_message.py b/addons/mail/models/mail_scheduled_message.py
index 2285c02eb4db3..b8782f2153939 100644
--- a/addons/mail/models/mail_scheduled_message.py
+++ b/addons/mail/models/mail_scheduled_message.py
@@ -13,7 +13,7 @@
_logger = logging.getLogger(__name__)
-class ScheduledMessage(models.Model):
+class MailScheduledMessage(models.Model):
""" Scheduled message model (holds post values generated by the composer to delay the
posting of the message). Different from mail.message.schedule that posts the message but
delays the notification process.
@@ -27,7 +27,6 @@ class ScheduledMessage(models.Model):
have static notification parameters, but some will become dynamic when adding mass_mail support
such as 'email_from' and 'force_email_lang'.
"""
- _name = 'mail.scheduled.message'
_description = 'Scheduled Message'
# content
@@ -76,7 +75,7 @@ def create(self, vals_list):
self._check(vals)
# clean context to prevent usage of default_model and default_res_id
- scheduled_messages = super(ScheduledMessage, self.with_context(clean_context(self.env.context))).create(vals_list)
+ scheduled_messages = super(MailScheduledMessage, self.with_context(clean_context(self.env.context))).create(vals_list)
# transfer attachments from composer to scheduled messages
for scheduled_message in scheduled_messages:
if attachments := scheduled_message.attachment_ids:
diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py
index cc4dc49827614..fff5eda23d144 100644
--- a/addons/mail/models/mail_template.py
+++ b/addons/mail/models/mail_template.py
@@ -16,7 +16,6 @@
class MailTemplate(models.Model):
"Templates for sending email"
- _name = "mail.template"
_inherit = ['mail.render.mixin', 'template.reset.mixin']
_description = 'Email Templates'
_order = 'user_id,name,id'
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index a464d6b1dc6b5..32a2d9bb5cd3f 100644
--- a/addons/mail/models/mail_thread.py
+++ b/addons/mail/models/mail_thread.py
@@ -84,7 +84,6 @@ class MailThread(models.AbstractModel):
- ``mail_notify_force_send``: if less than 50 email notifications to send,
send them directly instead of using the queue; True by default
'''
- _name = 'mail.thread'
_description = 'Email Thread'
_mail_flat_thread = True # flatten the discussion history
_mail_post_access = 'write' # access required on the document to post on it
diff --git a/addons/mail/models/mail_thread_blacklist.py b/addons/mail/models/mail_thread_blacklist.py
index d4cc898902747..60d5603dd4ae3 100644
--- a/addons/mail/models/mail_thread_blacklist.py
+++ b/addons/mail/models/mail_thread_blacklist.py
@@ -6,7 +6,7 @@
from odoo.tools import SQL
-class MailBlackListMixin(models.AbstractModel):
+class MailThreadBlacklist(models.AbstractModel):
""" Mixin that is inherited by all model with opt out. This mixin stores a normalized
email based on primary_email field.
@@ -26,7 +26,6 @@ class MailBlackListMixin(models.AbstractModel):
Mail Thread capabilities are required for this mixin. """
- _name = 'mail.thread.blacklist'
_inherit = ['mail.thread']
_description = 'Mail Blacklist mixin'
_primary_email = 'email'
@@ -101,14 +100,14 @@ def _assert_primary_email(self):
def _message_receive_bounce(self, email, partner):
""" Override of mail.thread generic method. Purpose is to increment the
bounce counter of the record. """
- super(MailBlackListMixin, self)._message_receive_bounce(email, partner)
+ super()._message_receive_bounce(email, partner)
for record in self:
record.message_bounce = record.message_bounce + 1
def _message_reset_bounce(self, email):
""" Override of mail.thread generic method. Purpose is to reset the
bounce counter of the record. """
- super(MailBlackListMixin, self)._message_reset_bounce(email)
+ super()._message_reset_bounce(email)
self.write({'message_bounce': 0})
def mail_action_blacklist_remove(self):
diff --git a/addons/mail/models/mail_thread_cc.py b/addons/mail/models/mail_thread_cc.py
index 7e36bd514ac4c..3e83cf5a2fbfe 100644
--- a/addons/mail/models/mail_thread_cc.py
+++ b/addons/mail/models/mail_thread_cc.py
@@ -4,9 +4,8 @@
from odoo import _, api, fields, models, tools
-class MailCCMixin(models.AbstractModel):
- _name = 'mail.thread.cc'
- _inherit = 'mail.thread'
+class MailThreadCc(models.AbstractModel):
+ _inherit = ['mail.thread']
_description = 'Email CC management'
email_cc = fields.Char('Email cc')
@@ -28,7 +27,7 @@ def message_new(self, msg_dict, custom_values=None):
'email_cc': ", ".join(self._mail_cc_sanitized_raw_dict(msg_dict.get('cc')).values()),
}
cc_values.update(custom_values)
- return super(MailCCMixin, self).message_new(msg_dict, cc_values)
+ return super().message_new(msg_dict, cc_values)
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'''
@@ -41,7 +40,7 @@ def message_update(self, msg_dict, update_vals=None):
new_cc.update(old_cc)
cc_values['email_cc'] = ", ".join(new_cc.values())
cc_values.update(update_vals)
- return super(MailCCMixin, self).message_update(msg_dict, cc_values)
+ return super().message_update(msg_dict, cc_values)
def _message_get_suggested_recipients(self):
recipients = super()._message_get_suggested_recipients()
diff --git a/addons/mail/models/mail_thread_main_attachment.py b/addons/mail/models/mail_thread_main_attachment.py
index 4be34f0fc4401..b2407709c84b6 100644
--- a/addons/mail/models/mail_thread_main_attachment.py
+++ b/addons/mail/models/mail_thread_main_attachment.py
@@ -5,11 +5,10 @@
from odoo.addons.mail.tools.discuss import Store
-class MailMainAttachmentMixin(models.AbstractModel):
+class MailThreadMainAttachment(models.AbstractModel):
""" Mixin that adds main attachment support to the MailThread class. """
- _name = 'mail.thread.main.attachment'
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
_description = 'Mail Main Attachment management'
message_main_attachment_id = fields.Many2one(string="Main Attachment", comodel_name='ir.attachment', copy=False)
diff --git a/addons/mail/models/mail_tracking_duration_mixin.py b/addons/mail/models/mail_tracking_duration_mixin.py
index 1744f3233ef03..f86f1f638caa2 100644
--- a/addons/mail/models/mail_tracking_duration_mixin.py
+++ b/addons/mail/models/mail_tracking_duration_mixin.py
@@ -4,7 +4,6 @@
class MailTrackingDurationMixin(models.AbstractModel):
- _name = "mail.tracking.duration.mixin"
_description = "Mixin to compute the time a record has spent in each value a many2one field can take"
duration_tracking = fields.Json(
diff --git a/addons/mail/models/mail_tracking_value.py b/addons/mail/models/mail_tracking_value.py
index 432b0840cf3e1..16ec0b2ea1ff1 100644
--- a/addons/mail/models/mail_tracking_value.py
+++ b/addons/mail/models/mail_tracking_value.py
@@ -6,8 +6,7 @@
from odoo import api, fields, models
-class MailTracking(models.Model):
- _name = 'mail.tracking.value'
+class MailTrackingValue(models.Model):
_description = 'Mail Tracking Value'
_rec_name = 'field_id'
_order = 'id DESC'
diff --git a/addons/mail/models/models.py b/addons/mail/models/models.py
index 78b9a2f5243b9..6d3fb1caa5046 100644
--- a/addons/mail/models/models.py
+++ b/addons/mail/models/models.py
@@ -13,8 +13,11 @@
_logger = logging.getLogger(__name__)
+
class BaseModel(models.AbstractModel):
- _inherit = 'base'
+ _name = "base"
+
+ _inherit = ['base']
def _valid_field_parameter(self, field, name):
# allow tracking on abstract models; see also 'mail.thread'
diff --git a/addons/mail/models/res_company.py b/addons/mail/models/res_company.py
index 75a8a9f749baf..520a9015a00b1 100644
--- a/addons/mail/models/res_company.py
+++ b/addons/mail/models/res_company.py
@@ -4,9 +4,8 @@
from odoo import api, models, fields, tools
-class Company(models.Model):
- _name = 'res.company'
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
def _default_alias_domain_id(self):
return self.env['mail.alias.domain'].search([], limit=1)
diff --git a/addons/mail/models/res_config_settings.py b/addons/mail/models/res_config_settings.py
index 5193dc83bad22..0cb296bd9fe84 100644
--- a/addons/mail/models/res_config_settings.py
+++ b/addons/mail/models/res_config_settings.py
@@ -10,7 +10,7 @@
class ResConfigSettings(models.TransientModel):
""" Inherit the base settings to add a counter of failed email + configure
the alias domain. """
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
external_email_server_default = fields.Boolean(
"Use Custom Email Servers",
diff --git a/addons/mail/models/res_partner.py b/addons/mail/models/res_partner.py
index 1bb5c11a86a30..6365197a1f49c 100644
--- a/addons/mail/models/res_partner.py
+++ b/addons/mail/models/res_partner.py
@@ -8,10 +8,10 @@
from odoo.osv import expression
from odoo.addons.mail.tools.discuss import Store
-class Partner(models.Model):
+
+class ResPartner(models.Model):
""" Update partner to add a field about notification preferences. Add a generic opt-out field that can be used
to restrict usage of automatic email templates. """
- _name = "res.partner"
_inherit = ['res.partner', 'mail.activity.mixin', 'mail.thread.blacklist']
_mail_flat_thread = False
diff --git a/addons/mail/models/res_users.py b/addons/mail/models/res_users.py
index 4d429d404a79f..31afbf6eb5f39 100644
--- a/addons/mail/models/res_users.py
+++ b/addons/mail/models/res_users.py
@@ -7,14 +7,13 @@
from odoo.addons.mail.tools.discuss import Store
-class Users(models.Model):
+class ResUsers(models.Model):
""" Update of res.users class
- add a preference about sending emails about notifications
- make a new user follow itself
- add a welcome message
- add suggestion preference
"""
- _name = 'res.users'
_inherit = ['res.users']
notification_type = fields.Selection([
@@ -73,7 +72,7 @@ def SELF_WRITEABLE_FIELDS(self):
@api.model_create_multi
def create(self, vals_list):
- users = super(Users, self).create(vals_list)
+ users = super().create(vals_list)
# log a portal status change (manual tracking)
log_portal_access = not self._context.get('mail_create_nolog') and not self._context.get('mail_notrack')
@@ -105,7 +104,7 @@ def write(self, vals):
if 'notification_type' in vals:
user_notification_type_modified = self.filtered(lambda user: user.notification_type != vals['notification_type'])
- write_res = super(Users, self).write(vals)
+ write_res = super().write(vals)
# log a portal status change (manual tracking)
if log_portal_access:
@@ -156,7 +155,7 @@ def write(self, vals):
def action_archive(self):
activities_to_delete = self.env['mail.activity'].search([('user_id', 'in', self.ids)])
activities_to_delete.unlink()
- return super(Users, self).action_archive()
+ return super().action_archive()
def _notify_security_setting_update(self, subject, content, mail_values=None, **kwargs):
""" This method is meant to be called whenever a sensitive update is done on the user's account.
@@ -245,7 +244,7 @@ def _deactivate_portal_user(self, **post):
else:
users_to_blacklist = []
- super(Users, self)._deactivate_portal_user(**post)
+ super()._deactivate_portal_user(**post)
for user, user_email in users_to_blacklist:
self.env['mail.blacklist']._add(
diff --git a/addons/mail/models/res_users_settings.py b/addons/mail/models/res_users_settings.py
index aedd9337f4580..eb0f32022f6ac 100644
--- a/addons/mail/models/res_users_settings.py
+++ b/addons/mail/models/res_users_settings.py
@@ -4,7 +4,7 @@
class ResUsersSettings(models.Model):
- _inherit = 'res.users.settings'
+ _inherit = ['res.users.settings']
is_discuss_sidebar_category_channel_open = fields.Boolean(string="Is discuss sidebar category channel open?", default=True)
is_discuss_sidebar_category_chat_open = fields.Boolean(string="Is discuss sidebar category chat open?", default=True)
diff --git a/addons/mail/models/res_users_settings_volumes.py b/addons/mail/models/res_users_settings_volumes.py
index 4d037555b7368..0a52d73e3f796 100644
--- a/addons/mail/models/res_users_settings_volumes.py
+++ b/addons/mail/models/res_users_settings_volumes.py
@@ -6,7 +6,6 @@
class ResUsersSettingsVolumes(models.Model):
""" Represents the volume of the sound that the user of user_setting_id will receive from partner_id. """
- _name = 'res.users.settings.volumes'
_description = 'User Settings Volumes'
user_setting_id = fields.Many2one('res.users.settings', required=True, ondelete='cascade', index=True)
diff --git a/addons/mail/models/template_reset_mixin.py b/addons/mail/models/template_reset_mixin.py
index 120936a05d87d..b03ecff260426 100644
--- a/addons/mail/models/template_reset_mixin.py
+++ b/addons/mail/models/template_reset_mixin.py
@@ -14,7 +14,6 @@
class TemplateResetMixin(models.AbstractModel):
- _name = "template.reset.mixin"
_description = 'Template Reset Mixin'
template_fs = fields.Char(
diff --git a/addons/mail/models/update.py b/addons/mail/models/update.py
index 06713a8681063..6b462112317ea 100644
--- a/addons/mail/models/update.py
+++ b/addons/mail/models/update.py
@@ -15,8 +15,7 @@
_logger = logging.getLogger(__name__)
-class PublisherWarrantyContract(AbstractModel):
- _name = "publisher_warranty.contract"
+class Publisher_WarrantyContract(AbstractModel):
_description = 'Publisher Warranty Contract'
@api.model
diff --git a/addons/mail/wizard/base_module_uninstall.py b/addons/mail/wizard/base_module_uninstall.py
index 43e029ba85147..35b4832d80bd2 100644
--- a/addons/mail/wizard/base_module_uninstall.py
+++ b/addons/mail/wizard/base_module_uninstall.py
@@ -5,7 +5,7 @@
class BaseModuleUninstall(models.TransientModel):
- _inherit = "base.module.uninstall"
+ _inherit = ["base.module.uninstall"]
def _get_models(self):
# consider mail-thread models only
diff --git a/addons/mail/wizard/base_partner_merge_automatic_wizard.py b/addons/mail/wizard/base_partner_merge_automatic_wizard.py
index 974b6f56bda1e..bb1f5d532e312 100644
--- a/addons/mail/wizard/base_partner_merge_automatic_wizard.py
+++ b/addons/mail/wizard/base_partner_merge_automatic_wizard.py
@@ -4,12 +4,12 @@
from odoo.tools import format_list
-class MergePartnerAutomatic(models.TransientModel):
+class BasePartnerMergeAutomaticWizard(models.TransientModel):
- _inherit = 'base.partner.merge.automatic.wizard'
+ _inherit = ['base.partner.merge.automatic.wizard']
def _log_merge_operation(self, src_partners, dst_partner):
- super(MergePartnerAutomatic, self)._log_merge_operation(src_partners, dst_partner)
+ super()._log_merge_operation(src_partners, dst_partner)
dst_partner.message_post(
body=self.env._(
"Merged with the following partners: %s",
diff --git a/addons/mail/wizard/mail_activity_schedule.py b/addons/mail/wizard/mail_activity_schedule.py
index 4697b440676dc..9afcc00791195 100644
--- a/addons/mail/wizard/mail_activity_schedule.py
+++ b/addons/mail/wizard/mail_activity_schedule.py
@@ -12,7 +12,6 @@
class MailActivitySchedule(models.TransientModel):
- _name = 'mail.activity.schedule'
_description = 'Activity schedule plan Wizard'
_batch_size = 500
diff --git a/addons/mail/wizard/mail_blacklist_remove.py b/addons/mail/wizard/mail_blacklist_remove.py
index f4347d54b9d9a..896ebc3ee7f30 100644
--- a/addons/mail/wizard/mail_blacklist_remove.py
+++ b/addons/mail/wizard/mail_blacklist_remove.py
@@ -5,7 +5,6 @@
class MailBlacklistRemove(models.TransientModel):
- _name = 'mail.blacklist.remove'
_description = 'Remove email from blacklist wizard'
email = fields.Char(name="Email", readonly=True, required=True)
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index 7a2c1294d1965..248fdaf009e59 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -27,7 +27,7 @@ def _reopen(self, res_id, model, context=None):
}
-class MailComposer(models.TransientModel):
+class MailComposeMessage(models.TransientModel):
""" Generic message composition wizard. You may inherit from this wizard
at model and view levels to provide specific features.
@@ -37,8 +37,7 @@ class MailComposer(models.TransientModel):
contain template placeholders that will be merged with actual data
before being sent to each recipient.
"""
- _name = 'mail.compose.message'
- _inherit = 'mail.composer.mixin'
+ _inherit = ['mail.composer.mixin']
_description = 'Email composition wizard'
_log_access = True
_batch_size = 50
@@ -623,11 +622,11 @@ def _compute_can_edit_body(self):
"""
non_mass_mail = self.filtered(lambda m: m.composition_mode != 'mass_mail')
non_mass_mail.can_edit_body = True
- super(MailComposer, self - non_mass_mail)._compute_can_edit_body()
+ super(MailComposeMessage, self - non_mass_mail)._compute_can_edit_body()
def _compute_field_value(self, field):
if field.compute_sudo:
- return super(MailComposer, self.with_context(prefetch_fields=False))._compute_field_value(field)
+ return super(MailComposeMessage, self.with_context(prefetch_fields=False))._compute_field_value(field)
return super()._compute_field_value(field)
# ------------------------------------------------------------
diff --git a/addons/mail/wizard/mail_resend_message.py b/addons/mail/wizard/mail_resend_message.py
index 75b5e64628899..0504225a77984 100644
--- a/addons/mail/wizard/mail_resend_message.py
+++ b/addons/mail/wizard/mail_resend_message.py
@@ -6,7 +6,6 @@
class MailResendMessage(models.TransientModel):
- _name = 'mail.resend.message'
_description = 'Email resend wizard'
mail_message_id = fields.Many2one('mail.message', 'Message', readonly=True)
@@ -81,8 +80,7 @@ def cancel_mail_action(self):
return {'type': 'ir.actions.act_window_close'}
-class PartnerResend(models.TransientModel):
- _name = 'mail.resend.partner'
+class MailResendPartner(models.TransientModel):
_description = 'Partner with additional information for mail resend'
notification_id = fields.Many2one('mail.notification', string='Notification', required=True, ondelete='cascade')
diff --git a/addons/mail/wizard/mail_template_preview.py b/addons/mail/wizard/mail_template_preview.py
index 0f9708aa55415..9a360f344449a 100644
--- a/addons/mail/wizard/mail_template_preview.py
+++ b/addons/mail/wizard/mail_template_preview.py
@@ -6,7 +6,6 @@
class MailTemplatePreview(models.TransientModel):
- _name = 'mail.template.preview'
_description = 'Email Template Preview'
_MAIL_TEMPLATE_FIELDS = ['attachment_ids',
'body_html',
diff --git a/addons/mail/wizard/mail_template_reset.py b/addons/mail/wizard/mail_template_reset.py
index 33036193b1dec..3cd4145d293b7 100644
--- a/addons/mail/wizard/mail_template_reset.py
+++ b/addons/mail/wizard/mail_template_reset.py
@@ -5,7 +5,6 @@
class MailTemplateReset(models.TransientModel):
- _name = 'mail.template.reset'
_description = 'Mail Template Reset'
template_ids = fields.Many2many('mail.template')
diff --git a/addons/mail/wizard/mail_wizard_invite.py b/addons/mail/wizard/mail_wizard_invite.py
index dcb40ef087a95..cfa97aa7745d6 100644
--- a/addons/mail/wizard/mail_wizard_invite.py
+++ b/addons/mail/wizard/mail_wizard_invite.py
@@ -9,9 +9,8 @@
from odoo.exceptions import UserError
-class Invite(models.TransientModel):
+class MailWizardInvite(models.TransientModel):
""" Wizard to invite partners (or channels) and make them followers. """
- _name = 'mail.wizard.invite'
_description = 'Invite wizard'
res_model = fields.Char('Related Document Model', required=True, help='Model of the followed resource')
diff --git a/addons/mail_bot/models/discuss_channel.py b/addons/mail_bot/models/discuss_channel.py
index 9d37b1f7345b0..7113171142d28 100644
--- a/addons/mail_bot/models/discuss_channel.py
+++ b/addons/mail_bot/models/discuss_channel.py
@@ -4,8 +4,8 @@
from odoo import api, models, _
-class Channel(models.Model):
- _inherit = 'discuss.channel'
+class DiscussChannel(models.Model):
+ _inherit = ['discuss.channel']
def execute_command_help(self, **kwargs):
super().execute_command_help(**kwargs)
diff --git a/addons/mail_bot/models/ir_http.py b/addons/mail_bot/models/ir_http.py
index 42471a9888b49..cf304e581a280 100644
--- a/addons/mail_bot/models/ir_http.py
+++ b/addons/mail_bot/models/ir_http.py
@@ -4,11 +4,11 @@
from odoo import models
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
def session_info(self):
- res = super(Http, self).session_info()
+ res = super().session_info()
if self.env.user._is_internal():
res['odoobot_initialized'] = self.env.user.odoobot_state not in [False, 'not_initialized']
return res
diff --git a/addons/mail_bot/models/mail_bot.py b/addons/mail_bot/models/mail_bot.py
index 1a449158e631b..db2d034f1959b 100644
--- a/addons/mail_bot/models/mail_bot.py
+++ b/addons/mail_bot/models/mail_bot.py
@@ -9,7 +9,6 @@
class MailBot(models.AbstractModel):
- _name = 'mail.bot'
_description = 'Mail Bot'
def _apply_logic(self, record, values, command=None):
diff --git a/addons/mail_bot/models/mail_thread.py b/addons/mail_bot/models/mail_thread.py
index e1be43e7ca215..a8325b0f49212 100644
--- a/addons/mail_bot/models/mail_thread.py
+++ b/addons/mail_bot/models/mail_thread.py
@@ -5,7 +5,7 @@
class MailThread(models.AbstractModel):
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
def _message_post_after_hook(self, message, msg_vals):
self.env['mail.bot']._apply_logic(self, msg_vals)
diff --git a/addons/mail_bot/models/res_users.py b/addons/mail_bot/models/res_users.py
index f6c12893fd2a0..6dba1906dfd1a 100644
--- a/addons/mail_bot/models/res_users.py
+++ b/addons/mail_bot/models/res_users.py
@@ -4,8 +4,9 @@
from odoo import models, fields, _
-class Users(models.Model):
- _inherit = 'res.users'
+
+class ResUsers(models.Model):
+ _inherit = ['res.users']
odoobot_state = fields.Selection(
[
diff --git a/addons/mail_group/models/mail_group.py b/addons/mail_group/models/mail_group.py
index 3b1f0c27d503b..575ee676881a7 100644
--- a/addons/mail_group/models/mail_group.py
+++ b/addons/mail_group/models/mail_group.py
@@ -31,7 +31,6 @@ class MailGroup(models.Model):
group messages. Moderation can be activated on groups. In that case email have to
be validated or rejected.
"""
- _name = 'mail.group'
_description = 'Mail Group'
# TDE CHECK: use blaclist mixin
_inherit = ['mail.alias.mixin']
diff --git a/addons/mail_group/models/mail_group_member.py b/addons/mail_group/models/mail_group_member.py
index 3bb07d0a3e6c1..97f58e64f2933 100644
--- a/addons/mail_group/models/mail_group_member.py
+++ b/addons/mail_group/models/mail_group_member.py
@@ -11,7 +11,6 @@
class MailGroupMember(models.Model):
"""Models a group member that can be either an email address either a full partner."""
- _name = 'mail.group.member'
_description = 'Mailing List Member'
_rec_name = 'email'
diff --git a/addons/mail_group/models/mail_group_message.py b/addons/mail_group/models/mail_group_message.py
index d5db0ab5e0f51..7ecfe426204fa 100644
--- a/addons/mail_group/models/mail_group_message.py
+++ b/addons/mail_group/models/mail_group_message.py
@@ -19,7 +19,6 @@ class MailGroupMessage(models.Model):
Those are build on with additional information related to specific
features of like better parent / children management and moderation.
"""
- _name = 'mail.group.message'
_description = 'Mailing List Message'
_rec_name = 'subject'
_order = 'create_date DESC'
diff --git a/addons/mail_group/models/mail_group_moderation.py b/addons/mail_group/models/mail_group_moderation.py
index cbfd7c8c45b59..8d97328923f9c 100644
--- a/addons/mail_group/models/mail_group_moderation.py
+++ b/addons/mail_group/models/mail_group_moderation.py
@@ -8,7 +8,6 @@
class MailGroupModeration(models.Model):
"""Represent the moderation rules for an email address in a group."""
- _name = 'mail.group.moderation'
_description = 'Mailing List black/white list'
email = fields.Char(string='Email', required=True)
diff --git a/addons/mail_group/wizard/mail_group_message_reject.py b/addons/mail_group/wizard/mail_group_message_reject.py
index 7b726adb09342..7d5a7ba0c2ad2 100644
--- a/addons/mail_group/wizard/mail_group_message_reject.py
+++ b/addons/mail_group/wizard/mail_group_message_reject.py
@@ -5,7 +5,6 @@
class MailGroupMessageReject(models.TransientModel):
- _name = 'mail.group.message.reject'
_description = 'Reject Group Message'
subject = fields.Char('Subject', store=True, readonly=False, compute='_compute_subject')
diff --git a/addons/mail_plugin/models/ir_http.py b/addons/mail_plugin/models/ir_http.py
index 9cf3028334bbf..e5ba17b2f4046 100644
--- a/addons/mail_plugin/models/ir_http.py
+++ b/addons/mail_plugin/models/ir_http.py
@@ -6,8 +6,9 @@
from odoo import models
from odoo.http import request
+
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _auth_method_outlook(cls):
diff --git a/addons/mail_plugin/models/res_partner.py b/addons/mail_plugin/models/res_partner.py
index 3dbdd240a7178..a3b84c120a0ba 100644
--- a/addons/mail_plugin/models/res_partner.py
+++ b/addons/mail_plugin/models/res_partner.py
@@ -3,7 +3,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
iap_enrich_info = fields.Text('IAP Enrich Info', help='IAP response stored as a JSON string',
compute='_compute_partner_iap_info')
diff --git a/addons/mail_plugin/models/res_partner_iap.py b/addons/mail_plugin/models/res_partner_iap.py
index be03a0ad4e3fb..d1a40877547db 100644
--- a/addons/mail_plugin/models/res_partner_iap.py
+++ b/addons/mail_plugin/models/res_partner_iap.py
@@ -16,7 +16,6 @@ class ResPartnerIap(models.Model):
IAP information.
"""
- _name = 'res.partner.iap'
_description = 'Partner IAP'
partner_id = fields.Many2one('res.partner', string='Partner',
diff --git a/addons/maintenance/models/maintenance.py b/addons/maintenance/models/maintenance.py
index 8e75155727b8c..07ff9fe888026 100644
--- a/addons/maintenance/models/maintenance.py
+++ b/addons/maintenance/models/maintenance.py
@@ -10,7 +10,6 @@
class MaintenanceStage(models.Model):
""" Model for case stages. This models the main stages of a Maintenance Request management flow. """
- _name = 'maintenance.stage'
_description = 'Maintenance Stage'
_order = 'sequence, id'
@@ -21,7 +20,6 @@ class MaintenanceStage(models.Model):
class MaintenanceEquipmentCategory(models.Model):
- _name = 'maintenance.equipment.category'
_inherit = ['mail.alias.mixin', 'mail.thread']
_description = 'Maintenance Equipment Category'
@@ -78,7 +76,6 @@ def _alias_get_creation_values(self):
class MaintenanceMixin(models.AbstractModel):
- _name = 'maintenance.mixin'
_check_company_auto = True
_description = 'Maintenance Maintained Item'
@@ -119,7 +116,6 @@ def _compute_maintenance_count(self):
class MaintenanceEquipment(models.Model):
- _name = 'maintenance.equipment'
_inherit = ['mail.thread', 'mail.activity.mixin', 'maintenance.mixin']
_description = 'Maintenance Equipment'
_check_company_auto = True
@@ -208,7 +204,6 @@ def action_open_matched_serial(self):
class MaintenanceRequest(models.Model):
- _name = 'maintenance.request'
_inherit = ['mail.thread.cc', 'mail.activity.mixin']
_description = 'Maintenance Request'
_order = "id desc"
@@ -401,7 +396,6 @@ def _read_group_stage_ids(self, stages, domain):
class MaintenanceTeam(models.Model):
- _name = 'maintenance.team'
_description = 'Maintenance Teams'
name = fields.Char('Team Name', required=True, translate=True)
diff --git a/addons/maintenance/models/res_config_settings.py b/addons/maintenance/models/res_config_settings.py
index 5c5887443c3f1..f4ce82dfb0dc7 100644
--- a/addons/maintenance/models/res_config_settings.py
+++ b/addons/maintenance/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
module_maintenance_worksheet = fields.Boolean(string="Custom Maintenance Worksheets")
diff --git a/addons/marketing_card/models/card_campaign.py b/addons/marketing_card/models/card_campaign.py
index 91338ffe6630e..2cbf123884b5c 100644
--- a/addons/marketing_card/models/card_campaign.py
+++ b/addons/marketing_card/models/card_campaign.py
@@ -6,7 +6,6 @@
class CardCampaign(models.Model):
- _name = 'card.campaign'
_description = 'Marketing Card Campaign'
_inherit = ['mail.activity.mixin', 'mail.render.mixin', 'mail.thread']
_order = 'id DESC'
diff --git a/addons/marketing_card/models/card_campaign_tag.py b/addons/marketing_card/models/card_campaign_tag.py
index ecbc220688246..ec4f2b4284ce3 100644
--- a/addons/marketing_card/models/card_campaign_tag.py
+++ b/addons/marketing_card/models/card_campaign_tag.py
@@ -4,7 +4,6 @@
class CardCampaignTag(models.Model):
- _name = 'card.campaign.tag'
_description = 'Marketing Card Campaign Tag'
def _get_default_color(self):
diff --git a/addons/marketing_card/models/card_card.py b/addons/marketing_card/models/card_card.py
index c718fae7c00b8..6d828dd67a20e 100644
--- a/addons/marketing_card/models/card_card.py
+++ b/addons/marketing_card/models/card_card.py
@@ -3,9 +3,8 @@
from odoo import api, fields, models
-class MarketingCard(models.Model):
+class CardCard(models.Model):
"""Mapping from a unique ID to a 'sharer' of a campaign. Storing state of sharing and their specific card."""
- _name = 'card.card'
_description = 'Marketing Card'
active = fields.Boolean('Active', default=True)
diff --git a/addons/marketing_card/models/card_template.py b/addons/marketing_card/models/card_template.py
index 851789115ad05..300bac320d1ce 100644
--- a/addons/marketing_card/models/card_template.py
+++ b/addons/marketing_card/models/card_template.py
@@ -8,8 +8,7 @@
TEMPLATE_RATIO = 40 / 21
-class CardCampaignTemplate(models.Model):
- _name = 'card.template'
+class CardTemplate(models.Model):
_description = 'Marketing Card Template'
name = fields.Char(required=True)
diff --git a/addons/marketing_card/models/mailing_mailing.py b/addons/marketing_card/models/mailing_mailing.py
index 9983345a1acb4..48b99bd135c9e 100644
--- a/addons/marketing_card/models/mailing_mailing.py
+++ b/addons/marketing_card/models/mailing_mailing.py
@@ -1,9 +1,8 @@
from odoo import _, api, exceptions, fields, models, osv
-class MassMailing(models.Model):
- _name = 'mailing.mailing'
- _inherit = 'mailing.mailing'
+class MailingMailing(models.Model):
+ _inherit = ['mailing.mailing']
mailing_model_id = fields.Many2one(compute="_compute_mailing_model_id", store=True, readonly=False)
card_requires_sync_count = fields.Integer(compute="_compute_card_requires_sync_count")
diff --git a/addons/marketing_card/models/utm_source.py b/addons/marketing_card/models/utm_source.py
index 90e4a0db91819..d1e1bd479cbd7 100644
--- a/addons/marketing_card/models/utm_source.py
+++ b/addons/marketing_card/models/utm_source.py
@@ -2,7 +2,7 @@
class UtmSource(models.Model):
- _inherit = 'utm.source'
+ _inherit = ['utm.source']
@api.ondelete(at_uninstall=False)
def _unlink_except_utm_source_marketing_card(self):
diff --git a/addons/marketing_card/wizards/mail_compose_message.py b/addons/marketing_card/wizards/mail_compose_message.py
index e7454f80a813f..2901ffb4ecb39 100644
--- a/addons/marketing_card/wizards/mail_compose_message.py
+++ b/addons/marketing_card/wizards/mail_compose_message.py
@@ -8,7 +8,7 @@
class MailComposeMessage(models.TransientModel):
- _inherit = 'mail.compose.message'
+ _inherit = ['mail.compose.message']
def _prepare_mail_values_dynamic(self, res_ids):
"""Replace generic card urls with the specific res_id url."""
diff --git a/addons/mass_mailing/models/ir_http.py b/addons/mass_mailing/models/ir_http.py
index 3dd9ad508d421..d19f0baec8019 100644
--- a/addons/mass_mailing/models/ir_http.py
+++ b/addons/mass_mailing/models/ir_http.py
@@ -4,7 +4,7 @@
class IrHttp(models.AbstractModel):
- _inherit = "ir.http"
+ _inherit = ["ir.http"]
@classmethod
def _get_translation_frontend_modules_name(cls):
diff --git a/addons/mass_mailing/models/ir_mail_server.py b/addons/mass_mailing/models/ir_mail_server.py
index b94adf5905947..8a66cde9a814e 100644
--- a/addons/mass_mailing/models/ir_mail_server.py
+++ b/addons/mass_mailing/models/ir_mail_server.py
@@ -5,8 +5,7 @@
from odoo.tools.misc import format_date
-class IrMailServer(models.Model):
- _name = 'ir.mail_server'
+class IrMail_Server(models.Model):
_inherit = ['ir.mail_server']
active_mailing_ids = fields.One2many(
@@ -24,7 +23,7 @@ def format_usage(mailing_id):
details = _('(scheduled for %s)', format_date(self.env, mailing_id.schedule_date))
return f'{base} {details}'
- usages_super = super(IrMailServer, self)._active_usages_compute()
+ usages_super = super()._active_usages_compute()
default_mail_server_id = self.env['mailing.mailing']._get_default_mail_server_id()
for record in self:
usages = []
diff --git a/addons/mass_mailing/models/ir_model.py b/addons/mass_mailing/models/ir_model.py
index 6035a8ee635a8..51a0a5df25ae2 100644
--- a/addons/mass_mailing/models/ir_model.py
+++ b/addons/mass_mailing/models/ir_model.py
@@ -5,7 +5,7 @@
class IrModel(models.Model):
- _inherit = 'ir.model'
+ _inherit = ['ir.model']
is_mailing_enabled = fields.Boolean(
string="Mailing Enabled",
diff --git a/addons/mass_mailing/models/link_tracker.py b/addons/mass_mailing/models/link_tracker.py
index 0d7be46e35acd..122af05911fdf 100644
--- a/addons/mass_mailing/models/link_tracker.py
+++ b/addons/mass_mailing/models/link_tracker.py
@@ -5,13 +5,13 @@
class LinkTracker(models.Model):
- _inherit = "link.tracker"
+ _inherit = ["link.tracker"]
mass_mailing_id = fields.Many2one('mailing.mailing', string='Mass Mailing')
class LinkTrackerClick(models.Model):
- _inherit = "link.tracker.click"
+ _inherit = ["link.tracker.click"]
mailing_trace_id = fields.Many2one('mailing.trace', string='Mail Statistics', index='btree_not_null')
mass_mailing_id = fields.Many2one('mailing.mailing', string='Mass Mailing', index='btree_not_null')
diff --git a/addons/mass_mailing/models/mail_render_mixin.py b/addons/mass_mailing/models/mail_render_mixin.py
index 9864e74182dd7..6f57a75a083fe 100644
--- a/addons/mass_mailing/models/mail_render_mixin.py
+++ b/addons/mass_mailing/models/mail_render_mixin.py
@@ -5,7 +5,7 @@
class MailRenderMixin(models.AbstractModel):
- _inherit = "mail.render.mixin"
+ _inherit = ["mail.render.mixin"]
@api.model
def _render_template_postprocess(self, model, rendered):
diff --git a/addons/mass_mailing/models/mail_thread.py b/addons/mass_mailing/models/mail_thread.py
index b2426495bf184..0ec1d5531a65a 100644
--- a/addons/mass_mailing/models/mail_thread.py
+++ b/addons/mass_mailing/models/mail_thread.py
@@ -11,7 +11,7 @@
class MailThread(models.AbstractModel):
""" Update MailThread to add the support of bounce management in mass mailing traces. """
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
@api.model
def _message_route_process(self, message, message_dict, routes):
diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py
index 66597300c1503..4caa08f2417fb 100644
--- a/addons/mass_mailing/models/mailing.py
+++ b/addons/mass_mailing/models/mailing.py
@@ -37,9 +37,9 @@
mso_re = re.compile(r"\[if mso\]>[\s\S]* 0:
raise UserError(_("At least one of the mailing list you are trying to archive is used in an ongoing mailing campaign."))
- return super(MassMailingList, self).write(vals)
+ return super().write(vals)
@api.depends('contact_count')
def _compute_display_name(self):
diff --git a/addons/mass_mailing/models/mailing_subscription.py b/addons/mass_mailing/models/mailing_subscription.py
index 10f36e7f645c1..cbd3a5c8593fc 100644
--- a/addons/mass_mailing/models/mailing_subscription.py
+++ b/addons/mass_mailing/models/mailing_subscription.py
@@ -8,7 +8,6 @@ class MailingSubscription(models.Model):
""" Intermediate model between mass mailing list and mass mailing contact
Indicates if a contact is opted out for a particular list
"""
- _name = 'mailing.subscription'
_description = 'Mailing List Subscription'
_table = 'mailing_subscription'
_rec_name = 'contact_id'
diff --git a/addons/mass_mailing/models/mailing_subscription_optout.py b/addons/mass_mailing/models/mailing_subscription_optout.py
index a1dbe1fec13fa..292679ddf4950 100644
--- a/addons/mass_mailing/models/mailing_subscription_optout.py
+++ b/addons/mass_mailing/models/mailing_subscription_optout.py
@@ -4,9 +4,8 @@
from odoo import fields, models
-class MailingSubscriptionReason(models.Model):
+class MailingSubscriptionOptout(models.Model):
""" Reason for opting out of mailing lists or for blacklisting. """
- _name = 'mailing.subscription.optout'
_description = 'Mailing Subscription Reason'
_order = 'sequence ASC, create_date DESC, id DESC'
diff --git a/addons/mass_mailing/models/mailing_trace.py b/addons/mass_mailing/models/mailing_trace.py
index 21232ddb69084..423bd86dabf10 100644
--- a/addons/mass_mailing/models/mailing_trace.py
+++ b/addons/mass_mailing/models/mailing_trace.py
@@ -51,7 +51,6 @@ class MailingTrace(models.Model):
* bounced: triggered by gateway bounce (mail) or in _prepare_mass_sms_trace_values
if sms_number_format error when sending sms (sms)
"""
- _name = 'mailing.trace'
_description = 'Mailing Statistics'
_rec_name = 'id'
_order = 'create_date DESC'
diff --git a/addons/mass_mailing/models/res_company.py b/addons/mass_mailing/models/res_company.py
index 8c1088e50a958..6fe795438308e 100644
--- a/addons/mass_mailing/models/res_company.py
+++ b/addons/mass_mailing/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
def _get_social_media_links(self):
self.ensure_one()
diff --git a/addons/mass_mailing/models/res_config_settings.py b/addons/mass_mailing/models/res_config_settings.py
index 5fc90bea79ab0..027dcee130e55 100644
--- a/addons/mass_mailing/models/res_config_settings.py
+++ b/addons/mass_mailing/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
group_mass_mailing_campaign = fields.Boolean(
string="Mailing Campaigns",
diff --git a/addons/mass_mailing/models/res_partner.py b/addons/mass_mailing/models/res_partner.py
index ecc80b745c018..aa5609ba835f6 100644
--- a/addons/mass_mailing/models/res_partner.py
+++ b/addons/mass_mailing/models/res_partner.py
@@ -4,6 +4,6 @@
from odoo import models
-class Partner(models.Model):
- _inherit = 'res.partner'
+class ResPartner(models.Model):
+ _inherit = ['res.partner']
_mailing_enabled = True
diff --git a/addons/mass_mailing/models/res_users.py b/addons/mass_mailing/models/res_users.py
index 5d758b4eaaa43..30cdd515c777e 100644
--- a/addons/mass_mailing/models/res_users.py
+++ b/addons/mass_mailing/models/res_users.py
@@ -4,8 +4,7 @@
from odoo import api, models, _
-class Users(models.Model):
- _name = 'res.users'
+class ResUsers(models.Model):
_inherit = ['res.users']
@api.model
diff --git a/addons/mass_mailing/models/utm_campaign.py b/addons/mass_mailing/models/utm_campaign.py
index ceb6f20c2d558..d5285b011d5f6 100644
--- a/addons/mass_mailing/models/utm_campaign.py
+++ b/addons/mass_mailing/models/utm_campaign.py
@@ -10,7 +10,7 @@
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
mailing_mail_ids = fields.One2many(
'mailing.mailing', 'campaign_id',
diff --git a/addons/mass_mailing/models/utm_medium.py b/addons/mass_mailing/models/utm_medium.py
index 8786306030c89..f91521ca26cde 100644
--- a/addons/mass_mailing/models/utm_medium.py
+++ b/addons/mass_mailing/models/utm_medium.py
@@ -7,7 +7,7 @@
class UtmMedium(models.Model):
- _inherit = 'utm.medium'
+ _inherit = ['utm.medium']
@api.ondelete(at_uninstall=False)
def _unlink_except_linked_mailings(self):
diff --git a/addons/mass_mailing/models/utm_source.py b/addons/mass_mailing/models/utm_source.py
index ae604e8654f55..74089675ef95b 100644
--- a/addons/mass_mailing/models/utm_source.py
+++ b/addons/mass_mailing/models/utm_source.py
@@ -7,7 +7,7 @@
class UtmSource(models.Model):
- _inherit = 'utm.source'
+ _inherit = ['utm.source']
@api.ondelete(at_uninstall=False)
def _unlink_except_linked_mailings(self):
diff --git a/addons/mass_mailing/report/mailing_trace_report.py b/addons/mass_mailing/report/mailing_trace_report.py
index 64e2d7dab9222..f855f437202d8 100644
--- a/addons/mass_mailing/report/mailing_trace_report.py
+++ b/addons/mass_mailing/report/mailing_trace_report.py
@@ -5,7 +5,6 @@
class MailingTraceReport(models.Model):
- _name = 'mailing.trace.report'
_auto = False
_description = 'Mass Mailing Statistics'
diff --git a/addons/mass_mailing/wizard/mail_compose_message.py b/addons/mass_mailing/wizard/mail_compose_message.py
index 937d3482d7985..0e72339e97bc5 100644
--- a/addons/mass_mailing/wizard/mail_compose_message.py
+++ b/addons/mass_mailing/wizard/mail_compose_message.py
@@ -8,7 +8,7 @@
class MailComposeMessage(models.TransientModel):
- _inherit = 'mail.compose.message'
+ _inherit = ['mail.compose.message']
mass_mailing_id = fields.Many2one('mailing.mailing', string='Mass Mailing', ondelete='cascade')
campaign_id = fields.Many2one('utm.campaign', string='Mass Mailing Campaign', ondelete='set null')
diff --git a/addons/mass_mailing/wizard/mailing_contact_import.py b/addons/mass_mailing/wizard/mailing_contact_import.py
index 37f13cd2a97f1..6c9ac35f5893f 100644
--- a/addons/mass_mailing/wizard/mailing_contact_import.py
+++ b/addons/mass_mailing/wizard/mailing_contact_import.py
@@ -6,7 +6,6 @@
class MailingContactImport(models.TransientModel):
- _name = 'mailing.contact.import'
_description = 'Mailing Contact Import'
mailing_list_ids = fields.Many2many('mailing.list', string='Lists')
diff --git a/addons/mass_mailing/wizard/mailing_contact_to_list.py b/addons/mass_mailing/wizard/mailing_contact_to_list.py
index e6d34c98232b8..6f75f383bda51 100644
--- a/addons/mass_mailing/wizard/mailing_contact_to_list.py
+++ b/addons/mass_mailing/wizard/mailing_contact_to_list.py
@@ -3,8 +3,8 @@
from odoo import fields, models, _
+
class MailingContactToList(models.TransientModel):
- _name = "mailing.contact.to.list"
_description = "Add Contacts to Mailing List"
contact_ids = fields.Many2many('mailing.contact', string='Contacts')
diff --git a/addons/mass_mailing/wizard/mailing_list_merge.py b/addons/mass_mailing/wizard/mailing_list_merge.py
index 213107783f6e8..9b85f284de283 100644
--- a/addons/mass_mailing/wizard/mailing_list_merge.py
+++ b/addons/mass_mailing/wizard/mailing_list_merge.py
@@ -5,13 +5,12 @@
from odoo.exceptions import UserError
-class MassMailingListMerge(models.TransientModel):
- _name = 'mailing.list.merge'
+class MailingListMerge(models.TransientModel):
_description = 'Merge Mass Mailing List'
@api.model
def default_get(self, fields):
- res = super(MassMailingListMerge, self).default_get(fields)
+ res = super().default_get(fields)
if not res.get('src_list_ids') and 'src_list_ids' in fields:
if self.env.context.get('active_model') != 'mailing.list':
diff --git a/addons/mass_mailing/wizard/mailing_mailing_schedule_date.py b/addons/mass_mailing/wizard/mailing_mailing_schedule_date.py
index f4698ff005a92..1b92bb616090b 100644
--- a/addons/mass_mailing/wizard/mailing_mailing_schedule_date.py
+++ b/addons/mass_mailing/wizard/mailing_mailing_schedule_date.py
@@ -5,7 +5,6 @@
class MailingMailingScheduleDate(models.TransientModel):
- _name = "mailing.mailing.schedule.date"
_description = "schedule a mailing"
schedule_date = fields.Datetime(string='Scheduled for')
diff --git a/addons/mass_mailing/wizard/mailing_mailing_test.py b/addons/mass_mailing/wizard/mailing_mailing_test.py
index 6acca451b5efa..599a908272d5a 100644
--- a/addons/mass_mailing/wizard/mailing_mailing_test.py
+++ b/addons/mass_mailing/wizard/mailing_mailing_test.py
@@ -7,8 +7,7 @@
from odoo.tools.misc import file_open
-class TestMassMailing(models.TransientModel):
- _name = 'mailing.mailing.test'
+class MailingMailingTest(models.TransientModel):
_description = 'Sample Mail Wizard'
# allow mailing.mailing.test records to live for 10h (instead of 1h default)
# used for quality of life in combination with '_default_email_to'
diff --git a/addons/mass_mailing_crm/models/crm_lead.py b/addons/mass_mailing_crm/models/crm_lead.py
index f2a13f5356b83..58485d7d3b87b 100644
--- a/addons/mass_mailing_crm/models/crm_lead.py
+++ b/addons/mass_mailing_crm/models/crm_lead.py
@@ -5,5 +5,5 @@
class CrmLead(models.Model):
- _inherit = 'crm.lead'
+ _inherit = ['crm.lead']
_mailing_enabled = True
diff --git a/addons/mass_mailing_crm/models/mailing_mailing.py b/addons/mass_mailing_crm/models/mailing_mailing.py
index 33d31afbc473e..ff2afeb0e1363 100644
--- a/addons/mass_mailing_crm/models/mailing_mailing.py
+++ b/addons/mass_mailing_crm/models/mailing_mailing.py
@@ -5,9 +5,8 @@
from odoo import fields, models, _, tools
-class MassMailing(models.Model):
- _name = 'mailing.mailing'
- _inherit = 'mailing.mailing'
+class MailingMailing(models.Model):
+ _inherit = ['mailing.mailing']
use_leads = fields.Boolean('Use Leads', compute='_compute_use_leads')
crm_lead_count = fields.Integer('Leads/Opportunities Count', compute='_compute_crm_lead_count')
@@ -47,7 +46,7 @@ def action_redirect_to_leads_and_opportunities(self):
def _prepare_statistics_email_values(self):
self.ensure_one()
- values = super(MassMailing, self)._prepare_statistics_email_values()
+ values = super()._prepare_statistics_email_values()
if not self.user_id:
return values
if not self.env['crm.lead'].has_access('read'):
diff --git a/addons/mass_mailing_crm/models/utm.py b/addons/mass_mailing_crm/models/utm.py
index cb895aa09ad21..22e0ca177bf1d 100644
--- a/addons/mass_mailing_crm/models/utm.py
+++ b/addons/mass_mailing_crm/models/utm.py
@@ -5,6 +5,6 @@
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
ab_testing_winner_selection = fields.Selection(selection_add=[('crm_lead_count', 'Leads')])
diff --git a/addons/mass_mailing_crm_sms/models/utm.py b/addons/mass_mailing_crm_sms/models/utm.py
index 20ce0d8e74fea..ca53034cea36e 100644
--- a/addons/mass_mailing_crm_sms/models/utm.py
+++ b/addons/mass_mailing_crm_sms/models/utm.py
@@ -5,6 +5,6 @@
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
ab_testing_sms_winner_selection = fields.Selection(selection_add=[('crm_lead_count', 'Leads')])
diff --git a/addons/mass_mailing_event/models/event_event.py b/addons/mass_mailing_event/models/event_event.py
index 07af8e0992ba2..dab42a9be19b2 100644
--- a/addons/mass_mailing_event/models/event_event.py
+++ b/addons/mass_mailing_event/models/event_event.py
@@ -4,8 +4,8 @@
from odoo import models, _
-class Event(models.Model):
- _inherit = "event.event"
+class EventEvent(models.Model):
+ _inherit = ["event.event"]
def action_mass_mailing_attendees(self):
return {
diff --git a/addons/mass_mailing_event/models/event_registration.py b/addons/mass_mailing_event/models/event_registration.py
index 061a02191e8b0..4ec1365bfa243 100644
--- a/addons/mass_mailing_event/models/event_registration.py
+++ b/addons/mass_mailing_event/models/event_registration.py
@@ -5,7 +5,7 @@
class EventRegistration(models.Model):
- _inherit = 'event.registration'
+ _inherit = ['event.registration']
_mailing_enabled = True
def _mailing_get_default_domain(self, mailing):
diff --git a/addons/mass_mailing_event_sms/models/event.py b/addons/mass_mailing_event_sms/models/event.py
index eb4a27bc3a132..ba0c96673badf 100644
--- a/addons/mass_mailing_event_sms/models/event.py
+++ b/addons/mass_mailing_event_sms/models/event.py
@@ -4,17 +4,17 @@
from odoo import models
-class Event(models.Model):
- _inherit = "event.event"
+class EventEvent(models.Model):
+ _inherit = ["event.event"]
def action_mass_mailing_attendees(self):
# Minimal override: set form view being the one mixing sms and mail (not prioritized one)
- action = super(Event, self).action_mass_mailing_attendees()
+ action = super().action_mass_mailing_attendees()
action['view_id'] = self.env.ref('mass_mailing_sms.mailing_mailing_view_form_mixed').id
return action
def action_invite_contacts(self):
# Minimal override: set form view being the one mixing sms and mail (not prioritized one)
- action = super(Event, self).action_invite_contacts()
+ action = super().action_invite_contacts()
action['view_id'] = self.env.ref('mass_mailing_sms.mailing_mailing_view_form_mixed').id
return action
diff --git a/addons/mass_mailing_event_track/models/event_event.py b/addons/mass_mailing_event_track/models/event_event.py
index 945f966cff18f..3b96f9d0c2285 100644
--- a/addons/mass_mailing_event_track/models/event_event.py
+++ b/addons/mass_mailing_event_track/models/event_event.py
@@ -4,8 +4,8 @@
from odoo import models, _
-class Event(models.Model):
- _inherit = "event.event"
+class EventEvent(models.Model):
+ _inherit = ["event.event"]
def action_mass_mailing_track_speakers(self):
mass_mailing_action = dict(
diff --git a/addons/mass_mailing_event_track/models/event_track.py b/addons/mass_mailing_event_track/models/event_track.py
index d84c0194c517e..01af294b42461 100644
--- a/addons/mass_mailing_event_track/models/event_track.py
+++ b/addons/mass_mailing_event_track/models/event_track.py
@@ -5,7 +5,7 @@
class EventTrack(models.Model):
- _inherit = 'event.track'
+ _inherit = ['event.track']
_mailing_enabled = True
def _mailing_get_default_domain(self, mailing):
diff --git a/addons/mass_mailing_event_track_sms/models/event.py b/addons/mass_mailing_event_track_sms/models/event.py
index cbfb15ffd5e24..aa47b9b51b96e 100644
--- a/addons/mass_mailing_event_track_sms/models/event.py
+++ b/addons/mass_mailing_event_track_sms/models/event.py
@@ -4,11 +4,11 @@
from odoo import models
-class Event(models.Model):
- _inherit = "event.event"
+class EventEvent(models.Model):
+ _inherit = ["event.event"]
def action_mass_mailing_track_speakers(self):
# Minimal override: set form view being the one mixing sms and mail (not prioritized one)
- action = super(Event, self).action_mass_mailing_track_speakers()
+ action = super().action_mass_mailing_track_speakers()
action['view_id'] = self.env.ref('mass_mailing_sms.mailing_mailing_view_form_mixed').id
return action
diff --git a/addons/mass_mailing_sale/models/mailing_mailing.py b/addons/mass_mailing_sale/models/mailing_mailing.py
index 03254b37f9720..68768dd945614 100644
--- a/addons/mass_mailing_sale/models/mailing_mailing.py
+++ b/addons/mass_mailing_sale/models/mailing_mailing.py
@@ -6,9 +6,8 @@
from odoo.osv import expression
-class MassMailing(models.Model):
- _name = 'mailing.mailing'
- _inherit = 'mailing.mailing'
+class MailingMailing(models.Model):
+ _inherit = ['mailing.mailing']
sale_quotation_count = fields.Integer('Quotation Count', compute='_compute_sale_quotation_count')
sale_invoiced_amount = fields.Integer('Invoiced Amount', compute='_compute_sale_invoiced_amount')
@@ -84,7 +83,7 @@ def action_redirect_to_invoiced(self):
def _prepare_statistics_email_values(self):
self.ensure_one()
- values = super(MassMailing, self)._prepare_statistics_email_values()
+ values = super()._prepare_statistics_email_values()
if not self.user_id:
return values
diff --git a/addons/mass_mailing_sale/models/sale_order.py b/addons/mass_mailing_sale/models/sale_order.py
index d55aaef743222..90c6fdd056d94 100644
--- a/addons/mass_mailing_sale/models/sale_order.py
+++ b/addons/mass_mailing_sale/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
_mailing_enabled = True
def _mailing_get_default_domain(self, mailing):
diff --git a/addons/mass_mailing_sale/models/utm.py b/addons/mass_mailing_sale/models/utm.py
index 661ac26a05612..d324032677678 100644
--- a/addons/mass_mailing_sale/models/utm.py
+++ b/addons/mass_mailing_sale/models/utm.py
@@ -5,7 +5,7 @@
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
ab_testing_winner_selection = fields.Selection(selection_add=[
('sale_quotation_count', 'Quotations'),
diff --git a/addons/mass_mailing_sale_sms/models/utm.py b/addons/mass_mailing_sale_sms/models/utm.py
index b5e70411977e9..47bf0909259d4 100644
--- a/addons/mass_mailing_sale_sms/models/utm.py
+++ b/addons/mass_mailing_sale_sms/models/utm.py
@@ -5,7 +5,7 @@
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
ab_testing_sms_winner_selection = fields.Selection(selection_add=[
('sale_quotation_count', 'Quotations'),
diff --git a/addons/mass_mailing_slides/models/slide_channel.py b/addons/mass_mailing_slides/models/slide_channel.py
index 1c781c02da3d1..e1a6a360e3206 100644
--- a/addons/mass_mailing_slides/models/slide_channel.py
+++ b/addons/mass_mailing_slides/models/slide_channel.py
@@ -4,8 +4,8 @@
from odoo import models, _
-class Course(models.Model):
- _inherit = "slide.channel"
+class SlideChannel(models.Model):
+ _inherit = ["slide.channel"]
def action_mass_mailing_attendees(self):
domain = repr([('slide_channel_ids', 'in', self.ids)])
diff --git a/addons/mass_mailing_sms/models/mailing_contact.py b/addons/mass_mailing_sms/models/mailing_contact.py
index cee28bcf8a9c8..5465fcfcd55f1 100644
--- a/addons/mass_mailing_sms/models/mailing_contact.py
+++ b/addons/mass_mailing_sms/models/mailing_contact.py
@@ -5,7 +5,6 @@
class MailingContact(models.Model):
- _name = 'mailing.contact'
_inherit = ['mailing.contact', 'mail.thread.phone']
mobile = fields.Char(string='Mobile')
diff --git a/addons/mass_mailing_sms/models/mailing_list.py b/addons/mass_mailing_sms/models/mailing_list.py
index 8978d88d05b01..2dbfcff9eb979 100644
--- a/addons/mass_mailing_sms/models/mailing_list.py
+++ b/addons/mass_mailing_sms/models/mailing_list.py
@@ -5,7 +5,7 @@
class MailingList(models.Model):
- _inherit = 'mailing.list'
+ _inherit = ['mailing.list']
contact_count_sms = fields.Integer(compute="_compute_mailing_list_statistics", string="SMS Contacts")
diff --git a/addons/mass_mailing_sms/models/mailing_mailing.py b/addons/mass_mailing_sms/models/mailing_mailing.py
index 26eacff0f4846..7a893dac22ad6 100644
--- a/addons/mass_mailing_sms/models/mailing_mailing.py
+++ b/addons/mass_mailing_sms/models/mailing_mailing.py
@@ -10,12 +10,12 @@
_logger = logging.getLogger(__name__)
-class Mailing(models.Model):
- _inherit = 'mailing.mailing'
+class MailingMailing(models.Model):
+ _inherit = ['mailing.mailing']
@api.model
def default_get(self, fields):
- res = super(Mailing, self).default_get(fields)
+ res = super().default_get(fields)
if fields is not None and 'keep_archives' in fields and res.get('mailing_type') == 'sms':
res['keep_archives'] = True
return res
@@ -56,7 +56,7 @@ def default_get(self, fields):
@api.depends('mailing_type')
def _compute_medium_id(self):
- super(Mailing, self)._compute_medium_id()
+ super()._compute_medium_id()
for mailing in self:
if mailing.mailing_type == 'sms' and (not mailing.medium_id or mailing.medium_id == self.env['utm.medium']._fetch_or_create_utm_medium('email')):
mailing.medium_id = self.env['utm.medium']._fetch_or_create_utm_medium("sms", module="mass_mailing_sms").id
@@ -105,7 +105,7 @@ def action_retry_failed(self):
mass_sms = self.filtered(lambda m: m.mailing_type == 'sms')
if mass_sms:
mass_sms.action_retry_failed_sms()
- return super(Mailing, self - mass_sms).action_retry_failed()
+ return super(MailingMailing, self - mass_sms).action_retry_failed()
def action_retry_failed_sms(self):
failed_sms = self.env['sms.sms'].sudo().search([
@@ -127,10 +127,10 @@ def action_test(self):
'target': 'new',
'context': ctx,
}
- return super(Mailing, self).action_test()
+ return super().action_test()
def _action_view_traces_filtered(self, view_filter):
- action = super(Mailing, self)._action_view_traces_filtered(view_filter)
+ action = super()._action_view_traces_filtered(view_filter)
if self.mailing_type == 'sms':
action['views'] = [(self.env.ref('mass_mailing_sms.mailing_trace_view_tree_sms').id, 'list'),
(self.env.ref('mass_mailing_sms.mailing_trace_view_form_sms').id, 'form')]
@@ -238,7 +238,7 @@ def _action_send_mail(self, res_ids=None):
mass_sms = self.filtered(lambda m: m.mailing_type == 'sms')
if mass_sms:
mass_sms.action_send_sms(res_ids=res_ids)
- return super(Mailing, self - mass_sms)._action_send_mail(res_ids=res_ids)
+ return super(MailingMailing, self - mass_sms)._action_send_mail(res_ids=res_ids)
def action_send_sms(self, res_ids=None):
for mailing in self:
@@ -259,7 +259,7 @@ def _prepare_statistics_email_values(self):
Each item in the returned list will be displayed as a table, with a title and
1, 2 or 3 columns.
"""
- values = super(Mailing, self)._prepare_statistics_email_values()
+ values = super()._prepare_statistics_email_values()
if self.mailing_type == 'sms':
mailing_type = self._get_pretty_mailing_type()
values['title'] = _('24H Stats of %(mailing_type)s "%(mailing_name)s"',
@@ -291,14 +291,14 @@ def _prepare_statistics_email_values(self):
def _get_pretty_mailing_type(self):
if self.mailing_type == 'sms':
return _('SMS Text Message')
- return super(Mailing, self)._get_pretty_mailing_type()
+ return super()._get_pretty_mailing_type()
# --------------------------------------------------
# TOOLS
# --------------------------------------------------
def _get_default_mailing_domain(self):
- mailing_domain = super(Mailing, self)._get_default_mailing_domain()
+ mailing_domain = super()._get_default_mailing_domain()
if self.mailing_type == 'sms' and 'phone_sanitized_blacklisted' in self.env[self.mailing_model_name]._fields:
mailing_domain = expression.AND([mailing_domain, [('phone_sanitized_blacklisted', '=', False)]])
@@ -311,7 +311,7 @@ def convert_links(self):
tracker_values = mailing._get_link_tracker_values()
body = mailing._shorten_links_text(mailing.body_plaintext, tracker_values)
res[mailing.id] = body
- res.update(super(Mailing, self - sms_mailings).convert_links())
+ res.update(super(MailingMailing, self - sms_mailings).convert_links())
return res
# ------------------------------------------------------
diff --git a/addons/mass_mailing_sms/models/mailing_trace.py b/addons/mass_mailing_sms/models/mailing_trace.py
index f485c9b29eea4..3b318092b7e13 100644
--- a/addons/mass_mailing_sms/models/mailing_trace.py
+++ b/addons/mass_mailing_sms/models/mailing_trace.py
@@ -10,7 +10,7 @@
class MailingTrace(models.Model):
""" Improve statistics model to add SMS support. Main attributes of
statistics model are used, only some specific data is required. """
- _inherit = 'mailing.trace'
+ _inherit = ['mailing.trace']
CODE_SIZE = 3
trace_type = fields.Selection(selection_add=[
diff --git a/addons/mass_mailing_sms/models/res_users.py b/addons/mass_mailing_sms/models/res_users.py
index 309f655f81d68..2744d56b40085 100644
--- a/addons/mass_mailing_sms/models/res_users.py
+++ b/addons/mass_mailing_sms/models/res_users.py
@@ -6,8 +6,7 @@
from odoo import api, fields, models, modules, _
-class Users(models.Model):
- _name = 'res.users'
+class ResUsers(models.Model):
_inherit = ['res.users']
@api.model
diff --git a/addons/mass_mailing_sms/models/sms_tracker.py b/addons/mass_mailing_sms/models/sms_tracker.py
index abf31099cf3e6..94e143a59fb8c 100644
--- a/addons/mass_mailing_sms/models/sms_tracker.py
+++ b/addons/mass_mailing_sms/models/sms_tracker.py
@@ -4,7 +4,7 @@
class SmsTracker(models.Model):
- _inherit = "sms.tracker"
+ _inherit = ["sms.tracker"]
SMS_STATE_TO_TRACE_STATUS = {
'error': 'error',
diff --git a/addons/mass_mailing_sms/models/utm.py b/addons/mass_mailing_sms/models/utm.py
index e79b9ab4568a7..9c68f73ca16b2 100644
--- a/addons/mass_mailing_sms/models/utm.py
+++ b/addons/mass_mailing_sms/models/utm.py
@@ -7,7 +7,7 @@
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
mailing_sms_ids = fields.One2many(
'mailing.mailing', 'campaign_id',
@@ -78,7 +78,7 @@ def _cron_process_mass_mailing_ab_testing(self):
class UtmMedium(models.Model):
- _inherit = 'utm.medium'
+ _inherit = ['utm.medium']
@api.ondelete(at_uninstall=False)
def _unlink_except_utm_medium_sms(self):
diff --git a/addons/mass_mailing_sms/wizard/mailing_sms_test.py b/addons/mass_mailing_sms/wizard/mailing_sms_test.py
index a7aff06f656fe..1090cc2793968 100644
--- a/addons/mass_mailing_sms/wizard/mailing_sms_test.py
+++ b/addons/mass_mailing_sms/wizard/mailing_sms_test.py
@@ -8,8 +8,7 @@
from odoo.addons.sms.tools.sms_api import SmsApi
-class MassSMSTest(models.TransientModel):
- _name = 'mailing.sms.test'
+class MailingSmsTest(models.TransientModel):
_description = 'Test SMS Mailing'
def _default_numbers(self):
diff --git a/addons/mass_mailing_sms/wizard/sms_composer.py b/addons/mass_mailing_sms/wizard/sms_composer.py
index 27fec36773f36..734ecda7decdd 100644
--- a/addons/mass_mailing_sms/wizard/sms_composer.py
+++ b/addons/mass_mailing_sms/wizard/sms_composer.py
@@ -6,8 +6,8 @@
from odoo import _, Command, fields, models
-class SMSComposer(models.TransientModel):
- _inherit = 'sms.composer'
+class SmsComposer(models.TransientModel):
+ _inherit = ['sms.composer']
# mass mode with mass sms
mass_sms_allow_unsubscribe = fields.Boolean('Include opt-out link', default=True)
@@ -48,7 +48,7 @@ def _prepare_mass_sms_trace_values(self, record, sms_values):
def _get_optout_record_ids(self, records, recipients_info):
""" Fetch opt-out records based on mailing. """
- res = super(SMSComposer, self)._get_optout_record_ids(records, recipients_info)
+ res = super()._get_optout_record_ids(records, recipients_info)
if self.mailing_id:
optout_res_ids = self.mailing_id._get_opt_out_list_sms()
res += optout_res_ids
@@ -56,14 +56,14 @@ def _get_optout_record_ids(self, records, recipients_info):
def _get_done_record_ids(self, records, recipients_info):
""" A/B testing could lead to records having been already mailed. """
- res = super(SMSComposer, self)._get_done_record_ids(records, recipients_info)
+ res = super()._get_done_record_ids(records, recipients_info)
if self.mailing_id:
seen_ids, seen_list = self.mailing_id._get_seen_list_sms()
res += seen_ids
return res
def _prepare_body_values(self, records):
- all_bodies = super(SMSComposer, self)._prepare_body_values(records)
+ all_bodies = super()._prepare_body_values(records)
if self.mailing_id:
tracker_values = self.mailing_id._get_link_tracker_values()
for sms_id, body in all_bodies.items():
@@ -72,7 +72,7 @@ def _prepare_body_values(self, records):
return all_bodies
def _prepare_mass_sms_values(self, records):
- result = super(SMSComposer, self)._prepare_mass_sms_values(records)
+ result = super()._prepare_mass_sms_values(records)
if self.composition_mode == 'mass' and self.mailing_id:
for record in records:
sms_values = result[record.id]
@@ -85,7 +85,7 @@ def _prepare_mass_sms_values(self, records):
return result
def _prepare_mass_sms(self, records, sms_record_values):
- sms_all = super(SMSComposer, self)._prepare_mass_sms(records, sms_record_values)
+ sms_all = super()._prepare_mass_sms(records, sms_record_values)
if self.mailing_id:
updated_bodies = sms_all._update_body_short_links()
for sms in sms_all:
diff --git a/addons/membership/models/account_move.py b/addons/membership/models/account_move.py
index 83f1a4f7a867e..94784c7bf03cc 100644
--- a/addons/membership/models/account_move.py
+++ b/addons/membership/models/account_move.py
@@ -7,7 +7,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def button_draft(self):
# OVERRIDE to update the cancel date.
@@ -40,7 +40,7 @@ def write(self, vals):
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def write(self, vals):
# OVERRIDE
diff --git a/addons/membership/models/membership.py b/addons/membership/models/membership.py
index bdfa9a201a43e..81cfa43dd666f 100644
--- a/addons/membership/models/membership.py
+++ b/addons/membership/models/membership.py
@@ -14,8 +14,7 @@
]
-class MembershipLine(models.Model):
- _name = 'membership.membership_line'
+class MembershipMembership_Line(models.Model):
_rec_name = 'partner'
_order = 'id desc'
_description = 'Membership Line'
diff --git a/addons/membership/models/partner.py b/addons/membership/models/partner.py
index d9b9541e269d2..dcf3d328ebf94 100644
--- a/addons/membership/models/partner.py
+++ b/addons/membership/models/partner.py
@@ -7,8 +7,8 @@
from . import membership
-class Partner(models.Model):
- _inherit = 'res.partner'
+class ResPartner(models.Model):
+ _inherit = ['res.partner']
associate_member = fields.Many2one('res.partner', string='Associate Member',
help="A member with whom you want to associate your membership."
diff --git a/addons/membership/models/product.py b/addons/membership/models/product.py
index 3c517848b0db5..376c761c1c6b5 100644
--- a/addons/membership/models/product.py
+++ b/addons/membership/models/product.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Product(models.Model):
- _inherit = 'product.template'
+class ProductTemplate(models.Model):
+ _inherit = ['product.template']
membership = fields.Boolean(help='Check if the product is eligible for membership.')
membership_date_from = fields.Date(string='Membership Start Date',
diff --git a/addons/membership/report/report_membership.py b/addons/membership/report/report_membership.py
index 3d181887b516b..df0933bd635df 100644
--- a/addons/membership/report/report_membership.py
+++ b/addons/membership/report/report_membership.py
@@ -17,7 +17,6 @@
class ReportMembership(models.Model):
'''Membership Analysis'''
- _name = 'report.membership'
_description = 'Membership Analysis'
_auto = False
_rec_name = 'start_date'
diff --git a/addons/membership/wizard/membership_invoice.py b/addons/membership/wizard/membership_invoice.py
index ea73a86a6cd22..80b5f152de7d5 100644
--- a/addons/membership/wizard/membership_invoice.py
+++ b/addons/membership/wizard/membership_invoice.py
@@ -5,7 +5,6 @@
class MembershipInvoice(models.TransientModel):
- _name = "membership.invoice"
_description = "Membership Invoice"
product_id = fields.Many2one('product.product', string='Membership', required=True)
diff --git a/addons/microsoft_account/models/microsoft_service.py b/addons/microsoft_account/models/microsoft_service.py
index 0200ef3083aab..6cd31b0d26cde 100644
--- a/addons/microsoft_account/models/microsoft_service.py
+++ b/addons/microsoft_account/models/microsoft_service.py
@@ -35,8 +35,8 @@ def _get_microsoft_client_secret(ICP_sudo, service):
"""
return ICP_sudo.get_param('microsoft_%s_client_secret' % service)
+
class MicrosoftService(models.AbstractModel):
- _name = 'microsoft.service'
_description = 'Microsoft Service'
def _get_microsoft_client_id(self, service):
diff --git a/addons/microsoft_account/models/res_users.py b/addons/microsoft_account/models/res_users.py
index d6587ffeda96c..7bcab8d8bdaa8 100644
--- a/addons/microsoft_account/models/res_users.py
+++ b/addons/microsoft_account/models/res_users.py
@@ -7,8 +7,8 @@
from odoo import api, fields, models, _
-class User(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
microsoft_calendar_rtoken = fields.Char('Microsoft Refresh Token', copy=False, groups="base.group_system")
microsoft_calendar_token = fields.Char('Microsoft User token', copy=False, groups="base.group_system")
diff --git a/addons/microsoft_calendar/models/calendar.py b/addons/microsoft_calendar/models/calendar.py
index 46784bf8f6927..7984ec84cd13c 100644
--- a/addons/microsoft_calendar/models/calendar.py
+++ b/addons/microsoft_calendar/models/calendar.py
@@ -34,8 +34,8 @@
_logger = logging.getLogger(__name__)
-class Meeting(models.Model):
- _name = 'calendar.event'
+
+class CalendarEvent(models.Model):
_inherit = ['calendar.event', 'microsoft.calendar.sync']
microsoft_recurrence_master_id = fields.Char('Microsoft Recurrence Master Id')
@@ -95,7 +95,7 @@ def create(self, vals_list):
# for a recurrent event, we do not create events separately but we directly
# create the recurrency from the corresponding calendar.recurrence.
# That's why, events from a recurrency have their `need_sync_m` attribute set to False.
- return super(Meeting, self.with_context(dont_notify=notify_context)).create([
+ return super(CalendarEvent, self.with_context(dont_notify=notify_context)).create([
dict(vals, need_sync_m=False) if vals.get('recurrence_id') or vals.get('recurrency') else vals
for vals in vals_list
])
@@ -210,11 +210,11 @@ def write(self, values):
if attendee_ids and values.get('partner_ids'):
(self - deactivated_events)._update_attendee_status(attendee_ids)
- res = super(Meeting, (self - deactivated_events).with_context(dont_notify=notify_context)).write(values)
+ res = super(CalendarEvent, (self - deactivated_events).with_context(dont_notify=notify_context)).write(values)
# Deactivate events that were recreated after changing organizer.
if deactivated_events:
- res |= super(Meeting, deactivated_events.with_context(dont_notify=notify_context)).write({**values, 'active': False})
+ res |= super(CalendarEvent, deactivated_events.with_context(dont_notify=notify_context)).write({**values, 'active': False})
if recurrence_update_setting in ('all_events',) and len(self) == 1 \
and values.keys() & self._get_microsoft_synced_fields():
@@ -670,7 +670,7 @@ def _cancel_microsoft(self):
for event in records:
# remove the tracking data to avoid calling _track_template in the pre-commit phase
self.env.cr.precommit.data.pop(f'mail.tracking.create.{event._name}.{event.id}', None)
- super(Meeting, records)._cancel_microsoft()
+ super(CalendarEvent, records)._cancel_microsoft()
attendees = (self - records).attendee_ids.filtered(lambda a: a.partner_id == user.partner_id)
attendees.do_decline()
diff --git a/addons/microsoft_calendar/models/calendar_attendee.py b/addons/microsoft_calendar/models/calendar_attendee.py
index fdc68a7df9759..67eaaf7bcada1 100644
--- a/addons/microsoft_calendar/models/calendar_attendee.py
+++ b/addons/microsoft_calendar/models/calendar_attendee.py
@@ -5,9 +5,8 @@
from odoo import models
-class Attendee(models.Model):
- _name = 'calendar.attendee'
- _inherit = 'calendar.attendee'
+class CalendarAttendee(models.Model):
+ _inherit = ['calendar.attendee']
def do_tentative(self):
# Synchronize event after state change
diff --git a/addons/microsoft_calendar/models/calendar_recurrence_rule.py b/addons/microsoft_calendar/models/calendar_recurrence_rule.py
index 7506f4db7a699..16badcc1c4eaf 100644
--- a/addons/microsoft_calendar/models/calendar_recurrence_rule.py
+++ b/addons/microsoft_calendar/models/calendar_recurrence_rule.py
@@ -5,8 +5,7 @@
from odoo.osv import expression
-class RecurrenceRule(models.Model):
- _name = 'calendar.recurrence'
+class CalendarRecurrence(models.Model):
_inherit = ['calendar.recurrence', 'microsoft.calendar.sync']
diff --git a/addons/microsoft_calendar/models/microsoft_sync.py b/addons/microsoft_calendar/models/microsoft_sync.py
index b4210d8219468..7b595ae0f2e47 100644
--- a/addons/microsoft_calendar/models/microsoft_sync.py
+++ b/addons/microsoft_calendar/models/microsoft_sync.py
@@ -51,8 +51,8 @@ def called_after():
def microsoft_calendar_token(user):
yield user._get_microsoft_calendar_token()
-class MicrosoftSync(models.AbstractModel):
- _name = 'microsoft.calendar.sync'
+
+class MicrosoftCalendarSync(models.AbstractModel):
_description = "Synchronize a record with Microsoft Calendar"
microsoft_id = fields.Char('Organizer event Id', copy=False, index=True)
diff --git a/addons/microsoft_calendar/models/res_config_settings.py b/addons/microsoft_calendar/models/res_config_settings.py
index 7198c24572eaa..656c747aae6ea 100644
--- a/addons/microsoft_calendar/models/res_config_settings.py
+++ b/addons/microsoft_calendar/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
cal_microsoft_client_id = fields.Char("Microsoft Client_id", config_parameter='microsoft_calendar_client_id', default='')
cal_microsoft_client_secret = fields.Char("Microsoft Client_key", config_parameter='microsoft_calendar_client_secret', default='')
diff --git a/addons/microsoft_calendar/models/res_users.py b/addons/microsoft_calendar/models/res_users.py
index 4f60a7d4ce42a..0751b0da7da0e 100644
--- a/addons/microsoft_calendar/models/res_users.py
+++ b/addons/microsoft_calendar/models/res_users.py
@@ -16,8 +16,8 @@
_logger = logging.getLogger(__name__)
-class User(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
microsoft_calendar_sync_token = fields.Char(related='res_users_settings_id.microsoft_calendar_sync_token', groups='base.group_system')
microsoft_synchronization_stopped = fields.Boolean(related='res_users_settings_id.microsoft_synchronization_stopped', readonly=False, groups='base.group_system')
diff --git a/addons/microsoft_calendar/models/res_users_settings.py b/addons/microsoft_calendar/models/res_users_settings.py
index f616a1c11aaed..fcdc009ce0632 100644
--- a/addons/microsoft_calendar/models/res_users_settings.py
+++ b/addons/microsoft_calendar/models/res_users_settings.py
@@ -4,7 +4,7 @@
class ResUsersSettings(models.Model):
- _inherit = "res.users.settings"
+ _inherit = ["res.users.settings"]
# Microsoft Calendar settings.
microsoft_calendar_sync_token = fields.Char('Microsoft Next Sync Token', copy=False, groups='base.group_system')
diff --git a/addons/microsoft_calendar/wizard/reset_account.py b/addons/microsoft_calendar/wizard/reset_account.py
index c242cf6b72e6d..273c9993bfb73 100644
--- a/addons/microsoft_calendar/wizard/reset_account.py
+++ b/addons/microsoft_calendar/wizard/reset_account.py
@@ -6,8 +6,7 @@
from odoo.addons.microsoft_calendar.models.microsoft_sync import microsoft_calendar_token
-class ResetMicrosoftAccount(models.TransientModel):
- _name = 'microsoft.calendar.account.reset'
+class MicrosoftCalendarAccountReset(models.TransientModel):
_description = 'Microsoft Calendar Account Reset'
user_id = fields.Many2one('res.users', required=True)
diff --git a/addons/microsoft_outlook/models/fetchmail_server.py b/addons/microsoft_outlook/models/fetchmail_server.py
index be756584056fd..07110d3da13f6 100644
--- a/addons/microsoft_outlook/models/fetchmail_server.py
+++ b/addons/microsoft_outlook/models/fetchmail_server.py
@@ -8,7 +8,6 @@
class FetchmailServer(models.Model):
"""Add the Outlook OAuth authentication on the incoming mail servers."""
- _name = 'fetchmail.server'
_inherit = ['fetchmail.server', 'microsoft.outlook.mixin']
_OUTLOOK_SCOPE = 'https://outlook.office.com/IMAP.AccessAsUser.All'
diff --git a/addons/microsoft_outlook/models/ir_mail_server.py b/addons/microsoft_outlook/models/ir_mail_server.py
index 144e7ac98d401..c479e2edd8895 100644
--- a/addons/microsoft_outlook/models/ir_mail_server.py
+++ b/addons/microsoft_outlook/models/ir_mail_server.py
@@ -7,10 +7,9 @@
from odoo.exceptions import UserError
-class IrMailServer(models.Model):
+class IrMail_Server(models.Model):
"""Add the Outlook OAuth authentication on the outgoing mail servers."""
- _name = 'ir.mail_server'
_inherit = ['ir.mail_server', 'microsoft.outlook.mixin']
_OUTLOOK_SCOPE = 'https://outlook.office.com/SMTP.Send'
@@ -23,7 +22,7 @@ class IrMailServer(models.Model):
def _compute_is_microsoft_outlook_configured(self):
outlook_servers = self.filtered(lambda server: server.smtp_authentication == 'outlook')
(self - outlook_servers).is_microsoft_outlook_configured = False
- super(IrMailServer, outlook_servers)._compute_is_microsoft_outlook_configured()
+ super(IrMail_Server, outlook_servers)._compute_is_microsoft_outlook_configured()
def _compute_smtp_authentication_info(self):
outlook_servers = self.filtered(lambda server: server.smtp_authentication == 'outlook')
@@ -31,7 +30,7 @@ def _compute_smtp_authentication_info(self):
'Connect your Outlook account with the OAuth Authentication process. \n'
'By default, only a user with a matching email address will be able to use this server. '
'To extend its use, you should set a "mail.default.from" system parameter.')
- super(IrMailServer, self - outlook_servers)._compute_smtp_authentication_info()
+ super(IrMail_Server, self - outlook_servers)._compute_smtp_authentication_info()
@api.constrains('smtp_authentication', 'smtp_pass', 'smtp_encryption', 'smtp_user')
def _check_use_microsoft_outlook_service(self):
diff --git a/addons/microsoft_outlook/models/microsoft_outlook_mixin.py b/addons/microsoft_outlook/models/microsoft_outlook_mixin.py
index 43353fc5e4328..0022bec9cf0de 100644
--- a/addons/microsoft_outlook/models/microsoft_outlook_mixin.py
+++ b/addons/microsoft_outlook/models/microsoft_outlook_mixin.py
@@ -17,7 +17,6 @@
class MicrosoftOutlookMixin(models.AbstractModel):
- _name = 'microsoft.outlook.mixin'
_description = 'Microsoft Outlook Mixin'
_OUTLOOK_SCOPE = None
diff --git a/addons/microsoft_outlook/models/res_config_settings.py b/addons/microsoft_outlook/models/res_config_settings.py
index 620ecace671e7..764aaa019311e 100644
--- a/addons/microsoft_outlook/models/res_config_settings.py
+++ b/addons/microsoft_outlook/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
microsoft_outlook_client_identifier = fields.Char('Outlook Client Id', config_parameter='microsoft_outlook_client_id')
microsoft_outlook_client_secret = fields.Char('Outlook Client Secret', config_parameter='microsoft_outlook_client_secret')
diff --git a/addons/mrp/models/ir_attachment.py b/addons/mrp/models/ir_attachment.py
index 6d9a3567514a5..e41156c20372a 100644
--- a/addons/mrp/models/ir_attachment.py
+++ b/addons/mrp/models/ir_attachment.py
@@ -4,8 +4,7 @@
class IrAttachment(models.Model):
- _name = "ir.attachment"
- _inherit = "ir.attachment"
+ _inherit = ["ir.attachment"]
def _post_add_create(self, **kwargs):
super()._post_add_create(**kwargs)
diff --git a/addons/mrp/models/mrp_bom.py b/addons/mrp/models/mrp_bom.py
index 3f54261c34978..f93ec9261c213 100644
--- a/addons/mrp/models/mrp_bom.py
+++ b/addons/mrp/models/mrp_bom.py
@@ -12,7 +12,6 @@
class MrpBom(models.Model):
""" Defines bills of material for a product or a product template """
- _name = 'mrp.bom'
_description = 'Bill of Material'
_inherit = ['mail.thread', 'product.catalog.mixin']
_rec_name = 'product_tmpl_id'
@@ -516,7 +515,6 @@ def _get_extra_attachments(self):
class MrpBomLine(models.Model):
- _name = 'mrp.bom.line'
_order = "sequence, id"
_rec_name = "product_id"
_description = 'Bill of Material Line'
@@ -721,8 +719,7 @@ def _get_product_catalog_lines_data(self, default=False, **kwargs):
}
-class MrpByProduct(models.Model):
- _name = 'mrp.bom.byproduct'
+class MrpBomByproduct(models.Model):
_description = 'Byproduct'
_rec_name = "product_id"
_check_company_auto = True
diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py
index 32cc94470e846..f31e34a9df8ef 100644
--- a/addons/mrp/models/mrp_production.py
+++ b/addons/mrp/models/mrp_production.py
@@ -24,7 +24,6 @@
class MrpProduction(models.Model):
""" Manufacturing Orders """
- _name = 'mrp.production'
_description = 'Manufacturing Order'
_date_name = 'date_start'
_inherit = ['mail.thread', 'mail.activity.mixin', 'product.catalog.mixin']
diff --git a/addons/mrp/models/mrp_routing.py b/addons/mrp/models/mrp_routing.py
index 3b2b1f04bcd59..1bdaf26cfdeac 100644
--- a/addons/mrp/models/mrp_routing.py
+++ b/addons/mrp/models/mrp_routing.py
@@ -7,7 +7,6 @@
class MrpRoutingWorkcenter(models.Model):
- _name = 'mrp.routing.workcenter'
_description = 'Work Center Usage'
_inherit = ['mail.thread', 'mail.activity.mixin']
diff --git a/addons/mrp/models/mrp_unbuild.py b/addons/mrp/models/mrp_unbuild.py
index b42880ce0393f..ed3caf279f3f7 100644
--- a/addons/mrp/models/mrp_unbuild.py
+++ b/addons/mrp/models/mrp_unbuild.py
@@ -9,7 +9,6 @@
class MrpUnbuild(models.Model):
- _name = "mrp.unbuild"
_description = "Unbuild Order"
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'id desc'
diff --git a/addons/mrp/models/mrp_workcenter.py b/addons/mrp/models/mrp_workcenter.py
index 606201e61e4ac..f7e0112655805 100644
--- a/addons/mrp/models/mrp_workcenter.py
+++ b/addons/mrp/models/mrp_workcenter.py
@@ -18,7 +18,6 @@
class MrpWorkcenter(models.Model):
- _name = 'mrp.workcenter'
_description = 'Work Center'
_order = "sequence, id"
_inherit = ['mail.thread', 'resource.mixin']
@@ -401,8 +400,7 @@ def _get_expected_duration(self, product_id):
return capacity.time_start + capacity.time_stop if capacity else self.time_start + self.time_stop
-class WorkcenterTag(models.Model):
- _name = 'mrp.workcenter.tag'
+class MrpWorkcenterTag(models.Model):
_description = 'Add tag for the workcenter'
_order = 'name'
@@ -419,7 +417,6 @@ def _get_default_color(self):
class MrpWorkcenterProductivityLossType(models.Model):
- _name = "mrp.workcenter.productivity.loss.type"
_description = 'MRP Workorder productivity losses'
_rec_name = 'loss_type'
@@ -439,7 +436,6 @@ def _compute_display_name(self):
class MrpWorkcenterProductivityLoss(models.Model):
- _name = "mrp.workcenter.productivity.loss"
_description = "Workcenter Productivity Losses"
_order = "sequence, id"
@@ -464,8 +460,8 @@ def _convert_to_duration(self, date_start, date_stop, workcenter=False):
duration = max(duration, (date_stop - date_start).total_seconds() / 60.0)
return round(duration, 2)
+
class MrpWorkcenterProductivity(models.Model):
- _name = "mrp.workcenter.productivity"
_description = "Workcenter Productivity Log"
_order = "id desc"
_rec_name = "loss_id"
@@ -571,8 +567,7 @@ def _close(self):
underperformance_timers.write({'loss_id': underperformance_type.id})
-class MrpWorkCenterCapacity(models.Model):
- _name = 'mrp.workcenter.capacity'
+class MrpWorkcenterCapacity(models.Model):
_description = 'Work Center Capacity'
_check_company_auto = True
diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py
index d689fc09e197f..9c9257288cf86 100644
--- a/addons/mrp/models/mrp_workorder.py
+++ b/addons/mrp/models/mrp_workorder.py
@@ -11,7 +11,6 @@
class MrpWorkorder(models.Model):
- _name = 'mrp.workorder'
_description = 'Work Order'
_order = 'sequence, leave_id, date_start, id'
diff --git a/addons/mrp/models/product.py b/addons/mrp/models/product.py
index b96189a5b9094..041aec17ef3bd 100644
--- a/addons/mrp/models/product.py
+++ b/addons/mrp/models/product.py
@@ -18,8 +18,9 @@
'!=': py_operator.ne
}
+
class ProductTemplate(models.Model):
- _inherit = "product.template"
+ _inherit = ["product.template"]
bom_line_ids = fields.One2many('mrp.bom.line', 'product_tmpl_id', 'BoM Components')
bom_ids = fields.One2many('mrp.bom', 'product_tmpl_id', 'Bill of Materials')
@@ -112,7 +113,7 @@ def _get_backend_root_menu_ids(self):
class ProductProduct(models.Model):
- _inherit = "product.product"
+ _inherit = ["product.product"]
variant_bom_ids = fields.One2many('mrp.bom', 'product_id', 'BOM Product Variants')
bom_line_ids = fields.One2many('mrp.bom.line', 'product_id', 'BoM Components')
diff --git a/addons/mrp/models/product_document.py b/addons/mrp/models/product_document.py
index b111f8f85aa9e..ac9613d430f1f 100644
--- a/addons/mrp/models/product_document.py
+++ b/addons/mrp/models/product_document.py
@@ -5,7 +5,7 @@
class ProductDocument(models.Model):
- _inherit = 'product.document'
+ _inherit = ['product.document']
def _default_attached_on_mrp(self):
return "bom" if self.env.context.get('attached_on_bom') else "hidden"
diff --git a/addons/mrp/models/res_company.py b/addons/mrp/models/res_company.py
index bbfdfd84d1461..e4c704e6631d8 100644
--- a/addons/mrp/models/res_company.py
+++ b/addons/mrp/models/res_company.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Company(models.Model):
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
manufacturing_lead = fields.Float(
'Manufacturing Lead Time', default=0.0, required=True,
@@ -34,5 +34,5 @@ def create_missing_unbuild_sequences(self):
company_todo_sequence._create_unbuild_sequence()
def _create_per_company_sequences(self):
- super(Company, self)._create_per_company_sequences()
+ super()._create_per_company_sequences()
self._create_unbuild_sequence()
diff --git a/addons/mrp/models/res_config_settings.py b/addons/mrp/models/res_config_settings.py
index b144b0a7f640e..3daa956c2f1c7 100644
--- a/addons/mrp/models/res_config_settings.py
+++ b/addons/mrp/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
manufacturing_lead = fields.Float(related='company_id.manufacturing_lead', string="Manufacturing Lead Time", readonly=False)
use_manufacturing_lead = fields.Boolean(string="Default Manufacturing Lead Time", config_parameter='mrp.use_manufacturing_lead')
diff --git a/addons/mrp/models/stock_lot.py b/addons/mrp/models/stock_lot.py
index 74a731f46d716..982b9f09c6ea4 100644
--- a/addons/mrp/models/stock_lot.py
+++ b/addons/mrp/models/stock_lot.py
@@ -6,7 +6,7 @@
class StockLot(models.Model):
- _inherit = 'stock.lot'
+ _inherit = ['stock.lot']
def _check_create(self):
active_mo_id = self.env.context.get('active_mo_id')
diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py
index d8041d9f13d5c..d2247e93bdbb1 100644
--- a/addons/mrp/models/stock_move.py
+++ b/addons/mrp/models/stock_move.py
@@ -10,7 +10,7 @@
class StockMoveLine(models.Model):
- _inherit = 'stock.move.line'
+ _inherit = ['stock.move.line']
workorder_id = fields.Many2one('mrp.workorder', 'Work Order', check_company=True)
production_id = fields.Many2one('mrp.production', 'Production Order', check_company=True)
@@ -181,7 +181,7 @@ def _get_linkable_moves(self):
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
created_production_id = fields.Many2one('mrp.production', 'Created Production Order', check_company=True, index=True)
production_id = fields.Many2one(
diff --git a/addons/mrp/models/stock_orderpoint.py b/addons/mrp/models/stock_orderpoint.py
index 48f6e3f9f1ef9..f88a3d74f09c5 100644
--- a/addons/mrp/models/stock_orderpoint.py
+++ b/addons/mrp/models/stock_orderpoint.py
@@ -9,7 +9,7 @@
class StockWarehouseOrderpoint(models.Model):
- _inherit = 'stock.warehouse.orderpoint'
+ _inherit = ['stock.warehouse.orderpoint']
show_bom = fields.Boolean('Show BoM column', compute='_compute_show_bom')
bom_id = fields.Many2one(
diff --git a/addons/mrp/models/stock_picking.py b/addons/mrp/models/stock_picking.py
index 7b364653d5e67..ae152777f5eac 100644
--- a/addons/mrp/models/stock_picking.py
+++ b/addons/mrp/models/stock_picking.py
@@ -8,7 +8,7 @@
class StockPickingType(models.Model):
- _inherit = 'stock.picking.type'
+ _inherit = ['stock.picking.type']
code = fields.Selection(selection_add=[
('mrp_operation', 'Manufacturing')
@@ -116,8 +116,9 @@ def _get_aggregated_records_by_date(self):
mrp_records = [(i, d, self.env._('Confirmed')) for i, d in picking_type_id_to_dates.items()]
return records + mrp_records
+
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
has_kits = fields.Boolean(compute='_compute_has_kits')
production_count = fields.Integer(
diff --git a/addons/mrp/models/stock_quant.py b/addons/mrp/models/stock_quant.py
index 9806de47d80c0..8d91b67264972 100644
--- a/addons/mrp/models/stock_quant.py
+++ b/addons/mrp/models/stock_quant.py
@@ -3,7 +3,7 @@
class StockQuant(models.Model):
- _inherit = 'stock.quant'
+ _inherit = ['stock.quant']
@api.constrains('product_id')
def _check_kits(self):
diff --git a/addons/mrp/models/stock_replenish_mixin.py b/addons/mrp/models/stock_replenish_mixin.py
index bf65d278bb7fc..c918a321af1b8 100644
--- a/addons/mrp/models/stock_replenish_mixin.py
+++ b/addons/mrp/models/stock_replenish_mixin.py
@@ -3,8 +3,8 @@
from odoo import api, fields, models
-class ProductReplenishMixin(models.AbstractModel):
- _inherit = 'stock.replenish.mixin'
+class StockReplenishMixin(models.AbstractModel):
+ _inherit = ['stock.replenish.mixin']
bom_id = fields.Many2one('mrp.bom', string="Bill of Material")
show_bom = fields.Boolean(compute='_compute_show_bom')
diff --git a/addons/mrp/models/stock_rule.py b/addons/mrp/models/stock_rule.py
index 560e550d52b73..898f13196c271 100644
--- a/addons/mrp/models/stock_rule.py
+++ b/addons/mrp/models/stock_rule.py
@@ -11,7 +11,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
action = fields.Selection(selection_add=[
('manufacture', 'Manufacture')
], ondelete={'manufacture': 'cascade'})
@@ -233,7 +233,7 @@ def _push_prepare_move_copy_values(self, move_to_copy, new_date):
class ProcurementGroup(models.Model):
- _inherit = 'procurement.group'
+ _inherit = ['procurement.group']
mrp_production_ids = fields.One2many('mrp.production', 'procurement_group_id')
diff --git a/addons/mrp/models/stock_scrap.py b/addons/mrp/models/stock_scrap.py
index 6b882d306d5ca..0a322e9bb7583 100644
--- a/addons/mrp/models/stock_scrap.py
+++ b/addons/mrp/models/stock_scrap.py
@@ -5,7 +5,7 @@
class StockScrap(models.Model):
- _inherit = 'stock.scrap'
+ _inherit = ['stock.scrap']
production_id = fields.Many2one(
'mrp.production', 'Manufacturing Order',
diff --git a/addons/mrp/models/stock_traceability.py b/addons/mrp/models/stock_traceability.py
index 1fddc4bf1aceb..5fe3e3faaf693 100644
--- a/addons/mrp/models/stock_traceability.py
+++ b/addons/mrp/models/stock_traceability.py
@@ -1,11 +1,12 @@
from odoo import models, api
-class MrpStockReport(models.TransientModel):
- _inherit = 'stock.traceability.report'
+
+class StockTraceabilityReport(models.TransientModel):
+ _inherit = ['stock.traceability.report']
@api.model
def _get_reference(self, move_line):
- res_model, res_id, ref = super(MrpStockReport, self)._get_reference(move_line)
+ res_model, res_id, ref = super()._get_reference(move_line)
if move_line.move_id.production_id and not move_line.move_id.scrapped:
res_model = 'mrp.production'
res_id = move_line.move_id.production_id.id
@@ -26,7 +27,7 @@ def _get_reference(self, move_line):
@api.model
def _get_linked_move_lines(self, move_line):
- move_lines, is_used = super(MrpStockReport, self)._get_linked_move_lines(move_line)
+ move_lines, is_used = super()._get_linked_move_lines(move_line)
if not move_lines:
move_lines = (move_line.move_id.consume_unbuild_id and move_line.produce_line_ids) or (move_line.move_id.production_id and move_line.consume_line_ids)
if not is_used:
diff --git a/addons/mrp/models/stock_warehouse.py b/addons/mrp/models/stock_warehouse.py
index e2660d71fc678..49ea652f4dc28 100644
--- a/addons/mrp/models/stock_warehouse.py
+++ b/addons/mrp/models/stock_warehouse.py
@@ -7,7 +7,7 @@
class StockWarehouse(models.Model):
- _inherit = 'stock.warehouse'
+ _inherit = ['stock.warehouse']
manufacture_to_resupply = fields.Boolean(
'Manufacture to Resupply', default=True,
@@ -279,8 +279,9 @@ def _update_name_and_code(self, name=False, code=False):
warehouse.manufacture_pull_id.write({'name': warehouse.manufacture_pull_id.name.replace(warehouse.name, name, 1)})
return res
-class Orderpoint(models.Model):
- _inherit = "stock.warehouse.orderpoint"
+
+class StockWarehouseOrderpoint(models.Model):
+ _inherit = ["stock.warehouse.orderpoint"]
@api.constrains('product_id')
def check_product_is_not_kit(self):
diff --git a/addons/mrp/report/mrp_report_bom_structure.py b/addons/mrp/report/mrp_report_bom_structure.py
index f71223aeb1834..4a7133aeec260 100644
--- a/addons/mrp/report/mrp_report_bom_structure.py
+++ b/addons/mrp/report/mrp_report_bom_structure.py
@@ -9,8 +9,7 @@
from odoo.exceptions import UserError
-class ReportBomStructure(models.AbstractModel):
- _name = 'report.mrp.report_bom_structure'
+class ReportMrpReport_Bom_Structure(models.AbstractModel):
_description = 'BOM Overview Report'
@api.model
diff --git a/addons/mrp/report/mrp_report_mo_overview.py b/addons/mrp/report/mrp_report_mo_overview.py
index 408e1eb9d3bbf..3c92c0d82f969 100644
--- a/addons/mrp/report/mrp_report_mo_overview.py
+++ b/addons/mrp/report/mrp_report_mo_overview.py
@@ -8,8 +8,8 @@
from datetime import datetime, timedelta
from math import log10
-class ReportMoOverview(models.AbstractModel):
- _name = 'report.mrp.report_mo_overview'
+
+class ReportMrpReport_Mo_Overview(models.AbstractModel):
_description = 'MO Overview Report'
@api.model
diff --git a/addons/mrp/report/report_stock_reception.py b/addons/mrp/report/report_stock_reception.py
index 457a6dbfb34dc..5c22d9dea7c84 100644
--- a/addons/mrp/report/report_stock_reception.py
+++ b/addons/mrp/report/report_stock_reception.py
@@ -5,8 +5,8 @@
from odoo.tools import format_date
-class ReceptionReport(models.AbstractModel):
- _inherit = 'report.stock.report_reception'
+class ReportStockReport_Reception(models.AbstractModel):
+ _inherit = ['report.stock.report_reception']
def _get_docs(self, docids):
if self.env.context.get('default_production_ids'):
diff --git a/addons/mrp/report/report_stock_rule.py b/addons/mrp/report/report_stock_rule.py
index 2f25ca6a6bd0b..f1541d6b272de 100644
--- a/addons/mrp/report/report_stock_rule.py
+++ b/addons/mrp/report/report_stock_rule.py
@@ -4,14 +4,14 @@
from odoo import api, models
-class ReportStockRule(models.AbstractModel):
- _inherit = 'report.stock.report_stock_rule'
+class ReportStockReport_Stock_Rule(models.AbstractModel):
+ _inherit = ['report.stock.report_stock_rule']
@api.model
def _get_rule_loc(self, rule, product_id):
""" We override this method to handle manufacture rule which do not have a location_src_id.
"""
- res = super(ReportStockRule, self)._get_rule_loc(rule, product_id)
+ res = super()._get_rule_loc(rule, product_id)
if rule.action == 'manufacture':
res['source'] = product_id.property_stock_production
return res
diff --git a/addons/mrp/report/stock_forecasted.py b/addons/mrp/report/stock_forecasted.py
index 30aa117bee0ff..d71d8d5ca0e74 100644
--- a/addons/mrp/report/stock_forecasted.py
+++ b/addons/mrp/report/stock_forecasted.py
@@ -4,8 +4,8 @@
from odoo import api, models
-class StockForecasted(models.AbstractModel):
- _inherit = 'stock.forecasted_product_product'
+class StockForecasted_Product_Product(models.AbstractModel):
+ _inherit = ['stock.forecasted_product_product']
def _prepare_report_line(self, quantity, move_out=None, move_in=None, replenishment_filled=True, product=False, reserved_move=False, in_transit=False, read=True):
line = super()._prepare_report_line(quantity, move_out, move_in, replenishment_filled, product, reserved_move, in_transit, read)
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
index 6782676406ef7..73d8d0063afa5 100644
--- a/addons/mrp/wizard/change_production_qty.py
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -7,7 +7,6 @@
class ChangeProductionQty(models.TransientModel):
- _name = 'change.production.qty'
_description = 'Change Production Qty'
mo_id = fields.Many2one('mrp.production', 'Manufacturing Order',
diff --git a/addons/mrp/wizard/mrp_batch_produce.py b/addons/mrp/wizard/mrp_batch_produce.py
index bee799f17cdde..6e1b946618526 100644
--- a/addons/mrp/wizard/mrp_batch_produce.py
+++ b/addons/mrp/wizard/mrp_batch_produce.py
@@ -9,8 +9,7 @@
from odoo.exceptions import UserError
-class MrpBatchProduct(models.TransientModel):
- _name = 'mrp.batch.produce'
+class MrpBatchProduce(models.TransientModel):
_description = 'Produce a batch of production order'
production_id = fields.Many2one('mrp.production', 'Production')
diff --git a/addons/mrp/wizard/mrp_consumption_warning.py b/addons/mrp/wizard/mrp_consumption_warning.py
index f1179fc7fba42..967dbe06fab34 100644
--- a/addons/mrp/wizard/mrp_consumption_warning.py
+++ b/addons/mrp/wizard/mrp_consumption_warning.py
@@ -7,7 +7,6 @@
class MrpConsumptionWarning(models.TransientModel):
- _name = 'mrp.consumption.warning'
_description = "Wizard in case of consumption in warning/strict and more component has been used for a MO (related to the bom)"
mrp_production_ids = fields.Many2many('mrp.production')
@@ -86,8 +85,8 @@ def action_cancel(self):
'target': 'main',
}
+
class MrpConsumptionWarningLine(models.TransientModel):
- _name = 'mrp.consumption.warning.line'
_description = "Line of issue consumption"
mrp_consumption_warning_id = fields.Many2one('mrp.consumption.warning', "Parent Wizard", readonly=True, required=True, ondelete="cascade")
diff --git a/addons/mrp/wizard/mrp_production_backorder.py b/addons/mrp/wizard/mrp_production_backorder.py
index cac73f6626a9b..4c4d3133216d4 100644
--- a/addons/mrp/wizard/mrp_production_backorder.py
+++ b/addons/mrp/wizard/mrp_production_backorder.py
@@ -5,7 +5,6 @@
class MrpProductionBackorderLine(models.TransientModel):
- _name = 'mrp.production.backorder.line'
_description = "Backorder Confirmation Line"
mrp_production_backorder_id = fields.Many2one('mrp.production.backorder', 'MO Backorder', required=True, ondelete="cascade")
@@ -14,7 +13,6 @@ class MrpProductionBackorderLine(models.TransientModel):
class MrpProductionBackorder(models.TransientModel):
- _name = 'mrp.production.backorder'
_description = "Wizard to mark as done or create back order"
mrp_production_ids = fields.Many2many('mrp.production')
diff --git a/addons/mrp/wizard/mrp_production_split.py b/addons/mrp/wizard/mrp_production_split.py
index ad7e88bc8ce07..f505c17b40080 100644
--- a/addons/mrp/wizard/mrp_production_split.py
+++ b/addons/mrp/wizard/mrp_production_split.py
@@ -6,14 +6,12 @@
class MrpProductionSplitMulti(models.TransientModel):
- _name = 'mrp.production.split.multi'
_description = "Wizard to Split Multiple Productions"
production_ids = fields.One2many('mrp.production.split', 'production_split_multi_id', 'Productions To Split')
class MrpProductionSplit(models.TransientModel):
- _name = 'mrp.production.split'
_description = "Wizard to Split a Production"
production_split_multi_id = fields.Many2one('mrp.production.split.multi', 'Split Productions')
@@ -91,7 +89,6 @@ def action_return_to_list(self):
class MrpProductionSplitLine(models.TransientModel):
- _name = 'mrp.production.split.line'
_description = "Split Production Detail"
mrp_production_split_id = fields.Many2one(
diff --git a/addons/mrp/wizard/product_replenish.py b/addons/mrp/wizard/product_replenish.py
index 5bada6d118629..35ebd2587949e 100644
--- a/addons/mrp/wizard/product_replenish.py
+++ b/addons/mrp/wizard/product_replenish.py
@@ -5,7 +5,7 @@
class ProductReplenish(models.TransientModel):
- _inherit = 'product.replenish'
+ _inherit = ['product.replenish']
@api.depends('route_id')
def _compute_date_planned(self):
diff --git a/addons/mrp/wizard/stock_label_type.py b/addons/mrp/wizard/stock_label_type.py
index 851366ee04600..f22e715a872fd 100644
--- a/addons/mrp/wizard/stock_label_type.py
+++ b/addons/mrp/wizard/stock_label_type.py
@@ -4,8 +4,8 @@
from odoo import _, fields, models
-class ProductLabelLayout(models.TransientModel):
- _inherit = 'picking.label.type'
+class PickingLabelType(models.TransientModel):
+ _inherit = ['picking.label.type']
production_ids = fields.Many2many('mrp.production')
diff --git a/addons/mrp/wizard/stock_warn_insufficient_qty.py b/addons/mrp/wizard/stock_warn_insufficient_qty.py
index 335c54249a489..a94a0482dc8a9 100644
--- a/addons/mrp/wizard/stock_warn_insufficient_qty.py
+++ b/addons/mrp/wizard/stock_warn_insufficient_qty.py
@@ -5,8 +5,7 @@
class StockWarnInsufficientQtyUnbuild(models.TransientModel):
- _name = 'stock.warn.insufficient.qty.unbuild'
- _inherit = 'stock.warn.insufficient.qty'
+ _inherit = ['stock.warn.insufficient.qty']
_description = 'Warn Insufficient Unbuild Quantity'
unbuild_id = fields.Many2one('mrp.unbuild', 'Unbuild')
diff --git a/addons/mrp_account/models/account_move.py b/addons/mrp_account/models/account_move.py
index d745218f9b828..871d90af70746 100644
--- a/addons/mrp_account/models/account_move.py
+++ b/addons/mrp_account/models/account_move.py
@@ -7,7 +7,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
wip_production_ids = fields.Many2many(
'mrp.production', string="Relevant WIP MOs",
@@ -40,7 +40,7 @@ def action_view_wip_production(self):
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
def _get_invoiced_qty_per_product(self):
# Replace the kit-type products with their components
diff --git a/addons/mrp_account/models/analytic_account.py b/addons/mrp_account/models/analytic_account.py
index fb60d90b3c6d7..c8cdc1af782d4 100644
--- a/addons/mrp_account/models/analytic_account.py
+++ b/addons/mrp_account/models/analytic_account.py
@@ -5,7 +5,7 @@
class AccountAnalyticAccount(models.Model):
- _inherit = 'account.analytic.account'
+ _inherit = ['account.analytic.account']
_description = 'Analytic Account'
production_ids = fields.Many2many('mrp.production')
@@ -74,12 +74,13 @@ def action_view_workorder(self):
class AccountAnalyticLine(models.Model):
- _inherit = 'account.analytic.line'
+ _inherit = ['account.analytic.line']
category = fields.Selection(selection_add=[('manufacturing_order', 'Manufacturing Order')])
+
class AccountAnalyticApplicability(models.Model):
- _inherit = 'account.analytic.applicability'
+ _inherit = ['account.analytic.applicability']
_description = "Analytic Plan's Applicabilities"
business_domain = fields.Selection(
diff --git a/addons/mrp_account/models/mrp_production.py b/addons/mrp_account/models/mrp_production.py
index fcba308ad414b..5917131ea7714 100644
--- a/addons/mrp_account/models/mrp_production.py
+++ b/addons/mrp_account/models/mrp_production.py
@@ -8,7 +8,7 @@
class MrpProduction(models.Model):
- _inherit = 'mrp.production'
+ _inherit = ['mrp.production']
extra_cost = fields.Float(copy=False, string='Extra Unit Cost')
show_valuation = fields.Boolean(compute='_compute_show_valuation')
diff --git a/addons/mrp_account/models/mrp_routing.py b/addons/mrp_account/models/mrp_routing.py
index f36d70eac0232..3b333f93efcb1 100644
--- a/addons/mrp_account/models/mrp_routing.py
+++ b/addons/mrp_account/models/mrp_routing.py
@@ -5,7 +5,7 @@
class MrpRoutingWorkcenter(models.Model):
- _inherit = 'mrp.routing.workcenter'
+ _inherit = ['mrp.routing.workcenter']
def _total_cost_per_hour(self):
self.ensure_one()
diff --git a/addons/mrp_account/models/mrp_workcenter.py b/addons/mrp_account/models/mrp_workcenter.py
index 76b7e310a459f..cecfc8047827d 100644
--- a/addons/mrp_account/models/mrp_workcenter.py
+++ b/addons/mrp_account/models/mrp_workcenter.py
@@ -5,7 +5,6 @@
class MrpWorkcenter(models.Model):
- _name = 'mrp.workcenter'
_inherit = ['mrp.workcenter', 'analytic.mixin']
costs_hour_account_ids = fields.Many2many('account.analytic.account', compute="_compute_costs_hour_account_ids", store=True)
@@ -21,7 +20,6 @@ def _compute_costs_hour_account_ids(self):
class MrpWorkcenterProductivity(models.Model):
- _name = 'mrp.workcenter.productivity'
- _inherit = 'mrp.workcenter.productivity'
+ _inherit = ['mrp.workcenter.productivity']
account_move_line_id = fields.Many2one('account.move.line')
diff --git a/addons/mrp_account/models/mrp_workorder.py b/addons/mrp_account/models/mrp_workorder.py
index ac93579621d60..71df3eab27dad 100644
--- a/addons/mrp_account/models/mrp_workorder.py
+++ b/addons/mrp_account/models/mrp_workorder.py
@@ -5,7 +5,7 @@
class MrpWorkorder(models.Model):
- _inherit = 'mrp.workorder'
+ _inherit = ['mrp.workorder']
mo_analytic_account_line_ids = fields.Many2many('account.analytic.line', 'mrp_workorder_mo_analytic_rel', copy=False)
wc_analytic_account_line_ids = fields.Many2many('account.analytic.line', 'mrp_workorder_wc_analytic_rel', copy=False)
diff --git a/addons/mrp_account/models/product.py b/addons/mrp_account/models/product.py
index 626d7e1a56b31..1cbd24b7903e7 100644
--- a/addons/mrp_account/models/product.py
+++ b/addons/mrp_account/models/product.py
@@ -6,8 +6,7 @@
class ProductTemplate(models.Model):
- _name = 'product.template'
- _inherit = 'product.template'
+ _inherit = ['product.template']
def _get_product_accounts(self):
accounts = super()._get_product_accounts()
@@ -28,8 +27,7 @@ def button_bom_cost(self):
class ProductProduct(models.Model):
- _name = 'product.product'
- _inherit = 'product.product'
+ _inherit = ['product.product']
def button_bom_cost(self):
self.ensure_one()
@@ -114,7 +112,7 @@ def _compute_bom_price(self, bom, boms_to_recompute=False, byproduct_bom=False):
class ProductCategory(models.Model):
- _inherit = 'product.category'
+ _inherit = ['product.category']
property_stock_account_production_cost_id = fields.Many2one(
'account.account', 'Production Account', company_dependent=True, ondelete='restrict',
diff --git a/addons/mrp_account/models/stock_move.py b/addons/mrp_account/models/stock_move.py
index 6ea08d1eb8ded..bf42b1869f885 100644
--- a/addons/mrp_account/models/stock_move.py
+++ b/addons/mrp_account/models/stock_move.py
@@ -7,7 +7,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
def _filter_anglo_saxon_moves(self, product):
res = super(StockMove, self)._filter_anglo_saxon_moves(product)
diff --git a/addons/mrp_account/report/mrp_report_mo_overview.py b/addons/mrp_account/report/mrp_report_mo_overview.py
index 6008f8caf4f1d..bb9c48c528f8d 100644
--- a/addons/mrp_account/report/mrp_report_mo_overview.py
+++ b/addons/mrp_account/report/mrp_report_mo_overview.py
@@ -4,8 +4,9 @@
from odoo import models
from odoo.tools import float_is_zero
-class ReportMoOverview(models.AbstractModel):
- _inherit = 'report.mrp.report_mo_overview'
+
+class ReportMrpReport_Mo_Overview(models.AbstractModel):
+ _inherit = ['report.mrp.report_mo_overview']
def _get_unit_cost(self, move):
valuation_layers = move.sudo().stock_valuation_layer_ids
diff --git a/addons/mrp_account/wizard/mrp_wip_accounting.py b/addons/mrp_account/wizard/mrp_wip_accounting.py
index 0d94b3d27ef0d..f10d424771a3b 100644
--- a/addons/mrp_account/wizard/mrp_wip_accounting.py
+++ b/addons/mrp_account/wizard/mrp_wip_accounting.py
@@ -7,8 +7,7 @@
from odoo.tools import format_list
-class MrpWipAccountingLine(models.TransientModel):
- _name = 'mrp.account.wip.accounting.line'
+class MrpAccountWipAccountingLine(models.TransientModel):
_description = 'Account move line to be created when posting WIP account move'
account_id = fields.Many2one('account.account', "Account")
@@ -36,8 +35,7 @@ def _compute_credit(self):
record.credit = 0
-class MrpWipAccounting(models.TransientModel):
- _name = 'mrp.account.wip.accounting'
+class MrpAccountWipAccounting(models.TransientModel):
_description = 'Wizard to post Manufacturing WIP account move'
@api.model
diff --git a/addons/mrp_landed_costs/models/stock_landed_cost.py b/addons/mrp_landed_costs/models/stock_landed_cost.py
index edc6b5d40d841..1b5d1122b81e7 100644
--- a/addons/mrp_landed_costs/models/stock_landed_cost.py
+++ b/addons/mrp_landed_costs/models/stock_landed_cost.py
@@ -5,7 +5,7 @@
class StockLandedCost(models.Model):
- _inherit = 'stock.landed.cost'
+ _inherit = ['stock.landed.cost']
target_model = fields.Selection(selection_add=[
('manufacturing', "Manufacturing Orders")
diff --git a/addons/mrp_product_expiry/models/mrp_production.py b/addons/mrp_product_expiry/models/mrp_production.py
index ada9bd5e1869a..53a4ba7864170 100644
--- a/addons/mrp_product_expiry/models/mrp_production.py
+++ b/addons/mrp_product_expiry/models/mrp_production.py
@@ -4,8 +4,8 @@
from odoo import models, _
-class MrpWorkorder(models.Model):
- _inherit = 'mrp.production'
+class MrpProduction(models.Model):
+ _inherit = ['mrp.production']
def pre_button_mark_done(self):
confirm_expired_lots = self._check_expired_lots()
diff --git a/addons/mrp_product_expiry/wizard/confirm_expiry.py b/addons/mrp_product_expiry/wizard/confirm_expiry.py
index d3dabe27ec410..e12a417c32235 100644
--- a/addons/mrp_product_expiry/wizard/confirm_expiry.py
+++ b/addons/mrp_product_expiry/wizard/confirm_expiry.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models, _
-class ConfirmExpiry(models.TransientModel):
- _inherit = 'expiry.picking.confirmation'
+class ExpiryPickingConfirmation(models.TransientModel):
+ _inherit = ['expiry.picking.confirmation']
production_ids = fields.Many2many('mrp.production', readonly=True)
workorder_id = fields.Many2one('mrp.workorder', readonly=True)
@@ -30,7 +30,7 @@ def _compute_descriptive_fields(self):
lot_name=self.lot_ids.name,
)
else:
- super(ConfirmExpiry, self)._compute_descriptive_fields()
+ super()._compute_descriptive_fields()
def confirm_produce(self):
ctx = dict(self._context, skip_expired=True)
diff --git a/addons/mrp_repair/models/production.py b/addons/mrp_repair/models/production.py
index bb885ab00dd96..c43b9c885be87 100644
--- a/addons/mrp_repair/models/production.py
+++ b/addons/mrp_repair/models/production.py
@@ -4,7 +4,7 @@
class MrpProduction(models.Model):
- _inherit = 'mrp.production'
+ _inherit = ['mrp.production']
repair_count = fields.Integer(
string='Count of source repairs',
diff --git a/addons/mrp_repair/models/repair.py b/addons/mrp_repair/models/repair.py
index a343ccd823fa7..f87afcc04dcb3 100644
--- a/addons/mrp_repair/models/repair.py
+++ b/addons/mrp_repair/models/repair.py
@@ -3,8 +3,8 @@
from odoo import api, models, fields, _
-class Repair(models.Model):
- _inherit = 'repair.order'
+class RepairOrder(models.Model):
+ _inherit = ['repair.order']
production_count = fields.Integer(
'Count of MOs generated',
@@ -75,7 +75,7 @@ def _get_action_add_from_catalog_extra_context(self):
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _prepare_phantom_line_vals(self, bom_line, qty):
self.ensure_one()
diff --git a/addons/mrp_subcontracting/models/mrp_bom.py b/addons/mrp_subcontracting/models/mrp_bom.py
index 954318cae5486..da2fc744151f2 100644
--- a/addons/mrp_subcontracting/models/mrp_bom.py
+++ b/addons/mrp_subcontracting/models/mrp_bom.py
@@ -5,8 +5,9 @@
from odoo.exceptions import ValidationError
from odoo.osv.expression import AND
+
class MrpBom(models.Model):
- _inherit = 'mrp.bom'
+ _inherit = ['mrp.bom']
type = fields.Selection(selection_add=[
('subcontract', 'Subcontracting')
diff --git a/addons/mrp_subcontracting/models/mrp_production.py b/addons/mrp_subcontracting/models/mrp_production.py
index 9069ca4ee02c9..8d75725970c20 100644
--- a/addons/mrp_subcontracting/models/mrp_production.py
+++ b/addons/mrp_subcontracting/models/mrp_production.py
@@ -8,7 +8,7 @@
class MrpProduction(models.Model):
- _inherit = 'mrp.production'
+ _inherit = ['mrp.production']
_rec_names_search = ['name', 'incoming_picking.name']
move_line_raw_ids = fields.One2many(
diff --git a/addons/mrp_subcontracting/models/product.py b/addons/mrp_subcontracting/models/product.py
index 2dc0ecf580ab7..c0edb3ed83586 100644
--- a/addons/mrp_subcontracting/models/product.py
+++ b/addons/mrp_subcontracting/models/product.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class SupplierInfo(models.Model):
- _inherit = 'product.supplierinfo'
+class ProductSupplierinfo(models.Model):
+ _inherit = ['product.supplierinfo']
is_subcontractor = fields.Boolean('Subcontracted', compute='_compute_is_subcontractor', help="Choose a vendor of type subcontractor if you want to subcontract the product")
@@ -18,7 +18,7 @@ def _compute_is_subcontractor(self):
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def _prepare_sellers(self, params=False):
if params and params.get('subcontractor_ids'):
diff --git a/addons/mrp_subcontracting/models/res_company.py b/addons/mrp_subcontracting/models/res_company.py
index c6a4070bf602f..ced5575cef970 100644
--- a/addons/mrp_subcontracting/models/res_company.py
+++ b/addons/mrp_subcontracting/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
subcontracting_location_id = fields.Many2one('stock.location')
diff --git a/addons/mrp_subcontracting/models/res_partner.py b/addons/mrp_subcontracting/models/res_partner.py
index 35598c8971e48..f5d10e7bc8adc 100644
--- a/addons/mrp_subcontracting/models/res_partner.py
+++ b/addons/mrp_subcontracting/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
property_stock_subcontractor = fields.Many2one(
'stock.location', string="Subcontractor Location", company_dependent=True,
diff --git a/addons/mrp_subcontracting/models/stock_location.py b/addons/mrp_subcontracting/models/stock_location.py
index 27a45356067b5..e09c0124fce03 100644
--- a/addons/mrp_subcontracting/models/stock_location.py
+++ b/addons/mrp_subcontracting/models/stock_location.py
@@ -6,7 +6,7 @@
class StockLocation(models.Model):
- _inherit = 'stock.location'
+ _inherit = ['stock.location']
is_subcontracting_location = fields.Boolean(
"Is a Subcontracting Location?",
diff --git a/addons/mrp_subcontracting/models/stock_move.py b/addons/mrp_subcontracting/models/stock_move.py
index d789dff9b31d8..f09ed46701084 100644
--- a/addons/mrp_subcontracting/models/stock_move.py
+++ b/addons/mrp_subcontracting/models/stock_move.py
@@ -10,7 +10,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
is_subcontract = fields.Boolean('The move is a subcontract receipt')
show_subcontracting_details_visible = fields.Boolean(
diff --git a/addons/mrp_subcontracting/models/stock_move_line.py b/addons/mrp_subcontracting/models/stock_move_line.py
index 418b006f1471c..b5d9749aea832 100644
--- a/addons/mrp_subcontracting/models/stock_move_line.py
+++ b/addons/mrp_subcontracting/models/stock_move_line.py
@@ -6,7 +6,7 @@
class StockMoveLine(models.Model):
- _inherit = 'stock.move.line'
+ _inherit = ['stock.move.line']
@api.onchange('lot_name', 'lot_id')
def _onchange_serial_number(self):
diff --git a/addons/mrp_subcontracting/models/stock_picking.py b/addons/mrp_subcontracting/models/stock_picking.py
index 77c5e0aeab3bd..b93e2bb9b8377 100644
--- a/addons/mrp_subcontracting/models/stock_picking.py
+++ b/addons/mrp_subcontracting/models/stock_picking.py
@@ -10,8 +10,7 @@
class StockPicking(models.Model):
- _name = 'stock.picking'
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
move_line_ids_without_package = fields.One2many(
domain=['&', '|', ('location_dest_id.usage', '!=', 'production'), ('move_id.picking_code', '!=', 'outgoing'),
diff --git a/addons/mrp_subcontracting/models/stock_quant.py b/addons/mrp_subcontracting/models/stock_quant.py
index adb6f96a25560..0f08966f32f22 100644
--- a/addons/mrp_subcontracting/models/stock_quant.py
+++ b/addons/mrp_subcontracting/models/stock_quant.py
@@ -6,7 +6,7 @@
class StockQuant(models.Model):
- _inherit = 'stock.quant'
+ _inherit = ['stock.quant']
is_subcontract = fields.Boolean(store=False, search='_search_is_subcontract')
diff --git a/addons/mrp_subcontracting/models/stock_replenish_mixin.py b/addons/mrp_subcontracting/models/stock_replenish_mixin.py
index fcbe4ee6ee63b..6413d83537080 100644
--- a/addons/mrp_subcontracting/models/stock_replenish_mixin.py
+++ b/addons/mrp_subcontracting/models/stock_replenish_mixin.py
@@ -4,8 +4,8 @@
from odoo.osv import expression
-class ProductReplenishMixin(models.AbstractModel):
- _inherit = 'stock.replenish.mixin'
+class StockReplenishMixin(models.AbstractModel):
+ _inherit = ['stock.replenish.mixin']
def _get_allowed_route_domain(self):
domains = super()._get_allowed_route_domain()
diff --git a/addons/mrp_subcontracting/models/stock_rule.py b/addons/mrp_subcontracting/models/stock_rule.py
index 45154e0b72267..75bef61ad2ae4 100644
--- a/addons/mrp_subcontracting/models/stock_rule.py
+++ b/addons/mrp_subcontracting/models/stock_rule.py
@@ -5,7 +5,7 @@
class StockRule(models.Model):
- _inherit = "stock.rule"
+ _inherit = ["stock.rule"]
def _push_prepare_move_copy_values(self, move_to_copy, new_date):
new_move_vals = super(StockRule, self)._push_prepare_move_copy_values(move_to_copy, new_date)
diff --git a/addons/mrp_subcontracting/models/stock_warehouse.py b/addons/mrp_subcontracting/models/stock_warehouse.py
index e5de4f5dbc186..113f1461a4415 100644
--- a/addons/mrp_subcontracting/models/stock_warehouse.py
+++ b/addons/mrp_subcontracting/models/stock_warehouse.py
@@ -5,7 +5,7 @@
class StockWarehouse(models.Model):
- _inherit = 'stock.warehouse'
+ _inherit = ['stock.warehouse']
subcontracting_to_resupply = fields.Boolean(
'Resupply Subcontractors', default=True)
diff --git a/addons/mrp_subcontracting/report/mrp_report_bom_structure.py b/addons/mrp_subcontracting/report/mrp_report_bom_structure.py
index 84492b3ac5f19..eef65d009e9a2 100644
--- a/addons/mrp_subcontracting/report/mrp_report_bom_structure.py
+++ b/addons/mrp_subcontracting/report/mrp_report_bom_structure.py
@@ -5,8 +5,8 @@
from odoo.tools import float_compare
-class ReportBomStructure(models.AbstractModel):
- _inherit = 'report.mrp.report_bom_structure'
+class ReportMrpReport_Bom_Structure(models.AbstractModel):
+ _inherit = ['report.mrp.report_bom_structure']
def _get_subcontracting_line(self, bom, seller, level, bom_quantity):
ratio_uom_seller = seller.product_uom.ratio / bom.product_uom_id.ratio
diff --git a/addons/mrp_subcontracting/wizard/change_production_qty.py b/addons/mrp_subcontracting/wizard/change_production_qty.py
index 4839db1cedbef..7df9c916ab573 100644
--- a/addons/mrp_subcontracting/wizard/change_production_qty.py
+++ b/addons/mrp_subcontracting/wizard/change_production_qty.py
@@ -5,7 +5,7 @@
class ChangeProductionQty(models.TransientModel):
- _inherit = 'change.production.qty'
+ _inherit = ['change.production.qty']
@api.model
def _need_quantity_propagation(self, move, qty):
diff --git a/addons/mrp_subcontracting/wizard/mrp_consumption_warning.py b/addons/mrp_subcontracting/wizard/mrp_consumption_warning.py
index 4e37dc88c9bd1..5245510a2d68c 100644
--- a/addons/mrp_subcontracting/wizard/mrp_consumption_warning.py
+++ b/addons/mrp_subcontracting/wizard/mrp_consumption_warning.py
@@ -5,7 +5,7 @@
class MrpConsumptionWarning(models.TransientModel):
- _inherit = 'mrp.consumption.warning'
+ _inherit = ['mrp.consumption.warning']
def action_confirm(self):
if self.mrp_production_ids._get_subcontract_move():
diff --git a/addons/mrp_subcontracting/wizard/stock_picking_return.py b/addons/mrp_subcontracting/wizard/stock_picking_return.py
index bbf3f376feb98..fd2f94ad7972c 100644
--- a/addons/mrp_subcontracting/wizard/stock_picking_return.py
+++ b/addons/mrp_subcontracting/wizard/stock_picking_return.py
@@ -4,8 +4,8 @@
from odoo import api, models, fields
-class ReturnPicking(models.TransientModel):
- _inherit = 'stock.return.picking'
+class StockReturnPicking(models.TransientModel):
+ _inherit = ['stock.return.picking']
def _prepare_picking_default_values(self):
vals = super()._prepare_picking_default_values()
@@ -14,8 +14,8 @@ def _prepare_picking_default_values(self):
return vals
-class ReturnPickingLine(models.TransientModel):
- _inherit = 'stock.return.picking.line'
+class StockReturnPickingLine(models.TransientModel):
+ _inherit = ['stock.return.picking.line']
def _prepare_move_default_values(self, new_picking):
vals = super()._prepare_move_default_values(new_picking)
diff --git a/addons/mrp_subcontracting_account/models/mrp_production.py b/addons/mrp_subcontracting_account/models/mrp_production.py
index b17d373a47e6a..7337ed461ae7b 100644
--- a/addons/mrp_subcontracting_account/models/mrp_production.py
+++ b/addons/mrp_subcontracting_account/models/mrp_production.py
@@ -5,7 +5,7 @@
class MrpProduction(models.Model):
- _inherit = 'mrp.production'
+ _inherit = ['mrp.production']
def _cal_price(self, consumed_moves):
finished_move = self.move_finished_ids.filtered(lambda x: x.product_id == self.product_id and x.state not in ('done', 'cancel') and x.quantity > 0)
diff --git a/addons/mrp_subcontracting_account/models/product_product.py b/addons/mrp_subcontracting_account/models/product_product.py
index f2539f2b84320..49aca55e5e794 100644
--- a/addons/mrp_subcontracting_account/models/product_product.py
+++ b/addons/mrp_subcontracting_account/models/product_product.py
@@ -3,8 +3,9 @@
from odoo import models, fields
+
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def _compute_bom_price(self, bom, boms_to_recompute=False, byproduct_bom=False):
""" Add the price of the subcontracting supplier if it exists with the bom configuration.
diff --git a/addons/mrp_subcontracting_account/models/stock_move.py b/addons/mrp_subcontracting_account/models/stock_move.py
index 9634f94f60bbf..50a780444e890 100644
--- a/addons/mrp_subcontracting_account/models/stock_move.py
+++ b/addons/mrp_subcontracting_account/models/stock_move.py
@@ -5,7 +5,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _should_force_price_unit(self):
self.ensure_one()
diff --git a/addons/mrp_subcontracting_account/models/stock_picking.py b/addons/mrp_subcontracting_account/models/stock_picking.py
index 6440926412ba9..5277894ae478e 100644
--- a/addons/mrp_subcontracting_account/models/stock_picking.py
+++ b/addons/mrp_subcontracting_account/models/stock_picking.py
@@ -6,7 +6,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
def action_view_stock_valuation_layers(self):
action = super(StockPicking, self).action_view_stock_valuation_layers()
diff --git a/addons/mrp_subcontracting_dropshipping/models/purchase.py b/addons/mrp_subcontracting_dropshipping/models/purchase.py
index 9548e2376991c..54f80c506794a 100644
--- a/addons/mrp_subcontracting_dropshipping/models/purchase.py
+++ b/addons/mrp_subcontracting_dropshipping/models/purchase.py
@@ -6,7 +6,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
default_location_dest_id_is_subcontracting_loc = fields.Boolean(related='picking_type_id.default_location_dest_id.is_subcontracting_location')
diff --git a/addons/mrp_subcontracting_dropshipping/models/res_company.py b/addons/mrp_subcontracting_dropshipping/models/res_company.py
index 7a216750994db..a56dec41b4e2e 100644
--- a/addons/mrp_subcontracting_dropshipping/models/res_company.py
+++ b/addons/mrp_subcontracting_dropshipping/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
dropship_subcontractor_pick_type_id = fields.Many2one('stock.picking.type')
diff --git a/addons/mrp_subcontracting_dropshipping/models/stock_move.py b/addons/mrp_subcontracting_dropshipping/models/stock_move.py
index 831ac41366bdf..243fbbfd598d2 100644
--- a/addons/mrp_subcontracting_dropshipping/models/stock_move.py
+++ b/addons/mrp_subcontracting_dropshipping/models/stock_move.py
@@ -5,7 +5,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
def _prepare_procurement_values(self):
vals = super()._prepare_procurement_values()
diff --git a/addons/mrp_subcontracting_dropshipping/models/stock_orderpoint.py b/addons/mrp_subcontracting_dropshipping/models/stock_orderpoint.py
index a1b8f7e0bc63b..e06fc33ef4f09 100644
--- a/addons/mrp_subcontracting_dropshipping/models/stock_orderpoint.py
+++ b/addons/mrp_subcontracting_dropshipping/models/stock_orderpoint.py
@@ -5,7 +5,7 @@
class StockWarehouseOrderpoint(models.Model):
- _inherit = 'stock.warehouse.orderpoint'
+ _inherit = ['stock.warehouse.orderpoint']
def _prepare_procurement_values(self, date=False, group=False):
vals = super()._prepare_procurement_values(date, group)
diff --git a/addons/mrp_subcontracting_dropshipping/models/stock_picking.py b/addons/mrp_subcontracting_dropshipping/models/stock_picking.py
index 0e23a300e3177..0491d4ce427af 100644
--- a/addons/mrp_subcontracting_dropshipping/models/stock_picking.py
+++ b/addons/mrp_subcontracting_dropshipping/models/stock_picking.py
@@ -6,7 +6,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
def _compute_is_dropship(self):
dropship_subcontract_pickings = self.filtered(lambda p: p.location_dest_id.is_subcontracting_location and p.location_id.usage == 'supplier')
diff --git a/addons/mrp_subcontracting_dropshipping/models/stock_replenish_mixin.py b/addons/mrp_subcontracting_dropshipping/models/stock_replenish_mixin.py
index 16efb11676246..baf9cae76829b 100644
--- a/addons/mrp_subcontracting_dropshipping/models/stock_replenish_mixin.py
+++ b/addons/mrp_subcontracting_dropshipping/models/stock_replenish_mixin.py
@@ -4,8 +4,8 @@
from odoo.osv import expression
-class ProductReplenishMixin(models.AbstractModel):
- _inherit = 'stock.replenish.mixin'
+class StockReplenishMixin(models.AbstractModel):
+ _inherit = ['stock.replenish.mixin']
def _get_allowed_route_domain(self):
domains = super()._get_allowed_route_domain()
diff --git a/addons/mrp_subcontracting_dropshipping/models/stock_rule.py b/addons/mrp_subcontracting_dropshipping/models/stock_rule.py
index db4cf3e506dc1..1eb4f1fe682b9 100644
--- a/addons/mrp_subcontracting_dropshipping/models/stock_rule.py
+++ b/addons/mrp_subcontracting_dropshipping/models/stock_rule.py
@@ -5,7 +5,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
def _prepare_purchase_order(self, company_id, origins, values):
if 'partner_id' not in values[0] \
diff --git a/addons/mrp_subcontracting_dropshipping/models/stock_warehouse.py b/addons/mrp_subcontracting_dropshipping/models/stock_warehouse.py
index 96e4c5938abf0..71f1f74be3c7a 100644
--- a/addons/mrp_subcontracting_dropshipping/models/stock_warehouse.py
+++ b/addons/mrp_subcontracting_dropshipping/models/stock_warehouse.py
@@ -5,7 +5,7 @@
class StockWarehouse(models.Model):
- _inherit = 'stock.warehouse'
+ _inherit = ['stock.warehouse']
subcontracting_dropshipping_to_resupply = fields.Boolean(
'Dropship Subcontractors', default=True,
diff --git a/addons/mrp_subcontracting_landed_costs/models/stock_move.py b/addons/mrp_subcontracting_landed_costs/models/stock_move.py
index 957b6dcb74e94..15f9c12cc7b27 100644
--- a/addons/mrp_subcontracting_landed_costs/models/stock_move.py
+++ b/addons/mrp_subcontracting_landed_costs/models/stock_move.py
@@ -2,7 +2,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _get_stock_valuation_layer_ids(self):
self.ensure_one()
diff --git a/addons/mrp_subcontracting_purchase/models/account_move_line.py b/addons/mrp_subcontracting_purchase/models/account_move_line.py
index fba799638576c..1990c9545b8a7 100644
--- a/addons/mrp_subcontracting_purchase/models/account_move_line.py
+++ b/addons/mrp_subcontracting_purchase/models/account_move_line.py
@@ -5,7 +5,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _get_price_unit_val_dif_and_relevant_qty(self):
price_unit_val_dif, relevant_qty = super()._get_price_unit_val_dif_and_relevant_qty()
diff --git a/addons/mrp_subcontracting_purchase/models/purchase_order.py b/addons/mrp_subcontracting_purchase/models/purchase_order.py
index 9ac20c0322301..5494561828417 100644
--- a/addons/mrp_subcontracting_purchase/models/purchase_order.py
+++ b/addons/mrp_subcontracting_purchase/models/purchase_order.py
@@ -5,7 +5,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
subcontracting_resupply_picking_count = fields.Integer(
"Count of Subcontracting Resupply", compute='_compute_subcontracting_resupply_picking_count',
diff --git a/addons/mrp_subcontracting_purchase/models/stock_move.py b/addons/mrp_subcontracting_purchase/models/stock_move.py
index 2fd9b63000789..05f902a8025fd 100644
--- a/addons/mrp_subcontracting_purchase/models/stock_move.py
+++ b/addons/mrp_subcontracting_purchase/models/stock_move.py
@@ -5,7 +5,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _is_purchase_return(self):
res = super()._is_purchase_return()
diff --git a/addons/mrp_subcontracting_purchase/models/stock_picking.py b/addons/mrp_subcontracting_purchase/models/stock_picking.py
index 81cf530f65387..b6efacd59517c 100644
--- a/addons/mrp_subcontracting_purchase/models/stock_picking.py
+++ b/addons/mrp_subcontracting_purchase/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
subcontracting_source_purchase_count = fields.Integer(
"Number of subcontracting PO Source", compute='_compute_subcontracting_source_purchase_count',
diff --git a/addons/mrp_subcontracting_purchase/models/stock_rule.py b/addons/mrp_subcontracting_purchase/models/stock_rule.py
index b0c3d40d6b43b..c1005b4f48192 100644
--- a/addons/mrp_subcontracting_purchase/models/stock_rule.py
+++ b/addons/mrp_subcontracting_purchase/models/stock_rule.py
@@ -2,7 +2,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
def _get_lead_days(self, product, **values):
"""For subcontracting, we need to consider both vendor lead time and
diff --git a/addons/mrp_subcontracting_purchase/models/stock_valuation_layer.py b/addons/mrp_subcontracting_purchase/models/stock_valuation_layer.py
index ce7b1d9e7b6a8..af29fe4fb6655 100644
--- a/addons/mrp_subcontracting_purchase/models/stock_valuation_layer.py
+++ b/addons/mrp_subcontracting_purchase/models/stock_valuation_layer.py
@@ -4,7 +4,7 @@
class StockValuationLayer(models.Model):
- _inherit = 'stock.valuation.layer'
+ _inherit = ['stock.valuation.layer']
def _get_layer_price_unit(self):
""" For a subcontracted product, we want a way to get the subcontracting cost (the price on the PO)
diff --git a/addons/mrp_subcontracting_purchase/report/mrp_report_bom_structure.py b/addons/mrp_subcontracting_purchase/report/mrp_report_bom_structure.py
index d2b79cc92358c..4bc951643375f 100644
--- a/addons/mrp_subcontracting_purchase/report/mrp_report_bom_structure.py
+++ b/addons/mrp_subcontracting_purchase/report/mrp_report_bom_structure.py
@@ -4,8 +4,8 @@
from odoo import api, models
-class ReportBomStructure(models.AbstractModel):
- _inherit = 'report.mrp.report_bom_structure'
+class ReportMrpReport_Bom_Structure(models.AbstractModel):
+ _inherit = ['report.mrp.report_bom_structure']
@api.model
def _is_buy_route(self, rules, product, bom):
diff --git a/addons/onboarding/models/onboarding_onboarding.py b/addons/onboarding/models/onboarding_onboarding.py
index cdd97783bbef0..0e244650da13d 100644
--- a/addons/onboarding/models/onboarding_onboarding.py
+++ b/addons/onboarding/models/onboarding_onboarding.py
@@ -5,8 +5,7 @@
from odoo.addons.onboarding.models.onboarding_progress import ONBOARDING_PROGRESS_STATES
-class Onboarding(models.Model):
- _name = 'onboarding.onboarding'
+class OnboardingOnboarding(models.Model):
_description = 'Onboarding'
_order = 'sequence asc, id desc'
diff --git a/addons/onboarding/models/onboarding_onboarding_step.py b/addons/onboarding/models/onboarding_onboarding_step.py
index 9fac09dc964af..9ce7db15935fb 100644
--- a/addons/onboarding/models/onboarding_onboarding_step.py
+++ b/addons/onboarding/models/onboarding_onboarding_step.py
@@ -6,8 +6,7 @@
from odoo.exceptions import ValidationError
-class OnboardingStep(models.Model):
- _name = 'onboarding.onboarding.step'
+class OnboardingOnboardingStep(models.Model):
_description = 'Onboarding Step'
_order = 'sequence asc, id asc'
_rec_name = 'title'
diff --git a/addons/onboarding/models/onboarding_progress.py b/addons/onboarding/models/onboarding_progress.py
index 8a11d4db1e326..d625e53fead87 100644
--- a/addons/onboarding/models/onboarding_progress.py
+++ b/addons/onboarding/models/onboarding_progress.py
@@ -12,7 +12,6 @@
class OnboardingProgress(models.Model):
- _name = 'onboarding.progress'
_description = 'Onboarding Progress Tracker'
_rec_name = 'onboarding_id'
diff --git a/addons/onboarding/models/onboarding_progress_step.py b/addons/onboarding/models/onboarding_progress_step.py
index 87e5e5b30f22b..668694d677287 100644
--- a/addons/onboarding/models/onboarding_progress_step.py
+++ b/addons/onboarding/models/onboarding_progress_step.py
@@ -6,7 +6,6 @@
class OnboardingProgressStep(models.Model):
- _name = 'onboarding.progress.step'
_description = 'Onboarding Progress Step Tracker'
_rec_name = 'step_id'
diff --git a/addons/partner_autocomplete/models/iap_autocomplete_api.py b/addons/partner_autocomplete/models/iap_autocomplete_api.py
index a0996cf4f1cde..03dfcf79420c0 100644
--- a/addons/partner_autocomplete/models/iap_autocomplete_api.py
+++ b/addons/partner_autocomplete/models/iap_autocomplete_api.py
@@ -10,8 +10,7 @@
_logger = logging.getLogger(__name__)
-class IapAutocompleteEnrichAPI(models.AbstractModel):
- _name = 'iap.autocomplete.api'
+class IapAutocompleteApi(models.AbstractModel):
_description = 'IAP Partner Autocomplete API'
_DEFAULT_ENDPOINT = 'https://partner-autocomplete.odoo.com'
diff --git a/addons/partner_autocomplete/models/ir_http.py b/addons/partner_autocomplete/models/ir_http.py
index 4f7ff87ee537c..6fe2a99d9bade 100644
--- a/addons/partner_autocomplete/models/ir_http.py
+++ b/addons/partner_autocomplete/models/ir_http.py
@@ -4,12 +4,12 @@
from odoo import models
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
def session_info(self):
""" Add information about iap enrich to perform """
- session_info = super(Http, self).session_info()
+ session_info = super().session_info()
if session_info.get('is_admin'):
session_info['iap_company_enrich'] = not self.env.user.company_id.iap_enrich_auto_done
return session_info
diff --git a/addons/partner_autocomplete/models/res_company.py b/addons/partner_autocomplete/models/res_company.py
index b72954b2f0db8..d6698e3e23177 100644
--- a/addons/partner_autocomplete/models/res_company.py
+++ b/addons/partner_autocomplete/models/res_company.py
@@ -15,8 +15,7 @@
class ResCompany(models.Model):
- _name = 'res.company'
- _inherit = 'res.company'
+ _inherit = ['res.company']
partner_gid = fields.Integer('Company database ID', related="partner_id.partner_gid", inverse="_inverse_partner_gid", store=True)
iap_enrich_auto_done = fields.Boolean('Enrich Done')
diff --git a/addons/partner_autocomplete/models/res_config_settings.py b/addons/partner_autocomplete/models/res_config_settings.py
index 09e5cd354b706..b9c44fabc7913 100644
--- a/addons/partner_autocomplete/models/res_config_settings.py
+++ b/addons/partner_autocomplete/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
partner_autocomplete_insufficient_credit = fields.Boolean('Insufficient credit', compute="_compute_partner_autocomplete_insufficient_credit")
diff --git a/addons/partner_autocomplete/models/res_partner.py b/addons/partner_autocomplete/models/res_partner.py
index b77efdd9ceb69..3ed437ad0bda4 100644
--- a/addons/partner_autocomplete/models/res_partner.py
+++ b/addons/partner_autocomplete/models/res_partner.py
@@ -24,9 +24,9 @@
'XI': 'GB', # United Kingdom (Northern Ireland)
}
+
class ResPartner(models.Model):
- _name = 'res.partner'
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
partner_gid = fields.Integer('Company database ID')
additional_info = fields.Char('Additional info')
diff --git a/addons/partner_autocomplete/models/res_partner_autocomplete_sync.py b/addons/partner_autocomplete/models/res_partner_autocomplete_sync.py
index 8274380df6228..cf6d6a7c655ee 100644
--- a/addons/partner_autocomplete/models/res_partner_autocomplete_sync.py
+++ b/addons/partner_autocomplete/models/res_partner_autocomplete_sync.py
@@ -6,8 +6,8 @@
_logger = logging.getLogger(__name__)
+
class ResPartnerAutocompleteSync(models.Model):
- _name = 'res.partner.autocomplete.sync'
_description = 'Partner Autocomplete Sync'
partner_id = fields.Many2one('res.partner', string="Partner", ondelete='cascade')
diff --git a/addons/payment/models/ir_http.py b/addons/payment/models/ir_http.py
index dadfeb875f812..fce1fb494eacd 100644
--- a/addons/payment/models/ir_http.py
+++ b/addons/payment/models/ir_http.py
@@ -4,7 +4,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _get_translation_frontend_modules_name(cls):
diff --git a/addons/payment/models/onboarding_step.py b/addons/payment/models/onboarding_step.py
index 75d9e0bdc51b6..dd02f65ed3c62 100644
--- a/addons/payment/models/onboarding_step.py
+++ b/addons/payment/models/onboarding_step.py
@@ -3,8 +3,8 @@
from odoo import api, models
-class OnboardingStep(models.Model):
- _inherit = 'onboarding.onboarding.step'
+class OnboardingOnboardingStep(models.Model):
+ _inherit = ['onboarding.onboarding.step']
@api.model
def action_validate_step_payment_provider(self):
diff --git a/addons/payment/models/payment_method.py b/addons/payment/models/payment_method.py
index f2cbe016f92af..48a91a5e24798 100644
--- a/addons/payment/models/payment_method.py
+++ b/addons/payment/models/payment_method.py
@@ -9,7 +9,6 @@
class PaymentMethod(models.Model):
- _name = 'payment.method'
_description = "Payment Method"
_order = 'active desc, sequence, name'
diff --git a/addons/payment/models/payment_provider.py b/addons/payment/models/payment_provider.py
index b2da6f08ee781..dce32223d373e 100644
--- a/addons/payment/models/payment_provider.py
+++ b/addons/payment/models/payment_provider.py
@@ -12,7 +12,6 @@
class PaymentProvider(models.Model):
- _name = 'payment.provider'
_description = 'Payment Provider'
_order = 'module_state, state desc, sequence, name'
_check_company_auto = True
diff --git a/addons/payment/models/payment_token.py b/addons/payment/models/payment_token.py
index d42dde6699405..f52b65002e3e1 100644
--- a/addons/payment/models/payment_token.py
+++ b/addons/payment/models/payment_token.py
@@ -7,7 +7,6 @@
class PaymentToken(models.Model):
- _name = 'payment.token'
_order = 'partner_id, id desc'
_description = 'Payment Token'
_check_company_auto = True
diff --git a/addons/payment/models/payment_transaction.py b/addons/payment/models/payment_transaction.py
index dbdc0a4d8babc..3bb3e52c8f926 100644
--- a/addons/payment/models/payment_transaction.py
+++ b/addons/payment/models/payment_transaction.py
@@ -20,7 +20,6 @@
class PaymentTransaction(models.Model):
- _name = 'payment.transaction'
_description = 'Payment Transaction'
_order = 'id desc'
_rec_name = 'reference'
diff --git a/addons/payment/models/res_company.py b/addons/payment/models/res_company.py
index 8c170bb7dfe69..0de98187a911f 100644
--- a/addons/payment/models/res_company.py
+++ b/addons/payment/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
payment_onboarding_payment_method = fields.Selection(
string="Selected onboarding payment method",
diff --git a/addons/payment/models/res_country.py b/addons/payment/models/res_country.py
index 69b0a1636c1a1..b59680399215a 100644
--- a/addons/payment/models/res_country.py
+++ b/addons/payment/models/res_country.py
@@ -5,7 +5,7 @@
class ResCountry(models.Model):
- _inherit = 'res.country'
+ _inherit = ['res.country']
is_stripe_supported_country = fields.Boolean(compute='_compute_is_stripe_supported_country')
diff --git a/addons/payment/models/res_partner.py b/addons/payment/models/res_partner.py
index afb594a70d81d..97f42cb9ea524 100644
--- a/addons/payment/models/res_partner.py
+++ b/addons/payment/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
payment_token_ids = fields.One2many(
string="Payment Tokens", comodel_name='payment.token', inverse_name='partner_id')
diff --git a/addons/payment/wizards/payment_capture_wizard.py b/addons/payment/wizards/payment_capture_wizard.py
index e41474f133fb5..3822a6ca1d587 100644
--- a/addons/payment/wizards/payment_capture_wizard.py
+++ b/addons/payment/wizards/payment_capture_wizard.py
@@ -6,7 +6,6 @@
class PaymentCaptureWizard(models.TransientModel):
- _name = 'payment.capture.wizard'
_description = "Payment Capture Wizard"
transaction_ids = fields.Many2many( # All the source txs related to the capture request
diff --git a/addons/payment/wizards/payment_link_wizard.py b/addons/payment/wizards/payment_link_wizard.py
index 9a6d12223da76..65abf652fc33e 100644
--- a/addons/payment/wizards/payment_link_wizard.py
+++ b/addons/payment/wizards/payment_link_wizard.py
@@ -8,7 +8,6 @@
class PaymentLinkWizard(models.TransientModel):
- _name = 'payment.link.wizard'
_description = "Generate Payment Link"
@api.model
diff --git a/addons/payment/wizards/payment_onboarding_wizard.py b/addons/payment/wizards/payment_onboarding_wizard.py
index cf28e8f32394e..bcd60b44e56f7 100644
--- a/addons/payment/wizards/payment_onboarding_wizard.py
+++ b/addons/payment/wizards/payment_onboarding_wizard.py
@@ -4,8 +4,7 @@
from odoo.exceptions import UserError
-class PaymentWizard(models.TransientModel):
- _name = 'payment.provider.onboarding.wizard'
+class PaymentProviderOnboardingWizard(models.TransientModel):
_description = 'Payment provider onboarding wizard'
payment_method = fields.Selection([
diff --git a/addons/payment_adyen/models/payment_provider.py b/addons/payment_adyen/models/payment_provider.py
index e48027015e275..85660a33cca63 100644
--- a/addons/payment_adyen/models/payment_provider.py
+++ b/addons/payment_adyen/models/payment_provider.py
@@ -15,7 +15,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('adyen', "Adyen")], ondelete={'adyen': 'set default'})
diff --git a/addons/payment_adyen/models/payment_token.py b/addons/payment_adyen/models/payment_token.py
index b72a8594943c4..131980d3a5e98 100644
--- a/addons/payment_adyen/models/payment_token.py
+++ b/addons/payment_adyen/models/payment_token.py
@@ -4,7 +4,7 @@
class PaymentToken(models.Model):
- _inherit = 'payment.token'
+ _inherit = ['payment.token']
adyen_shopper_reference = fields.Char(
string="Shopper Reference", help="The unique reference of the partner owning this token",
diff --git a/addons/payment_adyen/models/payment_transaction.py b/addons/payment_adyen/models/payment_transaction.py
index 6087eda27671b..d7bc3dc97daca 100644
--- a/addons/payment_adyen/models/payment_transaction.py
+++ b/addons/payment_adyen/models/payment_transaction.py
@@ -15,7 +15,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
#=== BUSINESS METHODS ===#
diff --git a/addons/payment_adyen/wizards/payment_capture_wizard.py b/addons/payment_adyen/wizards/payment_capture_wizard.py
index 4b010572b8abe..86be885e9813e 100644
--- a/addons/payment_adyen/wizards/payment_capture_wizard.py
+++ b/addons/payment_adyen/wizards/payment_capture_wizard.py
@@ -4,7 +4,7 @@
class PaymentCaptureWizard(models.TransientModel):
- _inherit = 'payment.capture.wizard'
+ _inherit = ['payment.capture.wizard']
has_adyen_tx = fields.Boolean(compute='_compute_has_adyen_tx')
diff --git a/addons/payment_aps/models/payment_provider.py b/addons/payment_aps/models/payment_provider.py
index 1a080b593b194..8025121387a1b 100644
--- a/addons/payment_aps/models/payment_provider.py
+++ b/addons/payment_aps/models/payment_provider.py
@@ -12,7 +12,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('aps', "Amazon Payment Services")], ondelete={'aps': 'set default'}
diff --git a/addons/payment_aps/models/payment_transaction.py b/addons/payment_aps/models/payment_transaction.py
index e009efb02a5c0..dd22b924c5fca 100644
--- a/addons/payment_aps/models/payment_transaction.py
+++ b/addons/payment_aps/models/payment_transaction.py
@@ -17,7 +17,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
@api.model
def _compute_reference(self, provider_code, prefix=None, separator='-', **kwargs):
diff --git a/addons/payment_asiapay/models/payment_provider.py b/addons/payment_asiapay/models/payment_provider.py
index 38c31b4f05565..b7313a47acf6e 100644
--- a/addons/payment_asiapay/models/payment_provider.py
+++ b/addons/payment_asiapay/models/payment_provider.py
@@ -9,7 +9,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('asiapay', "AsiaPay")], ondelete={'asiapay': 'set default'}
diff --git a/addons/payment_asiapay/models/payment_transaction.py b/addons/payment_asiapay/models/payment_transaction.py
index db25681917c17..7b3935f7e0374 100644
--- a/addons/payment_asiapay/models/payment_transaction.py
+++ b/addons/payment_asiapay/models/payment_transaction.py
@@ -16,7 +16,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
@api.model
def _compute_reference(self, provider_code, prefix=None, separator='-', **kwargs):
diff --git a/addons/payment_authorize/models/payment_provider.py b/addons/payment_authorize/models/payment_provider.py
index d75baca42d4de..d1f241a75bbef 100644
--- a/addons/payment_authorize/models/payment_provider.py
+++ b/addons/payment_authorize/models/payment_provider.py
@@ -15,7 +15,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('authorize', 'Authorize.Net')], ondelete={'authorize': 'set default'})
diff --git a/addons/payment_authorize/models/payment_token.py b/addons/payment_authorize/models/payment_token.py
index 7e287bd6f224c..a87a80cee49d7 100644
--- a/addons/payment_authorize/models/payment_token.py
+++ b/addons/payment_authorize/models/payment_token.py
@@ -12,7 +12,7 @@
class PaymentToken(models.Model):
- _inherit = 'payment.token'
+ _inherit = ['payment.token']
authorize_profile = fields.Char(
string="Authorize.Net Profile ID",
diff --git a/addons/payment_authorize/models/payment_transaction.py b/addons/payment_authorize/models/payment_transaction.py
index 48c32ad6852f1..020752a978844 100644
--- a/addons/payment_authorize/models/payment_transaction.py
+++ b/addons/payment_authorize/models/payment_transaction.py
@@ -15,7 +15,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_processing_values(self, processing_values):
""" Override of payment to return an access token as provider-specific processing values.
diff --git a/addons/payment_buckaroo/models/payment_provider.py b/addons/payment_buckaroo/models/payment_provider.py
index c5214c717ab5a..761508590fd74 100644
--- a/addons/payment_buckaroo/models/payment_provider.py
+++ b/addons/payment_buckaroo/models/payment_provider.py
@@ -10,7 +10,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('buckaroo', "Buckaroo")], ondelete={'buckaroo': 'set default'})
diff --git a/addons/payment_buckaroo/models/payment_transaction.py b/addons/payment_buckaroo/models/payment_transaction.py
index 17ed59ef56c51..541e86d2f9047 100644
--- a/addons/payment_buckaroo/models/payment_transaction.py
+++ b/addons/payment_buckaroo/models/payment_transaction.py
@@ -14,7 +14,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_rendering_values(self, processing_values):
""" Override of payment to return Buckaroo-specific rendering values.
diff --git a/addons/payment_custom/models/payment_provider.py b/addons/payment_custom/models/payment_provider.py
index 906d59d406521..919db03f5eda5 100644
--- a/addons/payment_custom/models/payment_provider.py
+++ b/addons/payment_custom/models/payment_provider.py
@@ -7,7 +7,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
_sql_constraints = [(
'custom_providers_setup',
diff --git a/addons/payment_custom/models/payment_transaction.py b/addons/payment_custom/models/payment_transaction.py
index 9395bcd64d125..517739c7ca73c 100644
--- a/addons/payment_custom/models/payment_transaction.py
+++ b/addons/payment_custom/models/payment_transaction.py
@@ -11,7 +11,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_rendering_values(self, processing_values):
""" Override of payment to return custom-specific rendering values.
diff --git a/addons/payment_demo/models/payment_provider.py b/addons/payment_demo/models/payment_provider.py
index ee577e6dd0377..75aa1e352274c 100644
--- a/addons/payment_demo/models/payment_provider.py
+++ b/addons/payment_demo/models/payment_provider.py
@@ -7,7 +7,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(selection_add=[('demo', 'Demo')], ondelete={'demo': 'set default'})
diff --git a/addons/payment_demo/models/payment_token.py b/addons/payment_demo/models/payment_token.py
index d5074b0c264f3..41131bad018b4 100644
--- a/addons/payment_demo/models/payment_token.py
+++ b/addons/payment_demo/models/payment_token.py
@@ -4,7 +4,7 @@
class PaymentToken(models.Model):
- _inherit = 'payment.token'
+ _inherit = ['payment.token']
demo_simulated_state = fields.Selection(
string="Simulated State",
diff --git a/addons/payment_demo/models/payment_transaction.py b/addons/payment_demo/models/payment_transaction.py
index 1fb025ea5fa0c..8a7f656411a07 100644
--- a/addons/payment_demo/models/payment_transaction.py
+++ b/addons/payment_demo/models/payment_transaction.py
@@ -9,7 +9,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
capture_manually = fields.Boolean(related='provider_id.capture_manually')
diff --git a/addons/payment_flutterwave/models/payment_provider.py b/addons/payment_flutterwave/models/payment_provider.py
index eb022ba0777b7..cac4b006e3cbe 100644
--- a/addons/payment_flutterwave/models/payment_provider.py
+++ b/addons/payment_flutterwave/models/payment_provider.py
@@ -18,7 +18,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('flutterwave', "Flutterwave")], ondelete={'flutterwave': 'set default'}
diff --git a/addons/payment_flutterwave/models/payment_token.py b/addons/payment_flutterwave/models/payment_token.py
index d03d1e32d20ff..62bfe450fc6a7 100644
--- a/addons/payment_flutterwave/models/payment_token.py
+++ b/addons/payment_flutterwave/models/payment_token.py
@@ -4,7 +4,7 @@
class PaymentToken(models.Model):
- _inherit = 'payment.token'
+ _inherit = ['payment.token']
flutterwave_customer_email = fields.Char(
help="The email of the customer at the time the token was created.", readonly=True
diff --git a/addons/payment_flutterwave/models/payment_transaction.py b/addons/payment_flutterwave/models/payment_transaction.py
index 52773bb1fb1a2..6fcda5f422d4a 100644
--- a/addons/payment_flutterwave/models/payment_transaction.py
+++ b/addons/payment_flutterwave/models/payment_transaction.py
@@ -17,7 +17,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_rendering_values(self, processing_values):
""" Override of payment to return Flutterwave-specific rendering values.
diff --git a/addons/payment_mercado_pago/models/payment_provider.py b/addons/payment_mercado_pago/models/payment_provider.py
index f1776003734d3..04ad01dea4984 100644
--- a/addons/payment_mercado_pago/models/payment_provider.py
+++ b/addons/payment_mercado_pago/models/payment_provider.py
@@ -16,7 +16,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('mercado_pago', "Mercado Pago")], ondelete={'mercado_pago': 'set default'}
diff --git a/addons/payment_mercado_pago/models/payment_transaction.py b/addons/payment_mercado_pago/models/payment_transaction.py
index 23416ec02210b..e51ed742c7a7d 100644
--- a/addons/payment_mercado_pago/models/payment_transaction.py
+++ b/addons/payment_mercado_pago/models/payment_transaction.py
@@ -17,7 +17,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_rendering_values(self, processing_values):
""" Override of `payment` to return Mercado Pago-specific rendering values.
diff --git a/addons/payment_mollie/models/payment_provider.py b/addons/payment_mollie/models/payment_provider.py
index fd809722a9325..0b28f7f9547bb 100755
--- a/addons/payment_mollie/models/payment_provider.py
+++ b/addons/payment_mollie/models/payment_provider.py
@@ -15,7 +15,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('mollie', 'Mollie')], ondelete={'mollie': 'set default'}
diff --git a/addons/payment_mollie/models/payment_transaction.py b/addons/payment_mollie/models/payment_transaction.py
index 84e009f522ad0..9d002eb36dd08 100644
--- a/addons/payment_mollie/models/payment_transaction.py
+++ b/addons/payment_mollie/models/payment_transaction.py
@@ -16,7 +16,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_rendering_values(self, processing_values):
""" Override of payment to return Mollie-specific rendering values.
diff --git a/addons/payment_paypal/models/payment_provider.py b/addons/payment_paypal/models/payment_provider.py
index 410b514086258..f2b96dffbb6a1 100644
--- a/addons/payment_paypal/models/payment_provider.py
+++ b/addons/payment_paypal/models/payment_provider.py
@@ -19,7 +19,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('paypal', "PayPal")], ondelete={'paypal': 'set default'}
diff --git a/addons/payment_paypal/models/payment_transaction.py b/addons/payment_paypal/models/payment_transaction.py
index d2bd7063371cb..c2ce43c5deabc 100644
--- a/addons/payment_paypal/models/payment_transaction.py
+++ b/addons/payment_paypal/models/payment_transaction.py
@@ -14,7 +14,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
# See https://developer.paypal.com/docs/api-basics/notifications/ipn/IPNandPDTVariables/
# this field has no use in Odoo except for debugging
diff --git a/addons/payment_razorpay/models/payment_provider.py b/addons/payment_razorpay/models/payment_provider.py
index afb5d9a9e69e0..a424da9579c64 100644
--- a/addons/payment_razorpay/models/payment_provider.py
+++ b/addons/payment_razorpay/models/payment_provider.py
@@ -18,7 +18,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('razorpay', "Razorpay")], ondelete={'razorpay': 'set default'}
diff --git a/addons/payment_razorpay/models/payment_token.py b/addons/payment_razorpay/models/payment_token.py
index 5e22533d939cd..398465177009a 100644
--- a/addons/payment_razorpay/models/payment_token.py
+++ b/addons/payment_razorpay/models/payment_token.py
@@ -7,7 +7,7 @@
class PaymentToken(models.Model):
- _inherit = 'payment.token'
+ _inherit = ['payment.token']
def _razorpay_get_limit_exceed_warning(self, amount, currency_id):
""" Return a warning message when the maximum payment amount is exceeded.
diff --git a/addons/payment_razorpay/models/payment_transaction.py b/addons/payment_razorpay/models/payment_transaction.py
index 15d2bb36323d0..1d35181c0b198 100644
--- a/addons/payment_razorpay/models/payment_transaction.py
+++ b/addons/payment_razorpay/models/payment_transaction.py
@@ -18,7 +18,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_processing_values(self, processing_values):
""" Override of `payment` to return razorpay-specific processing values.
diff --git a/addons/payment_stripe/models/payment_provider.py b/addons/payment_stripe/models/payment_provider.py
index 8bfd7d98a6842..a17afd9cdf8b0 100644
--- a/addons/payment_stripe/models/payment_provider.py
+++ b/addons/payment_stripe/models/payment_provider.py
@@ -20,7 +20,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('stripe', "Stripe")], ondelete={'stripe': 'set default'})
diff --git a/addons/payment_stripe/models/payment_token.py b/addons/payment_stripe/models/payment_token.py
index 5891e3cd8c536..57db6256aed40 100644
--- a/addons/payment_stripe/models/payment_token.py
+++ b/addons/payment_stripe/models/payment_token.py
@@ -10,7 +10,7 @@
class PaymentToken(models.Model):
- _inherit = 'payment.token'
+ _inherit = ['payment.token']
stripe_payment_method = fields.Char(string="Stripe Payment Method ID", readonly=True)
stripe_mandate = fields.Char(string="Stripe Mandate", readonly=True)
diff --git a/addons/payment_stripe/models/payment_transaction.py b/addons/payment_stripe/models/payment_transaction.py
index 582755b3c85e7..9db8bdc8b554c 100644
--- a/addons/payment_stripe/models/payment_transaction.py
+++ b/addons/payment_stripe/models/payment_transaction.py
@@ -18,7 +18,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_processing_values(self, processing_values):
""" Override of payment to return Stripe-specific processing values.
diff --git a/addons/payment_worldline/models/payment_provider.py b/addons/payment_worldline/models/payment_provider.py
index 3f2bde01c06b2..6feb52be99eea 100644
--- a/addons/payment_worldline/models/payment_provider.py
+++ b/addons/payment_worldline/models/payment_provider.py
@@ -19,7 +19,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('worldline', "Worldline")], ondelete={'worldline': 'set default'}
diff --git a/addons/payment_worldline/models/payment_transaction.py b/addons/payment_worldline/models/payment_transaction.py
index 0c90088826a85..1f0ee09eea4fb 100644
--- a/addons/payment_worldline/models/payment_transaction.py
+++ b/addons/payment_worldline/models/payment_transaction.py
@@ -17,7 +17,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_rendering_values(self, processing_values):
""" Override of `payment` to return Worldline-specific processing values.
diff --git a/addons/payment_xendit/models/payment_provider.py b/addons/payment_xendit/models/payment_provider.py
index 5207e67e53232..e6a376ab909fb 100644
--- a/addons/payment_xendit/models/payment_provider.py
+++ b/addons/payment_xendit/models/payment_provider.py
@@ -15,7 +15,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
code = fields.Selection(
selection_add=[('xendit', "Xendit")], ondelete={'xendit': 'set default'}
diff --git a/addons/payment_xendit/models/payment_transaction.py b/addons/payment_xendit/models/payment_transaction.py
index 2017ab09f13d3..32d06c1cc477b 100644
--- a/addons/payment_xendit/models/payment_transaction.py
+++ b/addons/payment_xendit/models/payment_transaction.py
@@ -15,7 +15,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
def _get_specific_rendering_values(self, processing_values):
""" Override of `payment` to return Xendit-specific rendering values.
diff --git a/addons/phone_validation/models/mail_thread_phone.py b/addons/phone_validation/models/mail_thread_phone.py
index 4ed597fa626bc..1a348c3a22d46 100644
--- a/addons/phone_validation/models/mail_thread_phone.py
+++ b/addons/phone_validation/models/mail_thread_phone.py
@@ -11,7 +11,7 @@
PHONE_REGEX_PATTERN = r'[\s\\./\(\)\-]'
-class PhoneMixin(models.AbstractModel):
+class MailThreadPhone(models.AbstractModel):
""" Purpose of this mixin is to offer two services
* compute a sanitized phone number based on _phone_get_number_fields.
@@ -28,7 +28,6 @@ class PhoneMixin(models.AbstractModel):
* ``_phone_reset_blacklisted``: reactivate recordset (even if not blacklisted
this method can be called safely);
"""
- _name = 'mail.thread.phone'
_description = 'Phone Blacklist Mixin'
_inherit = ['mail.thread']
_phone_search_min_length = 3
diff --git a/addons/phone_validation/models/models.py b/addons/phone_validation/models/models.py
index c34d80982c367..097e6ed1ba081 100644
--- a/addons/phone_validation/models/models.py
+++ b/addons/phone_validation/models/models.py
@@ -6,7 +6,9 @@
class BaseModel(models.AbstractModel):
- _inherit = 'base'
+ _name = "base"
+
+ _inherit = ['base']
# ------------------------------------------------------------
# FIELDS HELPERS
diff --git a/addons/phone_validation/models/phone_blacklist.py b/addons/phone_validation/models/phone_blacklist.py
index faeb508a9f729..48a10a2ce4f3d 100644
--- a/addons/phone_validation/models/phone_blacklist.py
+++ b/addons/phone_validation/models/phone_blacklist.py
@@ -5,9 +5,8 @@
from odoo.tools import _, SQL
-class PhoneBlackList(models.Model):
+class PhoneBlacklist(models.Model):
""" Blacklist of phone numbers. Used to avoid sending unwanted messages to people. """
- _name = 'phone.blacklist'
_inherit = ['mail.thread']
_description = 'Phone Blacklist'
_rec_name = 'number'
@@ -64,7 +63,7 @@ def write(self, values):
except UserError as err:
raise UserError(_("%(error)s Please correct the number and try again.", error=str(err))) from err
values['number'] = sanitized
- return super(PhoneBlackList, self).write(values)
+ return super().write(values)
def _condition_to_sql(self, alias: str, fname: str, operator: str, value, query) -> SQL:
if fname == 'number':
diff --git a/addons/phone_validation/models/res_partner.py b/addons/phone_validation/models/res_partner.py
index 292d0c131bcf1..e9625d89de8c9 100644
--- a/addons/phone_validation/models/res_partner.py
+++ b/addons/phone_validation/models/res_partner.py
@@ -4,8 +4,7 @@
from odoo.addons.phone_validation.tools import phone_validation
-class Partner(models.Model):
- _name = 'res.partner'
+class ResPartner(models.Model):
_inherit = ['res.partner']
@api.onchange('phone', 'country_id', 'company_id')
diff --git a/addons/phone_validation/models/res_users.py b/addons/phone_validation/models/res_users.py
index 9a918ad283f9f..1b800e2335f16 100644
--- a/addons/phone_validation/models/res_users.py
+++ b/addons/phone_validation/models/res_users.py
@@ -4,8 +4,8 @@
from odoo import _, models
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
def _deactivate_portal_user(self, **post):
"""Blacklist the phone of the user after deleting it."""
@@ -17,7 +17,7 @@ def _deactivate_portal_user(self, **post):
if number:
numbers_to_blacklist[number] = user
- super(Users, self)._deactivate_portal_user(**post)
+ super()._deactivate_portal_user(**post)
if numbers_to_blacklist:
current_user = self.env.user
diff --git a/addons/phone_validation/wizard/phone_blacklist_remove.py b/addons/phone_validation/wizard/phone_blacklist_remove.py
index e882a7a36c636..25248470f53ed 100644
--- a/addons/phone_validation/wizard/phone_blacklist_remove.py
+++ b/addons/phone_validation/wizard/phone_blacklist_remove.py
@@ -5,7 +5,6 @@
class PhoneBlacklistRemove(models.TransientModel):
- _name = 'phone.blacklist.remove'
_description = 'Remove phone from blacklist'
phone = fields.Char(string="Phone Number", readonly=True, required=True)
diff --git a/addons/point_of_sale/models/account_bank_statement.py b/addons/point_of_sale/models/account_bank_statement.py
index 4f1c5f59d0785..1e830dac34342 100644
--- a/addons/point_of_sale/models/account_bank_statement.py
+++ b/addons/point_of_sale/models/account_bank_statement.py
@@ -6,6 +6,6 @@
class AccountBankStatementLine(models.Model):
- _inherit = 'account.bank.statement.line'
+ _inherit = ['account.bank.statement.line']
pos_session_id = fields.Many2one('pos.session', string="Session", copy=False)
diff --git a/addons/point_of_sale/models/account_fiscal_position.py b/addons/point_of_sale/models/account_fiscal_position.py
index b0862cf8e9d29..be84825451f7b 100644
--- a/addons/point_of_sale/models/account_fiscal_position.py
+++ b/addons/point_of_sale/models/account_fiscal_position.py
@@ -2,7 +2,6 @@
class AccountFiscalPosition(models.Model):
- _name = 'account.fiscal.position'
_inherit = ['account.fiscal.position', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/account_fiscal_position_tax.py b/addons/point_of_sale/models/account_fiscal_position_tax.py
index e6ac964df35c0..a9ccce7beb0a0 100644
--- a/addons/point_of_sale/models/account_fiscal_position_tax.py
+++ b/addons/point_of_sale/models/account_fiscal_position_tax.py
@@ -2,7 +2,6 @@
class AccountFiscalPositionTax(models.Model):
- _name = 'account.fiscal.position.tax'
_inherit = ['account.fiscal.position.tax', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/account_journal.py b/addons/point_of_sale/models/account_journal.py
index 1cf2732d836d7..06ec357fb9ad9 100644
--- a/addons/point_of_sale/models/account_journal.py
+++ b/addons/point_of_sale/models/account_journal.py
@@ -4,8 +4,9 @@
from odoo import fields, models, api, _
from odoo.exceptions import ValidationError
+
class AccountJournal(models.Model):
- _inherit = 'account.journal'
+ _inherit = ['account.journal']
pos_payment_method_ids = fields.One2many('pos.payment.method', 'journal_id', string='Point of Sale Payment Methods')
diff --git a/addons/point_of_sale/models/account_move.py b/addons/point_of_sale/models/account_move.py
index e07b43e02dc44..36b99b50260de 100644
--- a/addons/point_of_sale/models/account_move.py
+++ b/addons/point_of_sale/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
pos_order_ids = fields.One2many('pos.order', 'account_move')
pos_payment_ids = fields.One2many('pos.payment', 'account_move_id')
@@ -70,7 +70,7 @@ def _compute_amount(self):
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _stock_account_get_anglo_saxon_price_unit(self):
self.ensure_one()
diff --git a/addons/point_of_sale/models/account_payment.py b/addons/point_of_sale/models/account_payment.py
index 7a26552c004b6..30ff3e9ab5e36 100644
--- a/addons/point_of_sale/models/account_payment.py
+++ b/addons/point_of_sale/models/account_payment.py
@@ -5,7 +5,7 @@
class AccountPayment(models.Model):
- _inherit = 'account.payment'
+ _inherit = ['account.payment']
pos_payment_method_id = fields.Many2one('pos.payment.method', "POS Payment Method")
force_outstanding_account_id = fields.Many2one("account.account", "Forced Outstanding Account", check_company=True)
diff --git a/addons/point_of_sale/models/account_tax.py b/addons/point_of_sale/models/account_tax.py
index 4e88b2bed1f68..da0bf62e6033e 100644
--- a/addons/point_of_sale/models/account_tax.py
+++ b/addons/point_of_sale/models/account_tax.py
@@ -6,7 +6,6 @@
class AccountTax(models.Model):
- _name = 'account.tax'
_inherit = ['account.tax', 'pos.load.mixin']
def write(self, vals):
diff --git a/addons/point_of_sale/models/account_tax_group.py b/addons/point_of_sale/models/account_tax_group.py
index d42ad0eec259c..984932f99be99 100644
--- a/addons/point_of_sale/models/account_tax_group.py
+++ b/addons/point_of_sale/models/account_tax_group.py
@@ -2,7 +2,6 @@
class AccountTaxGroup(models.Model):
- _name = 'account.tax.group'
_inherit = ['account.tax.group', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/barcode_rule.py b/addons/point_of_sale/models/barcode_rule.py
index e9b67a515823e..d7f553ef35c71 100644
--- a/addons/point_of_sale/models/barcode_rule.py
+++ b/addons/point_of_sale/models/barcode_rule.py
@@ -6,7 +6,7 @@
class BarcodeRule(models.Model):
- _inherit = 'barcode.rule'
+ _inherit = ['barcode.rule']
type = fields.Selection(selection_add=[
('weight', 'Weighted Product'),
diff --git a/addons/point_of_sale/models/decimal_precision.py b/addons/point_of_sale/models/decimal_precision.py
index 539fc3e10f174..4bfb8d2ce40b2 100644
--- a/addons/point_of_sale/models/decimal_precision.py
+++ b/addons/point_of_sale/models/decimal_precision.py
@@ -2,7 +2,6 @@
class DecimalPrecision(models.Model):
- _name = 'decimal.precision'
_inherit = ['decimal.precision', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/digest.py b/addons/point_of_sale/models/digest.py
index 6834b50299dc4..c89fc110a1f07 100644
--- a/addons/point_of_sale/models/digest.py
+++ b/addons/point_of_sale/models/digest.py
@@ -5,8 +5,8 @@
from odoo.exceptions import AccessError
-class Digest(models.Model):
- _inherit = 'digest.digest'
+class DigestDigest(models.Model):
+ _inherit = ['digest.digest']
kpi_pos_total = fields.Boolean('POS Sales')
kpi_pos_total_value = fields.Monetary(compute='_compute_kpi_pos_total_value')
@@ -24,6 +24,6 @@ def _compute_kpi_pos_total_value(self):
)
def _compute_kpis_actions(self, company, user):
- res = super(Digest, self)._compute_kpis_actions(company, user)
+ res = super()._compute_kpis_actions(company, user)
res['kpi_pos_total'] = 'point_of_sale.action_pos_sale_graph&menu_id=%s' % self.env.ref('point_of_sale.menu_point_root').id
return res
diff --git a/addons/point_of_sale/models/ir_binary.py b/addons/point_of_sale/models/ir_binary.py
index a8aa95544903d..f364ec23afa74 100644
--- a/addons/point_of_sale/models/ir_binary.py
+++ b/addons/point_of_sale/models/ir_binary.py
@@ -2,7 +2,7 @@
class IrBinary(models.AbstractModel):
- _inherit = "ir.binary"
+ _inherit = ["ir.binary"]
def _find_record_check_access(self, record, access_token, field):
if record._name == "product.product" and field == "image_128":
diff --git a/addons/point_of_sale/models/ir_ui_view.py b/addons/point_of_sale/models/ir_ui_view.py
index 066543d99d5e5..db33b54352868 100644
--- a/addons/point_of_sale/models/ir_ui_view.py
+++ b/addons/point_of_sale/models/ir_ui_view.py
@@ -2,7 +2,6 @@
class IrUiView(models.Model):
- _name = 'ir.ui.view'
_inherit = ['ir.ui.view', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/mail_compose_message.py b/addons/point_of_sale/models/mail_compose_message.py
index 3ed8a29949a85..1e0aa2d7e3690 100644
--- a/addons/point_of_sale/models/mail_compose_message.py
+++ b/addons/point_of_sale/models/mail_compose_message.py
@@ -1,8 +1,8 @@
from odoo import models, _
-class MailComposer(models.TransientModel):
- _inherit = 'mail.compose.message'
+class MailComposeMessage(models.TransientModel):
+ _inherit = ['mail.compose.message']
def action_send_mail(self):
res = super().action_send_mail()
diff --git a/addons/point_of_sale/models/pos_bill.py b/addons/point_of_sale/models/pos_bill.py
index 5e6b45f3b46a3..5c7ba936c2215 100644
--- a/addons/point_of_sale/models/pos_bill.py
+++ b/addons/point_of_sale/models/pos_bill.py
@@ -3,8 +3,7 @@
from odoo.osv.expression import OR
-class Bill(models.Model):
- _name = "pos.bill"
+class PosBill(models.Model):
_order = "value"
_description = "Coins/Bills"
_inherit = ["pos.load.mixin"]
diff --git a/addons/point_of_sale/models/pos_bus_mixin.py b/addons/point_of_sale/models/pos_bus_mixin.py
index b5450b7fd3410..51308301e07eb 100644
--- a/addons/point_of_sale/models/pos_bus_mixin.py
+++ b/addons/point_of_sale/models/pos_bus_mixin.py
@@ -3,8 +3,8 @@
import uuid
from odoo import fields, models, api
+
class PosBusMixin(models.AbstractModel):
- _name = "pos.bus.mixin"
_description = "Bus Mixin"
access_token = fields.Char('Security Token', copy=False)
diff --git a/addons/point_of_sale/models/pos_category.py b/addons/point_of_sale/models/pos_category.py
index 17e0abb38d40a..061c135c11dc0 100644
--- a/addons/point_of_sale/models/pos_category.py
+++ b/addons/point_of_sale/models/pos_category.py
@@ -9,7 +9,6 @@
class PosCategory(models.Model):
- _name = "pos.category"
_description = "Point of Sale Category"
_inherit = ['pos.load.mixin']
_order = "sequence, name"
diff --git a/addons/point_of_sale/models/pos_config.py b/addons/point_of_sale/models/pos_config.py
index 3346b5bbc21da..5740d7eebd81c 100644
--- a/addons/point_of_sale/models/pos_config.py
+++ b/addons/point_of_sale/models/pos_config.py
@@ -13,7 +13,6 @@
class PosConfig(models.Model):
- _name = 'pos.config'
_inherit = ['pos.bus.mixin', 'pos.load.mixin']
_description = 'Point of Sale Configuration'
_check_company_auto = True
diff --git a/addons/point_of_sale/models/pos_load_mixin.py b/addons/point_of_sale/models/pos_load_mixin.py
index 9aa72457b8471..c6c353fb9bd17 100644
--- a/addons/point_of_sale/models/pos_load_mixin.py
+++ b/addons/point_of_sale/models/pos_load_mixin.py
@@ -3,7 +3,6 @@
class PosLoadMixin(models.AbstractModel):
- _name = "pos.load.mixin"
_description = "PoS data loading mixin"
@api.model
diff --git a/addons/point_of_sale/models/pos_note.py b/addons/point_of_sale/models/pos_note.py
index 4e6b8d5792c70..149e7063b26db 100644
--- a/addons/point_of_sale/models/pos_note.py
+++ b/addons/point_of_sale/models/pos_note.py
@@ -4,7 +4,6 @@
class PosNote(models.Model):
- _name = 'pos.note'
_description = 'PoS Note'
_inherit = ['pos.load.mixin']
diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py
index 43bc1586e11a9..7278f9759eef3 100644
--- a/addons/point_of_sale/models/pos_order.py
+++ b/addons/point_of_sale/models/pos_order.py
@@ -20,7 +20,6 @@
class PosOrder(models.Model):
- _name = "pos.order"
_inherit = ["portal.mixin", "pos.bus.mixin", "pos.load.mixin", "mail.thread"]
_description = "Point of Sale Orders"
_order = "date_order desc, name desc, id desc"
@@ -1143,10 +1142,10 @@ def _refund(self):
order._prepare_refund_values(current_session)
)
for line in order.lines:
- PosOrderLineLot = self.env['pos.pack.operation.lot']
+ PosPackOperationLot = self.env['pos.pack.operation.lot']
for pack_lot in line.pack_lot_ids:
- PosOrderLineLot += pack_lot.copy()
- line.copy(line._prepare_refund_data(refund_order, PosOrderLineLot))
+ PosPackOperationLot += pack_lot.copy()
+ line.copy(line._prepare_refund_data(refund_order, PosPackOperationLot))
refund_orders |= refund_order
return refund_orders
@@ -1270,8 +1269,8 @@ def _send_order(self):
def _post_chatter_message(self, body):
self.message_post(body=body)
+
class PosOrderLine(models.Model):
- _name = "pos.order.line"
_description = "Point of Sale Order Lines"
_rec_name = "product_id"
_inherit = ['pos.load.mixin']
@@ -1343,15 +1342,15 @@ def _compute_refund_qty(self):
for orderline in self:
orderline.refunded_qty = -sum(orderline.mapped('refund_orderline_ids.qty'))
- def _prepare_refund_data(self, refund_order, PosOrderLineLot):
+ def _prepare_refund_data(self, refund_order, PosPackOperationLot):
"""
This prepares data for refund order line. Inheritance may inject more data here
@param refund_order: the pre-created refund order
@type refund_order: pos.order
- @param PosOrderLineLot: the pre-created Pack operation Lot
- @type PosOrderLineLot: pos.pack.operation.lot
+ @param PosPackOperationLot: the pre-created Pack operation Lot
+ @type PosPackOperationLot: pos.pack.operation.lot
@return: dictionary of data which is for creating a refund order line from the original line
@rtype: dict
@@ -1363,7 +1362,7 @@ def _prepare_refund_data(self, refund_order, PosOrderLineLot):
'order_id': refund_order.id,
'price_subtotal': -self.price_subtotal,
'price_subtotal_incl': -self.price_subtotal_incl,
- 'pack_lot_ids': PosOrderLineLot,
+ 'pack_lot_ids': PosPackOperationLot,
'is_total_cost_computed': False,
'refunded_orderline_id': self.id,
}
@@ -1637,8 +1636,7 @@ def _get_discount_amount(self):
return original_price - self.price_subtotal_incl
-class PosOrderLineLot(models.Model):
- _name = "pos.pack.operation.lot"
+class PosPackOperationLot(models.Model):
_description = "Specify product lot/serial number in pos order line"
_rec_name = "lot_name"
_inherit = ['pos.load.mixin']
@@ -1656,8 +1654,8 @@ def _load_pos_data_domain(self, data):
def _load_pos_data_fields(self, config_id):
return ['lot_name', 'pos_order_line_id']
+
class AccountCashRounding(models.Model):
- _name = 'account.cash.rounding'
_inherit = ['account.cash.rounding', 'pos.load.mixin']
@api.constrains('rounding', 'rounding_method', 'strategy')
diff --git a/addons/point_of_sale/models/pos_payment.py b/addons/point_of_sale/models/pos_payment.py
index c9a77bc5ad7a7..8b9a26accee39 100644
--- a/addons/point_of_sale/models/pos_payment.py
+++ b/addons/point_of_sale/models/pos_payment.py
@@ -12,7 +12,6 @@ class PosPayment(models.Model):
`payment_method_id`.
"""
- _name = "pos.payment"
_description = "Point of Sale Payments"
_order = "id desc"
_inherit = ['pos.load.mixin']
diff --git a/addons/point_of_sale/models/pos_payment_method.py b/addons/point_of_sale/models/pos_payment_method.py
index feef857f0a2db..37c2b954984e1 100644
--- a/addons/point_of_sale/models/pos_payment_method.py
+++ b/addons/point_of_sale/models/pos_payment_method.py
@@ -3,7 +3,6 @@
class PosPaymentMethod(models.Model):
- _name = "pos.payment.method"
_description = "Point of Sale Payment Methods"
_order = "sequence, id"
_inherit = ['pos.load.mixin']
diff --git a/addons/point_of_sale/models/pos_printer.py b/addons/point_of_sale/models/pos_printer.py
index 898c06a291c40..e9208c1aa0f23 100644
--- a/addons/point_of_sale/models/pos_printer.py
+++ b/addons/point_of_sale/models/pos_printer.py
@@ -3,9 +3,9 @@
from odoo import fields, models, api
+
class PosPrinter(models.Model):
- _name = 'pos.printer'
_description = 'Point of Sale Printer'
_inherit = ['pos.load.mixin']
diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py
index 9125f324131c9..0cd8cd5d52113 100644
--- a/addons/point_of_sale/models/pos_session.py
+++ b/addons/point_of_sale/models/pos_session.py
@@ -13,7 +13,6 @@
class PosSession(models.Model):
- _name = 'pos.session'
_order = 'id desc'
_description = 'Point of Sale Session'
_inherit = ['mail.thread', 'mail.activity.mixin', "pos.bus.mixin", 'pos.load.mixin']
@@ -1872,8 +1871,9 @@ def _pos_has_valid_product(self):
def _get_closed_orders(self):
return self.order_ids.filtered(lambda o: o.state not in ['draft', 'cancel'])
+
class ProcurementGroup(models.Model):
- _inherit = 'procurement.group'
+ _inherit = ['procurement.group']
@api.model
def _run_scheduler_tasks(self, use_new_cursor=False, company_id=False):
diff --git a/addons/point_of_sale/models/product.py b/addons/point_of_sale/models/product.py
index 6dca71b5099d7..cf8fe33a42c6c 100644
--- a/addons/point_of_sale/models/product.py
+++ b/addons/point_of_sale/models/product.py
@@ -9,7 +9,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
available_in_pos = fields.Boolean(string='Available in POS', help='Check if you want this product to appear in the Point of Sale.', default=False)
to_weight = fields.Boolean(string='To Weigh With Scale', help="Check if the product should be weighted using the hardware scale integration.")
@@ -50,7 +50,6 @@ def _check_combo_inclusions(self):
class ProductProduct(models.Model):
- _name = 'product.product'
_inherit = ['product.product', 'pos.load.mixin']
@api.model
@@ -234,7 +233,6 @@ def get_product_info_pos(self, price, quantity, pos_config_id):
class ProductAttribute(models.Model):
- _name = 'product.attribute'
_inherit = ['product.attribute', 'pos.load.mixin']
@api.model
@@ -243,7 +241,6 @@ def _load_pos_data_fields(self, config_id):
class ProductAttributeCustomValue(models.Model):
- _name = 'product.attribute.custom.value'
_inherit = ["product.attribute.custom.value", "pos.load.mixin"]
pos_order_line_id = fields.Many2one('pos.order.line', string="PoS Order Line", ondelete='cascade')
@@ -258,7 +255,6 @@ def _load_pos_data_fields(self, config_id):
class ProductTemplateAttributeLine(models.Model):
- _name = 'product.template.attribute.line'
_inherit = ['product.template.attribute.line', 'pos.load.mixin']
@api.model
@@ -272,7 +268,6 @@ def _load_pos_data_domain(self, data):
class ProductTemplateAttributeValue(models.Model):
- _name = 'product.template.attribute.value'
_inherit = ['product.template.attribute.value', 'pos.load.mixin']
@api.model
@@ -290,7 +285,6 @@ def _load_pos_data_fields(self, config_id):
class ProductPackaging(models.Model):
- _name = 'product.packaging'
_inherit = ['product.packaging', 'pos.load.mixin']
@api.model
@@ -302,8 +296,7 @@ def _load_pos_data_fields(self, config_id):
return ['id', 'name', 'barcode', 'product_id', 'qty']
-class UomCateg(models.Model):
- _name = 'uom.category'
+class UomCategory(models.Model):
_inherit = ['uom.category', 'pos.load.mixin']
is_pos_groupable = fields.Boolean(string='Group Products in POS',
@@ -318,8 +311,7 @@ def _load_pos_data_fields(self, config_id):
return ['id', 'name', 'uom_ids']
-class Uom(models.Model):
- _name = 'uom.uom'
+class UomUom(models.Model):
_inherit = ['uom.uom', 'pos.load.mixin']
is_pos_groupable = fields.Boolean(related='category_id.is_pos_groupable', readonly=False)
@@ -338,7 +330,6 @@ def _load_pos_data(self, data):
class ProductPricelist(models.Model):
- _name = 'product.pricelist'
_inherit = ['product.pricelist', 'pos.load.mixin']
@api.model
@@ -352,7 +343,6 @@ def _load_pos_data_fields(self, config_id):
class ProductPricelistItem(models.Model):
- _name = 'product.pricelist.item'
_inherit = ['product.pricelist.item', 'pos.load.mixin']
@api.model
@@ -374,7 +364,6 @@ def _load_pos_data_fields(self, config_id):
class ProductCategory(models.Model):
- _name = 'product.category'
_inherit = ['product.category', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/product_combo.py b/addons/point_of_sale/models/product_combo.py
index 0e1c767884e06..5e12776d0ea46 100644
--- a/addons/point_of_sale/models/product_combo.py
+++ b/addons/point_of_sale/models/product_combo.py
@@ -4,7 +4,6 @@
class ProductCombo(models.Model):
- _name = 'product.combo'
_inherit = ['product.combo', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/product_combo_item.py b/addons/point_of_sale/models/product_combo_item.py
index 9bfe3ef9dc80d..56bb8061e94ab 100644
--- a/addons/point_of_sale/models/product_combo_item.py
+++ b/addons/point_of_sale/models/product_combo_item.py
@@ -4,7 +4,6 @@
class ProductComboItem(models.Model):
- _name = 'product.combo.item'
_inherit = ['product.combo.item', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/report_sale_details.py b/addons/point_of_sale/models/report_sale_details.py
index 8eff99dbab58f..4c14c1c73a024 100644
--- a/addons/point_of_sale/models/report_sale_details.py
+++ b/addons/point_of_sale/models/report_sale_details.py
@@ -9,9 +9,8 @@
from odoo.tools import SQL
-class ReportSaleDetails(models.AbstractModel):
+class ReportPoint_Of_SaleReport_Saledetails(models.AbstractModel):
- _name = 'report.point_of_sale.report_saledetails'
_description = 'Point of Sale Details'
def _get_date_start_and_date_stop(self, date_start, date_stop):
diff --git a/addons/point_of_sale/models/res_company.py b/addons/point_of_sale/models/res_company.py
index 399b52b959916..048344296e1de 100644
--- a/addons/point_of_sale/models/res_company.py
+++ b/addons/point_of_sale/models/res_company.py
@@ -4,8 +4,8 @@
from odoo.exceptions import ValidationError
from odoo.osv import expression
+
class ResCompany(models.Model):
- _name = 'res.company'
_inherit = ['res.company', 'pos.load.mixin']
point_of_sale_update_stock_quantities = fields.Selection([
diff --git a/addons/point_of_sale/models/res_config_settings.py b/addons/point_of_sale/models/res_config_settings.py
index b5d1086611cb3..e05e38461ee7c 100644
--- a/addons/point_of_sale/models/res_config_settings.py
+++ b/addons/point_of_sale/models/res_config_settings.py
@@ -20,7 +20,7 @@ class ResConfigSettings(models.TransientModel):
call, not before `create` is called. Because of this, vals contains a lot of field before
super call, then the number of fields is reduced after.
"""
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
def _default_pos_config(self):
# Default to the last modified pos.config.
diff --git a/addons/point_of_sale/models/res_country.py b/addons/point_of_sale/models/res_country.py
index c7ab2977c0b49..ce2d8e5911ea3 100644
--- a/addons/point_of_sale/models/res_country.py
+++ b/addons/point_of_sale/models/res_country.py
@@ -2,7 +2,6 @@
class ResCountry(models.Model):
- _name = 'res.country'
_inherit = ['res.country', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/res_country_state.py b/addons/point_of_sale/models/res_country_state.py
index 68732395c2030..65d5d1696d1f4 100644
--- a/addons/point_of_sale/models/res_country_state.py
+++ b/addons/point_of_sale/models/res_country_state.py
@@ -2,7 +2,6 @@
class ResCountryState(models.Model):
- _name = 'res.country.state'
_inherit = ['res.country.state', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/res_currency.py b/addons/point_of_sale/models/res_currency.py
index aa1be916d7299..45aef450fa199 100644
--- a/addons/point_of_sale/models/res_currency.py
+++ b/addons/point_of_sale/models/res_currency.py
@@ -2,7 +2,6 @@
class ResCurrency(models.Model):
- _name = 'res.currency'
_inherit = ['res.currency', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/res_lang.py b/addons/point_of_sale/models/res_lang.py
index cd225eb98b03e..2c8a7922bd785 100644
--- a/addons/point_of_sale/models/res_lang.py
+++ b/addons/point_of_sale/models/res_lang.py
@@ -2,7 +2,6 @@
class ResLang(models.Model):
- _name = 'res.lang'
_inherit = ['res.lang', 'pos.load.mixin']
@api.model
diff --git a/addons/point_of_sale/models/res_partner.py b/addons/point_of_sale/models/res_partner.py
index eacad929058c0..29b22de971e5b 100644
--- a/addons/point_of_sale/models/res_partner.py
+++ b/addons/point_of_sale/models/res_partner.py
@@ -3,7 +3,6 @@
class ResPartner(models.Model):
- _name = 'res.partner'
_inherit = ['res.partner', 'pos.load.mixin']
pos_order_count = fields.Integer(
diff --git a/addons/point_of_sale/models/res_users.py b/addons/point_of_sale/models/res_users.py
index d6331ee80dcef..3402e4f5e780c 100644
--- a/addons/point_of_sale/models/res_users.py
+++ b/addons/point_of_sale/models/res_users.py
@@ -2,7 +2,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
@api.model
def _load_pos_data_domain(self, data):
diff --git a/addons/point_of_sale/models/stock_picking.py b/addons/point_of_sale/models/stock_picking.py
index 3ac874aabca52..da2619cdd129e 100644
--- a/addons/point_of_sale/models/stock_picking.py
+++ b/addons/point_of_sale/models/stock_picking.py
@@ -8,8 +8,9 @@
from itertools import groupby
from collections import defaultdict
+
class StockPicking(models.Model):
- _inherit='stock.picking'
+ _inherit = ['stock.picking']
pos_session_id = fields.Many2one('pos.session', index=True)
pos_order_id = fields.Many2one('pos.order', index=True)
@@ -157,8 +158,8 @@ def _action_done(self):
move.action_post()
return res
+
class StockPickingType(models.Model):
- _name = 'stock.picking.type'
_inherit = ['stock.picking.type', 'pos.load.mixin']
@api.depends('warehouse_id')
@@ -185,13 +186,15 @@ def _load_pos_data_domain(self, data):
def _load_pos_data_fields(self, config_id):
return ['id', 'use_create_lots', 'use_existing_lots']
+
class ProcurementGroup(models.Model):
- _inherit = 'procurement.group'
+ _inherit = ['procurement.group']
pos_order_id = fields.Many2one('pos.order', 'POS Order')
+
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _get_new_picking_values(self):
vals = super(StockMove, self)._get_new_picking_values()
diff --git a/addons/point_of_sale/models/stock_rule.py b/addons/point_of_sale/models/stock_rule.py
index d1b3d877febf3..59f247596aa66 100644
--- a/addons/point_of_sale/models/stock_rule.py
+++ b/addons/point_of_sale/models/stock_rule.py
@@ -6,7 +6,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
def _get_stock_move_values(self, product_id, product_qty, product_uom, location_id, name, origin, company_id, values):
move_values = super()._get_stock_move_values(product_id, product_qty, product_uom, location_id, name, origin, company_id, values)
diff --git a/addons/point_of_sale/models/stock_warehouse.py b/addons/point_of_sale/models/stock_warehouse.py
index 9cc50ca93ee2a..ddfe438c6fd9d 100644
--- a/addons/point_of_sale/models/stock_warehouse.py
+++ b/addons/point_of_sale/models/stock_warehouse.py
@@ -3,13 +3,13 @@
from odoo import models, fields, api, _
-class Warehouse(models.Model):
- _inherit = "stock.warehouse"
+class StockWarehouse(models.Model):
+ _inherit = ["stock.warehouse"]
pos_type_id = fields.Many2one('stock.picking.type', string="Point of Sale Operation Type")
def _get_sequence_values(self, name=False, code=False):
- sequence_values = super(Warehouse, self)._get_sequence_values(name=name, code=code)
+ sequence_values = super()._get_sequence_values(name=name, code=code)
sequence_values.update({
'pos_type_id': {
'name': _('%(name)s Picking POS', name=self.name),
@@ -21,14 +21,14 @@ def _get_sequence_values(self, name=False, code=False):
return sequence_values
def _get_picking_type_update_values(self):
- picking_type_update_values = super(Warehouse, self)._get_picking_type_update_values()
+ picking_type_update_values = super()._get_picking_type_update_values()
picking_type_update_values.update({
'pos_type_id': {'default_location_src_id': self.lot_stock_id.id}
})
return picking_type_update_values
def _get_picking_type_create_values(self, max_sequence):
- picking_type_create_values, max_sequence = super(Warehouse, self)._get_picking_type_create_values(max_sequence)
+ picking_type_create_values, max_sequence = super()._get_picking_type_create_values(max_sequence)
picking_type_create_values.update({
'pos_type_id': {
'name': _('PoS Orders'),
diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py
index fe4216808ece3..9b65556df6998 100644
--- a/addons/point_of_sale/report/pos_invoice.py
+++ b/addons/point_of_sale/report/pos_invoice.py
@@ -5,8 +5,7 @@
from odoo.exceptions import UserError
-class PosInvoiceReport(models.AbstractModel):
- _name = 'report.point_of_sale.report_invoice'
+class ReportPoint_Of_SaleReport_Invoice(models.AbstractModel):
_description = 'Point of Sale Invoice Report'
@api.model
diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py
index f635904401048..6fed33bbe98f3 100644
--- a/addons/point_of_sale/report/pos_order_report.py
+++ b/addons/point_of_sale/report/pos_order_report.py
@@ -4,8 +4,7 @@
from odoo import fields, models, tools
-class PosOrderReport(models.Model):
- _name = "report.pos.order"
+class ReportPosOrder(models.Model):
_description = "Point of Sale Orders Report"
_auto = False
_order = 'date desc'
diff --git a/addons/point_of_sale/wizard/pos_close_session_wizard.py b/addons/point_of_sale/wizard/pos_close_session_wizard.py
index d42ee72c76187..fa1c492328f30 100644
--- a/addons/point_of_sale/wizard/pos_close_session_wizard.py
+++ b/addons/point_of_sale/wizard/pos_close_session_wizard.py
@@ -5,7 +5,6 @@
class PosCloseSessionWizard(models.TransientModel):
- _name = "pos.close.session.wizard"
_description = "Close Session Wizard"
amount_to_balance = fields.Float("Amount to balance")
diff --git a/addons/point_of_sale/wizard/pos_daily_sales_reports.py b/addons/point_of_sale/wizard/pos_daily_sales_reports.py
index 1e5078c40e870..9c9872f3c9e64 100644
--- a/addons/point_of_sale/wizard/pos_daily_sales_reports.py
+++ b/addons/point_of_sale/wizard/pos_daily_sales_reports.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class PosDailyReport(models.TransientModel):
- _name = 'pos.daily.sales.reports.wizard'
+class PosDailySalesReportsWizard(models.TransientModel):
_description = 'Point of Sale Daily Report'
pos_session_id = fields.Many2one('pos.session', required=True)
diff --git a/addons/point_of_sale/wizard/pos_details.py b/addons/point_of_sale/wizard/pos_details.py
index 100e50f58ffb0..6cf3c77f3bf5e 100644
--- a/addons/point_of_sale/wizard/pos_details.py
+++ b/addons/point_of_sale/wizard/pos_details.py
@@ -5,8 +5,7 @@
from odoo.exceptions import UserError
-class PosDetails(models.TransientModel):
- _name = 'pos.details.wizard'
+class PosDetailsWizard(models.TransientModel):
_description = 'Point of Sale Details Report'
def _default_start_date(self):
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py
index a0e4a3f18e24b..36ff2ee622d53 100644
--- a/addons/point_of_sale/wizard/pos_payment.py
+++ b/addons/point_of_sale/wizard/pos_payment.py
@@ -7,7 +7,6 @@
class PosMakePayment(models.TransientModel):
- _name = 'pos.make.payment'
_description = 'Point of Sale Make Payment Wizard'
def _default_config(self):
diff --git a/addons/portal/models/ir_http.py b/addons/portal/models/ir_http.py
index 13e0b7abab766..9670a09d8a044 100644
--- a/addons/portal/models/ir_http.py
+++ b/addons/portal/models/ir_http.py
@@ -4,7 +4,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _get_translation_frontend_modules_name(cls):
diff --git a/addons/portal/models/ir_qweb.py b/addons/portal/models/ir_qweb.py
index 12d13022df675..3017c1c56e247 100644
--- a/addons/portal/models/ir_qweb.py
+++ b/addons/portal/models/ir_qweb.py
@@ -5,8 +5,8 @@
from odoo.tools import is_html_empty, lazy
-class IrQWeb(models.AbstractModel):
- _inherit = "ir.qweb"
+class IrQweb(models.AbstractModel):
+ _inherit = ["ir.qweb"]
def _prepare_frontend_environment(self, values):
""" Returns ir.qweb with context and update values with portal specific
diff --git a/addons/portal/models/ir_ui_view.py b/addons/portal/models/ir_ui_view.py
index f84d487e9387c..cea3950437e80 100644
--- a/addons/portal/models/ir_ui_view.py
+++ b/addons/portal/models/ir_ui_view.py
@@ -4,7 +4,7 @@
from odoo import models, fields
-class View(models.Model):
- _inherit = "ir.ui.view"
+class IrUiView(models.Model):
+ _inherit = ["ir.ui.view"]
customize_show = fields.Boolean("Show As Optional Inherit", default=False)
diff --git a/addons/portal/models/mail_message.py b/addons/portal/models/mail_message.py
index ea3d27112ce3d..4334cc75dee2c 100644
--- a/addons/portal/models/mail_message.py
+++ b/addons/portal/models/mail_message.py
@@ -7,7 +7,7 @@
class MailMessage(models.Model):
- _inherit = 'mail.message'
+ _inherit = ['mail.message']
def portal_message_format(self, options=None):
""" Simpler and portal-oriented version of 'message_format'. Purpose
diff --git a/addons/portal/models/mail_thread.py b/addons/portal/models/mail_thread.py
index 98c8863f3b723..d76c19f405698 100644
--- a/addons/portal/models/mail_thread.py
+++ b/addons/portal/models/mail_thread.py
@@ -8,7 +8,7 @@
class MailThread(models.AbstractModel):
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
_mail_post_token_field = 'access_token' # token field for external posts, to be overridden
diff --git a/addons/portal/models/portal_mixin.py b/addons/portal/models/portal_mixin.py
index c73261adc3acf..2b43112339fda 100644
--- a/addons/portal/models/portal_mixin.py
+++ b/addons/portal/models/portal_mixin.py
@@ -7,7 +7,6 @@
class PortalMixin(models.AbstractModel):
- _name = "portal.mixin"
_description = 'Portal Mixin'
access_url = fields.Char(
diff --git a/addons/portal/models/res_config_settings.py b/addons/portal/models/res_config_settings.py
index e483cf8160460..1e4e79312efc1 100644
--- a/addons/portal/models/res_config_settings.py
+++ b/addons/portal/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
portal_allow_api_keys = fields.Boolean(
string='Customer API Keys',
diff --git a/addons/portal/models/res_partner.py b/addons/portal/models/res_partner.py
index cc01f1429d5e7..5e470bf2004d9 100644
--- a/addons/portal/models/res_partner.py
+++ b/addons/portal/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
def _can_edit_name(self):
""" Name can be changed more often than the VAT """
diff --git a/addons/portal/models/res_users_apikeys_description.py b/addons/portal/models/res_users_apikeys_description.py
index 3334077e836d7..532e0a2382b50 100644
--- a/addons/portal/models/res_users_apikeys_description.py
+++ b/addons/portal/models/res_users_apikeys_description.py
@@ -5,8 +5,8 @@
from odoo.exceptions import AccessError
-class APIKeyDescription(models.TransientModel):
- _inherit = 'res.users.apikeys.description'
+class ResUsersApikeysDescription(models.TransientModel):
+ _inherit = ['res.users.apikeys.description']
def check_access_make_key(self):
try:
diff --git a/addons/portal/wizard/portal_share.py b/addons/portal/wizard/portal_share.py
index 2271676e8c6ce..412d48755d0ad 100644
--- a/addons/portal/wizard/portal_share.py
+++ b/addons/portal/wizard/portal_share.py
@@ -4,7 +4,6 @@
class PortalShare(models.TransientModel):
- _name = 'portal.share'
_description = 'Portal Sharing'
@api.model
diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py
index f55b1530e1941..5befb3715ff52 100644
--- a/addons/portal/wizard/portal_wizard.py
+++ b/addons/portal/wizard/portal_wizard.py
@@ -17,7 +17,6 @@ class PortalWizard(models.TransientModel):
A wizard to manage the creation/removal of portal users.
"""
- _name = 'portal.wizard'
_description = 'Grant Portal Access'
def _default_partner_ids(self):
@@ -75,7 +74,6 @@ class PortalWizardUser(models.TransientModel):
A model to configure users in the portal wizard.
"""
- _name = 'portal.wizard.user'
_description = 'Portal User Config'
wizard_id = fields.Many2one('portal.wizard', string='Wizard', required=True, ondelete='cascade')
diff --git a/addons/portal_rating/models/ir_http.py b/addons/portal_rating/models/ir_http.py
index 04a6a05d8f71b..67fd3856a0338 100644
--- a/addons/portal_rating/models/ir_http.py
+++ b/addons/portal_rating/models/ir_http.py
@@ -5,7 +5,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _get_translation_frontend_modules_name(cls):
diff --git a/addons/portal_rating/models/mail_message.py b/addons/portal_rating/models/mail_message.py
index b375d71d7c02f..0666ba1892b83 100644
--- a/addons/portal_rating/models/mail_message.py
+++ b/addons/portal_rating/models/mail_message.py
@@ -6,7 +6,7 @@
class MailMessage(models.Model):
- _inherit = 'mail.message'
+ _inherit = ['mail.message']
def _portal_get_default_format_properties_names(self, options=None):
""" Add request for rating information
diff --git a/addons/portal_rating/models/mail_thread.py b/addons/portal_rating/models/mail_thread.py
index 60f514562dd9d..c269246cb948f 100644
--- a/addons/portal_rating/models/mail_thread.py
+++ b/addons/portal_rating/models/mail_thread.py
@@ -4,7 +4,7 @@
class MailThread(models.AbstractModel):
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
def _get_allowed_message_post_params(self):
return super()._get_allowed_message_post_params() | {"rating_value"}
diff --git a/addons/portal_rating/models/rating_rating.py b/addons/portal_rating/models/rating_rating.py
index b1c4647deb308..743a38ce87cfa 100644
--- a/addons/portal_rating/models/rating_rating.py
+++ b/addons/portal_rating/models/rating_rating.py
@@ -3,8 +3,8 @@
from odoo import api, fields, models, exceptions, _
-class Rating(models.Model):
- _inherit = 'rating.rating'
+class RatingRating(models.Model):
+ _inherit = ['rating.rating']
# Adding information for comment a rating message
publisher_comment = fields.Text("Publisher comment")
diff --git a/addons/pos_account_tax_python/models/account_tax.py b/addons/pos_account_tax_python/models/account_tax.py
index 19e8f17ce055a..0df64dafaf179 100644
--- a/addons/pos_account_tax_python/models/account_tax.py
+++ b/addons/pos_account_tax_python/models/account_tax.py
@@ -2,7 +2,7 @@
class AccountTax(models.Model):
- _inherit = 'account.tax'
+ _inherit = ['account.tax']
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/pos_adyen/models/pos_config.py b/addons/pos_adyen/models/pos_config.py
index ee4c6c3d2c8c6..acbaca006ae7c 100644
--- a/addons/pos_adyen/models/pos_config.py
+++ b/addons/pos_adyen/models/pos_config.py
@@ -9,7 +9,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
adyen_ask_customer_for_tip = fields.Boolean('Ask Customers For Tip')
diff --git a/addons/pos_adyen/models/pos_payment_method.py b/addons/pos_adyen/models/pos_payment_method.py
index 9f15f1b13048c..01754f257ad5c 100644
--- a/addons/pos_adyen/models/pos_payment_method.py
+++ b/addons/pos_adyen/models/pos_payment_method.py
@@ -14,8 +14,9 @@
UNPREDICTABLE_ADYEN_DATA = object() # sentinel
+
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
def _get_payment_terminal_selection(self):
return super(PosPaymentMethod, self)._get_payment_terminal_selection() + [('adyen', 'Adyen')]
diff --git a/addons/pos_adyen/models/res_config_settings.py b/addons/pos_adyen/models/res_config_settings.py
index d55ee8f44bfa5..a18447d34943b 100644
--- a/addons/pos_adyen/models/res_config_settings.py
+++ b/addons/pos_adyen/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
# pos.config fields
pos_adyen_ask_customer_for_tip = fields.Boolean(compute='_compute_pos_adyen_ask_customer_for_tip', store=True, readonly=False)
diff --git a/addons/pos_discount/models/pos_config.py b/addons/pos_discount/models/pos_config.py
index 3f6ad2cc0532a..0371f12382786 100644
--- a/addons/pos_discount/models/pos_config.py
+++ b/addons/pos_discount/models/pos_config.py
@@ -6,7 +6,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
iface_discount = fields.Boolean(string='Order Discounts', help='Allow the cashier to give discounts on the whole order.')
discount_pc = fields.Float(string='Discount Percentage', help='The default discount percentage when clicking on the Discount button', default=10.0)
diff --git a/addons/pos_discount/models/product_product.py b/addons/pos_discount/models/product_product.py
index 69aa95ff045d5..4c9d5b10e094c 100644
--- a/addons/pos_discount/models/product_product.py
+++ b/addons/pos_discount/models/product_product.py
@@ -2,7 +2,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def _load_pos_data(self, data):
res = super()._load_pos_data(data)
diff --git a/addons/pos_discount/models/res_config_settings.py b/addons/pos_discount/models/res_config_settings.py
index 35a260a45f3f2..416e913b05236 100644
--- a/addons/pos_discount/models/res_config_settings.py
+++ b/addons/pos_discount/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
# pos.config fields
pos_discount_pc = fields.Float(related='pos_config_id.discount_pc', readonly=False)
diff --git a/addons/pos_epson_printer/models/pos_config.py b/addons/pos_epson_printer/models/pos_config.py
index 885d9e4d70f9b..5d9eacbf98a1e 100644
--- a/addons/pos_epson_printer/models/pos_config.py
+++ b/addons/pos_epson_printer/models/pos_config.py
@@ -3,7 +3,8 @@
from odoo import fields, models
+
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
epson_printer_ip = fields.Char(string='Epson Printer IP', help="Local IP address of an Epson receipt printer.")
diff --git a/addons/pos_epson_printer/models/pos_printer.py b/addons/pos_epson_printer/models/pos_printer.py
index 99d11dc0ea596..1181372e8b907 100644
--- a/addons/pos_epson_printer/models/pos_printer.py
+++ b/addons/pos_epson_printer/models/pos_printer.py
@@ -4,9 +4,10 @@
from odoo import fields, models, api, _
from odoo.exceptions import ValidationError
+
class PosPrinter(models.Model):
- _inherit = 'pos.printer'
+ _inherit = ['pos.printer']
printer_type = fields.Selection(selection_add=[('epson_epos', 'Use an Epson printer')])
epson_printer_ip = fields.Char(string='Epson Printer IP Address', help="Local IP address of an Epson receipt printer.", default="0.0.0.0")
diff --git a/addons/pos_epson_printer/models/res_config_settings.py b/addons/pos_epson_printer/models/res_config_settings.py
index a5db7f0f2e0cd..8116e94232e98 100644
--- a/addons/pos_epson_printer/models/res_config_settings.py
+++ b/addons/pos_epson_printer/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
pos_epson_printer_ip = fields.Char(compute='_compute_pos_epson_printer_ip', store=True, readonly=False)
diff --git a/addons/pos_event/models/event_event.py b/addons/pos_event/models/event_event.py
index 3e703a526ad08..57eaa886d36d1 100644
--- a/addons/pos_event/models/event_event.py
+++ b/addons/pos_event/models/event_event.py
@@ -1,8 +1,7 @@
from odoo import api, fields, models
-class Event(models.Model):
- _name = 'event.event'
+class EventEvent(models.Model):
_inherit = ['event.event', 'pos.load.mixin']
image_1024 = fields.Image("PoS Image", max_width=1024, max_height=1024)
diff --git a/addons/pos_event/models/event_question.py b/addons/pos_event/models/event_question.py
index 9824eea2b8bda..c31091077018c 100644
--- a/addons/pos_event/models/event_question.py
+++ b/addons/pos_event/models/event_question.py
@@ -4,7 +4,6 @@
class EventQuestion(models.Model):
- _name = 'event.question'
_inherit = ['event.question', 'pos.load.mixin']
@api.model
diff --git a/addons/pos_event/models/event_question_answer.py b/addons/pos_event/models/event_question_answer.py
index fc71cfa9b08fb..e08e0916825a1 100644
--- a/addons/pos_event/models/event_question_answer.py
+++ b/addons/pos_event/models/event_question_answer.py
@@ -4,7 +4,6 @@
class EventQuestionAnswer(models.Model):
- _name = 'event.question.answer'
_inherit = ['event.question.answer', 'pos.load.mixin']
@api.model
diff --git a/addons/pos_event/models/event_registration.py b/addons/pos_event/models/event_registration.py
index 7f78fb9871123..592ce277e1843 100644
--- a/addons/pos_event/models/event_registration.py
+++ b/addons/pos_event/models/event_registration.py
@@ -3,7 +3,6 @@
class EventRegistration(models.Model):
- _name = 'event.registration'
_inherit = ['event.registration', 'pos.load.mixin']
pos_order_id = fields.Many2one(related='pos_order_line_id.order_id', string='PoS Order')
diff --git a/addons/pos_event/models/event_registration_answer.py b/addons/pos_event/models/event_registration_answer.py
index a2fff8ef0191b..daee19cd5feaa 100644
--- a/addons/pos_event/models/event_registration_answer.py
+++ b/addons/pos_event/models/event_registration_answer.py
@@ -4,7 +4,6 @@
class EventRegistrationAnswer(models.Model):
- _name = 'event.registration.answer'
_inherit = ['event.registration.answer', 'pos.load.mixin']
@api.model
diff --git a/addons/pos_event/models/event_ticket.py b/addons/pos_event/models/event_ticket.py
index 0f911032a3b18..d7b0e24e79464 100644
--- a/addons/pos_event/models/event_ticket.py
+++ b/addons/pos_event/models/event_ticket.py
@@ -2,8 +2,7 @@
from odoo import models, api, fields
-class EventTicket(models.Model):
- _name = 'event.event.ticket'
+class EventEventTicket(models.Model):
_inherit = ['event.event.ticket', 'pos.load.mixin']
@api.model
diff --git a/addons/pos_event/models/pos_config.py b/addons/pos_event/models/pos_config.py
index 09a90bc9a534d..a6ea7ef177d51 100644
--- a/addons/pos_event/models/pos_config.py
+++ b/addons/pos_event/models/pos_config.py
@@ -3,7 +3,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
def _update_events_seats(self, events):
data = []
diff --git a/addons/pos_event/models/pos_order.py b/addons/pos_event/models/pos_order.py
index e035f47afbbfa..446c56c1896d2 100644
--- a/addons/pos_event/models/pos_order.py
+++ b/addons/pos_event/models/pos_order.py
@@ -3,7 +3,7 @@
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
attendee_count = fields.Integer('Attendee Count', compute='_compute_attendee_count')
diff --git a/addons/pos_event/models/pos_order_line.py b/addons/pos_event/models/pos_order_line.py
index 2f5df664a632c..50c03e7a7fd5f 100644
--- a/addons/pos_event/models/pos_order_line.py
+++ b/addons/pos_event/models/pos_order_line.py
@@ -3,7 +3,7 @@
class PosOrderLine(models.Model):
- _inherit = 'pos.order.line'
+ _inherit = ['pos.order.line']
event_ticket_id = fields.Many2one('event.event.ticket', string='Event Ticket')
event_registration_ids = fields.One2many('event.registration', 'pos_order_line_id', string='Event Registrations')
diff --git a/addons/pos_event/models/pos_session.py b/addons/pos_event/models/pos_session.py
index 67649494a8caa..419d8ce555d5e 100644
--- a/addons/pos_event/models/pos_session.py
+++ b/addons/pos_event/models/pos_session.py
@@ -3,7 +3,7 @@
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
@api.model
def _load_pos_data_models(self, config_id):
diff --git a/addons/pos_hr/models/account_bank_statement.py b/addons/pos_hr/models/account_bank_statement.py
index 5c3af96ce6536..6a43181cf60ea 100644
--- a/addons/pos_hr/models/account_bank_statement.py
+++ b/addons/pos_hr/models/account_bank_statement.py
@@ -3,6 +3,6 @@
class AccountBankStatementLine(models.Model):
- _inherit = 'account.bank.statement.line'
+ _inherit = ['account.bank.statement.line']
employee_id = fields.Many2one('hr.employee', string="Employee", help="The employee who made the cash move.")
diff --git a/addons/pos_hr/models/hr_employee.py b/addons/pos_hr/models/hr_employee.py
index 19b522fcf0a52..a7ba976c39dfe 100644
--- a/addons/pos_hr/models/hr_employee.py
+++ b/addons/pos_hr/models/hr_employee.py
@@ -7,8 +7,9 @@
from odoo.exceptions import UserError
from odoo.tools import format_list
+
class HrEmployee(models.Model):
- _inherit = 'hr.employee'
+ _inherit = ['hr.employee']
@api.model
def _load_pos_data_domain(self, data):
diff --git a/addons/pos_hr/models/multi_employee_sales_report.py b/addons/pos_hr/models/multi_employee_sales_report.py
index 535ccf4092286..a5c19e15a2b4c 100644
--- a/addons/pos_hr/models/multi_employee_sales_report.py
+++ b/addons/pos_hr/models/multi_employee_sales_report.py
@@ -2,8 +2,7 @@
from odoo import api, models
-class MultiEmployeeSalesReport(models.AbstractModel):
- _name = 'report.pos_hr.multi_employee_sales_report'
+class ReportPos_HrMulti_Employee_Sales_Report(models.AbstractModel):
_description = 'A collection of single session reports. One for each employee'
@api.model
diff --git a/addons/pos_hr/models/pos_config.py b/addons/pos_hr/models/pos_config.py
index d1e5104d80745..ce7f41e5b4b77 100644
--- a/addons/pos_hr/models/pos_config.py
+++ b/addons/pos_hr/models/pos_config.py
@@ -4,7 +4,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
basic_employee_ids = fields.Many2many(
'hr.employee', 'pos_hr_basic_employee_hr_employee', string="Employees with basic access",
diff --git a/addons/pos_hr/models/pos_order.py b/addons/pos_hr/models/pos_order.py
index 01ae0b3351fbd..ad5ec9a6b45d5 100644
--- a/addons/pos_hr/models/pos_order.py
+++ b/addons/pos_hr/models/pos_order.py
@@ -4,7 +4,7 @@
class PosOrder(models.Model):
- _inherit = "pos.order"
+ _inherit = ["pos.order"]
employee_id = fields.Many2one('hr.employee', string="Cashier", help="The employee who uses the cash register.")
cashier = fields.Char(string="Cashier name", compute="_compute_cashier", store=True)
diff --git a/addons/pos_hr/models/pos_payment.py b/addons/pos_hr/models/pos_payment.py
index 8994b08a10d98..0567ec42db361 100644
--- a/addons/pos_hr/models/pos_payment.py
+++ b/addons/pos_hr/models/pos_payment.py
@@ -2,7 +2,7 @@
class PosPayment(models.Model):
- _inherit = "pos.payment"
+ _inherit = ["pos.payment"]
employee_id = fields.Many2one('hr.employee', string='Cashier', related='pos_order_id.employee_id', store=True, index=True)
diff --git a/addons/pos_hr/models/pos_session.py b/addons/pos_hr/models/pos_session.py
index c7adb5d5a877c..1ce00b6106794 100644
--- a/addons/pos_hr/models/pos_session.py
+++ b/addons/pos_hr/models/pos_session.py
@@ -5,7 +5,7 @@
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
employee_id = fields.Many2one(
"hr.employee",
string="Cashier",
diff --git a/addons/pos_hr/models/product_product.py b/addons/pos_hr/models/product_product.py
index fe9394e21da9d..d7a8bde7ae203 100644
--- a/addons/pos_hr/models/product_product.py
+++ b/addons/pos_hr/models/product_product.py
@@ -2,7 +2,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/pos_hr/models/res_config_settings.py b/addons/pos_hr/models/res_config_settings.py
index a41af4fe489c1..3f22de3750ad7 100644
--- a/addons/pos_hr/models/res_config_settings.py
+++ b/addons/pos_hr/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
# pos.config fields
pos_basic_employee_ids = fields.Many2many(related='pos_config_id.basic_employee_ids', readonly=False,
diff --git a/addons/pos_hr/models/single_employee_sales_report.py b/addons/pos_hr/models/single_employee_sales_report.py
index 9a8c1964e67c0..83f2ec4470575 100644
--- a/addons/pos_hr/models/single_employee_sales_report.py
+++ b/addons/pos_hr/models/single_employee_sales_report.py
@@ -3,9 +3,8 @@
from odoo.osv.expression import AND
-class SingleEmployeeSalesReport(models.AbstractModel):
- _name = 'report.pos_hr.single_employee_sales_report'
- _inherit = 'report.point_of_sale.report_saledetails'
+class ReportPos_HrSingle_Employee_Sales_Report(models.AbstractModel):
+ _inherit = ['report.point_of_sale.report_saledetails']
_description = 'Session sales details for a single employee'
def _get_domain(self, date_start=False, date_stop=False, config_ids=False, session_ids=False, employee_id=False):
diff --git a/addons/pos_hr/report/pos_order_report.py b/addons/pos_hr/report/pos_order_report.py
index fb2e6f0d4daa2..9b2d06933f407 100644
--- a/addons/pos_hr/report/pos_order_report.py
+++ b/addons/pos_hr/report/pos_order_report.py
@@ -5,8 +5,8 @@
from odoo import models, fields
-class PosOrderReport(models.Model):
- _inherit = "report.pos.order"
+class ReportPosOrder(models.Model):
+ _inherit = ["report.pos.order"]
employee_id = fields.Many2one('hr.employee', string='Employee', readonly=True)
def _select(self):
diff --git a/addons/pos_hr/wizard/pos_daily_sales_reports.py b/addons/pos_hr/wizard/pos_daily_sales_reports.py
index 1a4f006458411..5d7422f93dde2 100644
--- a/addons/pos_hr/wizard/pos_daily_sales_reports.py
+++ b/addons/pos_hr/wizard/pos_daily_sales_reports.py
@@ -3,8 +3,8 @@
from odoo import fields, models, api
-class PosDailyReportPerEmployee(models.TransientModel):
- _inherit = 'pos.daily.sales.reports.wizard'
+class PosDailySalesReportsWizard(models.TransientModel):
+ _inherit = ['pos.daily.sales.reports.wizard']
add_report_per_employee = fields.Boolean(string='Add a report per each employee', default=True)
employee_ids = fields.Many2many('hr.employee', compute='_compute_employee_ids')
diff --git a/addons/pos_loyalty/models/barcode_rule.py b/addons/pos_loyalty/models/barcode_rule.py
index a33a132fb62d8..220b9305639e5 100644
--- a/addons/pos_loyalty/models/barcode_rule.py
+++ b/addons/pos_loyalty/models/barcode_rule.py
@@ -5,6 +5,6 @@
class BarcodeRule(models.Model):
- _inherit = 'barcode.rule'
+ _inherit = ['barcode.rule']
type = fields.Selection(selection_add=[('coupon', 'Coupon')], ondelete={'coupon': 'set default'})
diff --git a/addons/pos_loyalty/models/loyalty_card.py b/addons/pos_loyalty/models/loyalty_card.py
index dacd7bf9732a4..e78acb824c83e 100644
--- a/addons/pos_loyalty/models/loyalty_card.py
+++ b/addons/pos_loyalty/models/loyalty_card.py
@@ -3,8 +3,8 @@
from odoo import fields, models, api
+
class LoyaltyCard(models.Model):
- _name = 'loyalty.card'
_inherit = ['loyalty.card', 'pos.load.mixin']
source_pos_order_id = fields.Many2one('pos.order', "PoS Order Reference",
diff --git a/addons/pos_loyalty/models/loyalty_mail.py b/addons/pos_loyalty/models/loyalty_mail.py
index 4277cccc2c0e6..2456f4f3fe1cd 100644
--- a/addons/pos_loyalty/models/loyalty_mail.py
+++ b/addons/pos_loyalty/models/loyalty_mail.py
@@ -3,8 +3,9 @@
from odoo import fields, models
+
class LoyaltyMail(models.Model):
- _inherit = 'loyalty.mail'
+ _inherit = ['loyalty.mail']
pos_report_print_id = fields.Many2one('ir.actions.report', string="Print Report", domain=[('model', '=', 'loyalty.card')],
help="The report action to be executed when creating a coupon/gift card/loyalty card in the PoS.",
diff --git a/addons/pos_loyalty/models/loyalty_program.py b/addons/pos_loyalty/models/loyalty_program.py
index 26a9bc79e153c..063d24c78273a 100644
--- a/addons/pos_loyalty/models/loyalty_program.py
+++ b/addons/pos_loyalty/models/loyalty_program.py
@@ -3,8 +3,8 @@
from odoo import _, api, fields, models
from odoo.exceptions import UserError
+
class LoyaltyProgram(models.Model):
- _name = 'loyalty.program'
_inherit = ['loyalty.program', 'pos.load.mixin']
# NOTE: `pos_config_ids` satisfies an excpeptional use case: when no PoS is specified, the loyalty program is
diff --git a/addons/pos_loyalty/models/loyalty_reward.py b/addons/pos_loyalty/models/loyalty_reward.py
index bf8bf81b4149f..c3d5721765f49 100644
--- a/addons/pos_loyalty/models/loyalty_reward.py
+++ b/addons/pos_loyalty/models/loyalty_reward.py
@@ -5,8 +5,8 @@
import ast
import json
+
class LoyaltyReward(models.Model):
- _name = 'loyalty.reward'
_inherit = ['loyalty.reward', 'pos.load.mixin']
def _get_discount_product_values(self):
diff --git a/addons/pos_loyalty/models/loyalty_rule.py b/addons/pos_loyalty/models/loyalty_rule.py
index dcbddcfa5c9cd..5cda342d4c212 100644
--- a/addons/pos_loyalty/models/loyalty_rule.py
+++ b/addons/pos_loyalty/models/loyalty_rule.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
from odoo.osv import expression
+
class LoyaltyRule(models.Model):
- _name = 'loyalty.rule'
_inherit = ['loyalty.rule', 'pos.load.mixin']
valid_product_ids = fields.Many2many(
diff --git a/addons/pos_loyalty/models/pos_config.py b/addons/pos_loyalty/models/pos_config.py
index 375fee9cd1bfb..1b2b6b77afdf9 100644
--- a/addons/pos_loyalty/models/pos_config.py
+++ b/addons/pos_loyalty/models/pos_config.py
@@ -4,8 +4,9 @@
from odoo import _, fields, models
from odoo.exceptions import UserError
+
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
# NOTE: this funtions acts as a m2m field with loyalty.program model. We do this to handle an excpetional use case:
# When no PoS is specified at a loyalty program form, this program is applied to every PoS (instead of none)
diff --git a/addons/pos_loyalty/models/pos_order.py b/addons/pos_loyalty/models/pos_order.py
index 7fd7c7916d508..4d8c8b7b3b4b9 100644
--- a/addons/pos_loyalty/models/pos_order.py
+++ b/addons/pos_loyalty/models/pos_order.py
@@ -6,8 +6,9 @@
from odoo.tools import float_compare
import base64
+
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
def validate_coupon_programs(self, point_changes, new_codes):
"""
diff --git a/addons/pos_loyalty/models/pos_order_line.py b/addons/pos_loyalty/models/pos_order_line.py
index 743e38259ad69..8cade3a22ae88 100644
--- a/addons/pos_loyalty/models/pos_order_line.py
+++ b/addons/pos_loyalty/models/pos_order_line.py
@@ -3,8 +3,9 @@
from odoo import fields, models, api
+
class PosOrderLine(models.Model):
- _inherit = 'pos.order.line'
+ _inherit = ['pos.order.line']
is_reward_line = fields.Boolean(
help="Whether this line is part of a reward or not.")
diff --git a/addons/pos_loyalty/models/pos_session.py b/addons/pos_loyalty/models/pos_session.py
index 66f044514b504..6326ed2b6eebb 100644
--- a/addons/pos_loyalty/models/pos_session.py
+++ b/addons/pos_loyalty/models/pos_session.py
@@ -2,8 +2,9 @@
from odoo import models, api
+
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
@api.model
def _load_pos_data_models(self, config_id):
diff --git a/addons/pos_loyalty/models/product_product.py b/addons/pos_loyalty/models/product_product.py
index 52b496759fe85..340458b82c553 100644
--- a/addons/pos_loyalty/models/product_product.py
+++ b/addons/pos_loyalty/models/product_product.py
@@ -2,7 +2,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/pos_loyalty/models/res_partner.py b/addons/pos_loyalty/models/res_partner.py
index 403a01926bb7d..c0740cd1e0585 100644
--- a/addons/pos_loyalty/models/res_partner.py
+++ b/addons/pos_loyalty/models/res_partner.py
@@ -2,6 +2,6 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
loyalty_card_count = fields.Integer(groups='base.group_user,point_of_sale.group_pos_user')
diff --git a/addons/pos_mercado_pago/models/pos_payment_method.py b/addons/pos_mercado_pago/models/pos_payment_method.py
index 5c3eec17f1bc0..71e57de298493 100644
--- a/addons/pos_mercado_pago/models/pos_payment_method.py
+++ b/addons/pos_mercado_pago/models/pos_payment_method.py
@@ -9,7 +9,7 @@
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
mp_bearer_token = fields.Char(
string="Production user token",
diff --git a/addons/pos_mercado_pago/models/pos_session.py b/addons/pos_mercado_pago/models/pos_session.py
index 8d6325d90b29b..1b05c5db34239 100644
--- a/addons/pos_mercado_pago/models/pos_session.py
+++ b/addons/pos_mercado_pago/models/pos_session.py
@@ -3,7 +3,7 @@
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
def _loader_params_pos_payment_method(self):
result = super()._loader_params_pos_payment_method()
diff --git a/addons/pos_mrp/models/pos_order.py b/addons/pos_mrp/models/pos_order.py
index e8de63d92aeb1..0f23c7d1c4d23 100644
--- a/addons/pos_mrp/models/pos_order.py
+++ b/addons/pos_mrp/models/pos_order.py
@@ -3,8 +3,9 @@
from odoo import models
+
class PosOrderLine(models.Model):
- _inherit = "pos.order.line"
+ _inherit = ["pos.order.line"]
def _get_stock_moves_to_consider(self, stock_moves, product):
self.ensure_one()
@@ -15,8 +16,9 @@ def _get_stock_moves_to_consider(self, stock_moves, product):
ml_product_to_consider = (product.bom_ids and [comp[0].product_id.id for comp in components]) or [product.id]
return stock_moves.filtered(lambda ml: ml.product_id.id in ml_product_to_consider and ml.bom_line_id)
+
class PosOrder(models.Model):
- _inherit = "pos.order"
+ _inherit = ["pos.order"]
def _get_pos_anglo_saxon_price_unit(self, product, partner_id, quantity):
bom = product.env['mrp.bom']._bom_find(product, company_id=self.mapped('picking_ids.move_line_ids').company_id.id, bom_type='phantom')[product]
diff --git a/addons/pos_online_payment/models/account_payment.py b/addons/pos_online_payment/models/account_payment.py
index a5af8a2654e0c..fcc32e603f6ac 100644
--- a/addons/pos_online_payment/models/account_payment.py
+++ b/addons/pos_online_payment/models/account_payment.py
@@ -5,7 +5,7 @@
class AccountPayment(models.Model):
- _inherit = 'account.payment'
+ _inherit = ['account.payment']
pos_order_id = fields.Many2one('pos.order', string='POS Order', help='The Point of Sale order linked to this payment', readonly=True)
diff --git a/addons/pos_online_payment/models/payment_transaction.py b/addons/pos_online_payment/models/payment_transaction.py
index 25c3576601c26..09028d20ef92b 100644
--- a/addons/pos_online_payment/models/payment_transaction.py
+++ b/addons/pos_online_payment/models/payment_transaction.py
@@ -6,7 +6,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
pos_order_id = fields.Many2one('pos.order', string='POS Order', help='The Point of Sale order linked to the payment transaction', readonly=True)
diff --git a/addons/pos_online_payment/models/pos_config.py b/addons/pos_online_payment/models/pos_config.py
index 7cbee7b8161d1..9b0ac582f077c 100644
--- a/addons/pos_online_payment/models/pos_config.py
+++ b/addons/pos_online_payment/models/pos_config.py
@@ -6,7 +6,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
@api.constrains('payment_method_ids')
def _check_online_payment_methods(self):
diff --git a/addons/pos_online_payment/models/pos_order.py b/addons/pos_online_payment/models/pos_order.py
index 46afd72f92ffe..31a2f4bf121a2 100644
--- a/addons/pos_online_payment/models/pos_order.py
+++ b/addons/pos_online_payment/models/pos_order.py
@@ -5,7 +5,7 @@
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
online_payment_method_id = fields.Many2one('pos.payment.method', compute="_compute_online_payment_method_id")
next_online_payment_amount = fields.Float(string='Next online payment amount to pay', digits=0, required=False) # unlimited precision
diff --git a/addons/pos_online_payment/models/pos_payment.py b/addons/pos_online_payment/models/pos_payment.py
index fac04eb99e3eb..620a7b90e7b0b 100644
--- a/addons/pos_online_payment/models/pos_payment.py
+++ b/addons/pos_online_payment/models/pos_payment.py
@@ -9,7 +9,7 @@
class PosPayment(models.Model):
- _inherit = 'pos.payment'
+ _inherit = ['pos.payment']
online_account_payment_id = fields.Many2one('account.payment', string='Online accounting payment', readonly=True) # One2one
diff --git a/addons/pos_online_payment/models/pos_payment_method.py b/addons/pos_online_payment/models/pos_payment_method.py
index 03696a1ec31f1..6db4343c31442 100644
--- a/addons/pos_online_payment/models/pos_payment_method.py
+++ b/addons/pos_online_payment/models/pos_payment_method.py
@@ -6,7 +6,7 @@
class PosPaymentMethod(models.Model):
- _inherit = "pos.payment.method"
+ _inherit = ["pos.payment.method"]
is_online_payment = fields.Boolean(string="Online Payment", help="Use this payment method for online payments (payments made on a web page with online payment providers)", default=False)
online_payment_provider_ids = fields.Many2many('payment.provider', string="Allowed Providers", domain="[('is_published', '=', True), ('state', 'in', ['enabled', 'test'])]")
diff --git a/addons/pos_online_payment/models/pos_session.py b/addons/pos_online_payment/models/pos_session.py
index 7230ee2b070b5..4f6780681d50d 100644
--- a/addons/pos_online_payment/models/pos_session.py
+++ b/addons/pos_online_payment/models/pos_session.py
@@ -7,7 +7,7 @@
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
def _accumulate_amounts(self, data):
data = super()._accumulate_amounts(data)
diff --git a/addons/pos_online_payment_self_order/models/pos_config.py b/addons/pos_online_payment_self_order/models/pos_config.py
index 08e193a3eccba..565e29e08227a 100644
--- a/addons/pos_online_payment_self_order/models/pos_config.py
+++ b/addons/pos_online_payment_self_order/models/pos_config.py
@@ -6,7 +6,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
self_order_online_payment_method_id = fields.Many2one('pos.payment.method', string='Self Online Payment', help="The online payment method to use when a customer pays a self-order online.", domain=[('is_online_payment', '=', True)], store=True, readonly=False)
diff --git a/addons/pos_online_payment_self_order/models/pos_order.py b/addons/pos_online_payment_self_order/models/pos_order.py
index 6dc2e3258953a..97804f9aef1ed 100644
--- a/addons/pos_online_payment_self_order/models/pos_order.py
+++ b/addons/pos_online_payment_self_order/models/pos_order.py
@@ -6,7 +6,7 @@
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
use_self_order_online_payment = fields.Boolean(compute='_compute_use_self_order_online_payment', store=True, readonly=True)
diff --git a/addons/pos_online_payment_self_order/models/pos_payment_method.py b/addons/pos_online_payment_self_order/models/pos_payment_method.py
index ce86602e8547d..ee5693baa29b3 100644
--- a/addons/pos_online_payment_self_order/models/pos_payment_method.py
+++ b/addons/pos_online_payment_self_order/models/pos_payment_method.py
@@ -3,7 +3,7 @@
class PosPaymentMethod(models.Model):
- _inherit = "pos.payment.method"
+ _inherit = ["pos.payment.method"]
@api.model
def _load_pos_self_data_domain(self, data):
diff --git a/addons/pos_online_payment_self_order/models/res_config_settings.py b/addons/pos_online_payment_self_order/models/res_config_settings.py
index 55ad58afa4d0e..2e3b42be5a36e 100644
--- a/addons/pos_online_payment_self_order/models/res_config_settings.py
+++ b/addons/pos_online_payment_self_order/models/res_config_settings.py
@@ -4,6 +4,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
pos_self_order_online_payment_method_id = fields.Many2one(related='pos_config_id.self_order_online_payment_method_id', readonly=False)
diff --git a/addons/pos_paytm/models/pos_payment_method.py b/addons/pos_paytm/models/pos_payment_method.py
index 3d85609dc053a..213e1e5fa6dc7 100644
--- a/addons/pos_paytm/models/pos_payment_method.py
+++ b/addons/pos_paytm/models/pos_payment_method.py
@@ -17,8 +17,9 @@
REQUEST_TIMEOUT = 30
iv = b'@@@@&&&###$$$$'
+
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
paytm_tid = fields.Char(string='PayTM Terminal ID', help="Terminal model or Activation code \n ex: 70000123")
channel_id = fields.Char(string='PayTM Channel ID', default='EDC')
diff --git a/addons/pos_razorpay/models/pos_payment.py b/addons/pos_razorpay/models/pos_payment.py
index a939f15a95dd3..a50b06a56dada 100644
--- a/addons/pos_razorpay/models/pos_payment.py
+++ b/addons/pos_razorpay/models/pos_payment.py
@@ -1,7 +1,8 @@
from odoo import models, fields
+
class PosPayment(models.Model):
- _inherit = "pos.payment"
+ _inherit = ["pos.payment"]
razorpay_reverse_ref_no = fields.Char('Razorpay Reverse Reference No.')
diff --git a/addons/pos_razorpay/models/pos_payment_method.py b/addons/pos_razorpay/models/pos_payment_method.py
index 578f30ddd28a3..15a8b977a297c 100644
--- a/addons/pos_razorpay/models/pos_payment_method.py
+++ b/addons/pos_razorpay/models/pos_payment_method.py
@@ -3,8 +3,9 @@
from .razorpay_pos_request import RazorpayPosRequest
+
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
razorpay_tid = fields.Char(string='Razorpay Device Serial No', help='Device Serial No \n ex: 7000012300')
razorpay_allowed_payment_modes = fields.Selection(selection=[('all', 'All'), ('card', 'Card'), ('upi', 'UPI'), ('bharatqr', 'BHARATQR')], default='all', help='Choose allow payment mode: \n All/Card/UPI or QR')
diff --git a/addons/pos_restaurant/models/account_fiscal_position.py b/addons/pos_restaurant/models/account_fiscal_position.py
index c1361f4b08e1e..7dee4e04aceb2 100644
--- a/addons/pos_restaurant/models/account_fiscal_position.py
+++ b/addons/pos_restaurant/models/account_fiscal_position.py
@@ -3,7 +3,7 @@
class AccountFiscalPosition(models.Model):
- _inherit = 'account.fiscal.position'
+ _inherit = ['account.fiscal.position']
@api.model
def _load_pos_data_domain(self, data):
diff --git a/addons/pos_restaurant/models/pos_config.py b/addons/pos_restaurant/models/pos_config.py
index 445304112d4fe..83bae5836509b 100644
--- a/addons/pos_restaurant/models/pos_config.py
+++ b/addons/pos_restaurant/models/pos_config.py
@@ -8,7 +8,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
iface_splitbill = fields.Boolean(string='Bill Splitting', help='Enables Bill Splitting in the Point of Sale.')
iface_printbill = fields.Boolean(string='Bill Printing', help='Allows to print the Bill before payment.')
diff --git a/addons/pos_restaurant/models/pos_order.py b/addons/pos_restaurant/models/pos_order.py
index 8706ab05b6792..f3487cbff342d 100644
--- a/addons/pos_restaurant/models/pos_order.py
+++ b/addons/pos_restaurant/models/pos_order.py
@@ -2,8 +2,9 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
+
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
table_id = fields.Many2one('restaurant.table', string='Table', help='The table where this order was served', index='btree_not_null', readonly=True)
customer_count = fields.Integer(string='Guests', help='The amount of customers that have been served by this order.', readonly=True)
diff --git a/addons/pos_restaurant/models/pos_payment.py b/addons/pos_restaurant/models/pos_payment.py
index d4bfae1572f8d..7fbc051cddfef 100644
--- a/addons/pos_restaurant/models/pos_payment.py
+++ b/addons/pos_restaurant/models/pos_payment.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class PosConfig(models.Model):
- _inherit = 'pos.payment'
+class PosPayment(models.Model):
+ _inherit = ['pos.payment']
def _update_payment_line_for_tip(self, tip_amount):
"""Inherit this method to perform reauthorization or capture on electronic payment."""
diff --git a/addons/pos_restaurant/models/pos_restaurant.py b/addons/pos_restaurant/models/pos_restaurant.py
index 9b82fd0de1520..6681d0b757086 100644
--- a/addons/pos_restaurant/models/pos_restaurant.py
+++ b/addons/pos_restaurant/models/pos_restaurant.py
@@ -7,7 +7,6 @@
class RestaurantFloor(models.Model):
- _name = 'restaurant.floor'
_description = 'Restaurant Floor'
_order = "sequence, name"
_inherit = ['pos.load.mixin']
@@ -81,9 +80,9 @@ def deactivate_floor(self, session_id):
return True
+
class RestaurantTable(models.Model):
- _name = 'restaurant.table'
_description = 'Restaurant Table'
_inherit = ['pos.load.mixin']
diff --git a/addons/pos_restaurant/models/pos_session.py b/addons/pos_restaurant/models/pos_session.py
index 71e031bef3cd6..9f2795938e9f5 100644
--- a/addons/pos_restaurant/models/pos_session.py
+++ b/addons/pos_restaurant/models/pos_session.py
@@ -4,8 +4,9 @@
from odoo import models, api
import json
+
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
@api.model
def _load_pos_data_models(self, config_id):
diff --git a/addons/pos_restaurant/models/res_config_settings.py b/addons/pos_restaurant/models/res_config_settings.py
index 69a2963d3b653..bc7ff123b3812 100644
--- a/addons/pos_restaurant/models/res_config_settings.py
+++ b/addons/pos_restaurant/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
pos_floor_ids = fields.Many2many(related='pos_config_id.floor_ids', readonly=False)
pos_iface_printbill = fields.Boolean(compute='_compute_pos_module_pos_restaurant', store=True, readonly=False)
diff --git a/addons/pos_restaurant_adyen/models/pos_order.py b/addons/pos_restaurant_adyen/models/pos_order.py
index f3b8553c8c880..25cb2eb4da29e 100644
--- a/addons/pos_restaurant_adyen/models/pos_order.py
+++ b/addons/pos_restaurant_adyen/models/pos_order.py
@@ -5,7 +5,7 @@
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
def action_pos_order_paid(self):
res = super(PosOrder, self).action_pos_order_paid()
diff --git a/addons/pos_restaurant_adyen/models/pos_payment.py b/addons/pos_restaurant_adyen/models/pos_payment.py
index 4c62cacf50cd4..cf046c243ac30 100644
--- a/addons/pos_restaurant_adyen/models/pos_payment.py
+++ b/addons/pos_restaurant_adyen/models/pos_payment.py
@@ -10,7 +10,7 @@
class PosPayment(models.Model):
- _inherit = 'pos.payment'
+ _inherit = ['pos.payment']
def _update_payment_line_for_tip(self, tip_amount):
"""Capture the payment when a tip is set."""
diff --git a/addons/pos_restaurant_adyen/models/pos_payment_method.py b/addons/pos_restaurant_adyen/models/pos_payment_method.py
index 9e3e90de4e444..879ee023a93c8 100644
--- a/addons/pos_restaurant_adyen/models/pos_payment_method.py
+++ b/addons/pos_restaurant_adyen/models/pos_payment_method.py
@@ -5,7 +5,7 @@
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
adyen_merchant_account = fields.Char(help='The POS merchant account code used in Adyen')
diff --git a/addons/pos_restaurant_stripe/models/pos_payment.py b/addons/pos_restaurant_stripe/models/pos_payment.py
index cbf3dd42f5ef7..78935f4d1247b 100644
--- a/addons/pos_restaurant_stripe/models/pos_payment.py
+++ b/addons/pos_restaurant_stripe/models/pos_payment.py
@@ -4,7 +4,7 @@
class PosPayment(models.Model):
- _inherit = 'pos.payment'
+ _inherit = ['pos.payment']
def _update_payment_line_for_tip(self, tip_amount):
"""Capture the payment when a tip is set."""
diff --git a/addons/pos_sale/models/crm_team.py b/addons/pos_sale/models/crm_team.py
index bdde081f745f1..491121a9d9fce 100644
--- a/addons/pos_sale/models/crm_team.py
+++ b/addons/pos_sale/models/crm_team.py
@@ -8,7 +8,7 @@
class CrmTeam(models.Model):
- _inherit = 'crm.team'
+ _inherit = ['crm.team']
pos_config_ids = fields.One2many('pos.config', 'crm_team_id', string="Point of Sales")
pos_sessions_open_count = fields.Integer(string='Open POS Sessions', compute='_compute_pos_sessions_open_count')
diff --git a/addons/pos_sale/models/pos_config.py b/addons/pos_sale/models/pos_config.py
index dbee02867c75b..640458c28643b 100644
--- a/addons/pos_sale/models/pos_config.py
+++ b/addons/pos_sale/models/pos_config.py
@@ -5,7 +5,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
crm_team_id = fields.Many2one(
'crm.team', string="Sales Team", ondelete="set null",
diff --git a/addons/pos_sale/models/pos_order.py b/addons/pos_sale/models/pos_order.py
index 6ee13fddfa061..957188a21c5c8 100644
--- a/addons/pos_sale/models/pos_order.py
+++ b/addons/pos_sale/models/pos_order.py
@@ -6,7 +6,7 @@
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
currency_rate = fields.Float(compute='_compute_currency_rate', store=True, digits=0, readonly=True)
crm_team_id = fields.Many2one('crm.team', string="Sales Team", ondelete="set null")
@@ -159,8 +159,9 @@ def _get_invoice_lines_values(self, line_values, pos_line):
return inv_line_vals
+
class PosOrderLine(models.Model):
- _inherit = 'pos.order.line'
+ _inherit = ['pos.order.line']
sale_order_origin_id = fields.Many2one('sale.order', string="Linked Sale Order")
sale_order_line_id = fields.Many2one('sale.order.line', string="Source Sale Order Line")
diff --git a/addons/pos_sale/models/pos_session.py b/addons/pos_sale/models/pos_session.py
index 2f0ad285e9dcf..e240c4c68a8a3 100644
--- a/addons/pos_sale/models/pos_session.py
+++ b/addons/pos_sale/models/pos_session.py
@@ -5,7 +5,7 @@
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
crm_team_id = fields.Many2one('crm.team', related='config_id.crm_team_id', string="Sales Team", readonly=True)
diff --git a/addons/pos_sale/models/product_product.py b/addons/pos_sale/models/product_product.py
index 1f70b183560ca..107256e4c044a 100644
--- a/addons/pos_sale/models/product_product.py
+++ b/addons/pos_sale/models/product_product.py
@@ -2,7 +2,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/pos_sale/models/res_config_settings.py b/addons/pos_sale/models/res_config_settings.py
index 00a2d4b30ae76..81e31fb667a40 100644
--- a/addons/pos_sale/models/res_config_settings.py
+++ b/addons/pos_sale/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
pos_crm_team_id = fields.Many2one(related='pos_config_id.crm_team_id', readonly=False, string='Sales Team (PoS)')
pos_down_payment_product_id = fields.Many2one(related='pos_config_id.down_payment_product_id', readonly=False)
diff --git a/addons/pos_sale/models/sale_order.py b/addons/pos_sale/models/sale_order.py
index 7c4db83928c13..19ae895b3914e 100644
--- a/addons/pos_sale/models/sale_order.py
+++ b/addons/pos_sale/models/sale_order.py
@@ -5,7 +5,6 @@
class SaleOrder(models.Model):
- _name = 'sale.order'
_inherit = ['sale.order', 'pos.load.mixin']
pos_order_line_ids = fields.One2many('pos.order.line', 'sale_order_origin_id', string="Order lines Transfered to Point of Sale", readonly=True, groups="point_of_sale.group_pos_user")
@@ -49,8 +48,8 @@ def _compute_amount_unpaid(self):
total_pos_paid = sum(sale_order.order_line.filtered(lambda l: not l.display_type).mapped('pos_order_line_ids.price_subtotal_incl'))
sale_order.amount_unpaid = sale_order.amount_total - (total_invoice_paid + total_pos_paid)
+
class SaleOrderLine(models.Model):
- _name = 'sale.order.line'
_inherit = ['sale.order.line', 'pos.load.mixin']
pos_order_line_ids = fields.One2many('pos.order.line', 'sale_order_line_id', string="Order lines Transfered to Point of Sale", readonly=True, groups="point_of_sale.group_pos_user")
diff --git a/addons/pos_sale/models/stock_picking.py b/addons/pos_sale/models/stock_picking.py
index b837ee2fb1a7b..0bcd85b26928b 100644
--- a/addons/pos_sale/models/stock_picking.py
+++ b/addons/pos_sale/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
def _create_move_from_pos_order_lines(self, lines):
lines_to_unreserve = self.env['pos.order.line']
diff --git a/addons/pos_sale/report/sale_report.py b/addons/pos_sale/report/sale_report.py
index f93914a7a3256..5b78ec7fb9d33 100644
--- a/addons/pos_sale/report/sale_report.py
+++ b/addons/pos_sale/report/sale_report.py
@@ -5,7 +5,7 @@
class SaleReport(models.Model):
- _inherit = "sale.report"
+ _inherit = ["sale.report"]
@api.model
def _get_done_states(self):
diff --git a/addons/pos_sale_loyalty/models/sale_order.py b/addons/pos_sale_loyalty/models/sale_order.py
index 98641fb71cae7..c629f59fdf086 100644
--- a/addons/pos_sale_loyalty/models/sale_order.py
+++ b/addons/pos_sale_loyalty/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
def _get_sale_order_fields(self):
field_names = super()._get_sale_order_fields()
diff --git a/addons/pos_sale_margin/report/sale_report.py b/addons/pos_sale_margin/report/sale_report.py
index 9053ea8a32b6f..f04f8baa17101 100644
--- a/addons/pos_sale_margin/report/sale_report.py
+++ b/addons/pos_sale_margin/report/sale_report.py
@@ -5,7 +5,7 @@
class SaleReport(models.Model):
- _inherit = "sale.report"
+ _inherit = ["sale.report"]
def _fill_pos_fields(self, additional_fields):
values = super()._fill_pos_fields(additional_fields)
diff --git a/addons/pos_self_order/models/account_fiscal_position.py b/addons/pos_self_order/models/account_fiscal_position.py
index d122231138c5b..4e39a2836115e 100644
--- a/addons/pos_self_order/models/account_fiscal_position.py
+++ b/addons/pos_self_order/models/account_fiscal_position.py
@@ -2,7 +2,7 @@
class AccountFiscalPosition(models.Model):
- _inherit = 'account.fiscal.position'
+ _inherit = ['account.fiscal.position']
def _load_pos_self_data(self, data):
return self._load_pos_data(data)
diff --git a/addons/pos_self_order/models/ir_binary.py b/addons/pos_self_order/models/ir_binary.py
index 4e023fe12f3b3..c5a2947bc8009 100644
--- a/addons/pos_self_order/models/ir_binary.py
+++ b/addons/pos_self_order/models/ir_binary.py
@@ -2,7 +2,7 @@
class IrBinary(models.AbstractModel):
- _inherit = "ir.binary"
+ _inherit = ["ir.binary"]
def _find_record_check_access(self, record, access_token, field):
if record._name in ["product.product", "pos.category"] and field in ["image_128", "image_512"]:
diff --git a/addons/pos_self_order/models/ir_http.py b/addons/pos_self_order/models/ir_http.py
index bc6d83e12f8a4..5910f48310f78 100644
--- a/addons/pos_self_order/models/ir_http.py
+++ b/addons/pos_self_order/models/ir_http.py
@@ -4,7 +4,7 @@
class IrHttp(models.AbstractModel):
- _inherit = "ir.http"
+ _inherit = ["ir.http"]
@classmethod
def _get_translation_frontend_modules_name(cls):
diff --git a/addons/pos_self_order/models/pos_category.py b/addons/pos_self_order/models/pos_category.py
index c6c2e87b3b0f1..f783e8683ea5e 100644
--- a/addons/pos_self_order/models/pos_category.py
+++ b/addons/pos_self_order/models/pos_category.py
@@ -6,7 +6,7 @@
class PosCategory(models.Model):
- _inherit = "pos.category"
+ _inherit = ["pos.category"]
hour_until = fields.Float(string='Availability Until', default=24.0, help="The product will be available until this hour.")
diff --git a/addons/pos_self_order/models/pos_config.py b/addons/pos_self_order/models/pos_config.py
index 131fd2a926396..ad3d676b09004 100644
--- a/addons/pos_self_order/models/pos_config.py
+++ b/addons/pos_self_order/models/pos_config.py
@@ -11,7 +11,7 @@
class PosConfig(models.Model):
- _inherit = "pos.config"
+ _inherit = ["pos.config"]
def _self_order_kiosk_default_languages(self):
return self.env["res.lang"].get_installed()
diff --git a/addons/pos_self_order/models/pos_load_mixin.py b/addons/pos_self_order/models/pos_load_mixin.py
index d27e16f58cca8..138e59904eb12 100644
--- a/addons/pos_self_order/models/pos_load_mixin.py
+++ b/addons/pos_self_order/models/pos_load_mixin.py
@@ -3,7 +3,7 @@
class PosLoadMixin(models.AbstractModel):
- _inherit = "pos.load.mixin"
+ _inherit = ["pos.load.mixin"]
@api.model
def _load_pos_self_data_domain(self, data):
diff --git a/addons/pos_self_order/models/pos_order.py b/addons/pos_self_order/models/pos_order.py
index 0a354f35564e4..539c3c2fa35da 100644
--- a/addons/pos_self_order/models/pos_order.py
+++ b/addons/pos_self_order/models/pos_order.py
@@ -7,7 +7,7 @@
class PosOrderLine(models.Model):
- _inherit = "pos.order.line"
+ _inherit = ["pos.order.line"]
combo_id = fields.Many2one('product.combo', string='Combo reference')
@@ -31,8 +31,9 @@ def write(self, vals):
del vals['combo_parent_uuid']
return super().write(vals)
+
class PosOrder(models.Model):
- _inherit = "pos.order"
+ _inherit = ["pos.order"]
table_stand_number = fields.Char(string="Table Stand Number")
diff --git a/addons/pos_self_order/models/pos_payment_method.py b/addons/pos_self_order/models/pos_payment_method.py
index 3e2627dd55ec2..7adbb402a37c3 100644
--- a/addons/pos_self_order/models/pos_payment_method.py
+++ b/addons/pos_self_order/models/pos_payment_method.py
@@ -2,7 +2,7 @@
class PosPaymentMethod(models.Model):
- _inherit = "pos.payment.method"
+ _inherit = ["pos.payment.method"]
# will be overridden.
def _payment_request_from_kiosk(self, order):
diff --git a/addons/pos_self_order/models/pos_restaurant.py b/addons/pos_self_order/models/pos_restaurant.py
index ff3b660d33095..2aba319282daa 100644
--- a/addons/pos_self_order/models/pos_restaurant.py
+++ b/addons/pos_self_order/models/pos_restaurant.py
@@ -8,7 +8,7 @@
class RestaurantTable(models.Model):
- _inherit = "restaurant.table"
+ _inherit = ["restaurant.table"]
identifier = fields.Char(
"Security Token",
@@ -37,7 +37,7 @@ def _load_pos_self_data_domain(self, data):
class RestaurantFloor(models.Model):
- _inherit = "restaurant.floor"
+ _inherit = ["restaurant.floor"]
@api.model
def _load_pos_self_data_fields(self, config_id):
diff --git a/addons/pos_self_order/models/pos_self_order_custom_link.py b/addons/pos_self_order/models/pos_self_order_custom_link.py
index 1cf091d79baa1..93a349136cd29 100644
--- a/addons/pos_self_order/models/pos_self_order_custom_link.py
+++ b/addons/pos_self_order/models/pos_self_order_custom_link.py
@@ -6,9 +6,8 @@
from markupsafe import escape
-class PosSelfOrderCustomLink(models.Model):
- _name = "pos_self_order.custom_link"
- _inherit = "pos.load.mixin"
+class Pos_Self_OrderCustom_Link(models.Model):
+ _inherit = ["pos.load.mixin"]
_description = (
"Custom links that the restaurant can configure to be displayed on the self order screen"
)
diff --git a/addons/pos_self_order/models/pos_session.py b/addons/pos_self_order/models/pos_session.py
index ad5993fcf5bc2..f52a94e818e56 100644
--- a/addons/pos_self_order/models/pos_session.py
+++ b/addons/pos_self_order/models/pos_session.py
@@ -5,7 +5,7 @@
class PosSession(models.Model):
- _inherit = 'pos.session'
+ _inherit = ['pos.session']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/pos_self_order/models/product_product.py b/addons/pos_self_order/models/product_product.py
index 00310f8b02ac8..4f93fc57f46f1 100644
--- a/addons/pos_self_order/models/product_product.py
+++ b/addons/pos_self_order/models/product_product.py
@@ -5,7 +5,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
self_order_available = fields.Boolean(
string="Available in Self Order",
@@ -32,8 +32,9 @@ def write(self, vals_list):
product._send_availability_status()
return res
+
class ProductProduct(models.Model):
- _inherit = "product.product"
+ _inherit = ["product.product"]
@api.model
def _load_pos_data_fields(self, config_id):
diff --git a/addons/pos_self_order/models/res_config_settings.py b/addons/pos_self_order/models/res_config_settings.py
index cd58d2721562f..d5bdda1169962 100644
--- a/addons/pos_self_order/models/res_config_settings.py
+++ b/addons/pos_self_order/models/res_config_settings.py
@@ -12,7 +12,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = "res.config.settings"
+ _inherit = ["res.config.settings"]
pos_self_ordering_takeaway = fields.Boolean(related="pos_config_id.self_ordering_takeaway", readonly=False)
pos_self_ordering_service_mode = fields.Selection(related="pos_config_id.self_ordering_service_mode", readonly=False, required=True)
diff --git a/addons/pos_self_order_adyen/models/pos_payment_method.py b/addons/pos_self_order_adyen/models/pos_payment_method.py
index d759ad830afba..5008c5777ddc8 100644
--- a/addons/pos_self_order_adyen/models/pos_payment_method.py
+++ b/addons/pos_self_order_adyen/models/pos_payment_method.py
@@ -5,7 +5,7 @@
class PosPaymentMethod(models.Model):
- _inherit = "pos.payment.method"
+ _inherit = ["pos.payment.method"]
@api.model
def _get_valid_acquirer_data(self):
diff --git a/addons/pos_self_order_razorpay/models/pos_payment_method.py b/addons/pos_self_order_razorpay/models/pos_payment_method.py
index 1c2ed72d62143..08d09e58147eb 100644
--- a/addons/pos_self_order_razorpay/models/pos_payment_method.py
+++ b/addons/pos_self_order_razorpay/models/pos_payment_method.py
@@ -4,7 +4,7 @@
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
def _payment_request_from_kiosk(self, order):
if self.use_payment_terminal != 'razorpay':
diff --git a/addons/pos_self_order_sale/models/res_config_settings.py b/addons/pos_self_order_sale/models/res_config_settings.py
index e811c8e2c9def..416931baeadcb 100644
--- a/addons/pos_self_order_sale/models/res_config_settings.py
+++ b/addons/pos_self_order_sale/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = "res.config.settings"
+ _inherit = ["res.config.settings"]
@api.onchange("pos_self_ordering_mode")
def _onchange_pos_self_order_kiosk(self):
diff --git a/addons/pos_self_order_stripe/models/pos_payment_method.py b/addons/pos_self_order_stripe/models/pos_payment_method.py
index 17af357b61453..4b30134c0f0d5 100644
--- a/addons/pos_self_order_stripe/models/pos_payment_method.py
+++ b/addons/pos_self_order_stripe/models/pos_payment_method.py
@@ -2,7 +2,7 @@
class PosPaymentMethod(models.Model):
- _inherit = "pos.payment.method"
+ _inherit = ["pos.payment.method"]
def _payment_request_from_kiosk(self, order):
if self.use_payment_terminal != 'stripe':
diff --git a/addons/pos_six/models/pos_config.py b/addons/pos_six/models/pos_config.py
index 2b7a9ea5ea31d..ba5e1923f3de3 100644
--- a/addons/pos_six/models/pos_config.py
+++ b/addons/pos_six/models/pos_config.py
@@ -5,7 +5,7 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
def _force_http(self):
enforce_https = self.env['ir.config_parameter'].sudo().get_param('point_of_sale.enforce_https')
diff --git a/addons/pos_six/models/pos_payment_method.py b/addons/pos_six/models/pos_payment_method.py
index 1119cd807d29b..9a33294006191 100644
--- a/addons/pos_six/models/pos_payment_method.py
+++ b/addons/pos_six/models/pos_payment_method.py
@@ -5,7 +5,7 @@
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
def _get_payment_terminal_selection(self):
return super(PosPaymentMethod, self)._get_payment_terminal_selection() + [('six', 'SIX')]
diff --git a/addons/pos_sms/models/pos_config.py b/addons/pos_sms/models/pos_config.py
index 2be84d19a2c42..b7bcab71700a3 100644
--- a/addons/pos_sms/models/pos_config.py
+++ b/addons/pos_sms/models/pos_config.py
@@ -2,6 +2,6 @@
class PosConfig(models.Model):
- _inherit = 'pos.config'
+ _inherit = ['pos.config']
sms_receipt_template_id = fields.Many2one('sms.template', string="Sms Receipt template", domain=[('model', '=', 'pos.order')], help="SMS will be sent to the customer based on this template")
diff --git a/addons/pos_sms/models/pos_order.py b/addons/pos_sms/models/pos_order.py
index 7bbb77e73e74f..fc5e664ad8355 100644
--- a/addons/pos_sms/models/pos_order.py
+++ b/addons/pos_sms/models/pos_order.py
@@ -2,7 +2,7 @@
class PosOrder(models.Model):
- _inherit = 'pos.order'
+ _inherit = ['pos.order']
def action_sent_message_on_sms(self, phone, _):
if not (self and self.config_id.module_pos_sms and self.config_id.sms_receipt_template_id and phone):
diff --git a/addons/pos_sms/models/res_config_settings.py b/addons/pos_sms/models/res_config_settings.py
index 56a883a92c4bb..c2181dce30451 100644
--- a/addons/pos_sms/models/res_config_settings.py
+++ b/addons/pos_sms/models/res_config_settings.py
@@ -2,6 +2,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
pos_sms_receipt_template_id = fields.Many2one('sms.template', related='pos_config_id.sms_receipt_template_id', readonly=False)
diff --git a/addons/pos_stripe/models/pos_payment_method.py b/addons/pos_stripe/models/pos_payment_method.py
index 1c74526c97402..adc690d841fe1 100644
--- a/addons/pos_stripe/models/pos_payment_method.py
+++ b/addons/pos_stripe/models/pos_payment_method.py
@@ -10,8 +10,9 @@
_logger = logging.getLogger(__name__)
TIMEOUT = 10
+
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
def _get_payment_terminal_selection(self):
return super()._get_payment_terminal_selection() + [('stripe', 'Stripe')]
diff --git a/addons/pos_viva_wallet/models/pos_payment_method.py b/addons/pos_viva_wallet/models/pos_payment_method.py
index e41fc6d0f763d..dffd8be71f422 100644
--- a/addons/pos_viva_wallet/models/pos_payment_method.py
+++ b/addons/pos_viva_wallet/models/pos_payment_method.py
@@ -11,7 +11,7 @@
class PosPaymentMethod(models.Model):
- _inherit = 'pos.payment.method'
+ _inherit = ['pos.payment.method']
# Viva Wallet
viva_wallet_merchant_id = fields.Char(string="Merchant ID", help='Used when connecting to Viva Wallet: https://developer.vivawallet.com/getting-started/find-your-account-credentials/merchant-id-and-api-key/')
diff --git a/addons/privacy_lookup/models/privacy_log.py b/addons/privacy_lookup/models/privacy_log.py
index 045a2d25f7115..43d737837e03f 100644
--- a/addons/privacy_lookup/models/privacy_log.py
+++ b/addons/privacy_lookup/models/privacy_log.py
@@ -6,7 +6,6 @@
class PrivacyLog(models.Model):
- _name = 'privacy.log'
_description = 'Privacy Log'
_rec_name = 'user_id'
diff --git a/addons/privacy_lookup/models/res_partner.py b/addons/privacy_lookup/models/res_partner.py
index 19962c362f2b3..1fddf66d4c85d 100644
--- a/addons/privacy_lookup/models/res_partner.py
+++ b/addons/privacy_lookup/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
def action_privacy_lookup(self):
self.ensure_one()
diff --git a/addons/privacy_lookup/wizard/privacy_lookup_wizard.py b/addons/privacy_lookup/wizard/privacy_lookup_wizard.py
index 15527ad14e79c..44b7e9fd83abb 100644
--- a/addons/privacy_lookup/wizard/privacy_lookup_wizard.py
+++ b/addons/privacy_lookup/wizard/privacy_lookup_wizard.py
@@ -9,7 +9,6 @@
class PrivacyLookupWizard(models.TransientModel):
- _name = 'privacy.lookup.wizard'
_description = 'Privacy Lookup Wizard'
_transient_max_count = 0
_transient_max_hours = 24
@@ -210,7 +209,6 @@ def action_open_lines(self):
class PrivacyLookupWizardLine(models.TransientModel):
- _name = 'privacy.lookup.wizard.line'
_description = 'Privacy Lookup Wizard Line'
_transient_max_count = 0
_transient_max_hours = 24
diff --git a/addons/product/models/decimal_precision.py b/addons/product/models/decimal_precision.py
index 8e7decaf74b3d..0d5c01def1ba7 100644
--- a/addons/product/models/decimal_precision.py
+++ b/addons/product/models/decimal_precision.py
@@ -4,7 +4,7 @@
class DecimalPrecision(models.Model):
- _inherit = 'decimal.precision'
+ _inherit = ['decimal.precision']
@api.onchange('digits')
def _onchange_digits(self):
diff --git a/addons/product/models/ir_attachment.py b/addons/product/models/ir_attachment.py
index e9a915d0ae23c..4671ef3bb4fc6 100644
--- a/addons/product/models/ir_attachment.py
+++ b/addons/product/models/ir_attachment.py
@@ -4,7 +4,7 @@
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/product/models/product_attribute.py b/addons/product/models/product_attribute.py
index 790b0e7d98441..d5737f5ec844b 100644
--- a/addons/product/models/product_attribute.py
+++ b/addons/product/models/product_attribute.py
@@ -5,7 +5,6 @@
class ProductAttribute(models.Model):
- _name = "product.attribute"
_description = "Product Attribute"
# if you change this _order, keep it in sync with the method
# `_sort_key_attribute_value` in `product.template`
diff --git a/addons/product/models/product_attribute_custom_value.py b/addons/product/models/product_attribute_custom_value.py
index 4a8dfab820cc0..0bf524c3de02a 100644
--- a/addons/product/models/product_attribute_custom_value.py
+++ b/addons/product/models/product_attribute_custom_value.py
@@ -4,7 +4,6 @@
class ProductAttributeCustomValue(models.Model):
- _name = 'product.attribute.custom.value'
_description = "Product Attribute Custom Value"
_order = 'custom_product_template_attribute_value_id, id'
diff --git a/addons/product/models/product_attribute_value.py b/addons/product/models/product_attribute_value.py
index 793da36ee7def..4c50ede990d7c 100644
--- a/addons/product/models/product_attribute_value.py
+++ b/addons/product/models/product_attribute_value.py
@@ -7,7 +7,6 @@
class ProductAttributeValue(models.Model):
- _name = 'product.attribute.value'
# if you change this _order, keep it in sync with the method
# `_sort_key_variant` in `product.template'
_order = 'attribute_id, sequence, id'
diff --git a/addons/product/models/product_catalog_mixin.py b/addons/product/models/product_catalog_mixin.py
index 358dc55c65449..28e0c1e5c09b2 100644
--- a/addons/product/models/product_catalog_mixin.py
+++ b/addons/product/models/product_catalog_mixin.py
@@ -9,7 +9,6 @@ class ProductCatalogMixin(models.AbstractModel):
It assumes the model using this mixin has a O2M field where the products are added/removed and
this field's co-related model should has a method named `_get_product_catalog_lines_data`.
"""
- _name = 'product.catalog.mixin'
_description = 'Product Catalog Mixin'
def action_add_from_catalog(self):
diff --git a/addons/product/models/product_category.py b/addons/product/models/product_category.py
index e93ccafa85208..c64a4c6982f37 100644
--- a/addons/product/models/product_category.py
+++ b/addons/product/models/product_category.py
@@ -6,7 +6,6 @@
class ProductCategory(models.Model):
- _name = "product.category"
_inherit = ['mail.thread']
_description = "Product Category"
_parent_name = "parent_id"
diff --git a/addons/product/models/product_combo.py b/addons/product/models/product_combo.py
index f49f003338a8a..b822b82c48540 100644
--- a/addons/product/models/product_combo.py
+++ b/addons/product/models/product_combo.py
@@ -5,7 +5,6 @@
class ProductCombo(models.Model):
- _name = 'product.combo'
_description = "Product Combo"
_order = 'sequence, id'
diff --git a/addons/product/models/product_combo_item.py b/addons/product/models/product_combo_item.py
index 05ee43d2a388e..6a6fc5a9e3987 100644
--- a/addons/product/models/product_combo_item.py
+++ b/addons/product/models/product_combo_item.py
@@ -5,7 +5,6 @@
class ProductComboItem(models.Model):
- _name = 'product.combo.item'
_description = "Product Combo Item"
_check_company_auto = True
diff --git a/addons/product/models/product_document.py b/addons/product/models/product_document.py
index 4f525a9c04897..43b05be0a7ba5 100644
--- a/addons/product/models/product_document.py
+++ b/addons/product/models/product_document.py
@@ -6,7 +6,6 @@
class ProductDocument(models.Model):
- _name = 'product.document'
_description = "Product Document"
_inherits = {
'ir.attachment': 'ir_attachment_id',
diff --git a/addons/product/models/product_packaging.py b/addons/product/models/product_packaging.py
index 28c4ffef246c0..f1703078e1aab 100644
--- a/addons/product/models/product_packaging.py
+++ b/addons/product/models/product_packaging.py
@@ -10,7 +10,6 @@
class ProductPackaging(models.Model):
- _name = "product.packaging"
_description = "Product Packaging"
_order = 'product_id, sequence, id'
_check_company_auto = True
diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py
index ea2aad34c8b90..4f1878eb0b248 100644
--- a/addons/product/models/product_pricelist.py
+++ b/addons/product/models/product_pricelist.py
@@ -4,8 +4,7 @@
from odoo.exceptions import UserError
-class Pricelist(models.Model):
- _name = "product.pricelist"
+class ProductPricelist(models.Model):
_inherit = ['mail.thread', 'mail.activity.mixin']
_description = "Pricelist"
_rec_names_search = ['name', 'currency_id'] # TODO check if should be removed
@@ -301,7 +300,7 @@ def _get_partner_pricelist_multi(self, partner_ids):
company_id = self.env.company.id
IrConfigParameter = self.env['ir.config_parameter'].sudo()
- Pricelist = self.env['product.pricelist']
+ ProductPricelist = self.env['product.pricelist']
pl_domain = self._get_partner_pricelist_multi_search_domain_hook(company_id)
# if no specific property, try to find a fitting pricelist
@@ -321,7 +320,7 @@ def convert_to_int(string_value):
return None
# get fallback pricelist when no pricelist for a given country
pl_fallback = (
- Pricelist.search(pl_domain + [('country_group_ids', '=', False)], limit=1) or
+ ProductPricelist.search(pl_domain + [('country_group_ids', '=', False)], limit=1) or
# save data in ir.config_parameter instead of ir.default for
# res.partner.property_product_pricelist
# otherwise the data will become the default value while
@@ -329,15 +328,15 @@ def convert_to_int(string_value):
# however if the property_product_pricelist is not specified
# the result of the previous line should have high priority
# when computing
- Pricelist.browse(convert_to_int(IrConfigParameter.get_param(f'res.partner.property_product_pricelist_{company_id}'))) or
- Pricelist.browse(convert_to_int(IrConfigParameter.get_param('res.partner.property_product_pricelist'))) or
- Pricelist.search(pl_domain, limit=1)
+ ProductPricelist.browse(convert_to_int(IrConfigParameter.get_param(f'res.partner.property_product_pricelist_{company_id}'))) or
+ ProductPricelist.browse(convert_to_int(IrConfigParameter.get_param('res.partner.property_product_pricelist'))) or
+ ProductPricelist.search(pl_domain, limit=1)
)
# group partners by country, and find a pricelist for each country
remaining_partners = self.env['res.partner'].browse(remaining_partner_ids)
partners_by_country = remaining_partners.grouped('country_id')
for country, partners in partners_by_country.items():
- pl = Pricelist.search(pl_domain + [('country_group_ids.country_ids', '=', country.id if country else False)], limit=1)
+ pl = ProductPricelist.search(pl_domain + [('country_group_ids.country_ids', '=', country.id if country else False)], limit=1)
pl = pl or pl_fallback
result.update(dict.fromkeys(partners._ids, pl))
diff --git a/addons/product/models/product_pricelist_item.py b/addons/product/models/product_pricelist_item.py
index 5da109d24fe07..ae8b2741df486 100644
--- a/addons/product/models/product_pricelist_item.py
+++ b/addons/product/models/product_pricelist_item.py
@@ -5,8 +5,7 @@
from odoo.tools import format_amount, format_datetime, formatLang
-class PricelistItem(models.Model):
- _name = "product.pricelist.item"
+class ProductPricelistItem(models.Model):
_description = "Pricelist Rule"
_order = "applied_on, min_quantity desc, categ_id desc, id desc"
_check_company_auto = True
diff --git a/addons/product/models/product_product.py b/addons/product/models/product_product.py
index 134327a5f77e1..889b656ff3fcb 100644
--- a/addons/product/models/product_product.py
+++ b/addons/product/models/product_product.py
@@ -13,7 +13,6 @@
class ProductProduct(models.Model):
- _name = "product.product"
_description = "Product Variant"
_inherits = {'product.template': 'product_tmpl_id'}
_inherit = ['mail.thread', 'mail.activity.mixin']
diff --git a/addons/product/models/product_supplierinfo.py b/addons/product/models/product_supplierinfo.py
index 6bf474a2bfac4..f65e61266bedc 100644
--- a/addons/product/models/product_supplierinfo.py
+++ b/addons/product/models/product_supplierinfo.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, _
-class SupplierInfo(models.Model):
- _name = "product.supplierinfo"
+class ProductSupplierinfo(models.Model):
_description = "Supplier Pricelist"
_order = 'sequence, min_qty DESC, price, id'
_rec_name = 'partner_id'
diff --git a/addons/product/models/product_tag.py b/addons/product/models/product_tag.py
index cba69a0f75f4d..660f20b1a6031 100644
--- a/addons/product/models/product_tag.py
+++ b/addons/product/models/product_tag.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
from odoo.osv import expression
+
class ProductTag(models.Model):
- _name = 'product.tag'
_description = 'Product Tag'
_order = 'sequence, id'
diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py
index 48f6a640d0147..fab966aa2a90a 100644
--- a/addons/product/models/product_template.py
+++ b/addons/product/models/product_template.py
@@ -15,7 +15,6 @@
class ProductTemplate(models.Model):
- _name = "product.template"
_inherit = ['mail.thread', 'mail.activity.mixin', 'image.mixin']
_description = "Product"
_order = "is_favorite desc, name"
diff --git a/addons/product/models/product_template_attribute_exclusion.py b/addons/product/models/product_template_attribute_exclusion.py
index e4f31a053b99d..b548b129b23b5 100644
--- a/addons/product/models/product_template_attribute_exclusion.py
+++ b/addons/product/models/product_template_attribute_exclusion.py
@@ -4,7 +4,6 @@
class ProductTemplateAttributeExclusion(models.Model):
- _name = 'product.template.attribute.exclusion'
_description = "Product Template Attribute Exclusion"
_order = 'product_tmpl_id, id'
diff --git a/addons/product/models/product_template_attribute_line.py b/addons/product/models/product_template_attribute_line.py
index 7b5691cda0e84..9bb0ef94539fd 100644
--- a/addons/product/models/product_template_attribute_line.py
+++ b/addons/product/models/product_template_attribute_line.py
@@ -9,7 +9,6 @@ class ProductTemplateAttributeLine(models.Model):
"""Attributes available on product.template with their selected values in a m2m.
Used as a configuration model to generate the appropriate product.template.attribute.value"""
- _name = 'product.template.attribute.line'
_rec_name = 'attribute_id'
_rec_names_search = ['attribute_id', 'value_ids']
_description = "Product Template Attribute Line"
diff --git a/addons/product/models/product_template_attribute_value.py b/addons/product/models/product_template_attribute_value.py
index 235bdcc710614..5bef41b20cd65 100644
--- a/addons/product/models/product_template_attribute_value.py
+++ b/addons/product/models/product_template_attribute_value.py
@@ -11,7 +11,6 @@ class ProductTemplateAttributeValue(models.Model):
"""Materialized relationship between attribute values
and product template generated by the product.template.attribute.line"""
- _name = 'product.template.attribute.value'
_description = "Product Template Attribute Value"
_order = 'attribute_line_id, product_attribute_value_id, id'
diff --git a/addons/product/models/res_company.py b/addons/product/models/res_company.py
index d922c96861cc0..7c61611181e63 100644
--- a/addons/product/models/res_company.py
+++ b/addons/product/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/product/models/res_config_settings.py b/addons/product/models/res_config_settings.py
index 6af454dc68248..6c9bdde80eb3a 100644
--- a/addons/product/models/res_config_settings.py
+++ b/addons/product/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
group_uom = fields.Boolean("Units of Measure", implied_group='uom.group_uom')
group_product_variant = fields.Boolean("Variants", implied_group='product.group_product_variant')
diff --git a/addons/product/models/res_country_group.py b/addons/product/models/res_country_group.py
index 403189e962b69..b1b6bdb703d16 100644
--- a/addons/product/models/res_country_group.py
+++ b/addons/product/models/res_country_group.py
@@ -5,7 +5,7 @@
class ResCountryGroup(models.Model):
- _inherit = 'res.country.group'
+ _inherit = ['res.country.group']
pricelist_ids = fields.Many2many(
comodel_name='product.pricelist',
diff --git a/addons/product/models/res_currency.py b/addons/product/models/res_currency.py
index 3d8f25ab55502..2c71c4dd9c5f4 100644
--- a/addons/product/models/res_currency.py
+++ b/addons/product/models/res_currency.py
@@ -5,7 +5,7 @@
class ResCurrency(models.Model):
- _inherit = 'res.currency'
+ _inherit = ['res.currency']
def _activate_group_multi_currency(self):
# for Sale/ POS - Multi currency flows require pricelists
diff --git a/addons/product/models/res_partner.py b/addons/product/models/res_partner.py
index 5db74543c63c8..87928e6bfcbf3 100644
--- a/addons/product/models/res_partner.py
+++ b/addons/product/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
# when the specific_property_product_pricelist is not defined
# the fallback value may be computed with 2 ir.config_parameter
diff --git a/addons/product/models/uom_uom.py b/addons/product/models/uom_uom.py
index 1d65c64a17686..4611213cad511 100644
--- a/addons/product/models/uom_uom.py
+++ b/addons/product/models/uom_uom.py
@@ -4,8 +4,8 @@
from odoo import api, models, _
-class UoM(models.Model):
- _inherit = 'uom.uom'
+class UomUom(models.Model):
+ _inherit = ['uom.uom']
@api.onchange('rounding')
def _onchange_rounding(self):
diff --git a/addons/product/report/product_label_report.py b/addons/product/report/product_label_report.py
index 31bf0aa088889..7d245172b6592 100644
--- a/addons/product/report/product_label_report.py
+++ b/addons/product/report/product_label_report.py
@@ -58,40 +58,35 @@ def _prepare_data(env, docids, data):
}
-class ReportProductTemplateLabel2x7(models.AbstractModel):
- _name = 'report.product.report_producttemplatelabel2x7'
+class ReportProductReport_Producttemplatelabel2x7(models.AbstractModel):
_description = 'Product Label Report 2x7'
def _get_report_values(self, docids, data):
return _prepare_data(self.env, docids, data)
-class ReportProductTemplateLabel4x7(models.AbstractModel):
- _name = 'report.product.report_producttemplatelabel4x7'
+class ReportProductReport_Producttemplatelabel4x7(models.AbstractModel):
_description = 'Product Label Report 4x7'
def _get_report_values(self, docids, data):
return _prepare_data(self.env, docids, data)
-class ReportProductTemplateLabel4x12(models.AbstractModel):
- _name = 'report.product.report_producttemplatelabel4x12'
+class ReportProductReport_Producttemplatelabel4x12(models.AbstractModel):
_description = 'Product Label Report 4x12'
def _get_report_values(self, docids, data):
return _prepare_data(self.env, docids, data)
-class ReportProductTemplateLabel4x12NoPrice(models.AbstractModel):
- _name = 'report.product.report_producttemplatelabel4x12noprice'
+class ReportProductReport_Producttemplatelabel4x12noprice(models.AbstractModel):
_description = 'Product Label Report 4x12 No Price'
def _get_report_values(self, docids, data):
return _prepare_data(self.env, docids, data)
-class ReportProductTemplateLabelDymo(models.AbstractModel):
- _name = 'report.product.report_producttemplatelabel_dymo'
+class ReportProductReport_Producttemplatelabel_Dymo(models.AbstractModel):
_description = 'Product Label Report'
def _get_report_values(self, docids, data):
diff --git a/addons/product/report/product_pricelist_report.py b/addons/product/report/product_pricelist_report.py
index c6ea5dca17201..30cd3014e3924 100644
--- a/addons/product/report/product_pricelist_report.py
+++ b/addons/product/report/product_pricelist_report.py
@@ -3,8 +3,7 @@
from odoo import api, models
-class ProductPricelistReport(models.AbstractModel):
- _name = 'report.product.report_pricelist'
+class ReportProductReport_Pricelist(models.AbstractModel):
_description = 'Pricelist Report'
def _get_report_values(self, docids, data):
diff --git a/addons/product/wizard/product_label_layout.py b/addons/product/wizard/product_label_layout.py
index a97c68c7791ae..31ec3588a94ab 100644
--- a/addons/product/wizard/product_label_layout.py
+++ b/addons/product/wizard/product_label_layout.py
@@ -7,7 +7,6 @@
class ProductLabelLayout(models.TransientModel):
- _name = 'product.label.layout'
_description = 'Choose the sheet layout to print the labels'
print_format = fields.Selection([
diff --git a/addons/product/wizard/update_product_attribute_value.py b/addons/product/wizard/update_product_attribute_value.py
index ea2993cf1740e..a599f1231d143 100644
--- a/addons/product/wizard/update_product_attribute_value.py
+++ b/addons/product/wizard/update_product_attribute_value.py
@@ -5,7 +5,6 @@
class UpdateProductAttributeValue(models.TransientModel):
- _name = 'update.product.attribute.value'
_description = "Update product attribute value"
attribute_value_id = fields.Many2one('product.attribute.value', required=True)
diff --git a/addons/product_email_template/models/account_move.py b/addons/product_email_template/models/account_move.py
index 798b650f6dcff..aa0892f6434a9 100644
--- a/addons/product_email_template/models/account_move.py
+++ b/addons/product_email_template/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def invoice_validate_send_email(self):
if self.env.su:
diff --git a/addons/product_email_template/models/product.py b/addons/product_email_template/models/product.py
index e043717e6e840..b7bb423568986 100644
--- a/addons/product_email_template/models/product.py
+++ b/addons/product_email_template/models/product.py
@@ -8,7 +8,7 @@ class ProductTemplate(models.Model):
product.template. When validating an invoice, an email will be send to the
customer based on this template. The customer will receive an email for each
product linked to an email template. """
- _inherit = "product.template"
+ _inherit = ["product.template"]
email_template_id = fields.Many2one('mail.template', string='Product Email Template',
help='When validating an invoice, an email will be sent to the customer '
diff --git a/addons/product_expiry/models/product_product.py b/addons/product_expiry/models/product_product.py
index 621461eaa329c..6809d0880c26b 100644
--- a/addons/product_expiry/models/product_product.py
+++ b/addons/product_expiry/models/product_product.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class Product(models.Model):
- _inherit = "product.product"
+class ProductProduct(models.Model):
+ _inherit = ["product.product"]
def action_open_quants(self):
# Override to hide the `removal_date` column if not needed.
@@ -15,7 +15,7 @@ def action_open_quants(self):
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
use_expiration_date = fields.Boolean(string='Use Expiration Date',
help='When this box is ticked, you have the possibility to specify dates to manage'
diff --git a/addons/product_expiry/models/production_lot.py b/addons/product_expiry/models/production_lot.py
index 65b26978ac04e..d5fef0779bf52 100644
--- a/addons/product_expiry/models/production_lot.py
+++ b/addons/product_expiry/models/production_lot.py
@@ -5,7 +5,7 @@
class StockLot(models.Model):
- _inherit = 'stock.lot'
+ _inherit = ['stock.lot']
use_expiration_date = fields.Boolean(
string='Use Expiration Date', related='product_id.use_expiration_date')
@@ -90,7 +90,7 @@ def _alert_date_exceeded(self):
class ProcurementGroup(models.Model):
- _inherit = 'procurement.group'
+ _inherit = ['procurement.group']
@api.model
def _run_scheduler_tasks(self, use_new_cursor=False, company_id=False):
diff --git a/addons/product_expiry/models/res_config_settings.py b/addons/product_expiry/models/res_config_settings.py
index 1c7c2503b55b9..61f6187e3a9ca 100644
--- a/addons/product_expiry/models/res_config_settings.py
+++ b/addons/product_expiry/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
group_expiry_date_on_delivery_slip = fields.Boolean("Display Expiration Dates on Delivery Slips",
implied_group='product_expiry.group_expiry_date_on_delivery_slip')
diff --git a/addons/product_expiry/models/stock_move.py b/addons/product_expiry/models/stock_move.py
index 7304b3e102e22..2c2abb6d849ef 100644
--- a/addons/product_expiry/models/stock_move.py
+++ b/addons/product_expiry/models/stock_move.py
@@ -10,7 +10,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
use_expiration_date = fields.Boolean(
string='Use Expiration Date', related='product_id.use_expiration_date')
diff --git a/addons/product_expiry/models/stock_move_line.py b/addons/product_expiry/models/stock_move_line.py
index e428b9a902506..f4961bf7f074a 100644
--- a/addons/product_expiry/models/stock_move_line.py
+++ b/addons/product_expiry/models/stock_move_line.py
@@ -8,7 +8,7 @@
class StockMoveLine(models.Model):
- _inherit = "stock.move.line"
+ _inherit = ["stock.move.line"]
expiration_date = fields.Datetime(
string='Expiration Date', compute='_compute_expiration_date', store=True,
diff --git a/addons/product_expiry/models/stock_picking.py b/addons/product_expiry/models/stock_picking.py
index ede0ba564624a..64238e3aed034 100644
--- a/addons/product_expiry/models/stock_picking.py
+++ b/addons/product_expiry/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = "stock.picking"
+ _inherit = ["stock.picking"]
def _pre_action_done_hook(self):
res = super()._pre_action_done_hook()
diff --git a/addons/product_expiry/models/stock_quant.py b/addons/product_expiry/models/stock_quant.py
index 677e4a7795610..a06472ec9e198 100644
--- a/addons/product_expiry/models/stock_quant.py
+++ b/addons/product_expiry/models/stock_quant.py
@@ -5,7 +5,7 @@
class StockQuant(models.Model):
- _inherit = 'stock.quant'
+ _inherit = ['stock.quant']
expiration_date = fields.Datetime(related='lot_id.expiration_date', store=True)
removal_date = fields.Datetime(related='lot_id.removal_date', store=True)
diff --git a/addons/product_expiry/wizard/confirm_expiry.py b/addons/product_expiry/wizard/confirm_expiry.py
index f1cebfd689e67..1f3eaec217a89 100644
--- a/addons/product_expiry/wizard/confirm_expiry.py
+++ b/addons/product_expiry/wizard/confirm_expiry.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models, _
-class ConfirmExpiry(models.TransientModel):
- _name = 'expiry.picking.confirmation'
+class ExpiryPickingConfirmation(models.TransientModel):
_description = 'Confirm Expiry'
lot_ids = fields.Many2many('stock.lot', readonly=True, required=True)
diff --git a/addons/product_images/models/ir_cron_trigger.py b/addons/product_images/models/ir_cron_trigger.py
index f13e4c0dbd463..83c30cd40516f 100644
--- a/addons/product_images/models/ir_cron_trigger.py
+++ b/addons/product_images/models/ir_cron_trigger.py
@@ -5,7 +5,7 @@
class IrCronTrigger(models.Model):
- _inherit = 'ir.cron.trigger'
+ _inherit = ['ir.cron.trigger']
@api.constrains('cron_id')
def _check_image_cron_is_not_already_triggered(self):
diff --git a/addons/product_images/models/product.py b/addons/product_images/models/product.py
index 5fae9ea01ada3..b7544dbb8b137 100644
--- a/addons/product_images/models/product.py
+++ b/addons/product_images/models/product.py
@@ -4,7 +4,7 @@
class ProductProduct(models.Model):
- _inherit = "product.product"
+ _inherit = ["product.product"]
image_fetch_pending = fields.Boolean(
help="Whether an image must be fetched for this product. Handled by a cron.",
diff --git a/addons/product_images/models/res_config_settings.py b/addons/product_images/models/res_config_settings.py
index 79bce568b16c3..6dce0a3d30a4c 100644
--- a/addons/product_images/models/res_config_settings.py
+++ b/addons/product_images/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
google_custom_search_key = fields.Char(
string="Google Custom Search API Key",
diff --git a/addons/product_images/wizard/product_fetch_image_wizard.py b/addons/product_images/wizard/product_fetch_image_wizard.py
index abf0cf01b8fa6..617278cf7cfcc 100644
--- a/addons/product_images/wizard/product_fetch_image_wizard.py
+++ b/addons/product_images/wizard/product_fetch_image_wizard.py
@@ -14,7 +14,6 @@
class ProductFetchImageWizard(models.TransientModel):
- _name = 'product.fetch.image.wizard'
_description = "Fetch product images from Google Images based on the product's barcode number."
_session = requests.Session()
diff --git a/addons/product_margin/models/product_product.py b/addons/product_margin/models/product_product.py
index 38de4af06730f..382a28d26f89c 100644
--- a/addons/product_margin/models/product_product.py
+++ b/addons/product_margin/models/product_product.py
@@ -9,7 +9,7 @@
class ProductProduct(models.Model):
- _inherit = "product.product"
+ _inherit = ["product.product"]
date_from = fields.Date(compute='_compute_product_margin_fields_values', string='Margin Date From')
date_to = fields.Date(compute='_compute_product_margin_fields_values', string='Margin Date To')
diff --git a/addons/product_margin/wizard/product_margin.py b/addons/product_margin/wizard/product_margin.py
index bea1f0ed43354..d0cbd705f1608 100644
--- a/addons/product_margin/wizard/product_margin.py
+++ b/addons/product_margin/wizard/product_margin.py
@@ -7,7 +7,6 @@
class ProductMargin(models.TransientModel):
- _name = 'product.margin'
_description = 'Product Margin'
from_date = fields.Date('From', default=time.strftime('%Y-01-01'))
diff --git a/addons/product_matrix/models/product_template.py b/addons/product_matrix/models/product_template.py
index 11681a8fe4532..2945706105908 100644
--- a/addons/product_matrix/models/product_template.py
+++ b/addons/product_matrix/models/product_template.py
@@ -6,7 +6,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
def _get_template_matrix(self, **kwargs):
self.ensure_one()
@@ -61,7 +61,7 @@ def _get_template_matrix(self, **kwargs):
class ProductTemplateAttributeValue(models.Model):
- _inherit = "product.template.attribute.value"
+ _inherit = ["product.template.attribute.value"]
def _grid_header_cell(self, fro_currency, to_currency, company, display_extra=True):
"""Generate a header matrix cell for 1 or multiple attributes.
diff --git a/addons/project/models/account_analytic_account.py b/addons/project/models/account_analytic_account.py
index f5f9c8c4aa0cf..7d95a208feb36 100644
--- a/addons/project/models/account_analytic_account.py
+++ b/addons/project/models/account_analytic_account.py
@@ -6,7 +6,7 @@
class AccountAnalyticAccount(models.Model):
- _inherit = 'account.analytic.account'
+ _inherit = ['account.analytic.account']
_description = 'Analytic Account'
project_ids = fields.One2many('project.project', 'account_id', string='Projects', export_string_translation=False)
diff --git a/addons/project/models/digest_digest.py b/addons/project/models/digest_digest.py
index 160835f8f7a96..f9cf09874b432 100644
--- a/addons/project/models/digest_digest.py
+++ b/addons/project/models/digest_digest.py
@@ -5,8 +5,8 @@
from odoo.exceptions import AccessError
-class Digest(models.Model):
- _inherit = 'digest.digest'
+class DigestDigest(models.Model):
+ _inherit = ['digest.digest']
kpi_project_task_opened = fields.Boolean('Open Tasks')
kpi_project_task_opened_value = fields.Integer(compute='_compute_project_task_opened_value', export_string_translation=False)
diff --git a/addons/project/models/ir_ui_menu.py b/addons/project/models/ir_ui_menu.py
index e3b162ffe5349..0d114ad773667 100644
--- a/addons/project/models/ir_ui_menu.py
+++ b/addons/project/models/ir_ui_menu.py
@@ -5,7 +5,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
def _load_menus_blacklist(self):
res = super()._load_menus_blacklist()
diff --git a/addons/project/models/mail_message.py b/addons/project/models/mail_message.py
index 009564854f376..a7d933861baa5 100644
--- a/addons/project/models/mail_message.py
+++ b/addons/project/models/mail_message.py
@@ -5,7 +5,7 @@
class MailMessage(models.Model):
- _inherit = 'mail.message'
+ _inherit = ['mail.message']
def init(self):
super().init()
diff --git a/addons/project/models/project_collaborator.py b/addons/project/models/project_collaborator.py
index 47010ca4680b0..99e23f3cced8e 100644
--- a/addons/project/models/project_collaborator.py
+++ b/addons/project/models/project_collaborator.py
@@ -4,7 +4,6 @@
class ProjectCollaborator(models.Model):
- _name = 'project.collaborator'
_description = 'Collaborators in project shared'
project_id = fields.Many2one('project.project', 'Project Shared', domain=[('privacy_visibility', '=', 'portal')], required=True, readonly=True, export_string_translation=False)
diff --git a/addons/project/models/project_milestone.py b/addons/project/models/project_milestone.py
index 392ac12ca10bc..9296ff69a19a8 100644
--- a/addons/project/models/project_milestone.py
+++ b/addons/project/models/project_milestone.py
@@ -8,8 +8,8 @@
from .project_task import CLOSED_STATES
+
class ProjectMilestone(models.Model):
- _name = 'project.milestone'
_description = "Project Milestone"
_inherit = ['mail.thread']
_order = 'sequence, deadline, is_reached desc, name'
diff --git a/addons/project/models/project_project.py b/addons/project/models/project_project.py
index d134bfe3cbdb1..44693dbe51406 100644
--- a/addons/project/models/project_project.py
+++ b/addons/project/models/project_project.py
@@ -16,8 +16,7 @@
from .project_task import CLOSED_STATES
-class Project(models.Model):
- _name = "project.project"
+class ProjectProject(models.Model):
_description = "Project"
_inherit = [
'portal.mixin',
@@ -428,7 +427,7 @@ def copy(self, default=None):
default = dict(default or {})
# Since we dont want to copy the milestones if the original project has the feature disabled, we set the milestones to False by default.
default['milestone_ids'] = False
- new_projects = super(Project, self.with_context(mail_auto_subscribe_no_notify=True, mail_create_nosubscribe=True)).copy(default=default)
+ new_projects = super(ProjectProject, self.with_context(mail_auto_subscribe_no_notify=True, mail_create_nosubscribe=True)).copy(default=default)
if 'milestone_mapping' not in self.env.context:
self = self.with_context(milestone_mapping={})
actions_per_project = dict(self.env['ir.embedded.actions']._read_group(
diff --git a/addons/project/models/project_project_stage.py b/addons/project/models/project_project_stage.py
index 148847cf1f2de..eb49c6ec2c750 100644
--- a/addons/project/models/project_project_stage.py
+++ b/addons/project/models/project_project_stage.py
@@ -4,8 +4,8 @@
from odoo import fields, models, _
from odoo.exceptions import UserError
+
class ProjectProjectStage(models.Model):
- _name = 'project.project.stage'
_description = 'Project Stage'
_order = 'sequence, id'
diff --git a/addons/project/models/project_tags.py b/addons/project/models/project_tags.py
index db36275001826..c662e84c29de2 100644
--- a/addons/project/models/project_tags.py
+++ b/addons/project/models/project_tags.py
@@ -10,7 +10,6 @@
class ProjectTags(models.Model):
""" Tags of project's tasks """
- _name = "project.tags"
_description = "Project Tags"
_order = "name"
diff --git a/addons/project/models/project_task.py b/addons/project/models/project_task.py
index 981246178df9b..5da34506dc392 100644
--- a/addons/project/models/project_task.py
+++ b/addons/project/models/project_task.py
@@ -79,8 +79,7 @@
}
-class Task(models.Model):
- _name = "project.task"
+class ProjectTask(models.Model):
_description = "Task"
_date_name = "date_assign"
_inherit = [
@@ -98,7 +97,7 @@ class Task(models.Model):
_track_duration_field = 'stage_id'
def _get_versioned_fields(self):
- return [Task.description.name]
+ return [ProjectTask.description.name]
@api.model
def _get_default_partner_id(self, project=None, parent=None):
@@ -847,7 +846,7 @@ def copy(self, default=None):
'depend_on_ids': False,
'dependent_ids': False,
})
- copied_tasks = super(Task, self.with_context(
+ copied_tasks = super(ProjectTask, self.with_context(
mail_auto_subscribe_no_notify=True,
mail_create_nosubscribe=True,
mail_create_nolog=True,
@@ -1120,7 +1119,7 @@ def create(self, vals_list):
if is_portal_user:
vals_list_no_sudo, vals_list = zip(*(self._get_portal_sudo_vals(vals, defaults=True) for vals in vals_list))
self_no_sudo, self = self, self.sudo().with_context(self._get_portal_sudo_context())
- tasks = super(Task, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
+ tasks = super(ProjectTask, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
if is_portal_user:
for task, vals in zip(tasks.with_env(self_no_sudo.env), vals_list_no_sudo):
task.write(vals)
@@ -1276,7 +1275,7 @@ def write(self, vals):
project_link_per_task_id[task.id] = project_link
result = super().write(vals)
if portal_can_write:
- super(Task, self_no_sudo).write(vals_no_sudo)
+ super(ProjectTask, self_no_sudo).write(vals_no_sudo)
if 'user_ids' in vals:
self._populate_missing_personal_stages()
@@ -1614,7 +1613,7 @@ def _notify_get_reply_to(self, default=None):
res = {task.id: aliases.get(task.project_id.id) for task in self}
leftover = self.filtered(lambda rec: not rec.project_id)
if leftover:
- res.update(super(Task, leftover)._notify_get_reply_to(default=default))
+ res.update(super(ProjectTask, leftover)._notify_get_reply_to(default=default))
return res
def _ensure_personal_stages(self):
@@ -1660,7 +1659,7 @@ def message_new(self, msg, custom_values=None):
}
defaults.update(custom_values)
- task = super(Task, self.with_context(create_context)).message_new(msg, custom_values=defaults)
+ task = super(ProjectTask, self.with_context(create_context)).message_new(msg, custom_values=defaults)
email_list = task.email_split(msg)
partner_ids = [p.id for p in self.env['mail.thread']._mail_find_partner_from_emails(email_list, records=task, force_create=False) if p]
task.message_subscribe(partner_ids)
diff --git a/addons/project/models/project_task_recurrence.py b/addons/project/models/project_task_recurrence.py
index 146c017ae0e9b..d8b5ed32612b8 100644
--- a/addons/project/models/project_task_recurrence.py
+++ b/addons/project/models/project_task_recurrence.py
@@ -6,8 +6,8 @@
from dateutil.relativedelta import relativedelta
+
class ProjectTaskRecurrence(models.Model):
- _name = 'project.task.recurrence'
_description = 'Task Recurrence'
task_ids = fields.One2many('project.task', 'recurrence_id', copy=False)
diff --git a/addons/project/models/project_task_stage_personal.py b/addons/project/models/project_task_stage_personal.py
index 5331bfe9ba3f4..ba8bc9fbe8d59 100644
--- a/addons/project/models/project_task_stage_personal.py
+++ b/addons/project/models/project_task_stage_personal.py
@@ -3,8 +3,8 @@
from odoo import fields, models
+
class ProjectTaskStagePersonal(models.Model):
- _name = 'project.task.stage.personal'
_description = 'Personal Task Stage'
_table = 'project_task_user_rel'
_rec_name = 'stage_id'
diff --git a/addons/project/models/project_task_type.py b/addons/project/models/project_task_type.py
index b2078fc68ebe7..29e618353e15c 100644
--- a/addons/project/models/project_task_type.py
+++ b/addons/project/models/project_task_type.py
@@ -8,7 +8,6 @@
class ProjectTaskType(models.Model):
- _name = 'project.task.type'
_description = 'Task Stage'
_order = 'sequence, id'
diff --git a/addons/project/models/project_update.py b/addons/project/models/project_update.py
index 04808d7e52010..36a159aee23a6 100644
--- a/addons/project/models/project_update.py
+++ b/addons/project/models/project_update.py
@@ -20,8 +20,8 @@
'to_define': 0,
}
+
class ProjectUpdate(models.Model):
- _name = 'project.update'
_description = 'Project Update'
_order = 'id desc'
_inherit = ['mail.thread.cc', 'mail.activity.mixin']
diff --git a/addons/project/models/res_config_settings.py b/addons/project/models/res_config_settings.py
index f38fba8205fed..3b956e970f52e 100644
--- a/addons/project/models/res_config_settings.py
+++ b/addons/project/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
module_hr_timesheet = fields.Boolean(string="Task Logs")
group_project_rating = fields.Boolean("Customer Ratings", implied_group='project.group_project_rating')
diff --git a/addons/project/models/res_partner.py b/addons/project/models/res_partner.py
index 7d24d3861f5a4..59d936f50672e 100644
--- a/addons/project/models/res_partner.py
+++ b/addons/project/models/res_partner.py
@@ -8,7 +8,7 @@
class ResPartner(models.Model):
""" Inherits partner and adds Tasks information in the partner form """
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
project_ids = fields.One2many('project.project', 'partner_id', string='Projects', export_string_translation=False)
task_ids = fields.One2many('project.task', 'partner_id', string='Tasks', export_string_translation=False)
diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py
index c8cfcf4b70983..2b259bfd5915e 100644
--- a/addons/project/report/project_report.py
+++ b/addons/project/report/project_report.py
@@ -5,8 +5,8 @@
from odoo.addons.rating.models.rating_data import RATING_LIMIT_MIN, RATING_TEXT
+
class ReportProjectTaskUser(models.Model):
- _name = "report.project.task.user"
_description = "Tasks Analysis"
_order = 'name desc, project_id'
_auto = False
diff --git a/addons/project/report/project_task_burndown_chart_report.py b/addons/project/report/project_task_burndown_chart_report.py
index f144a1a52a255..f2a26ddc86262 100644
--- a/addons/project/report/project_task_burndown_chart_report.py
+++ b/addons/project/report/project_task_burndown_chart_report.py
@@ -7,8 +7,7 @@
from odoo.addons.resource.models.utils import filter_domain_leaf
-class ReportProjectTaskBurndownChart(models.AbstractModel):
- _name = 'project.task.burndown.chart.report'
+class ProjectTaskBurndownChartReport(models.AbstractModel):
_description = 'Burndown Chart'
_auto = False
_order = 'date'
diff --git a/addons/project/wizard/project_project_stage_delete.py b/addons/project/wizard/project_project_stage_delete.py
index e18b816dbb23b..1a2888dfa811a 100644
--- a/addons/project/wizard/project_project_stage_delete.py
+++ b/addons/project/wizard/project_project_stage_delete.py
@@ -4,8 +4,8 @@
from ast import literal_eval
from odoo import api, fields, models
-class ProjectStageDelete(models.TransientModel):
- _name = 'project.project.stage.delete.wizard'
+
+class ProjectProjectStageDeleteWizard(models.TransientModel):
_description = 'Project Stage Delete Wizard'
stage_ids = fields.Many2many('project.project.stage', string='Stages To Delete', ondelete='cascade', context={'active_test': False}, export_string_translation=False)
diff --git a/addons/project/wizard/project_share_collaborator_wizard.py b/addons/project/wizard/project_share_collaborator_wizard.py
index 6f388648e2010..68555a3047cf4 100644
--- a/addons/project/wizard/project_share_collaborator_wizard.py
+++ b/addons/project/wizard/project_share_collaborator_wizard.py
@@ -3,8 +3,7 @@
from odoo import api, fields, models
-class ProjectSharingCollaboratorWizard(models.TransientModel):
- _name = 'project.share.collaborator.wizard'
+class ProjectShareCollaboratorWizard(models.TransientModel):
_description = 'Project Sharing Collaborator Wizard'
parent_wizard_id = fields.Many2one(
diff --git a/addons/project/wizard/project_share_wizard.py b/addons/project/wizard/project_share_wizard.py
index 16988d28ad8cf..30155557445ec 100644
--- a/addons/project/wizard/project_share_wizard.py
+++ b/addons/project/wizard/project_share_wizard.py
@@ -6,8 +6,7 @@
class ProjectShareWizard(models.TransientModel):
- _name = 'project.share.wizard'
- _inherit = 'portal.share'
+ _inherit = ['portal.share']
_description = 'Project Sharing'
@api.model
diff --git a/addons/project/wizard/project_task_type_delete.py b/addons/project/wizard/project_task_type_delete.py
index 63f7bbf543d09..5c24867402840 100644
--- a/addons/project/wizard/project_task_type_delete.py
+++ b/addons/project/wizard/project_task_type_delete.py
@@ -5,8 +5,7 @@
from ast import literal_eval
-class ProjectTaskTypeDelete(models.TransientModel):
- _name = 'project.task.type.delete.wizard'
+class ProjectTaskTypeDeleteWizard(models.TransientModel):
_description = 'Project Task Stage Delete Wizard'
project_ids = fields.Many2many('project.project', domain="['|', ('active', '=', False), ('active', '=', True)]", string='Projects', ondelete='cascade', export_string_translation=False)
diff --git a/addons/project_account/models/project_project.py b/addons/project_account/models/project_project.py
index f76f19994be13..3df6e5b9cf93f 100644
--- a/addons/project_account/models/project_project.py
+++ b/addons/project_account/models/project_project.py
@@ -7,8 +7,8 @@
from odoo import models
-class Project(models.Model):
- _inherit = 'project.project'
+class ProjectProject(models.Model):
+ _inherit = ['project.project']
def _add_purchase_items(self, profitability_items, with_action=True):
domain = self._get_add_purchase_items_domain()
diff --git a/addons/project_hr_expense/models/hr_expense.py b/addons/project_hr_expense/models/hr_expense.py
index da27d56e84279..4f7ad9cd72c2c 100644
--- a/addons/project_hr_expense/models/hr_expense.py
+++ b/addons/project_hr_expense/models/hr_expense.py
@@ -2,7 +2,7 @@
class HrExpense(models.Model):
- _inherit = 'hr.expense'
+ _inherit = ['hr.expense']
def _compute_analytic_distribution(self):
project_id = self.env.context.get('project_id')
diff --git a/addons/project_hr_expense/models/project_project.py b/addons/project_hr_expense/models/project_project.py
index c53c7098aa9f6..d99874eb95c81 100644
--- a/addons/project_hr_expense/models/project_project.py
+++ b/addons/project_hr_expense/models/project_project.py
@@ -6,8 +6,8 @@
from odoo.osv import expression
-class Project(models.Model):
- _inherit = 'project.project'
+class ProjectProject(models.Model):
+ _inherit = ['project.project']
# ----------------------------
# Actions
diff --git a/addons/project_hr_skills/models/project_task.py b/addons/project_hr_skills/models/project_task.py
index 5e4b51ea6cdbe..a879e942ad018 100644
--- a/addons/project_hr_skills/models/project_task.py
+++ b/addons/project_hr_skills/models/project_task.py
@@ -2,7 +2,8 @@
from odoo import fields, models
+
class ProjectTask(models.Model):
- _inherit = "project.task"
+ _inherit = ["project.task"]
user_skill_ids = fields.One2many('hr.employee.skill', related='user_ids.employee_skill_ids')
diff --git a/addons/project_hr_skills/report/report_project_task_user.py b/addons/project_hr_skills/report/report_project_task_user.py
index 9236813d8813c..092d040fa0ba1 100644
--- a/addons/project_hr_skills/report/report_project_task_user.py
+++ b/addons/project_hr_skills/report/report_project_task_user.py
@@ -2,7 +2,8 @@
from odoo import fields, models
+
class ReportProjectTaskUser(models.Model):
- _inherit = 'report.project.task.user'
+ _inherit = ['report.project.task.user']
user_skill_ids = fields.One2many('hr.employee.skill', related='user_ids.employee_skill_ids', string='Skills')
diff --git a/addons/project_mrp/models/mrp_bom.py b/addons/project_mrp/models/mrp_bom.py
index 33451c63bfc5c..cfcc713adbae8 100644
--- a/addons/project_mrp/models/mrp_bom.py
+++ b/addons/project_mrp/models/mrp_bom.py
@@ -4,6 +4,6 @@
class MrpBom(models.Model):
- _inherit = 'mrp.bom'
+ _inherit = ['mrp.bom']
project_id = fields.Many2one('project.project')
diff --git a/addons/project_mrp/models/mrp_production.py b/addons/project_mrp/models/mrp_production.py
index c3c3a933a1c8f..568e3c786978c 100644
--- a/addons/project_mrp/models/mrp_production.py
+++ b/addons/project_mrp/models/mrp_production.py
@@ -4,7 +4,7 @@
class MrpProduction(models.Model):
- _inherit = 'mrp.production'
+ _inherit = ['mrp.production']
project_id = fields.Many2one('project.project', compute='_compute_project_id', readonly=False, store=True)
diff --git a/addons/project_mrp/models/project_project.py b/addons/project_mrp/models/project_project.py
index fb79ca3782b41..f8a82b3e856fc 100644
--- a/addons/project_mrp/models/project_project.py
+++ b/addons/project_mrp/models/project_project.py
@@ -4,7 +4,7 @@
class ProjectProject(models.Model):
- _inherit = 'project.project'
+ _inherit = ['project.project']
bom_count = fields.Integer(compute='_compute_bom_count', groups='mrp.group_mrp_user', export_string_translation=False)
production_count = fields.Integer(compute='_compute_production_count', groups='mrp.group_mrp_user', export_string_translation=False)
diff --git a/addons/project_mrp_account/models/mrp_production.py b/addons/project_mrp_account/models/mrp_production.py
index 378942c72f21f..bb698424825d7 100644
--- a/addons/project_mrp_account/models/mrp_production.py
+++ b/addons/project_mrp_account/models/mrp_production.py
@@ -4,7 +4,7 @@
class MrpProduction(models.Model):
- _inherit = 'mrp.production'
+ _inherit = ['mrp.production']
has_analytic_account = fields.Boolean(compute='_compute_has_analytic_account')
diff --git a/addons/project_mrp_account/models/mrp_workorder.py b/addons/project_mrp_account/models/mrp_workorder.py
index c6057c2b0d54e..d3dc0affde204 100644
--- a/addons/project_mrp_account/models/mrp_workorder.py
+++ b/addons/project_mrp_account/models/mrp_workorder.py
@@ -4,7 +4,7 @@
class MrpWorkorder(models.Model):
- _inherit = 'mrp.workorder'
+ _inherit = ['mrp.workorder']
def _create_or_update_analytic_entry_for_record(self, value, hours):
super()._create_or_update_analytic_entry_for_record(value, hours)
diff --git a/addons/project_mrp_account/models/project_project.py b/addons/project_mrp_account/models/project_project.py
index 6aad8ef56147c..277f06a47c02f 100644
--- a/addons/project_mrp_account/models/project_project.py
+++ b/addons/project_mrp_account/models/project_project.py
@@ -4,8 +4,8 @@
from odoo.osv import expression
-class Project(models.Model):
- _inherit = "project.project"
+class ProjectProject(models.Model):
+ _inherit = ["project.project"]
# ----------------------------
# Project Updates
diff --git a/addons/project_mrp_account/models/stock_move.py b/addons/project_mrp_account/models/stock_move.py
index 6c8a89750949e..febdf46ab7463 100644
--- a/addons/project_mrp_account/models/stock_move.py
+++ b/addons/project_mrp_account/models/stock_move.py
@@ -6,7 +6,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _get_analytic_distribution(self):
distribution = self.raw_material_production_id.project_id._get_analytic_distribution()
diff --git a/addons/project_mrp_account/models/stock_rule.py b/addons/project_mrp_account/models/stock_rule.py
index 7a4e2327a25e4..584bfe20effd8 100644
--- a/addons/project_mrp_account/models/stock_rule.py
+++ b/addons/project_mrp_account/models/stock_rule.py
@@ -4,7 +4,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
def _prepare_mo_vals(self, product_id, product_qty, product_uom, location_id, name, origin, company_id, values, bom):
res = super()._prepare_mo_vals(product_id, product_qty, product_uom, location_id, name, origin, company_id, values, bom)
diff --git a/addons/project_mrp_sale/models/stock_move.py b/addons/project_mrp_sale/models/stock_move.py
index 904d9a1e3759d..988aa21b1b9d4 100644
--- a/addons/project_mrp_sale/models/stock_move.py
+++ b/addons/project_mrp_sale/models/stock_move.py
@@ -4,7 +4,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _prepare_procurement_values(self):
res = super()._prepare_procurement_values()
diff --git a/addons/project_mrp_stock_landed_costs/models/stock_landed_costs.py b/addons/project_mrp_stock_landed_costs/models/stock_landed_costs.py
index f3f5ce6379014..045d4ebae3cc9 100644
--- a/addons/project_mrp_stock_landed_costs/models/stock_landed_costs.py
+++ b/addons/project_mrp_stock_landed_costs/models/stock_landed_costs.py
@@ -3,8 +3,8 @@
from odoo import models
-class AdjustmentLines(models.Model):
- _inherit = 'stock.valuation.adjustment.lines'
+class StockValuationAdjustmentLines(models.Model):
+ _inherit = ['stock.valuation.adjustment.lines']
def _prepare_account_move_line_values(self):
res = super()._prepare_account_move_line_values()
diff --git a/addons/project_purchase/models/project_project.py b/addons/project_purchase/models/project_project.py
index ee994f4122ebd..3b3c3a75734f7 100644
--- a/addons/project_purchase/models/project_project.py
+++ b/addons/project_purchase/models/project_project.py
@@ -6,8 +6,8 @@
from odoo.osv import expression
-class Project(models.Model):
- _inherit = "project.project"
+class ProjectProject(models.Model):
+ _inherit = ["project.project"]
purchase_orders_count = fields.Integer('# Purchase Orders', compute='_compute_purchase_orders_count', groups='purchase.group_purchase_user', export_string_translation=False)
diff --git a/addons/project_purchase/models/purchase_order.py b/addons/project_purchase/models/purchase_order.py
index 12790ca9c92ff..f59b6d1bae038 100644
--- a/addons/project_purchase/models/purchase_order.py
+++ b/addons/project_purchase/models/purchase_order.py
@@ -4,6 +4,6 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
project_id = fields.Many2one('project.project')
diff --git a/addons/project_purchase/models/purchase_order_line.py b/addons/project_purchase/models/purchase_order_line.py
index 978d5cb874053..0e635bab7173e 100644
--- a/addons/project_purchase/models/purchase_order_line.py
+++ b/addons/project_purchase/models/purchase_order_line.py
@@ -4,7 +4,7 @@
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = ['purchase.order.line']
@api.depends('product_id', 'order_id.partner_id', 'order_id.project_id')
def _compute_analytic_distribution(self):
diff --git a/addons/project_purchase_stock/models/purchase_order.py b/addons/project_purchase_stock/models/purchase_order.py
index d981059733f0a..003e6744905aa 100644
--- a/addons/project_purchase_stock/models/purchase_order.py
+++ b/addons/project_purchase_stock/models/purchase_order.py
@@ -4,7 +4,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
def _prepare_picking(self):
res = super()._prepare_picking()
diff --git a/addons/project_sale_expense/models/account_move_line.py b/addons/project_sale_expense/models/account_move_line.py
index 04c6987433f35..72c563e3095e1 100644
--- a/addons/project_sale_expense/models/account_move_line.py
+++ b/addons/project_sale_expense/models/account_move_line.py
@@ -4,7 +4,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _sale_determine_order(self):
""" For move lines created from expense, we override the normal behavior.
diff --git a/addons/project_sale_expense/models/hr_expense.py b/addons/project_sale_expense/models/hr_expense.py
index 5d1de51b37ced..ff4382e51ecbd 100644
--- a/addons/project_sale_expense/models/hr_expense.py
+++ b/addons/project_sale_expense/models/hr_expense.py
@@ -3,8 +3,8 @@
from odoo import api, models
-class Expense(models.Model):
- _inherit = "hr.expense"
+class HrExpense(models.Model):
+ _inherit = ["hr.expense"]
@api.depends('sale_order_id')
def _compute_analytic_distribution(self):
diff --git a/addons/project_sale_expense/models/hr_expense_sheet.py b/addons/project_sale_expense/models/hr_expense_sheet.py
index e9dc57f26efd4..35083a860d02a 100644
--- a/addons/project_sale_expense/models/hr_expense_sheet.py
+++ b/addons/project_sale_expense/models/hr_expense_sheet.py
@@ -4,7 +4,7 @@
class HrExpenseSheet(models.Model):
- _inherit = "hr.expense.sheet"
+ _inherit = ["hr.expense.sheet"]
def _do_create_moves(self):
""" When creating the move of the expense, if the AA is given in the project of the SO, we take it as reference in the distribution.
diff --git a/addons/project_sale_expense/models/project_project.py b/addons/project_sale_expense/models/project_project.py
index 27a1ac888b804..c2adb49e37e3e 100644
--- a/addons/project_sale_expense/models/project_project.py
+++ b/addons/project_sale_expense/models/project_project.py
@@ -7,8 +7,8 @@
from collections import defaultdict
-class Project(models.Model):
- _inherit = 'project.project'
+class ProjectProject(models.Model):
+ _inherit = ['project.project']
def _get_expenses_profitability_items(self, with_action=True):
expenses_read_group = self.env['hr.expense']._read_group(
diff --git a/addons/project_sms/models/project_project.py b/addons/project_sms/models/project_project.py
index 8c3de1bf60250..b579d58cd7e72 100644
--- a/addons/project_sms/models/project_project.py
+++ b/addons/project_sms/models/project_project.py
@@ -5,7 +5,7 @@
class ProjectProject(models.Model):
- _inherit = "project.project"
+ _inherit = ["project.project"]
def _send_sms(self):
for project in self:
diff --git a/addons/project_sms/models/project_stage.py b/addons/project_sms/models/project_stage.py
index 626f9ce8ac0c5..f5a97134f0e07 100644
--- a/addons/project_sms/models/project_stage.py
+++ b/addons/project_sms/models/project_stage.py
@@ -5,7 +5,7 @@
class ProjectProjectStage(models.Model):
- _inherit = 'project.project.stage'
+ _inherit = ['project.project.stage']
sms_template_id = fields.Many2one('sms.template', string="SMS Template",
domain=[('model', '=', 'project.project')],
diff --git a/addons/project_sms/models/project_task.py b/addons/project_sms/models/project_task.py
index 11163e3fdcc84..92975fea1f572 100644
--- a/addons/project_sms/models/project_task.py
+++ b/addons/project_sms/models/project_task.py
@@ -5,7 +5,7 @@
class ProjectTask(models.Model):
- _inherit = "project.task"
+ _inherit = ["project.task"]
def _send_sms(self):
for task in self:
diff --git a/addons/project_sms/models/project_task_type.py b/addons/project_sms/models/project_task_type.py
index 1d5fa3cb5447f..7f96a2858dd94 100644
--- a/addons/project_sms/models/project_task_type.py
+++ b/addons/project_sms/models/project_task_type.py
@@ -5,7 +5,7 @@
class ProjectTaskType(models.Model):
- _inherit = "project.task.type"
+ _inherit = ["project.task.type"]
sms_template_id = fields.Many2one('sms.template', string="SMS Template",
domain=[('model', '=', 'project.task')],
diff --git a/addons/project_stock/models/project_project.py b/addons/project_stock/models/project_project.py
index fe8d3900d65ee..6d84c5577c767 100644
--- a/addons/project_stock/models/project_project.py
+++ b/addons/project_stock/models/project_project.py
@@ -5,7 +5,7 @@
class ProjectProject(models.Model):
- _inherit = 'project.project'
+ _inherit = ['project.project']
def action_open_deliveries(self):
self.ensure_one()
diff --git a/addons/project_stock/models/stock_picking.py b/addons/project_stock/models/stock_picking.py
index 168b0f7db5425..d77a5ccdd1067 100644
--- a/addons/project_stock/models/stock_picking.py
+++ b/addons/project_stock/models/stock_picking.py
@@ -4,6 +4,6 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
project_id = fields.Many2one('project.project')
diff --git a/addons/project_stock_account/models/analytic_applicability.py b/addons/project_stock_account/models/analytic_applicability.py
index a2b1040007c2a..37f319d851d34 100644
--- a/addons/project_stock_account/models/analytic_applicability.py
+++ b/addons/project_stock_account/models/analytic_applicability.py
@@ -4,7 +4,7 @@
class AccountAnalyticApplicability(models.Model):
- _inherit = 'account.analytic.applicability'
+ _inherit = ['account.analytic.applicability']
_description = "Analytic Plan's Applicabilities"
business_domain = fields.Selection(
diff --git a/addons/project_stock_account/models/stock_move.py b/addons/project_stock_account/models/stock_move.py
index f51add38e12e9..5a8d38a04c8bc 100644
--- a/addons/project_stock_account/models/stock_move.py
+++ b/addons/project_stock_account/models/stock_move.py
@@ -7,7 +7,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _get_analytic_distribution(self):
if not self.picking_type_id.analytic_costs:
diff --git a/addons/project_stock_account/models/stock_picking_type.py b/addons/project_stock_account/models/stock_picking_type.py
index caab1b9c141e9..bb2e1497d3ce3 100644
--- a/addons/project_stock_account/models/stock_picking_type.py
+++ b/addons/project_stock_account/models/stock_picking_type.py
@@ -3,7 +3,7 @@
from odoo import fields, models
-class PickingType(models.Model):
- _inherit = 'stock.picking.type'
+class StockPickingType(models.Model):
+ _inherit = ['stock.picking.type']
analytic_costs = fields.Boolean(help="Validating stock pickings will generate analytic entries for the selected project. Products set for re-invoicing will also be billed to the customer.")
diff --git a/addons/project_stock_landed_costs/models/stock_landed_costs.py b/addons/project_stock_landed_costs/models/stock_landed_costs.py
index 17406742213d3..3b54ed09d2ee7 100644
--- a/addons/project_stock_landed_costs/models/stock_landed_costs.py
+++ b/addons/project_stock_landed_costs/models/stock_landed_costs.py
@@ -3,8 +3,8 @@
from odoo import models
-class AdjustmentLines(models.Model):
- _inherit = 'stock.valuation.adjustment.lines'
+class StockValuationAdjustmentLines(models.Model):
+ _inherit = ['stock.valuation.adjustment.lines']
def _prepare_account_move_line_values(self):
res = super()._prepare_account_move_line_values()
diff --git a/addons/project_timesheet_holidays/models/account_analytic.py b/addons/project_timesheet_holidays/models/account_analytic.py
index 6d67bd069e1e4..6e40e71844b55 100644
--- a/addons/project_timesheet_holidays/models/account_analytic.py
+++ b/addons/project_timesheet_holidays/models/account_analytic.py
@@ -7,7 +7,7 @@
class AccountAnalyticLine(models.Model):
- _inherit = 'account.analytic.line'
+ _inherit = ['account.analytic.line']
holiday_id = fields.Many2one("hr.leave", string='Time Off Request', copy=False, index='btree_not_null', export_string_translation=False)
global_leave_id = fields.Many2one("resource.calendar.leaves", string="Global Time Off", index='btree_not_null', ondelete='cascade', export_string_translation=False)
diff --git a/addons/project_timesheet_holidays/models/hr_employee.py b/addons/project_timesheet_holidays/models/hr_employee.py
index 0c644733b6f0e..a7ad666d73124 100644
--- a/addons/project_timesheet_holidays/models/hr_employee.py
+++ b/addons/project_timesheet_holidays/models/hr_employee.py
@@ -5,8 +5,8 @@
from collections import defaultdict
-class Employee(models.Model):
- _inherit = 'hr.employee'
+class HrEmployee(models.Model):
+ _inherit = ['hr.employee']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/project_timesheet_holidays/models/hr_holidays.py b/addons/project_timesheet_holidays/models/hr_holidays.py
index e28c9e4580a86..69496cbf31395 100644
--- a/addons/project_timesheet_holidays/models/hr_holidays.py
+++ b/addons/project_timesheet_holidays/models/hr_holidays.py
@@ -5,8 +5,8 @@
from odoo.exceptions import ValidationError
-class HolidaysType(models.Model):
- _inherit = "hr.leave.type"
+class HrLeaveType(models.Model):
+ _inherit = ["hr.leave.type"]
timesheet_generate = fields.Boolean(
'Generate Timesheets', compute='_compute_timesheet_generate', store=True, readonly=False,
@@ -50,8 +50,8 @@ def _check_timesheet_generate(self):
"leave the internal project and task empty.", holiday_status.name))
-class Holidays(models.Model):
- _inherit = "hr.leave"
+class HrLeave(models.Model):
+ _inherit = ["hr.leave"]
timesheet_ids = fields.One2many('account.analytic.line', 'holiday_id', string="Analytic Lines")
diff --git a/addons/project_timesheet_holidays/models/project_task.py b/addons/project_timesheet_holidays/models/project_task.py
index 140983f1bedc1..6b9711a0ef1e5 100644
--- a/addons/project_timesheet_holidays/models/project_task.py
+++ b/addons/project_timesheet_holidays/models/project_task.py
@@ -3,8 +3,9 @@
from odoo import fields, models, _
-class Task(models.Model):
- _inherit = 'project.task'
+
+class ProjectTask(models.Model):
+ _inherit = ['project.task']
leave_types_count = fields.Integer(compute='_compute_leave_types_count', string="Time Off Types Count")
is_timeoff_task = fields.Boolean("Is Time off Task", compute="_compute_is_timeoff_task", search="_search_is_timeoff_task", export_string_translation=False)
diff --git a/addons/project_timesheet_holidays/models/res_company.py b/addons/project_timesheet_holidays/models/res_company.py
index c9e2dd1d75951..7bb1810fc50e5 100644
--- a/addons/project_timesheet_holidays/models/res_company.py
+++ b/addons/project_timesheet_holidays/models/res_company.py
@@ -4,8 +4,8 @@
from odoo import fields, models, _
-class Company(models.Model):
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
leave_timesheet_task_id = fields.Many2one(
'project.task', string="Time Off Task",
diff --git a/addons/project_timesheet_holidays/models/res_config_settings.py b/addons/project_timesheet_holidays/models/res_config_settings.py
index 04adace25d245..3304843fbf57d 100644
--- a/addons/project_timesheet_holidays/models/res_config_settings.py
+++ b/addons/project_timesheet_holidays/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
internal_project_id = fields.Many2one(
related='company_id.internal_project_id', required=True, string="Internal Project",
diff --git a/addons/project_timesheet_holidays/models/resource_calendar_leaves.py b/addons/project_timesheet_holidays/models/resource_calendar_leaves.py
index f3da7e00373dd..7e6c9ee6ab472 100644
--- a/addons/project_timesheet_holidays/models/resource_calendar_leaves.py
+++ b/addons/project_timesheet_holidays/models/resource_calendar_leaves.py
@@ -8,7 +8,7 @@
class ResourceCalendarLeaves(models.Model):
- _inherit = "resource.calendar.leaves"
+ _inherit = ["resource.calendar.leaves"]
timesheet_ids = fields.One2many('account.analytic.line', 'global_leave_id', string="Analytic Lines", export_string_translation=False)
diff --git a/addons/project_todo/models/project_task.py b/addons/project_todo/models/project_task.py
index e032c9ff9cc8a..6738f777893e9 100644
--- a/addons/project_todo/models/project_task.py
+++ b/addons/project_todo/models/project_task.py
@@ -5,8 +5,8 @@
from odoo.tools import html2plaintext
-class Task(models.Model):
- _inherit = 'project.task'
+class ProjectTask(models.Model):
+ _inherit = ['project.task']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/project_todo/models/res_users.py b/addons/project_todo/models/res_users.py
index 222ec19012124..98748544b1ee0 100644
--- a/addons/project_todo/models/res_users.py
+++ b/addons/project_todo/models/res_users.py
@@ -6,8 +6,8 @@
from odoo import _, api, models, modules
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
@api.model
def _get_activity_groups(self):
diff --git a/addons/project_todo/wizard/mail_activity_todo_create.py b/addons/project_todo/wizard/mail_activity_todo_create.py
index 929752fab76a9..bb5c20f577b3b 100644
--- a/addons/project_todo/wizard/mail_activity_todo_create.py
+++ b/addons/project_todo/wizard/mail_activity_todo_create.py
@@ -2,8 +2,8 @@
from odoo import fields, models, _
+
class MailActivityTodoCreate(models.TransientModel):
- _name = 'mail.activity.todo.create'
_description = 'Create activity and todo at the same time'
summary = fields.Char()
diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py
index 7d1e6c19bfc3e..9ed158feedc93 100644
--- a/addons/purchase/models/account_invoice.py
+++ b/addons/purchase/models/account_invoice.py
@@ -13,7 +13,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
purchase_vendor_bill_id = fields.Many2one('purchase.bill.union', store=False, readonly=False,
string='Auto-complete',
@@ -508,10 +508,9 @@ def _find_and_set_purchase_orders(self, po_references, partner_id, amount_total,
})]
-
class AccountMoveLine(models.Model):
""" Override AccountInvoice_line to add the link to the purchase order line it is related to"""
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
is_downpayment = fields.Boolean()
purchase_line_id = fields.Many2one('purchase.order.line', 'Purchase Order Line', ondelete='set null', index='btree_not_null', copy=False)
diff --git a/addons/purchase/models/account_tax.py b/addons/purchase/models/account_tax.py
index e5ab12d2e61e5..416f4492c8a0f 100644
--- a/addons/purchase/models/account_tax.py
+++ b/addons/purchase/models/account_tax.py
@@ -4,7 +4,7 @@
class AccountTax(models.Model):
- _inherit = "account.tax"
+ _inherit = ["account.tax"]
def _hook_compute_is_used(self, taxes_to_compute):
# OVERRIDE in order to fetch taxes used in purchase
diff --git a/addons/purchase/models/analytic_account.py b/addons/purchase/models/analytic_account.py
index 60e7516d2fb93..e3b850a960e26 100644
--- a/addons/purchase/models/analytic_account.py
+++ b/addons/purchase/models/analytic_account.py
@@ -5,7 +5,7 @@
class AccountAnalyticAccount(models.Model):
- _inherit = 'account.analytic.account'
+ _inherit = ['account.analytic.account']
purchase_order_count = fields.Integer("Purchase Order Count", compute='_compute_purchase_order_count')
diff --git a/addons/purchase/models/analytic_applicability.py b/addons/purchase/models/analytic_applicability.py
index 8dea5a8c59971..3759c51e7e099 100644
--- a/addons/purchase/models/analytic_applicability.py
+++ b/addons/purchase/models/analytic_applicability.py
@@ -4,7 +4,7 @@
class AccountAnalyticApplicability(models.Model):
- _inherit = 'account.analytic.applicability'
+ _inherit = ['account.analytic.applicability']
_description = "Analytic Plan's Applicabilities"
business_domain = fields.Selection(
diff --git a/addons/purchase/models/ir_actions_report.py b/addons/purchase/models/ir_actions_report.py
index 2664d99193812..aebcef0ec9946 100644
--- a/addons/purchase/models/ir_actions_report.py
+++ b/addons/purchase/models/ir_actions_report.py
@@ -5,7 +5,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
def _render_qweb_pdf_prepare_streams(self, report_ref, data, res_ids=None):
# EXTENDS base
diff --git a/addons/purchase/models/product.py b/addons/purchase/models/product.py
index 9d76c0f0ec8fe..7facea48f5c7e 100644
--- a/addons/purchase/models/product.py
+++ b/addons/purchase/models/product.py
@@ -9,8 +9,7 @@
class ProductTemplate(models.Model):
- _name = 'product.template'
- _inherit = 'product.template'
+ _inherit = ['product.template']
purchased_product_qty = fields.Float(compute='_compute_purchased_product_qty', string='Purchased', digits='Product Unit of Measure')
purchase_method = fields.Selection([
@@ -56,8 +55,7 @@ def action_view_po(self):
class ProductProduct(models.Model):
- _name = 'product.product'
- _inherit = 'product.product'
+ _inherit = ['product.product']
purchased_product_qty = fields.Float(compute='_compute_purchased_product_qty', string='Purchased',
digits='Product Unit of Measure')
@@ -117,7 +115,7 @@ def _get_backend_root_menu_ids(self):
class ProductSupplierinfo(models.Model):
- _inherit = "product.supplierinfo"
+ _inherit = ["product.supplierinfo"]
@api.onchange('partner_id')
def _onchange_partner_id(self):
@@ -125,6 +123,6 @@ def _onchange_partner_id(self):
class ProductPackaging(models.Model):
- _inherit = 'product.packaging'
+ _inherit = ['product.packaging']
purchase = fields.Boolean("Purchase", default=True, help="If true, the packaging can be used for purchase orders")
diff --git a/addons/purchase/models/purchase_bill_line_match.py b/addons/purchase/models/purchase_bill_line_match.py
index 72a181e930ffe..1fe388de52ab0 100644
--- a/addons/purchase/models/purchase_bill_line_match.py
+++ b/addons/purchase/models/purchase_bill_line_match.py
@@ -6,8 +6,7 @@
from odoo.exceptions import UserError
-class PurchaseBillMatch(models.Model):
- _name = "purchase.bill.line.match"
+class PurchaseBillLineMatch(models.Model):
_description = "Purchase Line and Vendor Bill line matching view"
_auto = False
_order = 'product_id, aml_id, pol_id'
diff --git a/addons/purchase/models/purchase_order.py b/addons/purchase/models/purchase_order.py
index e04ba4a0a401e..6ee01ab97c675 100644
--- a/addons/purchase/models/purchase_order.py
+++ b/addons/purchase/models/purchase_order.py
@@ -16,7 +16,6 @@
class PurchaseOrder(models.Model):
- _name = "purchase.order"
_inherit = ['portal.mixin', 'product.catalog.mixin', 'mail.thread', 'mail.activity.mixin']
_description = "Purchase Order"
_rec_names_search = ['name', 'partner_ref']
diff --git a/addons/purchase/models/purchase_order_line.py b/addons/purchase/models/purchase_order_line.py
index 4a6f238103269..8f48722696f7c 100644
--- a/addons/purchase/models/purchase_order_line.py
+++ b/addons/purchase/models/purchase_order_line.py
@@ -10,8 +10,7 @@
class PurchaseOrderLine(models.Model):
- _name = 'purchase.order.line'
- _inherit = 'analytic.mixin'
+ _inherit = ['analytic.mixin']
_description = 'Purchase Order Line'
_order = 'order_id, sequence, id'
diff --git a/addons/purchase/models/res_company.py b/addons/purchase/models/res_company.py
index 49768923bdb9f..b5758d2f41b3f 100644
--- a/addons/purchase/models/res_company.py
+++ b/addons/purchase/models/res_company.py
@@ -3,8 +3,9 @@
from odoo import fields, models
-class Company(models.Model):
- _inherit = 'res.company'
+
+class ResCompany(models.Model):
+ _inherit = ['res.company']
po_lead = fields.Float(string='Purchase Lead Time', required=True,
help="Margin of error for vendor lead times. When the system "
diff --git a/addons/purchase/models/res_config_settings.py b/addons/purchase/models/res_config_settings.py
index 1b3f933a505e1..382abaf7392b9 100644
--- a/addons/purchase/models/res_config_settings.py
+++ b/addons/purchase/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
lock_confirmed_po = fields.Boolean("Lock Confirmed Orders", default=lambda self: self.env.company.po_lock == 'lock')
po_lock = fields.Selection(related='company_id.po_lock', string="Purchase Order Modification *", readonly=False)
diff --git a/addons/purchase/models/res_partner.py b/addons/purchase/models/res_partner.py
index 867929fddd70b..5d767323c7c1a 100644
--- a/addons/purchase/models/res_partner.py
+++ b/addons/purchase/models/res_partner.py
@@ -1,12 +1,11 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
-from odoo.addons.base.models.res_partner import WARNING_MESSAGE, WARNING_HELP
+from odoo.addons.base.models.ResPartner import WARNING_MESSAGE, WARNING_HELP
-class res_partner(models.Model):
- _name = 'res.partner'
- _inherit = 'res.partner'
+class ResPartner(models.Model):
+ _inherit = ['res.partner']
def _compute_purchase_order_count(self):
self.purchase_order_count = 0
@@ -53,7 +52,7 @@ def _compute_supplier_invoice_count(self):
@api.model
def _commercial_fields(self):
- return super(res_partner, self)._commercial_fields()
+ return super()._commercial_fields()
property_purchase_currency_id = fields.Many2one(
'res.currency', string="Supplier Currency", company_dependent=True,
diff --git a/addons/purchase/report/purchase_bill.py b/addons/purchase/report/purchase_bill.py
index 58b003e332c9b..bbaa363025375 100644
--- a/addons/purchase/report/purchase_bill.py
+++ b/addons/purchase/report/purchase_bill.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models, tools
from odoo.tools import formatLang
+
class PurchaseBillUnion(models.Model):
- _name = 'purchase.bill.union'
_auto = False
_description = 'Purchases & Bills Union'
_order = "date desc, name desc"
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index a9e783a16c071..15053ecc6f9d4 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -11,7 +11,6 @@
class PurchaseReport(models.Model):
- _name = "purchase.report"
_description = "Purchase Report"
_auto = False
_order = 'date_order desc, price_total desc'
diff --git a/addons/purchase/wizard/bill_to_po_wizard.py b/addons/purchase/wizard/bill_to_po_wizard.py
index 4392d393a166b..0b4d93ebdf118 100644
--- a/addons/purchase/wizard/bill_to_po_wizard.py
+++ b/addons/purchase/wizard/bill_to_po_wizard.py
@@ -3,8 +3,7 @@
from odoo.exceptions import UserError
-class BillToPO(models.TransientModel):
- _name = 'bill.to.po.wizard'
+class BillToPoWizard(models.TransientModel):
_description = 'Bill to Purchase Order'
purchase_order_id = fields.Many2one(comodel_name='purchase.order')
diff --git a/addons/purchase_edi_ubl_bis3/models/purchase_edi_xml_ubl_bis3.py b/addons/purchase_edi_ubl_bis3/models/purchase_edi_xml_ubl_bis3.py
index bd2983e6640c9..2663d5340eadc 100644
--- a/addons/purchase_edi_ubl_bis3/models/purchase_edi_xml_ubl_bis3.py
+++ b/addons/purchase_edi_ubl_bis3/models/purchase_edi_xml_ubl_bis3.py
@@ -4,9 +4,8 @@
from odoo.tools import html2plaintext, cleanup_xml_node
-class PurchaseEdiXmlUBLBIS3(models.AbstractModel):
- _name = "purchase.edi.xml.ubl_bis3"
- _inherit = 'account.edi.xml.ubl_bis3'
+class PurchaseEdiXmlUbl_Bis3(models.AbstractModel):
+ _inherit = ['account.edi.xml.ubl_bis3']
_description = "UBL BIS 3 Peppol Order transaction 3.4"
# -------------------------------------------------------------------------
diff --git a/addons/purchase_edi_ubl_bis3/models/purchase_order.py b/addons/purchase_edi_ubl_bis3/models/purchase_order.py
index 42bc8cb30e496..da6bffadd1576 100644
--- a/addons/purchase_edi_ubl_bis3/models/purchase_order.py
+++ b/addons/purchase_edi_ubl_bis3/models/purchase_order.py
@@ -2,7 +2,7 @@
class PurchaseOrder(models.Model):
- _inherit = "purchase.order"
+ _inherit = ["purchase.order"]
def _get_edi_builders(self):
return super()._get_edi_builders() + [self.env['purchase.edi.xml.ubl_bis3']]
diff --git a/addons/purchase_mrp/models/account_move.py b/addons/purchase_mrp/models/account_move.py
index 9dbbc19125416..88a0a5ffe2357 100644
--- a/addons/purchase_mrp/models/account_move.py
+++ b/addons/purchase_mrp/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
def _get_stock_valuation_layers(self, move):
""" Do not handle the invoice correction for kit. It has to be done
diff --git a/addons/purchase_mrp/models/mrp_bom.py b/addons/purchase_mrp/models/mrp_bom.py
index 0bb18848fab19..fa5df8f66c8e4 100644
--- a/addons/purchase_mrp/models/mrp_bom.py
+++ b/addons/purchase_mrp/models/mrp_bom.py
@@ -7,7 +7,7 @@
class MrpBom(models.Model):
- _inherit = 'mrp.bom'
+ _inherit = ['mrp.bom']
@api.constrains('product_id', 'product_tmpl_id', 'bom_line_ids', 'byproduct_ids', 'operation_ids')
def _check_bom_lines(self):
@@ -23,7 +23,7 @@ def _check_bom_lines(self):
class MrpBomLine(models.Model):
- _inherit = 'mrp.bom.line'
+ _inherit = ['mrp.bom.line']
cost_share = fields.Float(
"Cost Share (%)", digits=(5, 2), # decimal = 2 is important for rounding calculations!!
diff --git a/addons/purchase_mrp/models/mrp_production.py b/addons/purchase_mrp/models/mrp_production.py
index 77fd223e8641b..a64e0eec9b528 100644
--- a/addons/purchase_mrp/models/mrp_production.py
+++ b/addons/purchase_mrp/models/mrp_production.py
@@ -5,7 +5,7 @@
class MrpProduction(models.Model):
- _inherit = 'mrp.production'
+ _inherit = ['mrp.production']
purchase_order_count = fields.Integer(
"Count of generated PO",
diff --git a/addons/purchase_mrp/models/purchase.py b/addons/purchase_mrp/models/purchase.py
index fe869a9f8a365..9d199a9e8a07f 100644
--- a/addons/purchase_mrp/models/purchase.py
+++ b/addons/purchase_mrp/models/purchase.py
@@ -8,7 +8,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
mrp_production_count = fields.Integer(
"Count of MO Source",
@@ -49,7 +49,7 @@ def action_view_mrp_productions(self):
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = ['purchase.order.line']
def _compute_qty_received(self):
kit_lines = self.env['purchase.order.line']
diff --git a/addons/purchase_mrp/models/stock_move.py b/addons/purchase_mrp/models/stock_move.py
index 5920a2427e263..bdb5bbe7b0897 100644
--- a/addons/purchase_mrp/models/stock_move.py
+++ b/addons/purchase_mrp/models/stock_move.py
@@ -7,7 +7,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _prepare_phantom_move_values(self, bom_line, product_qty, quantity_done):
vals = super(StockMove, self)._prepare_phantom_move_values(bom_line, product_qty, quantity_done)
diff --git a/addons/purchase_mrp/report/mrp_report_bom_structure.py b/addons/purchase_mrp/report/mrp_report_bom_structure.py
index 132087e099936..3d88aa90992b3 100644
--- a/addons/purchase_mrp/report/mrp_report_bom_structure.py
+++ b/addons/purchase_mrp/report/mrp_report_bom_structure.py
@@ -4,8 +4,9 @@
from odoo import api, models
from odoo.tools import float_compare
-class ReportBomStructure(models.AbstractModel):
- _inherit = 'report.mrp.report_bom_structure'
+
+class ReportMrpReport_Bom_Structure(models.AbstractModel):
+ _inherit = ['report.mrp.report_bom_structure']
@api.model
def _format_route_info(self, rules, rules_delay, warehouse, product, bom, quantity):
diff --git a/addons/purchase_mrp/report/mrp_report_mo_overview.py b/addons/purchase_mrp/report/mrp_report_mo_overview.py
index c3cd7ce1f602a..d076d03e16465 100644
--- a/addons/purchase_mrp/report/mrp_report_mo_overview.py
+++ b/addons/purchase_mrp/report/mrp_report_mo_overview.py
@@ -3,8 +3,9 @@
from odoo import fields, models
-class ReportMoOverview(models.AbstractModel):
- _inherit = 'report.mrp.report_mo_overview'
+
+class ReportMrpReport_Mo_Overview(models.AbstractModel):
+ _inherit = ['report.mrp.report_mo_overview']
def _get_extra_replenishments(self, product):
res = super()._get_extra_replenishments(product)
diff --git a/addons/purchase_product_matrix/models/purchase.py b/addons/purchase_product_matrix/models/purchase.py
index 27d3941a59dcf..789c9583056e8 100644
--- a/addons/purchase_product_matrix/models/purchase.py
+++ b/addons/purchase_product_matrix/models/purchase.py
@@ -6,7 +6,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
report_grids = fields.Boolean(string="Print Variant Grids", default=True, help="If set, the matrix of configurable products will be shown on the report of this order.")
@@ -161,7 +161,7 @@ def get_report_matrixes(self):
class PurchaseOrderLine(models.Model):
- _inherit = "purchase.order.line"
+ _inherit = ["purchase.order.line"]
product_template_id = fields.Many2one('product.template', string='Product Template', related="product_id.product_tmpl_id", domain=[('purchase_ok', '=', True)])
is_configurable_product = fields.Boolean('Is the product configurable?', related="product_template_id.has_configurable_attributes")
diff --git a/addons/purchase_repair/models/purchase_order.py b/addons/purchase_repair/models/purchase_order.py
index 95e6194a3876c..1bf5b246ac332 100644
--- a/addons/purchase_repair/models/purchase_order.py
+++ b/addons/purchase_repair/models/purchase_order.py
@@ -3,7 +3,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
repair_count = fields.Integer(string='Count of source repairs', compute='_compute_repair_count', groups='stock.group_stock_user')
diff --git a/addons/purchase_repair/models/repair_order.py b/addons/purchase_repair/models/repair_order.py
index 8acd6c901ebed..b3924e4c41625 100644
--- a/addons/purchase_repair/models/repair_order.py
+++ b/addons/purchase_repair/models/repair_order.py
@@ -3,7 +3,7 @@
class RepairOrder(models.Model):
- _inherit = 'repair.order'
+ _inherit = ['repair.order']
purchase_count = fields.Integer(string="Count of generated POs", compute="_compute_purchase_count", groups="purchase.group_purchase_user")
diff --git a/addons/purchase_requisition/models/product.py b/addons/purchase_requisition/models/product.py
index 69bd3bdfd639a..d338ed079fc35 100644
--- a/addons/purchase_requisition/models/product.py
+++ b/addons/purchase_requisition/models/product.py
@@ -4,15 +4,15 @@
from odoo import fields, models
-class SupplierInfo(models.Model):
- _inherit = 'product.supplierinfo'
+class ProductSupplierinfo(models.Model):
+ _inherit = ['product.supplierinfo']
purchase_requisition_id = fields.Many2one('purchase.requisition', related='purchase_requisition_line_id.requisition_id', string='Agreement')
purchase_requisition_line_id = fields.Many2one('purchase.requisition.line')
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def _prepare_sellers(self, params=False):
sellers = super(ProductProduct, self)._prepare_sellers(params=params)
diff --git a/addons/purchase_requisition/models/purchase.py b/addons/purchase_requisition/models/purchase.py
index ab4c1e9069e83..421f213f166db 100644
--- a/addons/purchase_requisition/models/purchase.py
+++ b/addons/purchase_requisition/models/purchase.py
@@ -8,7 +8,6 @@
class PurchaseOrderGroup(models.Model):
- _name = 'purchase.order.group'
_description = "Technical model to group PO for call to tenders"
order_ids = fields.One2many('purchase.order', 'purchase_group_id')
@@ -21,7 +20,7 @@ def write(self, vals):
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
requisition_id = fields.Many2one('purchase.requisition', string='Agreement', copy=False)
requisition_type = fields.Selection(related='requisition_id.requisition_type')
@@ -260,7 +259,7 @@ def _merge_alternative_po(self, rfqs):
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = ['purchase.order.line']
price_total_cc = fields.Monetary(compute='_compute_price_total_cc', string="Company Subtotal", currency_field="company_currency_id", store=True)
company_currency_id = fields.Many2one(related="company_id.currency_id", string="Company Currency")
diff --git a/addons/purchase_requisition/models/purchase_requisition.py b/addons/purchase_requisition/models/purchase_requisition.py
index 86f42c0df8049..2665bbfa77285 100644
--- a/addons/purchase_requisition/models/purchase_requisition.py
+++ b/addons/purchase_requisition/models/purchase_requisition.py
@@ -6,7 +6,6 @@
class PurchaseRequisition(models.Model):
- _name = "purchase.requisition"
_description = "Purchase Requisition"
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = "id desc"
@@ -161,8 +160,7 @@ def _unlink_if_draft_or_cancel(self):
class PurchaseRequisitionLine(models.Model):
- _name = "purchase.requisition.line"
- _inherit = 'analytic.mixin'
+ _inherit = ['analytic.mixin']
_description = "Purchase Requisition Line"
_rec_name = 'product_id'
diff --git a/addons/purchase_requisition/models/res_config_settings.py b/addons/purchase_requisition/models/res_config_settings.py
index 3378168415ed8..218ca8dd1d4f3 100644
--- a/addons/purchase_requisition/models/res_config_settings.py
+++ b/addons/purchase_requisition/models/res_config_settings.py
@@ -4,6 +4,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
group_purchase_alternatives = fields.Boolean("Purchase Alternatives", implied_group='purchase_requisition.group_purchase_alternatives')
diff --git a/addons/purchase_requisition/wizard/purchase_requisition_alternative_warning.py b/addons/purchase_requisition/wizard/purchase_requisition_alternative_warning.py
index b82d377621f9f..624d604bb07ad 100644
--- a/addons/purchase_requisition/wizard/purchase_requisition_alternative_warning.py
+++ b/addons/purchase_requisition/wizard/purchase_requisition_alternative_warning.py
@@ -5,7 +5,6 @@
class PurchaseRequisitionAlternativeWarning(models.TransientModel):
- _name = 'purchase.requisition.alternative.warning'
_description = 'Wizard in case PO still has open alternative requests for quotation'
po_ids = fields.Many2many('purchase.order', 'warning_purchase_order_rel', string="POs to Confirm")
diff --git a/addons/purchase_requisition/wizard/purchase_requisition_create_alternative.py b/addons/purchase_requisition/wizard/purchase_requisition_create_alternative.py
index 7ee97fdfbed65..22db3e9ef9265 100644
--- a/addons/purchase_requisition/wizard/purchase_requisition_create_alternative.py
+++ b/addons/purchase_requisition/wizard/purchase_requisition_create_alternative.py
@@ -6,7 +6,6 @@
class PurchaseRequisitionCreateAlternative(models.TransientModel):
- _name = 'purchase.requisition.create.alternative'
_description = 'Wizard to preset values for alternative PO'
origin_po_id = fields.Many2one(
diff --git a/addons/purchase_requisition_sale/wizard/purchase_requisition_create_alternative.py b/addons/purchase_requisition_sale/wizard/purchase_requisition_create_alternative.py
index e6a69dbd08735..62111ed245c28 100644
--- a/addons/purchase_requisition_sale/wizard/purchase_requisition_create_alternative.py
+++ b/addons/purchase_requisition_sale/wizard/purchase_requisition_create_alternative.py
@@ -5,7 +5,7 @@
class PurchaseRequisitionCreateAlternative(models.TransientModel):
- _inherit = 'purchase.requisition.create.alternative'
+ _inherit = ['purchase.requisition.create.alternative']
@api.model
def _get_alternative_line_value(self, order_line):
diff --git a/addons/purchase_requisition_stock/models/purchase.py b/addons/purchase_requisition_stock/models/purchase.py
index 547eb4c658136..b8df5b1c28e59 100644
--- a/addons/purchase_requisition_stock/models/purchase.py
+++ b/addons/purchase_requisition_stock/models/purchase.py
@@ -5,7 +5,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
on_time_rate_perc = fields.Float(string="OTD", compute="_compute_on_time_rate_perc")
@@ -25,6 +25,6 @@ def _onchange_requisition_id(self):
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = ['purchase.order.line']
on_time_rate_perc = fields.Float(string="OTD", related="order_id.on_time_rate_perc")
diff --git a/addons/purchase_requisition_stock/models/purchase_requisition.py b/addons/purchase_requisition_stock/models/purchase_requisition.py
index d11d789eb3c7f..45434d03a9c2a 100644
--- a/addons/purchase_requisition_stock/models/purchase_requisition.py
+++ b/addons/purchase_requisition_stock/models/purchase_requisition.py
@@ -5,7 +5,7 @@
class PurchaseRequisition(models.Model):
- _inherit = 'purchase.requisition'
+ _inherit = ['purchase.requisition']
def _default_picking_type_id(self):
picking_type = self.env['stock.picking.type'].search([('warehouse_id.company_id', '=', self.env.company.id), ('code', '=', 'incoming')], limit=1)
@@ -20,7 +20,7 @@ def _default_picking_type_id(self):
class PurchaseRequisitionLine(models.Model):
- _inherit = "purchase.requisition.line"
+ _inherit = ["purchase.requisition.line"]
move_dest_id = fields.Many2one('stock.move', 'Downstream Move')
diff --git a/addons/purchase_requisition_stock/models/stock.py b/addons/purchase_requisition_stock/models/stock.py
index 08e50d7494fa8..c042eb8dc83ce 100644
--- a/addons/purchase_requisition_stock/models/stock.py
+++ b/addons/purchase_requisition_stock/models/stock.py
@@ -5,7 +5,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
def _prepare_purchase_order(self, company_id, origins, values):
res = super(StockRule, self)._prepare_purchase_order(company_id, origins, values)
@@ -26,7 +26,7 @@ def _make_po_get_domain(self, company_id, values, partner):
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
requisition_line_ids = fields.One2many('purchase.requisition.line', 'move_dest_id')
diff --git a/addons/purchase_requisition_stock/wizard/purchase_requisition_create_alternative.py b/addons/purchase_requisition_stock/wizard/purchase_requisition_create_alternative.py
index 898d838c6b232..24a174b0b402e 100644
--- a/addons/purchase_requisition_stock/wizard/purchase_requisition_create_alternative.py
+++ b/addons/purchase_requisition_stock/wizard/purchase_requisition_create_alternative.py
@@ -5,7 +5,7 @@
class PurchaseRequisitionCreateAlternative(models.TransientModel):
- _inherit = 'purchase.requisition.create.alternative'
+ _inherit = ['purchase.requisition.create.alternative']
def _get_alternative_values(self):
vals = super(PurchaseRequisitionCreateAlternative, self)._get_alternative_values()
diff --git a/addons/purchase_stock/models/account_invoice.py b/addons/purchase_stock/models/account_invoice.py
index 72d52b8b140f4..387510ce05825 100644
--- a/addons/purchase_stock/models/account_invoice.py
+++ b/addons/purchase_stock/models/account_invoice.py
@@ -7,7 +7,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _stock_account_prepare_anglo_saxon_in_lines_vals(self):
''' Prepare values used to create the journal items (account.move.line) corresponding to the price difference
diff --git a/addons/purchase_stock/models/account_move_line.py b/addons/purchase_stock/models/account_move_line.py
index 26df54a58191a..2a5fb3b6d72a1 100644
--- a/addons/purchase_stock/models/account_move_line.py
+++ b/addons/purchase_stock/models/account_move_line.py
@@ -8,7 +8,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _get_valued_in_moves(self):
self.ensure_one()
diff --git a/addons/purchase_stock/models/product.py b/addons/purchase_stock/models/product.py
index c3c9346222a20..919a8ead6f52b 100644
--- a/addons/purchase_stock/models/product.py
+++ b/addons/purchase_stock/models/product.py
@@ -6,7 +6,7 @@
class ProductCategory(models.Model):
- _inherit = "product.category"
+ _inherit = ["product.category"]
property_account_creditor_price_difference_categ = fields.Many2one(
'account.account', string="Price Difference Account",
@@ -15,8 +15,7 @@ class ProductCategory(models.Model):
class ProductTemplate(models.Model):
- _name = 'product.template'
- _inherit = 'product.template'
+ _inherit = ['product.template']
property_account_creditor_price_difference = fields.Many2one(
'account.account', string="Price Difference Account", company_dependent=True, ondelete='restrict',
@@ -34,8 +33,7 @@ def _get_buy_route(self):
class ProductProduct(models.Model):
- _name = 'product.product'
- _inherit = 'product.product'
+ _inherit = ['product.product']
purchase_order_line_ids = fields.One2many('purchase.order.line', 'product_id', string="PO Lines") # used to compute quantities
@@ -91,8 +89,8 @@ def _get_lines_domain(self, location_ids=False, warehouse_ids=False):
return expression.OR(domains) if domains else []
-class SupplierInfo(models.Model):
- _inherit = 'product.supplierinfo'
+class ProductSupplierinfo(models.Model):
+ _inherit = ['product.supplierinfo']
last_purchase_date = fields.Date('Last Purchase', compute='_compute_last_purchase_date')
show_set_supplier_button = fields.Boolean(
diff --git a/addons/purchase_stock/models/purchase_order.py b/addons/purchase_stock/models/purchase_order.py
index 74387e48d9145..95fbdbad0c0d8 100644
--- a/addons/purchase_stock/models/purchase_order.py
+++ b/addons/purchase_stock/models/purchase_order.py
@@ -10,7 +10,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
@api.model
def _default_picking_type(self):
diff --git a/addons/purchase_stock/models/purchase_order_line.py b/addons/purchase_stock/models/purchase_order_line.py
index 8050b956764bc..5edcb8024350d 100644
--- a/addons/purchase_stock/models/purchase_order_line.py
+++ b/addons/purchase_stock/models/purchase_order_line.py
@@ -6,7 +6,7 @@
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = ['purchase.order.line']
def _ondelete_stock_moves(self):
modified_fields = ['qty_received_manual', 'qty_received_method']
diff --git a/addons/purchase_stock/models/res_company.py b/addons/purchase_stock/models/res_company.py
index b49d8cf925904..931c1fe25bf99 100644
--- a/addons/purchase_stock/models/res_company.py
+++ b/addons/purchase_stock/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
days_to_purchase = fields.Float(
string='Days to Purchase',
diff --git a/addons/purchase_stock/models/res_config_settings.py b/addons/purchase_stock/models/res_config_settings.py
index f3370a8c9099d..45c77d434379c 100644
--- a/addons/purchase_stock/models/res_config_settings.py
+++ b/addons/purchase_stock/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
module_stock_dropshipping = fields.Boolean("Dropshipping")
days_to_purchase = fields.Float(
diff --git a/addons/purchase_stock/models/res_partner.py b/addons/purchase_stock/models/res_partner.py
index 80f4bec4fd058..6ebab7fa9e442 100644
--- a/addons/purchase_stock/models/res_partner.py
+++ b/addons/purchase_stock/models/res_partner.py
@@ -8,7 +8,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
purchase_line_ids = fields.One2many('purchase.order.line', 'partner_id', string="Purchase Lines")
on_time_rate = fields.Float(
diff --git a/addons/purchase_stock/models/stock.py b/addons/purchase_stock/models/stock.py
index 750f874f7a894..7b1ce0647d93d 100644
--- a/addons/purchase_stock/models/stock.py
+++ b/addons/purchase_stock/models/stock.py
@@ -7,7 +7,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
purchase_id = fields.Many2one(
'purchase.order', related='move_ids.purchase_line_id.order_id',
@@ -40,7 +40,7 @@ def _search_delay_pass(self, operator, value):
class StockWarehouse(models.Model):
- _inherit = 'stock.warehouse'
+ _inherit = ['stock.warehouse']
buy_to_resupply = fields.Boolean('Buy to Resupply', default=True,
help="When products are bought, they can be delivered to this warehouse")
@@ -102,8 +102,8 @@ def _update_name_and_code(self, name=False, code=False):
return res
-class ReturnPicking(models.TransientModel):
- _inherit = "stock.return.picking"
+class StockReturnPicking(models.TransientModel):
+ _inherit = ["stock.return.picking"]
def _prepare_move_default_values(self, return_line, new_picking):
vals = super()._prepare_move_default_values(return_line, new_picking)
@@ -118,8 +118,8 @@ def _create_return(self):
return picking
-class Orderpoint(models.Model):
- _inherit = "stock.warehouse.orderpoint"
+class StockWarehouseOrderpoint(models.Model):
+ _inherit = ["stock.warehouse.orderpoint"]
show_supplier = fields.Boolean('Show supplier column', compute='_compute_show_suppplier')
supplier_id = fields.Many2one(
@@ -245,7 +245,7 @@ def _set_default_route_id(self):
class StockLot(models.Model):
- _inherit = 'stock.lot'
+ _inherit = ['stock.lot']
purchase_order_ids = fields.Many2many('purchase.order', string="Purchase Orders", compute='_compute_purchase_order_ids', readonly=True, store=False)
purchase_order_count = fields.Integer('Purchase order count', compute='_compute_purchase_order_ids')
@@ -270,7 +270,7 @@ def action_view_po(self):
class ProcurementGroup(models.Model):
- _inherit = 'procurement.group'
+ _inherit = ['procurement.group']
purchase_line_ids = fields.One2many('purchase.order.line', 'group_id', string='Linked Purchase Order Lines', copy=False)
diff --git a/addons/purchase_stock/models/stock_move.py b/addons/purchase_stock/models/stock_move.py
index 1e1d723c1720c..0aeb07e5da910 100644
--- a/addons/purchase_stock/models/stock_move.py
+++ b/addons/purchase_stock/models/stock_move.py
@@ -8,7 +8,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
purchase_line_id = fields.Many2one(
'purchase.order.line', 'Purchase Order Line',
diff --git a/addons/purchase_stock/models/stock_replenish_mixin.py b/addons/purchase_stock/models/stock_replenish_mixin.py
index f80cacd70c0e9..7b999f72ee96e 100644
--- a/addons/purchase_stock/models/stock_replenish_mixin.py
+++ b/addons/purchase_stock/models/stock_replenish_mixin.py
@@ -3,8 +3,8 @@
from odoo import api, fields, models
-class ProductReplenishMixin(models.AbstractModel):
- _inherit = 'stock.replenish.mixin'
+class StockReplenishMixin(models.AbstractModel):
+ _inherit = ['stock.replenish.mixin']
supplier_id = fields.Many2one('product.supplierinfo', string="Vendor")
show_vendor = fields.Boolean(compute='_compute_show_vendor')
diff --git a/addons/purchase_stock/models/stock_rule.py b/addons/purchase_stock/models/stock_rule.py
index 0e9e3567c1c4f..b6e7494fc4e6f 100644
--- a/addons/purchase_stock/models/stock_rule.py
+++ b/addons/purchase_stock/models/stock_rule.py
@@ -12,7 +12,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
action = fields.Selection(selection_add=[
('buy', 'Buy')
diff --git a/addons/purchase_stock/models/stock_valuation_layer.py b/addons/purchase_stock/models/stock_valuation_layer.py
index 3959806cb0f10..e63975d8ffe8a 100644
--- a/addons/purchase_stock/models/stock_valuation_layer.py
+++ b/addons/purchase_stock/models/stock_valuation_layer.py
@@ -2,7 +2,7 @@
class StockValuationLayer(models.Model):
- _inherit = 'stock.valuation.layer'
+ _inherit = ['stock.valuation.layer']
def _get_layer_price_unit(self):
""" This function returns the value of product in a layer per unit, relative to the aml
diff --git a/addons/purchase_stock/report/purchase_report.py b/addons/purchase_stock/report/purchase_report.py
index 50f3dc1aec52b..f956b4448535c 100644
--- a/addons/purchase_stock/report/purchase_report.py
+++ b/addons/purchase_stock/report/purchase_report.py
@@ -6,7 +6,7 @@
class PurchaseReport(models.Model):
- _inherit = "purchase.report"
+ _inherit = ["purchase.report"]
picking_type_id = fields.Many2one('stock.warehouse', 'Warehouse', readonly=True)
effective_date = fields.Datetime(string="Effective Date")
diff --git a/addons/purchase_stock/report/report_stock_rule.py b/addons/purchase_stock/report/report_stock_rule.py
index cc92df7ca76cf..cee2dbacf9b5d 100644
--- a/addons/purchase_stock/report/report_stock_rule.py
+++ b/addons/purchase_stock/report/report_stock_rule.py
@@ -4,14 +4,14 @@
from odoo import api, models
-class ReportStockRule(models.AbstractModel):
- _inherit = 'report.stock.report_stock_rule'
+class ReportStockReport_Stock_Rule(models.AbstractModel):
+ _inherit = ['report.stock.report_stock_rule']
@api.model
def _get_rule_loc(self, rule, product_id):
""" We override this method to handle buy rules which do not have a location_src_id.
"""
- res = super(ReportStockRule, self)._get_rule_loc(rule, product_id)
+ res = super()._get_rule_loc(rule, product_id)
if rule.action == 'buy':
res['source'] = self.env.ref('stock.stock_location_suppliers')
return res
diff --git a/addons/purchase_stock/report/stock_forecasted.py b/addons/purchase_stock/report/stock_forecasted.py
index 12569dc068888..6996280aaadf5 100644
--- a/addons/purchase_stock/report/stock_forecasted.py
+++ b/addons/purchase_stock/report/stock_forecasted.py
@@ -4,8 +4,8 @@
from odoo import models
-class StockForecasted(models.AbstractModel):
- _inherit = 'stock.forecasted_product_product'
+class StockForecasted_Product_Product(models.AbstractModel):
+ _inherit = ['stock.forecasted_product_product']
def _get_report_header(self, product_template_ids, product_ids, wh_location_ids):
res = super()._get_report_header(product_template_ids, product_ids, wh_location_ids)
diff --git a/addons/purchase_stock/report/vendor_delay_report.py b/addons/purchase_stock/report/vendor_delay_report.py
index eb5875f72af84..8d0218141e224 100644
--- a/addons/purchase_stock/report/vendor_delay_report.py
+++ b/addons/purchase_stock/report/vendor_delay_report.py
@@ -7,7 +7,6 @@
class VendorDelayReport(models.Model):
- _name = "vendor.delay.report"
_description = "Vendor Delay Report"
_auto = False
diff --git a/addons/purchase_stock/wizard/product_replenish.py b/addons/purchase_stock/wizard/product_replenish.py
index 5d096530793d6..625a59a16292f 100644
--- a/addons/purchase_stock/wizard/product_replenish.py
+++ b/addons/purchase_stock/wizard/product_replenish.py
@@ -6,7 +6,7 @@
class ProductReplenish(models.TransientModel):
- _inherit = 'product.replenish'
+ _inherit = ['product.replenish']
@api.model
def default_get(self, fields):
diff --git a/addons/purchase_stock/wizard/stock_replenishment_info.py b/addons/purchase_stock/wizard/stock_replenishment_info.py
index ac0a484616f7b..3af1670f701b5 100644
--- a/addons/purchase_stock/wizard/stock_replenishment_info.py
+++ b/addons/purchase_stock/wizard/stock_replenishment_info.py
@@ -5,7 +5,7 @@
class StockReplenishmentInfo(models.TransientModel):
- _inherit = 'stock.replenishment.info'
+ _inherit = ['stock.replenishment.info']
_description = 'Stock supplier replenishment information'
supplierinfo_id = fields.Many2one(related='orderpoint_id.supplier_id')
@@ -20,7 +20,7 @@ def _compute_supplierinfo_ids(self):
class StockReplenishmentOption(models.TransientModel):
- _inherit = 'stock.replenishment.option'
+ _inherit = ['stock.replenishment.option']
def select_route(self):
if self._context.get('replenish_id'):
diff --git a/addons/rating/models/mail_message.py b/addons/rating/models/mail_message.py
index 2325d5e6c0510..442b58347adb5 100644
--- a/addons/rating/models/mail_message.py
+++ b/addons/rating/models/mail_message.py
@@ -5,7 +5,7 @@
class MailMessage(models.Model):
- _inherit = 'mail.message'
+ _inherit = ['mail.message']
rating_ids = fields.One2many("rating.rating", "message_id", string="Related ratings")
rating_id = fields.Many2one("rating.rating", compute="_compute_rating_id")
diff --git a/addons/rating/models/mail_thread.py b/addons/rating/models/mail_thread.py
index 6546570aecf6d..e4d0b64e5bdcd 100644
--- a/addons/rating/models/mail_thread.py
+++ b/addons/rating/models/mail_thread.py
@@ -7,7 +7,7 @@
class MailThread(models.AbstractModel):
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
rating_ids = fields.One2many('rating.rating', 'res_id', string='Ratings', groups='base.group_user',
domain=lambda self: [('res_model', '=', self._name)], auto_join=True)
diff --git a/addons/rating/models/rating.py b/addons/rating/models/rating.py
index 5b7647fc6293a..8e76dbbbadd47 100644
--- a/addons/rating/models/rating.py
+++ b/addons/rating/models/rating.py
@@ -9,8 +9,7 @@
from odoo.tools.misc import file_open
-class Rating(models.Model):
- _name = "rating.rating"
+class RatingRating(models.Model):
_description = "Rating"
_order = 'write_date desc, id desc'
_rec_name = 'res_name'
@@ -124,12 +123,12 @@ def create(self, vals_list):
def write(self, values):
if values.get('res_model_id') and values.get('res_id'):
values.update(self._find_parent_data(values))
- return super(Rating, self).write(values)
+ return super().write(values)
def unlink(self):
# OPW-2181568: Delete the chatter message too
self.env['mail.message'].search([('rating_ids', 'in', self.ids)]).unlink()
- return super(Rating, self).unlink()
+ return super().unlink()
def _find_parent_data(self, values):
""" Determine the parent res_model/res_id, based on the values to create or write """
diff --git a/addons/rating/models/rating_mixin.py b/addons/rating/models/rating_mixin.py
index 5e446ea76e2a1..5844b3986a75a 100644
--- a/addons/rating/models/rating_mixin.py
+++ b/addons/rating/models/rating_mixin.py
@@ -9,9 +9,8 @@
class RatingMixin(models.AbstractModel):
"""This mixin adds rating statistics to mail.thread that already support ratings."""
- _name = 'rating.mixin'
_description = "Rating Mixin"
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
rating_last_value = fields.Float('Rating Last Value', groups='base.group_user', compute='_compute_rating_last_value', compute_sudo=True, store=True, aggregator="avg")
rating_last_feedback = fields.Text('Rating Last Feedback', groups='base.group_user', related='rating_ids.feedback')
diff --git a/addons/rating/models/rating_parent_mixin.py b/addons/rating/models/rating_parent_mixin.py
index 89d083735a548..c1ffe1116eb64 100644
--- a/addons/rating/models/rating_parent_mixin.py
+++ b/addons/rating/models/rating_parent_mixin.py
@@ -11,7 +11,6 @@
class RatingParentMixin(models.AbstractModel):
- _name = 'rating.parent.mixin'
_description = "Rating Parent Mixin"
_rating_satisfaction_days = False # Number of last days used to compute parent satisfaction. Set to False to include all existing rating.
diff --git a/addons/repair/models/mail_compose_message.py b/addons/repair/models/mail_compose_message.py
index 3d9520a60d957..7a62da594bdef 100644
--- a/addons/repair/models/mail_compose_message.py
+++ b/addons/repair/models/mail_compose_message.py
@@ -5,7 +5,7 @@
class MailComposeMessage(models.TransientModel):
- _inherit = 'mail.compose.message'
+ _inherit = ['mail.compose.message']
def _action_send_mail(self, auto_commit=False):
if self.model == 'repair.order':
diff --git a/addons/repair/models/product.py b/addons/repair/models/product.py
index 8dc591caa6db7..61e1a6eff40cc 100644
--- a/addons/repair/models/product.py
+++ b/addons/repair/models/product.py
@@ -5,8 +5,8 @@
from odoo.exceptions import UserError
-class Product(models.Model):
- _inherit = "product.product"
+class ProductProduct(models.Model):
+ _inherit = ["product.product"]
product_catalog_product_is_in_repair = fields.Boolean(
compute='_compute_product_is_in_repair',
@@ -38,6 +38,6 @@ def _count_returned_sn_products_domain(self, sn_lot, or_domains):
class ProductTemplate(models.Model):
- _inherit = "product.template"
+ _inherit = ["product.template"]
create_repair = fields.Boolean('Create Repair', help="Create a linked Repair Order on Sale Order confirmation of this product.", groups='stock.group_stock_user')
diff --git a/addons/repair/models/repair.py b/addons/repair/models/repair.py
index 35b183de0dd71..d72b7e20fce2b 100644
--- a/addons/repair/models/repair.py
+++ b/addons/repair/models/repair.py
@@ -17,9 +17,8 @@
}
-class Repair(models.Model):
+class RepairOrder(models.Model):
""" Repair Orders """
- _name = 'repair.order'
_description = 'Repair Order'
_inherit = ['mail.thread', 'mail.activity.mixin', 'product.catalog.mixin']
_order = 'priority desc, create_date desc'
@@ -726,9 +725,9 @@ def _update_order_line_info(self, product_id, quantity, **kwargs):
return self.env['product.product'].browse(product_id).list_price
+
class RepairTags(models.Model):
""" Tags of Repair's tasks """
- _name = "repair.tags"
_description = "Repair Tags"
def _get_default_color(self):
diff --git a/addons/repair/models/sale_order.py b/addons/repair/models/sale_order.py
index 6c567d2e939a4..309383022f846 100644
--- a/addons/repair/models/sale_order.py
+++ b/addons/repair/models/sale_order.py
@@ -4,8 +4,9 @@
from odoo import api, fields, models, _
from odoo.tools import float_compare
+
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
repair_order_ids = fields.One2many(
comodel_name='repair.order', inverse_name='sale_order_id',
@@ -48,7 +49,7 @@ def action_show_repair(self):
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
def _compute_qty_delivered(self):
remaining_so_lines = self
diff --git a/addons/repair/models/stock_lot.py b/addons/repair/models/stock_lot.py
index 8a60145d803e8..afb562c8fa048 100644
--- a/addons/repair/models/stock_lot.py
+++ b/addons/repair/models/stock_lot.py
@@ -5,7 +5,7 @@
class StockLot(models.Model):
- _inherit = 'stock.lot'
+ _inherit = ['stock.lot']
repair_line_ids = fields.Many2many('repair.order', string="Repair Orders", compute="_compute_repair_line_ids")
repair_part_count = fields.Integer('Repair part count', compute="_compute_repair_line_ids")
diff --git a/addons/repair/models/stock_move.py b/addons/repair/models/stock_move.py
index 2c451aa0a5bad..ab5817ce215fb 100644
--- a/addons/repair/models/stock_move.py
+++ b/addons/repair/models/stock_move.py
@@ -11,7 +11,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
repair_id = fields.Many2one('repair.order', check_company=True)
repair_line_type = fields.Selection([
diff --git a/addons/repair/models/stock_move_line.py b/addons/repair/models/stock_move_line.py
index 8dde297132c55..c2dd9826a052f 100644
--- a/addons/repair/models/stock_move_line.py
+++ b/addons/repair/models/stock_move_line.py
@@ -4,7 +4,7 @@
class StockMoveLine(models.Model):
- _inherit = 'stock.move.line'
+ _inherit = ['stock.move.line']
def _should_show_lot_in_invoice(self):
return super()._should_show_lot_in_invoice() or self.move_id.repair_line_type
diff --git a/addons/repair/models/stock_picking.py b/addons/repair/models/stock_picking.py
index 92593c9d91456..6231dfd667b45 100644
--- a/addons/repair/models/stock_picking.py
+++ b/addons/repair/models/stock_picking.py
@@ -8,8 +8,8 @@
from odoo.tools.misc import clean_context
-class PickingType(models.Model):
- _inherit = 'stock.picking.type'
+class StockPickingType(models.Model):
+ _inherit = ['stock.picking.type']
code = fields.Selection(selection_add=[
('repair_operation', 'Repair')
@@ -118,7 +118,7 @@ def _compute_default_location_src_id(self):
continue
stock_location = picking_type.warehouse_id.lot_stock_id
picking_type.default_location_src_id = stock_location.id
- super(PickingType, remaining_picking_type)._compute_default_location_src_id()
+ super(StockPickingType, remaining_picking_type)._compute_default_location_src_id()
def _compute_default_location_dest_id(self):
repair_picking_type = self.filtered(lambda pt: pt.code == 'repair_operation')
@@ -130,7 +130,7 @@ def _compute_default_location_dest_id(self):
prod_locations = {l[0].id: l[1] for l in prod_locations}
for picking_type in repair_picking_type:
picking_type.default_location_dest_id = prod_locations.get(picking_type.company_id.id)
- super(PickingType, (self - repair_picking_type))._compute_default_location_dest_id()
+ super(StockPickingType, (self - repair_picking_type))._compute_default_location_dest_id()
@api.depends('code')
def _compute_default_product_location_id(self):
@@ -171,7 +171,7 @@ def _get_aggregated_records_by_date(self):
repair_picking_types = self.filtered(lambda picking: picking.code == 'repair_operation')
other_picking_types = (self - repair_picking_types)
- records = super(PickingType, other_picking_types)._get_aggregated_records_by_date()
+ records = super(StockPickingType, other_picking_types)._get_aggregated_records_by_date()
repair_records = self.env['repair.order']._read_group(
[
('picking_type_id', 'in', repair_picking_types.ids),
@@ -193,8 +193,8 @@ def action_repair_overview(self):
return self.env['ir.actions.actions']._for_xml_id('repair.action_repair_picking_type_kanban')
-class Picking(models.Model):
- _inherit = 'stock.picking'
+class StockPicking(models.Model):
+ _inherit = ['stock.picking']
is_repairable = fields.Boolean(compute='_compute_is_repairable')
repair_ids = fields.One2many('repair.order', 'picking_id')
diff --git a/addons/repair/models/stock_traceability.py b/addons/repair/models/stock_traceability.py
index 9613242889020..468d6ed55755c 100644
--- a/addons/repair/models/stock_traceability.py
+++ b/addons/repair/models/stock_traceability.py
@@ -3,12 +3,12 @@
from odoo import models, api
-class MrpStockReport(models.TransientModel):
- _inherit = 'stock.traceability.report'
+class StockTraceabilityReport(models.TransientModel):
+ _inherit = ['stock.traceability.report']
@api.model
def _get_reference(self, move_line):
- res_model, res_id, ref = super(MrpStockReport, self)._get_reference(move_line)
+ res_model, res_id, ref = super()._get_reference(move_line)
if move_line.move_id.repair_id:
res_model = 'repair.order'
res_id = move_line.move_id.repair_id.id
@@ -17,7 +17,7 @@ def _get_reference(self, move_line):
@api.model
def _get_linked_move_lines(self, move_line):
- move_lines, is_used = super(MrpStockReport, self)._get_linked_move_lines(move_line)
+ move_lines, is_used = super()._get_linked_move_lines(move_line)
if not move_lines:
move_lines = move_line.move_id.repair_id and move_line.consume_line_ids
if not is_used:
diff --git a/addons/repair/models/stock_warehouse.py b/addons/repair/models/stock_warehouse.py
index 933cda22a57cc..e187d0e452954 100644
--- a/addons/repair/models/stock_warehouse.py
+++ b/addons/repair/models/stock_warehouse.py
@@ -6,7 +6,7 @@
class StockWarehouse(models.Model):
- _inherit = 'stock.warehouse'
+ _inherit = ['stock.warehouse']
repair_type_id = fields.Many2one('stock.picking.type', 'Repair Operation Type', check_company=True)
repair_mto_pull_id = fields.Many2one(
diff --git a/addons/repair/report/stock_forecasted.py b/addons/repair/report/stock_forecasted.py
index 1bbaaf8b829b1..0f2347e80a211 100644
--- a/addons/repair/report/stock_forecasted.py
+++ b/addons/repair/report/stock_forecasted.py
@@ -4,8 +4,8 @@
from odoo import models
-class StockForecasted(models.AbstractModel):
- _inherit = 'stock.forecasted_product_product'
+class StockForecasted_Product_Product(models.AbstractModel):
+ _inherit = ['stock.forecasted_product_product']
def _get_reservation_data(self, move):
if move.repair_id and move.repair_line_type:
@@ -17,7 +17,7 @@ def _product_sale_domain(self, product_template_ids, product_ids):
When a product's move is bind at the same time to a Repair Order
and to a Sale Order, only take the data into account once, as a RO
"""
- sol_domain = super(StockForecasted, self)._product_sale_domain(product_template_ids, product_ids)
+ sol_domain = super()._product_sale_domain(product_template_ids, product_ids)
move_domain = self._product_domain(product_template_ids, product_ids)
move_domain += [
('repair_id', '!=', False),
diff --git a/addons/repair/wizard/stock_warn_insufficient_qty.py b/addons/repair/wizard/stock_warn_insufficient_qty.py
index 471dff216ec24..05d00366b597b 100644
--- a/addons/repair/wizard/stock_warn_insufficient_qty.py
+++ b/addons/repair/wizard/stock_warn_insufficient_qty.py
@@ -5,8 +5,7 @@
class StockWarnInsufficientQtyRepair(models.TransientModel):
- _name = 'stock.warn.insufficient.qty.repair'
- _inherit = 'stock.warn.insufficient.qty'
+ _inherit = ['stock.warn.insufficient.qty']
_description = 'Warn Insufficient Repair Quantity'
repair_id = fields.Many2one('repair.order', string='Repair')
diff --git a/addons/resource/models/res_company.py b/addons/resource/models/res_company.py
index 3ba30d249a114..5ad3935d0ff17 100644
--- a/addons/resource/models/res_company.py
+++ b/addons/resource/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
resource_calendar_ids = fields.One2many(
'resource.calendar', 'company_id', 'Working Hours')
diff --git a/addons/resource/models/res_users.py b/addons/resource/models/res_users.py
index ef4f885919e56..5ebd1a4a79290 100644
--- a/addons/resource/models/res_users.py
+++ b/addons/resource/models/res_users.py
@@ -5,7 +5,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
resource_ids = fields.One2many(
'resource.resource', 'user_id', 'Resources')
diff --git a/addons/resource/models/resource_calendar.py b/addons/resource/models/resource_calendar.py
index 1619e8d8e1c53..a2b34a8a4e334 100644
--- a/addons/resource/models/resource_calendar.py
+++ b/addons/resource/models/resource_calendar.py
@@ -34,7 +34,6 @@ class ResourceCalendar(models.Model):
All methods in this class use intervals. An interval is a tuple holding
(begin_datetime, end_datetime). A list of intervals is therefore a list of
tuples, holding several intervals of work or leaves. """
- _name = "resource.calendar"
_description = "Resource Working Time"
@api.model
diff --git a/addons/resource/models/resource_calendar_attendance.py b/addons/resource/models/resource_calendar_attendance.py
index a914d7bb16157..3fa827d3cf1ff 100644
--- a/addons/resource/models/resource_calendar_attendance.py
+++ b/addons/resource/models/resource_calendar_attendance.py
@@ -6,7 +6,6 @@
class ResourceCalendarAttendance(models.Model):
- _name = "resource.calendar.attendance"
_description = "Work Detail"
_order = 'sequence, week_type, dayofweek, hour_from'
diff --git a/addons/resource/models/resource_calendar_leaves.py b/addons/resource/models/resource_calendar_leaves.py
index ebbf7426b2c7f..b3e700056868b 100644
--- a/addons/resource/models/resource_calendar_leaves.py
+++ b/addons/resource/models/resource_calendar_leaves.py
@@ -9,7 +9,6 @@
class ResourceCalendarLeaves(models.Model):
- _name = "resource.calendar.leaves"
_description = "Resource Time Off Detail"
_order = "date_from"
diff --git a/addons/resource/models/resource_mixin.py b/addons/resource/models/resource_mixin.py
index 460a1c4e291b3..1ec5e277e2842 100644
--- a/addons/resource/models/resource_mixin.py
+++ b/addons/resource/models/resource_mixin.py
@@ -9,7 +9,6 @@
class ResourceMixin(models.AbstractModel):
- _name = "resource.mixin"
_description = 'Resource Mixin'
resource_id = fields.Many2one(
diff --git a/addons/resource/models/resource_resource.py b/addons/resource/models/resource_resource.py
index ac252b829f43e..51e3cc2c74f9d 100644
--- a/addons/resource/models/resource_resource.py
+++ b/addons/resource/models/resource_resource.py
@@ -12,7 +12,6 @@
class ResourceResource(models.Model):
- _name = "resource.resource"
_description = "Resources"
_order = "name"
diff --git a/addons/resource_mail/models/resource_resource.py b/addons/resource_mail/models/resource_resource.py
index fb5cb7015317f..50e1a9c720b39 100644
--- a/addons/resource_mail/models/resource_resource.py
+++ b/addons/resource_mail/models/resource_resource.py
@@ -5,6 +5,6 @@
class ResourceResource(models.Model):
- _inherit = 'resource.resource'
+ _inherit = ['resource.resource']
im_status = fields.Char(related='user_id.im_status')
diff --git a/addons/sale/models/account_move.py b/addons/sale/models/account_move.py
index da65050977050..398c6eb3f7d11 100644
--- a/addons/sale/models/account_move.py
+++ b/addons/sale/models/account_move.py
@@ -6,7 +6,6 @@
class AccountMove(models.Model):
- _name = 'account.move'
_inherit = ['account.move', 'utm.mixin']
@api.model
diff --git a/addons/sale/models/account_move_line.py b/addons/sale/models/account_move_line.py
index f1817aca4dc74..c740b4dbc6f42 100644
--- a/addons/sale/models/account_move_line.py
+++ b/addons/sale/models/account_move_line.py
@@ -6,7 +6,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
is_downpayment = fields.Boolean()
sale_line_ids = fields.Many2many(
diff --git a/addons/sale/models/analytic.py b/addons/sale/models/analytic.py
index 5644d59c0d9eb..b961627cb275e 100644
--- a/addons/sale/models/analytic.py
+++ b/addons/sale/models/analytic.py
@@ -5,13 +5,13 @@
class AccountAnalyticLine(models.Model):
- _inherit = "account.analytic.line"
+ _inherit = ["account.analytic.line"]
so_line = fields.Many2one('sale.order.line', string='Sales Order Item', domain=[('qty_delivered_method', '=', 'analytic')], index='btree_not_null')
class AccountAnalyticApplicability(models.Model):
- _inherit = 'account.analytic.applicability'
+ _inherit = ['account.analytic.applicability']
_description = "Analytic Plan's Applicabilities"
business_domain = fields.Selection(
diff --git a/addons/sale/models/chart_template.py b/addons/sale/models/chart_template.py
index da094b7184625..6f5cf8655a9f2 100644
--- a/addons/sale/models/chart_template.py
+++ b/addons/sale/models/chart_template.py
@@ -2,7 +2,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = 'account.chart.template'
+ _inherit = ['account.chart.template']
def _get_property_accounts(self, additional_properties):
property_accounts = super()._get_property_accounts(additional_properties)
diff --git a/addons/sale/models/crm_team.py b/addons/sale/models/crm_team.py
index a6a878e03435e..9853b299c36f6 100644
--- a/addons/sale/models/crm_team.py
+++ b/addons/sale/models/crm_team.py
@@ -7,7 +7,7 @@
class CrmTeam(models.Model):
- _inherit = 'crm.team'
+ _inherit = ['crm.team']
invoiced = fields.Float(
compute='_compute_invoiced',
diff --git a/addons/sale/models/payment_provider.py b/addons/sale/models/payment_provider.py
index d16ccf7f0823e..7a5d0748b37c1 100644
--- a/addons/sale/models/payment_provider.py
+++ b/addons/sale/models/payment_provider.py
@@ -5,7 +5,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
so_reference_type = fields.Selection(string='Communication',
selection=[
diff --git a/addons/sale/models/payment_transaction.py b/addons/sale/models/payment_transaction.py
index 84e67adc01d8c..396ec6e578421 100644
--- a/addons/sale/models/payment_transaction.py
+++ b/addons/sale/models/payment_transaction.py
@@ -8,7 +8,7 @@
class PaymentTransaction(models.Model):
- _inherit = 'payment.transaction'
+ _inherit = ['payment.transaction']
sale_order_ids = fields.Many2many('sale.order', 'sale_order_transaction_rel', 'transaction_id', 'sale_order_id',
string='Sales Orders', copy=False, readonly=True)
diff --git a/addons/sale/models/product_category.py b/addons/sale/models/product_category.py
index 1fa32f9239a8f..559c89759bae6 100644
--- a/addons/sale/models/product_category.py
+++ b/addons/sale/models/product_category.py
@@ -2,7 +2,7 @@
class ProductCategory(models.Model):
- _inherit = "product.category"
+ _inherit = ["product.category"]
property_account_downpayment_categ_id = fields.Many2one(
comodel_name='account.account',
diff --git a/addons/sale/models/product_document.py b/addons/sale/models/product_document.py
index 14bb6135a3deb..887258bf53436 100644
--- a/addons/sale/models/product_document.py
+++ b/addons/sale/models/product_document.py
@@ -4,7 +4,7 @@
class ProductDocument(models.Model):
- _inherit = 'product.document'
+ _inherit = ['product.document']
attached_on_sale = fields.Selection(
selection=[
diff --git a/addons/sale/models/product_product.py b/addons/sale/models/product_product.py
index bc4b942ec6d7f..8f66f24dac2a0 100644
--- a/addons/sale/models/product_product.py
+++ b/addons/sale/models/product_product.py
@@ -8,7 +8,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
sales_count = fields.Float(compute='_compute_sales_count', string='Sold', digits='Product Unit of Measure')
@@ -100,7 +100,7 @@ def _filter_to_unlink(self):
class ProductAttributeCustomValue(models.Model):
- _inherit = "product.attribute.custom.value"
+ _inherit = ["product.attribute.custom.value"]
sale_order_line_id = fields.Many2one('sale.order.line', string="Sales Order Line", ondelete='cascade')
@@ -108,7 +108,8 @@ class ProductAttributeCustomValue(models.Model):
('sol_custom_value_unique', 'unique(custom_product_template_attribute_value_id, sale_order_line_id)', "Only one Custom Value is allowed per Attribute Value per Sales Order Line.")
]
+
class ProductPackaging(models.Model):
- _inherit = 'product.packaging'
+ _inherit = ['product.packaging']
sales = fields.Boolean("Sales", default=True, help="If true, the packaging can be used for sales orders")
diff --git a/addons/sale/models/product_template.py b/addons/sale/models/product_template.py
index 53d85cdea68a8..8485e6d1ce1f8 100644
--- a/addons/sale/models/product_template.py
+++ b/addons/sale/models/product_template.py
@@ -10,7 +10,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
_check_company_auto = True
service_type = fields.Selection(
diff --git a/addons/sale/models/res_company.py b/addons/sale/models/res_company.py
index bd46bf21c118c..bfb1c78d2fdc6 100644
--- a/addons/sale/models/res_company.py
+++ b/addons/sale/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
_check_company_auto = True
_sql_constraints = [
diff --git a/addons/sale/models/res_partner.py b/addons/sale/models/res_partner.py
index bdacb3d3d1d2b..69a3755b23b29 100644
--- a/addons/sale/models/res_partner.py
+++ b/addons/sale/models/res_partner.py
@@ -6,7 +6,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
sale_order_count = fields.Integer(
string="Sale Order Count",
diff --git a/addons/sale/models/sale_order.py b/addons/sale/models/sale_order.py
index 318f6b2de0743..6cca601b08f8b 100644
--- a/addons/sale/models/sale_order.py
+++ b/addons/sale/models/sale_order.py
@@ -47,7 +47,6 @@
class SaleOrder(models.Model):
- _name = 'sale.order'
_inherit = ['portal.mixin', 'product.catalog.mixin', 'mail.thread', 'mail.activity.mixin', 'utm.mixin']
_description = "Sales Order"
_order = 'date_order desc, id desc'
diff --git a/addons/sale/models/sale_order_line.py b/addons/sale/models/sale_order_line.py
index 4dbc4edf20f83..5e1d0c12d2b40 100644
--- a/addons/sale/models/sale_order_line.py
+++ b/addons/sale/models/sale_order_line.py
@@ -14,8 +14,7 @@
class SaleOrderLine(models.Model):
- _name = 'sale.order.line'
- _inherit = 'analytic.mixin'
+ _inherit = ['analytic.mixin']
_description = "Sales Order Line"
_rec_names_search = ['name', 'order_id.name']
_order = 'order_id, sequence, id'
diff --git a/addons/sale/models/utm_campaign.py b/addons/sale/models/utm_campaign.py
index 33af74d87e7e6..3faa3790f10db 100644
--- a/addons/sale/models/utm_campaign.py
+++ b/addons/sale/models/utm_campaign.py
@@ -3,8 +3,9 @@
from odoo import fields, models
+
class UtmCampaign(models.Model):
- _inherit = 'utm.campaign'
+ _inherit = ['utm.campaign']
_description = 'UTM Campaign'
quotation_count = fields.Integer('Quotation Count',
diff --git a/addons/sale/report/account_invoice_report.py b/addons/sale/report/account_invoice_report.py
index 42a910ba3ab8b..f93817be52c9a 100644
--- a/addons/sale/report/account_invoice_report.py
+++ b/addons/sale/report/account_invoice_report.py
@@ -6,7 +6,7 @@
class AccountInvoiceReport(models.Model):
- _inherit = 'account.invoice.report'
+ _inherit = ['account.invoice.report']
team_id = fields.Many2one(comodel_name='crm.team', string="Sales Team")
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index 87859a7a9b60d..1d1eead353c50 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -6,7 +6,6 @@
class SaleReport(models.Model):
- _name = "sale.report"
_description = "Sales Analysis Report"
_auto = False
_rec_name = 'date'
diff --git a/addons/sale/wizard/base_document_layout.py b/addons/sale/wizard/base_document_layout.py
index f2d1646858a26..6a041ce445b7c 100644
--- a/addons/sale/wizard/base_document_layout.py
+++ b/addons/sale/wizard/base_document_layout.py
@@ -4,7 +4,7 @@
class BaseDocumentLayout(models.TransientModel):
- _inherit = 'base.document.layout'
+ _inherit = ['base.document.layout']
def _get_preview_template(self):
if (
diff --git a/addons/sale/wizard/mass_cancel_orders.py b/addons/sale/wizard/mass_cancel_orders.py
index 5ec00ee2664b7..d6d54df08dbfa 100644
--- a/addons/sale/wizard/mass_cancel_orders.py
+++ b/addons/sale/wizard/mass_cancel_orders.py
@@ -3,8 +3,7 @@
from odoo import api, fields, models
-class MassCancelOrders(models.TransientModel):
- _name = 'sale.mass.cancel.orders'
+class SaleMassCancelOrders(models.TransientModel):
_description = "Cancel multiple quotations"
sale_order_ids = fields.Many2many(
diff --git a/addons/sale/wizard/payment_link_wizard.py b/addons/sale/wizard/payment_link_wizard.py
index e1e169e1ee749..4d0c90324c887 100644
--- a/addons/sale/wizard/payment_link_wizard.py
+++ b/addons/sale/wizard/payment_link_wizard.py
@@ -8,7 +8,7 @@
class PaymentLinkWizard(models.TransientModel):
- _inherit = 'payment.link.wizard'
+ _inherit = ['payment.link.wizard']
_description = 'Generate Sales Payment Link'
amount_paid = fields.Monetary(string="Already Paid", readonly=True)
diff --git a/addons/sale/wizard/payment_provider_onboarding_wizard.py b/addons/sale/wizard/payment_provider_onboarding_wizard.py
index d3bc79f187daf..cfb783916e91d 100644
--- a/addons/sale/wizard/payment_provider_onboarding_wizard.py
+++ b/addons/sale/wizard/payment_provider_onboarding_wizard.py
@@ -4,11 +4,10 @@
from odoo import fields, models
-class PaymentWizard(models.TransientModel):
+class SalePaymentProviderOnboardingWizard(models.TransientModel):
""" Override for the sale quotation onboarding panel. """
- _inherit = 'payment.provider.onboarding.wizard'
- _name = 'sale.payment.provider.onboarding.wizard'
+ _inherit = ['payment.provider.onboarding.wizard']
_description = 'Sale Payment provider onboarding wizard'
def _get_default_payment_method(self):
diff --git a/addons/sale/wizard/res_config_settings.py b/addons/sale/wizard/res_config_settings.py
index fddf3646ccf22..b237107ee86e3 100644
--- a/addons/sale/wizard/res_config_settings.py
+++ b/addons/sale/wizard/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
# Defaults
default_invoice_policy = fields.Selection(
diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py
index ac94c777d9baa..463e7157fd3fd 100644
--- a/addons/sale/wizard/sale_make_invoice_advance.py
+++ b/addons/sale/wizard/sale_make_invoice_advance.py
@@ -7,7 +7,6 @@
class SaleAdvancePaymentInv(models.TransientModel):
- _name = 'sale.advance.payment.inv'
_description = "Sales Advance Payment Invoice"
advance_payment_method = fields.Selection(
diff --git a/addons/sale/wizard/sale_order_cancel.py b/addons/sale/wizard/sale_order_cancel.py
index 9c2c102ac7397..6fdacae049d69 100644
--- a/addons/sale/wizard/sale_order_cancel.py
+++ b/addons/sale/wizard/sale_order_cancel.py
@@ -6,8 +6,7 @@
class SaleOrderCancel(models.TransientModel):
- _name = 'sale.order.cancel'
- _inherit = 'mail.composer.mixin'
+ _inherit = ['mail.composer.mixin']
_description = "Sales Order Cancel"
@api.model
diff --git a/addons/sale/wizard/sale_order_discount.py b/addons/sale/wizard/sale_order_discount.py
index 833f7c0b9f54b..d9bb681279019 100644
--- a/addons/sale/wizard/sale_order_discount.py
+++ b/addons/sale/wizard/sale_order_discount.py
@@ -7,7 +7,6 @@
class SaleOrderDiscount(models.TransientModel):
- _name = 'sale.order.discount'
_description = "Discount Wizard"
sale_order_id = fields.Many2one(
diff --git a/addons/sale_async_emails/models/sale_order.py b/addons/sale_async_emails/models/sale_order.py
index e5c54bbe457a4..e30b2be2320b6 100644
--- a/addons/sale_async_emails/models/sale_order.py
+++ b/addons/sale_async_emails/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
pending_email_template_id = fields.Many2one(
string="Pending Email Template",
diff --git a/addons/sale_crm/models/crm_lead.py b/addons/sale_crm/models/crm_lead.py
index 610b60cb601eb..aed7b7a61f553 100644
--- a/addons/sale_crm/models/crm_lead.py
+++ b/addons/sale_crm/models/crm_lead.py
@@ -8,7 +8,7 @@
class CrmLead(models.Model):
- _inherit = 'crm.lead'
+ _inherit = ['crm.lead']
sale_amount_total = fields.Monetary(compute='_compute_sale_data', string="Sum of Orders", help="Untaxed Total of Confirmed Orders", currency_field='company_currency')
quotation_count = fields.Integer(compute='_compute_sale_data', string="Number of Quotations")
diff --git a/addons/sale_crm/models/crm_team.py b/addons/sale_crm/models/crm_team.py
index 0694859c6bac9..fb1e2a9e293a3 100644
--- a/addons/sale_crm/models/crm_team.py
+++ b/addons/sale_crm/models/crm_team.py
@@ -6,7 +6,7 @@
class CrmTeam(models.Model):
- _inherit = 'crm.team'
+ _inherit = ['crm.team']
def _compute_dashboard_button_name(self):
super(CrmTeam, self)._compute_dashboard_button_name()
diff --git a/addons/sale_crm/models/res_users.py b/addons/sale_crm/models/res_users.py
index c567bfc8f8c99..1f25ab44e17ef 100644
--- a/addons/sale_crm/models/res_users.py
+++ b/addons/sale_crm/models/res_users.py
@@ -5,6 +5,6 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
target_sales_invoiced = fields.Integer('Invoiced in Sales Orders Target')
diff --git a/addons/sale_crm/models/sale_order.py b/addons/sale_crm/models/sale_order.py
index 21708498c7759..c44b28050c433 100644
--- a/addons/sale_crm/models/sale_order.py
+++ b/addons/sale_crm/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
opportunity_id = fields.Many2one(
'crm.lead', string='Opportunity', check_company=True,
diff --git a/addons/sale_crm/wizard/crm_opportunity_to_quotation.py b/addons/sale_crm/wizard/crm_opportunity_to_quotation.py
index 4442945eda998..957ce4ee32706 100644
--- a/addons/sale_crm/wizard/crm_opportunity_to_quotation.py
+++ b/addons/sale_crm/wizard/crm_opportunity_to_quotation.py
@@ -5,13 +5,12 @@
from odoo.exceptions import UserError
-class Opportunity2Quotation(models.TransientModel):
- _name = 'crm.quotation.partner'
+class CrmQuotationPartner(models.TransientModel):
_description = 'Create new or use existing Customer on new Quotation'
@api.model
def default_get(self, fields):
- result = super(Opportunity2Quotation, self).default_get(fields)
+ result = super().default_get(fields)
active_model = self._context.get('active_model')
if active_model != 'crm.lead':
diff --git a/addons/sale_edi_ubl/models/sale_edi_common.py b/addons/sale_edi_ubl/models/sale_edi_common.py
index 53ce168027b5e..db0b3ed2d6013 100644
--- a/addons/sale_edi_ubl/models/sale_edi_common.py
+++ b/addons/sale_edi_ubl/models/sale_edi_common.py
@@ -4,8 +4,7 @@
class SaleEdiCommon(models.AbstractModel):
- _name = 'sale.edi.common'
- _inherit = 'account.edi.common'
+ _inherit = ['account.edi.common']
_description = "Common functions for EDI orders"
# -------------------------------------------------------------------------
diff --git a/addons/sale_edi_ubl/models/sale_edi_xml_ubl_bis3.py b/addons/sale_edi_ubl/models/sale_edi_xml_ubl_bis3.py
index 609853d1dbc50..819f71eb19645 100644
--- a/addons/sale_edi_ubl/models/sale_edi_xml_ubl_bis3.py
+++ b/addons/sale_edi_ubl/models/sale_edi_xml_ubl_bis3.py
@@ -1,8 +1,7 @@
from odoo import models, Command
-class SaleEdiXmlUBLBIS3(models.AbstractModel):
- _name = 'sale.edi.xml.ubl_bis3'
+class SaleEdiXmlUbl_Bis3(models.AbstractModel):
_inherit = ['sale.edi.common', 'account.edi.xml.ubl_bis3']
_description = "UBL BIS Ordering 3.0"
diff --git a/addons/sale_edi_ubl/models/sale_order.py b/addons/sale_edi_ubl/models/sale_order.py
index b144dcf683eba..138433425fc00 100644
--- a/addons/sale_edi_ubl/models/sale_order.py
+++ b/addons/sale_edi_ubl/models/sale_order.py
@@ -2,7 +2,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
def _get_order_edi_decoder(self, file_data):
""" Override of sale to add edi decoder for xml files.
diff --git a/addons/sale_expense/models/account_move_line.py b/addons/sale_expense/models/account_move_line.py
index eb96256d4c807..283d8a0c7d1e8 100644
--- a/addons/sale_expense/models/account_move_line.py
+++ b/addons/sale_expense/models/account_move_line.py
@@ -4,7 +4,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _sale_can_be_reinvoice(self):
""" determine if the generated analytic line should be reinvoiced or not.
@@ -44,7 +44,7 @@ def _sale_create_reinvoice_sale_line(self):
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _reverse_moves(self, default_values_list=None, cancel=False):
self.expense_sheet_id._sale_expense_reset_sol_quantities()
diff --git a/addons/sale_expense/models/hr_expense.py b/addons/sale_expense/models/hr_expense.py
index c061f909e2610..9485690cd87ac 100644
--- a/addons/sale_expense/models/hr_expense.py
+++ b/addons/sale_expense/models/hr_expense.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Expense(models.Model):
- _inherit = "hr.expense"
+class HrExpense(models.Model):
+ _inherit = ["hr.expense"]
sale_order_id = fields.Many2one('sale.order', compute='_compute_sale_order_id', store=True, string='Customer to Reinvoice', readonly=False, tracking=True,
# NOTE: only confirmed SO can be selected, but this domain in activated throught the name search with the `sale_expense_all_order`
@@ -31,7 +31,7 @@ def _onchange_sale_order_id(self):
self.env.add_to_compute(self._fields['analytic_distribution'], to_reset)
def _get_split_values(self):
- vals = super(Expense, self)._get_split_values()
+ vals = super()._get_split_values()
for split_value in vals:
split_value['sale_order_id'] = self.sale_order_id.id
return vals
diff --git a/addons/sale_expense/models/hr_expense_sheet.py b/addons/sale_expense/models/hr_expense_sheet.py
index b5be3d8b611d7..6e2c78d849a2c 100644
--- a/addons/sale_expense/models/hr_expense_sheet.py
+++ b/addons/sale_expense/models/hr_expense_sheet.py
@@ -5,7 +5,7 @@
class HrExpenseSheet(models.Model):
- _inherit = "hr.expense.sheet"
+ _inherit = ["hr.expense.sheet"]
sale_order_count = fields.Integer(compute='_compute_sale_order_count')
diff --git a/addons/sale_expense/models/hr_expense_split.py b/addons/sale_expense/models/hr_expense_split.py
index bec5ed5218924..aa23f853ab1d6 100644
--- a/addons/sale_expense/models/hr_expense_split.py
+++ b/addons/sale_expense/models/hr_expense_split.py
@@ -5,7 +5,7 @@
class HrExpenseSplit(models.TransientModel):
- _inherit = "hr.expense.split"
+ _inherit = ["hr.expense.split"]
def default_get(self, fields):
result = super(HrExpenseSplit, self).default_get(fields)
diff --git a/addons/sale_expense/models/product_template.py b/addons/sale_expense/models/product_template.py
index 0ee1398a2d064..6fa4f69ddd3b6 100644
--- a/addons/sale_expense/models/product_template.py
+++ b/addons/sale_expense/models/product_template.py
@@ -5,7 +5,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
expense_policy_tooltip = fields.Char(compute='_compute_expense_policy_tooltip')
diff --git a/addons/sale_expense/models/sale_order.py b/addons/sale_expense/models/sale_order.py
index 6b3f7e9b4bd5a..8b983103ba7d7 100644
--- a/addons/sale_expense/models/sale_order.py
+++ b/addons/sale_expense/models/sale_order.py
@@ -6,7 +6,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
expense_ids = fields.One2many('hr.expense', 'sale_order_id', string='Expenses', domain=[('state', '=', 'done')], readonly=True, copy=False)
expense_count = fields.Integer("# of Expenses", compute='_compute_expense_count', compute_sudo=True)
diff --git a/addons/sale_expense_margin/models/account_move_line.py b/addons/sale_expense_margin/models/account_move_line.py
index 9085a25274fd2..ac9320b8a1700 100644
--- a/addons/sale_expense_margin/models/account_move_line.py
+++ b/addons/sale_expense_margin/models/account_move_line.py
@@ -5,7 +5,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _sale_prepare_sale_line_values(self, order, price):
res = super()._sale_prepare_sale_line_values(order, price)
diff --git a/addons/sale_expense_margin/models/sale_order_line.py b/addons/sale_expense_margin/models/sale_order_line.py
index 26503e54ccbc7..e4fa920cab6c6 100644
--- a/addons/sale_expense_margin/models/sale_order_line.py
+++ b/addons/sale_expense_margin/models/sale_order_line.py
@@ -2,8 +2,9 @@
from odoo import api, models, fields
+
class SaleOrderLine(models.Model):
- _inherit = "sale.order.line"
+ _inherit = ["sale.order.line"]
expense_id = fields.Many2one('hr.expense', string='Expense')
diff --git a/addons/sale_loyalty/models/loyalty_card.py b/addons/sale_loyalty/models/loyalty_card.py
index 9112167c9cdde..ac51679712e6e 100644
--- a/addons/sale_loyalty/models/loyalty_card.py
+++ b/addons/sale_loyalty/models/loyalty_card.py
@@ -5,7 +5,7 @@
class LoyaltyCard(models.Model):
- _inherit = 'loyalty.card'
+ _inherit = ['loyalty.card']
order_id = fields.Many2one(
comodel_name='sale.order',
diff --git a/addons/sale_loyalty/models/loyalty_history.py b/addons/sale_loyalty/models/loyalty_history.py
index fb46e1f89e5b6..590295994fb2e 100644
--- a/addons/sale_loyalty/models/loyalty_history.py
+++ b/addons/sale_loyalty/models/loyalty_history.py
@@ -4,7 +4,7 @@
class LoyaltyHistory(models.Model):
- _inherit = 'loyalty.history'
+ _inherit = ['loyalty.history']
def _get_order_portal_url(self):
if self.order_id and self.order_model == 'sale.order':
diff --git a/addons/sale_loyalty/models/loyalty_program.py b/addons/sale_loyalty/models/loyalty_program.py
index 356443b33effe..8c41cc6b3bc00 100644
--- a/addons/sale_loyalty/models/loyalty_program.py
+++ b/addons/sale_loyalty/models/loyalty_program.py
@@ -5,7 +5,7 @@
class LoyaltyProgram(models.Model):
- _inherit = 'loyalty.program'
+ _inherit = ['loyalty.program']
order_count = fields.Integer(compute='_compute_order_count')
sale_ok = fields.Boolean(string="Sales", default=True)
diff --git a/addons/sale_loyalty/models/loyalty_reward.py b/addons/sale_loyalty/models/loyalty_reward.py
index faf268ab306e7..72987223d652b 100644
--- a/addons/sale_loyalty/models/loyalty_reward.py
+++ b/addons/sale_loyalty/models/loyalty_reward.py
@@ -5,7 +5,7 @@
class LoyaltyReward(models.Model):
- _inherit = 'loyalty.reward'
+ _inherit = ['loyalty.reward']
def _get_discount_product_values(self):
res = super()._get_discount_product_values()
diff --git a/addons/sale_loyalty/models/sale_order.py b/addons/sale_loyalty/models/sale_order.py
index 791d8912e9293..9d0825ad45f39 100644
--- a/addons/sale_loyalty/models/sale_order.py
+++ b/addons/sale_loyalty/models/sale_order.py
@@ -17,7 +17,7 @@ def _generate_random_reward_code():
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
# Contains how much points should be given to a coupon upon validating the order
applied_coupon_ids = fields.Many2many(
diff --git a/addons/sale_loyalty/models/sale_order_coupon_points.py b/addons/sale_loyalty/models/sale_order_coupon_points.py
index 904cdbccc5284..9e6c8a13c8a71 100644
--- a/addons/sale_loyalty/models/sale_order_coupon_points.py
+++ b/addons/sale_loyalty/models/sale_order_coupon_points.py
@@ -5,7 +5,6 @@
class SaleOrderCouponPoints(models.Model):
- _name = 'sale.order.coupon.points'
_description = 'Sale Order Coupon Points - Keeps track of how a sale order impacts a coupon'
order_id = fields.Many2one(comodel_name='sale.order', required=True, ondelete='cascade')
diff --git a/addons/sale_loyalty/models/sale_order_line.py b/addons/sale_loyalty/models/sale_order_line.py
index b3125e8fa69c4..c41fa64a5bbb0 100644
--- a/addons/sale_loyalty/models/sale_order_line.py
+++ b/addons/sale_loyalty/models/sale_order_line.py
@@ -5,7 +5,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
is_reward_line = fields.Boolean(
string="Is a program reward line", compute='_compute_is_reward_line')
diff --git a/addons/sale_loyalty/wizard/sale_loyalty_coupon_wizard.py b/addons/sale_loyalty/wizard/sale_loyalty_coupon_wizard.py
index 5f7dccc9d4fd8..e327a46ad6c8c 100644
--- a/addons/sale_loyalty/wizard/sale_loyalty_coupon_wizard.py
+++ b/addons/sale_loyalty/wizard/sale_loyalty_coupon_wizard.py
@@ -4,8 +4,8 @@
from odoo import _, fields, models
from odoo.exceptions import ValidationError
+
class SaleLoyaltyCouponWizard(models.TransientModel):
- _name = 'sale.loyalty.coupon.wizard'
_description = 'Sale Loyalty - Apply Coupon Wizard'
order_id = fields.Many2one('sale.order', default=lambda self: self.env.context.get('active_id'), required=True)
diff --git a/addons/sale_loyalty/wizard/sale_loyalty_reward_wizard.py b/addons/sale_loyalty/wizard/sale_loyalty_reward_wizard.py
index 6099039e1e3e9..0c2910f8ac9c6 100644
--- a/addons/sale_loyalty/wizard/sale_loyalty_reward_wizard.py
+++ b/addons/sale_loyalty/wizard/sale_loyalty_reward_wizard.py
@@ -4,8 +4,8 @@
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
+
class SaleLoyaltyRewardWizard(models.TransientModel):
- _name = 'sale.loyalty.reward.wizard'
_description = 'Sale Loyalty - Reward Selection Wizard'
order_id = fields.Many2one('sale.order', default=lambda self: self.env.context.get('active_id'), required=True)
diff --git a/addons/sale_loyalty_delivery/models/loyalty_program.py b/addons/sale_loyalty_delivery/models/loyalty_program.py
index b4205de66c833..18e5b3f19785a 100644
--- a/addons/sale_loyalty_delivery/models/loyalty_program.py
+++ b/addons/sale_loyalty_delivery/models/loyalty_program.py
@@ -5,7 +5,7 @@
class LoyaltyProgram(models.Model):
- _inherit = 'loyalty.program'
+ _inherit = ['loyalty.program']
@api.model
def _program_type_default_values(self):
diff --git a/addons/sale_loyalty_delivery/models/loyalty_reward.py b/addons/sale_loyalty_delivery/models/loyalty_reward.py
index 0f52046bb9939..780420bc92046 100644
--- a/addons/sale_loyalty_delivery/models/loyalty_reward.py
+++ b/addons/sale_loyalty_delivery/models/loyalty_reward.py
@@ -5,7 +5,7 @@
class LoyaltyReward(models.Model):
- _inherit = 'loyalty.reward'
+ _inherit = ['loyalty.reward']
reward_type = fields.Selection(
selection_add=[('shipping', 'Free Shipping')],
diff --git a/addons/sale_loyalty_delivery/models/sale_order.py b/addons/sale_loyalty_delivery/models/sale_order.py
index 68ab6f20e0893..68f721c6a3f10 100644
--- a/addons/sale_loyalty_delivery/models/sale_order.py
+++ b/addons/sale_loyalty_delivery/models/sale_order.py
@@ -6,7 +6,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
# delivery overrides
diff --git a/addons/sale_management/models/digest.py b/addons/sale_management/models/digest.py
index 97359837bbca6..fb1fb53e6b2c9 100644
--- a/addons/sale_management/models/digest.py
+++ b/addons/sale_management/models/digest.py
@@ -5,8 +5,8 @@
from odoo.exceptions import AccessError
-class Digest(models.Model):
- _inherit = 'digest.digest'
+class DigestDigest(models.Model):
+ _inherit = ['digest.digest']
kpi_all_sale_total = fields.Boolean('All Sales')
kpi_all_sale_total_value = fields.Monetary(compute='_compute_kpi_sale_total_value')
@@ -24,6 +24,6 @@ def _compute_kpi_sale_total_value(self):
)
def _compute_kpis_actions(self, company, user):
- res = super(Digest, self)._compute_kpis_actions(company, user)
+ res = super()._compute_kpis_actions(company, user)
res['kpi_all_sale_total'] = 'sale.report_all_channels_sales_action&menu_id=%s' % self.env.ref('sale.sale_menu_root').id
return res
diff --git a/addons/sale_management/models/res_company.py b/addons/sale_management/models/res_company.py
index ea9e139ecbee6..5058d32a60b5f 100644
--- a/addons/sale_management/models/res_company.py
+++ b/addons/sale_management/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
_check_company_auto = True
sale_order_template_id = fields.Many2one(
diff --git a/addons/sale_management/models/res_config_settings.py b/addons/sale_management/models/res_config_settings.py
index 26dcb75d33d24..8e310ad5edf8f 100644
--- a/addons/sale_management/models/res_config_settings.py
+++ b/addons/sale_management/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
group_sale_order_template = fields.Boolean(
"Quotation Templates", implied_group='sale_management.group_sale_order_template')
diff --git a/addons/sale_management/models/sale_order.py b/addons/sale_management/models/sale_order.py
index 965c13c6e665d..1a18e97f4d47c 100644
--- a/addons/sale_management/models/sale_order.py
+++ b/addons/sale_management/models/sale_order.py
@@ -9,7 +9,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
sale_order_template_id = fields.Many2one(
comodel_name='sale.order.template',
diff --git a/addons/sale_management/models/sale_order_line.py b/addons/sale_management/models/sale_order_line.py
index 5048e53c5085d..f4df2864859fd 100644
--- a/addons/sale_management/models/sale_order_line.py
+++ b/addons/sale_management/models/sale_order_line.py
@@ -5,7 +5,7 @@
class SaleOrderLine(models.Model):
- _inherit = "sale.order.line"
+ _inherit = ["sale.order.line"]
_description = "Sales Order Line"
sale_order_option_ids = fields.One2many('sale.order.option', 'line_id', 'Optional Products Lines')
diff --git a/addons/sale_management/models/sale_order_option.py b/addons/sale_management/models/sale_order_option.py
index 7514051dc16ab..e355adf37442e 100644
--- a/addons/sale_management/models/sale_order_option.py
+++ b/addons/sale_management/models/sale_order_option.py
@@ -5,7 +5,6 @@
class SaleOrderOption(models.Model):
- _name = 'sale.order.option'
_description = "Sale Options"
_order = 'sequence, id'
diff --git a/addons/sale_management/models/sale_order_template.py b/addons/sale_management/models/sale_order_template.py
index 2dfa08da74e5c..d0f5ca411ead8 100644
--- a/addons/sale_management/models/sale_order_template.py
+++ b/addons/sale_management/models/sale_order_template.py
@@ -5,7 +5,6 @@
class SaleOrderTemplate(models.Model):
- _name = "sale.order.template"
_description = "Quotation Template"
_order = 'sequence, id'
diff --git a/addons/sale_management/models/sale_order_template_line.py b/addons/sale_management/models/sale_order_template_line.py
index f24aed96d0403..6a49502f45ca3 100644
--- a/addons/sale_management/models/sale_order_template_line.py
+++ b/addons/sale_management/models/sale_order_template_line.py
@@ -5,7 +5,6 @@
class SaleOrderTemplateLine(models.Model):
- _name = "sale.order.template.line"
_description = "Quotation Template Line"
_order = 'sale_order_template_id, sequence, id'
diff --git a/addons/sale_management/models/sale_order_template_option.py b/addons/sale_management/models/sale_order_template_option.py
index ffc54180bb156..b1f64dfbcbbf3 100644
--- a/addons/sale_management/models/sale_order_template_option.py
+++ b/addons/sale_management/models/sale_order_template_option.py
@@ -5,7 +5,6 @@
class SaleOrderTemplateOption(models.Model):
- _name = "sale.order.template.option"
_description = "Quotation Template Option"
_check_company_auto = True
diff --git a/addons/sale_margin/models/sale_order.py b/addons/sale_margin/models/sale_order.py
index 632947c260633..d66951e66c902 100644
--- a/addons/sale_margin/models/sale_order.py
+++ b/addons/sale_margin/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = "sale.order"
+ _inherit = ["sale.order"]
margin = fields.Monetary("Margin", compute='_compute_margin', store=True)
margin_percent = fields.Float("Margin (%)", compute='_compute_margin', store=True, aggregator="avg")
diff --git a/addons/sale_margin/models/sale_order_line.py b/addons/sale_margin/models/sale_order_line.py
index e0b9a9cf0e708..4fa0d36ec8404 100644
--- a/addons/sale_margin/models/sale_order_line.py
+++ b/addons/sale_margin/models/sale_order_line.py
@@ -5,7 +5,7 @@
class SaleOrderLine(models.Model):
- _inherit = "sale.order.line"
+ _inherit = ["sale.order.line"]
margin = fields.Float(
"Margin", compute='_compute_margin',
diff --git a/addons/sale_margin/report/sale_report.py b/addons/sale_margin/report/sale_report.py
index 49872ce43971d..8a7e743b4099d 100644
--- a/addons/sale_margin/report/sale_report.py
+++ b/addons/sale_margin/report/sale_report.py
@@ -5,7 +5,7 @@
class SaleReport(models.Model):
- _inherit = 'sale.report'
+ _inherit = ['sale.report']
margin = fields.Float('Margin')
diff --git a/addons/sale_mrp/models/account_move.py b/addons/sale_mrp/models/account_move.py
index 4fd7aeb31fd69..33c7118c89e6b 100644
--- a/addons/sale_mrp/models/account_move.py
+++ b/addons/sale_mrp/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
def _stock_account_get_anglo_saxon_price_unit(self):
price_unit = super(AccountMoveLine, self)._stock_account_get_anglo_saxon_price_unit()
diff --git a/addons/sale_mrp/models/mrp_bom.py b/addons/sale_mrp/models/mrp_bom.py
index dbd146d20b2b6..8cab2dc8c9a86 100644
--- a/addons/sale_mrp/models/mrp_bom.py
+++ b/addons/sale_mrp/models/mrp_bom.py
@@ -6,7 +6,7 @@
class MrpBom(models.Model):
- _inherit = 'mrp.bom'
+ _inherit = ['mrp.bom']
def toggle_active(self):
self.filtered(lambda bom: bom.active)._ensure_bom_is_free()
diff --git a/addons/sale_mrp/models/mrp_production.py b/addons/sale_mrp/models/mrp_production.py
index 769876ae268cf..5331cba0df792 100644
--- a/addons/sale_mrp/models/mrp_production.py
+++ b/addons/sale_mrp/models/mrp_production.py
@@ -5,7 +5,7 @@
class MrpProduction(models.Model):
- _inherit = 'mrp.production'
+ _inherit = ['mrp.production']
sale_order_count = fields.Integer(
"Count of Source SO",
diff --git a/addons/sale_mrp/models/sale_order.py b/addons/sale_mrp/models/sale_order.py
index 919cad21ce537..826237a516ee3 100644
--- a/addons/sale_mrp/models/sale_order.py
+++ b/addons/sale_mrp/models/sale_order.py
@@ -6,7 +6,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
mrp_production_count = fields.Integer(
"Count of MO generated",
diff --git a/addons/sale_mrp/models/sale_order_line.py b/addons/sale_mrp/models/sale_order_line.py
index ee47b2108a484..31f78cfb79b3c 100644
--- a/addons/sale_mrp/models/sale_order_line.py
+++ b/addons/sale_mrp/models/sale_order_line.py
@@ -6,7 +6,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
@api.depends('product_uom_qty', 'qty_delivered', 'product_id', 'state')
def _compute_qty_to_deliver(self):
diff --git a/addons/sale_mrp/models/stock_move_line.py b/addons/sale_mrp/models/stock_move_line.py
index 7cbcc1028d0eb..ff7d7a427b7c6 100644
--- a/addons/sale_mrp/models/stock_move_line.py
+++ b/addons/sale_mrp/models/stock_move_line.py
@@ -4,7 +4,7 @@
class StockMoveLine(models.Model):
- _inherit = 'stock.move.line'
+ _inherit = ['stock.move.line']
def _compute_sale_price(self):
kit_lines = self.filtered(lambda move_line: move_line.move_id.bom_line_id.bom_id.type == 'phantom')
diff --git a/addons/sale_mrp/models/stock_rule.py b/addons/sale_mrp/models/stock_rule.py
index e2c00e0fc6093..8976280af77da 100644
--- a/addons/sale_mrp/models/stock_rule.py
+++ b/addons/sale_mrp/models/stock_rule.py
@@ -2,7 +2,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
def _prepare_mo_vals(self, product_id, product_qty, product_uom, location_dest_id, name, origin, company_id, values, bom):
res = super()._prepare_mo_vals(product_id, product_qty, product_uom, location_dest_id, name, origin, company_id, values, bom)
diff --git a/addons/sale_pdf_quote_builder/models/ir_actions_report.py b/addons/sale_pdf_quote_builder/models/ir_actions_report.py
index d60b78055991f..6f8194388c4d0 100644
--- a/addons/sale_pdf_quote_builder/models/ir_actions_report.py
+++ b/addons/sale_pdf_quote_builder/models/ir_actions_report.py
@@ -10,7 +10,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
def _render_qweb_pdf_prepare_streams(self, report_ref, data, res_ids=None):
"""Override to add and fill headers, footers and product documents to the sale quotation."""
diff --git a/addons/sale_pdf_quote_builder/models/product_document.py b/addons/sale_pdf_quote_builder/models/product_document.py
index ffdfb9e58b87a..b41dd02d6ff64 100644
--- a/addons/sale_pdf_quote_builder/models/product_document.py
+++ b/addons/sale_pdf_quote_builder/models/product_document.py
@@ -9,7 +9,7 @@
class ProductDocument(models.Model):
- _inherit = 'product.document'
+ _inherit = ['product.document']
attached_on_sale = fields.Selection(
selection_add=[('inside', "Inside quote pdf")],
diff --git a/addons/sale_pdf_quote_builder/models/quotation_document.py b/addons/sale_pdf_quote_builder/models/quotation_document.py
index d09224b56b531..72ba115b20031 100644
--- a/addons/sale_pdf_quote_builder/models/quotation_document.py
+++ b/addons/sale_pdf_quote_builder/models/quotation_document.py
@@ -9,7 +9,6 @@
class QuotationDocument(models.Model):
- _name = 'quotation.document'
_description = "Quotation's Headers & Footers"
_inherits = {
'ir.attachment': 'ir_attachment_id',
diff --git a/addons/sale_pdf_quote_builder/models/sale_order.py b/addons/sale_pdf_quote_builder/models/sale_order.py
index cac9c6d70adec..711ff820f7495 100644
--- a/addons/sale_pdf_quote_builder/models/sale_order.py
+++ b/addons/sale_pdf_quote_builder/models/sale_order.py
@@ -6,7 +6,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
available_product_document_ids = fields.Many2many(
string="Available Product Documents",
diff --git a/addons/sale_pdf_quote_builder/models/sale_order_line.py b/addons/sale_pdf_quote_builder/models/sale_order_line.py
index bca5128e6eec7..2267fab11c554 100644
--- a/addons/sale_pdf_quote_builder/models/sale_order_line.py
+++ b/addons/sale_pdf_quote_builder/models/sale_order_line.py
@@ -4,7 +4,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
available_product_document_ids = fields.Many2many(
string="Available Product Documents",
diff --git a/addons/sale_pdf_quote_builder/models/sale_order_template.py b/addons/sale_pdf_quote_builder/models/sale_order_template.py
index 420b683e00b82..32d652c7b0917 100644
--- a/addons/sale_pdf_quote_builder/models/sale_order_template.py
+++ b/addons/sale_pdf_quote_builder/models/sale_order_template.py
@@ -4,7 +4,7 @@
class SaleOrderTemplate(models.Model):
- _inherit = 'sale.order.template'
+ _inherit = ['sale.order.template']
quotation_document_ids = fields.Many2many(
string="Headers and footers",
diff --git a/addons/sale_pdf_quote_builder/models/sale_pdf_form_field.py b/addons/sale_pdf_quote_builder/models/sale_pdf_form_field.py
index dfbf3fd3dfbfb..ae0c20dc0f1c4 100644
--- a/addons/sale_pdf_quote_builder/models/sale_pdf_form_field.py
+++ b/addons/sale_pdf_quote_builder/models/sale_pdf_form_field.py
@@ -9,7 +9,6 @@
class SalePdfFormField(models.Model):
- _name = 'sale.pdf.form.field'
_description = "Form fields of inside quotation documents."
_order = 'name'
diff --git a/addons/sale_product_matrix/models/product_template.py b/addons/sale_product_matrix/models/product_template.py
index 6493493229cf7..0deeaea3f4288 100644
--- a/addons/sale_product_matrix/models/product_template.py
+++ b/addons/sale_product_matrix/models/product_template.py
@@ -5,7 +5,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
product_add_mode = fields.Selection(
selection=[
diff --git a/addons/sale_product_matrix/models/sale_order.py b/addons/sale_product_matrix/models/sale_order.py
index e7f3d6e4053a9..a0b58e7da43e7 100644
--- a/addons/sale_product_matrix/models/sale_order.py
+++ b/addons/sale_product_matrix/models/sale_order.py
@@ -6,7 +6,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
# if set, the matrix of the products configurable by matrix will be shown
# on the report of the order.
diff --git a/addons/sale_product_matrix/models/sale_order_line.py b/addons/sale_product_matrix/models/sale_order_line.py
index accfb4b6b4aa6..010836b5ef68f 100644
--- a/addons/sale_product_matrix/models/sale_order_line.py
+++ b/addons/sale_product_matrix/models/sale_order_line.py
@@ -4,6 +4,6 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
product_add_mode = fields.Selection(related='product_template_id.product_add_mode', depends=['product_template_id'])
diff --git a/addons/sale_project/models/account_move.py b/addons/sale_project/models/account_move.py
index 21542201279e5..a507f4d843885 100644
--- a/addons/sale_project/models/account_move.py
+++ b/addons/sale_project/models/account_move.py
@@ -4,7 +4,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
def _get_action_per_item(self):
action = self.env.ref('account.action_move_out_invoice_type').id
diff --git a/addons/sale_project/models/account_move_line.py b/addons/sale_project/models/account_move_line.py
index 8d5023c78ad5f..291f853e6485a 100644
--- a/addons/sale_project/models/account_move_line.py
+++ b/addons/sale_project/models/account_move_line.py
@@ -5,7 +5,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
def _compute_analytic_distribution(self):
# when a project creates an aml, it adds an analytic account to it. the following filter is to save this
diff --git a/addons/sale_project/models/product_product.py b/addons/sale_project/models/product_product.py
index 1830a4cba10a9..7990a525d06cf 100644
--- a/addons/sale_project/models/product_product.py
+++ b/addons/sale_project/models/product_product.py
@@ -4,7 +4,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
@api.onchange('service_tracking')
def _onchange_service_tracking(self):
diff --git a/addons/sale_project/models/product_template.py b/addons/sale_project/models/product_template.py
index 701713258be17..727b14285cd7c 100644
--- a/addons/sale_project/models/product_template.py
+++ b/addons/sale_project/models/product_template.py
@@ -5,7 +5,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
@api.model
def _selection_service_policy(self):
diff --git a/addons/sale_project/models/project_milestone.py b/addons/sale_project/models/project_milestone.py
index 47ae9d5635db6..eb491976d0114 100644
--- a/addons/sale_project/models/project_milestone.py
+++ b/addons/sale_project/models/project_milestone.py
@@ -3,9 +3,9 @@
from odoo import api, fields, models, _
+
class ProjectMilestone(models.Model):
- _name = 'project.milestone'
- _inherit = 'project.milestone'
+ _inherit = ['project.milestone']
def _default_sale_line_id(self):
project_id = self._context.get('default_project_id')
diff --git a/addons/sale_project/models/project_project.py b/addons/sale_project/models/project_project.py
index 9f97da5ea8a7a..85cc2c5e59c35 100644
--- a/addons/sale_project/models/project_project.py
+++ b/addons/sale_project/models/project_project.py
@@ -12,7 +12,7 @@
class ProjectProject(models.Model):
- _inherit = 'project.project'
+ _inherit = ['project.project']
def _domain_sale_line_id(self):
domain = expression.AND([
diff --git a/addons/sale_project/models/project_task.py b/addons/sale_project/models/project_task.py
index c66a778f42836..a706b234b2820 100644
--- a/addons/sale_project/models/project_task.py
+++ b/addons/sale_project/models/project_task.py
@@ -8,7 +8,7 @@
class ProjectTask(models.Model):
- _inherit = "project.task"
+ _inherit = ["project.task"]
def _domain_sale_line_id(self):
domain = expression.AND([
diff --git a/addons/sale_project/models/project_task_recurrence.py b/addons/sale_project/models/project_task_recurrence.py
index 60695928cc274..bbb6042aaa00d 100644
--- a/addons/sale_project/models/project_task_recurrence.py
+++ b/addons/sale_project/models/project_task_recurrence.py
@@ -4,7 +4,7 @@
class ProjectTaskRecurrence(models.Model):
- _inherit = 'project.task.recurrence'
+ _inherit = ['project.task.recurrence']
@api.model
def _get_recurring_fields_to_copy(self):
diff --git a/addons/sale_project/models/res_config_settings.py b/addons/sale_project/models/res_config_settings.py
index e132c888760e1..934be3c4638b3 100644
--- a/addons/sale_project/models/res_config_settings.py
+++ b/addons/sale_project/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
def set_values(self):
super().set_values()
diff --git a/addons/sale_project/models/sale_order.py b/addons/sale_project/models/sale_order.py
index e6d56bcd24cfe..79fd917120bed 100644
--- a/addons/sale_project/models/sale_order.py
+++ b/addons/sale_project/models/sale_order.py
@@ -10,7 +10,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
tasks_ids = fields.Many2many('project.task', compute='_compute_tasks_ids', search='_search_tasks_ids', string='Tasks associated with this sale', export_string_translation=False)
tasks_count = fields.Integer(string='Tasks', compute='_compute_tasks_ids', groups="project.group_project_user", export_string_translation=False)
diff --git a/addons/sale_project/models/sale_order_line.py b/addons/sale_project/models/sale_order_line.py
index 9f3186969b5d4..3b91c2f5f70e0 100644
--- a/addons/sale_project/models/sale_order_line.py
+++ b/addons/sale_project/models/sale_order_line.py
@@ -9,7 +9,7 @@
class SaleOrderLine(models.Model):
- _inherit = "sale.order.line"
+ _inherit = ["sale.order.line"]
qty_delivered_method = fields.Selection(selection_add=[('milestones', 'Milestones')])
project_id = fields.Many2one(
diff --git a/addons/sale_project/models/sale_order_template_line.py b/addons/sale_project/models/sale_order_template_line.py
index f304c7bc60f73..756d60538adb1 100644
--- a/addons/sale_project/models/sale_order_template_line.py
+++ b/addons/sale_project/models/sale_order_template_line.py
@@ -3,8 +3,9 @@
from odoo import models
+
class SaleOrderTemplateLine(models.Model):
- _inherit = 'sale.order.template.line'
+ _inherit = ['sale.order.template.line']
def _prepare_order_line_values(self):
res = super()._prepare_order_line_values()
diff --git a/addons/sale_project/report/project_report.py b/addons/sale_project/report/project_report.py
index 684277c9f1c9a..65778ebfb85d2 100644
--- a/addons/sale_project/report/project_report.py
+++ b/addons/sale_project/report/project_report.py
@@ -5,7 +5,7 @@
class ReportProjectTaskUser(models.Model):
- _inherit = "report.project.task.user"
+ _inherit = ["report.project.task.user"]
sale_line_id = fields.Many2one('sale.order.line', string='Sales Order Item', readonly=True)
sale_order_id = fields.Many2one('sale.order', string='Sales Order', readonly=True)
diff --git a/addons/sale_project/report/sale_report.py b/addons/sale_project/report/sale_report.py
index d369ff92de7f1..f9fef84303dd0 100644
--- a/addons/sale_project/report/sale_report.py
+++ b/addons/sale_project/report/sale_report.py
@@ -4,7 +4,7 @@
class SaleReport(models.Model):
- _inherit = 'sale.report'
+ _inherit = ['sale.report']
project_id = fields.Many2one(comodel_name='project.project', readonly=True)
diff --git a/addons/sale_project_stock/models/sale_order_line.py b/addons/sale_project_stock/models/sale_order_line.py
index 1530855614236..1f0bbf70bcc6d 100644
--- a/addons/sale_project_stock/models/sale_order_line.py
+++ b/addons/sale_project_stock/models/sale_order_line.py
@@ -3,8 +3,9 @@
from odoo import models
+
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
def _get_action_per_item(self):
""" Get action per Sales Order Item to display the stock moves linked
diff --git a/addons/sale_project_stock/models/stock_move.py b/addons/sale_project_stock/models/stock_move.py
index 9a7d164b799cb..172d332df9560 100644
--- a/addons/sale_project_stock/models/stock_move.py
+++ b/addons/sale_project_stock/models/stock_move.py
@@ -5,7 +5,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _sale_get_invoice_price(self, order):
""" Based on the current stock move, compute the price to reinvoice the analytic line that is going to be created (so the
diff --git a/addons/sale_project_stock/models/stock_picking.py b/addons/sale_project_stock/models/stock_picking.py
index f864f767368d2..b7d1ceed88d15 100644
--- a/addons/sale_project_stock/models/stock_picking.py
+++ b/addons/sale_project_stock/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
def button_validate(self):
res = super().button_validate()
diff --git a/addons/sale_project_stock_account/models/stock_move.py b/addons/sale_project_stock_account/models/stock_move.py
index 5226fa52a86b2..55c21e957d96e 100644
--- a/addons/sale_project_stock_account/models/stock_move.py
+++ b/addons/sale_project_stock_account/models/stock_move.py
@@ -5,7 +5,7 @@
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _get_valid_moves_domain(self):
domain = super()._get_valid_moves_domain()
diff --git a/addons/sale_purchase/models/product_template.py b/addons/sale_purchase/models/product_template.py
index b3fb063f1cdc7..e8bef5485d080 100644
--- a/addons/sale_purchase/models/product_template.py
+++ b/addons/sale_purchase/models/product_template.py
@@ -6,7 +6,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
service_to_purchase = fields.Boolean(
"Subcontract Service", company_dependent=True, copy=False,
diff --git a/addons/sale_purchase/models/purchase_order.py b/addons/sale_purchase/models/purchase_order.py
index b42c0db4a5c9c..6747186782538 100644
--- a/addons/sale_purchase/models/purchase_order.py
+++ b/addons/sale_purchase/models/purchase_order.py
@@ -5,7 +5,7 @@
class PurchaseOrder(models.Model):
- _inherit = "purchase.order"
+ _inherit = ["purchase.order"]
sale_order_count = fields.Integer(
"Number of Source Sale",
@@ -68,7 +68,7 @@ def _activity_cancel_on_sale(self):
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = ['purchase.order.line']
sale_order_id = fields.Many2one(related='sale_line_id.order_id', string="Sale Order", store=True, readonly=True)
sale_line_id = fields.Many2one('sale.order.line', string="Origin Sale Item", index='btree_not_null', copy=False)
diff --git a/addons/sale_purchase/models/sale_order.py b/addons/sale_purchase/models/sale_order.py
index fa2a67a6af6af..0aaaf754ff221 100644
--- a/addons/sale_purchase/models/sale_order.py
+++ b/addons/sale_purchase/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
purchase_order_count = fields.Integer(
"Number of Purchase Order Generated",
diff --git a/addons/sale_purchase/models/sale_order_line.py b/addons/sale_purchase/models/sale_order_line.py
index 5d4e14201e835..d3719e90b1adb 100644
--- a/addons/sale_purchase/models/sale_order_line.py
+++ b/addons/sale_purchase/models/sale_order_line.py
@@ -10,7 +10,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
purchase_line_ids = fields.One2many('purchase.order.line', 'sale_line_id', string="Generated Purchase Lines", readonly=True, help="Purchase line generated by this Sales item on order confirmation, or when the quantity was increased.")
purchase_line_count = fields.Integer("Number of generated purchase items", compute='_compute_purchase_count')
diff --git a/addons/sale_purchase/wizards/sale_order_cancel.py b/addons/sale_purchase/wizards/sale_order_cancel.py
index 991c7ffd53161..9719e3b73556a 100644
--- a/addons/sale_purchase/wizards/sale_order_cancel.py
+++ b/addons/sale_purchase/wizards/sale_order_cancel.py
@@ -2,7 +2,7 @@
class SaleOrderCancel(models.TransientModel):
- _inherit = "sale.order.cancel"
+ _inherit = ["sale.order.cancel"]
display_purchase_orders_alert = fields.Boolean(
string="Purchase Order Alert",
diff --git a/addons/sale_purchase_project/models/sale_order_line.py b/addons/sale_purchase_project/models/sale_order_line.py
index df510661950a5..afd66d57205e8 100644
--- a/addons/sale_purchase_project/models/sale_order_line.py
+++ b/addons/sale_purchase_project/models/sale_order_line.py
@@ -4,7 +4,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
def _purchase_service_prepare_line_values(self, purchase_order, quantity=False):
purchase_line_vals = super()._purchase_service_prepare_line_values(purchase_order, quantity)
diff --git a/addons/sale_purchase_stock/models/purchase_order.py b/addons/sale_purchase_stock/models/purchase_order.py
index b621ed321413f..064949ba441e7 100644
--- a/addons/sale_purchase_stock/models/purchase_order.py
+++ b/addons/sale_purchase_stock/models/purchase_order.py
@@ -5,7 +5,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
@api.depends('order_line.move_dest_ids.group_id.sale_id', 'order_line.move_ids.move_dest_ids.group_id.sale_id')
def _compute_sale_order_count(self):
@@ -20,7 +20,7 @@ def _get_sale_orders(self):
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = ['purchase.order.line']
def _prepare_stock_moves(self, picking):
res = super()._prepare_stock_moves(picking)
diff --git a/addons/sale_purchase_stock/models/sale_order.py b/addons/sale_purchase_stock/models/sale_order.py
index f33e52606eae9..a836c5032e198 100644
--- a/addons/sale_purchase_stock/models/sale_order.py
+++ b/addons/sale_purchase_stock/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
@api.depends('procurement_group_id.stock_move_ids.created_purchase_line_ids.order_id', 'procurement_group_id.stock_move_ids.move_orig_ids.purchase_line_id.order_id')
def _compute_purchase_order_count(self):
diff --git a/addons/sale_service/models/sale_order_line.py b/addons/sale_service/models/sale_order_line.py
index 67ab616b5b849..828013fa81192 100644
--- a/addons/sale_service/models/sale_order_line.py
+++ b/addons/sale_service/models/sale_order_line.py
@@ -10,7 +10,7 @@
class SaleOrderLine(models.Model):
- _inherit = "sale.order.line"
+ _inherit = ["sale.order.line"]
# used to know if generate a task and/or a project, depending on the product settings
is_service = fields.Boolean("Is a Service", compute='_compute_is_service', store=True, compute_sudo=True, export_string_translation=False)
diff --git a/addons/sale_stock/models/account_move.py b/addons/sale_stock/models/account_move.py
index db66511c90a5a..00f2b9720caf5 100644
--- a/addons/sale_stock/models/account_move.py
+++ b/addons/sale_stock/models/account_move.py
@@ -9,7 +9,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
def _stock_account_get_last_step_stock_moves(self):
""" Overridden from stock_account.
@@ -133,8 +133,9 @@ def _compute_incoterm_location(self):
if incoterm_res:
move.incoterm_location = incoterm_res
+
class AccountMoveLine(models.Model):
- _inherit = "account.move.line"
+ _inherit = ["account.move.line"]
def _sale_can_be_reinvoice(self):
self.ensure_one()
diff --git a/addons/sale_stock/models/product_template.py b/addons/sale_stock/models/product_template.py
index cd0ce33b3c6a2..2b07775334d3e 100644
--- a/addons/sale_stock/models/product_template.py
+++ b/addons/sale_stock/models/product_template.py
@@ -5,7 +5,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
@api.depends('type')
def _compute_expense_policy(self):
diff --git a/addons/sale_stock/models/res_company.py b/addons/sale_stock/models/res_company.py
index 1677868c718d5..620f0c6caea53 100644
--- a/addons/sale_stock/models/res_company.py
+++ b/addons/sale_stock/models/res_company.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class company(models.Model):
- _inherit = 'res.company'
+class ResCompany(models.Model):
+ _inherit = ['res.company']
security_lead = fields.Float(
'Sales Safety Days', default=0.0, required=True,
diff --git a/addons/sale_stock/models/res_config_settings.py b/addons/sale_stock/models/res_config_settings.py
index edd571c532779..c10e846846248 100644
--- a/addons/sale_stock/models/res_config_settings.py
+++ b/addons/sale_stock/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
security_lead = fields.Float(related='company_id.security_lead', string="Security Lead Time", readonly=False)
use_security_lead = fields.Boolean(
diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py
index 1f0a4f5884e6a..035f5dfb4b0c3 100644
--- a/addons/sale_stock/models/sale_order.py
+++ b/addons/sale_stock/models/sale_order.py
@@ -12,7 +12,7 @@
class SaleOrder(models.Model):
- _inherit = "sale.order"
+ _inherit = ["sale.order"]
incoterm = fields.Many2one(
'account.incoterms', 'Incoterm',
diff --git a/addons/sale_stock/models/sale_order_line.py b/addons/sale_stock/models/sale_order_line.py
index c9f926626e8b0..4e190fca152bd 100644
--- a/addons/sale_stock/models/sale_order_line.py
+++ b/addons/sale_stock/models/sale_order_line.py
@@ -11,7 +11,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
qty_delivered_method = fields.Selection(selection_add=[('stock_move', 'Stock Moves')])
route_id = fields.Many2one('stock.route', string='Route', domain=[('sale_selectable', '=', True)], ondelete='restrict')
diff --git a/addons/sale_stock/models/stock.py b/addons/sale_stock/models/stock.py
index d2fed9b6154b8..950144fff6e46 100644
--- a/addons/sale_stock/models/stock.py
+++ b/addons/sale_stock/models/stock.py
@@ -8,12 +8,12 @@
class StockRoute(models.Model):
- _inherit = "stock.route"
+ _inherit = ["stock.route"]
sale_selectable = fields.Boolean("Selectable on Sales Order Line")
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
sale_line_id = fields.Many2one('sale.order.line', 'Sale Line', index='btree_not_null')
@api.model
@@ -58,20 +58,20 @@ def _get_all_related_sm(self, product):
class StockMoveLine(models.Model):
- _inherit = "stock.move.line"
+ _inherit = ["stock.move.line"]
def _should_show_lot_in_invoice(self):
return 'customer' in {self.location_id.usage, self.location_dest_id.usage}
class ProcurementGroup(models.Model):
- _inherit = 'procurement.group'
+ _inherit = ['procurement.group']
sale_id = fields.Many2one('sale.order', 'Sale Order')
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
def _get_custom_move_fields(self):
fields = super(StockRule, self)._get_custom_move_fields()
@@ -80,7 +80,7 @@ def _get_custom_move_fields(self):
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
sale_id = fields.Many2one('sale.order', compute="_compute_sale_id", inverse="_set_sale_id", string="Sales Order", store=True, index='btree_not_null')
@@ -201,7 +201,7 @@ def _can_return(self):
class StockLot(models.Model):
- _inherit = 'stock.lot'
+ _inherit = ['stock.lot']
sale_order_ids = fields.Many2many('sale.order', string="Sales Orders", compute='_compute_sale_order_ids')
sale_order_count = fields.Integer('Sale order count', compute='_compute_sale_order_ids')
diff --git a/addons/sale_stock/report/report_stock_rule.py b/addons/sale_stock/report/report_stock_rule.py
index 37a818ba3bbdf..b83482fadf07a 100644
--- a/addons/sale_stock/report/report_stock_rule.py
+++ b/addons/sale_stock/report/report_stock_rule.py
@@ -4,12 +4,12 @@
from odoo import api, models
-class ReportStockRule(models.AbstractModel):
- _inherit = 'report.stock.report_stock_rule'
+class ReportStockReport_Stock_Rule(models.AbstractModel):
+ _inherit = ['report.stock.report_stock_rule']
@api.model
def _get_routes(self, data):
- res = super(ReportStockRule, self)._get_routes(data)
+ res = super()._get_routes(data)
if data.get('so_route_ids'):
res = self.env['stock.route'].browse(data['so_route_ids']) | res
return res
diff --git a/addons/sale_stock/report/sale_report.py b/addons/sale_stock/report/sale_report.py
index e4a5e74c7a4a2..5b84946b86f4b 100644
--- a/addons/sale_stock/report/sale_report.py
+++ b/addons/sale_stock/report/sale_report.py
@@ -5,7 +5,7 @@
class SaleReport(models.Model):
- _inherit = "sale.report"
+ _inherit = ["sale.report"]
warehouse_id = fields.Many2one('stock.warehouse', 'Warehouse', readonly=True)
diff --git a/addons/sale_stock/report/stock_forecasted.py b/addons/sale_stock/report/stock_forecasted.py
index c3e32c79e61bd..b60190b2d95b0 100644
--- a/addons/sale_stock/report/stock_forecasted.py
+++ b/addons/sale_stock/report/stock_forecasted.py
@@ -4,8 +4,8 @@
from odoo import models
-class StockForecasted(models.AbstractModel):
- _inherit = 'stock.forecasted_product_product'
+class StockForecasted_Product_Product(models.AbstractModel):
+ _inherit = ['stock.forecasted_product_product']
def _prepare_report_line(self, quantity, move_out=None, move_in=None, replenishment_filled=True, product=False, reserved_move=False, in_transit=False, read=True):
line = super()._prepare_report_line(quantity, move_out, move_in, replenishment_filled, product, reserved_move, in_transit, read)
diff --git a/addons/sale_stock/wizard/sale_order_cancel.py b/addons/sale_stock/wizard/sale_order_cancel.py
index d7cddfa9c3f4c..4f666cf581e6b 100644
--- a/addons/sale_stock/wizard/sale_order_cancel.py
+++ b/addons/sale_stock/wizard/sale_order_cancel.py
@@ -5,7 +5,7 @@
class SaleOrderCancel(models.TransientModel):
- _inherit = 'sale.order.cancel'
+ _inherit = ['sale.order.cancel']
display_delivery_alert = fields.Boolean('Delivery Alert', compute='_compute_display_delivery_alert')
diff --git a/addons/sale_stock/wizard/stock_rules_report.py b/addons/sale_stock/wizard/stock_rules_report.py
index 0c4f86e72f07d..6e6b7d9542af1 100644
--- a/addons/sale_stock/wizard/stock_rules_report.py
+++ b/addons/sale_stock/wizard/stock_rules_report.py
@@ -5,7 +5,7 @@
class StockRulesReport(models.TransientModel):
- _inherit = 'stock.rules.report'
+ _inherit = ['stock.rules.report']
so_route_ids = fields.Many2many('stock.route', string='Apply specific routes',
domain="[('sale_selectable', '=', True)]", help="Choose to apply SO lines specific routes.")
diff --git a/addons/sale_stock_margin/models/sale_order_line.py b/addons/sale_stock_margin/models/sale_order_line.py
index f31f9ea209ec6..ed3e7d935a8fe 100644
--- a/addons/sale_stock_margin/models/sale_order_line.py
+++ b/addons/sale_stock_margin/models/sale_order_line.py
@@ -5,7 +5,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
@api.depends('move_ids', 'move_ids.stock_valuation_layer_ids', 'move_ids.picking_id.state')
def _compute_purchase_price(self):
diff --git a/addons/sale_timesheet/models/account_move.py b/addons/sale_timesheet/models/account_move.py
index 3c683b0744601..80a59273121a7 100644
--- a/addons/sale_timesheet/models/account_move.py
+++ b/addons/sale_timesheet/models/account_move.py
@@ -7,7 +7,7 @@
class AccountMove(models.Model):
- _inherit = "account.move"
+ _inherit = ["account.move"]
timesheet_ids = fields.One2many('account.analytic.line', 'timesheet_invoice_id', string='Timesheets', readonly=True, copy=False, export_string_translation=False)
timesheet_count = fields.Integer("Number of timesheets", compute='_compute_timesheet_count', compute_sudo=True, export_string_translation=False)
diff --git a/addons/sale_timesheet/models/account_move_line.py b/addons/sale_timesheet/models/account_move_line.py
index d4b185be70d52..e212cdc9b6df0 100644
--- a/addons/sale_timesheet/models/account_move_line.py
+++ b/addons/sale_timesheet/models/account_move_line.py
@@ -6,7 +6,7 @@
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
@api.model
def _timesheet_domain_get_invoiced_lines(self, sale_line_delivery):
diff --git a/addons/sale_timesheet/models/hr_employee.py b/addons/sale_timesheet/models/hr_employee.py
index 4a4b6e5da247d..139a528a8e955 100644
--- a/addons/sale_timesheet/models/hr_employee.py
+++ b/addons/sale_timesheet/models/hr_employee.py
@@ -4,7 +4,7 @@
class HrEmployee(models.Model):
- _inherit = 'hr.employee'
+ _inherit = ['hr.employee']
@api.model
def default_get(self, fields):
diff --git a/addons/sale_timesheet/models/hr_timesheet.py b/addons/sale_timesheet/models/hr_timesheet.py
index 1d58288413031..39c53e63e3b7e 100644
--- a/addons/sale_timesheet/models/hr_timesheet.py
+++ b/addons/sale_timesheet/models/hr_timesheet.py
@@ -19,8 +19,9 @@
('other_costs', 'Other costs'),
]
+
class AccountAnalyticLine(models.Model):
- _inherit = 'account.analytic.line'
+ _inherit = ['account.analytic.line']
def _domain_so_line(self):
domain = expression.AND([
diff --git a/addons/sale_timesheet/models/product_product.py b/addons/sale_timesheet/models/product_product.py
index 33ad1c3227b92..91208efc791a6 100644
--- a/addons/sale_timesheet/models/product_product.py
+++ b/addons/sale_timesheet/models/product_product.py
@@ -7,7 +7,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
@tools.ormcache()
def _get_default_uom_id(self):
diff --git a/addons/sale_timesheet/models/product_template.py b/addons/sale_timesheet/models/product_template.py
index 5e424378aa450..93696afa23458 100644
--- a/addons/sale_timesheet/models/product_template.py
+++ b/addons/sale_timesheet/models/product_template.py
@@ -7,7 +7,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
def _selection_service_policy(self):
service_policies = super()._selection_service_policy()
diff --git a/addons/sale_timesheet/models/project_project.py b/addons/sale_timesheet/models/project_project.py
index a3a7331647306..2320108b2b45e 100644
--- a/addons/sale_timesheet/models/project_project.py
+++ b/addons/sale_timesheet/models/project_project.py
@@ -10,7 +10,7 @@
class ProjectProject(models.Model):
- _inherit = 'project.project'
+ _inherit = ['project.project']
@api.model
def default_get(self, fields):
diff --git a/addons/sale_timesheet/models/project_sale_line_employee_map.py b/addons/sale_timesheet/models/project_sale_line_employee_map.py
index 5e0680eb94a97..ef2031602ba4b 100644
--- a/addons/sale_timesheet/models/project_sale_line_employee_map.py
+++ b/addons/sale_timesheet/models/project_sale_line_employee_map.py
@@ -6,8 +6,7 @@
from odoo.tools.misc import unquote
-class ProjectProductEmployeeMap(models.Model):
- _name = 'project.sale.line.employee.map'
+class ProjectSaleLineEmployeeMap(models.Model):
_description = 'Project Sales line, employee mapping'
def _domain_sale_line_id(self):
diff --git a/addons/sale_timesheet/models/project_task.py b/addons/sale_timesheet/models/project_task.py
index d28dfb65c624a..73529cf8a7b8c 100644
--- a/addons/sale_timesheet/models/project_task.py
+++ b/addons/sale_timesheet/models/project_task.py
@@ -5,7 +5,7 @@
class ProjectTask(models.Model):
- _inherit = "project.task"
+ _inherit = ["project.task"]
def _get_default_partner_id(self, project, parent):
res = super()._get_default_partner_id(project, parent)
diff --git a/addons/sale_timesheet/models/project_update.py b/addons/sale_timesheet/models/project_update.py
index af4f0afe80e56..32ba9925f57f9 100644
--- a/addons/sale_timesheet/models/project_update.py
+++ b/addons/sale_timesheet/models/project_update.py
@@ -7,7 +7,7 @@
class ProjectUpdate(models.Model):
- _inherit = 'project.update'
+ _inherit = ['project.update']
@api.model
def _get_template_values(self, project):
diff --git a/addons/sale_timesheet/models/res_config_settings.py b/addons/sale_timesheet/models/res_config_settings.py
index 82a5eabe07496..7d6045a96c94f 100644
--- a/addons/sale_timesheet/models/res_config_settings.py
+++ b/addons/sale_timesheet/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
invoice_policy = fields.Boolean(string="Invoice Policy", help="Timesheets taken when invoicing time spent")
diff --git a/addons/sale_timesheet/models/sale_order.py b/addons/sale_timesheet/models/sale_order.py
index 124c89be25372..15b37fbb8d595 100644
--- a/addons/sale_timesheet/models/sale_order.py
+++ b/addons/sale_timesheet/models/sale_order.py
@@ -8,7 +8,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
timesheet_count = fields.Float(string='Timesheet activities', compute='_compute_timesheet_count', groups="hr_timesheet.group_hr_timesheet_user", export_string_translation=False)
timesheet_encode_uom_id = fields.Many2one('uom.uom', related='company_id.timesheet_encode_uom_id', export_string_translation=False)
diff --git a/addons/sale_timesheet/models/sale_order_line.py b/addons/sale_timesheet/models/sale_order_line.py
index ad9f44855c8eb..4623f71cd4266 100644
--- a/addons/sale_timesheet/models/sale_order_line.py
+++ b/addons/sale_timesheet/models/sale_order_line.py
@@ -6,7 +6,7 @@
class SaleOrderLine(models.Model):
- _inherit = "sale.order.line"
+ _inherit = ["sale.order.line"]
qty_delivered_method = fields.Selection(selection_add=[('timesheet', 'Timesheets')])
analytic_line_ids = fields.One2many(domain=[('project_id', '=', False)]) # only analytic lines, not timesheets (since this field determine if SO line came from expense)
diff --git a/addons/sale_timesheet/report/project_report.py b/addons/sale_timesheet/report/project_report.py
index 7cdae6c84ba1e..c7d02cb22fdb8 100644
--- a/addons/sale_timesheet/report/project_report.py
+++ b/addons/sale_timesheet/report/project_report.py
@@ -4,7 +4,7 @@
class ReportProjectTaskUser(models.Model):
- _inherit = 'report.project.task.user'
+ _inherit = ['report.project.task.user']
remaining_hours_so = fields.Float('Time Remaining on SO', readonly=True, groups="hr_timesheet.group_hr_timesheet_user")
diff --git a/addons/sale_timesheet/report/timesheets_analysis_report.py b/addons/sale_timesheet/report/timesheets_analysis_report.py
index 3989402678d43..999d9689d7f99 100644
--- a/addons/sale_timesheet/report/timesheets_analysis_report.py
+++ b/addons/sale_timesheet/report/timesheets_analysis_report.py
@@ -7,7 +7,7 @@
class TimesheetsAnalysisReport(models.Model):
- _inherit = "timesheets.analysis.report"
+ _inherit = ["timesheets.analysis.report"]
order_id = fields.Many2one("sale.order", string="Sales Order", readonly=True)
so_line = fields.Many2one("sale.order.line", string="Sales Order Item", readonly=True)
diff --git a/addons/sale_timesheet/wizard/project_create_invoice.py b/addons/sale_timesheet/wizard/project_create_invoice.py
index 5306c0bf9d041..2b29f76469328 100644
--- a/addons/sale_timesheet/wizard/project_create_invoice.py
+++ b/addons/sale_timesheet/wizard/project_create_invoice.py
@@ -6,7 +6,6 @@
class ProjectCreateInvoice(models.TransientModel):
- _name = 'project.create.invoice'
_description = "Create Invoice from project"
@api.model
diff --git a/addons/sale_timesheet/wizard/sale_make_invoice_advance.py b/addons/sale_timesheet/wizard/sale_make_invoice_advance.py
index abb262b640d07..6b1d13b50dc94 100644
--- a/addons/sale_timesheet/wizard/sale_make_invoice_advance.py
+++ b/addons/sale_timesheet/wizard/sale_make_invoice_advance.py
@@ -5,7 +5,7 @@
class SaleAdvancePaymentInv(models.TransientModel):
- _inherit = 'sale.advance.payment.inv'
+ _inherit = ['sale.advance.payment.inv']
date_start_invoice_timesheet = fields.Date(
string="Start Date",
diff --git a/addons/sale_timesheet_margin/models/sale_order_line.py b/addons/sale_timesheet_margin/models/sale_order_line.py
index fa0123abdb230..6eaa85ed4bafa 100644
--- a/addons/sale_timesheet_margin/models/sale_order_line.py
+++ b/addons/sale_timesheet_margin/models/sale_order_line.py
@@ -2,8 +2,9 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
+
class SaleOrderLine(models.Model):
- _inherit = "sale.order.line"
+ _inherit = ["sale.order.line"]
@api.depends('analytic_line_ids.amount', 'qty_delivered_method')
def _compute_purchase_price(self):
diff --git a/addons/sales_team/models/crm_tag.py b/addons/sales_team/models/crm_tag.py
index efe262389ff3b..b4ca282e4f1cc 100644
--- a/addons/sales_team/models/crm_tag.py
+++ b/addons/sales_team/models/crm_tag.py
@@ -6,8 +6,7 @@
from odoo import fields, models
-class Tag(models.Model):
- _name = "crm.tag"
+class CrmTag(models.Model):
_description = "CRM Tag"
def _get_default_color(self):
diff --git a/addons/sales_team/models/crm_team.py b/addons/sales_team/models/crm_team.py
index cd29e59a5025e..d767cbe1f1437 100644
--- a/addons/sales_team/models/crm_team.py
+++ b/addons/sales_team/models/crm_team.py
@@ -15,7 +15,6 @@
class CrmTeam(models.Model):
- _name = "crm.team"
_inherit = ['mail.thread']
_description = "Sales Team"
_order = "sequence ASC, create_date DESC, id DESC"
diff --git a/addons/sales_team/models/crm_team_member.py b/addons/sales_team/models/crm_team_member.py
index cd601f2120489..9e7bdb3a6cfd6 100644
--- a/addons/sales_team/models/crm_team_member.py
+++ b/addons/sales_team/models/crm_team_member.py
@@ -5,7 +5,6 @@
class CrmTeamMember(models.Model):
- _name = 'crm.team.member'
_inherit = ['mail.thread']
_description = 'Sales Team Member'
_rec_name = 'user_id'
diff --git a/addons/sales_team/models/res_users.py b/addons/sales_team/models/res_users.py
index f89a744efbf7d..0b1d2a3d180bc 100644
--- a/addons/sales_team/models/res_users.py
+++ b/addons/sales_team/models/res_users.py
@@ -5,7 +5,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
crm_team_ids = fields.Many2many(
'crm.team', 'crm_team_member', 'user_id', 'crm_team_id', string='Sales Teams',
diff --git a/addons/sms/models/iap_account.py b/addons/sms/models/iap_account.py
index ff92a6b8b7aa1..925f3d091f90e 100644
--- a/addons/sms/models/iap_account.py
+++ b/addons/sms/models/iap_account.py
@@ -4,7 +4,7 @@
class IapAccount(models.Model):
- _inherit = 'iap.account'
+ _inherit = ['iap.account']
sender_name = fields.Char(help="This is the name that will be displayed as the sender of the SMS.", readonly=True)
diff --git a/addons/sms/models/ir_actions_server.py b/addons/sms/models/ir_actions_server.py
index f4f7cc58bc950..293f5a8499e1f 100644
--- a/addons/sms/models/ir_actions_server.py
+++ b/addons/sms/models/ir_actions_server.py
@@ -5,9 +5,8 @@
from odoo.exceptions import ValidationError
-class ServerActions(models.Model):
+class IrActionsServer(models.Model):
""" Add SMS option in server actions. """
- _name = 'ir.actions.server'
_inherit = ['ir.actions.server']
state = fields.Selection(selection_add=[
@@ -33,7 +32,7 @@ def _compute_available_model_ids(self):
mail_models = self.env['ir.model'].search([('is_mail_thread', '=', True), ('transient', '=', False)])
for action in mail_thread_based:
action.available_model_ids = mail_models.ids
- super(ServerActions, self - mail_thread_based)._compute_available_model_ids()
+ super(IrActionsServer, self - mail_thread_based)._compute_available_model_ids()
@api.depends('model_id', 'state')
def _compute_sms_template_id(self):
diff --git a/addons/sms/models/ir_model.py b/addons/sms/models/ir_model.py
index 5dc23787cf736..82c866fb0c09b 100644
--- a/addons/sms/models/ir_model.py
+++ b/addons/sms/models/ir_model.py
@@ -5,7 +5,7 @@
class IrModel(models.Model):
- _inherit = 'ir.model'
+ _inherit = ['ir.model']
is_mail_thread_sms = fields.Boolean(
string="Mail Thread SMS", default=False,
diff --git a/addons/sms/models/mail_message.py b/addons/sms/models/mail_message.py
index e7d91ec4367fd..d0430fde52e61 100644
--- a/addons/sms/models/mail_message.py
+++ b/addons/sms/models/mail_message.py
@@ -7,7 +7,7 @@ class MailMessage(models.Model):
""" Override MailMessage class in order to add a new type: SMS messages.
Those messages comes with their own notification method, using SMS
gateway. """
- _inherit = 'mail.message'
+ _inherit = ['mail.message']
message_type = fields.Selection(
selection_add=[('sms', 'SMS')],
diff --git a/addons/sms/models/mail_notification.py b/addons/sms/models/mail_notification.py
index e8e1aea2fbfab..451464cbabf5b 100644
--- a/addons/sms/models/mail_notification.py
+++ b/addons/sms/models/mail_notification.py
@@ -5,7 +5,7 @@
class MailNotification(models.Model):
- _inherit = 'mail.notification'
+ _inherit = ['mail.notification']
notification_type = fields.Selection(selection_add=[
('sms', 'SMS')
diff --git a/addons/sms/models/mail_thread.py b/addons/sms/models/mail_thread.py
index 00cca8a92be95..0daf6297ce186 100644
--- a/addons/sms/models/mail_thread.py
+++ b/addons/sms/models/mail_thread.py
@@ -10,7 +10,7 @@
class MailThread(models.AbstractModel):
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
message_has_sms_error = fields.Boolean(
'SMS Delivery error', compute='_compute_message_has_sms_error', search='_search_message_has_sms_error',
diff --git a/addons/sms/models/res_partner.py b/addons/sms/models/res_partner.py
index 4f7c928974321..d481e49e1ec44 100644
--- a/addons/sms/models/res_partner.py
+++ b/addons/sms/models/res_partner.py
@@ -5,5 +5,4 @@
class ResPartner(models.Model):
- _name = 'res.partner'
_inherit = ['mail.thread.phone', 'res.partner']
diff --git a/addons/sms/models/sms_sms.py b/addons/sms/models/sms_sms.py
index 186579cfb20a8..80bb8d7052c4d 100644
--- a/addons/sms/models/sms_sms.py
+++ b/addons/sms/models/sms_sms.py
@@ -14,7 +14,6 @@
class SmsSms(models.Model):
- _name = 'sms.sms'
_description = 'Outgoing SMS'
_rec_name = 'number'
_order = 'id DESC'
diff --git a/addons/sms/models/sms_template.py b/addons/sms/models/sms_template.py
index 1a790dd2f973c..870542e62e489 100644
--- a/addons/sms/models/sms_template.py
+++ b/addons/sms/models/sms_template.py
@@ -4,9 +4,8 @@
from odoo import api, fields, models, _
-class SMSTemplate(models.Model):
+class SmsTemplate(models.Model):
"Templates for sending SMS"
- _name = "sms.template"
_inherit = ['mail.render.mixin', 'template.reset.mixin']
_description = 'SMS Templates'
@@ -47,7 +46,7 @@ def copy_data(self, default=None):
def unlink(self):
self.sudo().mapped('sidebar_action_id').unlink()
- return super(SMSTemplate, self).unlink()
+ return super().unlink()
def action_create_sidebar_action(self):
ActWindow = self.env['ir.actions.act_window']
diff --git a/addons/sms/models/sms_tracker.py b/addons/sms/models/sms_tracker.py
index 0ad5b069807f9..ec3c5390b7447 100644
--- a/addons/sms/models/sms_tracker.py
+++ b/addons/sms/models/sms_tracker.py
@@ -16,7 +16,6 @@ class SmsTracker(models.Model):
Note: Only admins/system user should need to access (a fortiori modify) these technical
records so no "sudo" is used nor should be required here.
"""
- _name = 'sms.tracker'
_description = "Link SMS to mailing/sms tracking models"
SMS_STATE_TO_NOTIFICATION_STATUS = {
diff --git a/addons/sms/wizard/sms_account_code.py b/addons/sms/wizard/sms_account_code.py
index 6a318d706c577..3ea2a3448a742 100644
--- a/addons/sms/wizard/sms_account_code.py
+++ b/addons/sms/wizard/sms_account_code.py
@@ -5,8 +5,7 @@
from odoo.exceptions import ValidationError
-class SMSAccountCode(models.TransientModel):
- _name = 'sms.account.code'
+class SmsAccountCode(models.TransientModel):
_description = 'SMS Account Verification Code Wizard'
account_id = fields.Many2one('iap.account', required=True)
diff --git a/addons/sms/wizard/sms_account_phone.py b/addons/sms/wizard/sms_account_phone.py
index d38c4d9641990..06ed2d5536174 100644
--- a/addons/sms/wizard/sms_account_phone.py
+++ b/addons/sms/wizard/sms_account_phone.py
@@ -5,8 +5,7 @@
from odoo.exceptions import ValidationError
-class SMSAccountPhone(models.TransientModel):
- _name = 'sms.account.phone'
+class SmsAccountPhone(models.TransientModel):
_description = 'SMS Account Registration Phone Number Wizard'
account_id = fields.Many2one('iap.account', required=True)
diff --git a/addons/sms/wizard/sms_account_sender.py b/addons/sms/wizard/sms_account_sender.py
index 7c662fe107395..8f1ae76025ae6 100644
--- a/addons/sms/wizard/sms_account_sender.py
+++ b/addons/sms/wizard/sms_account_sender.py
@@ -6,8 +6,7 @@
from odoo.exceptions import ValidationError
-class SMSAccountSender(models.TransientModel):
- _name = 'sms.account.sender'
+class SmsAccountSender(models.TransientModel):
_description = 'SMS Account Sender Name Wizard'
account_id = fields.Many2one('iap.account', required=True)
diff --git a/addons/sms/wizard/sms_composer.py b/addons/sms/wizard/sms_composer.py
index ec744f46ac4fc..9d84b01011e38 100644
--- a/addons/sms/wizard/sms_composer.py
+++ b/addons/sms/wizard/sms_composer.py
@@ -9,13 +9,12 @@
from odoo.tools import html2plaintext, plaintext2html
-class SendSMS(models.TransientModel):
- _name = 'sms.composer'
+class SmsComposer(models.TransientModel):
_description = 'Send SMS Wizard'
@api.model
def default_get(self, fields):
- result = super(SendSMS, self).default_get(fields)
+ result = super().default_get(fields)
result['res_model'] = result.get('res_model') or self.env.context.get('active_model')
diff --git a/addons/sms/wizard/sms_resend.py b/addons/sms/wizard/sms_resend.py
index 87ac9ca2a1a30..eee9fde311abf 100644
--- a/addons/sms/wizard/sms_resend.py
+++ b/addons/sms/wizard/sms_resend.py
@@ -4,8 +4,7 @@
from odoo import _, api, exceptions, fields, models
-class SMSRecipient(models.TransientModel):
- _name = 'sms.resend.recipient'
+class SmsResendRecipient(models.TransientModel):
_description = 'Resend Notification'
_rec_name = 'sms_resend_id'
@@ -19,14 +18,13 @@ class SMSRecipient(models.TransientModel):
sms_number = fields.Char(string='Phone Number')
-class SMSResend(models.TransientModel):
- _name = 'sms.resend'
+class SmsResend(models.TransientModel):
_description = 'SMS Resend'
_rec_name = 'mail_message_id'
@api.model
def default_get(self, fields):
- result = super(SMSResend, self).default_get(fields)
+ result = super().default_get(fields)
if 'recipient_ids' in fields and result.get('mail_message_id'):
mail_message_id = self.env['mail.message'].browse(result['mail_message_id'])
result['recipient_ids'] = [(0, 0, {
diff --git a/addons/sms/wizard/sms_template_preview.py b/addons/sms/wizard/sms_template_preview.py
index f981f6857dc2b..1cd194e396071 100644
--- a/addons/sms/wizard/sms_template_preview.py
+++ b/addons/sms/wizard/sms_template_preview.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class SMSTemplatePreview(models.TransientModel):
- _name = "sms.template.preview"
+class SmsTemplatePreview(models.TransientModel):
_description = "SMS Template Preview"
@api.model
@@ -18,7 +17,7 @@ def _selection_languages(self):
@api.model
def default_get(self, fields):
- result = super(SMSTemplatePreview, self).default_get(fields)
+ result = super().default_get(fields)
sms_template_id = self.env.context.get('default_sms_template_id')
if not sms_template_id or 'resource_ref' not in fields:
return result
diff --git a/addons/sms/wizard/sms_template_reset.py b/addons/sms/wizard/sms_template_reset.py
index aa6087d6369f6..cd1842d596883 100644
--- a/addons/sms/wizard/sms_template_reset.py
+++ b/addons/sms/wizard/sms_template_reset.py
@@ -4,8 +4,7 @@
from odoo import fields, models, _
-class SMSTemplateReset(models.TransientModel):
- _name = 'sms.template.reset'
+class SmsTemplateReset(models.TransientModel):
_description = 'SMS Template Reset'
template_ids = fields.Many2many('sms.template')
diff --git a/addons/snailmail/models/ir_actions_report.py b/addons/snailmail/models/ir_actions_report.py
index 91fa921e36f63..c7f0b724e403f 100644
--- a/addons/snailmail/models/ir_actions_report.py
+++ b/addons/snailmail/models/ir_actions_report.py
@@ -4,7 +4,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
def retrieve_attachment(self, record):
# Override this method in order to force to re-render the pdf in case of
diff --git a/addons/snailmail/models/mail_message.py b/addons/snailmail/models/mail_message.py
index 948a93e898305..d2e68dfdfdb8b 100644
--- a/addons/snailmail/models/mail_message.py
+++ b/addons/snailmail/models/mail_message.py
@@ -2,8 +2,8 @@
from odoo import api, fields, models
-class Message(models.Model):
- _inherit = 'mail.message'
+class MailMessage(models.Model):
+ _inherit = ['mail.message']
snailmail_error = fields.Boolean(
string="Snailmail message in error",
diff --git a/addons/snailmail/models/mail_notification.py b/addons/snailmail/models/mail_notification.py
index c1046ebf6c532..c4c2733b96745 100644
--- a/addons/snailmail/models/mail_notification.py
+++ b/addons/snailmail/models/mail_notification.py
@@ -3,8 +3,8 @@
from odoo import fields, models
-class Notification(models.Model):
- _inherit = 'mail.notification'
+class MailNotification(models.Model):
+ _inherit = ['mail.notification']
notification_type = fields.Selection(selection_add=[('snail', 'Snailmail')], ondelete={'snail': 'cascade'})
letter_id = fields.Many2one('snailmail.letter', string="Snailmail Letter", index='btree_not_null', ondelete='cascade')
diff --git a/addons/snailmail/models/mail_thread.py b/addons/snailmail/models/mail_thread.py
index 8b72bb999c290..1e7fa42c629dc 100644
--- a/addons/snailmail/models/mail_thread.py
+++ b/addons/snailmail/models/mail_thread.py
@@ -6,7 +6,7 @@
class MailThread(models.AbstractModel):
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
def _notify_cancel_snail(self):
author_id = self.env.user.id
diff --git a/addons/snailmail/models/res_company.py b/addons/snailmail/models/res_company.py
index fad22acbcd3d5..101faf1c6421e 100644
--- a/addons/snailmail/models/res_company.py
+++ b/addons/snailmail/models/res_company.py
@@ -3,8 +3,9 @@
from odoo import fields, models
-class Company(models.Model):
- _inherit = "res.company"
+
+class ResCompany(models.Model):
+ _inherit = ["res.company"]
snailmail_color = fields.Boolean(default=True)
snailmail_cover = fields.Boolean(string='Add a Cover Page', default=False)
diff --git a/addons/snailmail/models/res_config_settings.py b/addons/snailmail/models/res_config_settings.py
index 4b7a1037230a4..d563eba2da7b7 100644
--- a/addons/snailmail/models/res_config_settings.py
+++ b/addons/snailmail/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
snailmail_color = fields.Boolean(string='Print In Color', related='company_id.snailmail_color', readonly=False)
snailmail_cover = fields.Boolean(string='Add a Cover Page', related='company_id.snailmail_cover', readonly=False)
diff --git a/addons/snailmail/models/res_partner.py b/addons/snailmail/models/res_partner.py
index c7f40f7b3a879..715c44595891f 100644
--- a/addons/snailmail/models/res_partner.py
+++ b/addons/snailmail/models/res_partner.py
@@ -7,7 +7,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
def write(self, vals):
letter_address_vals = {}
diff --git a/addons/snailmail/models/snailmail_letter.py b/addons/snailmail/models/snailmail_letter.py
index a087733173f5c..5e6d56e3cb5cf 100644
--- a/addons/snailmail/models/snailmail_letter.py
+++ b/addons/snailmail/models/snailmail_letter.py
@@ -32,7 +32,6 @@
class SnailmailLetter(models.Model):
- _name = 'snailmail.letter'
_description = 'Snailmail Letter'
user_id = fields.Many2one('res.users', 'Sent by')
diff --git a/addons/snailmail/wizard/snailmail_letter_format_error.py b/addons/snailmail/wizard/snailmail_letter_format_error.py
index 56ae850403b1b..9403101c29ab0 100644
--- a/addons/snailmail/wizard/snailmail_letter_format_error.py
+++ b/addons/snailmail/wizard/snailmail_letter_format_error.py
@@ -1,7 +1,7 @@
from odoo import api, fields, models
+
class SnailmailLetterFormatError(models.TransientModel):
- _name = 'snailmail.letter.format.error'
_description = 'Format Error Sending a Snailmail Letter'
message_id = fields.Many2one(
diff --git a/addons/snailmail/wizard/snailmail_letter_missing_required_fields.py b/addons/snailmail/wizard/snailmail_letter_missing_required_fields.py
index 4216f3f82aa3f..ee83818663271 100644
--- a/addons/snailmail/wizard/snailmail_letter_missing_required_fields.py
+++ b/addons/snailmail/wizard/snailmail_letter_missing_required_fields.py
@@ -1,8 +1,8 @@
from odoo import _, api, fields, models
+
class SnailmailLetterMissingRequiredFields(models.TransientModel):
- _name = 'snailmail.letter.missing.required.fields'
_description = 'Update address of partner'
partner_id = fields.Many2one('res.partner')
diff --git a/addons/snailmail_account/models/account_move_send.py b/addons/snailmail_account/models/account_move_send.py
index 577393e0484fe..209e1d4fe81de 100644
--- a/addons/snailmail_account/models/account_move_send.py
+++ b/addons/snailmail_account/models/account_move_send.py
@@ -2,7 +2,7 @@
class AccountMoveSend(models.AbstractModel):
- _inherit = 'account.move.send'
+ _inherit = ['account.move.send']
# -------------------------------------------------------------------------
# ALERTS
diff --git a/addons/snailmail_account/models/res_partner.py b/addons/snailmail_account/models/res_partner.py
index 110c12b49e151..ccde17e6b4986 100644
--- a/addons/snailmail_account/models/res_partner.py
+++ b/addons/snailmail_account/models/res_partner.py
@@ -2,7 +2,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
invoice_sending_method = fields.Selection(
selection_add=[('snailmail', 'by Post')],
diff --git a/addons/snailmail_account/wizard/account_move_send_batch_wizard.py b/addons/snailmail_account/wizard/account_move_send_batch_wizard.py
index 932163c7e3b76..e123c3a7090b9 100644
--- a/addons/snailmail_account/wizard/account_move_send_batch_wizard.py
+++ b/addons/snailmail_account/wizard/account_move_send_batch_wizard.py
@@ -2,7 +2,7 @@
class AccountMoveSendBatchWizard(models.TransientModel):
- _inherit = 'account.move.send.batch.wizard'
+ _inherit = ['account.move.send.batch.wizard']
send_by_post_stamps = fields.Integer(compute='_compute_send_by_post_stamps')
diff --git a/addons/social_media/models/res_company.py b/addons/social_media/models/res_company.py
index db7eb074f3e51..2aff0c5423edc 100644
--- a/addons/social_media/models/res_company.py
+++ b/addons/social_media/models/res_company.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Company(models.Model):
- _inherit = "res.company"
+class ResCompany(models.Model):
+ _inherit = ["res.company"]
social_twitter = fields.Char('X Account')
social_facebook = fields.Char('Facebook Account')
diff --git a/addons/spreadsheet/models/ir_http.py b/addons/spreadsheet/models/ir_http.py
index 859b82f591ffd..76f20a0ee950f 100644
--- a/addons/spreadsheet/models/ir_http.py
+++ b/addons/spreadsheet/models/ir_http.py
@@ -4,7 +4,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
def session_info(self):
"""
diff --git a/addons/spreadsheet/models/res_currency.py b/addons/spreadsheet/models/res_currency.py
index 41efd8b6690df..59a45780d7bf3 100644
--- a/addons/spreadsheet/models/res_currency.py
+++ b/addons/spreadsheet/models/res_currency.py
@@ -2,7 +2,7 @@
class ResCurrency(models.Model):
- _inherit = "res.currency"
+ _inherit = ["res.currency"]
@api.model
def get_company_currency_for_spreadsheet(self, company_id=None):
diff --git a/addons/spreadsheet/models/res_currency_rate.py b/addons/spreadsheet/models/res_currency_rate.py
index 9fc6af850436a..6a6b8f188b243 100644
--- a/addons/spreadsheet/models/res_currency_rate.py
+++ b/addons/spreadsheet/models/res_currency_rate.py
@@ -2,7 +2,7 @@
class ResCurrencyRate(models.Model):
- _inherit = "res.currency.rate"
+ _inherit = ["res.currency.rate"]
@api.model
def _get_rate_for_spreadsheet(self, currency_from_code, currency_to_code, date=None, company_id=None):
diff --git a/addons/spreadsheet/models/res_lang.py b/addons/spreadsheet/models/res_lang.py
index 2d16e9c85d6eb..dd6265070c2f7 100644
--- a/addons/spreadsheet/models/res_lang.py
+++ b/addons/spreadsheet/models/res_lang.py
@@ -8,8 +8,8 @@
)
-class Lang(models.Model):
- _inherit = "res.lang"
+class ResLang(models.Model):
+ _inherit = ["res.lang"]
@api.model
def get_locales_for_spreadsheet(self):
diff --git a/addons/spreadsheet/models/spreadsheet_mixin.py b/addons/spreadsheet/models/spreadsheet_mixin.py
index 04f781f4ab325..601c6f7142bbf 100644
--- a/addons/spreadsheet/models/spreadsheet_mixin.py
+++ b/addons/spreadsheet/models/spreadsheet_mixin.py
@@ -13,8 +13,8 @@
from odoo.addons.spreadsheet.utils.validate_data import fields_in_spreadsheet, menus_xml_ids_in_spreadsheet
+
class SpreadsheetMixin(models.AbstractModel):
- _name = "spreadsheet.mixin"
_description = "Spreadsheet mixin"
_auto = False
diff --git a/addons/spreadsheet_account/models/account.py b/addons/spreadsheet_account/models/account.py
index 8c49b7aed06b2..a0cc3d85cea1f 100644
--- a/addons/spreadsheet_account/models/account.py
+++ b/addons/spreadsheet_account/models/account.py
@@ -10,8 +10,8 @@
from odoo.tools import date_utils
-class AccountMove(models.Model):
- _inherit = "account.account"
+class AccountAccount(models.Model):
+ _inherit = ["account.account"]
@api.model
def _get_date_period_boundaries(self, date_period, company):
diff --git a/addons/spreadsheet_account/models/res_company.py b/addons/spreadsheet_account/models/res_company.py
index d59642256ab2d..bcaf50db52cec 100644
--- a/addons/spreadsheet_account/models/res_company.py
+++ b/addons/spreadsheet_account/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
@api.model
def get_fiscal_dates(self, payload):
diff --git a/addons/spreadsheet_dashboard/models/spreadsheet_dashboard.py b/addons/spreadsheet_dashboard/models/spreadsheet_dashboard.py
index 4cf6b80339036..db123af1cc712 100644
--- a/addons/spreadsheet_dashboard/models/spreadsheet_dashboard.py
+++ b/addons/spreadsheet_dashboard/models/spreadsheet_dashboard.py
@@ -5,9 +5,8 @@
class SpreadsheetDashboard(models.Model):
- _name = 'spreadsheet.dashboard'
_description = 'Spreadsheet Dashboard'
- _inherit = "spreadsheet.mixin"
+ _inherit = ["spreadsheet.mixin"]
_order = 'sequence'
name = fields.Char(required=True, translate=True)
diff --git a/addons/spreadsheet_dashboard/models/spreadsheet_dashboard_group.py b/addons/spreadsheet_dashboard/models/spreadsheet_dashboard_group.py
index a96da168bec50..ff5df99cdb41c 100644
--- a/addons/spreadsheet_dashboard/models/spreadsheet_dashboard_group.py
+++ b/addons/spreadsheet_dashboard/models/spreadsheet_dashboard_group.py
@@ -3,7 +3,6 @@
class SpreadsheetDashboardGroup(models.Model):
- _name = 'spreadsheet.dashboard.group'
_description = 'Group of dashboards'
_order = 'sequence'
diff --git a/addons/spreadsheet_dashboard/models/spreadsheet_dashboard_share.py b/addons/spreadsheet_dashboard/models/spreadsheet_dashboard_share.py
index 0f2cc861a31aa..dd6f27885d3e1 100644
--- a/addons/spreadsheet_dashboard/models/spreadsheet_dashboard_share.py
+++ b/addons/spreadsheet_dashboard/models/spreadsheet_dashboard_share.py
@@ -5,9 +5,9 @@
from odoo import models, fields, api, _
from odoo.tools import consteq
+
class SpreadsheetDashboardShare(models.Model):
- _name = 'spreadsheet.dashboard.share'
- _inherit = 'spreadsheet.mixin'
+ _inherit = ['spreadsheet.mixin']
_description = 'Copy of a shared dashboard'
dashboard_id = fields.Many2one('spreadsheet.dashboard', required=True, ondelete='cascade')
diff --git a/addons/stock/models/barcode.py b/addons/stock/models/barcode.py
index e81afcfe60799..587d8b072238e 100644
--- a/addons/stock/models/barcode.py
+++ b/addons/stock/models/barcode.py
@@ -5,7 +5,7 @@
class BarcodeRule(models.Model):
- _inherit = 'barcode.rule'
+ _inherit = ['barcode.rule']
type = fields.Selection(selection_add=[
('weight', 'Weighted Product'),
diff --git a/addons/stock/models/ir_actions_report.py b/addons/stock/models/ir_actions_report.py
index c742786d71972..4ec3741d0a215 100644
--- a/addons/stock/models/ir_actions_report.py
+++ b/addons/stock/models/ir_actions_report.py
@@ -2,7 +2,7 @@
class IrActionsReport(models.Model):
- _inherit = 'ir.actions.report'
+ _inherit = ['ir.actions.report']
def _get_rendering_context(self, report, docids, data):
data = super()._get_rendering_context(report, docids, data)
diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py
index ea589767c0616..10d70f2803d82 100644
--- a/addons/stock/models/product.py
+++ b/addons/stock/models/product.py
@@ -23,8 +23,8 @@
}
-class Product(models.Model):
- _inherit = "product.product"
+class ProductProduct(models.Model):
+ _inherit = ["product.product"]
stock_quant_ids = fields.One2many('stock.quant', 'product_id') # used to compute quantities
stock_move_ids = fields.One2many('stock.move', 'product_id') # used to compute quantities
@@ -442,7 +442,7 @@ def _onchange_tracking(self):
@api.model
def view_header_get(self, view_id, view_type):
- res = super(Product, self).view_header_get(view_id, view_type)
+ res = super().view_header_get(view_id, view_type)
if not res and self._context.get('active_id') and self._context.get('active_model') == 'stock.location':
return _(
'Products: %(location)s',
@@ -637,7 +637,7 @@ def _filter_to_unlink(self):
domain = [('product_id', 'in', self.ids)]
lines = self.env['stock.lot']._read_group(domain, ['product_id'])
linked_product_ids = [product.id for [product] in lines]
- return super(Product, self - self.browse(linked_product_ids))._filter_to_unlink()
+ return super(ProductProduct, self - self.browse(linked_product_ids))._filter_to_unlink()
@api.model
def _count_returned_sn_products(self, sn_lot):
@@ -660,7 +660,7 @@ def _count_returned_sn_products_domain(self, sn_lot, or_domains):
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
_check_company_auto = True
is_storable = fields.Boolean(
@@ -1024,7 +1024,7 @@ def action_product_tmpl_forecast_report(self):
class ProductCategory(models.Model):
- _inherit = 'product.category'
+ _inherit = ['product.category']
route_ids = fields.Many2many(
'stock.route', 'stock_route_categ', 'categ_id', 'route_id', 'Routes',
@@ -1080,8 +1080,9 @@ def _search_filter_for_stock_putaway_rule(self, operator, value):
return [('id', '=', product.categ_id.id)]
return []
+
class ProductPackaging(models.Model):
- _inherit = "product.packaging"
+ _inherit = ["product.packaging"]
package_type_id = fields.Many2one('stock.package.type', 'Package Type')
route_ids = fields.Many2many(
@@ -1090,8 +1091,8 @@ class ProductPackaging(models.Model):
help="Depending on the modules installed, this will allow you to define the route of the product in this packaging: whether it will be bought, manufactured, replenished on order, etc.")
-class UoM(models.Model):
- _inherit = 'uom.uom'
+class UomUom(models.Model):
+ _inherit = ['uom.uom']
def write(self, values):
# Users can not update the factor if open stock moves are based on it
@@ -1122,7 +1123,7 @@ def write(self, values):
('quantity', '!=', 0),
]):
raise UserError(error_msg)
- return super(UoM, self).write(values)
+ return super().write(values)
def _adjust_uom_quantities(self, qty, quant_uom):
""" This method adjust the quantities of a procurement if its UoM isn't the same
diff --git a/addons/stock/models/product_strategy.py b/addons/stock/models/product_strategy.py
index d0ca6745cf36d..eed17336adcf9 100644
--- a/addons/stock/models/product_strategy.py
+++ b/addons/stock/models/product_strategy.py
@@ -7,8 +7,7 @@
from odoo.tools.float_utils import float_compare
-class RemovalStrategy(models.Model):
- _name = 'product.removal'
+class ProductRemoval(models.Model):
_description = 'Removal Strategy'
name = fields.Char('Name', required=True, translate=True)
@@ -16,7 +15,6 @@ class RemovalStrategy(models.Model):
class StockPutawayRule(models.Model):
- _name = 'stock.putaway.rule'
_order = 'sequence,product_id'
_description = 'Putaway Rule'
_check_company_auto = True
diff --git a/addons/stock/models/res_company.py b/addons/stock/models/res_company.py
index fc725d700c3b1..e1b94c01636d9 100644
--- a/addons/stock/models/res_company.py
+++ b/addons/stock/models/res_company.py
@@ -5,8 +5,8 @@
from odoo import _, api, fields, models
-class Company(models.Model):
- _inherit = "res.company"
+class ResCompany(models.Model):
+ _inherit = ["res.company"]
_check_company_auto = True
def _default_confirmation_mail_template(self):
diff --git a/addons/stock/models/res_config_settings.py b/addons/stock/models/res_config_settings.py
index f1942c44b4e63..970b59746bbda 100644
--- a/addons/stock/models/res_config_settings.py
+++ b/addons/stock/models/res_config_settings.py
@@ -6,7 +6,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
module_product_expiry = fields.Boolean("Expiration Dates",
help="Track following dates on lots & serial numbers: best before, removal, end of life, alert. \n Such dates are set automatically at lot/serial number creation based on values set on the product (in days).")
diff --git a/addons/stock/models/res_partner.py b/addons/stock/models/res_partner.py
index fb6b4b2629bb7..ade1cae551f92 100644
--- a/addons/stock/models/res_partner.py
+++ b/addons/stock/models/res_partner.py
@@ -5,8 +5,8 @@
from odoo.addons.base.models.res_partner import WARNING_HELP, WARNING_MESSAGE
-class Partner(models.Model):
- _inherit = 'res.partner'
+class ResPartner(models.Model):
+ _inherit = ['res.partner']
_check_company_auto = True
property_stock_customer = fields.Many2one(
diff --git a/addons/stock/models/res_users.py b/addons/stock/models/res_users.py
index d291c23467b7a..5803b1f70f6d9 100644
--- a/addons/stock/models/res_users.py
+++ b/addons/stock/models/res_users.py
@@ -3,8 +3,8 @@
from odoo import models
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
def _get_default_warehouse_id(self):
# !!! Any change to the following search domain should probably
diff --git a/addons/stock/models/stock_location.py b/addons/stock/models/stock_location.py
index 7962e876c2729..ccdbf913fd13b 100644
--- a/addons/stock/models/stock_location.py
+++ b/addons/stock/models/stock_location.py
@@ -12,8 +12,7 @@
from odoo.tools.float_utils import float_compare
-class Location(models.Model):
- _name = "stock.location"
+class StockLocation(models.Model):
_description = "Inventory Locations"
_parent_name = "location_id"
_parent_store = True
@@ -24,7 +23,7 @@ class Location(models.Model):
@api.model
def default_get(self, fields):
- res = super(Location, self).default_get(fields)
+ res = super().default_get(fields)
if 'barcode' in fields and 'barcode' not in res and res.get('complete_name'):
res['barcode'] = res['complete_name']
return res
@@ -252,7 +251,7 @@ def write(self, values):
"You can't disable locations %s because they still contain products.",
', '.join(children_quants.mapped('location_id.display_name'))))
else:
- super(Location, children_location - self).with_context(do_not_check_quant=True).write({
+ super(StockLocation, children_location - self).with_context(do_not_check_quant=True).write({
'active': values['active'],
})
@@ -261,7 +260,7 @@ def write(self, values):
return res
def unlink(self):
- return super(Location, self.search([('id', 'child_of', self.ids)])).unlink()
+ return super(StockLocation, self.search([('id', 'child_of', self.ids)])).unlink()
@api.model
def name_create(self, name):
@@ -497,7 +496,6 @@ def _get_weight(self, excluded_sml_ids=False):
class StockRoute(models.Model):
- _name = 'stock.route'
_description = "Inventory Routes"
_order = 'sequence'
_check_company_auto = True
diff --git a/addons/stock/models/stock_lot.py b/addons/stock/models/stock_lot.py
index 35d258194e7b4..95bf191cb6bb1 100644
--- a/addons/stock/models/stock_lot.py
+++ b/addons/stock/models/stock_lot.py
@@ -20,7 +20,6 @@
class StockLot(models.Model):
- _name = 'stock.lot'
_inherit = ['mail.thread', 'mail.activity.mixin']
_description = 'Lot/Serial'
_check_company_auto = True
diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py
index fe1a03346b1c3..29220455c718b 100644
--- a/addons/stock/models/stock_move.py
+++ b/addons/stock/models/stock_move.py
@@ -17,7 +17,6 @@
class StockMove(models.Model):
- _name = "stock.move"
_description = "Stock Move"
_order = 'sequence, id'
diff --git a/addons/stock/models/stock_move_line.py b/addons/stock/models/stock_move_line.py
index 8f71ab8858b5e..01a858ce53eb1 100644
--- a/addons/stock/models/stock_move_line.py
+++ b/addons/stock/models/stock_move_line.py
@@ -10,7 +10,6 @@
class StockMoveLine(models.Model):
- _name = "stock.move.line"
_description = "Product Moves (Stock Move Line)"
_rec_name = "product_id"
_order = "result_package_id desc, id"
diff --git a/addons/stock/models/stock_orderpoint.py b/addons/stock/models/stock_orderpoint.py
index 8ac3f8736663f..6b72d823f1ad1 100644
--- a/addons/stock/models/stock_orderpoint.py
+++ b/addons/stock/models/stock_orderpoint.py
@@ -20,7 +20,6 @@
class StockWarehouseOrderpoint(models.Model):
""" Defines Minimum stock rules. """
- _name = "stock.warehouse.orderpoint"
_description = "Minimum Inventory Rule"
_check_company_auto = True
_order = "location_id,company_id,id"
diff --git a/addons/stock/models/stock_package_level.py b/addons/stock/models/stock_package_level.py
index bb80780a83427..1dec3920ead83 100644
--- a/addons/stock/models/stock_package_level.py
+++ b/addons/stock/models/stock_package_level.py
@@ -7,8 +7,7 @@
from odoo.tools.float_utils import float_is_zero
-class StockPackageLevel(models.Model):
- _name = 'stock.package_level'
+class StockPackage_Level(models.Model):
_description = 'Stock Package Level'
_check_company_auto = True
@@ -161,7 +160,7 @@ def create(self, vals_list):
return package_levels
def write(self, vals):
- result = super(StockPackageLevel, self).write(vals)
+ result = super().write(vals)
if vals.get('location_dest_id'):
self.mapped('move_line_ids').write({'location_dest_id': vals['location_dest_id']})
self.mapped('move_ids').write({'location_dest_id': vals['location_dest_id']})
@@ -170,7 +169,7 @@ def write(self, vals):
def unlink(self):
self.mapped('move_ids').write({'package_level_id': False})
self.mapped('move_line_ids').write({'result_package_id': False})
- return super(StockPackageLevel, self).unlink()
+ return super().unlink()
def _check_move_lines_map_quant_package(self, package, only_picked=False):
mls = self.move_line_ids
diff --git a/addons/stock/models/stock_package_type.py b/addons/stock/models/stock_package_type.py
index f71bb4986ea39..ee7a67eab2a12 100644
--- a/addons/stock/models/stock_package_type.py
+++ b/addons/stock/models/stock_package_type.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class PackageType(models.Model):
- _name = 'stock.package.type'
+class StockPackageType(models.Model):
_description = "Stock package type"
def _get_default_length_uom(self):
diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py
index ec2997f37d543..189838ed49dbc 100644
--- a/addons/stock/models/stock_picking.py
+++ b/addons/stock/models/stock_picking.py
@@ -16,8 +16,7 @@
from odoo.tools.float_utils import float_compare, float_is_zero
-class PickingType(models.Model):
- _name = "stock.picking.type"
+class StockPickingType(models.Model):
_description = "Picking Type"
_order = 'is_favorite desc, sequence, id'
_rec_names_search = ['name', 'warehouse_id.name']
@@ -214,7 +213,7 @@ def write(self, vals):
moves = self.env['stock.move'].search([('picking_type_id', 'in', picking_types.ids), ('state', 'not in', ('assigned', 'done', 'cancel'))])
moves.reservation_date = False
- return super(PickingType, self).write(vals)
+ return super().write(vals)
@api.model
def _search_is_favorite(self, operator, value):
@@ -525,8 +524,7 @@ def _prepare_graph_data(self, summaries):
picking_type.kanban_dashboard_graph = json.dumps(graph_data)
-class Picking(models.Model):
- _name = "stock.picking"
+class StockPicking(models.Model):
_inherit = ['mail.thread', 'mail.activity.mixin']
_description = "Transfer"
_order = "priority desc, scheduled_date asc, id desc"
@@ -1117,7 +1115,7 @@ def write(self, vals):
for picking in self:
if picking.picking_type_id != picking_type:
picking.name = picking_type.sequence_id.next_by_id()
- res = super(Picking, self).write(vals)
+ res = super().write(vals)
if vals.get('signature'):
for picking in self:
picking._attach_sign()
@@ -1139,7 +1137,7 @@ def write(self, vals):
def unlink(self):
self.move_ids._action_cancel()
self.with_context(prefetch_fields=False).move_ids.unlink() # Checks if moves are not done
- return super(Picking, self).unlink()
+ return super().unlink()
def do_print_picking(self):
self.write({'printed': True})
diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py
index a50f8c1dc0090..346ab759270d7 100644
--- a/addons/stock/models/stock_quant.py
+++ b/addons/stock/models/stock_quant.py
@@ -17,7 +17,6 @@
class StockQuant(models.Model):
- _name = 'stock.quant'
_description = 'Quants'
_rec_name = 'product_id'
_rec_names_search = ['location_id', 'lot_id', 'package_id', 'owner_id']
@@ -1517,9 +1516,8 @@ def move_quants(self, location_dest_id=False, package_dest_id=False, message=Fal
moves._action_done()
-class QuantPackage(models.Model):
+class StockQuantPackage(models.Model):
""" Packages containing quants and/or other packages """
- _name = "stock.quant.package"
_description = "Packages"
_order = 'name'
diff --git a/addons/stock/models/stock_replenish_mixin.py b/addons/stock/models/stock_replenish_mixin.py
index 5047865bdd00c..6656115bc819c 100644
--- a/addons/stock/models/stock_replenish_mixin.py
+++ b/addons/stock/models/stock_replenish_mixin.py
@@ -3,8 +3,7 @@
from odoo import api, fields, models
-class ProductReplenishMixin(models.AbstractModel):
- _name = 'stock.replenish.mixin'
+class StockReplenishMixin(models.AbstractModel):
_description = 'Product Replenish Mixin'
route_id = fields.Many2one(
diff --git a/addons/stock/models/stock_rule.py b/addons/stock/models/stock_rule.py
index ed6c12a130b64..5baa308ce59b4 100644
--- a/addons/stock/models/stock_rule.py
+++ b/addons/stock/models/stock_rule.py
@@ -29,7 +29,6 @@ def __init__(self, procurement_exceptions):
class StockRule(models.Model):
""" A rule describe what a procurement should do; produce, buy, move, ... """
- _name = 'stock.rule'
_description = "Stock Rule"
_order = "sequence, id"
_check_company_auto = True
@@ -426,7 +425,6 @@ class ProcurementGroup(models.Model):
The name is usually the name of the original document (sales order) or a
sequence computed if created manually.
"""
- _name = 'procurement.group'
_description = 'Procurement Group'
_order = "id desc"
diff --git a/addons/stock/models/stock_scrap.py b/addons/stock/models/stock_scrap.py
index 7c11fe7faddb3..b7e2c62a0a435 100644
--- a/addons/stock/models/stock_scrap.py
+++ b/addons/stock/models/stock_scrap.py
@@ -8,7 +8,6 @@
class StockScrap(models.Model):
- _name = 'stock.scrap'
_inherit = ['mail.thread']
_order = 'id desc'
_description = 'Scrap'
@@ -228,7 +227,6 @@ def action_validate(self):
class StockScrapReasonTag(models.Model):
- _name = 'stock.scrap.reason.tag'
_description = 'Scrap Reason Tag'
_order = 'sequence, id'
diff --git a/addons/stock/models/stock_storage_category.py b/addons/stock/models/stock_storage_category.py
index e552fe428fd07..1dbfd6703c287 100644
--- a/addons/stock/models/stock_storage_category.py
+++ b/addons/stock/models/stock_storage_category.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class StorageCategory(models.Model):
- _name = 'stock.storage.category'
+class StockStorageCategory(models.Model):
_description = "Storage Category"
_order = "name"
@@ -44,8 +43,7 @@ def copy_data(self, default=None):
return [dict(vals, name=self.env._("%s (copy)", category.name)) for category, vals in zip(self, vals_list)]
-class StorageCategoryProductCapacity(models.Model):
- _name = 'stock.storage.category.capacity'
+class StockStorageCategoryCapacity(models.Model):
_description = "Storage Category Capacity"
_check_company_auto = True
_order = "storage_category_id"
diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py
index d725e61698e45..313dab980c837 100644
--- a/addons/stock/models/stock_warehouse.py
+++ b/addons/stock/models/stock_warehouse.py
@@ -22,8 +22,7 @@
}
-class Warehouse(models.Model):
- _name = "stock.warehouse"
+class StockWarehouse(models.Model):
_description = "Warehouse"
_order = 'sequence,id'
_check_company_auto = True
diff --git a/addons/stock/report/product_label_report.py b/addons/stock/report/product_label_report.py
index 9847bb6c8b1e5..e008ac3a20884 100644
--- a/addons/stock/report/product_label_report.py
+++ b/addons/stock/report/product_label_report.py
@@ -8,8 +8,8 @@
import markupsafe
-class ReportProductLabel(models.AbstractModel):
- _name = 'report.stock.label_product_product_view'
+
+class ReportStockLabel_Product_Product_View(models.AbstractModel):
_description = 'Product Label Report'
def _get_report_values(self, docids, data):
@@ -51,8 +51,7 @@ def _get_report_values(self, docids, data):
return data
-class ReportLotLabel(models.AbstractModel):
- _name = 'report.stock.label_lot_template_view'
+class ReportStockLabel_Lot_Template_View(models.AbstractModel):
_description = 'Lot Label Report'
def _get_report_values(self, docids, data):
diff --git a/addons/stock/report/report_stock_quantity.py b/addons/stock/report/report_stock_quantity.py
index 52a3f5a0e744f..1525636d7a2b3 100644
--- a/addons/stock/report/report_stock_quantity.py
+++ b/addons/stock/report/report_stock_quantity.py
@@ -5,7 +5,6 @@
class ReportStockQuantity(models.Model):
- _name = 'report.stock.quantity'
_auto = False
_description = 'Stock Quantity Report'
diff --git a/addons/stock/report/report_stock_reception.py b/addons/stock/report/report_stock_reception.py
index 3347a5ec297bc..990e45c16858c 100644
--- a/addons/stock/report/report_stock_reception.py
+++ b/addons/stock/report/report_stock_reception.py
@@ -7,8 +7,7 @@
from odoo.tools import float_compare, float_is_zero, format_date
-class ReceptionReport(models.AbstractModel):
- _name = 'report.stock.report_reception'
+class ReportStockReport_Reception(models.AbstractModel):
_description = "Stock Reception Report"
@api.model
diff --git a/addons/stock/report/report_stock_rule.py b/addons/stock/report/report_stock_rule.py
index 91968d18f8be3..4197a707a570c 100644
--- a/addons/stock/report/report_stock_rule.py
+++ b/addons/stock/report/report_stock_rule.py
@@ -5,8 +5,7 @@
from odoo.exceptions import UserError
-class ReportStockRule(models.AbstractModel):
- _name = 'report.stock.report_stock_rule'
+class ReportStockReport_Stock_Rule(models.AbstractModel):
_description = 'Stock rule report'
@api.model
diff --git a/addons/stock/report/stock_forecasted.py b/addons/stock/report/stock_forecasted.py
index bd38441260f51..e057babf4e50e 100644
--- a/addons/stock/report/stock_forecasted.py
+++ b/addons/stock/report/stock_forecasted.py
@@ -8,8 +8,8 @@
from odoo.osv.expression import AND
from odoo.tools import float_is_zero, format_date, float_round, float_compare
-class StockForecasted(models.AbstractModel):
- _name = 'stock.forecasted_product_product'
+
+class StockForecasted_Product_Product(models.AbstractModel):
_description = "Stock Replenishment Report"
@api.model
@@ -431,10 +431,9 @@ def action_unreserve_linked_picks(self, move_id):
return move_ids
-class StockForecastedTemplate(models.AbstractModel):
- _name = 'stock.forecasted_product_template'
+class StockForecasted_Product_Template(models.AbstractModel):
_description = "Stock Replenishment Report"
- _inherit = 'stock.forecasted_product_product'
+ _inherit = ['stock.forecasted_product_product']
@api.model
def get_report_values(self, docids, data=None):
diff --git a/addons/stock/report/stock_lot_customer.py b/addons/stock/report/stock_lot_customer.py
index e59b6f667e368..0ad6eb3ee8721 100644
--- a/addons/stock/report/stock_lot_customer.py
+++ b/addons/stock/report/stock_lot_customer.py
@@ -4,7 +4,6 @@
class StockLotReport(models.Model):
- _name = "stock.lot.report"
_description = "Customer Lot Report"
_rec_name = 'lot_id'
_auto = False
diff --git a/addons/stock/report/stock_traceability.py b/addons/stock/report/stock_traceability.py
index b2ae5da7351c2..3d37261e2dcbf 100644
--- a/addons/stock/report/stock_traceability.py
+++ b/addons/stock/report/stock_traceability.py
@@ -18,8 +18,7 @@ def autoIncrement():
return rec
-class MrpStockReport(models.TransientModel):
- _name = 'stock.traceability.report'
+class StockTraceabilityReport(models.TransientModel):
_description = 'Traceability Report'
@api.model
diff --git a/addons/stock/wizard/product_label_layout.py b/addons/stock/wizard/product_label_layout.py
index 4c2efd22df63e..a9b1d9f260e0d 100644
--- a/addons/stock/wizard/product_label_layout.py
+++ b/addons/stock/wizard/product_label_layout.py
@@ -7,7 +7,7 @@
class ProductLabelLayout(models.TransientModel):
- _inherit = 'product.label.layout'
+ _inherit = ['product.label.layout']
move_ids = fields.Many2many('stock.move')
move_quantity = fields.Selection([
diff --git a/addons/stock/wizard/product_replenish.py b/addons/stock/wizard/product_replenish.py
index 859ef01dd2983..82672c4638802 100644
--- a/addons/stock/wizard/product_replenish.py
+++ b/addons/stock/wizard/product_replenish.py
@@ -10,8 +10,7 @@
class ProductReplenish(models.TransientModel):
- _name = 'product.replenish'
- _inherit = 'stock.replenish.mixin'
+ _inherit = ['stock.replenish.mixin']
_description = 'Product Replenish'
_check_company_auto = True
diff --git a/addons/stock/wizard/stock_backorder_confirmation.py b/addons/stock/wizard/stock_backorder_confirmation.py
index bece171f154c8..276d2e1663e4b 100644
--- a/addons/stock/wizard/stock_backorder_confirmation.py
+++ b/addons/stock/wizard/stock_backorder_confirmation.py
@@ -6,7 +6,6 @@
class StockBackorderConfirmationLine(models.TransientModel):
- _name = 'stock.backorder.confirmation.line'
_description = 'Backorder Confirmation Line'
backorder_confirmation_id = fields.Many2one('stock.backorder.confirmation', 'Immediate Transfer')
@@ -15,7 +14,6 @@ class StockBackorderConfirmationLine(models.TransientModel):
class StockBackorderConfirmation(models.TransientModel):
- _name = 'stock.backorder.confirmation'
_description = 'Backorder Confirmation'
pick_ids = fields.Many2many('stock.picking', 'stock_picking_backorder_rel')
diff --git a/addons/stock/wizard/stock_change_product_qty.py b/addons/stock/wizard/stock_change_product_qty.py
index c6d08f22c41a2..eee8ece13b0f8 100644
--- a/addons/stock/wizard/stock_change_product_qty.py
+++ b/addons/stock/wizard/stock_change_product_qty.py
@@ -5,8 +5,7 @@
from odoo.exceptions import UserError
-class ProductChangeQuantity(models.TransientModel):
- _name = "stock.change.product.qty"
+class StockChangeProductQty(models.TransientModel):
_description = "Change Product Quantity"
product_id = fields.Many2one('product.product', 'Product', required=True)
diff --git a/addons/stock/wizard/stock_inventory_adjustment_name.py b/addons/stock/wizard/stock_inventory_adjustment_name.py
index 9e53cf646fdd8..7f57e9fa20e9a 100644
--- a/addons/stock/wizard/stock_inventory_adjustment_name.py
+++ b/addons/stock/wizard/stock_inventory_adjustment_name.py
@@ -5,7 +5,6 @@
class StockInventoryAdjustmentName(models.TransientModel):
- _name = 'stock.inventory.adjustment.name'
_description = 'Inventory Adjustment Reference / Reason'
quant_ids = fields.Many2many('stock.quant')
diff --git a/addons/stock/wizard/stock_inventory_conflict.py b/addons/stock/wizard/stock_inventory_conflict.py
index 2bba84108ba16..a7b94c2ecd0fe 100644
--- a/addons/stock/wizard/stock_inventory_conflict.py
+++ b/addons/stock/wizard/stock_inventory_conflict.py
@@ -5,7 +5,6 @@
class StockInventoryConflict(models.TransientModel):
- _name = 'stock.inventory.conflict'
_description = 'Conflict in Inventory'
quant_ids = fields.Many2many(
diff --git a/addons/stock/wizard/stock_inventory_warning.py b/addons/stock/wizard/stock_inventory_warning.py
index 62608ab48597a..057b7c58a132f 100644
--- a/addons/stock/wizard/stock_inventory_warning.py
+++ b/addons/stock/wizard/stock_inventory_warning.py
@@ -5,7 +5,6 @@
class StockInventoryWarning(models.TransientModel):
- _name = 'stock.inventory.warning'
_description = 'Inventory Adjustment Warning'
quant_ids = fields.Many2many('stock.quant')
diff --git a/addons/stock/wizard/stock_label_type.py b/addons/stock/wizard/stock_label_type.py
index f05af6f4d2095..1c7062256a4fc 100644
--- a/addons/stock/wizard/stock_label_type.py
+++ b/addons/stock/wizard/stock_label_type.py
@@ -4,8 +4,7 @@
from odoo import _, fields, models
-class ProductLabelLayout(models.TransientModel):
- _name = 'picking.label.type'
+class PickingLabelType(models.TransientModel):
_description = 'Choose whether to print product or lot/sn labels'
picking_ids = fields.Many2many('stock.picking')
diff --git a/addons/stock/wizard/stock_lot_label_layout.py b/addons/stock/wizard/stock_lot_label_layout.py
index 4e09072d233af..14a5a0cd3c3cb 100644
--- a/addons/stock/wizard/stock_lot_label_layout.py
+++ b/addons/stock/wizard/stock_lot_label_layout.py
@@ -5,8 +5,7 @@
from odoo import fields, models
-class ProductLabelLayout(models.TransientModel):
- _name = 'lot.label.layout'
+class LotLabelLayout(models.TransientModel):
_description = 'Choose the sheet layout to print lot labels'
move_line_ids = fields.Many2many('stock.move.line')
diff --git a/addons/stock/wizard/stock_orderpoint_snooze.py b/addons/stock/wizard/stock_orderpoint_snooze.py
index 2fed22dfa2d7a..f222c47946d17 100644
--- a/addons/stock/wizard/stock_orderpoint_snooze.py
+++ b/addons/stock/wizard/stock_orderpoint_snooze.py
@@ -6,7 +6,6 @@
class StockOrderpointSnooze(models.TransientModel):
- _name = 'stock.orderpoint.snooze'
_description = 'Snooze Orderpoint'
orderpoint_ids = fields.Many2many('stock.warehouse.orderpoint')
diff --git a/addons/stock/wizard/stock_package_destination.py b/addons/stock/wizard/stock_package_destination.py
index b2964081fef04..877f659fd1bb8 100644
--- a/addons/stock/wizard/stock_package_destination.py
+++ b/addons/stock/wizard/stock_package_destination.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class ChooseDestinationLocation(models.TransientModel):
- _name = 'stock.package.destination'
+class StockPackageDestination(models.TransientModel):
_description = 'Stock Package Destination'
picking_id = fields.Many2one('stock.picking', required=True)
diff --git a/addons/stock/wizard/stock_picking_return.py b/addons/stock/wizard/stock_picking_return.py
index 8b087bdeb52cc..6cdf7184105ac 100644
--- a/addons/stock/wizard/stock_picking_return.py
+++ b/addons/stock/wizard/stock_picking_return.py
@@ -5,8 +5,7 @@
from odoo.tools.float_utils import float_is_zero
-class ReturnPickingLine(models.TransientModel):
- _name = "stock.return.picking.line"
+class StockReturnPickingLine(models.TransientModel):
_rec_name = 'product_id'
_description = 'Return Picking Line'
@@ -78,8 +77,7 @@ def _process_line(self, new_picking):
return True
-class ReturnPicking(models.TransientModel):
- _name = 'stock.return.picking'
+class StockReturnPicking(models.TransientModel):
_description = 'Return Picking'
@api.model
diff --git a/addons/stock/wizard/stock_quant_relocate.py b/addons/stock/wizard/stock_quant_relocate.py
index a5e8be351987a..edb9474a6f3ec 100644
--- a/addons/stock/wizard/stock_quant_relocate.py
+++ b/addons/stock/wizard/stock_quant_relocate.py
@@ -6,8 +6,7 @@
from odoo import fields, models, api
-class RelocateStockQuant(models.TransientModel):
- _name = 'stock.quant.relocate'
+class StockQuantRelocate(models.TransientModel):
_description = 'Stock Quantity Relocation'
quant_ids = fields.Many2many('stock.quant')
diff --git a/addons/stock/wizard/stock_quantity_history.py b/addons/stock/wizard/stock_quantity_history.py
index 28d64986e2606..5a31e8c102cb7 100644
--- a/addons/stock/wizard/stock_quantity_history.py
+++ b/addons/stock/wizard/stock_quantity_history.py
@@ -7,7 +7,6 @@
class StockQuantityHistory(models.TransientModel):
- _name = 'stock.quantity.history'
_description = 'Stock Quantity History'
inventory_datetime = fields.Datetime('Inventory at Date',
diff --git a/addons/stock/wizard/stock_replenishment_info.py b/addons/stock/wizard/stock_replenishment_info.py
index 9cb4543cd2bab..ffd2f9e91b8ee 100644
--- a/addons/stock/wizard/stock_replenishment_info.py
+++ b/addons/stock/wizard/stock_replenishment_info.py
@@ -15,7 +15,6 @@
class StockReplenishmentInfo(models.TransientModel):
- _name = 'stock.replenishment.info'
_description = 'Stock supplier replenishment information'
_rec_name = 'orderpoint_id'
@@ -97,7 +96,6 @@ def _compute_json_replenishment_history(self):
class StockReplenishmentOption(models.TransientModel):
- _name = 'stock.replenishment.option'
_description = 'Stock warehouse replenishment option'
route_id = fields.Many2one('stock.route')
diff --git a/addons/stock/wizard/stock_request_count.py b/addons/stock/wizard/stock_request_count.py
index d78769a814b0b..bb1e43dfce44e 100644
--- a/addons/stock/wizard/stock_request_count.py
+++ b/addons/stock/wizard/stock_request_count.py
@@ -6,7 +6,6 @@
class StockRequestCount(models.TransientModel):
- _name = 'stock.request.count'
_description = 'Stock Request an Inventory Count'
inventory_date = fields.Date(
diff --git a/addons/stock/wizard/stock_rules_report.py b/addons/stock/wizard/stock_rules_report.py
index 0aee05a7d30dc..bea3328bee731 100644
--- a/addons/stock/wizard/stock_rules_report.py
+++ b/addons/stock/wizard/stock_rules_report.py
@@ -5,7 +5,6 @@
class StockRulesReport(models.TransientModel):
- _name = 'stock.rules.report'
_description = 'Stock Rules report'
product_id = fields.Many2one('product.product', string='Product', required=True)
diff --git a/addons/stock/wizard/stock_track_confirmation.py b/addons/stock/wizard/stock_track_confirmation.py
index 27ea52adcac60..7e6e306c9c284 100644
--- a/addons/stock/wizard/stock_track_confirmation.py
+++ b/addons/stock/wizard/stock_track_confirmation.py
@@ -5,7 +5,6 @@
class StockTrackConfirmation(models.TransientModel):
- _name = 'stock.track.confirmation'
_description = 'Stock Track Confirmation'
tracking_line_ids = fields.One2many('stock.track.line', 'wizard_id')
@@ -21,8 +20,7 @@ def _onchange_quants(self):
self.tracking_line_ids = [(0, 0, {'product_id': product}) for product in self.product_ids]
-class StockTrackingLines(models.TransientModel):
- _name = 'stock.track.line'
+class StockTrackLine(models.TransientModel):
_description = 'Stock Track Line'
product_display_name = fields.Char('Name', compute='_compute_product_display_name', readonly=True)
diff --git a/addons/stock/wizard/stock_warn_insufficient_qty.py b/addons/stock/wizard/stock_warn_insufficient_qty.py
index aeebc9dd24bc1..66cf8b27ee0cb 100644
--- a/addons/stock/wizard/stock_warn_insufficient_qty.py
+++ b/addons/stock/wizard/stock_warn_insufficient_qty.py
@@ -5,7 +5,6 @@
class StockWarnInsufficientQty(models.AbstractModel):
- _name = 'stock.warn.insufficient.qty'
_description = 'Warn Insufficient Quantity'
product_id = fields.Many2one('product.product', 'Product', required=True)
@@ -32,8 +31,7 @@ def action_done(self):
class StockWarnInsufficientQtyScrap(models.TransientModel):
- _name = 'stock.warn.insufficient.qty.scrap'
- _inherit = 'stock.warn.insufficient.qty'
+ _inherit = ['stock.warn.insufficient.qty']
_description = 'Warn Insufficient Scrap Quantity'
scrap_id = fields.Many2one('stock.scrap', 'Scrap')
diff --git a/addons/stock_account/models/account_chart_template.py b/addons/stock_account/models/account_chart_template.py
index f57b47d7af110..700bcc0151652 100644
--- a/addons/stock_account/models/account_chart_template.py
+++ b/addons/stock_account/models/account_chart_template.py
@@ -6,7 +6,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
def _post_load_data(self, template_code, company, template_data):
super()._post_load_data(template_code, company, template_data)
diff --git a/addons/stock_account/models/account_move.py b/addons/stock_account/models/account_move.py
index 866a4a4b3721b..4f1c6d77d299f 100644
--- a/addons/stock_account/models/account_move.py
+++ b/addons/stock_account/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
stock_move_id = fields.Many2one('stock.move', string='Stock Move', index='btree_not_null')
stock_valuation_layer_ids = fields.One2many('stock.valuation.layer', 'account_move_id', string='Stock Valuation Layer')
@@ -238,7 +238,7 @@ def _get_invoiced_lot_values(self):
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
stock_valuation_layer_ids = fields.One2many('stock.valuation.layer', 'account_move_line_id', string='Stock Valuation Layer')
cogs_origin_id = fields.Many2one( # technical field used to keep track in the originating line of the anglo-saxon lines
diff --git a/addons/stock_account/models/analytic_account.py b/addons/stock_account/models/analytic_account.py
index 941904bddbc8e..69297abcbab57 100644
--- a/addons/stock_account/models/analytic_account.py
+++ b/addons/stock_account/models/analytic_account.py
@@ -6,7 +6,7 @@
class AccountAnalyticPlan(models.Model):
- _inherit = 'account.analytic.plan'
+ _inherit = ['account.analytic.plan']
def _calculate_distribution_amount(self, amount, percentage, total_percentage, distribution_on_each_plan):
"""
@@ -31,7 +31,7 @@ def _calculate_distribution_amount(self, amount, percentage, total_percentage, d
class AccountAnalyticAccount(models.Model):
- _inherit = 'account.analytic.account'
+ _inherit = ['account.analytic.account']
def _perform_analytic_distribution(self, distribution, amount, unit_amount, lines, obj, additive=False):
"""
diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py
index efddda2465a58..135021f91d1ad 100644
--- a/addons/stock_account/models/product.py
+++ b/addons/stock_account/models/product.py
@@ -10,8 +10,7 @@
class ProductTemplate(models.Model):
- _name = 'product.template'
- _inherit = 'product.template'
+ _inherit = ['product.template']
cost_method = fields.Selection(related="categ_id.property_cost_method", readonly=True)
valuation = fields.Selection(related="categ_id.property_valuation", readonly=True)
@@ -125,7 +124,7 @@ def get_product_accounts(self, fiscal_pos=None):
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
value_svl = fields.Float(compute='_compute_value_svl', compute_sudo=True)
quantity_svl = fields.Float(compute='_compute_value_svl', compute_sudo=True)
@@ -871,7 +870,7 @@ def _compute_average_price(self, qty_invoiced, qty_to_invoice, stock_moves, is_r
class ProductCategory(models.Model):
- _inherit = 'product.category'
+ _inherit = ['product.category']
property_valuation = fields.Selection([
('manual_periodic', 'Manual'),
diff --git a/addons/stock_account/models/res_company.py b/addons/stock_account/models/res_company.py
index d6a0921e6fd74..8d1c15ccfd451 100644
--- a/addons/stock_account/models/res_company.py
+++ b/addons/stock_account/models/res_company.py
@@ -2,8 +2,7 @@
class ResCompany(models.Model):
- _name = "res.company"
- _inherit = "res.company"
+ _inherit = ["res.company"]
account_production_wip_account_id = fields.Many2one('account.account', string='Production WIP Account', check_company=True)
account_production_wip_overhead_account_id = fields.Many2one('account.account', string='Production WIP Overhead Account', check_company=True)
diff --git a/addons/stock_account/models/res_config_settings.py b/addons/stock_account/models/res_config_settings.py
index 81dee2a185129..0c0d4a2573558 100644
--- a/addons/stock_account/models/res_config_settings.py
+++ b/addons/stock_account/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
module_stock_landed_costs = fields.Boolean("Landed Costs",
help="Affect landed costs on reception operations and split them among products to update their cost price.")
diff --git a/addons/stock_account/models/stock_location.py b/addons/stock_account/models/stock_location.py
index c1ecea1684a78..58847269fee14 100644
--- a/addons/stock_account/models/stock_location.py
+++ b/addons/stock_account/models/stock_location.py
@@ -5,7 +5,7 @@
class StockLocation(models.Model):
- _inherit = "stock.location"
+ _inherit = ["stock.location"]
valuation_in_account_id = fields.Many2one(
'account.account', 'Stock Valuation Account (Incoming)',
diff --git a/addons/stock_account/models/stock_lot.py b/addons/stock_account/models/stock_lot.py
index 0b75592e6ae2d..17b0100076add 100644
--- a/addons/stock_account/models/stock_lot.py
+++ b/addons/stock_account/models/stock_lot.py
@@ -8,7 +8,7 @@
class StockLot(models.Model):
- _inherit = 'stock.lot'
+ _inherit = ['stock.lot']
value_svl = fields.Float(compute='_compute_value_svl', compute_sudo=True)
quantity_svl = fields.Float(compute='_compute_value_svl', compute_sudo=True)
diff --git a/addons/stock_account/models/stock_move.py b/addons/stock_account/models/stock_move.py
index 51f7457227215..b2d8498515377 100644
--- a/addons/stock_account/models/stock_move.py
+++ b/addons/stock_account/models/stock_move.py
@@ -12,7 +12,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
to_refund = fields.Boolean(string="Update quantities on SO/PO", copy=True,
help='Trigger a decrease of the delivered/received quantity in the associated Sale Order/Purchase Order')
diff --git a/addons/stock_account/models/stock_move_line.py b/addons/stock_account/models/stock_move_line.py
index 80be8b8a2016d..b5b12d2ec1e20 100644
--- a/addons/stock_account/models/stock_move_line.py
+++ b/addons/stock_account/models/stock_move_line.py
@@ -7,7 +7,7 @@
class StockMoveLine(models.Model):
- _inherit = 'stock.move.line'
+ _inherit = ['stock.move.line']
# -------------------------------------------------------------------------
# CRUD
diff --git a/addons/stock_account/models/stock_picking.py b/addons/stock_account/models/stock_picking.py
index a497ed6744b73..1d809c9c30d01 100644
--- a/addons/stock_account/models/stock_picking.py
+++ b/addons/stock_account/models/stock_picking.py
@@ -7,7 +7,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
country_code = fields.Char(related="company_id.account_fiscal_country_id.code")
diff --git a/addons/stock_account/models/stock_quant.py b/addons/stock_account/models/stock_quant.py
index b54109210d0ba..1597058b70f3f 100644
--- a/addons/stock_account/models/stock_quant.py
+++ b/addons/stock_account/models/stock_quant.py
@@ -8,7 +8,7 @@
class StockQuant(models.Model):
- _inherit = 'stock.quant'
+ _inherit = ['stock.quant']
value = fields.Monetary('Value', compute='_compute_value', groups='stock.group_stock_manager')
currency_id = fields.Many2one('res.currency', compute='_compute_value', groups='stock.group_stock_manager')
diff --git a/addons/stock_account/models/stock_valuation_layer.py b/addons/stock_account/models/stock_valuation_layer.py
index 11702c8c05a98..de78a374b41b5 100644
--- a/addons/stock_account/models/stock_valuation_layer.py
+++ b/addons/stock_account/models/stock_valuation_layer.py
@@ -11,7 +11,6 @@
class StockValuationLayer(models.Model):
"""Stock Valuation Layer"""
- _name = 'stock.valuation.layer'
_description = 'Stock Valuation Layer'
_order = 'create_date, id'
diff --git a/addons/stock_account/models/template_generic_coa.py b/addons/stock_account/models/template_generic_coa.py
index 29fdcb2f2a99d..6a9b146420c2d 100644
--- a/addons/stock_account/models/template_generic_coa.py
+++ b/addons/stock_account/models/template_generic_coa.py
@@ -3,7 +3,7 @@
class AccountChartTemplate(models.AbstractModel):
- _inherit = "account.chart.template"
+ _inherit = ["account.chart.template"]
@template('generic_coa', 'res.company')
def _get_generic_coa_res_company(self):
diff --git a/addons/stock_account/report/stock_forecasted.py b/addons/stock_account/report/stock_forecasted.py
index c9602ecb8c588..40587cd9caf69 100644
--- a/addons/stock_account/report/stock_forecasted.py
+++ b/addons/stock_account/report/stock_forecasted.py
@@ -5,8 +5,8 @@
from odoo.tools.float_utils import float_is_zero, float_repr
-class StockForecasted(models.AbstractModel):
- _inherit = 'stock.forecasted_product_product'
+class StockForecasted_Product_Product(models.AbstractModel):
+ _inherit = ['stock.forecasted_product_product']
def _get_report_header(self, product_template_ids, product_ids, wh_location_ids):
""" Overrides to computes the valuations of the stock. """
diff --git a/addons/stock_account/wizard/stock_picking_return.py b/addons/stock_account/wizard/stock_picking_return.py
index fab152616047f..eaa4bfbfe45c0 100644
--- a/addons/stock_account/wizard/stock_picking_return.py
+++ b/addons/stock_account/wizard/stock_picking_return.py
@@ -5,7 +5,7 @@
class StockReturnPickingLine(models.TransientModel):
- _inherit = "stock.return.picking.line"
+ _inherit = ["stock.return.picking.line"]
to_refund = fields.Boolean(string="Update quantities on SO/PO", default=True,
help='Trigger a decrease of the delivered/received quantity in the associated Sale Order/Purchase Order')
diff --git a/addons/stock_account/wizard/stock_quantity_history.py b/addons/stock_account/wizard/stock_quantity_history.py
index e7a4b58282c99..c3c33be4e16ec 100644
--- a/addons/stock_account/wizard/stock_quantity_history.py
+++ b/addons/stock_account/wizard/stock_quantity_history.py
@@ -5,7 +5,7 @@
class StockQuantityHistory(models.TransientModel):
- _inherit = 'stock.quantity.history'
+ _inherit = ['stock.quantity.history']
def open_at_date(self):
active_model = self.env.context.get('active_model')
diff --git a/addons/stock_account/wizard/stock_request_count.py b/addons/stock_account/wizard/stock_request_count.py
index 757a74497709b..6f26b1ea43748 100644
--- a/addons/stock_account/wizard/stock_request_count.py
+++ b/addons/stock_account/wizard/stock_request_count.py
@@ -5,7 +5,7 @@
class StockRequestCount(models.TransientModel):
- _inherit = 'stock.request.count'
+ _inherit = ['stock.request.count']
accounting_date = fields.Date('Accounting Date')
diff --git a/addons/stock_account/wizard/stock_valuation_layer_revaluation.py b/addons/stock_account/wizard/stock_valuation_layer_revaluation.py
index b6505bf708814..a79cd7f357ba2 100644
--- a/addons/stock_account/wizard/stock_valuation_layer_revaluation.py
+++ b/addons/stock_account/wizard/stock_valuation_layer_revaluation.py
@@ -9,7 +9,6 @@
class StockValuationLayerRevaluation(models.TransientModel):
- _name = 'stock.valuation.layer.revaluation'
_description = "Wizard model to reavaluate a stock inventory for a product"
_check_company_auto = True
diff --git a/addons/stock_delivery/models/delivery_carrier.py b/addons/stock_delivery/models/delivery_carrier.py
index 87af883dc50df..1fa48b2dc5d00 100644
--- a/addons/stock_delivery/models/delivery_carrier.py
+++ b/addons/stock_delivery/models/delivery_carrier.py
@@ -10,7 +10,7 @@
class DeliveryCarrier(models.Model):
- _inherit = 'delivery.carrier'
+ _inherit = ['delivery.carrier']
# -------------------------------- #
# Internals for shipping providers #
diff --git a/addons/stock_delivery/models/product_template.py b/addons/stock_delivery/models/product_template.py
index 84d40ce46a3c3..785a18869a29c 100644
--- a/addons/stock_delivery/models/product_template.py
+++ b/addons/stock_delivery/models/product_template.py
@@ -4,7 +4,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
hs_code = fields.Char(
string="HS Code",
diff --git a/addons/stock_delivery/models/sale_order.py b/addons/stock_delivery/models/sale_order.py
index 701f368254e49..9ef3ebb9fc8ae 100644
--- a/addons/stock_delivery/models/sale_order.py
+++ b/addons/stock_delivery/models/sale_order.py
@@ -4,7 +4,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
def set_delivery_line(self, carrier, amount):
res = super().set_delivery_line(carrier, amount)
@@ -46,7 +46,7 @@ def _format_currency_amount(self, amount):
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
def _prepare_procurement_values(self, group_id):
values = super(SaleOrderLine, self)._prepare_procurement_values(group_id)
diff --git a/addons/stock_delivery/models/stock_move.py b/addons/stock_delivery/models/stock_move.py
index 77b4aaa1b5b13..6ef0c4c253e56 100644
--- a/addons/stock_delivery/models/stock_move.py
+++ b/addons/stock_delivery/models/stock_move.py
@@ -5,13 +5,13 @@
class StockRoute(models.Model):
- _inherit = "stock.route"
+ _inherit = ["stock.route"]
shipping_selectable = fields.Boolean("Applicable on Shipping Methods")
class StockMove(models.Model):
- _inherit = 'stock.move'
+ _inherit = ['stock.move']
def _auto_init(self):
if not column_exists(self.env.cr, "stock_move", "weight"):
@@ -47,8 +47,9 @@ def _key_assign_picking(self):
keys = super(StockMove, self)._key_assign_picking()
return keys + (self.sale_line_id.order_id.carrier_id,)
+
class StockMoveLine(models.Model):
- _inherit = 'stock.move.line'
+ _inherit = ['stock.move.line']
sale_price = fields.Float(compute='_compute_sale_price')
destination_country_code = fields.Char(related='picking_id.destination_country_code')
diff --git a/addons/stock_delivery/models/stock_package_type.py b/addons/stock_delivery/models/stock_package_type.py
index e63dd90972de1..57671fb9fdecd 100644
--- a/addons/stock_delivery/models/stock_package_type.py
+++ b/addons/stock_delivery/models/stock_package_type.py
@@ -3,8 +3,8 @@
from odoo import api, fields, models
-class PackageType(models.Model):
- _inherit = 'stock.package.type'
+class StockPackageType(models.Model):
+ _inherit = ['stock.package.type']
shipper_package_code = fields.Char('Carrier Code')
package_carrier_type = fields.Selection([('none', 'No carrier integration')], string='Carrier', default='none')
@@ -30,4 +30,4 @@ def _compute_length_uom_name(self):
package.length_uom_name = ""
else:
package_without_carrier |= package
- super(PackageType, package_without_carrier)._compute_length_uom_name()
+ super(StockPackageType, package_without_carrier)._compute_length_uom_name()
diff --git a/addons/stock_delivery/models/stock_picking.py b/addons/stock_delivery/models/stock_picking.py
index 3735bc544d252..33b5780f7865f 100644
--- a/addons/stock_delivery/models/stock_picking.py
+++ b/addons/stock_delivery/models/stock_picking.py
@@ -8,7 +8,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
def _get_default_weight_uom(self):
return self.env['product.template']._get_weight_uom_name_from_ir_config_parameter()
diff --git a/addons/stock_delivery/models/stock_quant_package.py b/addons/stock_delivery/models/stock_quant_package.py
index eb11569243d07..bc2d21651bb71 100644
--- a/addons/stock_delivery/models/stock_quant_package.py
+++ b/addons/stock_delivery/models/stock_quant_package.py
@@ -4,7 +4,7 @@
class StockQuantPackage(models.Model):
- _inherit = "stock.quant.package"
+ _inherit = ["stock.quant.package"]
@api.depends('quant_ids', 'package_type_id')
def _compute_weight(self):
diff --git a/addons/stock_delivery/wizard/choose_delivery_carrier.py b/addons/stock_delivery/wizard/choose_delivery_carrier.py
index 3128a16dd2a06..addf0b597fc5a 100644
--- a/addons/stock_delivery/wizard/choose_delivery_carrier.py
+++ b/addons/stock_delivery/wizard/choose_delivery_carrier.py
@@ -4,7 +4,7 @@
class ChooseDeliveryCarrier(models.TransientModel):
- _inherit = 'choose.delivery.carrier'
+ _inherit = ['choose.delivery.carrier']
@api.depends('carrier_id')
def _compute_invoicing_message(self):
diff --git a/addons/stock_delivery/wizard/choose_delivery_package.py b/addons/stock_delivery/wizard/choose_delivery_package.py
index e67c98c7f184a..d79d0157f1d2f 100644
--- a/addons/stock_delivery/wizard/choose_delivery_package.py
+++ b/addons/stock_delivery/wizard/choose_delivery_package.py
@@ -4,7 +4,6 @@
class ChooseDeliveryPackage(models.TransientModel):
- _name = 'choose.delivery.package'
_description = 'Delivery Package Selection Wizard'
picking_id = fields.Many2one('stock.picking', 'Picking')
diff --git a/addons/stock_delivery/wizard/stock_return_picking.py b/addons/stock_delivery/wizard/stock_return_picking.py
index 9c238dc53c50e..17b8d3e7116e1 100644
--- a/addons/stock_delivery/wizard/stock_return_picking.py
+++ b/addons/stock_delivery/wizard/stock_return_picking.py
@@ -4,7 +4,7 @@
class StockReturnPicking(models.TransientModel):
- _inherit = 'stock.return.picking'
+ _inherit = ['stock.return.picking']
def _create_return(self):
# Prevent copy of the carrier and carrier price when generating return picking
diff --git a/addons/stock_dropshipping/models/purchase.py b/addons/stock_dropshipping/models/purchase.py
index b18cfb40ff65c..6c3733eaeb9f5 100644
--- a/addons/stock_dropshipping/models/purchase.py
+++ b/addons/stock_dropshipping/models/purchase.py
@@ -5,7 +5,7 @@
class PurchaseOrder(models.Model):
- _inherit = 'purchase.order'
+ _inherit = ['purchase.order']
dropship_picking_count = fields.Integer("Dropship Count", compute='_compute_incoming_picking_count')
diff --git a/addons/stock_dropshipping/models/res_company.py b/addons/stock_dropshipping/models/res_company.py
index 67c8eef80c2c8..cfa02c5483cd1 100644
--- a/addons/stock_dropshipping/models/res_company.py
+++ b/addons/stock_dropshipping/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
# -------------------------------------------------------------------------
# Sequences
diff --git a/addons/stock_dropshipping/models/sale.py b/addons/stock_dropshipping/models/sale.py
index c5a685218cb91..2bb043e69d438 100644
--- a/addons/stock_dropshipping/models/sale.py
+++ b/addons/stock_dropshipping/models/sale.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
dropship_picking_count = fields.Integer("Dropship Count", compute='_compute_picking_ids')
@@ -25,7 +25,7 @@ def action_view_dropship(self):
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
def _compute_is_mto(self):
super(SaleOrderLine, self)._compute_is_mto()
diff --git a/addons/stock_dropshipping/models/stock.py b/addons/stock_dropshipping/models/stock.py
index ef23a9cd4295f..d9b6e1abca563 100644
--- a/addons/stock_dropshipping/models/stock.py
+++ b/addons/stock_dropshipping/models/stock.py
@@ -6,7 +6,7 @@
class StockRule(models.Model):
- _inherit = 'stock.rule'
+ _inherit = ['stock.rule']
@api.model
def _get_procurements_to_merge_groupby(self, procurement):
@@ -23,7 +23,7 @@ def _get_partner_id(self, values, rule):
class ProcurementGroup(models.Model):
- _inherit = "procurement.group"
+ _inherit = ["procurement.group"]
@api.model
def _get_rule_domain(self, location, values):
@@ -32,8 +32,9 @@ def _get_rule_domain(self, location, values):
domain = expression.AND([domain, [('company_id', '=', values['company_id'].id)]])
return domain
+
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
is_dropship = fields.Boolean("Is a Dropship", compute='_compute_is_dropship')
@@ -46,8 +47,9 @@ def _is_to_external_location(self):
self.ensure_one()
return super()._is_to_external_location() or self.is_dropship
+
class StockPickingType(models.Model):
- _inherit = 'stock.picking.type'
+ _inherit = ['stock.picking.type']
code = fields.Selection(
selection_add=[('dropship', 'Dropship')], ondelete={'dropship': lambda recs: recs.write({'code': 'outgoing', 'active': False})})
@@ -80,7 +82,7 @@ def _compute_show_picking_type(self):
class StockLot(models.Model):
- _inherit = 'stock.lot'
+ _inherit = ['stock.lot']
def _compute_last_delivery_partner_id(self):
super()._compute_last_delivery_partner_id()
diff --git a/addons/stock_dropshipping/models/stock_replenish_mixin.py b/addons/stock_dropshipping/models/stock_replenish_mixin.py
index 00bd335487604..c7fde50e9ce79 100644
--- a/addons/stock_dropshipping/models/stock_replenish_mixin.py
+++ b/addons/stock_dropshipping/models/stock_replenish_mixin.py
@@ -4,8 +4,8 @@
from odoo.osv import expression
-class ProductReplenishMixin(models.AbstractModel):
- _inherit = 'stock.replenish.mixin'
+class StockReplenishMixin(models.AbstractModel):
+ _inherit = ['stock.replenish.mixin']
def _get_allowed_route_domain(self):
domains = super()._get_allowed_route_domain()
diff --git a/addons/stock_fleet/models/fleet_vehicle_model.py b/addons/stock_fleet/models/fleet_vehicle_model.py
index b5e2bb40a1b86..54622bd7a32aa 100644
--- a/addons/stock_fleet/models/fleet_vehicle_model.py
+++ b/addons/stock_fleet/models/fleet_vehicle_model.py
@@ -5,7 +5,7 @@
class FleetVehicleModelCategory(models.Model):
- _inherit = 'fleet.vehicle.model.category'
+ _inherit = ['fleet.vehicle.model.category']
weight_capacity = fields.Float(string="Max Weight")
weight_capacity_uom_name = fields.Char(string='Weight unit of measure label', compute='_compute_weight_capacity_uom_name')
diff --git a/addons/stock_fleet/models/stock_location.py b/addons/stock_fleet/models/stock_location.py
index 977e6aea50c04..b5ca032ccbb5a 100644
--- a/addons/stock_fleet/models/stock_location.py
+++ b/addons/stock_fleet/models/stock_location.py
@@ -1,7 +1,7 @@
from odoo import fields, models
-class StockPickingBatch(models.Model):
- _inherit = 'stock.location'
+class StockLocation(models.Model):
+ _inherit = ['stock.location']
is_a_dock = fields.Boolean("Is a Dock Location")
diff --git a/addons/stock_fleet/models/stock_picking.py b/addons/stock_fleet/models/stock_picking.py
index 775296528290c..09c71625dbd81 100644
--- a/addons/stock_fleet/models/stock_picking.py
+++ b/addons/stock_fleet/models/stock_picking.py
@@ -4,7 +4,7 @@
class StockPicking(models.Model):
- _inherit = "stock.picking"
+ _inherit = ["stock.picking"]
zip = fields.Char(related='partner_id.zip', string='Zip', search="_search_zip")
diff --git a/addons/stock_fleet/models/stock_picking_batch.py b/addons/stock_fleet/models/stock_picking_batch.py
index 674af764fb67a..3e59005b91bd2 100644
--- a/addons/stock_fleet/models/stock_picking_batch.py
+++ b/addons/stock_fleet/models/stock_picking_batch.py
@@ -4,7 +4,7 @@
class StockPickingBatch(models.Model):
- _inherit = 'stock.picking.batch'
+ _inherit = ['stock.picking.batch']
vehicle_id = fields.Many2one('fleet.vehicle', string="Vehicle")
vehicle_category_id = fields.Many2one(
diff --git a/addons/stock_landed_costs/models/account_move.py b/addons/stock_landed_costs/models/account_move.py
index ded09d456a1f8..fd19f85c71178 100644
--- a/addons/stock_landed_costs/models/account_move.py
+++ b/addons/stock_landed_costs/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
landed_costs_ids = fields.One2many('stock.landed.cost', 'vendor_bill_id', string='Landed Costs')
landed_costs_visible = fields.Boolean(compute='_compute_landed_costs_visible')
@@ -53,7 +53,7 @@ def _post(self, soft=True):
class AccountMoveLine(models.Model):
- _inherit = 'account.move.line'
+ _inherit = ['account.move.line']
product_type = fields.Selection(related='product_id.type', readonly=True)
is_landed_costs_line = fields.Boolean()
diff --git a/addons/stock_landed_costs/models/product.py b/addons/stock_landed_costs/models/product.py
index 1cb19cdd5791c..6a0c6a183e632 100644
--- a/addons/stock_landed_costs/models/product.py
+++ b/addons/stock_landed_costs/models/product.py
@@ -7,7 +7,7 @@
class ProductTemplate(models.Model):
- _inherit = "product.template"
+ _inherit = ["product.template"]
landed_cost_ok = fields.Boolean('Is a Landed Cost', help='Indicates whether the product is a landed cost: when receiving a vendor bill, you can allocate this cost on preceding receipts.')
split_method_landed_cost = fields.Selection(SPLIT_METHOD, string="Default Split Method",
diff --git a/addons/stock_landed_costs/models/purchase.py b/addons/stock_landed_costs/models/purchase.py
index 369dea0308d4c..b9c49e8e3ba73 100644
--- a/addons/stock_landed_costs/models/purchase.py
+++ b/addons/stock_landed_costs/models/purchase.py
@@ -1,7 +1,8 @@
from odoo import api,models
+
class PurchaseOrderLine(models.Model):
- _inherit = 'purchase.order.line'
+ _inherit = ['purchase.order.line']
def _prepare_account_move_line(self, move=False):
res = super()._prepare_account_move_line(move)
diff --git a/addons/stock_landed_costs/models/res_company.py b/addons/stock_landed_costs/models/res_company.py
index c5e97e2fa6f91..148d4cb9f28ea 100644
--- a/addons/stock_landed_costs/models/res_company.py
+++ b/addons/stock_landed_costs/models/res_company.py
@@ -5,6 +5,6 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
lc_journal_id = fields.Many2one('account.journal')
diff --git a/addons/stock_landed_costs/models/res_config_settings.py b/addons/stock_landed_costs/models/res_config_settings.py
index e5b37c42693c6..7107782eff871 100644
--- a/addons/stock_landed_costs/models/res_config_settings.py
+++ b/addons/stock_landed_costs/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
lc_journal_id = fields.Many2one('account.journal', string='Default Journal', related='company_id.lc_journal_id', readonly=False)
diff --git a/addons/stock_landed_costs/models/stock_landed_cost.py b/addons/stock_landed_costs/models/stock_landed_cost.py
index 05272afd0e8ce..f9dce1ec53804 100644
--- a/addons/stock_landed_costs/models/stock_landed_cost.py
+++ b/addons/stock_landed_costs/models/stock_landed_cost.py
@@ -18,7 +18,6 @@
class StockLandedCost(models.Model):
- _name = 'stock.landed.cost'
_description = 'Stock Landed Cost'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'date desc, id desc'
@@ -338,8 +337,7 @@ def _check_sum(self):
return True
-class StockLandedCostLine(models.Model):
- _name = 'stock.landed.cost.lines'
+class StockLandedCostLines(models.Model):
_description = 'Stock Landed Cost Line'
name = fields.Char('Description')
@@ -369,8 +367,7 @@ def onchange_product_id(self):
self.account_id = accounts_data['stock_input']
-class AdjustmentLines(models.Model):
- _name = 'stock.valuation.adjustment.lines'
+class StockValuationAdjustmentLines(models.Model):
_description = 'Valuation Adjustment Lines'
name = fields.Char(
diff --git a/addons/stock_landed_costs/models/stock_move.py b/addons/stock_landed_costs/models/stock_move.py
index fd2f52ef766bd..d7e726d80651b 100644
--- a/addons/stock_landed_costs/models/stock_move.py
+++ b/addons/stock_landed_costs/models/stock_move.py
@@ -2,7 +2,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
def _get_stock_valuation_layer_ids(self):
self.ensure_one()
diff --git a/addons/stock_landed_costs/models/stock_valuation_layer.py b/addons/stock_landed_costs/models/stock_valuation_layer.py
index 86215e49b98bf..02650fa676648 100644
--- a/addons/stock_landed_costs/models/stock_valuation_layer.py
+++ b/addons/stock_landed_costs/models/stock_valuation_layer.py
@@ -5,6 +5,6 @@
class StockValuationLayer(models.Model):
- _inherit = 'stock.valuation.layer'
+ _inherit = ['stock.valuation.layer']
stock_landed_cost_id = fields.Many2one('stock.landed.cost', 'Landed Cost')
diff --git a/addons/stock_picking_batch/models/stock_move.py b/addons/stock_picking_batch/models/stock_move.py
index 4f508e6502403..e58e8cfa08ce8 100644
--- a/addons/stock_picking_batch/models/stock_move.py
+++ b/addons/stock_picking_batch/models/stock_move.py
@@ -6,7 +6,7 @@
class StockMove(models.Model):
- _inherit = "stock.move"
+ _inherit = ["stock.move"]
def _search_picking_for_assignation_domain(self):
domain = super()._search_picking_for_assignation_domain()
diff --git a/addons/stock_picking_batch/models/stock_move_line.py b/addons/stock_picking_batch/models/stock_move_line.py
index db3625308cf2a..98328b87e7c6e 100644
--- a/addons/stock_picking_batch/models/stock_move_line.py
+++ b/addons/stock_picking_batch/models/stock_move_line.py
@@ -10,7 +10,7 @@
class StockMoveLine(models.Model):
- _inherit = "stock.move.line"
+ _inherit = ["stock.move.line"]
batch_id = fields.Many2one(related='picking_id.batch_id', store=True)
diff --git a/addons/stock_picking_batch/models/stock_picking.py b/addons/stock_picking_batch/models/stock_picking.py
index cd0f93d31a753..abaf54b5d56dc 100644
--- a/addons/stock_picking_batch/models/stock_picking.py
+++ b/addons/stock_picking_batch/models/stock_picking.py
@@ -7,7 +7,7 @@
class StockPickingType(models.Model):
- _inherit = "stock.picking.type"
+ _inherit = ["stock.picking.type"]
count_picking_batch = fields.Integer(compute='_compute_picking_count')
count_picking_wave = fields.Integer(compute='_compute_picking_count')
@@ -84,7 +84,7 @@ def _validate_auto_batch_group_by(self):
class StockPicking(models.Model):
- _inherit = "stock.picking"
+ _inherit = ["stock.picking"]
batch_id = fields.Many2one(
'stock.picking.batch', string='Batch Transfer',
diff --git a/addons/stock_picking_batch/models/stock_picking_batch.py b/addons/stock_picking_batch/models/stock_picking_batch.py
index 23ddcf31a9cbe..ebb837641cfff 100644
--- a/addons/stock_picking_batch/models/stock_picking_batch.py
+++ b/addons/stock_picking_batch/models/stock_picking_batch.py
@@ -8,9 +8,9 @@
from odoo.osv.expression import AND
from odoo.tools import float_is_zero, format_list
+
class StockPickingBatch(models.Model):
_inherit = ['mail.thread', 'mail.activity.mixin']
- _name = "stock.picking.batch"
_description = "Batch Transfer"
_order = "name desc"
diff --git a/addons/stock_picking_batch/models/stock_warehouse.py b/addons/stock_picking_batch/models/stock_warehouse.py
index 45ca5d06a7aef..e01d92d229a29 100644
--- a/addons/stock_picking_batch/models/stock_warehouse.py
+++ b/addons/stock_picking_batch/models/stock_warehouse.py
@@ -5,7 +5,7 @@
class StockWarehouse(models.Model):
- _inherit = 'stock.warehouse'
+ _inherit = ['stock.warehouse']
def _get_picking_type_create_values(self, max_sequence):
data, next_sequence = super()._get_picking_type_create_values(max_sequence)
diff --git a/addons/stock_picking_batch/wizard/stock_add_to_wave.py b/addons/stock_picking_batch/wizard/stock_add_to_wave.py
index 45097b66a5e3d..d50ebfd9d8b6e 100644
--- a/addons/stock_picking_batch/wizard/stock_add_to_wave.py
+++ b/addons/stock_picking_batch/wizard/stock_add_to_wave.py
@@ -5,8 +5,7 @@
from odoo.exceptions import UserError
-class StockPickingToWave(models.TransientModel):
- _name = 'stock.add.to.wave'
+class StockAddToWave(models.TransientModel):
_description = 'Wave Transfer Lines'
@api.model
diff --git a/addons/stock_picking_batch/wizard/stock_package_destination.py b/addons/stock_picking_batch/wizard/stock_package_destination.py
index ccc7ad75085d9..a43ab10d83237 100644
--- a/addons/stock_picking_batch/wizard/stock_package_destination.py
+++ b/addons/stock_picking_batch/wizard/stock_package_destination.py
@@ -4,8 +4,8 @@
from odoo import api, models
-class ChooseDestinationLocation(models.TransientModel):
- _inherit = "stock.package.destination"
+class StockPackageDestination(models.TransientModel):
+ _inherit = ["stock.package.destination"]
def _compute_move_line_ids(self):
destination_without_batch = self.env['stock.package.destination']
@@ -14,7 +14,7 @@ def _compute_move_line_ids(self):
destination_without_batch |= destination
continue
destination.move_line_ids = destination.picking_id.batch_id.move_line_ids.filtered(lambda l: l.quantity > 0 and not l.result_package_id)
- super(ChooseDestinationLocation, destination_without_batch)._compute_move_line_ids()
+ super(StockPackageDestination, destination_without_batch)._compute_move_line_ids()
def action_done(self):
if self.picking_id.batch_id:
diff --git a/addons/stock_picking_batch/wizard/stock_picking_to_batch.py b/addons/stock_picking_batch/wizard/stock_picking_to_batch.py
index c356e9d6cfeeb..e792cd3cf1a18 100644
--- a/addons/stock_picking_batch/wizard/stock_picking_to_batch.py
+++ b/addons/stock_picking_batch/wizard/stock_picking_to_batch.py
@@ -6,7 +6,6 @@
class StockPickingToBatch(models.TransientModel):
- _name = 'stock.picking.to.batch'
_description = 'Batch Transfer Lines'
batch_id = fields.Many2one('stock.picking.batch', string='Batch Transfer', domain="[('is_wave', '=', False), ('state', 'in', ('draft', 'in_progress'))]")
diff --git a/addons/stock_sms/models/res_company.py b/addons/stock_sms/models/res_company.py
index 71aa0062ee2f9..93ce38c534a2a 100644
--- a/addons/stock_sms/models/res_company.py
+++ b/addons/stock_sms/models/res_company.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class Company(models.Model):
- _inherit = "res.company"
+class ResCompany(models.Model):
+ _inherit = ["res.company"]
def _default_confirmation_sms_picking_template(self):
try:
diff --git a/addons/stock_sms/models/res_config_settings.py b/addons/stock_sms/models/res_config_settings.py
index 12dab58a420f8..1597b5c78739e 100644
--- a/addons/stock_sms/models/res_config_settings.py
+++ b/addons/stock_sms/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
stock_move_sms_validation = fields.Boolean(
related='company_id.stock_move_sms_validation',
diff --git a/addons/stock_sms/models/stock_picking.py b/addons/stock_sms/models/stock_picking.py
index 42480a10494f5..22f75e7f757a2 100644
--- a/addons/stock_sms/models/stock_picking.py
+++ b/addons/stock_sms/models/stock_picking.py
@@ -6,8 +6,8 @@
import threading
-class Picking(models.Model):
- _inherit = 'stock.picking'
+class StockPicking(models.Model):
+ _inherit = ['stock.picking']
def _pre_action_done_hook(self):
res = super()._pre_action_done_hook()
@@ -46,7 +46,7 @@ def _action_generate_warn_sms_wizard(self):
}
def _send_confirmation_email(self):
- super(Picking, self)._send_confirmation_email()
+ super()._send_confirmation_email()
if not self.env.context.get('skip_sms') and not getattr(threading.current_thread(), 'testing', False) and not self.env.registry.in_test_mode():
pickings = self.filtered(lambda p: p.company_id.stock_move_sms_validation and p.picking_type_id.code == 'outgoing' and (p.partner_id.mobile or p.partner_id.phone))
for picking in pickings:
diff --git a/addons/stock_sms/wizard/confirm_stock_sms.py b/addons/stock_sms/wizard/confirm_stock_sms.py
index b364605aa5a2d..d00e0fca664c0 100644
--- a/addons/stock_sms/wizard/confirm_stock_sms.py
+++ b/addons/stock_sms/wizard/confirm_stock_sms.py
@@ -5,7 +5,6 @@
class ConfirmStockSms(models.TransientModel):
- _name = 'confirm.stock.sms'
_description = 'Confirm Stock SMS'
pick_ids = fields.Many2many('stock.picking', 'stock_picking_sms_rel')
diff --git a/addons/survey/models/badge.py b/addons/survey/models/badge.py
index 7ed12731711ef..36d05aa846d36 100644
--- a/addons/survey/models/badge.py
+++ b/addons/survey/models/badge.py
@@ -5,7 +5,7 @@
class GamificationBadge(models.Model):
- _inherit = 'gamification.badge'
+ _inherit = ['gamification.badge']
survey_ids = fields.One2many('survey.survey', 'certification_badge_id', 'Survey Ids')
survey_id = fields.Many2one('survey.survey', 'Survey', compute='_compute_survey_id', store=True)
diff --git a/addons/survey/models/challenge.py b/addons/survey/models/challenge.py
index 23b54c16ce700..84412b98cbbaf 100644
--- a/addons/survey/models/challenge.py
+++ b/addons/survey/models/challenge.py
@@ -4,8 +4,8 @@
from odoo import models, fields
-class Challenge(models.Model):
- _inherit = 'gamification.challenge'
+class GamificationChallenge(models.Model):
+ _inherit = ['gamification.challenge']
challenge_category = fields.Selection(selection_add=[
('certification', 'Certifications')
diff --git a/addons/survey/models/res_partner.py b/addons/survey/models/res_partner.py
index 91e91348076b3..dd1d2fc09ec01 100644
--- a/addons/survey/models/res_partner.py
+++ b/addons/survey/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
certifications_count = fields.Integer('Certifications Count', compute='_compute_certifications_count')
certifications_company_count = fields.Integer('Company Certifications Count', compute='_compute_certifications_company_count')
diff --git a/addons/survey/models/survey_question.py b/addons/survey/models/survey_question.py
index 7da8725096252..2d22ab923499d 100644
--- a/addons/survey/models/survey_question.py
+++ b/addons/survey/models/survey_question.py
@@ -42,7 +42,6 @@ class SurveyQuestion(models.Model):
That makes the use and display of these information at view and controller levels easier to understand.
"""
- _name = 'survey.question'
_description = 'Survey Question'
_rec_name = 'title'
_order = 'sequence,id'
@@ -781,6 +780,7 @@ def _get_correct_answers(self):
return correct_answers
+
class SurveyQuestionAnswer(models.Model):
""" A preconfigured answer for a question. This model stores values used
for
@@ -790,7 +790,6 @@ class SurveyQuestionAnswer(models.Model):
* matrix: row and column values;
"""
- _name = 'survey.question.answer'
_rec_name = 'value'
_rec_names_search = ['question_id.title', 'value']
_order = 'question_id, sequence, id'
diff --git a/addons/survey/models/survey_survey.py b/addons/survey/models/survey_survey.py
index f2bbf756fac44..2f74260ba9d58 100644
--- a/addons/survey/models/survey_survey.py
+++ b/addons/survey/models/survey_survey.py
@@ -13,10 +13,9 @@
from odoo.tools import is_html_empty
-class Survey(models.Model):
+class SurveySurvey(models.Model):
""" Settings for a multi-page/multi-question survey. Each survey can have one or more attached pages
and each page can display one or more questions. """
- _name = 'survey.survey'
_description = 'Survey'
_order = 'create_date DESC'
_rec_name = 'title'
@@ -441,7 +440,7 @@ def _check_survey_responsible_access(self):
@api.model_create_multi
def create(self, vals_list):
- surveys = super(Survey, self).create(vals_list)
+ surveys = super().create(vals_list)
for survey_sudo in surveys.filtered(lambda survey: survey.certification_give_badge).sudo():
survey_sudo._create_certification_badge_trigger()
return surveys
@@ -454,7 +453,7 @@ def write(self, vals):
or speed_limit is not None and s.session_speed_rating_time_limit != speed_limit
))
- result = super(Survey, self).write(vals)
+ result = super().write(vals)
if 'certification_give_badge' in vals:
return self.sudo()._handle_certification_badges(vals)
@@ -498,7 +497,7 @@ def copy_data(self, default=None):
return [dict(vals, title=self.env._("%s (copy)", survey.title)) for survey, vals in zip(self, vals_list)]
def toggle_active(self):
- super(Survey, self).toggle_active()
+ super().toggle_active()
activated = self.filtered(lambda survey: survey.active)
activated.certification_badge_id.action_unarchive()
(self - activated).certification_badge_id.action_archive()
diff --git a/addons/survey/models/survey_survey_template.py b/addons/survey/models/survey_survey_template.py
index 7b5b006f74679..d044f4376dd58 100644
--- a/addons/survey/models/survey_survey_template.py
+++ b/addons/survey/models/survey_survey_template.py
@@ -6,7 +6,7 @@
from odoo import api, models, _
-class SurveyTemplate(models.Model):
+class SurveySurvey(models.Model):
"""This model defines additional actions on the 'survey.survey' model that
can be used to load a survey sample. The model defines a sample for each
survey type:
@@ -16,7 +16,7 @@ class SurveyTemplate(models.Model):
(4) custom: An empty survey
"""
- _inherit = 'survey.survey'
+ _inherit = ['survey.survey']
@api.model
def action_load_sample_survey(self):
diff --git a/addons/survey/models/survey_user_input.py b/addons/survey/models/survey_user_input.py
index fb565237d2ced..b98b883ec22a2 100644
--- a/addons/survey/models/survey_user_input.py
+++ b/addons/survey/models/survey_user_input.py
@@ -14,9 +14,8 @@
_logger = logging.getLogger(__name__)
-class SurveyUserInput(models.Model):
+class SurveyUser_Input(models.Model):
""" Metadata for a set of one user's answers to a particular survey """
- _name = "survey.user_input"
_description = "Survey User Input"
_rec_name = "survey_id"
_order = "create_date desc"
@@ -169,7 +168,7 @@ def create(self, vals_list):
suvey_id = vals.get('survey_id', self.env.context.get('default_survey_id'))
survey = self.env['survey.survey'].browse(suvey_id)
vals['predefined_question_ids'] = [(6, 0, survey._prepare_user_input_predefined_questions().ids)]
- return super(SurveyUserInput, self).create(vals_list)
+ return super().create(vals_list)
# ------------------------------------------------------------
# ACTIONS / BUSINESS
@@ -701,8 +700,7 @@ def _notify_new_participation_subscribers(self):
user_input.message_post(author_id=author_id, body=body, subtype_xmlid='survey.mt_survey_user_input_completed')
-class SurveyUserInputLine(models.Model):
- _name = 'survey.user_input.line'
+class SurveyUser_InputLine(models.Model):
_description = 'Survey User Input Line'
_rec_name = 'user_input_id'
_order = 'question_sequence, id'
@@ -791,7 +789,7 @@ def create(self, vals_list):
if not vals.get('answer_score'):
score_vals = self._get_answer_score_values(vals)
vals.update(score_vals)
- return super(SurveyUserInputLine, self).create(vals_list)
+ return super().create(vals_list)
def write(self, vals):
res = True
@@ -806,7 +804,7 @@ def write(self, vals):
if not vals_copy.get('answer_score'):
score_vals = self._get_answer_score_values(getter_params, compute_speed_score=False)
vals_copy.update(score_vals)
- res = super(SurveyUserInputLine, line).write(vals_copy) and res
+ res = super(SurveyUser_InputLine, line).write(vals_copy) and res
return res
def _get_answer_matching_domain(self):
diff --git a/addons/survey/wizard/survey_invite.py b/addons/survey/wizard/survey_invite.py
index 50b25bac9d9bb..7b3ba718bb47c 100644
--- a/addons/survey/wizard/survey_invite.py
+++ b/addons/survey/wizard/survey_invite.py
@@ -15,8 +15,7 @@
class SurveyInvite(models.TransientModel):
- _name = 'survey.invite'
- _inherit = 'mail.composer.mixin'
+ _inherit = ['mail.composer.mixin']
_description = 'Survey Invitation Wizard'
@api.model
diff --git a/addons/test_base_automation/models/test_base_automation.py b/addons/test_base_automation/models/test_base_automation.py
index 95a8edb8e2188..5e43089040339 100644
--- a/addons/test_base_automation/models/test_base_automation.py
+++ b/addons/test_base_automation/models/test_base_automation.py
@@ -5,8 +5,7 @@
from odoo import fields, models, api
-class LeadTest(models.Model):
- _name = "base.automation.lead.test"
+class BaseAutomationLeadTest(models.Model):
_description = "Automated Rule Test"
name = fields.Char(string='Subject', required=True)
@@ -30,12 +29,12 @@ class LeadTest(models.Model):
@api.depends('state')
def _compute_stage_id(self):
- Stage = self.env['test_base_automation.stage']
+ Test_Base_AutomationStage = self.env['test_base_automation.stage']
for task in self:
if not task.stage_id and task.state == 'draft':
task.stage_id = (
- Stage.search([('name', 'ilike', 'new')], limit=1)
- or Stage.create({'name': 'New'})
+ Test_Base_AutomationStage.search([('name', 'ilike', 'new')], limit=1)
+ or Test_Base_AutomationStage.create({'name': 'New'})
)
@api.depends('partner_id.employee', 'priority')
@@ -56,14 +55,12 @@ def write(self, vals):
return result
-class LeadThreadTest(models.Model):
- _name = "base.automation.lead.thread.test"
+class BaseAutomationLeadThreadTest(models.Model):
_description = "Automated Rule Test With Thread"
_inherit = ['base.automation.lead.test', 'mail.thread']
-class LineTest(models.Model):
- _name = "base.automation.line.test"
+class BaseAutomationLineTest(models.Model):
_description = "Automated Rule Line Test"
name = fields.Char()
@@ -71,24 +68,22 @@ class LineTest(models.Model):
user_id = fields.Many2one('res.users')
-class ModelWithAccess(models.Model):
- _name = "base.automation.link.test"
+class BaseAutomationLinkTest(models.Model):
_description = "Automated Rule Link Test"
name = fields.Char()
linked_id = fields.Many2one('base.automation.linked.test', ondelete='cascade')
-class ModelWithoutAccess(models.Model):
- _name = "base.automation.linked.test"
+class BaseAutomationLinkedTest(models.Model):
_description = "Automated Rule Linked Test"
name = fields.Char()
another_field = fields.Char()
-class Project(models.Model):
- _name = _description = 'test_base_automation.project'
+class Test_Base_AutomationProject(models.Model):
+ _description = 'test_base_automation.project'
name = fields.Char()
task_ids = fields.One2many('test_base_automation.task', 'project_id')
@@ -98,8 +93,8 @@ class Project(models.Model):
user_ids = fields.Many2many('res.users')
-class Task(models.Model):
- _name = _description = 'test_base_automation.task'
+class Test_Base_AutomationTask(models.Model):
+ _description = 'test_base_automation.task'
name = fields.Char()
parent_id = fields.Many2one('test_base_automation.task')
@@ -115,31 +110,29 @@ def _compute_project_id(self):
task.project_id = task.parent_id.project_id
-class Stage(models.Model):
- _name = _description = 'test_base_automation.stage'
+class Test_Base_AutomationStage(models.Model):
+ _description = 'test_base_automation.stage'
name = fields.Char()
-class Tag(models.Model):
- _name = _description = 'test_base_automation.tag'
+class Test_Base_AutomationTag(models.Model):
+ _description = 'test_base_automation.tag'
name = fields.Char()
-class LeadThread(models.Model):
+
+class BaseAutomationLeadThreadTest(models.Model):
_inherit = ["base.automation.lead.test", "mail.thread"]
- _name = "base.automation.lead.thread.test"
_description = "Threaded Lead Test"
-class ModelWithCharRecName(models.Model):
- _name = "base.automation.model.with.recname.char"
+class BaseAutomationModelWithRecnameChar(models.Model):
_description = "Model with Char as _rec_name"
_rec_name = "description"
description = fields.Char()
user_id = fields.Many2one('res.users', string='Responsible')
-class ModelWithRecName(models.Model):
- _name = "base.automation.model.with.recname.m2o"
+class BaseAutomationModelWithRecnameM2o(models.Model):
_description = "Model with Many2one as _rec_name and name_create"
_rec_name = "user_id"
user_id = fields.Many2one("base.automation.model.with.recname.char", string='Responsible')
diff --git a/addons/test_html_field_history/models/model_html_field_history_test.py b/addons/test_html_field_history/models/model_html_field_history_test.py
index 266347fab4f83..726bb7c9ce619 100644
--- a/addons/test_html_field_history/models/model_html_field_history_test.py
+++ b/addons/test_html_field_history/models/model_html_field_history_test.py
@@ -4,15 +4,14 @@
from odoo import fields, models
-class ModelHtmlFieldHistoryTest(models.Model):
+class HtmlFieldHistoryTest(models.Model):
_description = "Test html_field_history Model"
- _name = "html.field.history.test"
_inherit = ["html.field.history.mixin"]
def _get_versioned_fields(self):
return [
- ModelHtmlFieldHistoryTest.versioned_field_1.name,
- ModelHtmlFieldHistoryTest.versioned_field_2.name,
+ HtmlFieldHistoryTest.versioned_field_1.name,
+ HtmlFieldHistoryTest.versioned_field_2.name,
]
versioned_field_1 = fields.Html(string="vf1")
diff --git a/addons/test_import_export/models/models_export.py b/addons/test_import_export/models/models_export.py
index d6dfb69688850..0d6f1ba881e11 100644
--- a/addons/test_import_export/models/models_export.py
+++ b/addons/test_import_export/models/models_export.py
@@ -2,7 +2,6 @@
class ExportAggregator(models.Model):
- _name = 'export.aggregator'
_description = 'Export Aggregator'
int_sum = fields.Integer(aggregator='sum')
@@ -19,8 +18,7 @@ class ExportAggregator(models.Model):
active = fields.Boolean(default=True)
-class ExportAggregatorO2M(models.Model):
- _name = 'export.aggregator.one2many'
+class ExportAggregatorOne2many(models.Model):
_description = 'Export Aggregator One2Many'
parent_id = fields.Many2one('export.aggregator')
diff --git a/addons/test_import_export/models/models_export_impex.py b/addons/test_import_export/models/models_export_impex.py
index b7543bc076e67..143bc05567e84 100644
--- a/addons/test_import_export/models/models_export_impex.py
+++ b/addons/test_import_export/models/models_export_impex.py
@@ -57,8 +57,7 @@ def _search_display_name(self, operator, value):
return FALSE_DOMAIN
-class One2ManyChild(models.Model):
- _name = 'export.one2many.child'
+class ExportOne2manyChild(models.Model):
_description = 'Export One to Many Child'
# FIXME: orm.py:1161, fix to display_name on m2o field
_rec_name = 'value'
@@ -79,8 +78,7 @@ def _search_display_name(self, operator, value):
return FALSE_DOMAIN
-class One2ManyMultiple(models.Model):
- _name = 'export.one2many.multiple'
+class ExportOne2manyMultiple(models.Model):
_description = 'Export One To Many Multiple'
_rec_name = 'parent_id'
@@ -90,8 +88,7 @@ class One2ManyMultiple(models.Model):
child2 = fields.One2many('export.one2many.child.2', 'parent_id')
-class One2ManyChildMultiple(models.Model):
- _name = 'export.one2many.multiple.child'
+class ExportOne2manyMultipleChild(models.Model):
# FIXME: orm.py:1161, fix to display_name on m2o field
_rec_name = 'value'
_description = 'Export One To Many Multiple Child'
@@ -105,20 +102,19 @@ def _compute_display_name(self):
record.display_name = f"{self._name}:{record.value}"
-class One2ManyChild1(models.Model):
+class ExportOne2manyChild1(models.Model):
_name = 'export.one2many.child.1'
- _inherit = 'export.one2many.multiple.child'
+ _inherit = ['export.one2many.multiple.child']
_description = 'Export One to Many Child 1'
-class One2ManyChild2(models.Model):
+class ExportOne2manyChild2(models.Model):
_name = 'export.one2many.child.2'
- _inherit = 'export.one2many.multiple.child'
+ _inherit = ['export.one2many.multiple.child']
_description = 'Export One To Many Child 2'
-class Many2ManyChild(models.Model):
- _name = 'export.many2many.other'
+class ExportMany2manyOther(models.Model):
_description = 'Export Many to Many Other'
# FIXME: orm.py:1161, fix to display_name on m2o field
_rec_name = 'value'
@@ -137,16 +133,14 @@ def _search_display_name(self, operator, value):
return FALSE_DOMAIN
-class SelectionWithDefault(models.Model):
- _name = 'export.selection.withdefault'
+class ExportSelectionWithdefault(models.Model):
_description = 'Export Selection With Default'
const = fields.Integer(default=4)
value = fields.Selection([('1', "Foo"), ('2', "Bar")], default='2')
-class RecO2M(models.Model):
- _name = 'export.one2many.recursive'
+class ExportOne2manyRecursive(models.Model):
_description = 'Export One To Many Recursive'
_rec_name = 'value'
@@ -154,8 +148,7 @@ class RecO2M(models.Model):
child = fields.One2many('export.one2many.multiple', 'parent_id')
-class OnlyOne(models.Model):
- _name = 'export.unique'
+class ExportUnique(models.Model):
_description = 'Export Unique'
value = fields.Integer()
@@ -168,40 +161,40 @@ class OnlyOne(models.Model):
]
-class InheritsParent(models.Model):
- _name = _description = 'export.inherits.parent'
+class ExportInheritsParent(models.Model):
+ _description = 'export.inherits.parent'
value_parent = fields.Integer()
-class InheritsChild(models.Model):
- _name = _description = 'export.inherits.child'
+class ExportInheritsChild(models.Model):
+ _description = 'export.inherits.child'
_inherits = {'export.inherits.parent': 'parent_id'}
parent_id = fields.Many2one('export.inherits.parent', required=True, ondelete='cascade')
value = fields.Integer()
-class Many2String(models.Model):
- _name = _description = 'export.m2o.str'
+class ExportM2oStr(models.Model):
+ _description = 'export.m2o.str'
child_id = fields.Many2one('export.m2o.str.child')
-class ChidToString(models.Model):
- _name = _description = 'export.m2o.str.child'
+class ExportM2oStrChild(models.Model):
+ _description = 'export.m2o.str.child'
name = fields.Char()
-class WithRequiredField(models.Model):
- _name = _description = 'export.with.required.field'
+class ExportWithRequiredField(models.Model):
+ _description = 'export.with.required.field'
name = fields.Char()
value = fields.Integer(required=True)
-class Many2OneRequiredSubfield(models.Model):
- _name = _description = 'export.many2one.required.subfield'
+class ExportMany2oneRequiredSubfield(models.Model):
+ _description = 'export.many2one.required.subfield'
name = fields.Many2one('export.with.required.field')
diff --git a/addons/test_import_export/models/models_import.py b/addons/test_import_export/models/models_import.py
index 4b83344cd1db1..f77f929b4ac30 100644
--- a/addons/test_import_export/models/models_import.py
+++ b/addons/test_import_export/models/models_import.py
@@ -1,88 +1,76 @@
from odoo import fields, models
-class Char(models.Model):
- _name = 'import.char'
+class ImportChar(models.Model):
_description = 'Tests: Base Import Model, Character'
value = fields.Char()
-class CharRequired(models.Model):
- _name = 'import.char.required'
+class ImportCharRequired(models.Model):
_description = 'Tests: Base Import Model, Character required'
value = fields.Char(required=True)
-class CharReadonly(models.Model):
- _name = 'import.char.readonly'
+class ImportCharReadonly(models.Model):
_description = 'Tests: Base Import Model, Character readonly'
value = fields.Char(readonly=True)
-class CharNoreadonly(models.Model):
- _name = 'import.char.noreadonly'
+class ImportCharNoreadonly(models.Model):
_description = 'Tests: Base Import Model, Character No readonly'
value = fields.Char(readonly=True)
-class CharStillreadonly(models.Model):
- _name = 'import.char.stillreadonly'
+class ImportCharStillreadonly(models.Model):
_description = 'Tests: Base Import Model, Character still readonly'
value = fields.Char(readonly=True)
# TODO: complex field (m2m, o2m, m2o)
-class M2o(models.Model):
- _name = 'import.m2o'
+class ImportM2o(models.Model):
_description = 'Tests: Base Import Model, Many to One'
value = fields.Many2one('import.m2o.related')
-class M2oRelated(models.Model):
- _name = 'import.m2o.related'
+class ImportM2oRelated(models.Model):
_description = 'Tests: Base Import Model, Many to One related'
value = fields.Integer(default=42)
-class M2oRequired(models.Model):
- _name = 'import.m2o.required'
+class ImportM2oRequired(models.Model):
_description = 'Tests: Base Import Model, Many to One required'
value = fields.Many2one('import.m2o.required.related', required=True)
-class M2oRequiredRelated(models.Model):
- _name = 'import.m2o.required.related'
+class ImportM2oRequiredRelated(models.Model):
_description = 'Tests: Base Import Model, Many to One required related'
value = fields.Integer(default=42)
-class O2m(models.Model):
- _name = 'import.o2m'
+class ImportO2m(models.Model):
_description = 'Tests: Base Import Model, One to Many'
name = fields.Char()
value = fields.One2many('import.o2m.child', 'parent_id')
-class O2mChild(models.Model):
- _name = 'import.o2m.child'
+class ImportO2mChild(models.Model):
_description = 'Tests: Base Import Model, One to Many child'
parent_id = fields.Many2one('import.o2m')
value = fields.Integer()
-class Preview(models.Model):
- _name = 'import.preview'
+class ImportPreview(models.Model):
_description = 'Tests: Base Import Model Preview'
name = fields.Char('Name')
@@ -90,8 +78,7 @@ class Preview(models.Model):
othervalue = fields.Integer(string='Other Variable')
-class Float(models.Model):
- _name = 'import.float'
+class ImportFloat(models.Model):
_description = 'Tests: Base Import Model Float'
value = fields.Float()
@@ -99,8 +86,7 @@ class Float(models.Model):
currency_id = fields.Many2one('res.currency')
-class Complex(models.Model):
- _name = 'import.complex'
+class ImportComplex(models.Model):
_description = 'Tests: Base Import Model Complex'
f = fields.Float()
@@ -112,8 +98,8 @@ class Complex(models.Model):
parent_id = fields.Many2one('import.complex')
-class PropertyDefinition(models.Model):
- _name = _description = 'import.properties.definition'
+class ImportPropertiesDefinition(models.Model):
+ _description = 'import.properties.definition'
_rec_name = 'id'
properties_definition = fields.PropertiesDefinition()
@@ -121,8 +107,8 @@ class PropertyDefinition(models.Model):
main_properties_record_id = fields.Many2one('import.properties', 'record_definition_id')
-class Property(models.Model):
- _name = _description = 'import.properties'
+class ImportProperties(models.Model):
+ _description = 'import.properties'
properties = fields.Properties(definition='record_definition_id.properties_definition')
record_definition_id = fields.Many2one('import.properties.definition')
diff --git a/addons/test_mail/models/test_discuss_models.py b/addons/test_mail/models/test_discuss_models.py
index fcd4214cb4cbe..1dcb4ba2f7fbb 100644
--- a/addons/test_mail/models/test_discuss_models.py
+++ b/addons/test_mail/models/test_discuss_models.py
@@ -6,7 +6,6 @@
class MailTestProperties(models.Model):
_description = 'Mail Test Properties'
- _name = 'mail.test.properties'
_inherit = ['mail.thread']
name = fields.Char('Name')
diff --git a/addons/test_mail/models/test_mail_corner_case_models.py b/addons/test_mail/models/test_mail_corner_case_models.py
index 157f7a9aed916..0f5313c167302 100644
--- a/addons/test_mail/models/test_mail_corner_case_models.py
+++ b/addons/test_mail/models/test_mail_corner_case_models.py
@@ -5,7 +5,6 @@
class MailPerformanceThread(models.Model):
- _name = 'mail.performance.thread'
_description = 'Performance: mail.thread'
_inherit = ['mail.thread']
@@ -22,7 +21,6 @@ def _value_pc(self):
class MailPerformanceTracking(models.Model):
- _name = 'mail.performance.tracking'
_description = 'Performance: multi tracking'
_inherit = ['mail.thread']
@@ -36,7 +34,6 @@ class MailTestFieldType(models.Model):
""" Test default values, notably type, messing through models during gateway
processing (i.e. lead.type versus attachment.type). """
_description = 'Test Field Type'
- _name = 'mail.test.field.type'
_inherit = ['mail.thread']
name = fields.Char()
@@ -61,7 +58,6 @@ class MailTestLang(models.Model):
""" A simple chatter model with lang-based capabilities, allowing to
test translations. """
_description = 'Lang Chatter Model'
- _name = 'mail.test.lang'
_inherit = ['mail.thread']
name = fields.Char()
@@ -92,16 +88,15 @@ def _notify_get_recipients_groups(self, message, model_description, msg_vals=Non
# TRACKING MODELS
# ------------------------------------------------------------
-class MailTestTrackAllM2M(models.Model):
- _name = 'mail.test.track.all.m2m'
+
+class MailTestTrackAllM2m(models.Model):
_description = 'Sub-model: pseudo tags for tracking'
_inherit = ['mail.thread']
name = fields.Char('Name')
-class MailTestTrackAllO2M(models.Model):
- _name = 'mail.test.track.all.o2m'
+class MailTestTrackAllO2m(models.Model):
_description = 'Sub-model: pseudo tags for tracking'
_inherit = ['mail.thread']
@@ -110,7 +105,6 @@ class MailTestTrackAllO2M(models.Model):
class MailTestTrackAll(models.Model):
- _name = 'mail.test.track.all'
_description = 'Test tracking on all field types'
_inherit = ['mail.thread']
@@ -142,7 +136,6 @@ class MailTestTrackAll(models.Model):
class MailTestTrackCompute(models.Model):
- _name = 'mail.test.track.compute'
_description = "Test tracking with computed fields"
_inherit = ['mail.thread']
@@ -153,7 +146,6 @@ class MailTestTrackCompute(models.Model):
class MailTestTrackGroups(models.Model):
- _name = 'mail.test.track.groups'
_description = "Test tracking with groups"
_inherit = ['mail.thread']
@@ -163,7 +155,6 @@ class MailTestTrackGroups(models.Model):
class MailTestTrackMonetary(models.Model):
- _name = 'mail.test.track.monetary'
_description = 'Test tracking monetary field'
_inherit = ['mail.thread']
@@ -175,7 +166,6 @@ class MailTestTrackMonetary(models.Model):
class MailTestTrackSelection(models.Model):
""" Test tracking for selection fields """
_description = 'Test Selection Tracking'
- _name = 'mail.test.track.selection'
_inherit = ['mail.thread']
name = fields.Char()
@@ -186,12 +176,12 @@ class MailTestTrackSelection(models.Model):
# OTHER
# ------------------------------------------------------------
+
class MailTestMultiCompany(models.Model):
""" This model can be used in multi company tests, with attachments support
for checking record update in MC """
- _name = 'mail.test.multi.company'
_description = "Test Multi Company Mail"
- _inherit = 'mail.thread.main.attachment'
+ _inherit = ['mail.thread.main.attachment']
name = fields.Char()
company_id = fields.Many2one('res.company')
@@ -201,14 +191,12 @@ class MailTestMultiCompanyRead(models.Model):
""" Just mail.test.simple, but multi company and supporting posting
even if the user has no write access. """
_description = 'Simple Chatter Model '
- _name = 'mail.test.multi.company.read'
_inherit = ['mail.test.multi.company']
_mail_post_access = 'read'
class MailTestMultiCompanyWithActivity(models.Model):
""" This model can be used in multi company tests with activity"""
- _name = "mail.test.multi.company.with.activity"
_description = "Test Multi Company Mail With Activity"
_inherit = ["mail.thread", "mail.activity.mixin"]
@@ -216,10 +204,9 @@ class MailTestMultiCompanyWithActivity(models.Model):
company_id = fields.Many2one("res.company")
-class MailTestNotMailThread(models.Model):
+class MailTestNothread(models.Model):
""" Models not inheriting from mail.thread but using some cross models
capabilities of mail. """
- _name = 'mail.test.nothread'
_description = "NoThread Model"
name = fields.Char()
diff --git a/addons/test_mail/models/test_mail_models.py b/addons/test_mail/models/test_mail_models.py
index 601eb957f9fe4..7652c98759b46 100644
--- a/addons/test_mail/models/test_mail_models.py
+++ b/addons/test_mail/models/test_mail_models.py
@@ -9,7 +9,6 @@ class MailTestSimple(models.Model):
""" A very simple model only inheriting from mail.thread when only
communication history is necessary. """
_description = 'Simple Chatter Model'
- _name = 'mail.test.simple'
_inherit = ['mail.thread']
name = fields.Char()
@@ -31,9 +30,8 @@ def _notify_by_email_get_headers(self, headers=None):
return headers
-class MailTestSimpleWithMainAttachment(models.Model):
+class MailTestSimpleMainAttachment(models.Model):
_description = 'Simple Chatter Model With Main Attachment Management'
- _name = 'mail.test.simple.main.attachment'
_inherit = ['mail.test.simple', 'mail.thread.main.attachment']
@@ -42,7 +40,6 @@ class MailTestSimpleUnfollow(models.Model):
communication history is necessary with unfollow link enabled in
notification emails even for non-internal user. """
_description = 'Simple Chatter Model'
- _name = 'mail.test.simple.unfollow'
_inherit = ['mail.thread']
_partner_unfollow_enabled = True
@@ -55,7 +52,6 @@ class MailTestAliasOptional(models.Model):
""" A chatter model inheriting from the alias mixin using optional alias_id
field, hence no inherits. """
_description = 'Chatter Model using Optional Alias Mixin'
- _name = 'mail.test.alias.optional'
_inherit = ['mail.alias.mixin.optional']
name = fields.Char()
@@ -76,7 +72,6 @@ class MailTestGateway(models.Model):
""" A very simple model only inheriting from mail.thread to test pure mass
mailing features and base performances. """
_description = 'Simple Chatter Model for Mail Gateway'
- _name = 'mail.test.gateway'
_inherit = ['mail.thread.blacklist']
_primary_email = 'email_from'
@@ -99,7 +94,6 @@ class MailTestGatewayCompany(models.Model):
""" A very simple model only inheriting from mail.thread to test pure mass
mailing features and base performances, with a company field. """
_description = 'Simple Chatter Model for Mail Gateway with company'
- _name = 'mail.test.gateway.company'
_inherit = ['mail.test.gateway']
company_id = fields.Many2one('res.company', 'Company')
@@ -110,7 +104,6 @@ class MailTestGatewayMainAttachment(models.Model):
mailing features and base performances, with a company field and main
attachment management. """
_description = 'Simple Chatter Model for Mail Gateway with company'
- _name = 'mail.test.gateway.main.attachment'
_inherit = ['mail.test.gateway', 'mail.thread.main.attachment']
company_id = fields.Many2one('res.company', 'Company')
@@ -120,7 +113,6 @@ class MailTestGatewayGroups(models.Model):
""" A model looking like discussion channels / groups (flat thread and
alias). Used notably for advanced gatewxay tests. """
_description = 'Channel/Group-like Chatter Model for Mail Gateway'
- _name = 'mail.test.gateway.groups'
_inherit = ['mail.thread.blacklist', 'mail.alias.mixin']
_mail_flat_thread = False
_primary_email = 'email_from'
@@ -152,11 +144,10 @@ def _message_get_default_recipients(self):
)
-class MailTestStandard(models.Model):
+class MailTestTrack(models.Model):
""" This model can be used in tests when automatic subscription and simple
tracking is necessary. Most features are present in a simple way. """
_description = 'Standard Chatter Model'
- _name = 'mail.test.track'
_inherit = ['mail.thread']
name = fields.Char()
@@ -178,11 +169,11 @@ def _track_get_default_log_message(self, changes):
return f'There was a change on {self.name} for fields "{",".join(changes)}"'
return super()._track_get_default_log_message(changes)
+
class MailTestActivity(models.Model):
""" This model can be used to test activities in addition to simple chatter
features. """
_description = 'Activity Model'
- _name = 'mail.test.activity'
_inherit = ['mail.thread', 'mail.activity.mixin']
name = fields.Char()
@@ -206,7 +197,6 @@ class MailTestTicket(models.Model):
""" This model can be used in tests when complex chatter features are
required like modeling tasks or tickets. """
_description = 'Ticket-like model'
- _name = 'mail.test.ticket'
_inherit = ['mail.thread']
_primary_email = 'email_from'
@@ -327,12 +317,12 @@ def _message_get_suggested_recipients(self):
)
return recipients
-class MailTestTicketEL(models.Model):
+
+class MailTestTicketEl(models.Model):
""" Just mail.test.ticket, but exclusion-list enabled. Kept as different
model to avoid messing with existing tests, notably performance, and ease
backward comparison. """
_description = 'Ticket-like model with exclusion list'
- _name = 'mail.test.ticket.el'
_inherit = [
'mail.test.ticket',
'mail.thread.blacklist',
@@ -349,12 +339,11 @@ def _compute_email_from(self):
ticket.email_from = ticket.customer_id.email_formatted
-class MailTestTicketMC(models.Model):
+class MailTestTicketMc(models.Model):
""" Just mail.test.ticket, but multi company. Kept as different model to
avoid messing with existing tests, notably performance, and ease backward
comparison. """
_description = 'Ticket-like model'
- _name = 'mail.test.ticket.mc'
_inherit = ['mail.test.ticket']
_primary_email = 'email_from'
@@ -366,7 +355,6 @@ class MailTestContainer(models.Model):
""" This model can be used in tests when container records like projects
or teams are required. """
_description = 'Project-like model with alias'
- _name = 'mail.test.container'
_mail_post_access = 'read'
_inherit = ['mail.thread', 'mail.alias.mixin']
@@ -407,12 +395,12 @@ def _alias_get_creation_values(self):
values['alias_parent_thread_id'] = self.id
return values
-class MailTestContainerMC(models.Model):
+
+class MailTestContainerMc(models.Model):
""" Just mail.test.container, but multi company. Kept as different model to
avoid messing with existing tests, notably performance, and ease backward
comparison. """
_description = 'Project-like model with alias (MC)'
- _name = 'mail.test.container.mc'
_mail_post_access = 'read'
_inherit = ['mail.test.container']
@@ -425,7 +413,6 @@ class MailTestComposerMixin(models.Model):
runs on other records and check notably dynamic template support and
translations. """
_description = 'Invite-like Wizard'
- _name = 'mail.test.composer.mixin'
_inherit = ['mail.composer.mixin']
name = fields.Char('Name')
@@ -440,7 +427,6 @@ def _compute_render_model(self):
class MailTestComposerSource(models.Model):
""" A simple model on which invites are sent. """
_description = 'Invite-like Source'
- _name = 'mail.test.composer.source'
_inherit = ['mail.thread.blacklist']
_primary_email = 'email_from'
@@ -461,7 +447,6 @@ def _mail_get_partner_fields(self, introspect_fields=False):
class MailTestMailTrackingDuration(models.Model):
_description = 'Fake model to test the mixin mail.tracking.duration.mixin'
- _name = 'mail.test.mail.tracking.duration'
_track_duration_field = 'customer_id'
_inherit = ['mail.thread', 'mail.tracking.duration.mixin']
diff --git a/addons/test_mail/models/test_mail_thread_models.py b/addons/test_mail/models/test_mail_thread_models.py
index 29bbe7252f1a0..30ede0ae2c2f2 100644
--- a/addons/test_mail/models/test_mail_thread_models.py
+++ b/addons/test_mail/models/test_mail_thread_models.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class MailTestCC(models.Model):
- _name = 'mail.test.cc'
+class MailTestCc(models.Model):
_description = "Test Email CC Thread"
_inherit = ['mail.thread.cc']
diff --git a/addons/test_mail_full/models/test_mail_models_mail.py b/addons/test_mail_full/models/test_mail_models_mail.py
index 17e482da234a6..f21e062d905dc 100644
--- a/addons/test_mail_full/models/test_mail_models_mail.py
+++ b/addons/test_mail_full/models/test_mail_models_mail.py
@@ -8,7 +8,6 @@ class MailTestPortal(models.Model):
""" A model inheriting from mail.thread and portal.mixin with some fields
used for portal sharing, like a partner, ..."""
_description = 'Chatter Model for Portal'
- _name = 'mail.test.portal'
_inherit = [
'portal.mixin',
'mail.thread',
@@ -27,7 +26,6 @@ def _compute_access_url(self):
class MailTestPortalNoPartner(models.Model):
""" A model inheriting from portal, but without any partner field """
_description = 'Chatter Model for Portal (no partner field)'
- _name = 'mail.test.portal.no.partner'
_inherit = [
'mail.thread',
'portal.mixin',
@@ -45,7 +43,6 @@ class MailTestRating(models.Model):
""" A model inheriting from rating.mixin (which inherits from mail.thread) with some fields used for SMS
gateway, like a partner, a specific mobile phone, ... """
_description = 'Rating Model (ticket-like)'
- _name = 'mail.test.rating'
_inherit = [
'rating.mixin',
'mail.activity.mixin',
@@ -108,8 +105,7 @@ class MailTestRatingThread(models.Model):
- user_id: value returned by the base _rating_get_operator method
"""
_description = 'Model for testing rating without the rating mixin'
- _name = 'mail.test.rating.thread'
- _inherit = 'mail.thread'
+ _inherit = ['mail.thread']
_order = 'name asc, id asc'
name = fields.Char('Name')
@@ -127,7 +123,6 @@ class MailTestRatingThreadRead(models.Model):
"""Same as MailTestRatingThread but post accessible on read by portal users."""
_description = "Read-post rating model"
- _name = "mail.test.rating.thread.read"
- _inherit = "mail.test.rating.thread"
+ _inherit = ["mail.test.rating.thread"]
_order = "name asc, id asc"
_mail_post_access = "read"
diff --git a/addons/test_mail_sms/models/test_mail_sms_models.py b/addons/test_mail_sms/models/test_mail_sms_models.py
index 114738750c726..3bc4dbb70c530 100644
--- a/addons/test_mail_sms/models/test_mail_sms_models.py
+++ b/addons/test_mail_sms/models/test_mail_sms_models.py
@@ -4,11 +4,10 @@
from odoo import api, fields, models
-class MailTestSMS(models.Model):
+class MailTestSms(models.Model):
""" A model inheriting from mail.thread with some fields used for SMS
gateway, like a partner, a specific mobile phone, ... """
_description = 'Chatter Model for SMS Gateway'
- _name = 'mail.test.sms'
_inherit = ['mail.thread']
_mailing_enabled = True
_order = 'name asc, id asc'
@@ -27,11 +26,10 @@ def _mail_get_partner_fields(self, introspect_fields=False):
return ['customer_id']
-class MailTestSMSBL(models.Model):
+class MailTestSmsBl(models.Model):
""" A model inheriting from mail.thread.phone allowing to test auto formatting
of phone numbers, blacklist, ... """
_description = 'SMS Mailing Blacklist Enabled'
- _name = 'mail.test.sms.bl'
_inherit = ['mail.thread.phone']
_mailing_enabled = True
_order = 'name asc, id asc'
@@ -60,11 +58,10 @@ def _mail_get_partner_fields(self, introspect_fields=False):
return ['customer_id']
-class MailTestSMSBLActivity(models.Model):
+class MailTestSmsBlActivity(models.Model):
""" A model inheriting from mail.thread.phone allowing to test auto formatting
of phone numbers, blacklist, ... as well as activities management. """
_description = 'SMS Mailing Blacklist Enabled with activities'
- _name = 'mail.test.sms.bl.activity'
_inherit = [
'mail.test.sms.bl',
'mail.activity.mixin',
@@ -73,11 +70,10 @@ class MailTestSMSBLActivity(models.Model):
_order = 'name asc, id asc'
-class MailTestSMSOptout(models.Model):
+class MailTestSmsBlOptout(models.Model):
""" Model using blacklist mechanism and a hijacked opt-out mechanism for
mass mailing features. """
_description = 'SMS Mailing Blacklist / Optout Enabled'
- _name = 'mail.test.sms.bl.optout'
_inherit = ['mail.thread.phone']
_mailing_enabled = True
_order = 'name asc, id asc'
@@ -104,11 +100,10 @@ def _mailing_get_opt_out_list_sms(self, mailing):
]).ids
-class MailTestSMSPartner(models.Model):
+class MailTestSmsPartner(models.Model):
""" A model like sale order having only a customer, not specific phone
or mobile fields. """
_description = 'Chatter Model for SMS Gateway (Partner only)'
- _name = 'mail.test.sms.partner'
_inherit = ['mail.thread']
_mailing_enabled = True
@@ -127,7 +122,7 @@ def _mailing_get_opt_out_list_sms(self, mailing):
]).ids
-class MailTestSMSPartner2Many(models.Model):
+class MailTestSmsPartner2many(models.Model):
""" A model like sale order having only a customer, not specific phone
or mobile fields. """
_description = 'Chatter Model for SMS Gateway (M2M Partners only)'
diff --git a/addons/test_mass_mailing/models/ir_qweb.py b/addons/test_mass_mailing/models/ir_qweb.py
index b70445bd36777..85eec15c9396a 100644
--- a/addons/test_mass_mailing/models/ir_qweb.py
+++ b/addons/test_mass_mailing/models/ir_qweb.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
from odoo import models
-class IrQWeb(models.AbstractModel):
- _inherit = "ir.qweb"
+
+class IrQweb(models.AbstractModel):
+ _inherit = ["ir.qweb"]
def _get_bundles_to_pregenarate(self):
- js_assets, css_assets = super(IrQWeb, self)._get_bundles_to_pregenarate()
+ js_assets, css_assets = super()._get_bundles_to_pregenarate()
assets = {'mass_mailing.iframe_css_assets_edit'}
return (js_assets | assets, css_assets | assets)
diff --git a/addons/test_mass_mailing/models/mailing_models.py b/addons/test_mass_mailing/models/mailing_models.py
index eca2ecb18f5e9..c28121d4babf7 100644
--- a/addons/test_mass_mailing/models/mailing_models.py
+++ b/addons/test_mass_mailing/models/mailing_models.py
@@ -4,11 +4,10 @@
from odoo import api, fields, models
-class MailingCustomer(models.Model):
+class MailingTestCustomer(models.Model):
""" A model inheriting from mail.thread with a partner field, to test
mass mailing flows involving checking partner email. """
_description = 'Mailing with partner'
- _name = 'mailing.test.customer'
_inherit = ['mail.thread']
name = fields.Char()
@@ -34,11 +33,10 @@ def _message_get_default_recipients(self):
return default_recipients
-class MailingSimple(models.Model):
+class MailingTestSimple(models.Model):
""" Model only inheriting from mail.thread to test base mailing features and
performances. """
_description = 'Simple Mailing'
- _name = 'mailing.test.simple'
_inherit = ['mail.thread']
_primary_email = 'email_from'
@@ -46,20 +44,18 @@ class MailingSimple(models.Model):
email_from = fields.Char()
-class MailingUTM(models.Model):
+class MailingTestUtm(models.Model):
""" Model inheriting from mail.thread and utm.mixin for checking utm of mailing
is caught and set on reply """
_description = 'Mailing: UTM enabled to test UTM sync with mailing'
- _name = 'mailing.test.utm'
_inherit = ['mail.thread', 'utm.mixin']
name = fields.Char()
-class MailingBLacklist(models.Model):
+class MailingTestBlacklist(models.Model):
""" Model using blacklist mechanism for mass mailing features. """
_description = 'Mailing Blacklist Enabled'
- _name = 'mailing.test.blacklist'
_inherit = ['mail.thread.blacklist']
_order = 'name ASC, id DESC'
_primary_email = 'email_from'
@@ -83,11 +79,10 @@ def _message_get_default_recipients(self):
return default_recipients
-class MailingOptOut(models.Model):
+class MailingTestOptout(models.Model):
""" Model using blacklist mechanism and a hijacked opt-out mechanism for
mass mailing features. """
_description = 'Mailing Blacklist / Optout Enabled'
- _name = 'mailing.test.optout'
_inherit = ['mail.thread.blacklist']
_primary_email = 'email_from'
@@ -121,7 +116,6 @@ def _message_get_default_recipients(self):
class MailingTestPartner(models.Model):
_description = 'Mailing Model with partner_id'
- _name = 'mailing.test.partner'
_inherit = ['mail.thread.blacklist']
_primary_email = 'email_from'
@@ -133,7 +127,6 @@ class MailingTestPartner(models.Model):
class MailingPerformance(models.Model):
""" A very simple model only inheriting from mail.thread to test pure mass
mailing performances. """
- _name = 'mailing.performance'
_description = 'Mailing: base performance'
_inherit = ['mail.thread']
@@ -141,9 +134,8 @@ class MailingPerformance(models.Model):
email_from = fields.Char()
-class MailingPerformanceBL(models.Model):
+class MailingPerformanceBlacklist(models.Model):
""" Model using blacklist mechanism for mass mailing performance. """
- _name = 'mailing.performance.blacklist'
_description = 'Mailing: blacklist performance'
_inherit = ['mail.thread.blacklist']
_primary_email = 'email_from' # blacklist field to check
diff --git a/addons/test_mass_mailing/models/mailing_models_cornercase.py b/addons/test_mass_mailing/models/mailing_models_cornercase.py
index e39469e555bd6..677ba2527bd08 100644
--- a/addons/test_mass_mailing/models/mailing_models_cornercase.py
+++ b/addons/test_mass_mailing/models/mailing_models_cornercase.py
@@ -7,7 +7,6 @@
class MailingTestPartnerUnstored(models.Model):
""" Check mailing with unstored fields """
_description = 'Mailing Model without stored partner_id'
- _name = 'mailing.test.partner.unstored'
_inherit = ['mail.thread.blacklist']
_primary_email = 'email_from'
diff --git a/addons/test_mass_mailing/models/mailing_models_utm.py b/addons/test_mass_mailing/models/mailing_models_utm.py
index 3d605ee3d2ae7..7b40b2f5767bc 100644
--- a/addons/test_mass_mailing/models/mailing_models_utm.py
+++ b/addons/test_mass_mailing/models/mailing_models_utm.py
@@ -6,7 +6,6 @@
class UtmTestSourceMixin(models.Model):
""" Test utm.source.mixin """
_description = "UTM Source Mixin Test Model"
- _name = "utm.test.source.mixin"
_order = "id DESC"
_rec_name = "title"
_inherit = [
@@ -21,7 +20,6 @@ class UtmTestSourceMixinOther(models.Model):
""" Test utm.source.mixin, similar to the other one, allowing also to test
cross model uniqueness check """
_description = "UTM Source Mixin Test Model (another)"
- _name = "utm.test.source.mixin.other"
_order = "id DESC"
_rec_name = "title"
_inherit = [
diff --git a/addons/test_resource/models/test_resource.py b/addons/test_resource/models/test_resource.py
index d1379510ec649..04128463ae75b 100644
--- a/addons/test_resource/models/test_resource.py
+++ b/addons/test_resource/models/test_resource.py
@@ -6,7 +6,6 @@
class ResourceTest(models.Model):
_description = 'Test Resource Model'
- _name = 'resource.test'
_inherit = ['resource.mixin']
name = fields.Char()
diff --git a/addons/test_spreadsheet/models/spreadsheet_mixin_test.py b/addons/test_spreadsheet/models/spreadsheet_mixin_test.py
index fc39e6a867715..db61792304305 100644
--- a/addons/test_spreadsheet/models/spreadsheet_mixin_test.py
+++ b/addons/test_spreadsheet/models/spreadsheet_mixin_test.py
@@ -1,9 +1,8 @@
from odoo import models
-class SpreadsheetDummy(models.Model):
+class SpreadsheetTest(models.Model):
""" A very simple model only inheriting from spreadsheet.mixin to test
its model functioning."""
_description = 'Dummy Spreadsheet'
- _name = 'spreadsheet.test'
_inherit = ['spreadsheet.mixin']
diff --git a/addons/test_website/models/model.py b/addons/test_website/models/model.py
index 33faba7183e62..545619c39b9fe 100644
--- a/addons/test_website/models/model.py
+++ b/addons/test_website/models/model.py
@@ -6,13 +6,12 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
name_translated = fields.Char(translate=True)
class TestModel(models.Model):
- _name = 'test.model'
_inherit = [
'website.seo.metadata',
'website.published.mixin',
@@ -47,8 +46,7 @@ def _search_get_detail(self, website, order, options):
}
-class TestSubModel(models.Model):
- _name = 'test.submodel'
+class TestSubmodel(models.Model):
_description = 'Website Submodel Test'
name = fields.Char(required=True)
@@ -57,14 +55,12 @@ class TestSubModel(models.Model):
class TestTag(models.Model):
- _name = 'test.tag'
_description = 'Website Tag Test'
name = fields.Char(required=True)
class TestModelMultiWebsite(models.Model):
- _name = 'test.model.multi.website'
_inherit = [
'website.published.multi.mixin',
]
@@ -79,7 +75,6 @@ class TestModelMultiWebsite(models.Model):
class TestModelExposed(models.Model):
- _name = "test.model.exposed"
_inherit = [
'website.seo.metadata',
'website.published.mixin',
diff --git a/addons/test_website/models/res_config_settings.py b/addons/test_website/models/res_config_settings.py
index 595bdf0f1cec0..b1f33c136e94a 100644
--- a/addons/test_website/models/res_config_settings.py
+++ b/addons/test_website/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
def action_website_test_setting(self):
return self.env['website'].get_client_action('/')
diff --git a/addons/test_website/models/website.py b/addons/test_website/models/website.py
index a3e9f4cd6d8fd..3832c78a5fd18 100644
--- a/addons/test_website/models/website.py
+++ b/addons/test_website/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def _search_get_details(self, search_type, order, options):
result = super()._search_get_details(search_type, order, options)
diff --git a/addons/transifex/models/models.py b/addons/transifex/models/models.py
index f110a314d6154..219f699454527 100644
--- a/addons/transifex/models/models.py
+++ b/addons/transifex/models/models.py
@@ -3,8 +3,11 @@
from odoo import models
+
class BaseModel(models.AbstractModel):
- _inherit = 'base'
+ _name = "base"
+
+ _inherit = ['base']
def get_field_translations(self, field_name, langs=None):
""" get model/model_term translations for records with transifex url
diff --git a/addons/transifex/models/transifex_code_translation.py b/addons/transifex/models/transifex_code_translation.py
index 37042f9d2ae6e..5b289d421667e 100644
--- a/addons/transifex/models/transifex_code_translation.py
+++ b/addons/transifex/models/transifex_code_translation.py
@@ -8,7 +8,6 @@
class TransifexCodeTranslation(models.Model):
- _name = "transifex.code.translation"
_description = "Code Translation"
_log_access = False
diff --git a/addons/transifex/models/transifex_translation.py b/addons/transifex/models/transifex_translation.py
index 59b4402445de7..86150d2c0c5ce 100644
--- a/addons/transifex/models/transifex_translation.py
+++ b/addons/transifex/models/transifex_translation.py
@@ -11,7 +11,6 @@
class TransifexTranslation(models.AbstractModel):
- _name = "transifex.translation"
_description = "Transifex Translation"
@tools.ormcache()
diff --git a/addons/uom/models/uom_uom.py b/addons/uom/models/uom_uom.py
index 4205fd84b58f7..38319cc931401 100644
--- a/addons/uom/models/uom_uom.py
+++ b/addons/uom/models/uom_uom.py
@@ -8,8 +8,7 @@
from odoo.exceptions import UserError, ValidationError
-class UoMCategory(models.Model):
- _name = 'uom.category'
+class UomCategory(models.Model):
_description = 'Product UoM Categories'
name = fields.Char('Unit of Measure Category', required=True, translate=True)
@@ -41,8 +40,7 @@ def _onchange_uom_ids(self):
self.reference_uom_id = new_reference._origin.id
-class UoM(models.Model):
- _name = 'uom.uom'
+class UomUom(models.Model):
_description = 'Product Unit of Measure'
_order = "factor DESC, id"
@@ -164,7 +162,7 @@ def create(self, vals_list):
if 'factor_inv' in values:
factor_inv = values.pop('factor_inv')
values['factor'] = factor_inv and (1.0 / factor_inv) or 0.0
- res = super(UoM, self).create(vals_list)
+ res = super().create(vals_list)
res._check_category_reference_uniqueness()
return res
@@ -173,7 +171,7 @@ def write(self, values):
factor_inv = values.pop('factor_inv')
values['factor'] = factor_inv and (1.0 / factor_inv) or 0.0
- res = super(UoM, self).write(values)
+ res = super().write(values)
if ('uom_type' not in values or values['uom_type'] != 'reference') and\
not self.env.context.get('allow_to_change_reference'):
self._check_category_reference_uniqueness()
@@ -211,9 +209,9 @@ def name_create(self, name):
def _compute_quantity(self, qty, to_unit, round=True, rounding_method='UP', raise_if_failure=True):
""" Convert the given quantity from the current UoM `self` into a given one
:param qty: the quantity to convert
- :param to_unit: the destination UoM record (uom.uom)
+ :param to_unit: the destination UomUom record (uom.uom)
:param raise_if_failure: only if the conversion is not possible
- - if true, raise an exception if the conversion is not possible (different UoM category),
+ - if true, raise an exception if the conversion is not possible (different UomUom category),
- otherwise, return the initial quantity
"""
if not self or not qty:
diff --git a/addons/utm/models/ir_http.py b/addons/utm/models/ir_http.py
index 8a6e6e4f25c7e..6ce498c3bee9b 100644
--- a/addons/utm/models/ir_http.py
+++ b/addons/utm/models/ir_http.py
@@ -5,7 +5,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def get_utm_domain_cookies(cls):
diff --git a/addons/utm/models/utm_campaign.py b/addons/utm/models/utm_campaign.py
index 8756fd6fc7341..b8a09843875ae 100644
--- a/addons/utm/models/utm_campaign.py
+++ b/addons/utm/models/utm_campaign.py
@@ -5,7 +5,6 @@
class UtmCampaign(models.Model):
- _name = 'utm.campaign'
_description = 'UTM Campaign'
_rec_name = 'title'
diff --git a/addons/utm/models/utm_medium.py b/addons/utm/models/utm_medium.py
index e87011a7b91fc..ab3e2f1f93750 100644
--- a/addons/utm/models/utm_medium.py
+++ b/addons/utm/models/utm_medium.py
@@ -7,7 +7,6 @@
class UtmMedium(models.Model):
- _name = 'utm.medium'
_description = 'UTM Medium'
_order = 'name'
diff --git a/addons/utm/models/utm_mixin.py b/addons/utm/models/utm_mixin.py
index 00b32e6c1b47f..a6be36fda6db2 100644
--- a/addons/utm/models/utm_mixin.py
+++ b/addons/utm/models/utm_mixin.py
@@ -12,7 +12,6 @@
class UtmMixin(models.AbstractModel):
""" Mixin class for objects which can be tracked by marketing. """
- _name = 'utm.mixin'
_description = 'UTM Mixin'
campaign_id = fields.Many2one('utm.campaign', 'Campaign', index='btree_not_null',
diff --git a/addons/utm/models/utm_source.py b/addons/utm/models/utm_source.py
index 4411083609dd8..655529daeeddd 100644
--- a/addons/utm/models/utm_source.py
+++ b/addons/utm/models/utm_source.py
@@ -6,7 +6,6 @@
class UtmSource(models.Model):
- _name = 'utm.source'
_description = 'UTM Source'
name = fields.Char(string='Source Name', required=True)
@@ -44,7 +43,6 @@ class UtmSourceMixin(models.AbstractModel):
"""Mixin responsible of generating the name of the source based on the content
(field defined by _rec_name) of the record (mailing, social post,...).
"""
- _name = 'utm.source.mixin'
_description = 'UTM Source Mixin'
name = fields.Char('Name', related='source_id.name', readonly=False)
diff --git a/addons/utm/models/utm_stage.py b/addons/utm/models/utm_stage.py
index 100018c7c714b..83d2f810142e8 100644
--- a/addons/utm/models/utm_stage.py
+++ b/addons/utm/models/utm_stage.py
@@ -8,7 +8,6 @@
class UtmStage(models.Model):
"""Stage for utm campaigns."""
- _name = 'utm.stage'
_description = 'Campaign Stage'
_order = 'sequence'
diff --git a/addons/utm/models/utm_tag.py b/addons/utm/models/utm_tag.py
index ba0516872d6e7..9cb70f13927ea 100644
--- a/addons/utm/models/utm_tag.py
+++ b/addons/utm/models/utm_tag.py
@@ -9,7 +9,6 @@
class UtmTag(models.Model):
"""Model of categories of utm campaigns, i.e. marketing, newsletter, ..."""
- _name = 'utm.tag'
_description = 'UTM Tag'
_order = 'name'
diff --git a/addons/web/models/base_document_layout.py b/addons/web/models/base_document_layout.py
index d910654d2ac27..f9cf548bc2b79 100644
--- a/addons/web/models/base_document_layout.py
+++ b/addons/web/models/base_document_layout.py
@@ -27,7 +27,6 @@ class BaseDocumentLayout(models.TransientModel):
Customise the company document layout and display a live preview
"""
- _name = 'base.document.layout'
_description = 'Company Document Layout'
@api.model
diff --git a/addons/web/models/ir_http.py b/addons/web/models/ir_http.py
index 672718ae3a2d7..e0b482c4685f5 100644
--- a/addons/web/models/ir_http.py
+++ b/addons/web/models/ir_http.py
@@ -27,8 +27,8 @@
ALLOWED_DEBUG_MODES = ['', '1', 'assets', 'tests', 'disable-t-cache']
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
bots = ["bot", "crawl", "slurp", "spider", "curl", "wget", "facebookexternalhit", "whatsapp", "trendsmapresolver", "pinterest", "instagram"]
diff --git a/addons/web/models/ir_model.py b/addons/web/models/ir_model.py
index 001044886af18..b9690480f69e2 100644
--- a/addons/web/models/ir_model.py
+++ b/addons/web/models/ir_model.py
@@ -5,7 +5,7 @@
class IrModel(models.Model):
- _inherit = "ir.model"
+ _inherit = ["ir.model"]
@api.model
def display_name_for(self, models):
diff --git a/addons/web/models/ir_qweb_fields.py b/addons/web/models/ir_qweb_fields.py
index 0dc6a2c739da3..59e2da3559590 100644
--- a/addons/web/models/ir_qweb_fields.py
+++ b/addons/web/models/ir_qweb_fields.py
@@ -10,16 +10,15 @@
from odoo.tools import html_escape as escape
-class Image(models.AbstractModel):
+class IrQwebFieldImage(models.AbstractModel):
"""
Widget options:
``class``
set as attribute on the generated
tag
"""
- _name = 'ir.qweb.field.image'
_description = 'Qweb Field Image'
- _inherit = 'ir.qweb.field.image'
+ _inherit = ['ir.qweb.field.image']
def _get_src_urls(self, record, field_name, options):
"""Considering the rendering options, returns the src and data-zoom-image urls.
@@ -113,9 +112,10 @@ def record_to_html(self, record, field_name, options):
return Markup(''.join(img))
-class ImageUrlConverter(models.AbstractModel):
+
+class IrQwebFieldImage_Url(models.AbstractModel):
_description = 'Qweb Field Image'
- _inherit = 'ir.qweb.field.image_url'
+ _inherit = ['ir.qweb.field.image_url']
def _get_src_urls(self, record, field_name, options):
image_url = record[options.get('preview_image', field_name)]
diff --git a/addons/web/models/ir_ui_menu.py b/addons/web/models/ir_ui_menu.py
index 79777aec0a2ee..69c31e9c87f2e 100644
--- a/addons/web/models/ir_ui_menu.py
+++ b/addons/web/models/ir_ui_menu.py
@@ -7,7 +7,7 @@
class IrUiMenu(models.Model):
- _inherit = "ir.ui.menu"
+ _inherit = ["ir.ui.menu"]
def load_web_menus(self, debug):
""" Loads all menu items (all applications and their sub-menus) and
diff --git a/addons/web/models/ir_ui_view.py b/addons/web/models/ir_ui_view.py
index 985451f6c8c04..09b32cb4626de 100644
--- a/addons/web/models/ir_ui_view.py
+++ b/addons/web/models/ir_ui_view.py
@@ -3,8 +3,8 @@
from odoo import models
-class View(models.Model):
- _inherit = 'ir.ui.view'
+class IrUiView(models.Model):
+ _inherit = ['ir.ui.view']
def get_view_info(self):
_view_info = self._get_view_info()
diff --git a/addons/web/models/models.py b/addons/web/models/models.py
index a52146872df9d..c058c81e41258 100644
--- a/addons/web/models/models.py
+++ b/addons/web/models/models.py
@@ -37,7 +37,7 @@ def __missing__(self, key):
class Base(models.AbstractModel):
- _inherit = 'base'
+ _inherit = ['base']
@api.model
@api.readonly
@@ -1049,9 +1049,8 @@ def web_override_translations(self, values):
self.update_field_translations(field_name, translations)
-
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
@api.model_create_multi
def create(self, vals_list):
diff --git a/addons/web/models/res_config_settings.py b/addons/web/models/res_config_settings.py
index e8e0ee36cbdad..762afc350a389 100644
--- a/addons/web/models/res_config_settings.py
+++ b/addons/web/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
web_app_name = fields.Char('Web App Name', config_parameter='web.web_app_name')
diff --git a/addons/web/models/res_partner.py b/addons/web/models/res_partner.py
index 8a1985cbb6d0c..5459aeb036769 100644
--- a/addons/web/models/res_partner.py
+++ b/addons/web/models/res_partner.py
@@ -16,7 +16,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
def _build_vcard(self):
""" Build the partner's vCard.
diff --git a/addons/web/models/res_users.py b/addons/web/models/res_users.py
index eb59735a1518e..4e0e1b331a990 100644
--- a/addons/web/models/res_users.py
+++ b/addons/web/models/res_users.py
@@ -5,7 +5,7 @@
class ResUsers(models.Model):
- _inherit = "res.users"
+ _inherit = ["res.users"]
@api.model
def name_search(self, name='', args=None, operator='ilike', limit=100):
diff --git a/addons/web_editor/models/assets.py b/addons/web_editor/models/assets.py
index fd418b94b37c9..969d504cf962b 100644
--- a/addons/web_editor/models/assets.py
+++ b/addons/web_editor/models/assets.py
@@ -11,8 +11,7 @@
_match_asset_file_url_regex = re.compile(r"^(/_custom/([^/]+))?/(\w+)/([/\w]+\.\w+)$")
-class Assets(models.AbstractModel):
- _name = 'web_editor.assets'
+class Web_EditorAssets(models.AbstractModel):
_description = 'Assets Utils'
@api.model
diff --git a/addons/web_editor/models/html_field_history_mixin.py b/addons/web_editor/models/html_field_history_mixin.py
index c01e3b5272d8d..b714c9ce49e16 100644
--- a/addons/web_editor/models/html_field_history_mixin.py
+++ b/addons/web_editor/models/html_field_history_mixin.py
@@ -7,8 +7,7 @@
from .diff_utils import apply_patch, generate_comparison, generate_patch
-class HtmlFieldHistory(models.AbstractModel):
- _name = "html.field.history.mixin"
+class HtmlFieldHistoryMixin(models.AbstractModel):
_description = "Field html History"
_html_field_history_size_limit = 300
diff --git a/addons/web_editor/models/ir_http.py b/addons/web_editor/models/ir_http.py
index c6f17e36df9bd..3355e75742379 100644
--- a/addons/web_editor/models/ir_http.py
+++ b/addons/web_editor/models/ir_http.py
@@ -8,7 +8,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _get_web_editor_context(cls):
diff --git a/addons/web_editor/models/ir_qweb.py b/addons/web_editor/models/ir_qweb.py
index 5ecc24fcc34a3..1b6e9942a05ff 100644
--- a/addons/web_editor/models/ir_qweb.py
+++ b/addons/web_editor/models/ir_qweb.py
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
from odoo import models
-class IrQWeb(models.AbstractModel):
- _inherit = "ir.qweb"
+
+class IrQweb(models.AbstractModel):
+ _inherit = ["ir.qweb"]
def _get_bundles_to_pregenarate(self):
- js_assets, css_assets = super(IrQWeb, self)._get_bundles_to_pregenarate()
+ js_assets, css_assets = super()._get_bundles_to_pregenarate()
assets = {
'web_editor.assets_snippets_menu',
'web_editor.backend_assets_wysiwyg',
diff --git a/addons/web_editor/models/ir_qweb_fields.py b/addons/web_editor/models/ir_qweb_fields.py
index 68c886261645d..963e74fd399f9 100644
--- a/addons/web_editor/models/ir_qweb_fields.py
+++ b/addons/web_editor/models/ir_qweb_fields.py
@@ -21,7 +21,7 @@
import requests
from lxml import etree, html
from markupsafe import Markup, escape_silent
-from PIL import Image as I
+from PIL import IrQwebFieldImage as I
from werkzeug import urls
from odoo import _, api, models, fields
@@ -34,10 +34,10 @@
logger = logging.getLogger(__name__)
-class IrQWeb(models.AbstractModel):
+class IrQweb(models.AbstractModel):
""" IrQWeb object for rendering editor stuff
"""
- _inherit = 'ir.qweb'
+ _inherit = ['ir.qweb']
def _compile_node(self, el, compile_context, indent):
snippet_key = compile_context.get('snippet-key')
@@ -159,14 +159,13 @@ def _get_template_cache_keys(self):
#------------------------------------------------------
-class Field(models.AbstractModel):
- _name = 'ir.qweb.field'
+class IrQwebField(models.AbstractModel):
_description = 'Qweb Field'
- _inherit = 'ir.qweb.field'
+ _inherit = ['ir.qweb.field']
@api.model
def attributes(self, record, field_name, options, values):
- attrs = super(Field, self).attributes(record, field_name, options, values)
+ attrs = super().attributes(record, field_name, options, values)
field = record._fields[field_name]
placeholder = options.get('placeholder') or getattr(field, 'placeholder', None)
@@ -193,10 +192,9 @@ def from_html(self, model, field, element):
return self.value_from_string(element.text_content().strip())
-class Integer(models.AbstractModel):
- _name = 'ir.qweb.field.integer'
+class IrQwebFieldInteger(models.AbstractModel):
_description = 'Qweb Field Integer'
- _inherit = 'ir.qweb.field.integer'
+ _inherit = ['ir.qweb.field.integer']
@api.model
def from_html(self, model, field, element):
@@ -205,10 +203,9 @@ def from_html(self, model, field, element):
return int(value.replace(lang.thousands_sep or '', ''))
-class Float(models.AbstractModel):
- _name = 'ir.qweb.field.float'
+class IrQwebFieldFloat(models.AbstractModel):
_description = 'Qweb Field Float'
- _inherit = 'ir.qweb.field.float'
+ _inherit = ['ir.qweb.field.float']
@api.model
def from_html(self, model, field, element):
@@ -218,14 +215,13 @@ def from_html(self, model, field, element):
.replace(lang.decimal_point, '.'))
-class ManyToOne(models.AbstractModel):
- _name = 'ir.qweb.field.many2one'
+class IrQwebFieldMany2one(models.AbstractModel):
_description = 'Qweb Field Many to One'
- _inherit = 'ir.qweb.field.many2one'
+ _inherit = ['ir.qweb.field.many2one']
@api.model
def attributes(self, record, field_name, options, values):
- attrs = super(ManyToOne, self).attributes(record, field_name, options, values)
+ attrs = super().attributes(record, field_name, options, values)
if options.get('inherit_branding'):
many2one = record[field_name]
if many2one:
@@ -259,14 +255,13 @@ def from_html(self, model, field, element):
return None
-class Contact(models.AbstractModel):
- _name = 'ir.qweb.field.contact'
+class IrQwebFieldContact(models.AbstractModel):
_description = 'Qweb Field Contact'
- _inherit = 'ir.qweb.field.contact'
+ _inherit = ['ir.qweb.field.contact']
@api.model
def attributes(self, record, field_name, options, values):
- attrs = super(Contact, self).attributes(record, field_name, options, values)
+ attrs = super().attributes(record, field_name, options, values)
if options.get('inherit_branding'):
attrs['data-oe-contact-options'] = json.dumps(options)
return attrs
@@ -277,14 +272,13 @@ def get_record_to_html(self, ids, options=None):
return self.value_to_html(self.env['res.partner'].search([('id', '=', ids[0])]), options=options)
-class Date(models.AbstractModel):
- _name = 'ir.qweb.field.date'
+class IrQwebFieldDate(models.AbstractModel):
_description = 'Qweb Field Date'
- _inherit = 'ir.qweb.field.date'
+ _inherit = ['ir.qweb.field.date']
@api.model
def attributes(self, record, field_name, options, values):
- attrs = super(Date, self).attributes(record, field_name, options, values)
+ attrs = super().attributes(record, field_name, options, values)
if options.get('inherit_branding'):
attrs['data-oe-original'] = record[field_name]
@@ -315,14 +309,13 @@ def from_html(self, model, field, element):
return fields.Date.to_string(date)
-class DateTime(models.AbstractModel):
- _name = 'ir.qweb.field.datetime'
+class IrQwebFieldDatetime(models.AbstractModel):
_description = 'Qweb Field Datetime'
- _inherit = 'ir.qweb.field.datetime'
+ _inherit = ['ir.qweb.field.datetime']
@api.model
def attributes(self, record, field_name, options, values):
- attrs = super(DateTime, self).attributes(record, field_name, options, values)
+ attrs = super().attributes(record, field_name, options, values)
if options.get('inherit_branding'):
value = record[field_name]
@@ -379,20 +372,18 @@ def from_html(self, model, field, element):
return fields.Datetime.to_string(dt)
-class Text(models.AbstractModel):
- _name = 'ir.qweb.field.text'
+class IrQwebFieldText(models.AbstractModel):
_description = 'Qweb Field Text'
- _inherit = 'ir.qweb.field.text'
+ _inherit = ['ir.qweb.field.text']
@api.model
def from_html(self, model, field, element):
return html_to_text(element)
-class Selection(models.AbstractModel):
- _name = 'ir.qweb.field.selection'
+class IrQwebFieldSelection(models.AbstractModel):
_description = 'Qweb Field Selection'
- _inherit = 'ir.qweb.field.selection'
+ _inherit = ['ir.qweb.field.selection']
@api.model
def from_html(self, model, field, element):
@@ -406,10 +397,9 @@ def from_html(self, model, field, element):
value, selection))
-class HTML(models.AbstractModel):
- _name = 'ir.qweb.field.html'
+class IrQwebFieldHtml(models.AbstractModel):
_description = 'Qweb Field HTML'
- _inherit = 'ir.qweb.field.html'
+ _inherit = ['ir.qweb.field.html']
@api.model
def attributes(self, record, field_name, options, values=None):
@@ -449,16 +439,15 @@ def from_html(self, model, field, element):
return '\n'.join(content)
-class Image(models.AbstractModel):
+class IrQwebFieldImage(models.AbstractModel):
"""
Widget options:
``class``
set as attribute on the generated
tag
"""
- _name = 'ir.qweb.field.image'
_description = 'Qweb Field Image'
- _inherit = 'ir.qweb.field.image'
+ _inherit = ['ir.qweb.field.image']
local_url_re = re.compile(r'^/(?P[^]]+)/static/(?P.+)$')
redirect_url_re = re.compile(r'\/web\/image\/\d+-redirect\/')
@@ -537,9 +526,8 @@ def load_remote_url(self, url):
return base64.b64encode(out.getvalue())
-class Monetary(models.AbstractModel):
- _name = 'ir.qweb.field.monetary'
- _inherit = 'ir.qweb.field.monetary'
+class IrQwebFieldMonetary(models.AbstractModel):
+ _inherit = ['ir.qweb.field.monetary']
@api.model
def from_html(self, model, field, element):
@@ -551,14 +539,13 @@ def from_html(self, model, field, element):
.replace(lang.decimal_point, '.'))
-class Duration(models.AbstractModel):
- _name = 'ir.qweb.field.duration'
+class IrQwebFieldDuration(models.AbstractModel):
_description = 'Qweb Field Duration'
- _inherit = 'ir.qweb.field.duration'
+ _inherit = ['ir.qweb.field.duration']
@api.model
def attributes(self, record, field_name, options, values):
- attrs = super(Duration, self).attributes(record, field_name, options, values)
+ attrs = super().attributes(record, field_name, options, values)
if options.get('inherit_branding'):
attrs['data-oe-original'] = record[field_name]
return attrs
@@ -571,18 +558,16 @@ def from_html(self, model, field, element):
return float(value)
-class RelativeDatetime(models.AbstractModel):
- _name = 'ir.qweb.field.relative'
+class IrQwebFieldRelative(models.AbstractModel):
_description = 'Qweb Field Relative'
- _inherit = 'ir.qweb.field.relative'
+ _inherit = ['ir.qweb.field.relative']
# get formatting from ir.qweb.field.relative but edition/save from datetime
-class QwebView(models.AbstractModel):
- _name = 'ir.qweb.field.qweb'
+class IrQwebFieldQweb(models.AbstractModel):
_description = 'Qweb Field qweb'
- _inherit = 'ir.qweb.field.qweb'
+ _inherit = ['ir.qweb.field.qweb']
def html_to_text(element):
@@ -590,7 +575,7 @@ def html_to_text(element):
in roughly equivalent textual content.
Used to replace and fixup the roundtripping of text and m2o: when using
- libxml 2.8.0 (but not 2.9.1) and parsing HTML with lxml.html.fromstring
+ libxml 2.8.0 (but not 2.9.1) and parsing IrQwebFieldHtml with lxml.html.fromstring
whitespace text nodes (text nodes composed *solely* of whitespace) are
stripped out with no recourse, and fundamentally relying on newlines
being in the text (e.g. inserted during user edition) is probably poor form
diff --git a/addons/web_editor/models/ir_ui_view.py b/addons/web_editor/models/ir_ui_view.py
index d4caa3b87160b..837c193d7c95f 100644
--- a/addons/web_editor/models/ir_ui_view.py
+++ b/addons/web_editor/models/ir_ui_view.py
@@ -22,7 +22,7 @@
class IrUiView(models.Model):
- _inherit = 'ir.ui.view'
+ _inherit = ['ir.ui.view']
def _get_cleaned_non_editing_attributes(self, attributes):
"""
diff --git a/addons/web_editor/models/ir_websocket.py b/addons/web_editor/models/ir_websocket.py
index 45e6938d6e5be..d50c4dcf715d9 100644
--- a/addons/web_editor/models/ir_websocket.py
+++ b/addons/web_editor/models/ir_websocket.py
@@ -8,7 +8,7 @@
class IrWebsocket(models.AbstractModel):
- _inherit = 'ir.websocket'
+ _inherit = ['ir.websocket']
def _build_bus_channel_list(self, channels):
if self.env.uid:
diff --git a/addons/web_editor/models/models.py b/addons/web_editor/models/models.py
index 55ab89e3ceccc..7b75da0895833 100644
--- a/addons/web_editor/models/models.py
+++ b/addons/web_editor/models/models.py
@@ -6,7 +6,7 @@
class Base(models.AbstractModel):
- _inherit = 'base'
+ _inherit = ['base']
@api.model
def _get_view_field_attributes(self):
@@ -17,7 +17,9 @@ def _get_view_field_attributes(self):
class BaseModel(models.AbstractModel):
- _inherit = 'base'
+ _name = "base"
+
+ _inherit = ['base']
def web_update_field_translations(self, fname, translations):
field = self._fields[fname]
diff --git a/addons/web_editor/models/test_models.py b/addons/web_editor/models/test_models.py
index 282b703c03d20..489bce64c8cf0 100644
--- a/addons/web_editor/models/test_models.py
+++ b/addons/web_editor/models/test_models.py
@@ -4,8 +4,7 @@
from odoo import models, fields
-class ConverterTest(models.Model):
- _name = 'web_editor.converter.test'
+class Web_EditorConverterTest(models.Model):
_description = 'Web Editor Converter Test'
# disable translation export for those brilliant field labels and values
@@ -30,8 +29,7 @@ class ConverterTest(models.Model):
text = fields.Text()
-class ConverterTestSub(models.Model):
- _name = 'web_editor.converter.test.sub'
+class Web_EditorConverterTestSub(models.Model):
_description = 'Web Editor Converter Subtest'
name = fields.Char()
diff --git a/addons/web_hierarchy/models/ir_actions.py b/addons/web_hierarchy/models/ir_actions.py
index 74ae4fa984437..5440411d3dc8a 100644
--- a/addons/web_hierarchy/models/ir_actions.py
+++ b/addons/web_hierarchy/models/ir_actions.py
@@ -3,7 +3,7 @@
from odoo import fields, models
-class ActWindowView(models.Model):
- _inherit = 'ir.actions.act_window.view'
+class IrActionsAct_WindowView(models.Model):
+ _inherit = ['ir.actions.act_window.view']
view_mode = fields.Selection(selection_add=[('hierarchy', 'Hierarchy')], ondelete={'hierarchy': 'cascade'})
diff --git a/addons/web_hierarchy/models/ir_ui_view.py b/addons/web_hierarchy/models/ir_ui_view.py
index ee5ecabb66a77..85608e9753896 100644
--- a/addons/web_hierarchy/models/ir_ui_view.py
+++ b/addons/web_hierarchy/models/ir_ui_view.py
@@ -20,8 +20,9 @@
'default_order'
}
-class View(models.Model):
- _inherit = 'ir.ui.view'
+
+class IrUiView(models.Model):
+ _inherit = ['ir.ui.view']
type = fields.Selection(selection_add=[('hierarchy', "Hierarchy")])
diff --git a/addons/web_hierarchy/models/models.py b/addons/web_hierarchy/models/models.py
index 88136e7d2b2bd..88d088d4a2b06 100644
--- a/addons/web_hierarchy/models/models.py
+++ b/addons/web_hierarchy/models/models.py
@@ -4,7 +4,7 @@
class Base(models.AbstractModel):
- _inherit = 'base'
+ _inherit = ['base']
@api.model
def hierarchy_read(self, domain, specification, parent_field, child_field=None, order=None):
diff --git a/addons/web_tour/models/ir_http.py b/addons/web_tour/models/ir_http.py
index 0d710bef754a0..8eef7c311cbb6 100644
--- a/addons/web_tour/models/ir_http.py
+++ b/addons/web_tour/models/ir_http.py
@@ -1,8 +1,8 @@
from odoo import models
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
def session_info(self):
result = super().session_info()
diff --git a/addons/web_tour/models/res_users.py b/addons/web_tour/models/res_users.py
index eb5ebc3728074..dbb175f5253bd 100644
--- a/addons/web_tour/models/res_users.py
+++ b/addons/web_tour/models/res_users.py
@@ -2,7 +2,7 @@
class ResUsers(models.Model):
- _inherit = "res.users"
+ _inherit = ["res.users"]
tour_enabled = fields.Boolean(compute='_compute_tour_enabled', store=True, readonly=False)
diff --git a/addons/web_tour/models/tour.py b/addons/web_tour/models/tour.py
index 5e067c78abfde..b9d88875b954d 100644
--- a/addons/web_tour/models/tour.py
+++ b/addons/web_tour/models/tour.py
@@ -3,8 +3,7 @@
import base64
-class Tour(models.Model):
- _name = "web_tour.tour"
+class Web_TourTour(models.Model):
_description = "Tours"
_order = "sequence, name, id"
@@ -79,8 +78,7 @@ def export_js_file(self):
}
-class TourStep(models.Model):
- _name = "web_tour.tour.step"
+class Web_TourTourStep(models.Model):
_description = "Tour's step"
_order = "sequence, id"
diff --git a/addons/web_unsplash/models/ir_attachment.py b/addons/web_unsplash/models/ir_attachment.py
index 373d0d933a9cb..70bf9ebbe761a 100644
--- a/addons/web_unsplash/models/ir_attachment.py
+++ b/addons/web_unsplash/models/ir_attachment.py
@@ -4,9 +4,9 @@
from odoo import models
-class Attachment(models.Model):
+class IrAttachment(models.Model):
- _inherit = "ir.attachment"
+ _inherit = ["ir.attachment"]
def _can_bypass_rights_on_media_dialog(self, **attachment_data):
# We need to allow and sudo the case of an "url + file" attachment,
diff --git a/addons/web_unsplash/models/ir_qweb_fields.py b/addons/web_unsplash/models/ir_qweb_fields.py
index 9b0f60a44ab98..b7dace6593424 100644
--- a/addons/web_unsplash/models/ir_qweb_fields.py
+++ b/addons/web_unsplash/models/ir_qweb_fields.py
@@ -3,8 +3,8 @@
from odoo import models, api
-class Image(models.AbstractModel):
- _inherit = 'ir.qweb.field.image'
+class IrQwebFieldImage(models.AbstractModel):
+ _inherit = ['ir.qweb.field.image']
@api.model
def from_html(self, model, field, element):
@@ -27,4 +27,4 @@ def from_html(self, model, field, element):
], limit=1)
return attachment.datas
- return super(Image, self).from_html(model, field, element)
+ return super().from_html(model, field, element)
diff --git a/addons/web_unsplash/models/res_config_settings.py b/addons/web_unsplash/models/res_config_settings.py
index 3136eaef7fe32..5a9ceabf0245a 100644
--- a/addons/web_unsplash/models/res_config_settings.py
+++ b/addons/web_unsplash/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
unsplash_access_key = fields.Char("Access Key", config_parameter='unsplash.access_key')
unsplash_app_id = fields.Char("Application ID", config_parameter='unsplash.app_id')
diff --git a/addons/web_unsplash/models/res_users.py b/addons/web_unsplash/models/res_users.py
index 3d4d2d8885bab..ad70d196169f2 100644
--- a/addons/web_unsplash/models/res_users.py
+++ b/addons/web_unsplash/models/res_users.py
@@ -4,7 +4,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
def _can_manage_unsplash_settings(self):
self.ensure_one()
diff --git a/addons/website/models/assets.py b/addons/website/models/assets.py
index 75bc1decd56f8..6819686e743f9 100644
--- a/addons/website/models/assets.py
+++ b/addons/website/models/assets.py
@@ -9,8 +9,8 @@
from odoo import api, models
-class Assets(models.AbstractModel):
- _inherit = 'web_editor.assets'
+class Web_EditorAssets(models.AbstractModel):
+ _inherit = ['web_editor.assets']
@api.model
def make_scss_customization(self, url, values):
@@ -144,7 +144,7 @@ def fetch_google_font(src):
@api.model
def _get_custom_attachment(self, custom_url, op='='):
"""
- See web_editor.Assets._get_custom_attachment
+ See web_editor.Web_EditorAssets._get_custom_attachment
Extend to only return the attachments related to the current website.
"""
if self.env.user.has_group('website.group_website_designer'):
@@ -162,7 +162,7 @@ def _get_custom_attachment(self, custom_url, op='='):
@api.model
def _get_custom_asset(self, custom_url):
"""
- See web_editor.Assets._get_custom_asset
+ See web_editor.Web_EditorAssets._get_custom_asset
Extend to only return the views related to the current website.
"""
if self.env.user.has_group('website.group_website_designer'):
@@ -182,7 +182,7 @@ def _add_website_id(self, values):
@api.model
def _save_asset_attachment_hook(self):
"""
- See web_editor.Assets._save_asset_attachment_hook
+ See web_editor.Web_EditorAssets._save_asset_attachment_hook
Extend to add website ID at ir.attachment creation.
"""
return self._add_website_id(super()._save_asset_attachment_hook())
@@ -190,7 +190,7 @@ def _save_asset_attachment_hook(self):
@api.model
def _save_asset_hook(self):
"""
- See web_editor.Assets._save_asset_hook
+ See web_editor.Web_EditorAssets._save_asset_hook
Extend to add website ID at ir.asset creation.
"""
return self._add_website_id(super()._save_asset_hook())
diff --git a/addons/website/models/base_partner_merge.py b/addons/website/models/base_partner_merge.py
index ee52bd9ff796c..74120f119d623 100644
--- a/addons/website/models/base_partner_merge.py
+++ b/addons/website/models/base_partner_merge.py
@@ -4,8 +4,8 @@
from odoo import api, models
-class MergePartnerAutomatic(models.TransientModel):
- _inherit = 'base.partner.merge.automatic.wizard'
+class BasePartnerMergeAutomaticWizard(models.TransientModel):
+ _inherit = ['base.partner.merge.automatic.wizard']
@api.model
def _update_foreign_keys(self, src_partners, dst_partner):
diff --git a/addons/website/models/ir_actions_server.py b/addons/website/models/ir_actions_server.py
index b9d0edbc36e67..3a478a3c3b0d0 100644
--- a/addons/website/models/ir_actions_server.py
+++ b/addons/website/models/ir_actions_server.py
@@ -6,11 +6,10 @@
from odoo.tools.json import scriptsafe as json_scriptsafe
-class ServerAction(models.Model):
+class IrActionsServer(models.Model):
""" Add website option in server actions. """
- _name = 'ir.actions.server'
- _inherit = 'ir.actions.server'
+ _inherit = ['ir.actions.server']
xml_id = fields.Char('External ID', compute='_compute_xml_id', help="ID of the action if defined in a XML file")
website_path = fields.Char('Website Path')
@@ -45,7 +44,7 @@ def _get_website_url(self):
@api.model
def _get_eval_context(self, action):
""" Override to add the request object in eval_context. """
- eval_context = super(ServerAction, self)._get_eval_context(action)
+ eval_context = super()._get_eval_context(action)
if action.state == 'code':
eval_context['request'] = request
eval_context['json'] = json_scriptsafe
@@ -57,5 +56,5 @@ def _run_action_code_multi(self, eval_context=None):
returned by the basic server action behavior. Note that response has
priority over action, avoid using both.
"""
- res = super(ServerAction, self)._run_action_code_multi(eval_context)
+ res = super()._run_action_code_multi(eval_context)
return eval_context.get('response', res)
diff --git a/addons/website/models/ir_asset.py b/addons/website/models/ir_asset.py
index 0ea5f88d6e3f4..c5d52f28a8346 100644
--- a/addons/website/models/ir_asset.py
+++ b/addons/website/models/ir_asset.py
@@ -4,7 +4,7 @@
class IrAsset(models.Model):
- _inherit = 'ir.asset'
+ _inherit = ['ir.asset']
key = fields.Char(copy=False) # used to resolve multiple assets in a multi-website environment
website_id = fields.Many2one('website', ondelete='cascade')
diff --git a/addons/website/models/ir_attachment.py b/addons/website/models/ir_attachment.py
index 89270450beb5e..4fbe9944d4c54 100644
--- a/addons/website/models/ir_attachment.py
+++ b/addons/website/models/ir_attachment.py
@@ -5,9 +5,9 @@
_logger = logging.getLogger(__name__)
-class Attachment(models.Model):
+class IrAttachment(models.Model):
- _inherit = "ir.attachment"
+ _inherit = ["ir.attachment"]
# Technical field used to resolve multiple attachments in a multi-website environment.
key = fields.Char()
@@ -23,7 +23,7 @@ def create(self, vals_list):
@api.model
def get_serving_groups(self):
- return super(Attachment, self).get_serving_groups() + ['website.group_website_designer']
+ return super().get_serving_groups() + ['website.group_website_designer']
def _get_serve_attachment(self, url, extra_domain=None, order=None):
website = self.env['website'].get_current_website()
diff --git a/addons/website/models/ir_binary.py b/addons/website/models/ir_binary.py
index f21d6e8d462ee..878a1cac1b629 100644
--- a/addons/website/models/ir_binary.py
+++ b/addons/website/models/ir_binary.py
@@ -2,7 +2,7 @@
class IrBinary(models.AbstractModel):
- _inherit = 'ir.binary'
+ _inherit = ['ir.binary']
def _find_record(
self, xmlid=None, res_model='ir.attachment', res_id=None,
diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py
index 249ab5fda9634..ed4ff3473999c 100644
--- a/addons/website/models/ir_http.py
+++ b/addons/website/models/ir_http.py
@@ -58,8 +58,8 @@ def get_request_website():
return request and getattr(request, 'website', False) or False
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
def routing_map(self, key=None):
if not key and request:
@@ -279,7 +279,7 @@ def get_nearest_lang(self, lang_code):
website_id = False
if getattr(request, 'is_frontend', True):
website_id = self.env.get('website_id', request.website_routing)
- return super(Http, self.with_context(website_id=website_id)).get_nearest_lang(lang_code)
+ return super(IrHttp, self.with_context(website_id=website_id)).get_nearest_lang(lang_code)
@classmethod
def _get_default_lang(cls):
@@ -426,7 +426,7 @@ def _get_error_html(cls, env, code, values):
@api.model
def get_frontend_session_info(self):
- session_info = super(Http, self).get_frontend_session_info()
+ session_info = super().get_frontend_session_info()
geoip_country_code = request.geoip.country_code
geoip_phone_code = request.env['res.country']._phone_code_for(geoip_country_code) if geoip_country_code else None
session_info.update({
diff --git a/addons/website/models/ir_model.py b/addons/website/models/ir_model.py
index 757efb9bcfa06..a6b6531d58b3f 100644
--- a/addons/website/models/ir_model.py
+++ b/addons/website/models/ir_model.py
@@ -5,7 +5,9 @@
class BaseModel(models.AbstractModel):
- _inherit = 'base'
+ _name = "base"
+
+ _inherit = ['base']
def get_base_url(self):
"""
diff --git a/addons/website/models/ir_model_data.py b/addons/website/models/ir_model_data.py
index 7e2c39b85bb41..08eaf3e44da21 100644
--- a/addons/website/models/ir_model_data.py
+++ b/addons/website/models/ir_model_data.py
@@ -9,7 +9,7 @@
class IrModelData(models.Model):
- _inherit = 'ir.model.data'
+ _inherit = ['ir.model.data']
@api.model
def _process_end_unlink_record(self, record):
diff --git a/addons/website/models/ir_module_module.py b/addons/website/models/ir_module_module.py
index 1c485f4567ac4..7413b4ff2945e 100644
--- a/addons/website/models/ir_module_module.py
+++ b/addons/website/models/ir_module_module.py
@@ -14,7 +14,6 @@
class IrModuleModule(models.Model):
- _name = "ir.module.module"
_description = 'Module'
_inherit = _name
diff --git a/addons/website/models/ir_qweb.py b/addons/website/models/ir_qweb.py
index 875475932f873..a6ab5e72bb4f2 100644
--- a/addons/website/models/ir_qweb.py
+++ b/addons/website/models/ir_qweb.py
@@ -18,10 +18,10 @@
re_background_image = re.compile(r"(background-image\s*:\s*url\(\s*['\"]?\s*)([^)'\"]+)")
-class IrQWeb(models.AbstractModel):
+class IrQweb(models.AbstractModel):
""" IrQWeb object for rendering stuff in the website context """
- _inherit = 'ir.qweb'
+ _inherit = ['ir.qweb']
URL_ATTRS = {
'form': 'action',
@@ -199,7 +199,7 @@ def _adapt_style_background_image(self, atts, url_adapter):
return atts
def _get_bundles_to_pregenarate(self):
- js_assets, css_assets = super(IrQWeb, self)._get_bundles_to_pregenarate()
+ js_assets, css_assets = super()._get_bundles_to_pregenarate()
assets = {
'website.backend_assets_all_wysiwyg',
'website.assets_all_wysiwyg',
diff --git a/addons/website/models/ir_qweb_fields.py b/addons/website/models/ir_qweb_fields.py
index 79e4facce65de..7a2d2b32015f2 100644
--- a/addons/website/models/ir_qweb_fields.py
+++ b/addons/website/models/ir_qweb_fields.py
@@ -7,12 +7,12 @@
from odoo.addons.website.tools import add_form_signature
-class Contact(models.AbstractModel):
- _inherit = 'ir.qweb.field.contact'
+class IrQwebFieldContact(models.AbstractModel):
+ _inherit = ['ir.qweb.field.contact']
@api.model
def get_available_options(self):
- options = super(Contact, self).get_available_options()
+ options = super().get_available_options()
options.update(
website_description=dict(type='boolean', string=_('Display the website description')),
UserBio=dict(type='boolean', string=_('Display the biography')),
@@ -21,8 +21,8 @@ def get_available_options(self):
return options
-class HTML(models.AbstractModel):
- _inherit = 'ir.qweb.field.html'
+class IrQwebFieldHtml(models.AbstractModel):
+ _inherit = ['ir.qweb.field.html']
@api.model
def value_to_html(self, value, options):
diff --git a/addons/website/models/ir_rule.py b/addons/website/models/ir_rule.py
index 7e2fec9396ec1..08dc700a039f5 100644
--- a/addons/website/models/ir_rule.py
+++ b/addons/website/models/ir_rule.py
@@ -3,7 +3,7 @@
class IrRule(models.Model):
- _inherit = 'ir.rule'
+ _inherit = ['ir.rule']
@api.model
def _eval_context(self):
diff --git a/addons/website/models/ir_ui_menu.py b/addons/website/models/ir_ui_menu.py
index 1de69ebf29e18..5cf7a7cf42054 100644
--- a/addons/website/models/ir_ui_menu.py
+++ b/addons/website/models/ir_ui_menu.py
@@ -5,7 +5,7 @@
class IrUiMenu(models.Model):
- _inherit = 'ir.ui.menu'
+ _inherit = ['ir.ui.menu']
@api.model
@tools.ormcache_context('self._uid', keys=('lang', 'force_action',))
diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py
index b113ae89b62b8..7bcfa5ad29984 100644
--- a/addons/website/models/ir_ui_view.py
+++ b/addons/website/models/ir_ui_view.py
@@ -14,9 +14,8 @@
_logger = logging.getLogger(__name__)
-class View(models.Model):
+class IrUiView(models.Model):
- _name = "ir.ui.view"
_inherit = ["ir.ui.view", "website.seo.metadata"]
website_id = fields.Many2one('website', ondelete='cascade', string="Website")
@@ -99,7 +98,7 @@ def write(self, vals):
'''
current_website_id = self.env.context.get('website_id')
if not current_website_id or self.env.context.get('no_cow'):
- return super(View, self).write(vals)
+ return super().write(vals)
# We need to consider inactive views when handling multi-website cow
# feature (to copy inactive children views, to search for specific
@@ -117,7 +116,7 @@ def write(self, vals):
# No need of COW if the view is already specific
if view.website_id:
- super(View, view).write(vals)
+ super(IrUiView, view).write(vals)
continue
# Ensure the cache of the pages stay consistent when doing COW.
@@ -135,7 +134,7 @@ def write(self, vals):
('website_id', '=', current_website_id)
], limit=1)
if website_specific_view:
- super(View, website_specific_view).write(vals)
+ super(IrUiView, website_specific_view).write(vals)
continue
# Set key to avoid copy() to generate an unique key as we want the
@@ -165,7 +164,7 @@ def write(self, vals):
# Trigger COW on inheriting views
inherit_child.write({'inherit_id': website_specific_view.id})
- super(View, website_specific_view).write(vals)
+ super(IrUiView, website_specific_view).write(vals)
return True
@@ -210,7 +209,7 @@ def _create_all_specific_views(self, processed_modules):
record.with_context(website_id=website_id).write({
'inherit_id': specific_parent_view_id,
})
- super(View, self)._create_all_specific_views(processed_modules)
+ super()._create_all_specific_views(processed_modules)
def unlink(self):
'''This implements COU (copy-on-unlink). When deleting a generic page
@@ -232,7 +231,7 @@ def unlink(self):
for view in self.filtered(lambda view: not view.website_id):
specific_views += view._get_specific_views()
- result = super(View, self + specific_views).unlink()
+ result = super(IrUiView, self + specific_views).unlink()
self.env.registry.clear_cache('templates')
return result
@@ -281,7 +280,7 @@ def get_related_views(self, key, bundles=False):
# method should never be called in a generic context, even for
# tests)
self = self.with_context(website_id=self.env['website'].get_current_website().id)
- return super(View, self).get_related_views(key, bundles=bundles)
+ return super().get_related_views(key, bundles=bundles)
def filter_duplicate(self):
""" Filter current recordset only keeping the most suitable view per distinct key.
@@ -308,7 +307,7 @@ def filter_duplicate(self):
@api.model
def _view_get_inherited_children(self, view):
- extensions = super(View, self)._view_get_inherited_children(view)
+ extensions = super()._view_get_inherited_children(view)
return extensions.filter_duplicate()
@api.model
@@ -328,7 +327,7 @@ def _view_obj(self, view_id):
@api.model
def _get_inheriting_views_domain(self):
- domain = super(View, self)._get_inheriting_views_domain()
+ domain = super()._get_inheriting_views_domain()
current_website = self.env['website'].browse(self._context.get('website_id'))
website_views_domain = current_website.website_domain()
# when rendering for the website we have to include inactive views
@@ -340,9 +339,9 @@ def _get_inheriting_views_domain(self):
@api.model
def _get_inheriting_views(self):
if not self._context.get('website_id'):
- return super(View, self)._get_inheriting_views()
+ return super()._get_inheriting_views()
- views = super(View, self.with_context(active_test=False))._get_inheriting_views()
+ views = super(IrUiView, self.with_context(active_test=False))._get_inheriting_views()
# prefer inactive website-specific views over active generic ones
return views.filter_duplicate().filtered('active')
@@ -395,7 +394,7 @@ def _get_view_id(self, xml_id):
_logger.warning("Could not find view object with xml_id '%s'", xml_id)
raise ValueError('View %r in website %r not found' % (xml_id, self._context['website_id']))
return view.id
- return super(View, self.sudo())._get_view_id(xml_id)
+ return super(IrUiView, self.sudo())._get_view_id(xml_id)
@tools.ormcache('self.id', cache='templates')
def _get_cached_visibility(self):
@@ -455,14 +454,14 @@ def get_default_lang_code(self):
lang_code = self.env['website'].browse(website_id).default_lang_id.code
return lang_code
else:
- return super(View, self).get_default_lang_code()
+ return super().get_default_lang_code()
def _read_template_keys(self):
- return super(View, self)._read_template_keys() + ['website_id']
+ return super()._read_template_keys() + ['website_id']
@api.model
def _save_oe_structure_hook(self):
- res = super(View, self)._save_oe_structure_hook()
+ res = super()._save_oe_structure_hook()
res['website_id'] = self.env['website'].get_current_website().id
return res
@@ -473,7 +472,7 @@ def _set_noupdate(self):
In that case, we don't want to flag the generic view as noupdate.
'''
if not self._context.get('website_id'):
- super(View, self)._set_noupdate()
+ super()._set_noupdate()
def save(self, value, xpath=None):
self.ensure_one()
@@ -491,7 +490,7 @@ def save(self, value, xpath=None):
], limit=1)
if website_specific_view:
self = website_specific_view
- super(View, self).save(value, xpath=xpath)
+ super().save(value, xpath=xpath)
@api.model
def _get_allowed_root_attrs(self):
@@ -519,7 +518,7 @@ def _snippet_save_view_values_hook(self):
return res
def _update_field_translations(self, fname, translations, digest=None, source_lang=None):
- return super(View, self.with_context(no_cow=True))._update_field_translations(fname, translations, digest=digest, source_lang=source_lang)
+ return super(IrUiView, self.with_context(no_cow=True))._update_field_translations(fname, translations, digest=digest, source_lang=source_lang)
def _get_base_lang(self):
""" Returns the default language of the website as the base language if the record is bound to it """
diff --git a/addons/website/models/mixins.py b/addons/website/models/mixins.py
index 4ab152c6900ff..55bc7f38c977b 100644
--- a/addons/website/models/mixins.py
+++ b/addons/website/models/mixins.py
@@ -16,9 +16,8 @@
logger = logging.getLogger(__name__)
-class SeoMetadata(models.AbstractModel):
+class WebsiteSeoMetadata(models.AbstractModel):
- _name = 'website.seo.metadata'
_description = 'SEO metadata'
is_seo_optimized = fields.Boolean("SEO optimized", compute='_compute_is_seo_optimized')
@@ -98,9 +97,8 @@ def get_website_meta(self):
}
-class WebsiteCoverPropertiesMixin(models.AbstractModel):
+class WebsiteCover_PropertiesMixin(models.AbstractModel):
- _name = 'website.cover_properties.mixin'
_description = 'Cover Properties Website Mixin'
cover_properties = fields.Text('Cover Properties', default=lambda s: json_safe.dumps(s._default_cover_properties()))
@@ -149,13 +147,12 @@ def write(self, vals):
old_cover_properties = json_safe.loads(item.cover_properties)
cover_properties['resize_class'] = old_cover_properties.get('resize_class', classes[0])
copy_vals['cover_properties'] = json_safe.dumps(cover_properties)
- super(WebsiteCoverPropertiesMixin, item).write(copy_vals)
+ super(WebsiteCover_PropertiesMixin, item).write(copy_vals)
return True
class WebsiteMultiMixin(models.AbstractModel):
- _name = 'website.multi.mixin'
_description = 'Multi Website Mixin'
website_id = fields.Many2one(
@@ -177,7 +174,6 @@ def can_access_from_current_website(self, website_id=False):
class WebsitePublishedMixin(models.AbstractModel):
- _name = "website.published.mixin"
_description = 'Website Published Mixin'
website_published = fields.Boolean('Visible on current website', related='is_published', readonly=False)
@@ -291,7 +287,6 @@ def open_website_url(self):
class WebsiteSearchableMixin(models.AbstractModel):
"""Mixin to be inherited by all models that need to searchable through website"""
- _name = 'website.searchable.mixin'
_description = 'Website Searchable Mixin'
@api.model
diff --git a/addons/website/models/res_company.py b/addons/website/models/res_company.py
index 507ae582e326d..b43b60ff1eed1 100644
--- a/addons/website/models/res_company.py
+++ b/addons/website/models/res_company.py
@@ -4,8 +4,8 @@
from odoo.exceptions import ValidationError
-class Company(models.Model):
- _inherit = "res.company"
+class ResCompany(models.Model):
+ _inherit = ["res.company"]
website_id = fields.Many2one('website', compute='_compute_website_id', store=True)
diff --git a/addons/website/models/res_config_settings.py b/addons/website/models/res_config_settings.py
index 28f233a6e2666..511abd2b7e56e 100644
--- a/addons/website/models/res_config_settings.py
+++ b/addons/website/models/res_config_settings.py
@@ -9,7 +9,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
def _default_website(self):
return self.env['website'].search([('company_id', '=', self.env.company.id)], limit=1)
diff --git a/addons/website/models/res_lang.py b/addons/website/models/res_lang.py
index 92fda298d1473..eb8c65146e84a 100644
--- a/addons/website/models/res_lang.py
+++ b/addons/website/models/res_lang.py
@@ -6,14 +6,14 @@
from odoo.http import request
-class Lang(models.Model):
- _inherit = "res.lang"
+class ResLang(models.Model):
+ _inherit = ["res.lang"]
def write(self, vals):
if 'active' in vals and not vals['active']:
if self.env['website'].search_count([('language_ids', 'in', self._ids)], limit=1):
raise UserError(_("Cannot deactivate a language that is currently used on a website."))
- return super(Lang, self).write(vals)
+ return super().write(vals)
@tools.ormcache_context(keys=("website_id",))
def _get_frontend(self) -> LangDataDict:
diff --git a/addons/website/models/res_partner.py b/addons/website/models/res_partner.py
index a60f1b5287c59..fdf551ba0e7f3 100644
--- a/addons/website/models/res_partner.py
+++ b/addons/website/models/res_partner.py
@@ -4,8 +4,8 @@
from odoo import models, fields, api
-class Partner(models.Model):
- _name = 'res.partner'
+
+class ResPartner(models.Model):
_inherit = ['res.partner', 'website.published.multi.mixin']
visitor_ids = fields.One2many('website.visitor', 'partner_id', string='Visitors')
diff --git a/addons/website/models/res_users.py b/addons/website/models/res_users.py
index b7b2b7b29df16..e74a67044fe5d 100644
--- a/addons/website/models/res_users.py
+++ b/addons/website/models/res_users.py
@@ -9,7 +9,7 @@
class ResUsers(models.Model):
- _inherit = 'res.users'
+ _inherit = ['res.users']
website_id = fields.Many2one('website', related='partner_id.website_id', store=True, related_sudo=False, readonly=False)
diff --git a/addons/website/models/theme_models.py b/addons/website/models/theme_models.py
index 67056f4f687cf..8006f7b77d374 100644
--- a/addons/website/models/theme_models.py
+++ b/addons/website/models/theme_models.py
@@ -11,8 +11,7 @@
_logger = logging.getLogger(__name__)
-class ThemeAsset(models.Model):
- _name = 'theme.ir.asset'
+class ThemeIrAsset(models.Model):
_description = 'Theme Asset'
key = fields.Char()
@@ -49,8 +48,7 @@ def _convert_to_base_model(self, website, **kwargs):
return new_asset
-class ThemeView(models.Model):
- _name = 'theme.ir.ui.view'
+class ThemeIrUiView(models.Model):
_description = 'Theme UI View'
def compute_arch_fs(self):
@@ -109,8 +107,7 @@ def _convert_to_base_model(self, website, **kwargs):
return new_view
-class ThemeAttachment(models.Model):
- _name = 'theme.ir.attachment'
+class ThemeIrAttachment(models.Model):
_description = 'Theme Attachments'
name = fields.Char(required=True)
@@ -133,8 +130,7 @@ def _convert_to_base_model(self, website, **kwargs):
return new_attach
-class ThemeMenu(models.Model):
- _name = 'theme.website.menu'
+class ThemeWebsiteMenu(models.Model):
_description = 'Website Theme Menu'
name = fields.Char(required=True, translate=True)
@@ -174,8 +170,7 @@ def _convert_to_base_model(self, website, **kwargs):
return new_menu
-class ThemePage(models.Model):
- _name = 'theme.website.page'
+class ThemeWebsitePage(models.Model):
_description = 'Website Theme Page'
url = fields.Char()
@@ -214,8 +209,7 @@ def _convert_to_base_model(self, website, **kwargs):
return new_page
-class Theme(models.AbstractModel):
- _name = 'theme.utils'
+class ThemeUtils(models.AbstractModel):
_description = 'Theme Utils'
_auto = False
@@ -292,8 +286,8 @@ def _reset_default_config(self):
@api.model
def _toggle_asset(self, key, active):
- ThemeAsset = self.env['theme.ir.asset'].sudo().with_context(active_test=False)
- obj = ThemeAsset.search([('key', '=', key)])
+ ThemeIrAsset = self.env['theme.ir.asset'].sudo().with_context(active_test=False)
+ obj = ThemeIrAsset.search([('key', '=', key)])
website = self.env['website'].get_current_website()
if obj:
obj = obj.copy_ids.filtered(lambda x: x.website_id == website)
@@ -354,7 +348,7 @@ def disable_view(self, xml_id):
class IrUiView(models.Model):
- _inherit = 'ir.ui.view'
+ _inherit = ['ir.ui.view']
theme_template_id = fields.Many2one('theme.ir.ui.view', copy=False)
@@ -381,25 +375,25 @@ def write(self, vals):
class IrAsset(models.Model):
- _inherit = 'ir.asset'
+ _inherit = ['ir.asset']
theme_template_id = fields.Many2one('theme.ir.asset', copy=False)
class IrAttachment(models.Model):
- _inherit = 'ir.attachment'
+ _inherit = ['ir.attachment']
key = fields.Char(copy=False)
theme_template_id = fields.Many2one('theme.ir.attachment', copy=False)
class WebsiteMenu(models.Model):
- _inherit = 'website.menu'
+ _inherit = ['website.menu']
theme_template_id = fields.Many2one('theme.website.menu', copy=False)
class WebsitePage(models.Model):
- _inherit = 'website.page'
+ _inherit = ['website.page']
theme_template_id = fields.Many2one('theme.website.page', copy=False)
diff --git a/addons/website/models/website.py b/addons/website/models/website.py
index c5d04ddee7f79..8467065ed73f4 100644
--- a/addons/website/models/website.py
+++ b/addons/website/models/website.py
@@ -92,7 +92,6 @@
class Website(models.Model):
- _name = "website"
_description = "Website"
_order = "sequence, id"
diff --git a/addons/website/models/website_configurator_feature.py b/addons/website/models/website_configurator_feature.py
index 51f7201b7847d..65960092bfa42 100644
--- a/addons/website/models/website_configurator_feature.py
+++ b/addons/website/models/website_configurator_feature.py
@@ -8,7 +8,6 @@
class WebsiteConfiguratorFeature(models.Model):
- _name = 'website.configurator.feature'
_description = 'Website Configurator Feature'
_order = 'sequence'
diff --git a/addons/website/models/website_controller_page.py b/addons/website/models/website_controller_page.py
index 5097b3f506469..ab2261747dbdf 100644
--- a/addons/website/models/website_controller_page.py
+++ b/addons/website/models/website_controller_page.py
@@ -4,7 +4,6 @@
class WebsiteControllerPage(models.Model):
- _name = 'website.controller.page'
_inherits = {'ir.ui.view': 'view_id'}
_inherit = [
'website.published.multi.mixin',
diff --git a/addons/website/models/website_form.py b/addons/website/models/website_form.py
index 9d77530bec59f..45fb129fb80c5 100644
--- a/addons/website/models/website_form.py
+++ b/addons/website/models/website_form.py
@@ -7,8 +7,8 @@
from odoo.osv import expression
-class website_form_config(models.Model):
- _inherit = 'website'
+class Website(models.Model):
+ _inherit = ['website']
def _website_form_last_record(self):
if request and request.session.form_builder_model_model:
@@ -16,10 +16,9 @@ def _website_form_last_record(self):
return False
-class website_form_model(models.Model):
- _name = 'ir.model'
+class IrModel(models.Model):
_description = 'Models'
- _inherit = 'ir.model'
+ _inherit = ['ir.model']
website_form_access = fields.Boolean('Allowed to use in forms', help='Enable the form builder feature for this model.')
website_form_default_field_id = fields.Many2one('ir.model.fields', 'Field for custom form data', domain="[('model', '=', model), ('ttype', '=', 'text')]", help="Specify the field which will contain meta and custom form fields datas.")
@@ -128,11 +127,10 @@ def get_compatible_form_models(self):
)
-class website_form_model_fields(models.Model):
+class IrModelFields(models.Model):
""" fields configuration for form builder """
- _name = 'ir.model.fields'
_description = 'Fields'
- _inherit = 'ir.model.fields'
+ _inherit = ['ir.model.fields']
def init(self):
# set all existing unset website_form_blacklisted fields to ``true``
diff --git a/addons/website/models/website_menu.py b/addons/website/models/website_menu.py
index 1ec7d3f0a689e..b2a22b08068e1 100644
--- a/addons/website/models/website_menu.py
+++ b/addons/website/models/website_menu.py
@@ -12,9 +12,8 @@
from odoo.tools.translate import html_translate
-class Menu(models.Model):
+class WebsiteMenu(models.Model):
- _name = "website.menu"
_description = "Website Menu"
_parent_store = True
@@ -131,7 +130,7 @@ def unlink(self):
menus_to_remove |= self.env['website.menu'].search([('url', '=', menu.url),
('website_id', '!=', False),
('id', '!=', menu.id)])
- return super(Menu, menus_to_remove).unlink()
+ return super(WebsiteMenu, menus_to_remove).unlink()
@api.ondelete(at_uninstall=False)
def _unlink_except_master_tags(self):
diff --git a/addons/website/models/website_page.py b/addons/website/models/website_page.py
index ac92b84e19bb7..4e6dc9ac225d4 100644
--- a/addons/website/models/website_page.py
+++ b/addons/website/models/website_page.py
@@ -9,8 +9,7 @@
from odoo.tools.translate import _
-class Page(models.Model):
- _name = 'website.page'
+class WebsitePage(models.Model):
_inherits = {'ir.ui.view': 'view_id'}
_inherit = [
'website.published.multi.mixin',
@@ -160,7 +159,7 @@ def write(self, vals):
if vals['visibility'] != 'restricted_group':
vals['groups_id'] = False
self.env.registry.clear_cache() # write on page == write on view that invalid cache
- return super(Page, self).write(vals)
+ return super().write(vals)
def get_website_meta(self):
self.ensure_one()
diff --git a/addons/website/models/website_page_properties.py b/addons/website/models/website_page_properties.py
index bfddaa58fce01..2fe7be2cdddd9 100644
--- a/addons/website/models/website_page_properties.py
+++ b/addons/website/models/website_page_properties.py
@@ -3,8 +3,7 @@
from odoo import api, fields, models
-class PagePropertiesBase(models.TransientModel):
- _name = 'website.page.properties.base'
+class WebsitePagePropertiesBase(models.TransientModel):
_description = "Page Properties Base"
target_model_id = fields.Reference(selection='_selection_target_model_id', required=True)
@@ -128,8 +127,7 @@ def _is_ir_ui_view_published(self, view):
return not view.visibility
-class PageProperties(models.TransientModel):
- _name = 'website.page.properties'
+class WebsitePageProperties(models.TransientModel):
_description = "Page Properties"
_inherit = [
'website.page.properties.base',
diff --git a/addons/website/models/website_rewrite.py b/addons/website/models/website_rewrite.py
index 7c124945b8ad6..f567deec1133b 100644
--- a/addons/website/models/website_rewrite.py
+++ b/addons/website/models/website_rewrite.py
@@ -12,7 +12,6 @@
class WebsiteRoute(models.Model):
_rec_name = 'path'
- _name = 'website.route'
_description = "All Website Route"
_order = 'path'
@@ -49,7 +48,6 @@ def _refresh(self):
class WebsiteRewrite(models.Model):
- _name = 'website.rewrite'
_description = "Website rewrite"
name = fields.Char('Name', required=True)
diff --git a/addons/website/models/website_snippet_filter.py b/addons/website/models/website_snippet_filter.py
index 62d7ee6a4eacb..face0829b32c8 100644
--- a/addons/website/models/website_snippet_filter.py
+++ b/addons/website/models/website_snippet_filter.py
@@ -12,7 +12,6 @@
class WebsiteSnippetFilter(models.Model):
- _name = 'website.snippet.filter'
_inherit = ['website.published.multi.mixin']
_description = 'Website Snippet Filter'
_order = 'name ASC'
diff --git a/addons/website/models/website_visitor.py b/addons/website/models/website_visitor.py
index fc36436a69cec..8ec19613368b6 100644
--- a/addons/website/models/website_visitor.py
+++ b/addons/website/models/website_visitor.py
@@ -16,7 +16,6 @@
class WebsiteTrack(models.Model):
- _name = 'website.track'
_description = 'Visited Pages'
_order = 'visit_datetime DESC'
_log_access = False
@@ -28,7 +27,6 @@ class WebsiteTrack(models.Model):
class WebsiteVisitor(models.Model):
- _name = 'website.visitor'
_description = 'Website Visitor'
_order = 'id DESC'
diff --git a/addons/website/wizard/base_language_install.py b/addons/website/wizard/base_language_install.py
index 73e0828b6d7ca..12c1e8ac4efb8 100644
--- a/addons/website/wizard/base_language_install.py
+++ b/addons/website/wizard/base_language_install.py
@@ -5,7 +5,7 @@
class BaseLanguageInstall(models.TransientModel):
- _inherit = "base.language.install"
+ _inherit = ["base.language.install"]
website_ids = fields.Many2many('website', string='Websites to translate')
diff --git a/addons/website/wizard/blocked_third_party_domains.py b/addons/website/wizard/blocked_third_party_domains.py
index 1723318673487..feeab48aa820a 100644
--- a/addons/website/wizard/blocked_third_party_domains.py
+++ b/addons/website/wizard/blocked_third_party_domains.py
@@ -5,8 +5,7 @@
from odoo.exceptions import ValidationError
-class BlockedThirdPartyDomains(models.TransientModel):
- _name = "website.custom_blocked_third_party_domains"
+class WebsiteCustom_Blocked_Third_Party_Domains(models.TransientModel):
_description = "User list of blocked 3rd-party domains"
content = fields.Text(default=lambda s: s.env['website'].get_current_website().custom_blocked_third_party_domains)
diff --git a/addons/website/wizard/website_robots.py b/addons/website/wizard/website_robots.py
index f9b21351c9230..4c461dd26e752 100644
--- a/addons/website/wizard/website_robots.py
+++ b/addons/website/wizard/website_robots.py
@@ -3,7 +3,6 @@
class WebsiteRobots(models.TransientModel):
- _name = "website.robots"
_description = "Robots.txt Editor"
content = fields.Text(default=lambda s: s.env['website'].get_current_website().robots_txt)
diff --git a/addons/website_blog/models/website.py b/addons/website_blog/models/website.py
index 46cf8ea91dee6..edea2bc1a4420 100644
--- a/addons/website_blog/models/website.py
+++ b/addons/website_blog/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def get_suggested_controllers(self):
suggested_controllers = super(Website, self).get_suggested_controllers()
diff --git a/addons/website_blog/models/website_blog.py b/addons/website_blog/models/website_blog.py
index 245937b5abc0c..3765a47842265 100644
--- a/addons/website_blog/models/website_blog.py
+++ b/addons/website_blog/models/website_blog.py
@@ -11,8 +11,7 @@
from odoo.tools import html_escape
-class Blog(models.Model):
- _name = 'blog.blog'
+class BlogBlog(models.Model):
_description = 'Blog'
_inherit = [
'mail.thread',
@@ -36,7 +35,7 @@ def _compute_blog_post_count(self):
record.blog_post_count = len(record.blog_post_ids)
def write(self, vals):
- res = super(Blog, self).write(vals)
+ res = super().write(vals)
if 'active' in vals:
# archiving/unarchiving a blog does it on its posts, too
post_ids = self.env['blog.post'].with_context(active_test=False).search([
@@ -56,7 +55,7 @@ def message_post(self, *, parent_id=False, subtype_id=False, **kwargs):
parent_message = self.env['mail.message'].sudo().browse(parent_id)
if parent_message.subtype_id and parent_message.subtype_id == self.env.ref('website_blog.mt_blog_blog_published'):
subtype_id = self.env.ref('mail.mt_note').id
- return super(Blog, self).message_post(parent_id=parent_id, subtype_id=subtype_id, **kwargs)
+ return super().message_post(parent_id=parent_id, subtype_id=subtype_id, **kwargs)
def all_tags(self, join=False, min_limit=1):
BlogTag = self.env['blog.tag']
@@ -121,8 +120,8 @@ def _search_render_results(self, fetch_fields, mapping, icon, limit):
data['url'] = '/blog/%s' % data['id']
return results_data
+
class BlogTagCategory(models.Model):
- _name = 'blog.tag.category'
_description = 'Blog Tag Category'
_order = 'name'
@@ -135,7 +134,6 @@ class BlogTagCategory(models.Model):
class BlogTag(models.Model):
- _name = 'blog.tag'
_description = 'Blog Tag'
_inherit = ['website.seo.metadata']
_order = 'name'
@@ -151,7 +149,6 @@ class BlogTag(models.Model):
class BlogPost(models.Model):
- _name = "blog.post"
_description = "Blog Post"
_inherit = ['mail.thread', 'website.seo.metadata', 'website.published.multi.mixin',
'website.cover_properties.mixin', 'website.searchable.mixin']
diff --git a/addons/website_blog/models/website_snippet_filter.py b/addons/website_blog/models/website_snippet_filter.py
index 3bc59a651eaaf..5dce2f03eeaa9 100644
--- a/addons/website_blog/models/website_snippet_filter.py
+++ b/addons/website_blog/models/website_snippet_filter.py
@@ -7,7 +7,7 @@
class WebsiteSnippetFilter(models.Model):
- _inherit = 'website.snippet.filter'
+ _inherit = ['website.snippet.filter']
def _get_hardcoded_sample(self, model):
samples = super()._get_hardcoded_sample(model)
diff --git a/addons/website_cf_turnstile/models/ir_http.py b/addons/website_cf_turnstile/models/ir_http.py
index 5bc73afc957be..54be7dbd43822 100644
--- a/addons/website_cf_turnstile/models/ir_http.py
+++ b/addons/website_cf_turnstile/models/ir_http.py
@@ -10,8 +10,8 @@
logger = logging.getLogger(__name__)
-class Http(models.AbstractModel):
- _inherit = 'ir.http'
+class IrHttp(models.AbstractModel):
+ _inherit = ['ir.http']
@api.model
def get_frontend_session_info(self):
diff --git a/addons/website_cf_turnstile/models/res_config_settings.py b/addons/website_cf_turnstile/models/res_config_settings.py
index 5aae7b107bd15..75cbe75ae74ba 100644
--- a/addons/website_cf_turnstile/models/res_config_settings.py
+++ b/addons/website_cf_turnstile/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
turnstile_site_key = fields.Char("CF Site Key", config_parameter='cf.turnstile_site_key', groups='base.group_system')
turnstile_secret_key = fields.Char("CF Secret Key", config_parameter='cf.turnstile_secret_key', groups='base.group_system')
diff --git a/addons/website_crm/models/crm_lead.py b/addons/website_crm/models/crm_lead.py
index cf3ee227ef416..782ee80e940b5 100644
--- a/addons/website_crm/models/crm_lead.py
+++ b/addons/website_crm/models/crm_lead.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Lead(models.Model):
- _inherit = 'crm.lead'
+class CrmLead(models.Model):
+ _inherit = ['crm.lead']
visitor_ids = fields.Many2many('website.visitor', string="Web Visitors")
visitor_page_count = fields.Integer('# Page Views', compute="_compute_visitor_page_count")
@@ -39,7 +39,7 @@ def action_redirect_to_page_views(self):
return action
def _merge_get_fields_specific(self):
- fields_info = super(Lead, self)._merge_get_fields_specific()
+ fields_info = super()._merge_get_fields_specific()
# add all the visitors from all lead to merge
fields_info['visitor_ids'] = lambda fname, leads: [(6, 0, leads.visitor_ids.ids)]
return fields_info
diff --git a/addons/website_crm/models/website.py b/addons/website_crm/models/website.py
index 389c523cdc836..441efa5e821bb 100644
--- a/addons/website_crm/models/website.py
+++ b/addons/website_crm/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
def _get_crm_default_team_domain(self):
if not self.env.user.has_group('crm.group_use_lead'):
diff --git a/addons/website_crm/models/website_visitor.py b/addons/website_crm/models/website_visitor.py
index c990a7ab1fffd..6b25dbf0c971c 100644
--- a/addons/website_crm/models/website_visitor.py
+++ b/addons/website_crm/models/website_visitor.py
@@ -6,7 +6,7 @@
class WebsiteVisitor(models.Model):
- _inherit = 'website.visitor'
+ _inherit = ['website.visitor']
lead_ids = fields.Many2many('crm.lead', string='Leads', groups="sales_team.group_sale_salesman")
lead_count = fields.Integer('# Leads', compute="_compute_lead_count", groups="sales_team.group_sale_salesman")
diff --git a/addons/website_crm_iap_reveal/models/crm_lead.py b/addons/website_crm_iap_reveal/models/crm_lead.py
index 074a651a14cd2..763f63c507de8 100644
--- a/addons/website_crm_iap_reveal/models/crm_lead.py
+++ b/addons/website_crm_iap_reveal/models/crm_lead.py
@@ -4,12 +4,12 @@
from odoo import fields, models
-class Lead(models.Model):
- _inherit = 'crm.lead'
+class CrmLead(models.Model):
+ _inherit = ['crm.lead']
reveal_ip = fields.Char(string='IP Address')
reveal_iap_credits = fields.Integer(string='IAP Credits')
reveal_rule_id = fields.Many2one('crm.reveal.rule', string='Lead Generation Rule', index='btree_not_null')
def _merge_get_fields(self):
- return super(Lead, self)._merge_get_fields() + ['reveal_ip', 'reveal_iap_credits', 'reveal_rule_id']
+ return super()._merge_get_fields() + ['reveal_ip', 'reveal_iap_credits', 'reveal_rule_id']
diff --git a/addons/website_crm_iap_reveal/models/crm_reveal_rule.py b/addons/website_crm_iap_reveal/models/crm_reveal_rule.py
index bee0896602427..ffaded59d70c6 100644
--- a/addons/website_crm_iap_reveal/models/crm_reveal_rule.py
+++ b/addons/website_crm_iap_reveal/models/crm_reveal_rule.py
@@ -19,8 +19,8 @@
DEFAULT_REVEAL_BATCH_LIMIT = 25
DEFAULT_REVEAL_MONTH_VALID = 6
-class CRMRevealRule(models.Model):
- _name = 'crm.reveal.rule'
+
+class CrmRevealRule(models.Model):
_description = 'CRM Lead Generation Rules'
_order = 'sequence'
@@ -94,11 +94,11 @@ def write(self, vals):
}
if set(vals.keys()) & fields_set:
self.env.registry.clear_cache() # Clear the cache in order to recompute _get_active_rules
- return super(CRMRevealRule, self).write(vals)
+ return super().write(vals)
def unlink(self):
self.env.registry.clear_cache() # Clear the cache in order to recompute _get_active_rules
- return super(CRMRevealRule, self).unlink()
+ return super().unlink()
def action_get_lead_tree_view(self):
action = self.env["ir.actions.actions"]._for_xml_id("crm.crm_lead_all_leads")
diff --git a/addons/website_crm_iap_reveal/models/crm_reveal_view.py b/addons/website_crm_iap_reveal/models/crm_reveal_view.py
index 194211c6bd1a6..0cdf64f68c613 100644
--- a/addons/website_crm_iap_reveal/models/crm_reveal_view.py
+++ b/addons/website_crm_iap_reveal/models/crm_reveal_view.py
@@ -7,8 +7,8 @@
DEFAULT_REVEAL_VIEW_WEEKS_VALID = 5
-class CRMRevealView(models.Model):
- _name = 'crm.reveal.view'
+
+class CrmRevealView(models.Model):
_description = 'CRM Reveal View'
_rec_name = 'reveal_ip'
_order = 'id desc'
diff --git a/addons/website_crm_iap_reveal/models/ir_http.py b/addons/website_crm_iap_reveal/models/ir_http.py
index 5dc01959ec001..b93dcfb17cbc3 100644
--- a/addons/website_crm_iap_reveal/models/ir_http.py
+++ b/addons/website_crm_iap_reveal/models/ir_http.py
@@ -9,8 +9,9 @@
_logger = logging.getLogger(__name__)
+
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _serve_page(cls):
diff --git a/addons/website_crm_livechat/models/chatbot_script_step.py b/addons/website_crm_livechat/models/chatbot_script_step.py
index 17569b786016f..f7da66e313fe2 100644
--- a/addons/website_crm_livechat/models/chatbot_script_step.py
+++ b/addons/website_crm_livechat/models/chatbot_script_step.py
@@ -6,7 +6,7 @@
class ChatbotScriptStep(models.Model):
- _inherit = 'chatbot.script.step'
+ _inherit = ['chatbot.script.step']
def _chatbot_crm_prepare_lead_values(self, discuss_channel, description):
values = super()._chatbot_crm_prepare_lead_values(discuss_channel, description)
diff --git a/addons/website_crm_livechat/models/crm_lead.py b/addons/website_crm_livechat/models/crm_lead.py
index 031ceb587c6bd..88efcd182400c 100644
--- a/addons/website_crm_livechat/models/crm_lead.py
+++ b/addons/website_crm_livechat/models/crm_lead.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Lead(models.Model):
- _inherit = 'crm.lead'
+class CrmLead(models.Model):
+ _inherit = ['crm.lead']
visitor_sessions_count = fields.Integer('# Sessions', compute="_compute_visitor_sessions_count", groups="im_livechat.im_livechat_group_user")
diff --git a/addons/website_crm_livechat/models/discuss_channel.py b/addons/website_crm_livechat/models/discuss_channel.py
index dd9f73a60c210..6887f0b800c7e 100644
--- a/addons/website_crm_livechat/models/discuss_channel.py
+++ b/addons/website_crm_livechat/models/discuss_channel.py
@@ -5,7 +5,7 @@
class DiscussChannel(models.Model):
- _inherit = 'discuss.channel'
+ _inherit = ['discuss.channel']
def _convert_visitor_to_lead(self, partner, key):
""" When website is installed, we can link the created lead from /lead command
diff --git a/addons/website_crm_partner_assign/models/crm_lead.py b/addons/website_crm_partner_assign/models/crm_lead.py
index a1d1bb607d50d..9637aa9feaf10 100644
--- a/addons/website_crm_partner_assign/models/crm_lead.py
+++ b/addons/website_crm_partner_assign/models/crm_lead.py
@@ -8,7 +8,7 @@
class CrmLead(models.Model):
- _inherit = "crm.lead"
+ _inherit = ["crm.lead"]
partner_latitude = fields.Float('Geo Latitude', digits=(10, 7))
partner_longitude = fields.Float('Geo Longitude', digits=(10, 7))
diff --git a/addons/website_crm_partner_assign/models/res_partner.py b/addons/website_crm_partner_assign/models/res_partner.py
index 5ecb1b963c297..67baeafa5c4e4 100644
--- a/addons/website_crm_partner_assign/models/res_partner.py
+++ b/addons/website_crm_partner_assign/models/res_partner.py
@@ -4,7 +4,7 @@
class ResPartner(models.Model):
- _inherit = "res.partner"
+ _inherit = ["res.partner"]
@api.model
def default_get(self, fields_list):
diff --git a/addons/website_crm_partner_assign/models/res_partner_activation.py b/addons/website_crm_partner_assign/models/res_partner_activation.py
index 8230a5749c94c..2b51d9ce02ff6 100644
--- a/addons/website_crm_partner_assign/models/res_partner_activation.py
+++ b/addons/website_crm_partner_assign/models/res_partner_activation.py
@@ -5,7 +5,6 @@
class ResPartnerActivation(models.Model):
- _name = 'res.partner.activation'
_order = 'sequence'
_description = 'Partner Activation'
diff --git a/addons/website_crm_partner_assign/models/res_partner_grade.py b/addons/website_crm_partner_assign/models/res_partner_grade.py
index e58210804bdc6..bfdf8abfef001 100644
--- a/addons/website_crm_partner_assign/models/res_partner_grade.py
+++ b/addons/website_crm_partner_assign/models/res_partner_grade.py
@@ -5,7 +5,6 @@
class ResPartnerGrade(models.Model):
- _name = 'res.partner.grade'
_order = 'sequence'
_inherit = ['website.published.mixin']
_description = 'Partner Grade'
diff --git a/addons/website_crm_partner_assign/models/website.py b/addons/website_crm_partner_assign/models/website.py
index 296618c28e910..6ea8a30a19c36 100644
--- a/addons/website_crm_partner_assign/models/website.py
+++ b/addons/website_crm_partner_assign/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def get_suggested_controllers(self):
suggested_controllers = super(Website, self).get_suggested_controllers()
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 ab0b40f43bb40..85938e2c75c24 100644
--- a/addons/website_crm_partner_assign/report/crm_partner_report.py
+++ b/addons/website_crm_partner_assign/report/crm_partner_report.py
@@ -7,7 +7,6 @@
class CrmPartnerReportAssign(models.Model):
""" CRM Lead Report """
- _name = "crm.partner.report.assign"
_auto = False
_description = "CRM Partnership Analysis"
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 39ca7a6c6eefe..20273aaf350a5 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
@@ -7,7 +7,6 @@
class CrmLeadForwardToPartner(models.TransientModel):
""" Forward info history to partners. """
- _name = 'crm.lead.forward.to.partner'
_description = 'Lead forward to partner'
@api.model
@@ -120,7 +119,6 @@ def get_lead_portal_url(self, lead):
class CrmLeadAssignation(models.TransientModel):
- _name = 'crm.lead.assignation'
_description = 'Lead Assignation'
forward_id = fields.Many2one('crm.lead.forward.to.partner', 'Partner Assignment')
diff --git a/addons/website_crm_sms/models/website_visitor.py b/addons/website_crm_sms/models/website_visitor.py
index c68325422ac88..1b390b11fd9a8 100644
--- a/addons/website_crm_sms/models/website_visitor.py
+++ b/addons/website_crm_sms/models/website_visitor.py
@@ -5,7 +5,7 @@
class WebsiteVisitor(models.Model):
- _inherit = 'website.visitor'
+ _inherit = ['website.visitor']
def _check_for_sms_composer(self):
check = super(WebsiteVisitor, self)._check_for_sms_composer()
diff --git a/addons/website_customer/models/res_partner.py b/addons/website_customer/models/res_partner.py
index 03996e30f2d0f..955904bd429b4 100644
--- a/addons/website_customer/models/res_partner.py
+++ b/addons/website_customer/models/res_partner.py
@@ -4,9 +4,9 @@
from odoo import api, fields, models
-class Partner(models.Model):
+class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
website_tag_ids = fields.Many2many(
'res.partner.tag',
@@ -21,11 +21,10 @@ def get_backend_menu_id(self):
return self.env.ref('contacts.menu_contacts').id
-class Tags(models.Model):
+class ResPartnerTag(models.Model):
- _name = 'res.partner.tag'
_description = 'Partner Tags - These tags can be used on website to find customers by sector, or ...'
- _inherit = 'website.published.mixin'
+ _inherit = ['website.published.mixin']
@api.model
def get_selection_class(self):
diff --git a/addons/website_customer/models/website.py b/addons/website_customer/models/website.py
index 8e77c57625d46..f77d5f2756a0e 100644
--- a/addons/website_customer/models/website.py
+++ b/addons/website_customer/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def get_suggested_controllers(self):
suggested_controllers = super(Website, self).get_suggested_controllers()
diff --git a/addons/website_event/models/event_event.py b/addons/website_event/models/event_event.py
index 185aaac9a66a8..934f01e505f0c 100644
--- a/addons/website_event/models/event_event.py
+++ b/addons/website_event/models/event_event.py
@@ -16,8 +16,7 @@
GOOGLE_CALENDAR_URL = 'https://www.google.com/calendar/render?'
-class Event(models.Model):
- _name = 'event.event'
+class EventEvent(models.Model):
_inherit = [
'event.event',
'website.seo.metadata',
@@ -47,7 +46,7 @@ def _default_cover_properties(self):
[('public', 'Public'), ('link', 'Via a Link'), ('logged_users', 'Logged Users')],
string="Website Visibility", required=True, default='public', tracking=True,
help="""Defines the Visibility of the Event on the Website and searches.\n
- Note that the Event is however always available via its link.""")
+ Note that the EventEvent is however always available via its link.""")
website_published = fields.Boolean(tracking=True)
website_menu = fields.Boolean(
string='Website Menu',
@@ -229,7 +228,7 @@ def _compute_time_data(self):
@api.depends('name')
def _compute_website_url(self):
- super(Event, self)._compute_website_url()
+ super()._compute_website_url()
for event in self:
if event.id: # avoid to perform a slug on a not yet saved record in case of an onchange.
event.website_url = '/event/%s' % self.env['ir.http']._slug(event)
@@ -256,7 +255,7 @@ def create(self, vals_list):
def write(self, vals):
menus_state_by_field = self._split_menus_state_by_field()
- res = super(Event, self).write(vals)
+ res = super().write(vals)
menus_update_by_field = self._get_menus_update_by_field(menus_state_by_field, force_update=vals.keys())
self._update_website_menus(menus_update_by_field=menus_update_by_field)
return res
@@ -458,7 +457,7 @@ def _track_subtype(self, init_values):
if self.is_published:
return self.env.ref('website_event.mt_event_published', raise_if_not_found=False)
return self.env.ref('website_event.mt_event_unpublished', raise_if_not_found=False)
- return super(Event, self)._track_subtype(init_values)
+ return super()._track_subtype(init_values)
def _get_external_description(self):
""" Adding the URL of the event into the description """
@@ -485,7 +484,7 @@ def _get_event_resource_urls(self):
return {'google_url': google_url, 'iCal_url': iCal_url}
def _default_website_meta(self):
- res = super(Event, self)._default_website_meta()
+ res = super()._default_website_meta()
event_cover_properties = json.loads(self.cover_properties)
# background-image might contain single quotes eg `url('/my/url')`
res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = event_cover_properties.get('background-image', 'none')[4:-1].strip("'")
diff --git a/addons/website_event/models/event_registration.py b/addons/website_event/models/event_registration.py
index 06532afa93bac..433fa41abd952 100644
--- a/addons/website_event/models/event_registration.py
+++ b/addons/website_event/models/event_registration.py
@@ -4,7 +4,7 @@
class EventRegistration(models.Model):
- _inherit = 'event.registration'
+ _inherit = ['event.registration']
visitor_id = fields.Many2one('website.visitor', string='Visitor', ondelete='set null')
diff --git a/addons/website_event/models/event_tag.py b/addons/website_event/models/event_tag.py
index 88ff1b304a173..ab69d9a7dfdad 100644
--- a/addons/website_event/models/event_tag.py
+++ b/addons/website_event/models/event_tag.py
@@ -5,7 +5,6 @@
class EventTag(models.Model):
- _name = 'event.tag'
_inherit = ['event.tag', 'website.published.multi.mixin']
def default_get(self, fields_list):
diff --git a/addons/website_event/models/event_tag_category.py b/addons/website_event/models/event_tag_category.py
index 29d059a28b3ee..a934392eaefb1 100644
--- a/addons/website_event/models/event_tag_category.py
+++ b/addons/website_event/models/event_tag_category.py
@@ -5,7 +5,6 @@
class EventTagCategory(models.Model):
- _name = 'event.tag.category'
_inherit = ['event.tag.category', 'website.published.multi.mixin']
def _default_is_published(self):
diff --git a/addons/website_event/models/event_type.py b/addons/website_event/models/event_type.py
index 9692abfa76e6d..d13d8c637a3ee 100644
--- a/addons/website_event/models/event_type.py
+++ b/addons/website_event/models/event_type.py
@@ -4,7 +4,6 @@
class EventType(models.Model):
- _name = 'event.type'
_inherit = ['event.type']
website_menu = fields.Boolean('Display a dedicated menu on Website')
diff --git a/addons/website_event/models/website.py b/addons/website_event/models/website.py
index 6f2e6fa1ca4ba..b71001f02ca61 100644
--- a/addons/website_event/models/website.py
+++ b/addons/website_event/models/website.py
@@ -3,8 +3,9 @@
from odoo import models, _
+
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def get_suggested_controllers(self):
suggested_controllers = super(Website, self).get_suggested_controllers()
diff --git a/addons/website_event/models/website_event_menu.py b/addons/website_event/models/website_event_menu.py
index 3d4b4d32a9a3d..da75b027903fc 100644
--- a/addons/website_event/models/website_event_menu.py
+++ b/addons/website_event/models/website_event_menu.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class EventMenu(models.Model):
- _name = "website.event.menu"
+class WebsiteEventMenu(models.Model):
_description = "Website Event Menu"
_rec_name = "menu_id"
@@ -21,4 +20,4 @@ class EventMenu(models.Model):
def unlink(self):
self.view_id.sudo().unlink()
- return super(EventMenu, self).unlink()
+ return super().unlink()
diff --git a/addons/website_event/models/website_menu.py b/addons/website_event/models/website_menu.py
index 00f3a90814dae..621aa70b57674 100644
--- a/addons/website_event/models/website_menu.py
+++ b/addons/website_event/models/website_menu.py
@@ -5,7 +5,7 @@
class WebsiteMenu(models.Model):
- _inherit = "website.menu"
+ _inherit = ["website.menu"]
def unlink(self):
""" Override to synchronize event configuration fields with menu deletion. """
diff --git a/addons/website_event/models/website_snippet_filter.py b/addons/website_event/models/website_snippet_filter.py
index 1a1b6215c6480..4a2f00cf4cfaa 100644
--- a/addons/website_event/models/website_snippet_filter.py
+++ b/addons/website_event/models/website_snippet_filter.py
@@ -7,7 +7,7 @@
class WebsiteSnippetFilter(models.Model):
- _inherit = 'website.snippet.filter'
+ _inherit = ['website.snippet.filter']
def _get_hardcoded_sample(self, model):
samples = super()._get_hardcoded_sample(model)
diff --git a/addons/website_event/models/website_visitor.py b/addons/website_event/models/website_visitor.py
index 2f80761b245af..40c4ed4384858 100644
--- a/addons/website_event/models/website_visitor.py
+++ b/addons/website_event/models/website_visitor.py
@@ -6,7 +6,6 @@
class WebsiteVisitor(models.Model):
- _name = 'website.visitor'
_inherit = ['website.visitor']
event_registration_ids = fields.One2many(
diff --git a/addons/website_event_booth/models/event_event.py b/addons/website_event_booth/models/event_event.py
index 510d2b86f5ac4..66bfcc76060ec 100644
--- a/addons/website_event_booth/models/event_event.py
+++ b/addons/website_event_booth/models/event_event.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models, _
-class Event(models.Model):
- _inherit = 'event.event'
+class EventEvent(models.Model):
+ _inherit = ['event.event']
exhibition_map = fields.Image(string='Exhibition Map', max_width=1024, max_height=1024)
# frontend menu management
@@ -34,21 +34,21 @@ def toggle_booth_menu(self, val):
self.booth_menu = val
def _get_menu_update_fields(self):
- return super(Event, self)._get_menu_update_fields() + ['booth_menu']
+ return super()._get_menu_update_fields() + ['booth_menu']
def _update_website_menus(self, menus_update_by_field=None):
- super(Event, self)._update_website_menus(menus_update_by_field=menus_update_by_field)
+ super()._update_website_menus(menus_update_by_field=menus_update_by_field)
for event in self:
if event.menu_id and (not menus_update_by_field or event in menus_update_by_field.get('booth_menu')):
event._update_website_menu_entry('booth_menu', 'booth_menu_ids', 'booth')
def _get_menu_type_field_matching(self):
- res = super(Event, self)._get_menu_type_field_matching()
+ res = super()._get_menu_type_field_matching()
res['booth'] = 'booth_menu'
return res
def _get_website_menu_entries(self):
self.ensure_one()
- return super(Event, self)._get_website_menu_entries() + [
+ return super()._get_website_menu_entries() + [
(_('Get A Booth'), '/event/%s/booth' % self.env['ir.http']._slug(self), False, 90, 'booth')
]
diff --git a/addons/website_event_booth/models/event_type.py b/addons/website_event_booth/models/event_type.py
index 6f7808d5d5dd8..c44a0b4e9760f 100644
--- a/addons/website_event_booth/models/event_type.py
+++ b/addons/website_event_booth/models/event_type.py
@@ -5,7 +5,7 @@
class EventType(models.Model):
- _inherit = 'event.type'
+ _inherit = ['event.type']
booth_menu = fields.Boolean(
string='Booths on Website', compute='_compute_booth_menu',
diff --git a/addons/website_event_booth/models/website_event_menu.py b/addons/website_event_booth/models/website_event_menu.py
index 384cdc78ab209..112324e4ac32f 100644
--- a/addons/website_event_booth/models/website_event_menu.py
+++ b/addons/website_event_booth/models/website_event_menu.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class EventMenu(models.Model):
- _inherit = "website.event.menu"
+class WebsiteEventMenu(models.Model):
+ _inherit = ["website.event.menu"]
menu_type = fields.Selection(
selection_add=[('booth', 'Event Booth Menus')], ondelete={'booth': 'cascade'})
diff --git a/addons/website_event_booth_exhibitor/models/event_booth.py b/addons/website_event_booth_exhibitor/models/event_booth.py
index 48bac22fe6e50..228b03a7c0f1f 100644
--- a/addons/website_event_booth_exhibitor/models/event_booth.py
+++ b/addons/website_event_booth_exhibitor/models/event_booth.py
@@ -5,7 +5,7 @@
class EventBooth(models.Model):
- _inherit = 'event.booth'
+ _inherit = ['event.booth']
use_sponsor = fields.Boolean(related='booth_category_id.use_sponsor')
sponsor_type_id = fields.Many2one(related='booth_category_id.sponsor_type_id')
diff --git a/addons/website_event_booth_exhibitor/models/event_booth_category.py b/addons/website_event_booth_exhibitor/models/event_booth_category.py
index e7e818f4d270c..3b4737ca29a08 100644
--- a/addons/website_event_booth_exhibitor/models/event_booth_category.py
+++ b/addons/website_event_booth_exhibitor/models/event_booth_category.py
@@ -5,7 +5,7 @@
class EventBoothCategory(models.Model):
- _inherit = 'event.booth.category'
+ _inherit = ['event.booth.category']
@api.model
def _get_exhibitor_type(self):
diff --git a/addons/website_event_booth_sale/models/product_product.py b/addons/website_event_booth_sale/models/product_product.py
index 44e47fe6e72ba..515b6b2c0ef07 100644
--- a/addons/website_event_booth_sale/models/product_product.py
+++ b/addons/website_event_booth_sale/models/product_product.py
@@ -3,8 +3,9 @@
from odoo import models
+
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def _is_add_to_cart_allowed(self):
# `event_booth_registration_confirm` calls `_cart_update` with specific products, allow those aswell.
diff --git a/addons/website_event_booth_sale/models/product_template.py b/addons/website_event_booth_sale/models/product_template.py
index 9f8e9ba2a6198..af5f34bc6113a 100644
--- a/addons/website_event_booth_sale/models/product_template.py
+++ b/addons/website_event_booth_sale/models/product_template.py
@@ -5,7 +5,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
@api.model
def _get_product_types_allow_zero_price(self):
diff --git a/addons/website_event_booth_sale/models/sale_order.py b/addons/website_event_booth_sale/models/sale_order.py
index 70778ae69ac4d..6ba4f2b22fb97 100644
--- a/addons/website_event_booth_sale/models/sale_order.py
+++ b/addons/website_event_booth_sale/models/sale_order.py
@@ -6,7 +6,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
def _cart_find_product_line(
self, product_id=None, line_id=None,
diff --git a/addons/website_event_booth_sale_exhibitor/models/event_booth_registration.py b/addons/website_event_booth_sale_exhibitor/models/event_booth_registration.py
index ce820f8bd950e..fab0ad0671512 100644
--- a/addons/website_event_booth_sale_exhibitor/models/event_booth_registration.py
+++ b/addons/website_event_booth_sale_exhibitor/models/event_booth_registration.py
@@ -5,7 +5,7 @@
class EventBoothRegistration(models.Model):
- _inherit = 'event.booth.registration'
+ _inherit = ['event.booth.registration']
sponsor_name = fields.Char(string='Sponsor Name')
sponsor_email = fields.Char(string='Sponsor Email')
diff --git a/addons/website_event_crm/models/event_registration.py b/addons/website_event_crm/models/event_registration.py
index 75ad9afe73070..a414a1385c3ed 100644
--- a/addons/website_event_crm/models/event_registration.py
+++ b/addons/website_event_crm/models/event_registration.py
@@ -6,7 +6,7 @@
class EventRegistration(models.Model):
- _inherit = 'event.registration'
+ _inherit = ['event.registration']
def _get_lead_description_registration(self, line_suffix=''):
"""Add the questions and answers linked to the registrations into the description of the lead."""
diff --git a/addons/website_event_exhibitor/models/event_event.py b/addons/website_event_exhibitor/models/event_event.py
index cd913c98c16fd..e5bc33898480f 100644
--- a/addons/website_event_exhibitor/models/event_event.py
+++ b/addons/website_event_exhibitor/models/event_event.py
@@ -5,7 +5,7 @@
class EventEvent(models.Model):
- _inherit = "event.event"
+ _inherit = ["event.event"]
# sponsors
sponsor_ids = fields.One2many('event.sponsor', 'event_id', 'Sponsors')
diff --git a/addons/website_event_exhibitor/models/event_sponsor.py b/addons/website_event_exhibitor/models/event_sponsor.py
index 9bfb0801487de..174c58c9f04c6 100644
--- a/addons/website_event_exhibitor/models/event_sponsor.py
+++ b/addons/website_event_exhibitor/models/event_sponsor.py
@@ -10,8 +10,7 @@
from odoo.tools.translate import html_translate
-class Sponsor(models.Model):
- _name = "event.sponsor"
+class EventSponsor(models.Model):
_description = 'Event Sponsor'
_order = "sequence, sponsor_type_id"
# _order = 'sponsor_type_id, sequence' TDE FIXME
@@ -187,7 +186,7 @@ def _compute_country_flag_url(self):
@api.depends('name', 'event_id.name')
def _compute_website_url(self):
- super(Sponsor, self)._compute_website_url()
+ super()._compute_website_url()
for sponsor in self:
if sponsor.id: # avoid to perform a slug on a not yet saved record in case of an onchange.
base_url = sponsor.event_id.get_base_url()
@@ -204,7 +203,7 @@ def create(self, values_list):
exhibitor_name = values['name'] if values.get('name') else self.env['res.partner'].browse(values['partner_id']).name
name = 'odoo-exhibitor-%s' % exhibitor_name or 'sponsor'
values['room_name'] = name
- return super(Sponsor, self).create(values_list)
+ return super().create(values_list)
def write(self, values):
toupdate = self.env['event.sponsor']
@@ -213,8 +212,8 @@ def write(self, values):
# go into sequential update in order to create a custom room name for each sponsor
for exhibitor in toupdate:
values['room_name'] = 'odoo-exhibitor-%s' % exhibitor.name
- super(Sponsor, exhibitor).write(values)
- return super(Sponsor, self - toupdate).write(values)
+ super(EventSponsor, exhibitor).write(values)
+ return super(EventSponsor, self - toupdate).write(values)
# ------------------------------------------------------------
# ACTIONS
diff --git a/addons/website_event_exhibitor/models/event_sponsor_type.py b/addons/website_event_exhibitor/models/event_sponsor_type.py
index 72f66dc4915d7..a6691ad02f39c 100644
--- a/addons/website_event_exhibitor/models/event_sponsor_type.py
+++ b/addons/website_event_exhibitor/models/event_sponsor_type.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class SponsorType(models.Model):
- _name = "event.sponsor.type"
+class EventSponsorType(models.Model):
_description = 'Event Sponsor Level'
_order = "sequence"
diff --git a/addons/website_event_exhibitor/models/event_type.py b/addons/website_event_exhibitor/models/event_type.py
index 77212a2cf7079..dbf1fa712b0ab 100644
--- a/addons/website_event_exhibitor/models/event_type.py
+++ b/addons/website_event_exhibitor/models/event_type.py
@@ -5,7 +5,7 @@
class EventType(models.Model):
- _inherit = "event.type"
+ _inherit = ["event.type"]
exhibitor_menu = fields.Boolean(
string='Showcase Exhibitors', compute='_compute_exhibitor_menu',
diff --git a/addons/website_event_exhibitor/models/website_event_menu.py b/addons/website_event_exhibitor/models/website_event_menu.py
index 5926607ef488a..a4a060556fa56 100644
--- a/addons/website_event_exhibitor/models/website_event_menu.py
+++ b/addons/website_event_exhibitor/models/website_event_menu.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class EventMenu(models.Model):
- _inherit = "website.event.menu"
+class WebsiteEventMenu(models.Model):
+ _inherit = ["website.event.menu"]
menu_type = fields.Selection(
selection_add=[('exhibitor', 'Exhibitors Menus')],
diff --git a/addons/website_event_jitsi/models/res_config_settings.py b/addons/website_event_jitsi/models/res_config_settings.py
index 389aaae00311e..6c89bbc9caeab 100644
--- a/addons/website_event_jitsi/models/res_config_settings.py
+++ b/addons/website_event_jitsi/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
jitsi_server_domain = fields.Char(
'Jitsi Server Domain',
diff --git a/addons/website_event_meet/models/event_event.py b/addons/website_event_meet/models/event_event.py
index ac343bdcb8a10..91a658a4f7806 100644
--- a/addons/website_event_meet/models/event_event.py
+++ b/addons/website_event_meet/models/event_event.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Event(models.Model):
- _inherit = "event.event"
+class EventEvent(models.Model):
+ _inherit = ["event.event"]
meeting_room_ids = fields.One2many("event.meeting.room", "event_id", string="Meeting rooms")
meeting_room_count = fields.Integer("Room count", compute="_compute_meeting_room_count")
diff --git a/addons/website_event_meet/models/event_meeting_room.py b/addons/website_event_meet/models/event_meeting_room.py
index fa96e51771c79..57cb063a7048d 100644
--- a/addons/website_event_meet/models/event_meeting_room.py
+++ b/addons/website_event_meet/models/event_meeting_room.py
@@ -7,7 +7,6 @@
class EventMeetingRoom(models.Model):
- _name = "event.meeting.room"
_description = "Event Meeting Room"
_order = "is_pinned DESC, id"
_inherit = [
diff --git a/addons/website_event_meet/models/event_type.py b/addons/website_event_meet/models/event_type.py
index 4272de467b4ae..927f85517d6a8 100644
--- a/addons/website_event_meet/models/event_type.py
+++ b/addons/website_event_meet/models/event_type.py
@@ -5,7 +5,7 @@
class EventType(models.Model):
- _inherit = "event.type"
+ _inherit = ["event.type"]
meeting_room_allow_creation = fields.Boolean(
"Allow Room Creation", compute='_compute_meeting_room_allow_creation',
diff --git a/addons/website_event_meet/models/website_event_menu.py b/addons/website_event_meet/models/website_event_menu.py
index 0902dde05f29d..8695f853448e8 100644
--- a/addons/website_event_meet/models/website_event_menu.py
+++ b/addons/website_event_meet/models/website_event_menu.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class EventMenu(models.Model):
- _inherit = "website.event.menu"
+class WebsiteEventMenu(models.Model):
+ _inherit = ["website.event.menu"]
menu_type = fields.Selection(
selection_add=[("meeting_room", "Event Meeting Room Menus")],
diff --git a/addons/website_event_sale/models/product.py b/addons/website_event_sale/models/product.py
index 9725df2f15c4d..e3c7a71fe9bef 100644
--- a/addons/website_event_sale/models/product.py
+++ b/addons/website_event_sale/models/product.py
@@ -4,8 +4,8 @@
# defined for access rules
-class Product(models.Model):
- _inherit = 'product.product'
+class ProductProduct(models.Model):
+ _inherit = ['product.product']
event_ticket_ids = fields.One2many('event.event.ticket', 'product_id', string='Event Tickets')
@@ -15,8 +15,9 @@ def _is_add_to_cart_allowed(self):
res = super()._is_add_to_cart_allowed()
return res or any(event.website_published for event in self.event_ticket_ids.event_id)
+
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
@api.model
def _get_product_types_allow_zero_price(self):
diff --git a/addons/website_event_sale/models/product_pricelist.py b/addons/website_event_sale/models/product_pricelist.py
index 9fc87725a53a4..c53d9fe4a6ef4 100644
--- a/addons/website_event_sale/models/product_pricelist.py
+++ b/addons/website_event_sale/models/product_pricelist.py
@@ -2,8 +2,9 @@
from odoo import _, api, models
-class PricelistItem(models.Model):
- _inherit = "product.pricelist.item"
+
+class ProductPricelistItem(models.Model):
+ _inherit = ["product.pricelist.item"]
@api.onchange('applied_on', 'product_id', 'product_tmpl_id', 'min_quantity')
def _onchange_event_sale_warning(self):
diff --git a/addons/website_event_sale/models/sale_order.py b/addons/website_event_sale/models/sale_order.py
index 1acdda232cf87..a29c83a974e39 100644
--- a/addons/website_event_sale/models/sale_order.py
+++ b/addons/website_event_sale/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = "sale.order"
+ _inherit = ["sale.order"]
def _cart_find_product_line(self, product_id=None, line_id=None, event_ticket_id=False, **kwargs):
lines = super()._cart_find_product_line(product_id, line_id, **kwargs)
@@ -95,7 +95,7 @@ def _update_cart_line_values(self, order_line, update_values):
class SaleOrderLine(models.Model):
- _inherit = "sale.order.line"
+ _inherit = ["sale.order.line"]
@api.depends('product_id.display_name', 'event_ticket_id.display_name')
def _compute_name_short(self):
diff --git a/addons/website_event_sale/report/event_sale_report.py b/addons/website_event_sale/report/event_sale_report.py
index 6efd239b8ad36..feb8078d28cea 100644
--- a/addons/website_event_sale/report/event_sale_report.py
+++ b/addons/website_event_sale/report/event_sale_report.py
@@ -5,7 +5,7 @@
class EventSaleReport(models.Model):
- _inherit = 'event.sale.report'
+ _inherit = ['event.sale.report']
is_published = fields.Boolean('Published Events', readonly=True)
diff --git a/addons/website_event_track/models/event_event.py b/addons/website_event_track/models/event_event.py
index 7634cd5a6c9e3..3a5d1d5daa4ee 100644
--- a/addons/website_event_track/models/event_event.py
+++ b/addons/website_event_track/models/event_event.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models, _
-class Event(models.Model):
- _inherit = "event.event"
+class EventEvent(models.Model):
+ _inherit = ["event.event"]
track_ids = fields.One2many('event.track', 'event_id', 'Tracks')
track_count = fields.Integer('Track Count', compute='_compute_track_count')
@@ -66,10 +66,10 @@ def toggle_website_track_proposal(self, val):
self.website_track_proposal = val
def _get_menu_update_fields(self):
- return super(Event, self)._get_menu_update_fields() + ['website_track', 'website_track_proposal']
+ return super()._get_menu_update_fields() + ['website_track', 'website_track_proposal']
def _update_website_menus(self, menus_update_by_field=None):
- super(Event, self)._update_website_menus(menus_update_by_field=menus_update_by_field)
+ super()._update_website_menus(menus_update_by_field=menus_update_by_field)
for event in self:
if event.menu_id and (not menus_update_by_field or event in menus_update_by_field.get('website_track')):
event._update_website_menu_entry('website_track', 'track_menu_ids', 'track')
@@ -77,13 +77,13 @@ def _update_website_menus(self, menus_update_by_field=None):
event._update_website_menu_entry('website_track_proposal', 'track_proposal_menu_ids', 'track_proposal')
def _get_menu_type_field_matching(self):
- res = super(Event, self)._get_menu_type_field_matching()
+ res = super()._get_menu_type_field_matching()
res['track_proposal'] = 'website_track_proposal'
return res
def _get_website_menu_entries(self):
self.ensure_one()
- return super(Event, self)._get_website_menu_entries() + [
+ return super()._get_website_menu_entries() + [
(_('Talks'), '/event/%s/track' % self.env['ir.http']._slug(self), False, 10, 'track'),
(_('Agenda'), '/event/%s/agenda' % self.env['ir.http']._slug(self), False, 70, 'track'),
(_('Talk Proposals'), '/event/%s/track_proposal' % self.env['ir.http']._slug(self), False, 15, 'track_proposal')
diff --git a/addons/website_event_track/models/event_track.py b/addons/website_event_track/models/event_track.py
index b5bd522e6be50..eb6f4bd8b9260 100644
--- a/addons/website_event_track/models/event_track.py
+++ b/addons/website_event_track/models/event_track.py
@@ -11,8 +11,7 @@
from odoo.tools.translate import _, html_translate
-class Track(models.Model):
- _name = "event.track"
+class EventTrack(models.Model):
_description = 'Event Track'
_order = 'priority, date'
_inherit = ['mail.thread', 'mail.activity.mixin', 'website.seo.metadata', 'website.published.mixin']
@@ -152,7 +151,7 @@ def _get_default_stage_id(self):
@api.depends('name')
def _compute_website_url(self):
- super(Track, self)._compute_website_url()
+ super()._compute_website_url()
for track in self:
if track.id:
track.website_url = '/event/%s/track/%s' % (self.env['ir.http']._slug(track.event_id), self.env['ir.http']._slug(track))
@@ -397,7 +396,7 @@ def create(self, vals_list):
if values.get('website_cta_url'):
values['website_cta_url'] = self.env['res.partner']._clean_website(values['website_cta_url'])
- tracks = super(Track, self).create(vals_list)
+ tracks = super().create(vals_list)
post_values = {} if self.env.user.email else {'email_from': self.env.company.catchall_formatted}
for track in tracks:
@@ -422,7 +421,7 @@ def write(self, vals):
if vals.get('stage_id'):
stage = self.env['event.track.stage'].browse(vals['stage_id'])
self._synchronize_with_stage(stage)
- res = super(Track, self).write(vals)
+ res = super().write(vals)
return res
def _synchronize_with_stage(self, stage):
@@ -478,10 +477,10 @@ def _message_post_after_hook(self, message, msg_vals):
self.search([
('partner_id', '=', False), email_domain, ('stage_id.is_cancel', '=', False),
]).write({'partner_id': new_partner[0].id})
- return super(Track, self)._message_post_after_hook(message, msg_vals)
+ return super()._message_post_after_hook(message, msg_vals)
def _track_template(self, changes):
- res = super(Track, self)._track_template(changes)
+ res = super()._track_template(changes)
track = self[0]
if 'stage_id' in changes and track.stage_id.mail_template_id:
res['stage_id'] = (track.stage_id.mail_template_id, {
@@ -498,7 +497,7 @@ def _track_subtype(self, init_values):
return self.env.ref('website_event_track.mt_track_blocked')
elif 'kanban_state' in init_values and self.kanban_state == 'done':
return self.env.ref('website_event_track.mt_track_ready')
- return super(Track, self)._track_subtype(init_values)
+ return super()._track_subtype(init_values)
# ------------------------------------------------------------
# ACTION
diff --git a/addons/website_event_track/models/event_track_location.py b/addons/website_event_track/models/event_track_location.py
index d97231e6336b1..0277e15c8346f 100644
--- a/addons/website_event_track/models/event_track_location.py
+++ b/addons/website_event_track/models/event_track_location.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class TrackLocation(models.Model):
- _name = "event.track.location"
+class EventTrackLocation(models.Model):
_description = 'Event Track Location'
_order = 'sequence, id'
diff --git a/addons/website_event_track/models/event_track_stage.py b/addons/website_event_track/models/event_track_stage.py
index 5d0e03ecad109..8f0e850a1c887 100644
--- a/addons/website_event_track/models/event_track_stage.py
+++ b/addons/website_event_track/models/event_track_stage.py
@@ -4,8 +4,7 @@
from odoo import api, fields, models
-class TrackStage(models.Model):
- _name = 'event.track.stage'
+class EventTrackStage(models.Model):
_description = 'Event Track Stage'
_order = 'sequence, id'
diff --git a/addons/website_event_track/models/event_track_tag.py b/addons/website_event_track/models/event_track_tag.py
index 5358cff2082a2..5ba5ca6302fff 100644
--- a/addons/website_event_track/models/event_track_tag.py
+++ b/addons/website_event_track/models/event_track_tag.py
@@ -6,8 +6,7 @@
from odoo import fields, models
-class TrackTag(models.Model):
- _name = "event.track.tag"
+class EventTrackTag(models.Model):
_description = 'Event Track Tag'
_order = "category_id, sequence, name"
diff --git a/addons/website_event_track/models/event_track_tag_category.py b/addons/website_event_track/models/event_track_tag_category.py
index 05f14e7abed78..80ffbab828041 100644
--- a/addons/website_event_track/models/event_track_tag_category.py
+++ b/addons/website_event_track/models/event_track_tag_category.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class TrackTagCategory(models.Model):
- _name = "event.track.tag.category"
+class EventTrackTagCategory(models.Model):
_description = 'Event Track Tag Category'
_order = "sequence"
diff --git a/addons/website_event_track/models/event_track_visitor.py b/addons/website_event_track/models/event_track_visitor.py
index f08a12cfa21a0..04c918055d5ea 100644
--- a/addons/website_event_track/models/event_track_visitor.py
+++ b/addons/website_event_track/models/event_track_visitor.py
@@ -4,9 +4,8 @@
from odoo import api, fields, models
-class TrackVisitor(models.Model):
+class EventTrackVisitor(models.Model):
""" Table linking track and visitors. """
- _name = 'event.track.visitor'
_description = 'Track / Visitor Link'
_table = 'event_track_visitor'
_rec_name = 'track_id'
diff --git a/addons/website_event_track/models/event_type.py b/addons/website_event_track/models/event_type.py
index 7226017e07bed..55943b0b3cd16 100644
--- a/addons/website_event_track/models/event_type.py
+++ b/addons/website_event_track/models/event_type.py
@@ -5,7 +5,7 @@
class EventType(models.Model):
- _inherit = 'event.type'
+ _inherit = ['event.type']
website_track = fields.Boolean(
string='Tracks on Website', compute='_compute_website_track_menu_data',
diff --git a/addons/website_event_track/models/res_config_settings.py b/addons/website_event_track/models/res_config_settings.py
index 8d87e90d9ff26..aeffc3670e621 100644
--- a/addons/website_event_track/models/res_config_settings.py
+++ b/addons/website_event_track/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
events_app_name = fields.Char('Events App Name', related='website_id.events_app_name', readonly=False)
diff --git a/addons/website_event_track/models/website.py b/addons/website_event_track/models/website.py
index 84c3de22b5f1d..ac974a8ece428 100644
--- a/addons/website_event_track/models/website.py
+++ b/addons/website_event_track/models/website.py
@@ -11,7 +11,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
app_icon = fields.Image(
string='Website App Icon',
diff --git a/addons/website_event_track/models/website_event_menu.py b/addons/website_event_track/models/website_event_menu.py
index 70561b0a28ab1..21cbbf5fbe11e 100644
--- a/addons/website_event_track/models/website_event_menu.py
+++ b/addons/website_event_track/models/website_event_menu.py
@@ -4,8 +4,8 @@
from odoo import fields, models
-class EventMenu(models.Model):
- _inherit = "website.event.menu"
+class WebsiteEventMenu(models.Model):
+ _inherit = ["website.event.menu"]
menu_type = fields.Selection(
selection_add=[('track', 'Event Tracks Menus'), ('track_proposal', 'Event Proposals Menus')],
diff --git a/addons/website_event_track/models/website_menu.py b/addons/website_event_track/models/website_menu.py
index 703c3afbe8dd6..08cb68921eef9 100644
--- a/addons/website_event_track/models/website_menu.py
+++ b/addons/website_event_track/models/website_menu.py
@@ -5,7 +5,7 @@
class WebsiteMenu(models.Model):
- _inherit = "website.menu"
+ _inherit = ["website.menu"]
def unlink(self):
""" Override to synchronize event configuration fields with menu deletion.
diff --git a/addons/website_event_track/models/website_visitor.py b/addons/website_event_track/models/website_visitor.py
index 542b936cc5a81..cbf147556ba71 100644
--- a/addons/website_event_track/models/website_visitor.py
+++ b/addons/website_event_track/models/website_visitor.py
@@ -6,7 +6,6 @@
class WebsiteVisitor(models.Model):
- _name = 'website.visitor'
_inherit = ['website.visitor']
event_track_visitor_ids = fields.One2many(
diff --git a/addons/website_event_track_live/models/event_track.py b/addons/website_event_track_live/models/event_track.py
index 4bbb16cd74694..4ecf289c25a3e 100644
--- a/addons/website_event_track_live/models/event_track.py
+++ b/addons/website_event_track_live/models/event_track.py
@@ -6,8 +6,8 @@
from odoo import api, fields, models
-class Track(models.Model):
- _inherit = 'event.track'
+class EventTrack(models.Model):
+ _inherit = ['event.track']
youtube_video_url = fields.Char('YouTube Video Link')
youtube_video_id = fields.Char('YouTube video ID', compute='_compute_youtube_video_id',
@@ -31,7 +31,7 @@ def _compute_youtube_video_id(self):
@api.depends('youtube_video_id', 'is_youtube_replay', 'date_end', 'is_track_done')
def _compute_website_image_url(self):
youtube_thumbnail_tracks = self.filtered(lambda track: not track.website_image and track.youtube_video_id)
- super(Track, self - youtube_thumbnail_tracks)._compute_website_image_url()
+ super(EventTrack, self - youtube_thumbnail_tracks)._compute_website_image_url()
for track in youtube_thumbnail_tracks:
track.website_image_url = f'https://img.youtube.com/vi/{track.youtube_video_id}/maxresdefault.jpg'
diff --git a/addons/website_event_track_quiz/models/event_event.py b/addons/website_event_track_quiz/models/event_event.py
index 9ef2a289c082a..40fd593d87c02 100644
--- a/addons/website_event_track_quiz/models/event_event.py
+++ b/addons/website_event_track_quiz/models/event_event.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Event(models.Model):
- _inherit = "event.event"
+class EventEvent(models.Model):
+ _inherit = ["event.event"]
@api.depends("event_type_id", "website_menu", "community_menu")
def _compute_community_menu(self):
diff --git a/addons/website_event_track_quiz/models/event_quiz.py b/addons/website_event_track_quiz/models/event_quiz.py
index c5784f09a7ba2..9d73dc184e08d 100644
--- a/addons/website_event_track_quiz/models/event_quiz.py
+++ b/addons/website_event_track_quiz/models/event_quiz.py
@@ -5,8 +5,7 @@
from odoo.exceptions import ValidationError
-class Quiz(models.Model):
- _name = "event.quiz"
+class EventQuiz(models.Model):
_description = "Quiz"
name = fields.Char('Name', required=True, translate=True)
@@ -19,8 +18,7 @@ class Quiz(models.Model):
help='Let attendees reset the quiz and try again.')
-class QuizQuestion(models.Model):
- _name = "event.quiz.question"
+class EventQuizQuestion(models.Model):
_description = "Content Quiz Question"
_order = "quiz_id, sequence, id"
@@ -50,8 +48,7 @@ def _check_answers_integrity(self):
raise ValidationError(_('Question "%s" must have 1 correct answer and at least 1 incorrect answer to be valid.', question.name))
-class QuizAnswer(models.Model):
- _name = "event.quiz.answer"
+class EventQuizAnswer(models.Model):
_rec_name = "text_value"
_description = "Question's Answer"
_order = 'question_id, sequence, id'
diff --git a/addons/website_event_track_quiz/models/event_track_visitor.py b/addons/website_event_track_quiz/models/event_track_visitor.py
index 73376504dfe1d..eb7d7189a6dfd 100644
--- a/addons/website_event_track_quiz/models/event_track_visitor.py
+++ b/addons/website_event_track_quiz/models/event_track_visitor.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class TrackVisitor(models.Model):
- _name = 'event.track.visitor'
+class EventTrackVisitor(models.Model):
_inherit = ['event.track.visitor']
quiz_completed = fields.Boolean('Completed')
diff --git a/addons/website_forum/models/forum_forum.py b/addons/website_forum/models/forum_forum.py
index 85212ab4428bb..a53cbb65336ef 100644
--- a/addons/website_forum/models/forum_forum.py
+++ b/addons/website_forum/models/forum_forum.py
@@ -13,8 +13,7 @@
MOST_USED_TAGS_COUNT = 5 # Number of tags to track as "most used" to display on frontend
-class Forum(models.Model):
- _name = 'forum.forum'
+class ForumForum(models.Model):
_description = 'Forum'
_inherit = [
'mail.thread',
@@ -251,7 +250,7 @@ def _compute_website_url(self):
@api.model_create_multi
def create(self, vals_list):
forums = super(
- Forum,
+ ForumForum,
self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True)
).create(vals_list)
self.env['website'].sudo()._update_forum_count()
diff --git a/addons/website_forum/models/forum_post.py b/addons/website_forum/models/forum_post.py
index 17bee1589db4a..1898a7c792dc1 100644
--- a/addons/website_forum/models/forum_post.py
+++ b/addons/website_forum/models/forum_post.py
@@ -15,8 +15,7 @@
_logger = logging.getLogger(__name__)
-class Post(models.Model):
- _name = 'forum.post'
+class ForumPost(models.Model):
_description = 'Forum Post'
_inherit = [
'mail.thread',
@@ -298,7 +297,7 @@ def _search_can_view(self, operator, value):
# EXTENDS WEBSITE.SEO.METADATA
def _default_website_meta(self):
- res = super(Post, self)._default_website_meta()
+ res = super()._default_website_meta()
res['default_opengraph']['og:title'] = res['default_twitter']['twitter:title'] = self.name
res['default_opengraph']['og:description'] = res['default_twitter']['twitter:description'] = self.plain_content
res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = self.env['website'].image_url(self.create_uid, 'image_1024')
@@ -316,7 +315,7 @@ def create(self, vals_list):
if 'content' in vals and vals.get('forum_id'):
vals['content'] = self._update_content(vals['content'], vals['forum_id'])
- posts = super(Post, self.with_context(mail_create_nolog=True)).create(vals_list)
+ posts = super(ForumPost, self.with_context(mail_create_nolog=True)).create(vals_list)
for post in posts:
# deleted or closed questions
@@ -342,7 +341,7 @@ def unlink(self):
if post.is_correct:
post.create_uid.sudo()._add_karma(post.forum_id.karma_gen_answer_accepted * -1, post, _('The accepted answer is deleted'))
self.env.user.sudo()._add_karma(post.forum_id.karma_gen_answer_accepted * -1, post, _('Delete the accepted answer'))
- return super(Post, self).unlink()
+ return super().unlink()
def write(self, vals):
trusted_keys = ['active', 'is_correct', 'tag_ids'] # fields where security is checked manually
@@ -385,7 +384,7 @@ def write(self, vals):
if any(key not in trusted_keys for key in vals) and not post.can_edit:
raise AccessError(_('%d karma required to edit a post.', post.karma_edit))
- res = super(Post, self).write(vals)
+ res = super().write(vals)
# if post content modify, notify followers
if 'content' in vals or 'name' in vals:
@@ -407,7 +406,7 @@ def _get_access_action(self, access_uid=None, force_website=False):
""" Instead of the classic form view, redirect to the post on the website directly """
self.ensure_one()
if not force_website and not self.state == 'active':
- return super(Post, self)._get_access_action(access_uid=access_uid, force_website=force_website)
+ return super()._get_access_action(access_uid=access_uid, force_website=force_website)
return {
'type': 'ir.actions.act_url',
'url': '/forum/%s/%s' % (self.forum_id.id, self.id),
@@ -736,7 +735,7 @@ def _get_mail_message_access(self, res_ids, operation, model_name=None):
for post in self.browse(res_ids):
if not post.can_edit:
raise AccessError(_('%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)
+ return super()._get_mail_message_access(res_ids, operation, model_name=model_name)
def _notify_get_recipients_groups(self, message, model_description, msg_vals=None):
""" Add access button to everyone if the document is active. """
@@ -773,7 +772,7 @@ def message_post(self, *, message_type='notification', **kwargs):
raise AccessError(_('%d karma required to comment.', self.karma_comment))
if not kwargs.get('record_name') and self.parent_id:
kwargs['record_name'] = self.parent_id.name
- return super(Post, self).message_post(message_type=message_type, **kwargs)
+ return super().message_post(message_type=message_type, **kwargs)
def _notify_thread_by_inbox(self, message, recipients_data, msg_vals=False, **kwargs):
""" Override to avoid keeping all notified recipients of a comment.
@@ -783,7 +782,7 @@ def _notify_thread_by_inbox(self, message, recipients_data, msg_vals=False, **kw
msg_vals = {}
if msg_vals.get('message_type', message.message_type) == 'comment':
return
- return super(Post, self)._notify_thread_by_inbox(message, recipients_data, msg_vals=msg_vals, **kwargs)
+ return super()._notify_thread_by_inbox(message, recipients_data, msg_vals=msg_vals, **kwargs)
# ----------------------------------------------------------------------
# WEBSITE
diff --git a/addons/website_forum/models/forum_post_reason.py b/addons/website_forum/models/forum_post_reason.py
index caaf9e2c32967..9f1e2c9c5c8e2 100644
--- a/addons/website_forum/models/forum_post_reason.py
+++ b/addons/website_forum/models/forum_post_reason.py
@@ -4,8 +4,7 @@
from odoo import fields, models
-class PostReason(models.Model):
- _name = "forum.post.reason"
+class ForumPostReason(models.Model):
_description = "Post Closing Reason"
_order = 'name'
diff --git a/addons/website_forum/models/forum_post_vote.py b/addons/website_forum/models/forum_post_vote.py
index 610a8d6f5f241..d8234cef9f813 100644
--- a/addons/website_forum/models/forum_post_vote.py
+++ b/addons/website_forum/models/forum_post_vote.py
@@ -5,8 +5,7 @@
from odoo.exceptions import UserError, AccessError
-class Vote(models.Model):
- _name = 'forum.post.vote'
+class ForumPostVote(models.Model):
_description = 'Post Vote'
_order = 'create_date desc, id desc'
@@ -46,7 +45,7 @@ def create(self, vals_list):
for vals in vals_list:
vals.pop('user_id', None)
- votes = super(Vote, self).create(vals_list)
+ votes = super().create(vals_list)
for vote in votes:
vote._check_general_rights()
@@ -71,7 +70,7 @@ def write(self, values):
# karma update
vote._vote_update_karma(vote.vote, vote_value)
- res = super(Vote, self).write(values)
+ res = super().write(values)
return res
def _check_general_rights(self, vals=None):
diff --git a/addons/website_forum/models/forum_tag.py b/addons/website_forum/models/forum_tag.py
index 6e171a1b3d0cf..6ae38e8dab421 100644
--- a/addons/website_forum/models/forum_tag.py
+++ b/addons/website_forum/models/forum_tag.py
@@ -5,8 +5,7 @@
from odoo.exceptions import AccessError
-class Tags(models.Model):
- _name = "forum.tag"
+class ForumTag(models.Model):
_description = "Forum Tag"
_inherit = [
'mail.thread',
@@ -42,7 +41,7 @@ def create(self, vals_list):
forum = self.env['forum.forum'].browse(vals.get('forum_id'))
if self.env.user.karma < forum.karma_tag_create and not self.env.is_admin():
raise AccessError(_('%d karma required to create a new Tag.', forum.karma_tag_create))
- return super(Tags, self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True)).create(vals_list)
+ return super(ForumTag, self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True)).create(vals_list)
# ----------------------------------------------------------------------
# WEBSITE
diff --git a/addons/website_forum/models/gamification_challenge.py b/addons/website_forum/models/gamification_challenge.py
index 1f7d758ea3eda..18bde3fffd92e 100644
--- a/addons/website_forum/models/gamification_challenge.py
+++ b/addons/website_forum/models/gamification_challenge.py
@@ -4,8 +4,8 @@
from odoo import models, fields
-class Challenge(models.Model):
- _inherit = 'gamification.challenge'
+class GamificationChallenge(models.Model):
+ _inherit = ['gamification.challenge']
challenge_category = fields.Selection(selection_add=[
('forum', 'Website / Forum')
diff --git a/addons/website_forum/models/gamification_karma_tracking.py b/addons/website_forum/models/gamification_karma_tracking.py
index 86b309e720ec0..924bee31454b9 100644
--- a/addons/website_forum/models/gamification_karma_tracking.py
+++ b/addons/website_forum/models/gamification_karma_tracking.py
@@ -4,8 +4,8 @@
from odoo import models
-class KarmaTracking(models.Model):
- _inherit = 'gamification.karma.tracking'
+class GamificationKarmaTracking(models.Model):
+ _inherit = ['gamification.karma.tracking']
def _get_origin_selection_values(self):
return super()._get_origin_selection_values() + [('forum.post', self.env['ir.model']._get('forum.post').display_name)]
diff --git a/addons/website_forum/models/ir_attachment.py b/addons/website_forum/models/ir_attachment.py
index 6ba7e4a3dd16b..725c310bb21e0 100644
--- a/addons/website_forum/models/ir_attachment.py
+++ b/addons/website_forum/models/ir_attachment.py
@@ -4,9 +4,9 @@
from odoo import models
-class Attachment(models.Model):
+class IrAttachment(models.Model):
- _inherit = "ir.attachment"
+ _inherit = ["ir.attachment"]
def _can_bypass_rights_on_media_dialog(self, **attachment_data):
# Bypass the attachment create ACL and let the user create the image
diff --git a/addons/website_forum/models/res_users.py b/addons/website_forum/models/res_users.py
index b246e85f31dad..b64ae744fcce2 100644
--- a/addons/website_forum/models/res_users.py
+++ b/addons/website_forum/models/res_users.py
@@ -4,8 +4,8 @@
from odoo import _, fields, models
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
create_date = fields.Datetime('Create Date', readonly=True, index=True)
diff --git a/addons/website_forum/models/website.py b/addons/website_forum/models/website.py
index 2e098303381a6..656742cea2c45 100644
--- a/addons/website_forum/models/website.py
+++ b/addons/website_forum/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
forum_count = fields.Integer(readonly=True, default=0)
diff --git a/addons/website_hr_recruitment/models/hr_applicant.py b/addons/website_hr_recruitment/models/hr_applicant.py
index 763575c67e85c..42519883a2a63 100644
--- a/addons/website_hr_recruitment/models/hr_applicant.py
+++ b/addons/website_hr_recruitment/models/hr_applicant.py
@@ -5,9 +5,9 @@
from odoo.exceptions import UserError
-class Applicant(models.Model):
+class HrApplicant(models.Model):
- _inherit = 'hr.applicant'
+ _inherit = ['hr.applicant']
def website_form_input_filter(self, request, values):
if 'partner_name' in values:
diff --git a/addons/website_hr_recruitment/models/hr_department.py b/addons/website_hr_recruitment/models/hr_department.py
index 2483007822759..23cdc036cf249 100644
--- a/addons/website_hr_recruitment/models/hr_department.py
+++ b/addons/website_hr_recruitment/models/hr_department.py
@@ -4,8 +4,8 @@
from odoo import models, fields
-class Department(models.Model):
- _inherit = 'hr.department'
+class HrDepartment(models.Model):
+ _inherit = ['hr.department']
# Get department name using superuser, because model is not accessible for portal users
display_name = fields.Char(compute='_compute_display_name', search='_search_display_name', compute_sudo=True)
diff --git a/addons/website_hr_recruitment/models/hr_job.py b/addons/website_hr_recruitment/models/hr_job.py
index ca2d4abe03a7e..0202680f8f78d 100644
--- a/addons/website_hr_recruitment/models/hr_job.py
+++ b/addons/website_hr_recruitment/models/hr_job.py
@@ -7,8 +7,7 @@
from odoo.tools.translate import html_translate
-class Job(models.Model):
- _name = 'hr.job'
+class HrJob(models.Model):
_inherit = [
'hr.job',
'website.seo.metadata',
@@ -69,13 +68,13 @@ def _onchange_website_published(self):
self.is_published = False
def _compute_website_url(self):
- super(Job, self)._compute_website_url()
+ super()._compute_website_url()
for job in self:
job.website_url = f'/jobs/{self.env["ir.http"]._slug(job)}'
def set_open(self):
self.write({'website_published': False})
- return super(Job, self).set_open()
+ return super().set_open()
def get_backend_menu_id(self):
return self.env.ref('hr_recruitment.menu_hr_recruitment_root').id
diff --git a/addons/website_hr_recruitment/models/hr_recruitment_source.py b/addons/website_hr_recruitment/models/hr_recruitment_source.py
index 17fd659baaa96..d2241f0bcfc18 100644
--- a/addons/website_hr_recruitment/models/hr_recruitment_source.py
+++ b/addons/website_hr_recruitment/models/hr_recruitment_source.py
@@ -6,8 +6,8 @@
from odoo import api, fields, models
-class RecruitmentSource(models.Model):
- _inherit = 'hr.recruitment.source'
+class HrRecruitmentSource(models.Model):
+ _inherit = ['hr.recruitment.source']
url = fields.Char(compute='_compute_url', string='Tracker URL')
diff --git a/addons/website_hr_recruitment/models/website.py b/addons/website_hr_recruitment/models/website.py
index e96a6cc419b8c..c2f299447c091 100644
--- a/addons/website_hr_recruitment/models/website.py
+++ b/addons/website_hr_recruitment/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def get_suggested_controllers(self):
suggested_controllers = super(Website, self).get_suggested_controllers()
diff --git a/addons/website_jitsi/models/chat_room.py b/addons/website_jitsi/models/chat_room.py
index 1f7383bc1dd22..46c25a210d2fa 100644
--- a/addons/website_jitsi/models/chat_room.py
+++ b/addons/website_jitsi/models/chat_room.py
@@ -16,7 +16,6 @@ class ChatRoom(models.Model):
The participant count is automatically updated thanks to the chat room widget
to avoid having a costly computed field with a members model.
"""
- _name = "chat.room"
_description = "Chat Room"
def _default_name(self, objname='room'):
diff --git a/addons/website_jitsi/models/chat_room_mixin.py b/addons/website_jitsi/models/chat_room_mixin.py
index 81af141ed9879..8a62716a9a3b2 100644
--- a/addons/website_jitsi/models/chat_room_mixin.py
+++ b/addons/website_jitsi/models/chat_room_mixin.py
@@ -6,6 +6,7 @@
from odoo import api, fields, models
from odoo.tools import remove_accents
+
class ChatRoomMixin(models.AbstractModel):
"""Add the chat room configuration (`chat.room`) on the needed models.
@@ -13,7 +14,6 @@ class ChatRoomMixin(models.AbstractModel):
all the chat room logic at the same place, for all models.
Embed chat room related fields prefixed with `room_`.
"""
- _name = "chat.room.mixin"
_description = "Chat Room Mixin"
ROOM_CONFIG_FIELDS = [
('room_name', 'name'),
diff --git a/addons/website_livechat/models/chatbot_script.py b/addons/website_livechat/models/chatbot_script.py
index 5a31bdd7f36b4..926f8ff1d9583 100644
--- a/addons/website_livechat/models/chatbot_script.py
+++ b/addons/website_livechat/models/chatbot_script.py
@@ -5,7 +5,7 @@
class ChatbotScript(models.Model):
- _inherit = 'chatbot.script'
+ _inherit = ['chatbot.script']
def action_test_script(self):
self.ensure_one()
diff --git a/addons/website_livechat/models/chatbot_script_step.py b/addons/website_livechat/models/chatbot_script_step.py
index f5542c2757192..090456840d046 100644
--- a/addons/website_livechat/models/chatbot_script_step.py
+++ b/addons/website_livechat/models/chatbot_script_step.py
@@ -5,7 +5,7 @@
class ChatbotScriptStep(models.Model):
- _inherit = 'chatbot.script.step'
+ _inherit = ['chatbot.script.step']
def _chatbot_prepare_customer_values(self, discuss_channel, create_partner=True, update_partner=True):
values = super()._chatbot_prepare_customer_values(discuss_channel, create_partner, update_partner)
diff --git a/addons/website_livechat/models/discuss_channel.py b/addons/website_livechat/models/discuss_channel.py
index 7872a90a5bb68..e66f9488b2b66 100644
--- a/addons/website_livechat/models/discuss_channel.py
+++ b/addons/website_livechat/models/discuss_channel.py
@@ -6,7 +6,7 @@
class DiscussChannel(models.Model):
- _inherit = 'discuss.channel'
+ _inherit = ['discuss.channel']
livechat_visitor_id = fields.Many2one('website.visitor', string='Visitor', index='btree_not_null')
diff --git a/addons/website_livechat/models/im_livechat.py b/addons/website_livechat/models/im_livechat.py
index fd42efd3066bb..7ea4685700027 100644
--- a/addons/website_livechat/models/im_livechat.py
+++ b/addons/website_livechat/models/im_livechat.py
@@ -5,13 +5,12 @@
from odoo.tools.translate import html_translate
-class ImLivechatChannel(models.Model):
+class Im_LivechatChannel(models.Model):
- _name = 'im_livechat.channel'
_inherit = ['im_livechat.channel', 'website.published.mixin']
def _compute_website_url(self):
- super(ImLivechatChannel, self)._compute_website_url()
+ super()._compute_website_url()
for channel in self:
channel.website_url = "/livechat/channel/%s" % (self.env['ir.http']._slug(channel),)
diff --git a/addons/website_livechat/models/im_livechat_channel.py b/addons/website_livechat/models/im_livechat_channel.py
index 41ed42ecdb820..a8a11b45b8759 100644
--- a/addons/website_livechat/models/im_livechat_channel.py
+++ b/addons/website_livechat/models/im_livechat_channel.py
@@ -4,11 +4,11 @@
from odoo import models, _
-class ImLivechatChannel(models.Model):
- _inherit = 'im_livechat.channel'
+class Im_LivechatChannel(models.Model):
+ _inherit = ['im_livechat.channel']
def _get_livechat_discuss_channel_vals(self, anonymous_name, previous_operator_id=None, chatbot_script=None, user_id=None, country_id=None, lang=None):
- discuss_channel_vals = super(ImLivechatChannel, self)._get_livechat_discuss_channel_vals(
+ discuss_channel_vals = super()._get_livechat_discuss_channel_vals(
anonymous_name, previous_operator_id, chatbot_script, user_id=user_id, country_id=country_id, lang=lang
)
if not discuss_channel_vals:
diff --git a/addons/website_livechat/models/ir_http.py b/addons/website_livechat/models/ir_http.py
index 20f54548c968a..303cd6081425b 100644
--- a/addons/website_livechat/models/ir_http.py
+++ b/addons/website_livechat/models/ir_http.py
@@ -5,7 +5,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _get_translation_frontend_modules_name(cls):
diff --git a/addons/website_livechat/models/res_config_settings.py b/addons/website_livechat/models/res_config_settings.py
index 9c47f28b83ec1..8344f1f24859d 100644
--- a/addons/website_livechat/models/res_config_settings.py
+++ b/addons/website_livechat/models/res_config_settings.py
@@ -5,6 +5,6 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
channel_id = fields.Many2one('im_livechat.channel', string='Website Live Channel', related='website_id.channel_id', readonly=False)
diff --git a/addons/website_livechat/models/website.py b/addons/website_livechat/models/website.py
index af50279305953..73121e74a78c5 100644
--- a/addons/website_livechat/models/website.py
+++ b/addons/website_livechat/models/website.py
@@ -7,7 +7,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
channel_id = fields.Many2one('im_livechat.channel', string='Website Live Chat Channel')
diff --git a/addons/website_livechat/models/website_visitor.py b/addons/website_livechat/models/website_visitor.py
index d05d784211e11..1d2129bd8cdd2 100644
--- a/addons/website_livechat/models/website_visitor.py
+++ b/addons/website_livechat/models/website_visitor.py
@@ -9,7 +9,7 @@
class WebsiteVisitor(models.Model):
- _inherit = 'website.visitor'
+ _inherit = ['website.visitor']
livechat_operator_id = fields.Many2one('res.partner', compute='_compute_livechat_operator_id', store=True, string='Speaking with', index='btree_not_null')
livechat_operator_name = fields.Char('Operator Name', related="livechat_operator_id.name")
diff --git a/addons/website_mail/models/update.py b/addons/website_mail/models/update.py
index 5367cb7df9342..4d32431c303ba 100644
--- a/addons/website_mail/models/update.py
+++ b/addons/website_mail/models/update.py
@@ -4,11 +4,11 @@
from odoo import api, models
-class PublisherWarrantyContract(models.AbstractModel):
- _inherit = "publisher_warranty.contract"
+class Publisher_WarrantyContract(models.AbstractModel):
+ _inherit = ["publisher_warranty.contract"]
@api.model
def _get_message(self):
- msg = super(PublisherWarrantyContract, self)._get_message()
+ msg = super()._get_message()
msg['website'] = True
return msg
diff --git a/addons/website_mail_group/models/mail_group.py b/addons/website_mail_group/models/mail_group.py
index 782c897cbf201..8b3101b2facfe 100644
--- a/addons/website_mail_group/models/mail_group.py
+++ b/addons/website_mail_group/models/mail_group.py
@@ -5,8 +5,7 @@
class MailGroup(models.Model):
- _name = 'mail.group'
- _inherit = 'mail.group'
+ _inherit = ['mail.group']
def action_go_to_website(self):
self.ensure_one()
diff --git a/addons/website_mass_mailing/models/res_company.py b/addons/website_mass_mailing/models/res_company.py
index 91f7ef2cc161c..2973eaff54e91 100644
--- a/addons/website_mass_mailing/models/res_company.py
+++ b/addons/website_mass_mailing/models/res_company.py
@@ -5,7 +5,7 @@
class ResCompany(models.Model):
- _inherit = "res.company"
+ _inherit = ["res.company"]
def _get_social_media_links(self):
social_media_links = super()._get_social_media_links()
diff --git a/addons/website_membership/models/membership.py b/addons/website_membership/models/membership.py
index 50cf674f9e50e..cb59cd7d80cd5 100644
--- a/addons/website_membership/models/membership.py
+++ b/addons/website_membership/models/membership.py
@@ -3,9 +3,10 @@
from odoo import models
-class MembershipLine(models.Model):
- _inherit = 'membership.membership_line'
+class MembershipMembership_Line(models.Model):
+
+ _inherit = ['membership.membership_line']
def _get_published_companies(self, limit=None):
if not self.ids:
diff --git a/addons/website_membership/models/website.py b/addons/website_membership/models/website.py
index 645370b818933..e5dde88ff59bc 100644
--- a/addons/website_membership/models/website.py
+++ b/addons/website_membership/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
def get_suggested_controllers(self):
suggested_controllers = super(Website, self).get_suggested_controllers()
diff --git a/addons/website_partner/models/res_partner.py b/addons/website_partner/models/res_partner.py
index bb07d2658a8b2..f1c831511abc8 100644
--- a/addons/website_partner/models/res_partner.py
+++ b/addons/website_partner/models/res_partner.py
@@ -4,14 +4,13 @@
from odoo.tools.translate import html_translate
-class WebsiteResPartner(models.Model):
- _name = 'res.partner'
+class ResPartner(models.Model):
_inherit = ['res.partner', 'website.seo.metadata']
website_description = fields.Html('Website Partner Full Description', strip_style=True, sanitize_overridable=True, translate=html_translate)
website_short_description = fields.Text('Website Partner Short Description', translate=True)
def _compute_website_url(self):
- super(WebsiteResPartner, self)._compute_website_url()
+ super()._compute_website_url()
for partner in self:
partner.website_url = "/partners/%s" % self.env['ir.http']._slug(partner)
diff --git a/addons/website_payment/models/account_payment.py b/addons/website_payment/models/account_payment.py
index b1806dd920145..150c35f7bf343 100644
--- a/addons/website_payment/models/account_payment.py
+++ b/addons/website_payment/models/account_payment.py
@@ -5,6 +5,6 @@
class AccountPayment(models.Model):
- _inherit = 'account.payment'
+ _inherit = ['account.payment']
is_donation = fields.Boolean(string="Is Donation", related="payment_transaction_id.is_donation")
diff --git a/addons/website_payment/models/payment_provider.py b/addons/website_payment/models/payment_provider.py
index ebb53ed9aa512..8b3f1b6d2fb8c 100644
--- a/addons/website_payment/models/payment_provider.py
+++ b/addons/website_payment/models/payment_provider.py
@@ -10,7 +10,7 @@
class PaymentProvider(models.Model):
- _inherit = "payment.provider"
+ _inherit = ["payment.provider"]
website_id = fields.Many2one(
"website",
diff --git a/addons/website_payment/models/payment_transaction.py b/addons/website_payment/models/payment_transaction.py
index 3f47e9e6e05dd..91e3cac66da1a 100644
--- a/addons/website_payment/models/payment_transaction.py
+++ b/addons/website_payment/models/payment_transaction.py
@@ -6,7 +6,7 @@
class PaymentTransaction(models.Model):
- _inherit = "payment.transaction"
+ _inherit = ["payment.transaction"]
is_donation = fields.Boolean(string="Is donation")
diff --git a/addons/website_payment/models/res_config_settings.py b/addons/website_payment/models/res_config_settings.py
index 490efe58a9326..35bc3266ae473 100644
--- a/addons/website_payment/models/res_config_settings.py
+++ b/addons/website_payment/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
providers_state = fields.Selection(
selection=[
diff --git a/addons/website_payment_authorize/models/res_config_settings.py b/addons/website_payment_authorize/models/res_config_settings.py
index 7990deeb7dd88..52fd564dba229 100644
--- a/addons/website_payment_authorize/models/res_config_settings.py
+++ b/addons/website_payment_authorize/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
authorize_capture_method = fields.Selection(
string='Authorize.net: Payment Capture Method',
diff --git a/addons/website_profile/models/gamification_badge.py b/addons/website_profile/models/gamification_badge.py
index 3c02cedb5b0ad..ec2a5d1a87b50 100644
--- a/addons/website_profile/models/gamification_badge.py
+++ b/addons/website_profile/models/gamification_badge.py
@@ -5,5 +5,4 @@
class GamificationBadge(models.Model):
- _name = 'gamification.badge'
_inherit = ['gamification.badge', 'website.published.mixin']
diff --git a/addons/website_profile/models/res_users.py b/addons/website_profile/models/res_users.py
index 29223653dd086..bd0d482397f4e 100644
--- a/addons/website_profile/models/res_users.py
+++ b/addons/website_profile/models/res_users.py
@@ -11,8 +11,8 @@
VALIDATION_KARMA_GAIN = 3
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
@property
def SELF_READABLE_FIELDS(self):
diff --git a/addons/website_profile/models/website.py b/addons/website_profile/models/website.py
index 76a37eba3d989..039e5ee5cb0e4 100644
--- a/addons/website_profile/models/website.py
+++ b/addons/website_profile/models/website.py
@@ -5,6 +5,6 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
karma_profile_min = fields.Integer(string="Minimal karma to see other user's profile", default=150)
diff --git a/addons/website_project/models/project_task.py b/addons/website_project/models/project_task.py
index 4899a926af777..faf814b75d872 100644
--- a/addons/website_project/models/project_task.py
+++ b/addons/website_project/models/project_task.py
@@ -4,7 +4,7 @@
class ProjectTask(models.Model):
- _inherit = 'project.task'
+ _inherit = ['project.task']
# Need this field to check there is no email loops when Odoo reply automatically
email_from = fields.Char('Email From')
diff --git a/addons/website_sale/models/account_move.py b/addons/website_sale/models/account_move.py
index b5b1b40711953..b617d855aa885 100644
--- a/addons/website_sale/models/account_move.py
+++ b/addons/website_sale/models/account_move.py
@@ -5,7 +5,7 @@
class AccountMove(models.Model):
- _inherit = 'account.move'
+ _inherit = ['account.move']
website_id = fields.Many2one(
'website', compute='_compute_website_id', string='Website',
diff --git a/addons/website_sale/models/crm_team.py b/addons/website_sale/models/crm_team.py
index 9b21846a72378..ce8fa7520b056 100644
--- a/addons/website_sale/models/crm_team.py
+++ b/addons/website_sale/models/crm_team.py
@@ -4,7 +4,7 @@
class CrmTeam(models.Model):
- _inherit = 'crm.team'
+ _inherit = ['crm.team']
website_ids = fields.One2many(
string="Websites", comodel_name='website', inverse_name='salesteam_id',
diff --git a/addons/website_sale/models/delivery_carrier.py b/addons/website_sale/models/delivery_carrier.py
index 4c4f39c157efa..2a8cec2cf5c1e 100644
--- a/addons/website_sale/models/delivery_carrier.py
+++ b/addons/website_sale/models/delivery_carrier.py
@@ -4,7 +4,6 @@
class DeliveryCarrier(models.Model):
- _name = 'delivery.carrier'
_inherit = ['delivery.carrier', 'website.published.multi.mixin']
website_description = fields.Text(
diff --git a/addons/website_sale/models/digest.py b/addons/website_sale/models/digest.py
index 48f705c112ac0..f902537f83416 100644
--- a/addons/website_sale/models/digest.py
+++ b/addons/website_sale/models/digest.py
@@ -4,8 +4,8 @@
from odoo.exceptions import AccessError
-class Digest(models.Model):
- _inherit = 'digest.digest'
+class DigestDigest(models.Model):
+ _inherit = ['digest.digest']
kpi_website_sale_total = fields.Boolean(string="eCommerce Sales")
kpi_website_sale_total_value = fields.Monetary(compute='_compute_kpi_website_sale_total_value')
diff --git a/addons/website_sale/models/ir_http.py b/addons/website_sale/models/ir_http.py
index a212cde4540b7..20920d45424e8 100644
--- a/addons/website_sale/models/ir_http.py
+++ b/addons/website_sale/models/ir_http.py
@@ -5,7 +5,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _pre_dispatch(cls, rule, args):
diff --git a/addons/website_sale/models/payment_token.py b/addons/website_sale/models/payment_token.py
index 71fe1563556fe..0b3f5a4fb6775 100644
--- a/addons/website_sale/models/payment_token.py
+++ b/addons/website_sale/models/payment_token.py
@@ -4,7 +4,7 @@
class PaymentToken(models.Model):
- _inherit = 'payment.token'
+ _inherit = ['payment.token']
def _get_available_tokens(self, *args, is_express_checkout=False, **kwargs):
""" Override of `payment` not to return the tokens in case of express checkout.
diff --git a/addons/website_sale/models/product_attribute.py b/addons/website_sale/models/product_attribute.py
index e79bd4fd18e86..4cacae0f38798 100644
--- a/addons/website_sale/models/product_attribute.py
+++ b/addons/website_sale/models/product_attribute.py
@@ -4,7 +4,7 @@
class ProductAttribute(models.Model):
- _inherit = 'product.attribute'
+ _inherit = ['product.attribute']
visibility = fields.Selection(
selection=[('visible', "Visible"), ('hidden', "Hidden")],
diff --git a/addons/website_sale/models/product_document.py b/addons/website_sale/models/product_document.py
index 613afb903ff69..17db07a824a0d 100644
--- a/addons/website_sale/models/product_document.py
+++ b/addons/website_sale/models/product_document.py
@@ -5,7 +5,7 @@
class ProductDocument(models.Model):
- _inherit = 'product.document'
+ _inherit = ['product.document']
shown_on_product_page = fields.Boolean(string="Publish on website")
diff --git a/addons/website_sale/models/product_image.py b/addons/website_sale/models/product_image.py
index b81d2f58444c4..1c803f0dc645e 100644
--- a/addons/website_sale/models/product_image.py
+++ b/addons/website_sale/models/product_image.py
@@ -10,7 +10,6 @@
class ProductImage(models.Model):
- _name = 'product.image'
_description = "Product Image"
_inherit = ['image.mixin']
_order = 'sequence, id'
diff --git a/addons/website_sale/models/product_pricelist.py b/addons/website_sale/models/product_pricelist.py
index a253d0adfe663..ff883b9446340 100644
--- a/addons/website_sale/models/product_pricelist.py
+++ b/addons/website_sale/models/product_pricelist.py
@@ -7,7 +7,7 @@
class ProductPricelist(models.Model):
- _inherit = 'product.pricelist'
+ _inherit = ['product.pricelist']
#=== DEFAULT METHODS ===#
diff --git a/addons/website_sale/models/product_product.py b/addons/website_sale/models/product_product.py
index 2374e9b031121..d225cfa03c7cb 100644
--- a/addons/website_sale/models/product_product.py
+++ b/addons/website_sale/models/product_product.py
@@ -6,8 +6,8 @@
from odoo.exceptions import ValidationError
-class Product(models.Model):
- _inherit = 'product.product'
+class ProductProduct(models.Model):
+ _inherit = ['product.product']
variant_ribbon_id = fields.Many2one(string="Variant Ribbon", comodel_name='product.ribbon')
website_id = fields.Many2one(related='product_tmpl_id.website_id', readonly=False)
diff --git a/addons/website_sale/models/product_public_category.py b/addons/website_sale/models/product_public_category.py
index 0b8e7c72b13f8..0055f121bc991 100644
--- a/addons/website_sale/models/product_public_category.py
+++ b/addons/website_sale/models/product_public_category.py
@@ -5,7 +5,6 @@
class ProductPublicCategory(models.Model):
- _name = 'product.public.category'
_inherit = [
'website.seo.metadata',
'website.multi.mixin',
diff --git a/addons/website_sale/models/product_ribbon.py b/addons/website_sale/models/product_ribbon.py
index 6a0f3aafbd2cf..7e1dd388ae3ea 100644
--- a/addons/website_sale/models/product_ribbon.py
+++ b/addons/website_sale/models/product_ribbon.py
@@ -4,7 +4,6 @@
class ProductRibbon(models.Model):
- _name = 'product.ribbon'
_description = "Product ribbon"
name = fields.Char(string="Ribbon Name", required=True, translate=True, size=20)
diff --git a/addons/website_sale/models/product_tag.py b/addons/website_sale/models/product_tag.py
index 0b7e92a90fe4f..27342add0e7e9 100644
--- a/addons/website_sale/models/product_tag.py
+++ b/addons/website_sale/models/product_tag.py
@@ -4,7 +4,6 @@
class ProductTag(models.Model):
- _name = 'product.tag'
_inherit = ['website.multi.mixin', 'product.tag']
visible_on_ecommerce = fields.Boolean(
diff --git a/addons/website_sale/models/product_template.py b/addons/website_sale/models/product_template.py
index 5d5b2f1fdbc76..3a07cab39b96e 100644
--- a/addons/website_sale/models/product_template.py
+++ b/addons/website_sale/models/product_template.py
@@ -20,7 +20,6 @@ class ProductTemplate(models.Model):
'website.published.multi.mixin',
'website.searchable.mixin',
]
- _name = 'product.template'
_mail_post_access = 'read'
_check_company_auto = True
diff --git a/addons/website_sale/models/product_template_attribute_line.py b/addons/website_sale/models/product_template_attribute_line.py
index 6016fb9b63703..20470256b6268 100644
--- a/addons/website_sale/models/product_template_attribute_line.py
+++ b/addons/website_sale/models/product_template_attribute_line.py
@@ -6,7 +6,7 @@
class ProductTemplateAttributeLine(models.Model):
- _inherit = 'product.template.attribute.line'
+ _inherit = ['product.template.attribute.line']
def _prepare_single_value_for_display(self):
"""On the product page group together the attribute lines that concern
diff --git a/addons/website_sale/models/product_template_attribute_value.py b/addons/website_sale/models/product_template_attribute_value.py
index 480421cb8bcec..286ff70c49b4b 100644
--- a/addons/website_sale/models/product_template_attribute_value.py
+++ b/addons/website_sale/models/product_template_attribute_value.py
@@ -4,7 +4,7 @@
class ProductTemplateAttributeValue(models.Model):
- _inherit = 'product.template.attribute.value'
+ _inherit = ['product.template.attribute.value']
def _get_extra_price(self, combination_info):
self.ensure_one()
diff --git a/addons/website_sale/models/res_company.py b/addons/website_sale/models/res_company.py
index 3076b3c9d35f4..eefb67e069431 100644
--- a/addons/website_sale/models/res_company.py
+++ b/addons/website_sale/models/res_company.py
@@ -4,7 +4,7 @@
class ResCompany(models.Model):
- _inherit = 'res.company'
+ _inherit = ['res.company']
def _get_default_pricelist_vals(self):
""" Override of product. Called at company creation or activation of the pricelist setting.
diff --git a/addons/website_sale/models/res_config_settings.py b/addons/website_sale/models/res_config_settings.py
index 564ff9cd12de8..35b7e99c450f9 100644
--- a/addons/website_sale/models/res_config_settings.py
+++ b/addons/website_sale/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
# Groups
group_delivery_invoice_address = fields.Boolean(
diff --git a/addons/website_sale/models/res_partner.py b/addons/website_sale/models/res_partner.py
index d94bcf4a46b89..a9720df4a767f 100644
--- a/addons/website_sale/models/res_partner.py
+++ b/addons/website_sale/models/res_partner.py
@@ -6,7 +6,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
last_website_so_id = fields.Many2one(
string="Last Online Sales Order",
diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py
index 5a3fda250eb22..0866e8e12d71e 100644
--- a/addons/website_sale/models/sale_order.py
+++ b/addons/website_sale/models/sale_order.py
@@ -15,7 +15,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
website_id = fields.Many2one(
help="Website through which this order was placed for eCommerce orders.",
diff --git a/addons/website_sale/models/sale_order_line.py b/addons/website_sale/models/sale_order_line.py
index 1a6d9f57012a8..03c345ebdf7e7 100644
--- a/addons/website_sale/models/sale_order_line.py
+++ b/addons/website_sale/models/sale_order_line.py
@@ -4,7 +4,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
name_short = fields.Char(compute='_compute_name_short')
shop_warning = fields.Char(string="Warning")
diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py
index a53bb90b5cc22..6da54830ce3d3 100644
--- a/addons/website_sale/models/website.py
+++ b/addons/website_sale/models/website.py
@@ -9,7 +9,7 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
#=== DEFAULT METHODS ===#
diff --git a/addons/website_sale/models/website_base_unit.py b/addons/website_sale/models/website_base_unit.py
index d26e5aec2ad55..41f8c703ad118 100644
--- a/addons/website_sale/models/website_base_unit.py
+++ b/addons/website_sale/models/website_base_unit.py
@@ -4,7 +4,6 @@
class WebsiteBaseUnit(models.Model):
- _name = 'website.base.unit'
_description = "Unit of Measure for price per unit on eCommerce products."
_order = 'name'
diff --git a/addons/website_sale/models/website_menu.py b/addons/website_sale/models/website_menu.py
index 657f0f4fcf643..6e2e0fe0d252e 100644
--- a/addons/website_sale/models/website_menu.py
+++ b/addons/website_sale/models/website_menu.py
@@ -3,8 +3,8 @@
from odoo import models
-class Menu(models.Model):
- _inherit = 'website.menu'
+class WebsiteMenu(models.Model):
+ _inherit = ['website.menu']
def _compute_visible(self):
""" Hide '/shop' menus to the public user if only logged-in users can access it. """
@@ -12,4 +12,4 @@ def _compute_visible(self):
for menu in shop_menus:
menu.is_visible = menu.website_id.has_ecommerce_access()
- return super(Menu, self - shop_menus)._compute_visible()
+ return super(WebsiteMenu, self - shop_menus)._compute_visible()
diff --git a/addons/website_sale/models/website_sale_extra_field.py b/addons/website_sale/models/website_sale_extra_field.py
index f5ccab523402c..f01a83fba9896 100644
--- a/addons/website_sale/models/website_sale_extra_field.py
+++ b/addons/website_sale/models/website_sale_extra_field.py
@@ -4,7 +4,6 @@
class WebsiteSaleExtraField(models.Model):
- _name = 'website.sale.extra.field'
_description = "E-Commerce Extra Info Shown on product page"
_order = 'sequence'
diff --git a/addons/website_sale/models/website_snippet_filter.py b/addons/website_sale/models/website_snippet_filter.py
index f9937878c1a79..0c0424fb1d011 100644
--- a/addons/website_sale/models/website_snippet_filter.py
+++ b/addons/website_sale/models/website_snippet_filter.py
@@ -7,7 +7,7 @@
class WebsiteSnippetFilter(models.Model):
- _inherit = 'website.snippet.filter'
+ _inherit = ['website.snippet.filter']
product_cross_selling = fields.Boolean(
string="About cross selling products",
diff --git a/addons/website_sale/models/website_track.py b/addons/website_sale/models/website_track.py
index c928e1cb37ab0..a2c8b12dd372b 100644
--- a/addons/website_sale/models/website_track.py
+++ b/addons/website_sale/models/website_track.py
@@ -4,7 +4,7 @@
class WebsiteTrack(models.Model):
- _inherit = 'website.track'
+ _inherit = ['website.track']
product_id = fields.Many2one(
comodel_name='product.product', ondelete='cascade', readonly=True, index='btree_not_null',
diff --git a/addons/website_sale/models/website_visitor.py b/addons/website_sale/models/website_visitor.py
index c28d12a80fb82..49ee5779bd99e 100644
--- a/addons/website_sale/models/website_visitor.py
+++ b/addons/website_sale/models/website_visitor.py
@@ -4,7 +4,7 @@
class WebsiteVisitor(models.Model):
- _inherit = 'website.visitor'
+ _inherit = ['website.visitor']
visitor_product_count = fields.Integer(
string="Product Views",
diff --git a/addons/website_sale/report/sale_report.py b/addons/website_sale/report/sale_report.py
index 84e02a92b019b..b97b003b9b0f4 100644
--- a/addons/website_sale/report/sale_report.py
+++ b/addons/website_sale/report/sale_report.py
@@ -4,7 +4,7 @@
class SaleReport(models.Model):
- _inherit = 'sale.report'
+ _inherit = ['sale.report']
website_id = fields.Many2one('website', readonly=True)
is_abandoned_cart = fields.Boolean(string="Abandoned Cart", readonly=True)
diff --git a/addons/website_sale_autocomplete/models/res_config_settings.py b/addons/website_sale_autocomplete/models/res_config_settings.py
index 13eea8d76de10..4d0f309a90f36 100644
--- a/addons/website_sale_autocomplete/models/res_config_settings.py
+++ b/addons/website_sale_autocomplete/models/res_config_settings.py
@@ -2,7 +2,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
google_places_api_key = fields.Char(
string='Google Places API Key',
diff --git a/addons/website_sale_autocomplete/models/website.py b/addons/website_sale_autocomplete/models/website.py
index a1f471b0af4c8..497d104a44bce 100644
--- a/addons/website_sale_autocomplete/models/website.py
+++ b/addons/website_sale_autocomplete/models/website.py
@@ -4,7 +4,7 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
google_places_api_key = fields.Char(
string='Google Places API Key',
diff --git a/addons/website_sale_collect/models/delivery_carrier.py b/addons/website_sale_collect/models/delivery_carrier.py
index eb39ac3c2032c..bcf50ebc221ac 100644
--- a/addons/website_sale_collect/models/delivery_carrier.py
+++ b/addons/website_sale_collect/models/delivery_carrier.py
@@ -9,7 +9,7 @@
class DeliveryCarrier(models.Model):
- _inherit = 'delivery.carrier'
+ _inherit = ['delivery.carrier']
delivery_type = fields.Selection(
selection_add=[('in_store', "Pick up in store")], ondelete={'in_store': 'set default'}
diff --git a/addons/website_sale_collect/models/payment_provider.py b/addons/website_sale_collect/models/payment_provider.py
index 5511fe7c57092..2878a9af64c0d 100644
--- a/addons/website_sale_collect/models/payment_provider.py
+++ b/addons/website_sale_collect/models/payment_provider.py
@@ -7,7 +7,7 @@
class PaymentProvider(models.Model):
- _inherit = 'payment.provider'
+ _inherit = ['payment.provider']
custom_mode = fields.Selection(
selection_add=[('on_site', "Pay on site")]
diff --git a/addons/website_sale_collect/models/product_template.py b/addons/website_sale_collect/models/product_template.py
index 56f4196fa0d23..46de7da08c17d 100644
--- a/addons/website_sale_collect/models/product_template.py
+++ b/addons/website_sale_collect/models/product_template.py
@@ -6,7 +6,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
def _get_additionnal_combination_info(self, product_or_template, quantity, date, website):
""" Override of `website_sale` to add information on whether Click & Collect is enabled and
diff --git a/addons/website_sale_collect/models/res_config_settings.py b/addons/website_sale_collect/models/res_config_settings.py
index abb2a23660024..c202fd4fede0a 100644
--- a/addons/website_sale_collect/models/res_config_settings.py
+++ b/addons/website_sale_collect/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
def action_view_in_store_delivery_methods(self):
""" Return an action to browse pickup delivery methods in list view, or in form view if
diff --git a/addons/website_sale_collect/models/sale_order.py b/addons/website_sale_collect/models/sale_order.py
index 94eceab2f6128..a3809fe7b1e79 100644
--- a/addons/website_sale_collect/models/sale_order.py
+++ b/addons/website_sale_collect/models/sale_order.py
@@ -8,7 +8,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
def set_delivery_line(self, carrier, amount):
""" Override of `website_sale` to recompute warehouse when a new delivery method
diff --git a/addons/website_sale_collect/models/stock_warehouse.py b/addons/website_sale_collect/models/stock_warehouse.py
index 1f4c700d48794..405293f1ed6fa 100644
--- a/addons/website_sale_collect/models/stock_warehouse.py
+++ b/addons/website_sale_collect/models/stock_warehouse.py
@@ -4,7 +4,7 @@
class StockWarehouse(models.Model):
- _inherit = 'stock.warehouse'
+ _inherit = ['stock.warehouse']
opening_hours = fields.Many2one(
string="Opening Hours", comodel_name='resource.calendar', check_company=True
diff --git a/addons/website_sale_collect/models/website.py b/addons/website_sale_collect/models/website.py
index d0eb7808d3baf..dec02a791c26c 100644
--- a/addons/website_sale_collect/models/website.py
+++ b/addons/website_sale_collect/models/website.py
@@ -4,7 +4,7 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
in_store_dm_id = fields.Many2one(
string="In-store Delivery Method",
diff --git a/addons/website_sale_comparison/models/product_attribute.py b/addons/website_sale_comparison/models/product_attribute.py
index 4d2f60ea7af61..99bba3f80397f 100644
--- a/addons/website_sale_comparison/models/product_attribute.py
+++ b/addons/website_sale_comparison/models/product_attribute.py
@@ -4,7 +4,7 @@
class ProductAttribute(models.Model):
- _inherit = 'product.attribute'
+ _inherit = ['product.attribute']
_order = 'category_id, sequence, id'
category_id = fields.Many2one(
diff --git a/addons/website_sale_comparison/models/product_attribute_category.py b/addons/website_sale_comparison/models/product_attribute_category.py
index c9eece1195475..571b756e7a805 100644
--- a/addons/website_sale_comparison/models/product_attribute_category.py
+++ b/addons/website_sale_comparison/models/product_attribute_category.py
@@ -4,7 +4,6 @@
class ProductAttributeCategory(models.Model):
- _name = "product.attribute.category"
_description = "Product Attribute Category"
_order = 'sequence, id'
diff --git a/addons/website_sale_comparison/models/product_product.py b/addons/website_sale_comparison/models/product_product.py
index 040f320ad4403..41db33e8a4c71 100644
--- a/addons/website_sale_comparison/models/product_product.py
+++ b/addons/website_sale_comparison/models/product_product.py
@@ -6,7 +6,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def _prepare_categories_for_display(self):
"""On the comparison page group on the same line the values of each
diff --git a/addons/website_sale_comparison/models/product_template_attribute_line.py b/addons/website_sale_comparison/models/product_template_attribute_line.py
index 06d2fd710c650..5de8c459df998 100644
--- a/addons/website_sale_comparison/models/product_template_attribute_line.py
+++ b/addons/website_sale_comparison/models/product_template_attribute_line.py
@@ -6,7 +6,7 @@
class ProductTemplateAttributeLine(models.Model):
- _inherit = 'product.template.attribute.line'
+ _inherit = ['product.template.attribute.line']
def _prepare_categories_for_display(self):
"""On the product page group together the attribute lines that concern
diff --git a/addons/website_sale_loyalty/models/loyalty_card.py b/addons/website_sale_loyalty/models/loyalty_card.py
index 429a1a372c99a..eb59510b9fb9a 100644
--- a/addons/website_sale_loyalty/models/loyalty_card.py
+++ b/addons/website_sale_loyalty/models/loyalty_card.py
@@ -3,8 +3,9 @@
from odoo import models
+
class LoyaltyCard(models.Model):
- _inherit = 'loyalty.card'
+ _inherit = ['loyalty.card']
def action_coupon_share(self):
self.ensure_one()
diff --git a/addons/website_sale_loyalty/models/loyalty_program.py b/addons/website_sale_loyalty/models/loyalty_program.py
index c1f45155f1837..953d85d74dc3c 100644
--- a/addons/website_sale_loyalty/models/loyalty_program.py
+++ b/addons/website_sale_loyalty/models/loyalty_program.py
@@ -3,8 +3,8 @@
from odoo import fields, models
+
class LoyaltyProgram(models.Model):
- _name = 'loyalty.program'
_inherit = ['loyalty.program', 'website.multi.mixin']
ecommerce_ok = fields.Boolean("Available on Website", default=True)
diff --git a/addons/website_sale_loyalty/models/loyalty_rule.py b/addons/website_sale_loyalty/models/loyalty_rule.py
index 85ccb6d150ebc..79a7a52157616 100644
--- a/addons/website_sale_loyalty/models/loyalty_rule.py
+++ b/addons/website_sale_loyalty/models/loyalty_rule.py
@@ -4,8 +4,9 @@
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
+
class LoyaltyRule(models.Model):
- _inherit = 'loyalty.rule'
+ _inherit = ['loyalty.rule']
website_id = fields.Many2one(related='program_id.website_id', store=True)
diff --git a/addons/website_sale_loyalty/models/sale_order.py b/addons/website_sale_loyalty/models/sale_order.py
index ad27bcd4ab2a6..c63dd532265f3 100644
--- a/addons/website_sale_loyalty/models/sale_order.py
+++ b/addons/website_sale_loyalty/models/sale_order.py
@@ -10,7 +10,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
# List of disabled rewards for automatic claim
disabled_auto_rewards = fields.Many2many("loyalty.reward", relation="sale_order_disabled_auto_rewards_rel")
diff --git a/addons/website_sale_loyalty/models/sale_order_line.py b/addons/website_sale_loyalty/models/sale_order_line.py
index b6a4a595ad6c2..872787723be6d 100644
--- a/addons/website_sale_loyalty/models/sale_order_line.py
+++ b/addons/website_sale_loyalty/models/sale_order_line.py
@@ -4,8 +4,9 @@
from collections import defaultdict
from odoo import models
+
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
def _show_in_cart(self):
# Hide discount lines from website_order_line, see `order._compute_website_order_line`
diff --git a/addons/website_sale_loyalty/wizard/coupon_share.py b/addons/website_sale_loyalty/wizard/coupon_share.py
index 49e93becc4703..ab447846d0379 100644
--- a/addons/website_sale_loyalty/wizard/coupon_share.py
+++ b/addons/website_sale_loyalty/wizard/coupon_share.py
@@ -7,7 +7,6 @@
class CouponShare(models.TransientModel):
- _name = 'coupon.share'
_description = 'Create links that apply a coupon and redirect to a specific page'
def _get_default_website_id(self):
diff --git a/addons/website_sale_mass_mailing/models/res_config_settings.py b/addons/website_sale_mass_mailing/models/res_config_settings.py
index a36c16d1e28b4..f9a9c925fae5f 100644
--- a/addons/website_sale_mass_mailing/models/res_config_settings.py
+++ b/addons/website_sale_mass_mailing/models/res_config_settings.py
@@ -4,7 +4,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
is_newsletter_enabled = fields.Boolean()
newsletter_id = fields.Many2one(related='website_id.newsletter_id', readonly=False)
diff --git a/addons/website_sale_mass_mailing/models/website.py b/addons/website_sale_mass_mailing/models/website.py
index 3fa603341d1b9..642dbcaa76184 100644
--- a/addons/website_sale_mass_mailing/models/website.py
+++ b/addons/website_sale_mass_mailing/models/website.py
@@ -4,6 +4,6 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
newsletter_id = fields.Many2one(string="Newsletter List", comodel_name='mailing.list')
diff --git a/addons/website_sale_mondialrelay/models/res_partner.py b/addons/website_sale_mondialrelay/models/res_partner.py
index 1470220dec9d2..535ac77b97e30 100644
--- a/addons/website_sale_mondialrelay/models/res_partner.py
+++ b/addons/website_sale_mondialrelay/models/res_partner.py
@@ -5,7 +5,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
def _can_be_edited_by_current_customer(self, *args, **kwargs):
return super()._can_be_edited_by_current_customer(*args, **kwargs) and not self.is_mondialrelay
diff --git a/addons/website_sale_mondialrelay/models/sale_order.py b/addons/website_sale_mondialrelay/models/sale_order.py
index 402ca0d7f8f32..3b031b8768132 100644
--- a/addons/website_sale_mondialrelay/models/sale_order.py
+++ b/addons/website_sale_mondialrelay/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
def _check_cart_is_ready_to_be_paid(self):
if (
diff --git a/addons/website_sale_slides/models/product_product.py b/addons/website_sale_slides/models/product_product.py
index ec48adbc7071b..6a9b5565d7379 100644
--- a/addons/website_sale_slides/models/product_product.py
+++ b/addons/website_sale_slides/models/product_product.py
@@ -4,8 +4,8 @@
from odoo import _, fields, models
-class Product(models.Model):
- _inherit = "product.product"
+class ProductProduct(models.Model):
+ _inherit = ["product.product"]
channel_ids = fields.One2many('slide.channel', 'product_id', string='Courses')
@@ -13,7 +13,7 @@ def get_product_multiline_description_sale(self):
payment_channels = self.channel_ids.filtered(lambda course: course.enroll == 'payment')
if not payment_channels:
- return super(Product, self).get_product_multiline_description_sale()
+ return super().get_product_multiline_description_sale()
new_line = '' if len(payment_channels) == 1 else '\n'
return _('Access to: %(new_line)s%(channel_list)s', new_line=new_line, channel_list='\n'.join(payment_channels.mapped('name')))
diff --git a/addons/website_sale_slides/models/product_template.py b/addons/website_sale_slides/models/product_template.py
index 1dbed85fd16ef..37efd15a3e214 100644
--- a/addons/website_sale_slides/models/product_template.py
+++ b/addons/website_sale_slides/models/product_template.py
@@ -5,7 +5,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
service_tracking = fields.Selection(selection_add=[
('course', 'Course Access'),
diff --git a/addons/website_sale_slides/models/sale_order.py b/addons/website_sale_slides/models/sale_order.py
index 8adeea31d878c..16c95460dc6d0 100644
--- a/addons/website_sale_slides/models/sale_order.py
+++ b/addons/website_sale_slides/models/sale_order.py
@@ -5,7 +5,7 @@
class SaleOrder(models.Model):
- _inherit = "sale.order"
+ _inherit = ["sale.order"]
def _action_confirm(self):
""" If the product of an order line is a 'course', we add the client of the sale_order
diff --git a/addons/website_sale_slides/models/slide_channel.py b/addons/website_sale_slides/models/slide_channel.py
index 34e73e0a2e5c2..fbe87405953f7 100644
--- a/addons/website_sale_slides/models/slide_channel.py
+++ b/addons/website_sale_slides/models/slide_channel.py
@@ -5,8 +5,8 @@
from odoo.exceptions import AccessError
-class Channel(models.Model):
- _inherit = 'slide.channel'
+class SlideChannel(models.Model):
+ _inherit = ['slide.channel']
def _get_default_product_id(self):
product_courses = self.env['product.product'].search(
@@ -42,12 +42,12 @@ def _compute_product_sale_revenues(self):
@api.model_create_multi
def create(self, vals_list):
- channels = super(Channel, self).create(vals_list)
+ channels = super().create(vals_list)
channels.filtered(lambda channel: channel.enroll == 'payment')._synchronize_product_publish()
return channels
def write(self, vals):
- res = super(Channel, self).write(vals)
+ res = super().write(vals)
if 'is_published' in vals:
self.filtered(lambda channel: channel.enroll == 'payment')._synchronize_product_publish()
return res
@@ -79,7 +79,7 @@ def action_view_sales(self):
def _filter_add_members(self, target_partners, raise_on_access=False):
""" Overridden to add 'payment' channels to the filtered channels. People
that can write on payment-based channels can add members. """
- result = super(Channel, self)._filter_add_members(target_partners, raise_on_access=raise_on_access)
+ result = super()._filter_add_members(target_partners, raise_on_access=raise_on_access)
on_payment = self.filtered(lambda channel: channel.enroll == 'payment')
if on_payment:
if on_payment.has_access('write'):
diff --git a/addons/website_sale_stock/models/product_product.py b/addons/website_sale_stock/models/product_product.py
index 2265fdc5911ba..b45e5ba14c417 100644
--- a/addons/website_sale_stock/models/product_product.py
+++ b/addons/website_sale_stock/models/product_product.py
@@ -6,7 +6,7 @@
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
stock_notification_partner_ids = fields.Many2many('res.partner', relation='stock_notification_product_partner_rel', string='Back in stock Notifications')
diff --git a/addons/website_sale_stock/models/product_template.py b/addons/website_sale_stock/models/product_template.py
index fa0720b6c2a97..7aad59c8ed11e 100644
--- a/addons/website_sale_stock/models/product_template.py
+++ b/addons/website_sale_stock/models/product_template.py
@@ -6,7 +6,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
allow_out_of_stock_order = fields.Boolean(string='Continue selling when out-of-stock', default=True)
diff --git a/addons/website_sale_stock/models/res_config_settings.py b/addons/website_sale_stock/models/res_config_settings.py
index 0b535ae992470..d9c0d53250a77 100644
--- a/addons/website_sale_stock/models/res_config_settings.py
+++ b/addons/website_sale_stock/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = 'res.config.settings'
+ _inherit = ['res.config.settings']
allow_out_of_stock_order = fields.Boolean(
string='Continue selling when out-of-stock',
diff --git a/addons/website_sale_stock/models/sale_order.py b/addons/website_sale_stock/models/sale_order.py
index 56f3d884fa8bd..9d6aca4b8103d 100644
--- a/addons/website_sale_stock/models/sale_order.py
+++ b/addons/website_sale_stock/models/sale_order.py
@@ -6,7 +6,7 @@
class SaleOrder(models.Model):
- _inherit = 'sale.order'
+ _inherit = ['sale.order']
def _get_warehouse_available(self):
self.ensure_one()
diff --git a/addons/website_sale_stock/models/sale_order_line.py b/addons/website_sale_stock/models/sale_order_line.py
index 7dfe3d3017b20..015d676006b42 100644
--- a/addons/website_sale_stock/models/sale_order_line.py
+++ b/addons/website_sale_stock/models/sale_order_line.py
@@ -4,7 +4,7 @@
class SaleOrderLine(models.Model):
- _inherit = 'sale.order.line'
+ _inherit = ['sale.order.line']
def _set_shop_warning_stock(self, desired_qty, new_qty):
self.ensure_one()
diff --git a/addons/website_sale_stock/models/stock_picking.py b/addons/website_sale_stock/models/stock_picking.py
index 8b8ac7c879213..e912965dc01c0 100644
--- a/addons/website_sale_stock/models/stock_picking.py
+++ b/addons/website_sale_stock/models/stock_picking.py
@@ -5,7 +5,7 @@
class StockPicking(models.Model):
- _inherit = 'stock.picking'
+ _inherit = ['stock.picking']
website_id = fields.Many2one('website', related='sale_id.website_id', string='Website',
help='Website where this order has been placed, for eCommerce orders.',
diff --git a/addons/website_sale_stock/models/website.py b/addons/website_sale_stock/models/website.py
index 05c990ae8b424..f0fd3815fb07f 100644
--- a/addons/website_sale_stock/models/website.py
+++ b/addons/website_sale_stock/models/website.py
@@ -4,7 +4,7 @@
class Website(models.Model):
- _inherit = 'website'
+ _inherit = ['website']
warehouse_id = fields.Many2one('stock.warehouse', string='Warehouse')
diff --git a/addons/website_sale_stock_wishlist/models/product_template.py b/addons/website_sale_stock_wishlist/models/product_template.py
index 1b2678cfdc469..f61b0789a6594 100644
--- a/addons/website_sale_stock_wishlist/models/product_template.py
+++ b/addons/website_sale_stock_wishlist/models/product_template.py
@@ -4,7 +4,7 @@
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
def _get_additionnal_combination_info(self, product_or_template, quantity, date, website):
res = super()._get_additionnal_combination_info(product_or_template, quantity, date, website)
diff --git a/addons/website_sale_stock_wishlist/models/product_wishlist.py b/addons/website_sale_stock_wishlist/models/product_wishlist.py
index 77f93d43ec4c4..c47e00360c803 100644
--- a/addons/website_sale_stock_wishlist/models/product_wishlist.py
+++ b/addons/website_sale_stock_wishlist/models/product_wishlist.py
@@ -4,7 +4,7 @@
class ProductWishlist(models.Model):
- _inherit = "product.wishlist"
+ _inherit = ["product.wishlist"]
stock_notification = fields.Boolean(compute='_compute_stock_notification', default=False, required=True)
diff --git a/addons/website_sale_wishlist/models/product_wishlist.py b/addons/website_sale_wishlist/models/product_wishlist.py
index 765ac1f5f5e57..3ce7b7800ae53 100644
--- a/addons/website_sale_wishlist/models/product_wishlist.py
+++ b/addons/website_sale_wishlist/models/product_wishlist.py
@@ -5,7 +5,6 @@
class ProductWishlist(models.Model):
- _name = 'product.wishlist'
_description = 'Product Wishlist'
_sql_constraints = [
("product_unique_partner_id",
@@ -75,13 +74,13 @@ def _gc_sessions(self, *args, **kwargs):
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
wishlist_ids = fields.One2many('product.wishlist', 'partner_id', string='Wishlist', domain=[('active', '=', True)])
class ProductTemplate(models.Model):
- _inherit = 'product.template'
+ _inherit = ['product.template']
def _is_in_wishlist(self):
self.ensure_one()
@@ -89,7 +88,7 @@ def _is_in_wishlist(self):
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = ['product.product']
def _is_in_wishlist(self):
self.ensure_one()
diff --git a/addons/website_sale_wishlist/models/res_users.py b/addons/website_sale_wishlist/models/res_users.py
index cf7672c373f22..33d97ce201d88 100644
--- a/addons/website_sale_wishlist/models/res_users.py
+++ b/addons/website_sale_wishlist/models/res_users.py
@@ -3,7 +3,7 @@
class ResUsers(models.Model):
- _inherit = "res.users"
+ _inherit = ["res.users"]
def _check_credentials(self, credential, env):
"""Make all wishlists from session belong to its owner user."""
diff --git a/addons/website_slides/models/gamification_challenge.py b/addons/website_slides/models/gamification_challenge.py
index 7bb7f498ec433..bd424292e7524 100644
--- a/addons/website_slides/models/gamification_challenge.py
+++ b/addons/website_slides/models/gamification_challenge.py
@@ -4,8 +4,8 @@
from odoo import models, fields
-class Challenge(models.Model):
- _inherit = 'gamification.challenge'
+class GamificationChallenge(models.Model):
+ _inherit = ['gamification.challenge']
challenge_category = fields.Selection(selection_add=[
('slides', 'Website / Slides')
diff --git a/addons/website_slides/models/gamification_karma_tracking.py b/addons/website_slides/models/gamification_karma_tracking.py
index e203a675df7b4..41a5ddbd304a9 100644
--- a/addons/website_slides/models/gamification_karma_tracking.py
+++ b/addons/website_slides/models/gamification_karma_tracking.py
@@ -4,11 +4,11 @@
from odoo import _, models
-class KarmaTracking(models.Model):
- _inherit = 'gamification.karma.tracking'
+class GamificationKarmaTracking(models.Model):
+ _inherit = ['gamification.karma.tracking']
def _get_origin_selection_values(self):
return (
- super(KarmaTracking, self)._get_origin_selection_values()
+ super()._get_origin_selection_values()
+ [('slide.slide', _('Course Quiz')), ('slide.channel', self.env['ir.model']._get('slide.channel').display_name)]
)
diff --git a/addons/website_slides/models/res_config_settings.py b/addons/website_slides/models/res_config_settings.py
index 9e886766a7c8e..3a65e55db5d14 100644
--- a/addons/website_slides/models/res_config_settings.py
+++ b/addons/website_slides/models/res_config_settings.py
@@ -5,7 +5,7 @@
class ResConfigSettings(models.TransientModel):
- _inherit = "res.config.settings"
+ _inherit = ["res.config.settings"]
website_slide_google_app_key = fields.Char(related='website_id.website_slide_google_app_key', readonly=False)
module_website_sale_slides = fields.Boolean(string="Sell on eCommerce")
diff --git a/addons/website_slides/models/res_groups.py b/addons/website_slides/models/res_groups.py
index c7d28545b259e..c1f3f0eb7c99b 100644
--- a/addons/website_slides/models/res_groups.py
+++ b/addons/website_slides/models/res_groups.py
@@ -4,12 +4,12 @@
from odoo import api, models
-class UserGroup(models.Model):
- _inherit = 'res.groups'
+class ResGroups(models.Model):
+ _inherit = ['res.groups']
def write(self, vals):
""" Automatically subscribe new users to linked slide channels """
- write_res = super(UserGroup, self).write(vals)
+ write_res = super().write(vals)
if vals.get('users'):
# TDE FIXME: maybe directly check users and subscribe them
self.env['slide.channel'].sudo().search([('enroll_group_ids', 'in', self._ids)])._add_groups_members()
diff --git a/addons/website_slides/models/res_partner.py b/addons/website_slides/models/res_partner.py
index 9d92160dfc290..c6d97ea0a9364 100644
--- a/addons/website_slides/models/res_partner.py
+++ b/addons/website_slides/models/res_partner.py
@@ -6,7 +6,7 @@
class ResPartner(models.Model):
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
slide_channel_ids = fields.Many2many(
'slide.channel', string='eLearning Courses',
diff --git a/addons/website_slides/models/res_users.py b/addons/website_slides/models/res_users.py
index d4ff8ac4f6f85..3fbdbb643b21d 100644
--- a/addons/website_slides/models/res_users.py
+++ b/addons/website_slides/models/res_users.py
@@ -4,13 +4,13 @@
from odoo import api, models, _
-class Users(models.Model):
- _inherit = 'res.users'
+class ResUsers(models.Model):
+ _inherit = ['res.users']
@api.model_create_multi
def create(self, vals_list):
""" Trigger automatic subscription based on user groups """
- users = super(Users, self).create(vals_list)
+ users = super().create(vals_list)
for user in users:
self.env['slide.channel'].sudo().search([
('enroll_group_ids', 'in', user.groups_id.ids)
@@ -19,7 +19,7 @@ def create(self, vals_list):
def write(self, vals):
""" Trigger automatic subscription based on updated user groups """
- res = super(Users, self).write(vals)
+ res = super().write(vals)
sanitized_vals = self._remove_reified_groups(vals)
if sanitized_vals.get('groups_id'):
added_group_ids = [command[1] for command in sanitized_vals['groups_id'] if command[0] == 4]
@@ -28,7 +28,7 @@ def write(self, vals):
return res
def get_gamification_redirection_data(self):
- res = super(Users, self).get_gamification_redirection_data()
+ res = super().get_gamification_redirection_data()
res.append({
'url': '/slides',
'label': _('See our eLearning')
diff --git a/addons/website_slides/models/slide_channel.py b/addons/website_slides/models/slide_channel.py
index a0689a9918929..b71de6f18d24c 100644
--- a/addons/website_slides/models/slide_channel.py
+++ b/addons/website_slides/models/slide_channel.py
@@ -17,8 +17,7 @@
_logger = logging.getLogger(__name__)
-class ChannelUsersRelation(models.Model):
- _name = 'slide.channel.partner'
+class SlideChannelPartner(models.Model):
_description = 'Channel / Partners (Members)'
_table = 'slide_channel_partner'
_rec_name = 'partner_id'
@@ -164,7 +163,7 @@ def unlink(self):
for channel_partner in self
])
self.env['slide.slide.partner'].search(removed_slide_partner_domain).unlink()
- return super(ChannelUsersRelation, self).unlink()
+ return super().unlink()
def _get_invitation_hash(self):
""" Returns the invitation hash of the attendee, used to access courses as invited / joined. """
@@ -271,9 +270,8 @@ def _gc_slide_channel_partner(self):
expired_invitations.unlink()
-class Channel(models.Model):
+class SlideChannel(models.Model):
""" A channel is a container of slides. """
- _name = 'slide.channel'
_description = 'Course'
_inherit = [
'rating.mixin',
@@ -584,7 +582,7 @@ def _compute_slides_statistics(self):
record.update(result.get(record.id, default_vals))
def _compute_rating_stats(self):
- super(Channel, self)._compute_rating_stats()
+ super()._compute_rating_stats()
for record in self:
record.rating_avg_stars = record.rating_avg
@@ -656,7 +654,7 @@ def _compute_website_default_background_image_url(self):
@api.depends('name', 'website_id.domain')
def _compute_website_url(self):
- super(Channel, self)._compute_website_url()
+ super()._compute_website_url()
for channel in self:
if channel.id: # avoid to perform a slug on a not yet saved record in case of an onchange.
base_url = channel.get_base_url()
@@ -703,7 +701,7 @@ def _init_column(self, column_name):
it for every record.
"""
if column_name != 'access_token':
- super(Channel, self)._init_column(column_name)
+ super()._init_column(column_name)
else:
query = """
UPDATE %(table_name)s
@@ -723,7 +721,7 @@ def create(self, vals_list):
if not is_html_empty(vals.get('description')) and is_html_empty(vals.get('description_short')):
vals['description_short'] = vals['description']
- channels = super(Channel, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
+ channels = super(SlideChannel, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
for channel in channels:
if channel.user_id:
@@ -748,7 +746,7 @@ def write(self, vals):
if not is_html_empty(vals.get('description')) and is_html_empty(vals.get('description_short')) and self.description == self.description_short:
vals['description_short'] = vals.get('description')
- res = super(Channel, self).write(vals)
+ res = super().write(vals)
if vals.get('user_id'):
self._action_add_members(self.env['res.users'].sudo().browse(vals['user_id']).partner_id)
@@ -789,12 +787,12 @@ def toggle_active(self):
to_archive = self.filtered(lambda channel: channel.active)
to_activate = self.filtered(lambda channel: not channel.active)
if to_archive:
- super(Channel, to_archive).toggle_active()
+ super(SlideChannel, to_archive).toggle_active()
to_archive.is_published = False
to_archive.mapped('slide_ids').action_archive()
if to_activate:
to_activate.with_context(active_test=False).mapped('slide_ids').action_unarchive()
- super(Channel, to_activate).toggle_active()
+ super(SlideChannel, to_activate).toggle_active()
@api.returns('mail.message', lambda value: value.id)
def message_post(self, *, parent_id=False, subtype_id=False, **kwargs):
@@ -1121,7 +1119,7 @@ def action_refuse_access(self, partner_id):
def _rating_domain(self):
""" Only take the published rating into account to compute avg and count """
- domain = super(Channel, self)._rating_domain()
+ domain = super()._rating_domain()
return expression.AND([domain, [('is_internal', '=', False)]])
def _action_request_access(self, partner):
diff --git a/addons/website_slides/models/slide_channel_tag.py b/addons/website_slides/models/slide_channel_tag.py
index 2829e273cb1b0..f43431083d02d 100644
--- a/addons/website_slides/models/slide_channel_tag.py
+++ b/addons/website_slides/models/slide_channel_tag.py
@@ -7,9 +7,8 @@
class SlideChannelTagGroup(models.Model):
- _name = 'slide.channel.tag.group'
_description = 'Channel/Course Groups'
- _inherit = 'website.published.mixin'
+ _inherit = ['website.published.mixin']
_order = 'sequence asc'
name = fields.Char('Group Name', required=True, translate=True)
@@ -21,7 +20,6 @@ def _default_is_published(self):
class SlideChannelTag(models.Model):
- _name = 'slide.channel.tag'
_description = 'Channel/Course Tag'
_order = 'group_sequence asc, sequence asc'
diff --git a/addons/website_slides/models/slide_embed.py b/addons/website_slides/models/slide_embed.py
index f2d0172cab860..ba1c247da25b0 100644
--- a/addons/website_slides/models/slide_embed.py
+++ b/addons/website_slides/models/slide_embed.py
@@ -4,9 +4,8 @@
from odoo import _, api, fields, models
-class EmbeddedSlide(models.Model):
+class SlideEmbed(models.Model):
""" Embedding in third party websites. Track view count, generate statistics. """
- _name = 'slide.embed'
_description = 'Embedded Slides View Counter'
_rec_name = 'website_name'
diff --git a/addons/website_slides/models/slide_question.py b/addons/website_slides/models/slide_question.py
index a092b1a874dca..8ce82839e9d3a 100644
--- a/addons/website_slides/models/slide_question.py
+++ b/addons/website_slides/models/slide_question.py
@@ -6,7 +6,6 @@
class SlideQuestion(models.Model):
- _name = "slide.question"
_rec_name = "question"
_description = "Content Quiz Question"
_order = "sequence"
@@ -58,8 +57,8 @@ def _compute_answers_validation_error(self):
'This question must have at least one correct answer and one incorrect answer.'
) if not correct or correct == question.answer_ids else ''
+
class SlideAnswer(models.Model):
- _name = "slide.answer"
_rec_name = "text_value"
_description = "Slide Question's Answer"
_order = 'question_id, sequence, id'
diff --git a/addons/website_slides/models/slide_slide.py b/addons/website_slides/models/slide_slide.py
index f23739e01c7fd..ff67c8e35faec 100644
--- a/addons/website_slides/models/slide_slide.py
+++ b/addons/website_slides/models/slide_slide.py
@@ -21,8 +21,7 @@
_logger = logging.getLogger(__name__)
-class SlidePartnerRelation(models.Model):
- _name = 'slide.slide.partner'
+class SlideSlidePartner(models.Model):
_description = 'Slide / Partner decorated m2m'
_table = 'slide_slide_partner'
_rec_name = 'partner_id'
@@ -62,7 +61,7 @@ def write(self, values):
slides_completion_to_recompute = self.filtered(
lambda slide_partner: slide_partner.completed != values['completed'])
- res = super(SlidePartnerRelation, self).write(values)
+ res = super().write(values)
if slides_completion_to_recompute:
slides_completion_to_recompute._recompute_completion()
@@ -79,7 +78,6 @@ def _recompute_completion(self):
class SlideTag(models.Model):
""" Tag to search slides across channels. """
- _name = 'slide.tag'
_description = 'Slide Tag'
name = fields.Char('Name', required=True, translate=True)
@@ -89,8 +87,7 @@ class SlideTag(models.Model):
]
-class Slide(models.Model):
- _name = 'slide.slide'
+class SlideSlide(models.Model):
_inherit = [
'mail.thread',
'image.mixin',
@@ -591,7 +588,7 @@ def _on_change_slide_category(self):
@api.depends('name', 'channel_id.website_id.domain')
def _compute_website_url(self):
- super(Slide, self)._compute_website_url()
+ super()._compute_website_url()
for slide in self:
if slide.id: # avoid to perform a slug on a not yet saved record in case of an onchange.
base_url = slide.channel_id.get_base_url()
@@ -669,7 +666,7 @@ def write(self, values):
elif values['slide_category'] != 'article':
values = {'html_content': False, **values}
- res = super(Slide, self).write(values)
+ res = super().write(values)
if values.get('is_published'):
self.date_published = datetime.datetime.now()
self._post_publication()
@@ -705,14 +702,14 @@ def unlink(self):
for category in self.filtered(lambda slide: slide.is_category):
category.channel_id._move_category_slides(category, False)
channel_partner_ids = self.channel_id.channel_partner_ids
- res = super(Slide, self).unlink()
+ res = super().unlink()
channel_partner_ids._recompute_completion()
return res
def toggle_active(self):
# archiving/unarchiving a channel does it on its slides, too
to_archive = self.filtered(lambda slide: slide.active)
- res = super(Slide, self).toggle_active()
+ res = super().toggle_active()
if to_archive:
to_archive.filtered(lambda slide: not slide.is_category).is_published = False
return res
@@ -726,7 +723,7 @@ def message_post(self, *, message_type='notification', **kwargs):
self.ensure_one()
if message_type == 'comment' and not self.channel_id.can_comment: # user comments have a restriction on karma
raise AccessError(_('Not enough karma to comment'))
- return super(Slide, self).message_post(message_type=message_type, **kwargs)
+ return super().message_post(message_type=message_type, **kwargs)
def _get_access_action(self, access_uid=None, force_website=False):
""" Instead of the classic form view, redirect to website if it is published. """
@@ -739,7 +736,7 @@ def _get_access_action(self, access_uid=None, force_website=False):
'target_type': 'public',
'res_id': self.id,
}
- return super(Slide, self)._get_access_action(access_uid=access_uid, force_website=force_website)
+ return super()._get_access_action(access_uid=access_uid, force_website=force_website)
def _notify_get_recipients_groups(self, message, model_description, msg_vals=None):
""" Add access button to everyone if the document is active. """
@@ -1308,7 +1305,7 @@ def _fetch_vimeo_metadata(self, image_url_only=False):
return slide_metadata, None
def _default_website_meta(self):
- res = super(Slide, self)._default_website_meta()
+ res = super()._default_website_meta()
res['default_opengraph']['og:title'] = res['default_twitter']['twitter:title'] = self.name
res['default_opengraph']['og:description'] = res['default_twitter']['twitter:description'] = html2plaintext(self.description)
res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = self.env['website'].image_url(self, 'image_1024')
diff --git a/addons/website_slides/models/slide_slide_resource.py b/addons/website_slides/models/slide_slide_resource.py
index 4b9cc3eb145ec..dd0c808213fd3 100644
--- a/addons/website_slides/models/slide_slide_resource.py
+++ b/addons/website_slides/models/slide_slide_resource.py
@@ -8,8 +8,7 @@
from odoo.tools.mimetypes import get_extension
-class SlideResource(models.Model):
- _name = 'slide.slide.resource'
+class SlideSlideResource(models.Model):
_description = "Additional resource for a particular slide"
_order = "sequence, id"
diff --git a/addons/website_slides/models/website.py b/addons/website_slides/models/website.py
index 7cbf3be303c55..47ac6a165dc82 100644
--- a/addons/website_slides/models/website.py
+++ b/addons/website_slides/models/website.py
@@ -5,7 +5,7 @@
class Website(models.Model):
- _inherit = "website"
+ _inherit = ["website"]
website_slide_google_app_key = fields.Char('Google Doc Key', groups='base.group_system')
diff --git a/addons/website_slides/wizard/slide_channel_invite.py b/addons/website_slides/wizard/slide_channel_invite.py
index da1dbd19ac175..a6d40f9596d5a 100644
--- a/addons/website_slides/wizard/slide_channel_invite.py
+++ b/addons/website_slides/wizard/slide_channel_invite.py
@@ -13,8 +13,7 @@
class SlideChannelInvite(models.TransientModel):
- _name = 'slide.channel.invite'
- _inherit = 'mail.composer.mixin'
+ _inherit = ['mail.composer.mixin']
_description = 'Channel Invitation Wizard'
# composer content
diff --git a/addons/website_slides_forum/models/forum_forum.py b/addons/website_slides_forum/models/forum_forum.py
index f78891365dd39..4d6ee2a4382e9 100644
--- a/addons/website_slides_forum/models/forum_forum.py
+++ b/addons/website_slides_forum/models/forum_forum.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Forum(models.Model):
- _inherit = 'forum.forum'
+class ForumForum(models.Model):
+ _inherit = ['forum.forum']
slide_channel_ids = fields.One2many('slide.channel', 'forum_id', 'Courses', help="Edit the course linked to this forum on the course form.")
slide_channel_id = fields.Many2one('slide.channel', 'Course', compute='_compute_slide_channel_id', store=True)
diff --git a/addons/website_slides_forum/models/slide_channel.py b/addons/website_slides_forum/models/slide_channel.py
index 27d3e7dfedec5..32f325a0a564d 100644
--- a/addons/website_slides_forum/models/slide_channel.py
+++ b/addons/website_slides_forum/models/slide_channel.py
@@ -4,8 +4,8 @@
from odoo import api, fields, models
-class Channel(models.Model):
- _inherit = 'slide.channel'
+class SlideChannel(models.Model):
+ _inherit = ['slide.channel']
forum_id = fields.Many2one('forum.forum', 'Course Forum', copy=False)
forum_total_posts = fields.Integer('Number of active forum posts', related="forum_id.total_posts")
@@ -27,14 +27,14 @@ def action_redirect_to_forum(self):
@api.model_create_multi
def create(self, vals_list):
- channels = super(Channel, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
+ channels = super(SlideChannel, self.with_context(mail_create_nosubscribe=True)).create(vals_list)
channels.forum_id.privacy = False
return channels
def write(self, vals):
old_forum = self.forum_id
- res = super(Channel, self).write(vals)
+ res = super().write(vals)
if 'forum_id' in vals:
self.forum_id.privacy = False
if old_forum != self.forum_id:
diff --git a/addons/website_slides_survey/models/slide_channel.py b/addons/website_slides_survey/models/slide_channel.py
index 68ff10b3bd328..dbc38d8d49866 100644
--- a/addons/website_slides_survey/models/slide_channel.py
+++ b/addons/website_slides_survey/models/slide_channel.py
@@ -6,14 +6,16 @@
from odoo import api, fields, models, _
from odoo.osv import expression
-class ChannelUsersRelation(models.Model):
- _inherit = 'slide.channel.partner'
+
+class SlideChannelPartner(models.Model):
+ _inherit = ['slide.channel.partner']
nbr_certification = fields.Integer(related='channel_id.nbr_certification')
survey_certification_success = fields.Boolean('Certified')
-class Channel(models.Model):
- _inherit = 'slide.channel'
+
+class SlideChannel(models.Model):
+ _inherit = ['slide.channel']
members_certified_count = fields.Integer('# Certified Attendees', compute='_compute_members_certified_count')
nbr_certification = fields.Integer("Number of Certifications", compute='_compute_slides_statistics', store=True)
diff --git a/addons/website_slides_survey/models/slide_slide.py b/addons/website_slides_survey/models/slide_slide.py
index 2d7eba173f202..de227c97a0d70 100644
--- a/addons/website_slides_survey/models/slide_slide.py
+++ b/addons/website_slides_survey/models/slide_slide.py
@@ -5,8 +5,8 @@
from odoo.osv import expression
-class SlidePartnerRelation(models.Model):
- _inherit = 'slide.slide.partner'
+class SlideSlidePartner(models.Model):
+ _inherit = ['slide.slide.partner']
user_input_ids = fields.One2many('survey.user_input', 'slide_partner_id', 'Certification attempts')
survey_scoring_success = fields.Boolean('Certification Succeeded', compute='_compute_survey_scoring_success', store=True)
@@ -29,7 +29,7 @@ def _compute_field_value(self, field):
})
def _recompute_completion(self):
- super(SlidePartnerRelation, self)._recompute_completion()
+ super()._recompute_completion()
# Update certified partners
certification_success_slides = self.filtered(lambda slide: slide.survey_scoring_success)
if not certification_success_slides:
@@ -43,8 +43,9 @@ def _recompute_completion(self):
certified_channels_domain]
)).survey_certification_success = True
-class Slide(models.Model):
- _inherit = 'slide.slide'
+
+class SlideSlide(models.Model):
+ _inherit = ['slide.slide']
name = fields.Char(compute='_compute_name', readonly=False, store=True)
slide_category = fields.Selection(selection_add=[
@@ -73,7 +74,7 @@ def _compute_mark_complete_actions(self):
slides_certification = self.filtered(lambda slide: slide.slide_category == 'certification')
slides_certification.can_self_mark_uncompleted = False
slides_certification.can_self_mark_completed = False
- super(Slide, self - slides_certification)._compute_mark_complete_actions()
+ super(SlideSlide, self - slides_certification)._compute_mark_complete_actions()
@api.depends('slide_category')
def _compute_is_preview(self):
@@ -85,11 +86,11 @@ def _compute_is_preview(self):
def _compute_slide_icon_class(self):
certification = self.filtered(lambda slide: slide.slide_type == 'certification')
certification.slide_icon_class = 'fa-trophy'
- super(Slide, self - certification)._compute_slide_icon_class()
+ super(SlideSlide, self - certification)._compute_slide_icon_class()
@api.depends('slide_category', 'source_type')
def _compute_slide_type(self):
- super(Slide, self)._compute_slide_type()
+ super()._compute_slide_type()
for slide in self:
if slide.slide_category == 'certification':
slide.slide_type = 'certification'
@@ -104,14 +105,14 @@ def create(self, vals_list):
def write(self, values):
old_surveys = self.mapped('survey_id')
- result = super(Slide, self).write(values)
+ result = super().write(values)
if 'survey_id' in values:
self._ensure_challenge_category(old_surveys=old_surveys - self.mapped('survey_id'))
return result
def unlink(self):
old_surveys = self.mapped('survey_id')
- result = super(Slide, self).unlink()
+ result = super().unlink()
self._ensure_challenge_category(old_surveys=old_surveys, unlink=True)
return result
diff --git a/addons/website_slides_survey/models/survey_survey.py b/addons/website_slides_survey/models/survey_survey.py
index 964a823a1c510..01faa65e21134 100644
--- a/addons/website_slides_survey/models/survey_survey.py
+++ b/addons/website_slides_survey/models/survey_survey.py
@@ -8,9 +8,8 @@
from odoo.tools import format_list
-
-class Survey(models.Model):
- _inherit = 'survey.survey'
+class SurveySurvey(models.Model):
+ _inherit = ['survey.survey']
slide_ids = fields.One2many(
'slide.slide', 'survey_id', string="Certification Slides",
diff --git a/addons/website_slides_survey/models/survey_user.py b/addons/website_slides_survey/models/survey_user.py
index 6561f04739b4e..7165844406c92 100644
--- a/addons/website_slides_survey/models/survey_user.py
+++ b/addons/website_slides_survey/models/survey_user.py
@@ -5,8 +5,8 @@
from odoo.osv import expression
-class SurveyUserInput(models.Model):
- _inherit = 'survey.user_input'
+class SurveyUser_Input(models.Model):
+ _inherit = ['survey.user_input']
slide_id = fields.Many2one('slide.slide', 'Related course slide',
help="The related course slide when there is no membership information")
@@ -16,12 +16,12 @@ class SurveyUserInput(models.Model):
@api.model_create_multi
def create(self, vals_list):
- records = super(SurveyUserInput, self).create(vals_list)
+ records = super().create(vals_list)
records._check_for_failed_attempt()
return records
def write(self, vals):
- res = super(SurveyUserInput, self).write(vals)
+ res = super().write(vals)
if 'state' in vals:
self._check_for_failed_attempt()
return res
diff --git a/addons/website_sms/models/website_visitor.py b/addons/website_sms/models/website_visitor.py
index 75c72e2ec9eb0..3b0a59003403f 100644
--- a/addons/website_sms/models/website_visitor.py
+++ b/addons/website_sms/models/website_visitor.py
@@ -6,7 +6,7 @@
class WebsiteVisitor(models.Model):
- _inherit = 'website.visitor'
+ _inherit = ['website.visitor']
def _check_for_sms_composer(self):
""" Purpose of this method is to actualize visitor model prior to contacting
diff --git a/odoo/addons/base/models/ir_actions.py b/odoo/addons/base/models/ir_actions.py
index a749e4bb4c8fa..cf3240b88f4c9 100644
--- a/odoo/addons/base/models/ir_actions.py
+++ b/odoo/addons/base/models/ir_actions.py
@@ -251,8 +251,7 @@ def _get_readable_fields(self):
}
-class IrActionsActWindow(models.Model):
- _name = 'ir.actions.act_window'
+class IrActionsAct_Window(models.Model):
_description = 'Action Window'
_table = 'ir_act_window'
_inherit = ['ir.actions.actions']
@@ -333,7 +332,7 @@ def _compute_embedded_actions(self):
def read(self, fields=None, load='_classic_read'):
""" call the method get_empty_list_help of the model and set the window action help message
"""
- result = super(IrActionsActWindow, self).read(fields, load=load)
+ result = super().read(fields, load=load)
if not fields or 'help' in fields:
for values in result:
model = values.get('res_model')
@@ -352,11 +351,11 @@ def create(self, vals_list):
for vals in vals_list:
if not vals.get('name') and vals.get('res_model'):
vals['name'] = self.env[vals['res_model']]._description
- return super(IrActionsActWindow, self).create(vals_list)
+ return super().create(vals_list)
def unlink(self):
self.env.registry.clear_cache()
- return super(IrActionsActWindow, self).unlink()
+ return super().unlink()
def exists(self):
ids = self._existing()
@@ -404,8 +403,7 @@ def _get_action_dict(self):
]
-class IrActionsActWindowView(models.Model):
- _name = 'ir.actions.act_window.view'
+class IrActionsAct_WindowView(models.Model):
_description = 'Action Window View'
_table = 'ir_act_window_view'
_rec_name = 'view_id'
@@ -419,14 +417,13 @@ class IrActionsActWindowView(models.Model):
multi = fields.Boolean(string='On Multiple Doc.', help="If set to true, the action will not be displayed on the right toolbar of a form view.")
def _auto_init(self):
- res = super(IrActionsActWindowView, self)._auto_init()
+ res = super()._auto_init()
tools.create_unique_index(self._cr, 'act_window_view_unique_mode_per_action',
self._table, ['act_window_id', 'view_mode'])
return res
-class IrActionsActWindowClose(models.Model):
- _name = 'ir.actions.act_window_close'
+class IrActionsAct_Window_Close(models.Model):
_description = 'Action Window Close'
_inherit = ['ir.actions.actions']
_table = 'ir_actions'
@@ -442,8 +439,7 @@ def _get_readable_fields(self):
}
-class IrActionsActUrl(models.Model):
- _name = 'ir.actions.act_url'
+class IrActionsAct_Url(models.Model):
_description = 'Action URL'
_table = 'ir_act_url'
_inherit = ['ir.actions.actions']
@@ -1070,6 +1066,7 @@ def _eval_value(self, eval_context=None):
result[action.id] = expr
return result
+
class IrActionsTodo(models.Model):
"""
Configuration Wizards
diff --git a/odoo/addons/base/models/ir_actions_report.py b/odoo/addons/base/models/ir_actions_report.py
index f9173813a8abc..2b6beac19904e 100644
--- a/odoo/addons/base/models/ir_actions_report.py
+++ b/odoo/addons/base/models/ir_actions_report.py
@@ -133,6 +133,7 @@ def _split_table(tree, max_rows):
else:
_logger.info('Wkhtmltoimage seems to be broken.')
+
class IrActionsReport(models.Model):
_description = 'Report Action'
_inherit = ['ir.actions.actions']
diff --git a/odoo/addons/base/models/ir_config_parameter.py b/odoo/addons/base/models/ir_config_parameter.py
index 9cd50bee195f8..16591f35a13a5 100644
--- a/odoo/addons/base/models/ir_config_parameter.py
+++ b/odoo/addons/base/models/ir_config_parameter.py
@@ -26,9 +26,8 @@
}
-class IrConfigParameter(models.Model):
+class IrConfig_Parameter(models.Model):
"""Per-database storage of configuration key-value pairs."""
- _name = 'ir.config_parameter'
_description = 'System Parameter'
_rec_name = 'key'
_order = 'key'
@@ -105,7 +104,7 @@ def set_param(self, key, value):
@api.model_create_multi
def create(self, vals_list):
self.env.registry.clear_cache()
- return super(IrConfigParameter, self).create(vals_list)
+ return super().create(vals_list)
def write(self, vals):
if 'key' in vals:
@@ -113,11 +112,11 @@ def write(self, vals):
if illegal:
raise ValidationError(_("You cannot rename config parameters with keys %s", ', '.join(illegal)))
self.env.registry.clear_cache()
- return super(IrConfigParameter, self).write(vals)
+ return super().write(vals)
def unlink(self):
self.env.registry.clear_cache()
- return super(IrConfigParameter, self).unlink()
+ return super().unlink()
@api.ondelete(at_uninstall=False)
def unlink_default_parameters(self):
diff --git a/odoo/addons/base/models/ir_demo_failure.py b/odoo/addons/base/models/ir_demo_failure.py
index 5c8a8d4ac6bc8..8c6343c291728 100644
--- a/odoo/addons/base/models/ir_demo_failure.py
+++ b/odoo/addons/base/models/ir_demo_failure.py
@@ -1,18 +1,17 @@
from odoo import api, fields, models
-class IrDemoFailure(models.TransientModel):
+class IrDemo_Failure(models.TransientModel):
""" Stores modules for which we could not install demo data
"""
- _name = 'ir.demo_failure'
_description = 'Demo failure'
module_id = fields.Many2one('ir.module.module', required=True, string="Module")
error = fields.Char(string="Error")
wizard_id = fields.Many2one('ir.demo_failure.wizard')
-class IrDemoFailureWizard(models.TransientModel):
- _name = 'ir.demo_failure.wizard'
+
+class IrDemo_FailureWizard(models.TransientModel):
_description = 'Demo Failure wizard'
failure_ids = fields.One2many(
diff --git a/odoo/addons/base/models/ir_fields.py b/odoo/addons/base/models/ir_fields.py
index 2bc33c91bcbdc..4ff2254d3c0aa 100644
--- a/odoo/addons/base/models/ir_fields.py
+++ b/odoo/addons/base/models/ir_fields.py
@@ -42,6 +42,7 @@ class ImportWarning(Warning):
class ConversionNotFound(ValueError):
pass
+
class IrFieldsConverter(models.AbstractModel):
_description = 'Fields Converter'
diff --git a/odoo/addons/base/models/ir_mail_server.py b/odoo/addons/base/models/ir_mail_server.py
index 41a4fe9f0cb17..cea166e499a3a 100644
--- a/odoo/addons/base/models/ir_mail_server.py
+++ b/odoo/addons/base/models/ir_mail_server.py
@@ -131,9 +131,8 @@ def _verify_check_hostname_callback(cnx, x509, err_no, err_depth, return_code, *
return True
-class IrMailServer(models.Model):
+class IrMail_Server(models.Model):
"""Represents an SMTP server, able to send outgoing emails, with SSL and TLS capabilities."""
- _name = "ir.mail_server"
_description = 'Mail Server'
_order = 'sequence, id'
_allow_sudo_commands = False
diff --git a/odoo/addons/base/models/ir_model.py b/odoo/addons/base/models/ir_model.py
index f9897794de884..8c155da7a52e8 100644
--- a/odoo/addons/base/models/ir_model.py
+++ b/odoo/addons/base/models/ir_model.py
@@ -186,17 +186,18 @@ def jsonify(val):
#
# IMPORTANT: this must be the first model declared in the module
#
+
+
class Base(models.AbstractModel):
""" The base model, which is implicitly inherited by all models. """
_description = 'Base'
-class Unknown(models.AbstractModel):
+class _Unknown(models.AbstractModel):
"""
Abstract model used as a substitute for relational fields with an unknown
comodel.
"""
- _name = '_unknown'
_description = 'Unknown'
diff --git a/odoo/addons/base/models/ir_module.py b/odoo/addons/base/models/ir_module.py
index ac6ffd7d02107..b96c581ae4534 100644
--- a/odoo/addons/base/models/ir_module.py
+++ b/odoo/addons/base/models/ir_module.py
@@ -75,6 +75,7 @@ def check_and_log(method, self, *args, **kwargs):
return method(self, *args, **kwargs)
return decorator(check_and_log, method)
+
class IrModuleCategory(models.Model):
_description = "Application"
_order = 'name'
@@ -967,6 +968,7 @@ def _load_module_terms(self, modules, langs, overwrite=False, imported_module=Fa
DEP_STATES = STATES + [('unknown', 'Unknown')]
+
class IrModuleModuleDependency(models.Model):
_description = "Module dependency"
_log_access = False # inserts are done manually, create and write uid, dates are always null
diff --git a/odoo/addons/base/models/ir_qweb_fields.py b/odoo/addons/base/models/ir_qweb_fields.py
index d75a15ed0fe42..d7a48f4c7415a 100644
--- a/odoo/addons/base/models/ir_qweb_fields.py
+++ b/odoo/addons/base/models/ir_qweb_fields.py
@@ -43,6 +43,7 @@ def nl2br_enclose(string: str, enclosure_tag: str = 'div') -> Markup:
# QWeb Fields converters
#--------------------------------------------------------------------
+
class IrQwebField(models.AbstractModel):
""" Used to convert a t-field specification into an output HTML field.
@@ -404,11 +405,11 @@ def _get_src_data_b64(self, value, options):
def value_to_html(self, value, options):
return Markup('
') % self._get_src_data_b64(value, options)
-class IrQwebFieldImageUrl(models.AbstractModel):
+
+class IrQwebFieldImage_Url(models.AbstractModel):
""" ``image_url`` widget rendering, inserts an image tag in the
document.
"""
- _name = 'ir.qweb.field.image_url'
_description = 'Qweb Field Image'
_inherit = ['ir.qweb.field.image']
@@ -416,6 +417,7 @@ class IrQwebFieldImageUrl(models.AbstractModel):
def value_to_html(self, value, options):
return Markup('
' % (value))
+
class IrQwebFieldMonetary(models.AbstractModel):
""" ``monetary`` converter, has a mandatory option
``display_currency`` only if field is not of type Monetary.
@@ -518,13 +520,12 @@ def record_to_html(self, record, field_name, options):
)
-class IrQwebFieldFloatTime(models.AbstractModel):
+class IrQwebFieldFloat_Time(models.AbstractModel):
""" ``float_time`` converter, to display integral or fractional values as
human-readable time spans (e.g. 1.5 as "01:30").
Can be used on any numerical field.
"""
- _name = 'ir.qweb.field.float_time'
_description = 'Qweb Field Float Time'
_inherit = ['ir.qweb.field']
diff --git a/odoo/addons/base/models/ir_rule.py b/odoo/addons/base/models/ir_rule.py
index a9abb7b8b32fd..57fe0af1cf975 100644
--- a/odoo/addons/base/models/ir_rule.py
+++ b/odoo/addons/base/models/ir_rule.py
@@ -9,6 +9,8 @@
from odoo.tools.safe_eval import safe_eval, time
_logger = logging.getLogger(__name__)
+
+
class IrRule(models.Model):
_description = 'Record Rule'
_order = 'model_id DESC,id'
diff --git a/odoo/addons/base/models/ir_sequence.py b/odoo/addons/base/models/ir_sequence.py
index c082b0b0d49f8..f09c74ad32211 100644
--- a/odoo/addons/base/models/ir_sequence.py
+++ b/odoo/addons/base/models/ir_sequence.py
@@ -309,8 +309,7 @@ def get(self, code):
return self.get_id(code, 'code')
-class IrSequenceDateRange(models.Model):
- _name = 'ir.sequence.date_range'
+class IrSequenceDate_Range(models.Model):
_description = 'Sequence Date Range'
_rec_name = "sequence_id"
_allow_sudo_commands = False
@@ -331,7 +330,7 @@ def _set_number_next_actual(self):
@api.model
def default_get(self, fields):
- result = super(IrSequenceDateRange, self).default_get(fields)
+ result = super().default_get(fields)
if 'number_next_actual' in fields:
result['number_next_actual'] = 1
return result
@@ -369,7 +368,7 @@ def create(self, vals_list):
def unlink(self):
_drop_sequences(self._cr, ["ir_sequence_%03d_%03d" % (x.sequence_id.id, x.id) for x in self])
- return super(IrSequenceDateRange, self).unlink()
+ return super().unlink()
def write(self, values):
if values.get('number_next'):
@@ -383,6 +382,6 @@ def write(self, values):
# - Changing the number next of a sequence is really really rare,
# - But selecting the number next happens a lot,
# Therefore, if I chose to put the flush just above the select, it would check the flush most of the time for no reason.
- res = super(IrSequenceDateRange, self).write(values)
+ res = super().write(values)
self.flush_model(values.keys())
return res
diff --git a/odoo/addons/base/models/ir_ui_view.py b/odoo/addons/base/models/ir_ui_view.py
index ddc2b8a094d21..660c923fd8e98 100644
--- a/odoo/addons/base/models/ir_ui_view.py
+++ b/odoo/addons/base/models/ir_ui_view.py
@@ -2361,7 +2361,6 @@ def reset_view_button(self):
class Base(models.AbstractModel):
- _name = "base"
_inherit = ['base']
diff --git a/odoo/addons/base/models/res_country.py b/odoo/addons/base/models/res_country.py
index 20dcfe073cb3d..97568c5415f5e 100644
--- a/odoo/addons/base/models/res_country.py
+++ b/odoo/addons/base/models/res_country.py
@@ -147,6 +147,7 @@ def _check_address_format(self):
except (ValueError, KeyError):
raise UserError(_('The layout contains an invalid format key'))
+
class ResCountryGroup(models.Model):
_description = "Country Group"
diff --git a/odoo/addons/base/models/res_partner.py b/odoo/addons/base/models/res_partner.py
index dec425f412586..ea079da55363d 100644
--- a/odoo/addons/base/models/res_partner.py
+++ b/odoo/addons/base/models/res_partner.py
@@ -60,6 +60,7 @@ def _get_view(self, view_id=None, view_type='form', **options):
node.set("string", vat_label)
return arch, view
+
class FormatAddressMixin(models.AbstractModel):
_description = 'Address Format'
@@ -175,6 +176,7 @@ def _search_display_name(self, operator, value):
return [('id', 'child_of', self._search(domain))]
return domain
+
class ResPartnerTitle(models.Model):
_order = 'name'
_description = 'Partner Title'
diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py
index 7b7fde3b37243..4b1a0d6a3675a 100644
--- a/odoo/addons/base/models/res_users.py
+++ b/odoo/addons/base/models/res_users.py
@@ -172,6 +172,7 @@ def wrapped(self, *args, **kwargs):
# Basic res.groups and res.users
#----------------------------------------------------------
+
class ResGroups(models.Model):
_description = "Access Groups"
_rec_name = 'full_name'
@@ -1435,6 +1436,7 @@ def _should_alert_new_device(self):
# to the implied groups (transitively).
#
+
class ResGroups(models.Model):
_inherit = ['res.groups']
@@ -1551,8 +1553,7 @@ def _get_group_definitions(self):
return SetDefinitions(data)
-class UsersImplied(models.Model):
- _name = 'res.users'
+class ResUsers(models.Model):
_inherit = ['res.users']
@api.model_create_multi
@@ -1575,7 +1576,7 @@ def write(self, values):
if demoted_users:
# demoted users are restricted to the assigned groups only
vals = {'groups_id': [Command.clear()] + values['groups_id']}
- super(UsersImplied, demoted_users).write(vals)
+ super(ResUsers, demoted_users).write(vals)
# add implied groups for all users (in batches)
users_batch = defaultdict(self.browse)
for user in self:
@@ -1583,7 +1584,7 @@ def write(self, values):
for groups, users in users_batch.items():
gs = set(concat(g.trans_implied_ids for g in groups))
vals = {'groups_id': [Command.link(g.id) for g in gs]}
- super(UsersImplied, users).write(vals)
+ super(ResUsers, users).write(vals)
return res
#
@@ -1608,6 +1609,7 @@ def write(self, values):
# ID is in 'groups_id' and ID is maximal in the set {ID1, ..., IDk}
#
+
class ResGroups(models.Model):
_inherit = ['res.groups']
@@ -2112,6 +2114,7 @@ def fields_get(self, allfields=None, attributes=None):
})
return res
+
class ResUsersIdentitycheck(models.TransientModel):
""" Wizard used to re-check the user's credentials (password) and eventually
revoke access to his account to every device he has an active session on.
@@ -2156,6 +2159,7 @@ def run_check(self):
# change password wizard
#----------------------------------------------------------
+
class ChangePasswordWizard(models.TransientModel):
""" A wizard to manage the change of users' passwords. """
_description = "Change Password Wizard"
@@ -2194,6 +2198,7 @@ def change_password_button(self):
# don't keep temporary passwords in the database longer than necessary
self.write({'new_passwd': False})
+
class ChangePasswordOwn(models.TransientModel):
_description = "User, change own password wizard"
_transient_max_hours = 0.1
@@ -2223,6 +2228,8 @@ def change_password(self):
# attacks on API keys isn't much of a concern
['pbkdf2_sha512'], pbkdf2_sha512__rounds=6000,
)
+
+
class ResUsers(models.Model):
_inherit = ['res.users']
@@ -2277,6 +2284,7 @@ def api_key_wizard(self):
'views': [(False, 'form')],
}
+
class ResUsersApikeys(models.Model):
_description = 'Users API Keys'
_auto = False # so we can have a secret column
@@ -2399,6 +2407,7 @@ def _gc_user_apikeys(self):
""", SQL.identifier(self._table)))
_logger.info("GC %r delete %d entries", self._name, self.env.cr.rowcount)
+
class ResUsersApikeysDescription(models.TransientModel):
_description = 'API Key Description'
@@ -2475,6 +2484,7 @@ def check_access_make_key(self):
if not self.env.user._is_internal():
raise AccessError(_("Only internal users can create API keys"))
+
class ResUsersApikeysShow(models.AbstractModel):
_description = 'Show API Key'
diff --git a/odoo/addons/base/report/report_base_report_irmodulereference.py b/odoo/addons/base/report/report_base_report_irmodulereference.py
index 4a88e0e1f0aa4..74a45144d3492 100644
--- a/odoo/addons/base/report/report_base_report_irmodulereference.py
+++ b/odoo/addons/base/report/report_base_report_irmodulereference.py
@@ -4,8 +4,7 @@
from odoo import api, models
-class IrModelReferenceReport(models.AbstractModel):
- _name = 'report.base.report_irmodulereference'
+class ReportBaseReport_Irmodulereference(models.AbstractModel):
_description = 'Module Reference Report (base)'
@api.model
diff --git a/odoo/addons/base/wizard/base_export_language.py b/odoo/addons/base/wizard/base_export_language.py
index 8c4572d58719f..29e09c536f716 100644
--- a/odoo/addons/base/wizard/base_export_language.py
+++ b/odoo/addons/base/wizard/base_export_language.py
@@ -10,8 +10,8 @@
NEW_LANG_KEY = '__new__'
+
class BaseLanguageExport(models.TransientModel):
- _name = "base.language.export"
_description = 'Language Export'
@api.model
diff --git a/odoo/addons/base/wizard/base_import_language.py b/odoo/addons/base/wizard/base_import_language.py
index 273ce33b93690..f3aca81ce71e0 100644
--- a/odoo/addons/base/wizard/base_import_language.py
+++ b/odoo/addons/base/wizard/base_import_language.py
@@ -15,7 +15,6 @@
class BaseLanguageImport(models.TransientModel):
- _name = "base.language.import"
_description = "Language Import"
name = fields.Char('Language Name', required=True)
diff --git a/odoo/addons/base/wizard/base_language_install.py b/odoo/addons/base/wizard/base_language_install.py
index 0cd328c455016..b1103d9aa3d36 100644
--- a/odoo/addons/base/wizard/base_language_install.py
+++ b/odoo/addons/base/wizard/base_language_install.py
@@ -5,7 +5,6 @@
class BaseLanguageInstall(models.TransientModel):
- _name = "base.language.install"
_description = "Install Language"
@api.model
diff --git a/odoo/addons/base/wizard/base_module_uninstall.py b/odoo/addons/base/wizard/base_module_uninstall.py
index 7a54d73258f69..a5c1589aeadfc 100644
--- a/odoo/addons/base/wizard/base_module_uninstall.py
+++ b/odoo/addons/base/wizard/base_module_uninstall.py
@@ -5,7 +5,6 @@
class BaseModuleUninstall(models.TransientModel):
- _name = "base.module.uninstall"
_description = "Module Uninstall"
show_all = fields.Boolean()
diff --git a/odoo/addons/base/wizard/base_module_update.py b/odoo/addons/base/wizard/base_module_update.py
index 3a5b413b78313..403a22dd27daf 100644
--- a/odoo/addons/base/wizard/base_module_update.py
+++ b/odoo/addons/base/wizard/base_module_update.py
@@ -4,7 +4,6 @@
class BaseModuleUpdate(models.TransientModel):
- _name = "base.module.update"
_description = "Update Module"
updated = fields.Integer('Number of modules updated', readonly=True)
diff --git a/odoo/addons/base/wizard/base_module_upgrade.py b/odoo/addons/base/wizard/base_module_upgrade.py
index ddbd4c8ade7ba..5adf0c224c2de 100644
--- a/odoo/addons/base/wizard/base_module_upgrade.py
+++ b/odoo/addons/base/wizard/base_module_upgrade.py
@@ -7,7 +7,6 @@
class BaseModuleUpgrade(models.TransientModel):
- _name = "base.module.upgrade"
_description = "Upgrade Module"
@api.model
diff --git a/odoo/addons/base/wizard/base_partner_merge.py b/odoo/addons/base/wizard/base_partner_merge.py
index a50d5f08b46fd..82bcadf28fbe6 100644
--- a/odoo/addons/base/wizard/base_partner_merge.py
+++ b/odoo/addons/base/wizard/base_partner_merge.py
@@ -15,9 +15,9 @@
_logger = logging.getLogger('odoo.addons.base.partner.merge')
-class MergePartnerLine(models.TransientModel):
- _name = 'base.partner.merge.line'
+class BasePartnerMergeLine(models.TransientModel):
+
_description = 'Merge Partner Line'
_order = 'min_id asc'
@@ -26,19 +26,18 @@ class MergePartnerLine(models.TransientModel):
aggr_ids = fields.Char('Ids', required=True)
-class MergePartnerAutomatic(models.TransientModel):
+class BasePartnerMergeAutomaticWizard(models.TransientModel):
"""
The idea behind this wizard is to create a list of potential partners to
merge. We use two objects, the first one is the wizard for the end-user.
And the second will contain the partner list to merge.
"""
- _name = 'base.partner.merge.automatic.wizard'
_description = 'Merge Partner Wizard'
@api.model
def default_get(self, fields):
- res = super(MergePartnerAutomatic, self).default_get(fields)
+ res = super().default_get(fields)
active_ids = self.env.context.get('active_ids')
if self.env.context.get('active_model') == 'res.partner' and active_ids:
if 'state' in fields:
diff --git a/odoo/addons/test_access_rights/models.py b/odoo/addons/test_access_rights/models.py
index d58441261039f..0668244ccf892 100644
--- a/odoo/addons/test_access_rights/models.py
+++ b/odoo/addons/test_access_rights/models.py
@@ -3,8 +3,8 @@
from odoo import api, fields, models
-class SomeObj(models.Model):
- _name = 'test_access_right.some_obj'
+
+class Test_Access_RightSome_Obj(models.Model):
_description = 'Object For Test Access Right'
val = fields.Integer()
@@ -18,28 +18,28 @@ class SomeObj(models.Model):
forbidden2 = fields.Integer(groups='test_access_rights.test_group')
forbidden3 = fields.Integer(groups=fields.NO_ACCESS)
-class Container(models.Model):
- _name = 'test_access_right.container'
+
+class Test_Access_RightContainer(models.Model):
_description = 'Test Access Right Container'
some_ids = fields.Many2many('test_access_right.some_obj', 'test_access_right_rel', 'container_id', 'some_id')
-class Inherits(models.Model):
- _name = 'test_access_right.inherits'
+
+class Test_Access_RightInherits(models.Model):
_description = 'Object for testing related access rights'
_inherits = {'test_access_right.some_obj': 'some_id'}
some_id = fields.Many2one('test_access_right.some_obj', required=True, ondelete='restrict')
-class Child(models.Model):
- _name = 'test_access_right.child'
+
+class Test_Access_RightChild(models.Model):
_description = 'Object for testing company ir rule'
parent_id = fields.Many2one('test_access_right.some_obj')
-class ObjCateg(models.Model):
- _name = 'test_access_right.obj_categ'
+
+class Test_Access_RightObj_Categ(models.Model):
_description = "Context dependent searchable model"
name = fields.Char(required=True)
@@ -51,11 +51,10 @@ def search_fetch(self, domain, field_names, offset=0, limit=None, order=None):
return super().search_fetch(domain, field_names, offset, limit, order)
-class FakeTicket(models.Model):
+class Test_Access_RightTicket(models.Model):
"""We want to simulate a record that would typically be accessed by a portal user,
with a relational field to records that could not be accessed by a portal user.
"""
- _name = 'test_access_right.ticket'
_description = 'Fake ticket For Test Access Right'
name = fields.Char()
@@ -66,8 +65,7 @@ class ResPartner(models.Model):
"""User inherits partner, so we are implicitly adding these fields to User
This essentially reproduces the (sad) situation introduced by account.
"""
- _name = 'res.partner'
- _inherit = 'res.partner'
+ _inherit = ['res.partner']
currency_id = fields.Many2one('res.currency', compute='_get_company_currency', readonly=True)
monetary = fields.Monetary() # implicitly depends on currency_id as currency_field
diff --git a/odoo/addons/test_action_bindings/models.py b/odoo/addons/test_action_bindings/models.py
index 0a1f6cfff5c5e..ebdce72119754 100644
--- a/odoo/addons/test_action_bindings/models.py
+++ b/odoo/addons/test_action_bindings/models.py
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
from odoo import models
-class A(models.Model):
- _name = _description = 'tab.a'
+class TabA(models.Model):
+ _description = 'tab.a'
-class B(models.Model):
- _name = _description = 'tab.b'
+
+class TabB(models.Model):
+ _description = 'tab.b'
diff --git a/odoo/addons/test_assetsbundle/models/ir_qweb.py b/odoo/addons/test_assetsbundle/models/ir_qweb.py
index f0768f4c6fc64..c511054dcfb53 100644
--- a/odoo/addons/test_assetsbundle/models/ir_qweb.py
+++ b/odoo/addons/test_assetsbundle/models/ir_qweb.py
@@ -4,7 +4,7 @@
class IrQweb(models.AbstractModel):
- _inherit = 'ir.qweb'
+ _inherit = ['ir.qweb']
def _register_hook(self):
super()._register_hook()
diff --git a/odoo/addons/test_auth_custom/__init__.py b/odoo/addons/test_auth_custom/__init__.py
index d82f8ef7db5b3..08d9c1f956b29 100644
--- a/odoo/addons/test_auth_custom/__init__.py
+++ b/odoo/addons/test_auth_custom/__init__.py
@@ -4,7 +4,7 @@
class IrHttp(models.AbstractModel):
- _inherit = 'ir.http'
+ _inherit = ['ir.http']
@classmethod
def _auth_method_thing(cls):
diff --git a/odoo/addons/test_convert/models.py b/odoo/addons/test_convert/models.py
index dc9ac83e7c07f..2007398b4cb6f 100644
--- a/odoo/addons/test_convert/models.py
+++ b/odoo/addons/test_convert/models.py
@@ -3,8 +3,8 @@
from odoo import api, fields, models
-class TestModel(models.Model):
- _name = 'test_convert.test_model'
+
+class Test_ConvertTest_Model(models.Model):
_description = "Test Convert Model"
name = fields.Char(translate=True)
@@ -22,8 +22,8 @@ def action_test_time(self, cur_time):
def action_test_timezone(self, timezone):
return True
-class Usered(models.Model):
- _name = 'test_convert.usered'
+
+class Test_ConvertUsered(models.Model):
_description = "z test model ignore"
name = fields.Char()
diff --git a/odoo/addons/test_converter/models.py b/odoo/addons/test_converter/models.py
index 115cc80018970..2174d58fa5f51 100644
--- a/odoo/addons/test_converter/models.py
+++ b/odoo/addons/test_converter/models.py
@@ -3,8 +3,8 @@
from odoo import models, fields, api
-class test_model(models.Model):
- _name = 'test_converter.test_model'
+
+class Test_ConverterTest_Model(models.Model):
_description = 'Test Converter Model'
char = fields.Char()
@@ -34,13 +34,11 @@ def _gbf_m2o(self, subs, domain):
return subs.browse(sub_ids)
-class test_model_sub(models.Model):
- _name = 'test_converter.test_model.sub'
+class Test_ConverterTest_ModelSub(models.Model):
_description = 'Subtraction For Test Model & Test Converter'
name = fields.Char()
-class test_model_monetary(models.Model):
- _name = 'test_converter.monetary'
+class Test_ConverterMonetary(models.Model):
_description = 'Test Converter Monetary'
value = fields.Float(digits=(16, 55))
diff --git a/odoo/addons/test_exceptions/models.py b/odoo/addons/test_exceptions/models.py
index cb218aaac3243..0baf65f9b0818 100644
--- a/odoo/addons/test_exceptions/models.py
+++ b/odoo/addons/test_exceptions/models.py
@@ -5,12 +5,12 @@
from odoo import models, api
from odoo.tools.safe_eval import safe_eval
-class m(models.Model):
+
+class TestExceptionsModel(models.Model):
""" This model exposes a few methods that will raise the different
exceptions that must be handled by the server (and its RPC layer)
and the clients.
"""
- _name = 'test.exceptions.model'
_description = 'Test Exception Model'
def generate_redirect_warning(self):
diff --git a/odoo/addons/test_http/models.py b/odoo/addons/test_http/models.py
index bc53bab4ced8f..5879c0ee977da 100644
--- a/odoo/addons/test_http/models.py
+++ b/odoo/addons/test_http/models.py
@@ -7,8 +7,7 @@
PEGASUS_REGIONS = ['M4R', 'P3Y', 'M6R']
-class Stargate(models.Model):
- _name = 'test_http.stargate'
+class Test_HttpStargate(models.Model):
_description = 'Stargate'
_inherit = ['mail.thread', 'mail.activity.mixin']
@@ -63,8 +62,7 @@ def _compute_glyph_compute(self):
gate.glyph_compute = gate.glyph_attach
-class Galaxy(models.Model):
- _name = 'test_http.galaxy'
+class Test_HttpGalaxy(models.Model):
_description = 'Galaxy'
name = fields.Char(required=True, help='The galaxy common name.')
diff --git a/odoo/addons/test_inherit/models/mother_inherit_1.py b/odoo/addons/test_inherit/models/mother_inherit_1.py
index 13b726389ad6c..0671c41b1bdad 100644
--- a/odoo/addons/test_inherit/models/mother_inherit_1.py
+++ b/odoo/addons/test_inherit/models/mother_inherit_1.py
@@ -4,6 +4,8 @@
# We add a new field in the parent model. Because of a recent refactoring, this
+
+
# feature was broken. These models rely on that feature.
class TestInheritMother(models.Model):
_inherit = ['test.inherit.mother']
@@ -19,15 +21,13 @@ def bar(self):
return 42
-class TestMotherUnderscore(models.Model):
- _name = 'test_mother_underscore'
+class Test_Mother_Underscore(models.Model):
_description = 'Test Inherit Underscore'
_inherit = ['test.inherit.mother']
# pylint: disable=E0102
-class TestMotherUnderscore(models.Model): # noqa: F811
- _name = 'test_mother_underscore'
+class Test_Mother_Underscore(models.Model): # noqa: F811
_inherit = ['test_mother_underscore']
foo = fields.Char()
diff --git a/odoo/addons/test_inherit/models/test_models.py b/odoo/addons/test_inherit/models/test_models.py
index e80dc4c35ab28..ebf1aa8724105 100644
--- a/odoo/addons/test_inherit/models/test_models.py
+++ b/odoo/addons/test_inherit/models/test_models.py
@@ -4,8 +4,7 @@
# We inherit from the parent model, and we add some fields in the child model
-class TestInheritDaughter(models.Model):
- _name = 'test_inherit_daughter'
+class Test_Inherit_Daughter(models.Model):
_description = 'Test Inherit Daughter'
template_id = fields.Many2one('test.inherit.mother', 'Template',
@@ -14,8 +13,7 @@ class TestInheritDaughter(models.Model):
# pylint: disable=E0102
-class TestInheritDaughter(models.Model): # noqa: F811
- _name = 'test_inherit_daughter'
+class Test_Inherit_Daughter(models.Model): # noqa: F811
_inherit = ['test_inherit_daughter']
# simply redeclare the field without adding any option
@@ -33,9 +31,10 @@ class ResPartner(models.Model):
# Check the overriding of property fields by non-property fields.
+
+
# Contribution by Adrien Peiffer (ACSONE).
-class TestInheritProperty(models.Model):
- _name = 'test_inherit_property'
+class Test_Inherit_Property(models.Model):
_description = 'Test Inherit Property'
name = fields.Char('Name', required=True)
@@ -44,8 +43,7 @@ class TestInheritProperty(models.Model):
# pylint: disable=E0102
-class TestInheritProperty(models.Model): # noqa: F811
- _name = 'test_inherit_property'
+class Test_Inherit_Property(models.Model): # noqa: F811
_inherit = ['test_inherit_property']
# override property_foo with a plain normal field
@@ -62,16 +60,16 @@ def _compute_bar(self):
#
# Extend a parent model after is has been inherited in a child model
#
-class TestInheritParent(models.AbstractModel):
- _name = 'test_inherit_parent'
+
+
+class Test_Inherit_Parent(models.AbstractModel):
_description = 'Test Inherit Parent'
def stuff(self):
return 'P1'
-class TestInheritChild(models.AbstractModel):
- _name = 'test_inherit_child'
+class Test_Inherit_Child(models.AbstractModel):
_inherit = ['test_inherit_parent']
_description = 'Test Inherit Child'
@@ -82,8 +80,7 @@ def stuff(self):
# pylint: disable=E0102
-class TestInheritParent(models.AbstractModel): # noqa: F811
- _name = 'test_inherit_parent'
+class Test_Inherit_Parent(models.AbstractModel): # noqa: F811
_inherit = ['test_inherit_parent']
foo = fields.Integer()
@@ -101,8 +98,9 @@ def _check_foo(self):
#
# Extend a selection field
#
-class TestNewApiSelection(models.Model):
- _name = 'test_new_api.selection'
+
+
+class Test_New_ApiSelection(models.Model):
_inherit = ['test_new_api.selection']
state = fields.Selection(selection_add=[('bar', 'Bar'), ('baz', 'Baz')])
@@ -115,15 +113,15 @@ def _other_values(self):
#
# Helper model used in test_inherit_depends
#
-class TestInheritMixin(models.AbstractModel):
- _name = 'test_inherit_mixin'
+
+
+class Test_Inherit_Mixin(models.AbstractModel):
_description = "Test Inherit Mixin"
published = fields.Boolean()
-class TestNewApiMessage(models.Model):
- _name = 'test_new_api.message'
+class Test_New_ApiMessage(models.Model):
_inherit = ['test_new_api.message']
body = fields.Text(translate=True) # Test conversion of char (with trigram indexed) to jsonb postgreSQL type
diff --git a/odoo/addons/test_inherit_depends/models.py b/odoo/addons/test_inherit_depends/models.py
index 707855b17411e..591b7f63d5374 100644
--- a/odoo/addons/test_inherit_depends/models.py
+++ b/odoo/addons/test_inherit_depends/models.py
@@ -3,8 +3,7 @@
from odoo import models, fields
-class PublishedFoo(models.Model):
- _name = 'test_new_api.foo'
+class Test_New_ApiFoo(models.Model):
_inherit = ['test_new_api.foo', 'test_inherit_mixin']
diff --git a/odoo/addons/test_inherits/models.py b/odoo/addons/test_inherits/models.py
index 129c5afd0b5aa..eff95dfd849a8 100644
--- a/odoo/addons/test_inherits/models.py
+++ b/odoo/addons/test_inherits/models.py
@@ -4,8 +4,7 @@
# We just create a new model
-class Unit(models.Model):
- _name = 'test.unit'
+class TestUnit(models.Model):
_description = 'Test Unit'
name = fields.Char('Name', required=True, translate=True)
@@ -21,8 +20,7 @@ def _compute_surname(self):
unit.surname = unit.name or ''
-class UnitLine(models.Model):
- _name = 'test.unit.line'
+class TestUnitLine(models.Model):
_description = 'Test Unit Line'
name = fields.Char('Name', required=True)
@@ -30,9 +28,10 @@ class UnitLine(models.Model):
# We want to _inherits from the parent model and we add some fields
+
+
# in the child object
-class Box(models.Model):
- _name = 'test.box'
+class TestBox(models.Model):
_inherits = {'test.unit': 'unit_id'}
_description = 'Test Box'
@@ -43,8 +42,7 @@ class Box(models.Model):
# We add a third level of _inherits
-class Pallet(models.Model):
- _name = 'test.pallet'
+class TestPallet(models.Model):
_inherits = {'test.box': 'box_id'}
_description = 'Test Pallet'
@@ -54,17 +52,17 @@ class Pallet(models.Model):
# Another model for another test suite
-class AnotherUnit(models.Model):
- _name = 'test.another_unit'
+class TestAnother_Unit(models.Model):
_description = 'Another Test Unit'
val1 = fields.Integer('Value 1', required=True)
# We want to _inherits from the parent model, add a field and check
+
+
# the new field is always equals to the first one
-class AnotherBox(models.Model):
- _name = 'test.another_box'
+class TestAnother_Box(models.Model):
_inherits = {'test.another_unit': 'another_unit_id'}
_description = 'Another Test Box'
diff --git a/odoo/addons/test_inherits_depends/models.py b/odoo/addons/test_inherits_depends/models.py
index 77ad3ad120606..84c9ec983d4fc 100644
--- a/odoo/addons/test_inherits_depends/models.py
+++ b/odoo/addons/test_inherits_depends/models.py
@@ -4,7 +4,7 @@
# We add a field on this model
-class Unit(models.Model):
- _inherit = 'test.unit'
+class TestUnit(models.Model):
+ _inherit = ['test.unit']
second_name = fields.Char()
diff --git a/odoo/addons/test_limits/models.py b/odoo/addons/test_limits/models.py
index 679a92c586a31..b96b2542fcab4 100644
--- a/odoo/addons/test_limits/models.py
+++ b/odoo/addons/test_limits/models.py
@@ -6,11 +6,11 @@
from odoo import models, api
-class m(models.Model):
+
+class TestLimitsModel(models.Model):
""" This model exposes a few methods that will consume between 'almost no
resource' and 'a lot of resource'.
"""
- _name = 'test.limits.model'
_description = 'Test Limits Model'
@api.model
diff --git a/odoo/addons/test_main_flows/models/model_multicompany.py b/odoo/addons/test_main_flows/models/model_multicompany.py
index 2a2827196fb62..e7cd7feaa584f 100644
--- a/odoo/addons/test_main_flows/models/model_multicompany.py
+++ b/odoo/addons/test_main_flows/models/model_multicompany.py
@@ -1,7 +1,7 @@
from odoo import models, fields
-class ModelMultiCompany(models.Model):
- _name = "test.model_multicompany"
+
+class TestModel_Multicompany(models.Model):
_description = "test multicompany model"
name = fields.Char()
diff --git a/odoo/addons/test_new_api/models/test_new_api.py b/odoo/addons/test_new_api/models/test_new_api.py
index 74d3f47424462..d7d7b1c66b60f 100644
--- a/odoo/addons/test_new_api/models/test_new_api.py
+++ b/odoo/addons/test_new_api/models/test_new_api.py
@@ -13,8 +13,7 @@
_logger = logging.getLogger('precompute_setter')
-class Category(models.Model):
- _name = 'test_new_api.category'
+class Test_New_ApiCategory(models.Model):
_description = 'Test New API Category'
_order = 'name'
_parent_store = True
@@ -86,8 +85,7 @@ def _fetch_query(self, query, fields):
return super()._fetch_query(query, fields)
-class Discussion(models.Model):
- _name = 'test_new_api.discussion'
+class Test_New_ApiDiscussion(models.Model):
_description = 'Test New API Discussion'
name = fields.Char(string='Title', required=True, help="Description of discussion.")
@@ -136,8 +134,7 @@ def _onchange_messages(self):
self.message_concat = "\n".join(["%s:%s" % (m.name, m.body) for m in self.messages])
-class Message(models.Model):
- _name = 'test_new_api.message'
+class Test_New_ApiMessage(models.Model):
_description = 'Test New API Message'
discussion = fields.Many2one('test_new_api.discussion', ondelete='cascade')
@@ -238,8 +235,7 @@ def write(self, vals):
return super().write(vals)
-class EmailMessage(models.Model):
- _name = 'test_new_api.emailmessage'
+class Test_New_ApiEmailmessage(models.Model):
_description = 'Test New API Email Message'
_inherits = {'test_new_api.message': 'message'}
@@ -249,23 +245,21 @@ class EmailMessage(models.Model):
active = fields.Boolean('Active Message', related='message.active', store=True, related_sudo=False)
-class DiscussionPartner(models.Model):
+class Test_New_ApiPartner(models.Model):
"""
Simplified model for partners. Having a specific model avoids all the
overrides from other modules that may change which fields are being read,
how many queries it takes to use that model, etc.
"""
- _name = 'test_new_api.partner'
_description = 'Discussion Partner'
name = fields.Char(string='Name')
-class Multi(models.Model):
+class Test_New_ApiMulti(models.Model):
""" Model for testing multiple onchange methods in cascade that modify a
one2many field several times.
"""
- _name = 'test_new_api.multi'
_description = 'Test New API Multi'
name = fields.Char(related='partner.name', readonly=True)
@@ -290,8 +284,7 @@ def _onchange_tags(self):
line.tags |= self.tags
-class MultiLine(models.Model):
- _name = 'test_new_api.multi.line'
+class Test_New_ApiMultiLine(models.Model):
_description = 'Test New API Multi Line'
multi = fields.Many2one('test_new_api.multi', ondelete='cascade')
@@ -300,14 +293,12 @@ class MultiLine(models.Model):
tags = fields.Many2many('test_new_api.multi.tag')
-class MultiLine2(models.Model):
- _name = 'test_new_api.multi.line2'
- _inherit = 'test_new_api.multi.line'
+class Test_New_ApiMultiLine2(models.Model):
+ _inherit = ['test_new_api.multi.line']
_description = 'Test New API Multi Line 2'
-class MultiTag(models.Model):
- _name = 'test_new_api.multi.tag'
+class Test_New_ApiMultiTag(models.Model):
_description = 'Test New API Multi Tag'
name = fields.Char()
@@ -322,8 +313,7 @@ def _compute_display_name(self):
record.display_name = name or ""
-class Edition(models.Model):
- _name = 'test_new_api.creativework.edition'
+class Test_New_ApiCreativeworkEdition(models.Model):
_description = 'Test New API Creative Work Edition'
name = fields.Char()
@@ -332,8 +322,7 @@ class Edition(models.Model):
res_model = fields.Char(related='res_model_id.model', store=True, readonly=False)
-class Book(models.Model):
- _name = 'test_new_api.creativework.book'
+class Test_New_ApiCreativeworkBook(models.Model):
_description = 'Test New API Creative Work Book'
name = fields.Char()
@@ -342,8 +331,7 @@ class Book(models.Model):
)
-class Movie(models.Model):
- _name = 'test_new_api.creativework.movie'
+class Test_New_ApiCreativeworkMovie(models.Model):
_description = 'Test New API Creative Work Movie'
name = fields.Char()
@@ -352,8 +340,7 @@ class Movie(models.Model):
)
-class MixedModel(models.Model):
- _name = 'test_new_api.mixed'
+class Test_New_ApiMixed(models.Model):
_description = 'Test New API Mixed'
foo = fields.Char()
@@ -394,8 +381,7 @@ def _reference_models(self):
if not model.model.startswith('ir.')]
-class BoolModel(models.Model):
- _name = 'domain.bool'
+class DomainBool(models.Model):
_description = 'Boolean Domain'
bool_true = fields.Boolean('b1', default=True)
@@ -403,8 +389,7 @@ class BoolModel(models.Model):
bool_undefined = fields.Boolean('b3')
-class Foo(models.Model):
- _name = 'test_new_api.foo'
+class Test_New_ApiFoo(models.Model):
_description = 'Test New API Foo'
name = fields.Char()
@@ -413,8 +398,7 @@ class Foo(models.Model):
text = fields.Char(trim=False)
-class Bar(models.Model):
- _name = 'test_new_api.bar'
+class Test_New_ApiBar(models.Model):
_description = 'Test New API Bar'
name = fields.Char()
@@ -435,8 +419,7 @@ def _search_foo(self, operator, value):
return [('name', 'in', records.mapped('name'))]
-class Related(models.Model):
- _name = 'test_new_api.related'
+class Test_New_ApiRelated(models.Model):
_description = 'Test New API Related'
name = fields.Char()
@@ -465,29 +448,28 @@ class Related(models.Model):
foo_bar_sudo_id_name = fields.Char('foo_bar_sudo_id_name', related='foo_bar_sudo_id.name', related_sudo=False)
-class RelatedFoo(models.Model):
- _name = _description = 'test_new_api.related_foo'
+class Test_New_ApiRelated_Foo(models.Model):
+ _description = 'test_new_api.related_foo'
name = fields.Char()
bar_id = fields.Many2one('test_new_api.related_bar')
bar_name = fields.Char('bar_name', related='bar_id.name', related_sudo=False)
-class RelatedBar(models.Model):
- _name = _description = 'test_new_api.related_bar'
+class Test_New_ApiRelated_Bar(models.Model):
+ _description = 'test_new_api.related_bar'
name = fields.Char()
-class RelatedInherits(models.Model):
- _name = _description = 'test_new_api.related_inherits'
+class Test_New_ApiRelated_Inherits(models.Model):
+ _description = 'test_new_api.related_inherits'
_inherits = {'test_new_api.related': 'base_id'}
base_id = fields.Many2one('test_new_api.related', required=True, ondelete='cascade')
-class ComputeReadonly(models.Model):
- _name = 'test_new_api.compute.readonly'
+class Test_New_ApiComputeReadonly(models.Model):
_description = 'Model with a computed readonly field'
foo = fields.Char(default='')
@@ -499,8 +481,7 @@ def _compute_bar(self):
record.bar = record.foo
-class ComputeInverse(models.Model):
- _name = 'test_new_api.compute.inverse'
+class Test_New_ApiComputeInverse(models.Model):
_description = 'Model with a computed inversed field'
foo = fields.Char()
@@ -524,8 +505,7 @@ def _check_constraint(self):
self._context.get('log', []).append('constraint')
-class ComputeSudo(models.Model):
- _name = 'test_new_api.compute.sudo'
+class Test_New_ApiComputeSudo(models.Model):
_description = 'Model with a compute_sudo field'
name_for_uid = fields.Char(compute='_compute_name_for_uid', compute_sudo=True)
@@ -535,9 +515,9 @@ def _compute_name_for_uid(self):
for record in self:
record.name_for_uid = self.env.user.name
-class MultiComputeInverse(models.Model):
+
+class Test_New_ApiMulti_Compute_Inverse(models.Model):
""" Model with the same inverse method for several fields. """
- _name = 'test_new_api.multi_compute_inverse'
_description = 'Test New API Multi Compute Inverse'
foo = fields.Char(default='', required=True)
@@ -563,8 +543,7 @@ def _inverse_bar23(self):
record.write({'foo': '/'.join([record.bar1, record.bar2, record.bar3])})
-class Move(models.Model):
- _name = 'test_new_api.move'
+class Test_New_ApiMove(models.Model):
_description = 'Move'
line_ids = fields.One2many('test_new_api.move_line', 'move_id', domain=[('visible', '=', True)])
@@ -593,8 +572,7 @@ def _compute_tag_string(self):
record.tag_string = (record.tag_name or "") * record.tag_repeat
-class MoveLine(models.Model):
- _name = 'test_new_api.move_line'
+class Test_New_ApiMove_Line(models.Model):
_description = 'Move Line'
move_id = fields.Many2one('test_new_api.move', required=True, ondelete='cascade')
@@ -602,23 +580,22 @@ class MoveLine(models.Model):
quantity = fields.Integer()
-class Payment(models.Model):
- _name = 'test_new_api.payment'
+class Test_New_ApiPayment(models.Model):
_description = 'Payment inherits from Move'
_inherits = {'test_new_api.move': 'move_id'}
move_id = fields.Many2one('test_new_api.move', required=True, ondelete='cascade')
-class Order(models.Model):
- _name = _description = 'test_new_api.order'
+class Test_New_ApiOrder(models.Model):
+ _description = 'test_new_api.order'
line_ids = fields.One2many('test_new_api.order.line', 'order_id')
line_short_field_name = fields.Integer(index=True)
-class OrderLine(models.Model):
- _name = _description = 'test_new_api.order.line'
+class Test_New_ApiOrderLine(models.Model):
+ _description = 'test_new_api.order.line'
order_id = fields.Many2one('test_new_api.order', required=True, ondelete='cascade')
product = fields.Char()
@@ -647,8 +624,7 @@ def unlink(self):
return super().unlink()
-class CompanyDependent(models.Model):
- _name = 'test_new_api.company'
+class Test_New_ApiCompany(models.Model):
_description = 'Test New API Company'
foo = fields.Char(company_dependent=True)
@@ -665,8 +641,7 @@ class CompanyDependent(models.Model):
partner_id = fields.Many2one('res.partner', company_dependent=True)
-class CompanyDependentAttribute(models.Model):
- _name = 'test_new_api.company.attr'
+class Test_New_ApiCompanyAttr(models.Model):
_description = 'Test New API Company Attribute'
company = fields.Many2one('test_new_api.company')
@@ -679,8 +654,7 @@ def _compute_bar(self):
record.bar = (record.company.foo or '') * record.quantity
-class ComputeRecursive(models.Model):
- _name = 'test_new_api.recursive'
+class Test_New_ApiRecursive(models.Model):
_description = 'Test New API Recursive'
name = fields.Char(required=True)
@@ -718,8 +692,7 @@ def _compute_context_dependent_name(self):
rec.context_dependent_name = rec.name
-class ComputeRecursiveTree(models.Model):
- _name = 'test_new_api.recursive.tree'
+class Test_New_ApiRecursiveTree(models.Model):
_description = 'Test New API Recursive with one2many field'
name = fields.Char(required=True)
@@ -734,14 +707,14 @@ def _compute_display_name(self):
rec.display_name = '%s(%s)' % (rec.name, ', '.join(children_names))
-class ComputeRecursiveOrder(models.Model):
- _name = _description = 'test_new_api.recursive.order'
+class Test_New_ApiRecursiveOrder(models.Model):
+ _description = 'test_new_api.recursive.order'
value = fields.Integer()
-class ComputeRecursiveLine(models.Model):
- _name = _description = 'test_new_api.recursive.line'
+class Test_New_ApiRecursiveLine(models.Model):
+ _description = 'test_new_api.recursive.line'
order_id = fields.Many2one('test_new_api.recursive.order')
task_ids = fields.One2many('test_new_api.recursive.task', 'line_id')
@@ -755,8 +728,8 @@ def _compute_task_number(self):
record.task_number = len(record.task_ids)
-class ComputeRecursiveTask(models.Model):
- _name = _description = 'test_new_api.recursive.task'
+class Test_New_ApiRecursiveTask(models.Model):
+ _description = 'test_new_api.recursive.task'
value = fields.Integer()
line_id = fields.Many2one('test_new_api.recursive.line',
@@ -773,8 +746,7 @@ def _compute_line_id(self):
record.line_id = record.line_id.search(domain, order='id desc', limit=1)
-class ComputeCascade(models.Model):
- _name = 'test_new_api.cascade'
+class Test_New_ApiCascade(models.Model):
_description = 'Test New API Cascade'
foo = fields.Char()
@@ -792,8 +764,7 @@ def _compute_baz(self):
record.baz = "<%s>" % (record.bar or "")
-class ComputeReadWrite(models.Model):
- _name = 'test_new_api.compute.readwrite'
+class Test_New_ApiComputeReadwrite(models.Model):
_description = 'Model with a computed non-readonly field'
foo = fields.Char()
@@ -805,8 +776,7 @@ def _compute_bar(self):
record.bar = record.foo
-class ComputeOnchange(models.Model):
- _name = 'test_new_api.compute.onchange'
+class Test_New_ApiComputeOnchange(models.Model):
_description = "Compute method as an onchange"
active = fields.Boolean()
@@ -860,8 +830,7 @@ def copy_data(self, default=None):
return [dict(vals, foo=self.env._("%s (copy)", record.foo)) for record, vals in zip(self, vals_list)]
-class ComputeOnchangeLine(models.Model):
- _name = 'test_new_api.compute.onchange.line'
+class Test_New_ApiComputeOnchangeLine(models.Model):
_description = "Line-like model for test_new_api.compute.onchange"
record_id = fields.Many2one('test_new_api.compute.onchange', ondelete='cascade')
@@ -874,8 +843,7 @@ def _compute_bar(self):
line.bar = (line.foo or "") + "r"
-class ComputeDynamicDepends(models.Model):
- _name = 'test_new_api.compute.dynamic.depends'
+class Test_New_ApiComputeDynamicDepends(models.Model):
_description = "Computed field with dynamic dependencies"
name1 = fields.Char()
@@ -895,8 +863,7 @@ def _compute_full_name(self):
record.full_name = ", ".join(filter(None, (record[fname] for fname in fnames)))
-class ComputeUnassigned(models.Model):
- _name = 'test_new_api.compute.unassigned'
+class Test_New_ApiComputeUnassigned(models.Model):
_description = "Model with computed fields left unassigned"
foo = fields.Char()
@@ -930,8 +897,7 @@ def _compute_bares(self):
record.bares = record.foo
-class ComputeOne2many(models.Model):
- _name = 'test_new_api.one2many'
+class Test_New_ApiOne2many(models.Model):
_description = "A computed editable one2many field with a domain"
name = fields.Char()
@@ -955,8 +921,7 @@ def _compute_line_ids(self):
record.line_ids = [(0, 0, {'name': record.name})]
-class ComputeOne2manyLine(models.Model):
- _name = 'test_new_api.one2many.line'
+class Test_New_ApiOne2manyLine(models.Model):
_description = "Line of a computed one2many"
name = fields.Char()
@@ -964,8 +929,7 @@ class ComputeOne2manyLine(models.Model):
container_id = fields.Many2one('test_new_api.one2many', required=True)
-class ModelBinary(models.Model):
- _name = 'test_new_api.model_binary'
+class Test_New_ApiModel_Binary(models.Model):
_description = 'Test Image field'
binary = fields.Binary()
@@ -980,8 +944,7 @@ def _compute_binary(self):
record.binary_computed = [(record.id, bool(record.binary))]
-class ModelImage(models.Model):
- _name = 'test_new_api.model_image'
+class Test_New_ApiModel_Image(models.Model):
_description = 'Test Image field'
name = fields.Char(required=True)
@@ -993,8 +956,7 @@ class ModelImage(models.Model):
image_64 = fields.Image("Image 64", related='image', max_width=64, max_height=64, store=True, attachment=False, readonly=False)
-class BinarySvg(models.Model):
- _name = 'test_new_api.binary_svg'
+class Test_New_ApiBinary_Svg(models.Model):
_description = 'Test SVG upload'
name = fields.Char(required=True)
@@ -1005,16 +967,15 @@ class BinarySvg(models.Model):
store=True, attachment=False,
)
-class MonetaryBase(models.Model):
- _name = 'test_new_api.monetary_base'
+
+class Test_New_ApiMonetary_Base(models.Model):
_description = 'Monetary Base'
base_currency_id = fields.Many2one('res.currency')
amount = fields.Monetary(currency_field='base_currency_id')
-class MonetaryRelated(models.Model):
- _name = 'test_new_api.monetary_related'
+class Test_New_ApiMonetary_Related(models.Model):
_description = 'Monetary Related'
monetary_id = fields.Many2one('test_new_api.monetary_base')
@@ -1023,8 +984,7 @@ class MonetaryRelated(models.Model):
total = fields.Monetary()
-class MonetaryCustom(models.Model):
- _name = 'test_new_api.monetary_custom'
+class Test_New_ApiMonetary_Custom(models.Model):
_description = 'Monetary Related Custom'
monetary_id = fields.Many2one('test_new_api.monetary_base')
@@ -1032,8 +992,7 @@ class MonetaryCustom(models.Model):
x_amount = fields.Monetary(related='monetary_id.amount')
-class MonetaryInherits(models.Model):
- _name = 'test_new_api.monetary_inherits'
+class Test_New_ApiMonetary_Inherits(models.Model):
_description = 'Monetary Inherits'
_inherits = {'test_new_api.monetary_base': 'monetary_id'}
@@ -1041,8 +1000,7 @@ class MonetaryInherits(models.Model):
currency_id = fields.Many2one('res.currency')
-class MonetaryOrder(models.Model):
- _name = 'test_new_api.monetary_order'
+class Test_New_ApiMonetary_Order(models.Model):
_description = 'Sales Order'
currency_id = fields.Many2one('res.currency')
@@ -1055,52 +1013,45 @@ def _compute_total(self):
record.total = sum(line.subtotal for line in record.line_ids)
-class MonetaryOrderLine(models.Model):
- _name = 'test_new_api.monetary_order_line'
+class Test_New_ApiMonetary_Order_Line(models.Model):
_description = 'Sales Order Line'
order_id = fields.Many2one('test_new_api.monetary_order', required=True, ondelete='cascade')
subtotal = fields.Float(digits=(10, 2))
-class FieldWithCaps(models.Model):
- _name = 'test_new_api.field_with_caps'
+class Test_New_ApiField_With_Caps(models.Model):
_description = 'Model with field defined with capital letters'
pArTneR_321_id = fields.Many2one('res.partner')
-class Selection(models.Model):
- _name = 'test_new_api.selection'
+class Test_New_ApiSelection(models.Model):
_description = "Selection"
state = fields.Selection([('foo', 'Foo'), ('bar', 'Bar')])
other = fields.Selection([('foo', 'Foo'), ('bar', 'Bar')])
-class RequiredM2O(models.Model):
- _name = 'test_new_api.req_m2o'
+class Test_New_ApiReq_M2o(models.Model):
_description = 'Required Many2one'
foo = fields.Many2one('res.currency', required=True, ondelete='cascade')
bar = fields.Many2one('res.country', required=True)
-class RequiredM2OTransient(models.TransientModel):
- _name = 'test_new_api.req_m2o_transient'
+class Test_New_ApiReq_M2o_Transient(models.TransientModel):
_description = 'Transient Model with Required Many2one'
foo = fields.Many2one('res.currency', required=True, ondelete='restrict')
bar = fields.Many2one('res.country', required=True)
-class TestTransient(models.TransientModel):
- _name = 'test_new_api.transient_model'
+class Test_New_ApiTransient_Model(models.TransientModel):
_description = 'Transient Model'
-class Attachment(models.Model):
- _name = 'test_new_api.attachment'
+class Test_New_ApiAttachment(models.Model):
_description = 'Attachment'
res_model = fields.Char(required=True)
@@ -1121,11 +1072,10 @@ def modified(self, fnames, *args, **kwargs):
record = comodel.browse(self.res_id)
record.invalidate_recordset(['attachment_ids'])
record.modified(['attachment_ids'])
- return super(Attachment, self).modified(fnames, *args, **kwargs)
+ return super().modified(fnames, *args, **kwargs)
-class AttachmentHost(models.Model):
- _name = 'test_new_api.attachment.host'
+class Test_New_ApiAttachmentHost(models.Model):
_description = 'Attachment Host'
attachment_ids = fields.One2many(
@@ -1133,8 +1083,8 @@ class AttachmentHost(models.Model):
domain=lambda self: [('res_model', '=', self._name)],
)
-class DecimalPrecisionTestModel(models.Model):
- _name = 'decimal.precision.test'
+
+class DecimalPrecisionTest(models.Model):
_description = 'Decimal Precision Test'
float = fields.Float()
@@ -1142,8 +1092,7 @@ class DecimalPrecisionTestModel(models.Model):
float_4 = fields.Float(digits=(16, 4))
-class ModelA(models.Model):
- _name = 'test_new_api.model_a'
+class Test_New_ApiModel_A(models.Model):
_description = 'Model A'
name = fields.Char()
@@ -1151,8 +1100,7 @@ class ModelA(models.Model):
b_restricted_b_ids = fields.Many2many('test_new_api.model_b', relation='rel_model_a_model_b_2', ondelete='restrict')
-class ModelB(models.Model):
- _name = 'test_new_api.model_b'
+class Test_New_ApiModel_B(models.Model):
_description = 'Model B'
name = fields.Char()
@@ -1160,16 +1108,14 @@ class ModelB(models.Model):
b_restricted_a_ids = fields.Many2many('test_new_api.model_a', relation='rel_model_a_model_b_2')
-class ModelParent(models.Model):
- _name = 'test_new_api.model_parent'
+class Test_New_ApiModel_Parent(models.Model):
_description = 'Model Multicompany parent'
name = fields.Char()
company_id = fields.Many2one('res.company')
-class ModelChild(models.Model):
- _name = 'test_new_api.model_child'
+class Test_New_ApiModel_Child(models.Model):
_description = 'Model Multicompany child'
_check_company_auto = True
@@ -1178,8 +1124,7 @@ class ModelChild(models.Model):
parent_id = fields.Many2one('test_new_api.model_parent', check_company=True)
-class ModelChildNoCheck(models.Model):
- _name = 'test_new_api.model_child_nocheck'
+class Test_New_ApiModel_Child_Nocheck(models.Model):
_description = 'Model Multicompany child'
_check_company_auto = True
@@ -1189,8 +1134,7 @@ class ModelChildNoCheck(models.Model):
# model with explicit and stored field 'display_name'
-class Display(models.Model):
- _name = 'test_new_api.display'
+class Test_New_ApiDisplay(models.Model):
_description = 'Model that overrides display_name'
display_name = fields.Char(compute='_compute_display_name', store=True)
@@ -1201,20 +1145,19 @@ def _compute_display_name(self):
# abstract model with automatic and non-stored field 'display_name'
-class Mixin(models.AbstractModel):
- _name = 'test_new_api.mixin'
+class Test_New_ApiMixin(models.AbstractModel):
_description = 'Dummy mixin model'
# in this model extension, the field 'display_name' should not be inherited from
+
+
# 'test_new_api.mixin'
-class ExtendedDisplay(models.Model):
- _name = 'test_new_api.display'
+class Test_New_ApiDisplay(models.Model):
_inherit = ['test_new_api.mixin', 'test_new_api.display']
-class ModelActiveField(models.Model):
- _name = 'test_new_api.model_active_field'
+class Test_New_ApiModel_Active_Field(models.Model):
_description = 'A model with active field'
name = fields.Char()
@@ -1237,16 +1180,14 @@ class ModelActiveField(models.Model):
parent_active = fields.Boolean(string='Active Parent', related='parent_id.active', store=True)
-class ModelMany2oneReference(models.Model):
- _name = 'test_new_api.model_many2one_reference'
+class Test_New_ApiModel_Many2one_Reference(models.Model):
_description = 'dummy m2oref model'
res_model = fields.Char('Resource Model')
res_id = fields.Many2oneReference('Resource ID', model_field='res_model')
-class InverseM2oRef(models.Model):
- _name = 'test_new_api.inverse_m2o_ref'
+class Test_New_ApiInverse_M2o_Ref(models.Model):
_description = 'dummy m2oref inverse model'
model_ids = fields.One2many('test_new_api.model_many2one_reference', 'res_id', string="Models")
@@ -1258,8 +1199,7 @@ def _compute_model_ids_count(self):
rec.model_ids_count = len(rec.model_ids)
-class ModelChildM2o(models.Model):
- _name = 'test_new_api.model_child_m2o'
+class Test_New_ApiModel_Child_M2o(models.Model):
_description = 'dummy model with override write and ValidationError'
name = fields.Char('Name')
@@ -1280,14 +1220,13 @@ def _compute_cost(self):
record.cost = len(record.name)
def write(self, vals):
- res = super(ModelChildM2o, self).write(vals)
+ res = super().write(vals)
if self.name == 'A':
raise ValidationError('the first existing child should not be changed when adding a new child to the parent')
return res
-class ModelParentM2o(models.Model):
- _name = 'test_new_api.model_parent_m2o'
+class Test_New_ApiModel_Parent_M2o(models.Model):
_description = 'dummy model with multiple childs'
name = fields.Char('Name')
@@ -1300,25 +1239,23 @@ def _compute_cost(self):
record.cost = sum(child.cost for child in record.child_ids)
-class Country(models.Model):
- _name = 'test_new_api.country'
+class Test_New_ApiCountry(models.Model):
_description = 'Country, ordered by name'
_order = 'name, id'
name = fields.Char()
-class City(models.Model):
- _name = 'test_new_api.city'
+class Test_New_ApiCity(models.Model):
_description = 'City, ordered by country then name'
_order = 'country_id, name, id'
name = fields.Char()
country_id = fields.Many2one('test_new_api.country')
+
# abstract model with a selection field
-class StateMixin(models.AbstractModel):
- _name = 'test_new_api.state_mixin'
+class Test_New_ApiState_Mixin(models.AbstractModel):
_description = 'Dummy state mixin model'
state = fields.Selection([
@@ -1328,8 +1265,7 @@ class StateMixin(models.AbstractModel):
])
-class SelectionBase(models.Model):
- _name = 'test_new_api.model_selection_base'
+class Test_New_ApiModel_Selection_Base(models.Model):
_description = "Model with a base selection field"
my_selection = fields.Selection([
@@ -1338,8 +1274,8 @@ class SelectionBase(models.Model):
])
-class SelectionBaseNullExplicit(models.Model):
- _inherit = 'test_new_api.model_selection_base'
+class Test_New_ApiModel_Selection_Base(models.Model):
+ _inherit = ['test_new_api.model_selection_base']
_description = "Model with a selection field extension with ondelete null"
my_selection = fields.Selection(selection_add=[
@@ -1347,8 +1283,8 @@ class SelectionBaseNullExplicit(models.Model):
], ondelete={'quux': 'set null'})
-class SelectionBaseNullImplicit(models.Model):
- _inherit = 'test_new_api.model_selection_base'
+class Test_New_ApiModel_Selection_Base(models.Model):
+ _inherit = ['test_new_api.model_selection_base']
_description = "Model with a selection field extension without ondelete"
my_selection = fields.Selection(selection_add=[
@@ -1356,8 +1292,7 @@ class SelectionBaseNullImplicit(models.Model):
])
-class SelectionRelated(models.Model):
- _name = 'test_new_api.model_selection_related'
+class Test_New_ApiModel_Selection_Related(models.Model):
_description = "Model with a related selection field"
selection_id = fields.Many2one(
@@ -1369,8 +1304,7 @@ class SelectionRelated(models.Model):
)
-class SelectionRelatedUpdatable(models.Model):
- _name = 'test_new_api.model_selection_related_updatable'
+class Test_New_ApiModel_Selection_Related_Updatable(models.Model):
_description = "Model with an updatable related selection field"
selection_id = fields.Many2one(
@@ -1383,8 +1317,7 @@ class SelectionRelatedUpdatable(models.Model):
)
-class SelectionRequired(models.Model):
- _name = 'test_new_api.model_selection_required'
+class Test_New_ApiModel_Selection_Required(models.Model):
_description = "Model with a required selection field"
active = fields.Boolean(default=True)
@@ -1394,8 +1327,8 @@ class SelectionRequired(models.Model):
], required=True, default='foo')
-class SelectionRequiredDefault(models.Model):
- _inherit = 'test_new_api.model_selection_required'
+class Test_New_ApiModel_Selection_Required(models.Model):
+ _inherit = ['test_new_api.model_selection_required']
_description = "Model with a selection field extension with ondelete default"
my_selection = fields.Selection(selection_add=[
@@ -1403,8 +1336,8 @@ class SelectionRequiredDefault(models.Model):
], ondelete={'baz': 'set default'})
-class SelectionRequiredCascade(models.Model):
- _inherit = 'test_new_api.model_selection_required'
+class Test_New_ApiModel_Selection_Required(models.Model):
+ _inherit = ['test_new_api.model_selection_required']
_description = "Model with a selection field extension with ondelete cascade"
my_selection = fields.Selection(selection_add=[
@@ -1412,8 +1345,8 @@ class SelectionRequiredCascade(models.Model):
], ondelete={'eggs': 'cascade'})
-class SelectionRequiredLiteral(models.Model):
- _inherit = 'test_new_api.model_selection_required'
+class Test_New_ApiModel_Selection_Required(models.Model):
+ _inherit = ['test_new_api.model_selection_required']
_description = "Model with a selection field extension with ondelete set