[IMP] all: remove unreachable code

This commits adds the check W0101 to test_pylint and fixes the errors.

The index in sequence.py was added in rev 1381ac139e and cancelled a day later in 83fdc271e6
so i guess it is safe to remove it.
This commit is contained in:
Simon Lejeune
2016-08-22 13:51:37 +02:00
committed by Christophe Simonis
parent 1ede17978b
commit 7abed3b996
4 changed files with 1 additions and 19 deletions
-1
View File
@@ -361,7 +361,6 @@ class MailTemplate(models.Model):
except Exception:
_logger.info("Failed to render template %r using values %r" % (template, variables), exc_info=True)
raise UserError(_("Failed to render template %r using values %r")% (template, variables))
render_result = u""
if render_result == u"False":
render_result = u""
results[res_id] = render_result
-1
View File
@@ -26,7 +26,6 @@ class Rating(http.Controller):
'rating': rating, 'token': token,
'rate_name': rate_names[rate], 'rate': rate
})
return request.not_found()
@http.route(['/rating/<string:token>/<int:rate>/submit_feedback'], type="http", auth="public", method=['post'])
def submit_rating(self, token, rate, **kwargs):
-17
View File
@@ -112,23 +112,6 @@ class IrSequence(models.Model):
use_date_range = fields.Boolean(string='Use subsequences per date_range')
date_range_ids = fields.One2many('ir.sequence.date_range', 'sequence_id', string='Subsequences')
@api.model_cr
def init(self):
return # Don't do the following index yet.
# CONSTRAINT/UNIQUE INDEX on (code, company_id)
# /!\ The unique constraint 'unique_name_company_id' is not sufficient, because SQL92
# only support field names in constraint definitions, and we need a function here:
# we need to special-case company_id to treat all NULL company_id as equal, otherwise
# we would allow duplicate (code, NULL) ir_sequences.
self._cr.execute("""
SELECT indexname FROM pg_indexes WHERE indexname =
'ir_sequence_unique_code_company_id_idx'""")
if not self._cr.fetchone():
self._cr.execute("""
CREATE UNIQUE INDEX ir_sequence_unique_code_company_id_idx
ON ir_sequence (code, (COALESCE(company_id,-1)))""")
@api.model
def create(self, values):
""" Create a sequence, in implementation == standard a fast gaps-allowed PostgreSQL sequence is used.
@@ -23,6 +23,7 @@ class TestPyLint(TransactionCase):
ENABLED_CODES = [
'W0123', # eval used
'W0101', # unreachable code
]
def _skip_test(self, reason):