Skip to content

Commit 224b749

Browse files
jmaPascalRepond
andcommitted
primeng: acquistion
Co-Authored-by: Johnny Mariéthoz <[email protected]> Co-Authored-by: Pascal Repond <[email protected]>
1 parent b116a0c commit 224b749

File tree

89 files changed

+814
-714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+814
-714
lines changed

Dockerfile.base

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ FROM python:3.9-slim-bullseye
2020
# require debian packages
2121
RUN apt-get update -y && apt-get upgrade -y
2222
RUN apt-get install --no-install-recommends -y git vim-tiny curl gcc gnupg libc6-dev procps imagemagick && rm -rf /var/lib/apt/lists/*
23-
RUN pip install --upgrade setuptools wheel pip poetry
23+
RUN pip install --upgrade setuptools wheel pip poetry && poetry self add poetry-plugin-shell
2424

2525
# # uwsgi uwsgitop uwsgi-tools
2626

INSTALL.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ among other things.
5858
$ pyenv install 3.9.7
5959
$ cd rero-ils
6060
$ pyenv local 3.9.7
61-
$ sudo pip install poetry
61+
$ curl -sSL https://install.python-poetry.org | python3 -
62+
$ optional: poetry self add poetry-plugin-shell
63+
64+
See: https://python-poetry.org/docs#installation for more detail.
6265

6366
Next, ``cd`` into the project directory and bootstrap the instance (this will install
6467
all Python dependencies and build all static assets):

data/acq_order_lines.json

+9-28
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"priority": 0,
55
"quantity": 3,
66
"amount": 25,
7-
"exchange_rate": 1,
87
"notes": [
98
{
109
"type": "staff_note",
@@ -23,15 +22,13 @@
2322
"library": {
2423
"$ref": "https://bib.rero.ch/api/libraries/1"
2524
},
26-
"is_cancelled": false,
27-
"send_now": true
25+
"is_cancelled": false
2826
},
2927
{
3028
"pid": "2",
3129
"priority": 0,
3230
"quantity": 15,
3331
"amount": 5,
34-
"exchange_rate": 1,
3532
"notes": [
3633
{
3734
"type": "staff_note",
@@ -50,15 +47,13 @@
5047
"library": {
5148
"$ref": "https://bib.rero.ch/api/libraries/1"
5249
},
53-
"is_cancelled": false,
54-
"send_now": true
50+
"is_cancelled": false
5551
},
5652
{
5753
"pid": "3",
5854
"priority": 0,
5955
"quantity": 2,
6056
"amount": 100,
61-
"exchange_rate": 1,
6257
"notes": [
6358
{
6459
"type": "staff_note",
@@ -77,15 +72,13 @@
7772
"library": {
7873
"$ref": "https://bib.rero.ch/api/libraries/1"
7974
},
80-
"is_cancelled": false,
81-
"send_now": true
75+
"is_cancelled": false
8276
},
8377
{
8478
"pid": "4",
8579
"priority": 0,
8680
"quantity": 5,
8781
"amount": 10,
88-
"exchange_rate": 1,
8982
"acq_account": {
9083
"$ref": "https://bib.rero.ch/api/acq_accounts/7"
9184
},
@@ -98,15 +91,13 @@
9891
"library": {
9992
"$ref": "https://bib.rero.ch/api/libraries/2"
10093
},
101-
"is_cancelled": false,
102-
"send_now": true
94+
"is_cancelled": false
10395
},
10496
{
10597
"pid": "5",
10698
"priority": 5,
10799
"quantity": 1,
108100
"amount": 100,
109-
"exchange_rate": 1,
110101
"notes": [
111102
{
112103
"type": "staff_note",
@@ -125,15 +116,13 @@
125116
"library": {
126117
"$ref": "https://bib.rero.ch/api/libraries/2"
127118
},
128-
"is_cancelled": false,
129-
"send_now": true
119+
"is_cancelled": false
130120
},
131121
{
132122
"pid": "6",
133123
"priority": 1,
134124
"quantity": 5,
135125
"amount": 7,
136-
"exchange_rate": 1,
137126
"acq_account": {
138127
"$ref": "https://bib.rero.ch/api/acq_accounts/14"
139128
},
@@ -146,15 +135,13 @@
146135
"library": {
147136
"$ref": "https://bib.rero.ch/api/libraries/3"
148137
},
149-
"is_cancelled": false,
150-
"send_now": true
138+
"is_cancelled": false
151139
},
152140
{
153141
"pid": "7",
154142
"priority": 1,
155143
"quantity": 15,
156144
"amount": 12,
157-
"exchange_rate": 1,
158145
"acq_account": {
159146
"$ref": "https://bib.rero.ch/api/acq_accounts/20"
160147
},
@@ -167,15 +154,13 @@
167154
"library": {
168155
"$ref": "https://bib.rero.ch/api/libraries/4"
169156
},
170-
"is_cancelled": false,
171-
"send_now": true
157+
"is_cancelled": false
172158
},
173159
{
174160
"pid": "8",
175161
"priority": 1,
176162
"quantity": 10,
177163
"amount": 20,
178-
"exchange_rate": 1,
179164
"acq_account": {
180165
"$ref": "https://bib.rero.ch/api/acq_accounts/4"
181166
},
@@ -188,15 +173,13 @@
188173
"library": {
189174
"$ref": "https://bib.rero.ch/api/libraries/1"
190175
},
191-
"is_cancelled": false,
192-
"send_now": true
176+
"is_cancelled": false
193177
},
194178
{
195179
"pid": "9",
196180
"priority": 0,
197181
"quantity": 3,
198182
"amount": 22,
199-
"exchange_rate": 1,
200183
"acq_account": {
201184
"$ref": "https://bib.rero.ch/api/acq_accounts/2"
202185
},
@@ -216,7 +199,6 @@
216199
"priority": 0,
217200
"quantity": 3,
218201
"amount": 25,
219-
"exchange_rate": 1,
220202
"notes": [
221203
{
222204
"type": "staff_note",
@@ -235,7 +217,6 @@
235217
"library": {
236218
"$ref": "https://bib.rero.ch/api/libraries/1"
237219
},
238-
"is_cancelled": false,
239-
"order_date": "2021-07-20"
220+
"is_cancelled": false
240221
}
241222
]

data/acq_orders.json

+6-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"pid": "1",
44
"reference": "AOSTE-CANT1-POL-1",
5-
"type": "monograph",
65
"currency": "EUR",
76
"notes": [
87
{
@@ -18,12 +17,12 @@
1817
},
1918
"organisation": {
2019
"$ref": "https://bib.rero.ch/api/organisations/1"
21-
}
20+
},
21+
"send_now": true
2222
},
2323
{
2424
"pid": "2",
2525
"reference": "AOSTE-CANT1-POL-2",
26-
"type": "monograph",
2726
"currency": "EUR",
2827
"notes": [
2928
{
@@ -39,12 +38,12 @@
3938
},
4039
"organisation": {
4140
"$ref": "https://bib.rero.ch/api/organisations/1"
42-
}
41+
},
42+
"send_now": true
4343
},
4444
{
4545
"pid": "3",
4646
"reference": "AOSTE-CANT2-POL-1",
47-
"type": "monograph",
4847
"currency": "EUR",
4948
"notes": [
5049
{
@@ -65,7 +64,6 @@
6564
{
6665
"pid": "4",
6766
"reference": "AOSTE-AVISE-POL-1",
68-
"type": "monograph",
6967
"currency": "EUR",
7068
"notes": [
7169
{
@@ -86,7 +84,6 @@
8684
{
8785
"pid": "5",
8886
"reference": "AOSTE-LYCEE-POL-1",
89-
"type": "monograph",
9087
"currency": "EUR",
9188
"notes": [
9289
{
@@ -107,7 +104,6 @@
107104
{
108105
"pid": "6",
109106
"reference": "AOSTE-CANT1-POL-6",
110-
"type": "monograph",
111107
"currency": "EUR",
112108
"library": {
113109
"$ref": "https://bib.rero.ch/api/libraries/1"
@@ -122,7 +118,6 @@
122118
{
123119
"pid": "7",
124120
"reference": "AOSTE-CANT1-POL-2021-1",
125-
"type": "monograph",
126121
"currency": "EUR",
127122
"notes": [
128123
{
@@ -138,6 +133,7 @@
138133
},
139134
"organisation": {
140135
"$ref": "https://bib.rero.ch/api/organisations/1"
141-
}
136+
},
137+
"send_now": true
142138
}
143139
]

data/acq_receipts.json

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"$ref": "https://bib.rero.ch/api/acq_orders/1"
66
},
77
"reference": "AOSTE-CANT1-POL-1",
8-
"exchange_rate": 1,
98
"notes": [
109
{
1110
"type": "staff_note",
@@ -25,7 +24,6 @@
2524
"$ref": "https://bib.rero.ch/api/acq_orders/7"
2625
},
2726
"reference": "AOSTE-CANT1-POL-2021-1",
28-
"exchange_rate": 1,
2927
"notes": [
3028
{
3129
"type": "staff_note",

rero_ils/jsonschemas/common/identifier-v0.0.1.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"widget": {
2727
"formlyConfig": {
2828
"props": {
29-
"containerCssClass": "row",
30-
"itemCssClass": "col-lg-12",
29+
"containerCssClass": "grid grid-nogutter-y",
30+
"itemCssClass": "col-12",
3131
"hide": true
3232
}
3333
}
@@ -46,7 +46,7 @@
4646
"widget": {
4747
"formlyConfig": {
4848
"props": {
49-
"itemCssClass": "col-lg-6",
49+
"itemCssClass": "col-12 md:col-6",
5050
"options": [
5151
{
5252
"value": "bf:Local",
@@ -76,7 +76,7 @@
7676
"widget": {
7777
"formlyConfig": {
7878
"props": {
79-
"itemCssClass": "col-lg-6"
79+
"itemCssClass": "col-12 md:col-6"
8080
}
8181
}
8282
}
@@ -93,7 +93,7 @@
9393
"hide": "field?.parent?.model?.type !== 'bf:Local'"
9494
},
9595
"props": {
96-
"itemCssClass": "col-lg-6"
96+
"itemCssClass": "col-12 md:col-6"
9797
}
9898
}
9999
}

rero_ils/jsonschemas/common/languages-v0.0.1.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@
494494
"type": "select",
495495
"props": {
496496
"sort": true,
497-
"itemCssClass": "col-lg-6",
497+
"itemCssClass": "col-12 md:col-6",
498498
"options": [
499499
{
500500
"label": "lang_aar",
@@ -2550,7 +2550,7 @@
25502550
"widget": {
25512551
"formlyConfig": {
25522552
"props": {
2553-
"itemCssClass": "col-lg-12",
2553+
"itemCssClass": "col-12",
25542554
"hide": true
25552555
}
25562556
}
@@ -2574,7 +2574,7 @@
25742574
"widget": {
25752575
"formlyConfig": {
25762576
"props": {
2577-
"itemCssClass": "col-lg-12"
2577+
"itemCssClass": "col-12"
25782578
}
25792579
}
25802580
}
@@ -2586,7 +2586,7 @@
25862586
"widget": {
25872587
"formlyConfig": {
25882588
"props": {
2589-
"containerCssClass": "row"
2589+
"containerCssClass": "grid grid-nogutter-y"
25902590
}
25912591
}
25922592
}
@@ -2610,7 +2610,7 @@
26102610
"formlyConfig": {
26112611
"focus": true,
26122612
"props": {
2613-
"itemCssClass": "col-lg-12"
2613+
"itemCssClass": "col-12"
26142614
}
26152615
}
26162616
}
@@ -2622,7 +2622,7 @@
26222622
"widget": {
26232623
"formlyConfig": {
26242624
"props": {
2625-
"containerCssClass": "row"
2625+
"containerCssClass": "grid grid-nogutter-y"
26262626
}
26272627
}
26282628
}

rero_ils/jsonschemas/common/ui-languages-v0.0.1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"type": "select",
1414
"props": {
1515
"sort": true,
16-
"itemCssClass": "col-lg-2",
16+
"itemCssClass": "col-12 md:col-2",
1717
"options": [
1818
{
1919
"label": "lang_fre",

rero_ils/modules/acquisition/acq_accounts/serializers/json.py

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
class AcqAccountJSONSerializer(ACQJSONSerializer):
2727
"""Serializer for RERO-ILS `AcqAccount` records as JSON."""
2828

29+
def _postprocess_search_hit(self, hit: dict) -> None:
30+
"""Post-process each hit of a search result."""
31+
hit["metadata"]["number_of_children"] = (
32+
AcqAccountsSearch()
33+
.filter("term", parent__pid=hit["metadata"]["pid"])
34+
.count()
35+
)
36+
super()._postprocess_search_hit(hit)
37+
2938
def preprocess_record(self, pid, record, links_factory=None, **kwargs):
3039
"""Prepare a record and persistent identifier for serialization."""
3140
# Add some ES stored keys into response

0 commit comments

Comments
 (0)