Skip to content

Commit

Permalink
[IMP] *: adapt model class names to correspond to model names (apply …
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorash committed Oct 15, 2024
1 parent 33690a9 commit f10bd8d
Show file tree
Hide file tree
Showing 2,565 changed files with 3,893 additions and 4,794 deletions.
2 changes: 1 addition & 1 deletion addons/account/demo/account_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 0 additions & 2 deletions addons/account/models/account_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class AccountAccount(models.Model):
_name = "account.account"
_inherit = ['mail.thread']
_description = "Account"
_order = "code, placeholder_code"
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/account_account_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class AccountAccountTag(models.Model):
_name = 'account.account.tag'
_description = 'Account Tag'

name = fields.Char('Tag Name', required=True, translate=True)
Expand Down
2 changes: 1 addition & 1 deletion addons/account/models/account_analytic_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class AccountAnalyticAccount(models.Model):
_inherit = 'account.analytic.account'
_inherit = ['account.analytic.account']

invoice_count = fields.Integer(
"Invoice Count",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion addons/account/models/account_analytic_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion addons/account/models/account_analytic_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion addons/account/models/account_bank_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions addons/account/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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')
1 change: 0 additions & 1 deletion addons/account/models/account_cash_rounding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion addons/account/models/account_code_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/account_full_reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/account_incoterms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class AccountIncoterms(models.Model):
_name = 'account.incoterms'
_description = 'Incoterms'

name = fields.Char(
Expand Down
3 changes: 1 addition & 2 deletions addons/account/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions addons/account/models/account_journal_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 1 addition & 2 deletions addons/account/models/account_lock_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 1 addition & 2 deletions addons/account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion addons/account/models/account_move_line_tax_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/account_move_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

# -------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/account_partial_reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class AccountPartialReconcile(models.Model):
_name = "account.partial.reconcile"
_description = "Partial Reconcile"

# ==== Reconciliation fields ====
Expand Down
4 changes: 2 additions & 2 deletions addons/account/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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')
2 changes: 0 additions & 2 deletions addons/account/models/account_payment_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class AccountPaymentMethod(models.Model):
_name = "account.payment.method"
_description = "Payment Methods"

name = fields.Char(required=True, translate=True)
Expand Down Expand Up @@ -94,7 +93,6 @@ def unlink(self):


class AccountPaymentMethodLine(models.Model):
_name = "account.payment.method.line"
_description = "Payment Methods"
_order = 'sequence, id'

Expand Down
3 changes: 1 addition & 2 deletions addons/account/models/account_payment_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand Down
5 changes: 1 addition & 4 deletions addons/account/models/account_reconcile_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class AccountReconcileModelPartnerMapping(models.Model):
_name = 'account.reconcile.model.partner.mapping'
_description = 'Partner mapping for reconciliation models'
_check_company_auto = True

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
6 changes: 1 addition & 5 deletions addons/account/models/account_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

DOMAIN_REGEX = re.compile(r'(-?sum)\((.*)\)')


class AccountReport(models.Model):
_name = "account.report"
_description = "Accounting Report"
_order = 'sequence, id'

Expand Down Expand Up @@ -291,7 +291,6 @@ def _compute_display_name(self):


class AccountReportLine(models.Model):
_name = "account.report.line"
_description = "Accounting Report Line"
_order = 'sequence, id'

Expand Down Expand Up @@ -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'

Expand Down Expand Up @@ -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'

Expand All @@ -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'
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/account_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class AccountRoot(models.Model):
_name = 'account.root'
_description = 'Account codes first 2 digits'
_auto = False
_table_query = '0'
Expand Down
3 changes: 0 additions & 3 deletions addons/account/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@


class AccountTaxGroup(models.Model):
_name = 'account.tax.group'
_description = 'Tax Group'
_order = 'sequence asc, id'
_check_company_auto = True
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/chart_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def wrapper(*args, **kwargs):


class AccountChartTemplate(models.AbstractModel):
_name = "account.chart.template"
_description = "Account Chart Template"

@property
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion addons/account/models/decimal_precision.py
Original file line number Diff line number Diff line change
@@ -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'):
Expand Down
Loading

0 comments on commit f10bd8d

Please sign in to comment.