[FIX] *: bad usage of _ method
No need for selection fields If in global variable, the _lt should be used instead closes odoo/odoo#31211 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
@@ -16,9 +16,9 @@ class AccountReconcileModel(models.Model):
|
||||
company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.company)
|
||||
|
||||
rule_type = fields.Selection(selection=[
|
||||
('writeoff_button', _('Manually create a write-off on clicked button.')),
|
||||
('writeoff_suggestion', _('Suggest counterpart values.')),
|
||||
('invoice_matching', _('Match existing invoices/bills.'))
|
||||
('writeoff_button', 'Manually create a write-off on clicked button.'),
|
||||
('writeoff_suggestion', 'Suggest counterpart values.'),
|
||||
('invoice_matching', 'Match existing invoices/bills.')
|
||||
], string='Type', default='writeoff_button', required=True)
|
||||
auto_reconcile = fields.Boolean(string='Auto-validate',
|
||||
help='Validate the statement line automatically (reconciliation based on your rule).')
|
||||
|
||||
@@ -1066,9 +1066,9 @@ class AccountReconcileModelTemplate(models.Model):
|
||||
sequence = fields.Integer(required=True, default=10)
|
||||
|
||||
rule_type = fields.Selection(selection=[
|
||||
('writeoff_button', _('Manually create a write-off on clicked button.')),
|
||||
('writeoff_suggestion', _('Suggest a write-off.')),
|
||||
('invoice_matching', _('Match existing invoices/bills.'))
|
||||
('writeoff_button', 'Manually create a write-off on clicked button.'),
|
||||
('writeoff_suggestion', 'Suggest a write-off.'),
|
||||
('invoice_matching', 'Match existing invoices/bills.')
|
||||
], string='Type', default='writeoff_button', required=True)
|
||||
auto_reconcile = fields.Boolean(string='Auto-validate',
|
||||
help='Validate the statement line automatically (reconciliation based on your rule).')
|
||||
|
||||
@@ -26,7 +26,7 @@ class EmployeeSkill(models.Model):
|
||||
level_progress = fields.Integer(related='skill_level_id.level_progress')
|
||||
|
||||
_sql_constraints = [
|
||||
('_unique_skill', 'unique (employee_id, skill_id)', _("Two levels for the same skill is not allowed")),
|
||||
('_unique_skill', 'unique (employee_id, skill_id)', "Two levels for the same skill is not allowed"),
|
||||
]
|
||||
|
||||
@api.constrains('skill_id', 'skill_type_id')
|
||||
|
||||
@@ -7,7 +7,7 @@ import pytz
|
||||
|
||||
from odoo import models, api, fields
|
||||
from odoo.fields import Datetime
|
||||
from odoo.tools.translate import _
|
||||
from odoo.tools.translate import _, _lt
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class pos_session(models.Model):
|
||||
|
||||
ORDER_FIELDS = ['date_order', 'user_id', 'lines', 'statement_ids', 'pricelist_id', 'partner_id', 'session_id', 'pos_reference', 'sale_journal', 'fiscal_position_id']
|
||||
LINE_FIELDS = ['notice', 'product_id', 'qty', 'price_unit', 'discount', 'tax_ids', 'tax_ids_after_fiscal_position']
|
||||
ERR_MSG = _('According to the French law, you cannot modify a %s. Forbidden fields: %s.')
|
||||
ERR_MSG = _lt('According to the French law, you cannot modify a %s. Forbidden fields: %s.')
|
||||
|
||||
|
||||
class pos_order(models.Model):
|
||||
|
||||
@@ -10,8 +10,8 @@ class PaymentAcquirer(models.Model):
|
||||
|
||||
so_reference_type = fields.Selection(string='Communication',
|
||||
selection=[
|
||||
('so_name', _('Based on Document Reference')),
|
||||
('partner', _('Based on Customer ID'))], default='so_name',
|
||||
('so_name', 'Based on Document Reference'),
|
||||
('partner', 'Based on Customer ID')], default='so_name',
|
||||
help='You can set here the communication type that will appear on sales orders.'
|
||||
'The communication will be given to the customer when they choose the payment method.')
|
||||
|
||||
|
||||
@@ -5,21 +5,21 @@ import logging
|
||||
|
||||
import requests
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo import api, fields, models, _, _lt
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
TWITTER_EXCEPTION = {
|
||||
304: _('There was no new data to return.'),
|
||||
400: _('The request was invalid or cannot be otherwise served. Requests without authentication are considered invalid and will yield this response.'),
|
||||
401: _('Authentication credentials were missing or incorrect. Maybe screen name tweets are protected.'),
|
||||
403: _('The request is understood, but it has been refused or access is not allowed. Please check your Twitter API Key and Secret.'),
|
||||
429: _('Request cannot be served due to the applications rate limit having been exhausted for the resource.'),
|
||||
500: _('Twitter seems broken. Please retry later. You may consider posting an issue on Twitter forums to get help.'),
|
||||
502: _('Twitter is down or being upgraded.'),
|
||||
503: _('The Twitter servers are up, but overloaded with requests. Try again later.'),
|
||||
504: _('The Twitter servers are up, but the request could not be serviced due to some failure within our stack. Try again later.')
|
||||
304: _lt('There was no new data to return.'),
|
||||
400: _lt('The request was invalid or cannot be otherwise served. Requests without authentication are considered invalid and will yield this response.'),
|
||||
401: _lt('Authentication credentials were missing or incorrect. Maybe screen name tweets are protected.'),
|
||||
403: _lt('The request is understood, but it has been refused or access is not allowed. Please check your Twitter API Key and Secret.'),
|
||||
429: _lt('Request cannot be served due to the applications rate limit having been exhausted for the resource.'),
|
||||
500: _lt('Twitter seems broken. Please retry later. You may consider posting an issue on Twitter forums to get help.'),
|
||||
502: _lt('Twitter is down or being upgraded.'),
|
||||
503: _lt('The Twitter servers are up, but overloaded with requests. Try again later.'),
|
||||
504: _lt('The Twitter servers are up, but the request could not be serviced due to some failure within our stack. Try again later.')
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ WARNING_MESSAGE = [
|
||||
('warning','Warning'),
|
||||
('block','Blocking Message')
|
||||
]
|
||||
WARNING_HELP = _('Selecting the "Warning" option will notify user with the message, Selecting "Blocking Message" will throw an exception with the message and block the flow. The Message has to be written in the next field.')
|
||||
WARNING_HELP = 'Selecting the "Warning" option will notify user with the message, Selecting "Blocking Message" will throw an exception with the message and block the flow. The Message has to be written in the next field.'
|
||||
|
||||
|
||||
ADDRESS_FIELDS = ('street', 'street2', 'zip', 'city', 'state_id', 'country_id')
|
||||
|
||||
Reference in New Issue
Block a user