From 7417d8fc138b9de550bc631435bcc08628c29bed Mon Sep 17 00:00:00 2001 From: Naglis Jonaitis Date: Wed, 31 Jul 2019 17:04:09 +0000 Subject: [PATCH] [IMP] *: fix typos in field definitions * account, crm, hr, im_livechat, l10n_ch, l10n_it_edi, mail, mass_mailing, project, stock, base - `String` -> `string`; - `defaut` -> `default`; - `defaults` -> `default`; - `reandonly` -> `readonly`; - removed redundant `placeholder` attribute for `Char` field; - removed redundant `size` attribute for `Float` and `Integer` fields; - changed to use `Selection` instead of `Char` for a field having a defined `selection`. closes odoo/odoo#35356 Signed-off-by: Martin Trigaux (mat) --- addons/account/models/account_move.py | 6 +++--- addons/crm/report/crm_activity_report.py | 2 +- addons/hr/models/hr_employee.py | 2 +- addons/im_livechat/report/im_livechat_report_channel.py | 2 +- addons/l10n_ch/models/account_invoice.py | 2 +- addons/l10n_it_edi/models/account_invoice.py | 2 +- addons/l10n_it_edi/models/res_company.py | 2 +- addons/mail/models/mail_alias.py | 2 +- addons/mass_mailing/models/mailing.py | 2 +- addons/project/report/project_report.py | 2 +- addons/stock/models/stock_inventory.py | 2 +- addons/stock/wizard/product_replenish.py | 2 +- addons/stock/wizard/stock_rules_report.py | 2 +- odoo/addons/base/models/ir_mail_server.py | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 569cf3532a7..af988981e37 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -96,7 +96,7 @@ class AccountMove(models.Model): ('in_refund', 'Vendor Credit Note'), ('out_receipt', 'Sales Receipt'), ('in_receipt', 'Purchase Receipt'), - ], String='Type', required=True, store=True, index=True, readonly=True, tracking=True, + ], string='Type', required=True, store=True, index=True, readonly=True, tracking=True, default="entry") to_check = fields.Boolean(string='To Check', default=False, help='If this checkbox is ticked, it means that the user was not sure of all the related informations at the time of the creation of the move and that the move needs to be checked again.') @@ -2151,9 +2151,9 @@ class AccountMoveLine(models.Model): compute='_amount_residual', help="The residual amount on a journal item expressed in its currency (possibly not the company currency).") full_reconcile_id = fields.Many2one('account.full.reconcile', string="Matching Number", copy=False, index=True) - matched_debit_ids = fields.One2many('account.partial.reconcile', 'credit_move_id', String='Matched Debits', + matched_debit_ids = fields.One2many('account.partial.reconcile', 'credit_move_id', string='Matched Debits', help='Debit journal items that are matched with this journal item.') - matched_credit_ids = fields.One2many('account.partial.reconcile', 'debit_move_id', String='Matched Credits', + matched_credit_ids = fields.One2many('account.partial.reconcile', 'debit_move_id', string='Matched Credits', help='Credit journal items that are matched with this journal item.') # ==== Analytic fields ==== diff --git a/addons/crm/report/crm_activity_report.py b/addons/crm/report/crm_activity_report.py index 554b49a3290..880145cca65 100644 --- a/addons/crm/report/crm_activity_report.py +++ b/addons/crm/report/crm_activity_report.py @@ -28,7 +28,7 @@ class ActivityReport(models.Model): company_id = fields.Many2one('res.company', 'Company', readonly=True) stage_id = fields.Many2one('crm.stage', 'Stage', readonly=True) partner_id = fields.Many2one('res.partner', 'Customer', readonly=True) - lead_type = fields.Char( + lead_type = fields.Selection( string='Type', selection=[('lead', 'Lead'), ('opportunity', 'Opportunity')], help="Type is used to separate Leads and Opportunities") diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index b1635bab5a7..a9252dac860 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -87,7 +87,7 @@ class HrEmployeePrivate(models.Model): ('master', 'Master'), ('other', 'Other'), ], 'Certificate Level', default='other', groups="hr.group_hr_user", tracking=True) - study_field = fields.Char("Field of Study", placeholder='Computer Science', groups="hr.group_hr_user", tracking=True) + study_field = fields.Char("Field of Study", groups="hr.group_hr_user", tracking=True) study_school = fields.Char("School", groups="hr.group_hr_user", tracking=True) emergency_contact = fields.Char("Emergency Contact", groups="hr.group_hr_user", tracking=True) emergency_phone = fields.Char("Emergency Phone", groups="hr.group_hr_user", tracking=True) diff --git a/addons/im_livechat/report/im_livechat_report_channel.py b/addons/im_livechat/report/im_livechat_report_channel.py index 70b1fc1d30f..b22e040327a 100644 --- a/addons/im_livechat/report/im_livechat_report_channel.py +++ b/addons/im_livechat/report/im_livechat_report_channel.py @@ -25,7 +25,7 @@ class ImLivechatReportChannel(models.Model): duration = fields.Float('Average duration', digits=(16, 2), readonly=True, group_operator="avg", help="Duration of the conversation (in seconds)") nbr_speaker = fields.Integer('# of speakers', readonly=True, group_operator="avg", help="Number of different speakers") nbr_message = fields.Integer('Average message', readonly=True, group_operator="avg", help="Number of message in the conversation") - is_without_answer = fields.Integer('Session(s) without answer', reandonly=True, group_operator="sum", + is_without_answer = fields.Integer('Session(s) without answer', readonly=True, group_operator="sum", help="""A session is without answer if the operator did not answer. If the visitor is also the operator, the session will always be answered.""") days_of_activity = fields.Integer('Days of activity', group_operator="max", readonly=True, help="Number of days since the first session of the operator") diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py index 3b72a00c1d4..775d206b7ae 100644 --- a/addons/l10n_ch/models/account_invoice.py +++ b/addons/l10n_ch/models/account_invoice.py @@ -25,7 +25,7 @@ class AccountMove(models.Model): l10n_ch_isr_valid = fields.Boolean(compute='_compute_l10n_ch_isr_valid', help='Boolean value. True iff all the data required to generate the ISR are present') - l10n_ch_isr_sent = fields.Boolean(defaut=False, help="Boolean value telling whether or not the ISR corresponding to this invoice has already been printed or sent by mail.") + l10n_ch_isr_sent = fields.Boolean(default=False, help="Boolean value telling whether or not the ISR corresponding to this invoice has already been printed or sent by mail.") l10n_ch_currency_name = fields.Char(related='currency_id.name', readonly=True, string="Currency Name", help="The name of this invoice's currency") #This field is used in the "invisible" condition field of the 'Print ISR' button. @api.depends('invoice_partner_bank_id.bank_id.l10n_ch_postal_eur', 'invoice_partner_bank_id.bank_id.l10n_ch_postal_chf') diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py index 4b4457c042e..ed6cf716493 100644 --- a/addons/l10n_it_edi/models/account_invoice.py +++ b/addons/l10n_it_edi/models/account_invoice.py @@ -39,7 +39,7 @@ class AccountMove(models.Model): could not be delivered to the addressee') # ok we must do nothing ], default='to_send', copy=False) - l10n_it_stamp_duty = fields.Float(default=0, string="Dati Bollo", size=15, readonly=True, states={'draft': [('readonly', False)]}) + l10n_it_stamp_duty = fields.Float(default=0, string="Dati Bollo", readonly=True, states={'draft': [('readonly', False)]}) l10n_it_ddt_id = fields.Many2one('l10n_it.ddt', string='DDT', readonly=True, states={'draft': [('readonly', False)]}, copy=False) diff --git a/addons/l10n_it_edi/models/res_company.py b/addons/l10n_it_edi/models/res_company.py index a0cce53b9a5..e37b451d36b 100644 --- a/addons/l10n_it_edi/models/res_company.py +++ b/addons/l10n_it_edi/models/res_company.py @@ -53,7 +53,7 @@ class ResCompany(models.Model): l10n_it_eco_index_number = fields.Char(string="Number in register of companies", size=20, help="This field must contain the number under which the\ seller/provider is listed on the register of companies.") - l10n_it_eco_index_share_capital = fields.Float(default="0.0", size=15, string="Share capital actually paid up", + l10n_it_eco_index_share_capital = fields.Float(default=0.0, string="Share capital actually paid up", help="Mandatory if the seller/provider is a company with share\ capital (SpA, SApA, Srl), this field must contain the amount\ of share capital actually paid up as resulting from the last\ diff --git a/addons/mail/models/mail_alias.py b/addons/mail/models/mail_alias.py index 2a8b9c6bde8..15447921645 100644 --- a/addons/mail/models/mail_alias.py +++ b/addons/mail/models/mail_alias.py @@ -39,7 +39,7 @@ class Alias(models.Model): # hack to only allow selecting mail_thread models (we might # (have a few false positives, though) domain="[('field_id.name', '=', 'message_ids')]") - alias_user_id = fields.Many2one('res.users', 'Owner', defaults=lambda self: self.env.user, + alias_user_id = fields.Many2one('res.users', 'Owner', default=lambda self: self.env.user, help="The owner of records created upon receiving emails on this alias. " "If this field is not set the system will attempt to find the right owner " "based on the sender (From) address, or will use the Administrator account " diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py index 919890d4e0c..417e7f3b6cc 100644 --- a/addons/mass_mailing/models/mailing.py +++ b/addons/mass_mailing/models/mailing.py @@ -268,7 +268,7 @@ class MassMailing(models.Model): received_ratio = fields.Integer(compute="_compute_statistics", string='Received Ratio') opened_ratio = fields.Integer(compute="_compute_statistics", string='Opened Ratio') replied_ratio = fields.Integer(compute="_compute_statistics", string='Replied Ratio') - bounced_ratio = fields.Integer(compute="_compute_statistics", String='Bounced Ratio') + bounced_ratio = fields.Integer(compute="_compute_statistics", string='Bounced Ratio') next_departure = fields.Datetime(compute="_compute_next_departure", string='Scheduled date') def _compute_total(self): diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py index c1cf00c71e7..4ae15340268 100644 --- a/addons/project/report/project_report.py +++ b/addons/project/report/project_report.py @@ -29,7 +29,7 @@ class ReportProjectTaskUser(models.Model): ('0', 'Low'), ('1', 'Normal'), ('2', 'High') - ], size=1, readonly=True, string="Priority") + ], readonly=True, string="Priority") state = fields.Selection([ ('normal', 'In Progress'), ('blocked', 'Blocked'), diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py index 888900a0c81..1c004048ddc 100644 --- a/addons/stock/models/stock_inventory.py +++ b/addons/stock/models/stock_inventory.py @@ -309,7 +309,7 @@ class InventoryLine(models.Model): inventory_date = fields.Datetime('Inventory Date', readonly=True, default=fields.Datetime.now, help="Last date at which the On Hand Quantity has been computed.") - outdated = fields.Boolean(String='Quantity oudated', + outdated = fields.Boolean(string='Quantity outdated', compute='_compute_outdated', search='_search_outdated') product_tracking = fields.Selection('Tracking', related='product_id.tracking', readonly=True) diff --git a/addons/stock/wizard/product_replenish.py b/addons/stock/wizard/product_replenish.py index 8d6c1df2b41..eac78f6b3a4 100644 --- a/addons/stock/wizard/product_replenish.py +++ b/addons/stock/wizard/product_replenish.py @@ -12,7 +12,7 @@ class ProductReplenish(models.TransientModel): _description = 'Product Replenish' product_id = fields.Many2one('product.product', string='Product', required=True) - product_tmpl_id = fields.Many2one('product.template', String='Product Template', required=True) + product_tmpl_id = fields.Many2one('product.template', string='Product Template', required=True) product_has_variants = fields.Boolean('Has variants', default=False, required=True) product_uom_category_id = fields.Many2one('uom.category', related='product_id.uom_id.category_id', readonly=True, required=True) product_uom_id = fields.Many2one('uom.uom', string='Unity of measure', required=True) diff --git a/addons/stock/wizard/stock_rules_report.py b/addons/stock/wizard/stock_rules_report.py index b637d2af591..8a20f393eac 100644 --- a/addons/stock/wizard/stock_rules_report.py +++ b/addons/stock/wizard/stock_rules_report.py @@ -9,7 +9,7 @@ class StockRulesReport(models.TransientModel): _description = 'Stock Rules report' product_id = fields.Many2one('product.product', string='Product', required=True) - product_tmpl_id = fields.Many2one('product.template', String='Product Template', required=True) + product_tmpl_id = fields.Many2one('product.template', string='Product Template', required=True) warehouse_ids = fields.Many2many('stock.warehouse', string='Warehouses', required=True, help="Show the routes that apply on selected warehouses.") product_has_variants = fields.Boolean('Has variants', default=False, required=True) diff --git a/odoo/addons/base/models/ir_mail_server.py b/odoo/addons/base/models/ir_mail_server.py index 3cdc256646b..c17a8ddbed6 100644 --- a/odoo/addons/base/models/ir_mail_server.py +++ b/odoo/addons/base/models/ir_mail_server.py @@ -144,7 +144,7 @@ class IrMailServer(models.Model): name = fields.Char(string='Description', required=True, index=True) smtp_host = fields.Char(string='SMTP Server', required=True, help="Hostname or IP of SMTP server") - smtp_port = fields.Integer(string='SMTP Port', size=5, required=True, default=25, help="SMTP Port. Usually 465 for SSL, and 25 or 587 for other cases.") + smtp_port = fields.Integer(string='SMTP Port', required=True, default=25, help="SMTP Port. Usually 465 for SSL, and 25 or 587 for other cases.") smtp_user = fields.Char(string='Username', help="Optional username for SMTP authentication", groups='base.group_system') smtp_pass = fields.Char(string='Password', help="Optional password for SMTP authentication", groups='base.group_system') smtp_encryption = fields.Selection([('none', 'None'),