-
-
Notifications
You must be signed in to change notification settings - Fork 166
/
pylint_oca_broken.py
108 lines (76 loc) · 2.22 KB
/
pylint_oca_broken.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import openerp
from openerp import api
from openerp.api import one, multi
from odoo.exceptions import Warning as UserError # pylint: disable=W0622
from odoo.exceptions import Warning as OtherName # pylint: disable=W0404
from odoo.exceptions import Warning # pylint: disable=W0404,W0622
from odoo.exceptions import (AccessError as AE, # pylint: disable=W0404
ValidationError,
Warning as UserError2)
class snake_case(object):
pass
class UseUnusedImport(object):
def method1(self):
return UserError, OtherName, Warning, AE, ValidationError, UserError2
def inherited_method(self):
# Missing return()
super(UseUnusedImport, self).inherited_method()
def inherited_method2(self):
# Missing return(), however this is a generator.
for i in super(UseUnusedImport, self).inherited_method2():
yield i
yield 1
def write(self):
return super(UseUnusedImport, self).write()
class ApiOne(object):
@api.one
def copy(self):
# Missing super()
pass
def create(self):
# Missing super()
pass
def write(self):
# Missing super()
pass
def unlink(self):
# Missing super()
pass
def read(self):
# Missing super()
pass
def setUp(self):
# Missing super()
pass
def tearDown(self):
# Missing super()
pass
def default_get(self):
# Missing super()
pass
class One(object):
@one
def copy(self):
return super(One, self).copy()
class OpenerpApiOne(object):
@openerp.api.one
def copy(self):
return super(OpenerpApiOne, self).copy()
class WOApiOne(object):
# copy without api.one decorator
def copy(self):
return super(WOApiOne, self).copy()
class ApiOneMultiTogether(object):
@api.multi
@api.one
def copy(self):
return super(ApiOneMultiTogether, self).copy()
@multi
@one
def copy2(self):
return super(ApiOneMultiTogether, self).copy2()
@openerp.api.multi
@openerp.api.one
def copy3(self):
return super(ApiOneMultiTogether, self).copy3()
# vim:comment vim