-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfiguration.py
220 lines (195 loc) · 7.43 KB
/
configuration.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# For copyright and license terms, see COPYRIGHT.rst (top level of repository)
# Repository: https://github.com/C3S/collecting_society
from trytond.model import ModelView, ModelSQL, ModelSingleton, fields
from trytond.model import MultiValueMixin
from trytond.pool import Pool
from trytond.pyson import Id
__all__ = ['Configuration']
artist_sequence = fields.Many2One(
'ir.sequence', 'Artist Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_artist')),
])
release_sequence = fields.Many2One(
'ir.sequence', 'Release Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_release')),
])
creation_sequence = fields.Many2One(
'ir.sequence', 'Creation Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_creation')),
])
content_sequence = fields.Many2One(
'ir.sequence', 'Content Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_content')),
])
tariff_system_sequence = fields.Many2One(
'ir.sequence', 'Tariff System Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_tariff_system')),
])
distribution_plan_sequence = fields.Many2One(
'ir.sequence', 'Distribution Plan Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_distribution_plan')),
])
declaration_sequence = fields.Many2One(
'ir.sequence', 'Declaration Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_declaration')),
])
utilisation_sequence = fields.Many2One(
'ir.sequence', 'Utilisation Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_utilisation')),
])
collection_sequence = fields.Many2One(
'ir.sequence', 'Collection Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_collection')),
])
distribution_sequence = fields.Many2One(
'ir.sequence', 'Distribution Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_distribution')),
])
harddisk_label_sequence = fields.Many2One(
'ir.sequence', 'Harddisk Label Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_harddisk_label')),
])
filesystem_label_sequence = fields.Many2One(
'ir.sequence', 'Filesystem Label Sequence', domain=[
('sequence_type', '=',
Id('collecting_society', 'sequence_type_filesystem_label')),
])
class Configuration(ModelSingleton, ModelSQL, ModelView, MultiValueMixin):
'Collecting Society Configuration'
__name__ = 'collecting_society.configuration'
artist_sequence = fields.MultiValue(artist_sequence)
release_sequence = fields.MultiValue(release_sequence)
creation_sequence = fields.MultiValue(creation_sequence)
content_sequence = fields.MultiValue(content_sequence)
tariff_system_sequence = fields.MultiValue(tariff_system_sequence)
distribution_plan_sequence = fields.MultiValue(distribution_plan_sequence)
declaration_sequence = fields.MultiValue(declaration_sequence)
utilisation_sequence = fields.MultiValue(utilisation_sequence)
collection_sequence = fields.MultiValue(collection_sequence)
distribution_sequence = fields.MultiValue(distribution_sequence)
harddisk_label_sequence = fields.MultiValue(harddisk_label_sequence)
filesystem_label_sequence = fields.MultiValue(filesystem_label_sequence)
@classmethod
def default_artist_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id('collecting_society', 'sequence_artist')
except KeyError:
return None
@classmethod
def default_release_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id('collecting_society', 'sequence_release')
except KeyError:
return None
@classmethod
def default_creation_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id('collecting_society', 'sequence_creation')
except KeyError:
return None
@classmethod
def default_content_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id('collecting_society', 'sequence_content')
except KeyError:
return None
@classmethod
def default_tariff_system_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id(
'collecting_society', 'sequence_tariff_system')
except KeyError:
return None
@classmethod
def default_distribution_plan_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id(
'collecting_society', 'sequence_distribution_plan')
except KeyError:
return None
@classmethod
def default_declaration_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id(
'collecting_society', 'sequence_declaration')
except KeyError:
return None
@classmethod
def default_utilisation_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id(
'collecting_society', 'sequence_utilisation')
except KeyError:
return None
@classmethod
def default_collection_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id(
'collecting_society', 'sequence_collection')
except KeyError:
return None
@classmethod
def default_distribution_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id(
'collecting_society', 'sequence_distribution')
except KeyError:
return None
@classmethod
def default_harddisk_label_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id(
'collecting_society', 'sequence_harddisk_label')
except KeyError:
return None
@classmethod
def default_filesystem_label_sequence(cls, **pattern):
pool = Pool()
ModelData = pool.get('ir.model.data')
try:
return ModelData.get_id(
'collecting_society', 'sequence_filesystem_label')
except KeyError:
return None
# class ConfigurationSequence(ModelSQL, ValueMixin):
# 'Party Configuration Sequence'
# __name__ = 'party.configuration.party_sequence'
# party_sequence = party_sequence
# _configuration_value_field = 'party_sequence'
#
# @classmethod
# def check_xml_record(cls, records, values):
# return True