Merge lp:~jfb-tempo-consulting/unifield-server/US-8006 into lp:unifield-server
- US-8006
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5926 |
Proposed branch: | lp:~jfb-tempo-consulting/unifield-server/US-8006 |
Merge into: | lp:unifield-server |
Diff against target: |
1426 lines (+1071/-36) (has conflicts) 8 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+137/-14) bin/addons/procurement_cycle/__init__.py (+15/-0) bin/addons/procurement_cycle/replenishment.py (+51/-20) bin/addons/procurement_cycle/replenishment_report.xml (+10/-0) bin/addons/procurement_cycle/replenishment_view.xml (+2/-2) bin/addons/procurement_cycle/report/__init__.py (+1/-0) bin/addons/procurement_cycle/report/chronogram.mako (+755/-0) bin/addons/procurement_cycle/report/chronogram.py (+100/-0) Text conflict in bin/addons/msf_profile/i18n/fr_MF.po |
To merge this branch: | bzr merge lp:~jfb-tempo-consulting/unifield-server/US-8006 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+397369@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
2 | --- bin/addons/msf_profile/i18n/fr_MF.po 2021-02-04 16:31:58 +0000 |
3 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2021-02-05 11:25:27 +0000 |
4 | @@ -717,7 +717,7 @@ |
5 | msgid "Batch Number %s for %s with Expiry Date %s has been created." |
6 | msgstr "Le numéro de lot %s pour %s avec date d'expiration %s a été créé." |
7 | |
8 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
9 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
10 | #: selection:account.entries.report,month:0 |
11 | #: selection:account.invoice.report,month:0 |
12 | #: selection:analytic.entries.report,month:0 |
13 | @@ -729,6 +729,7 @@ |
14 | #: selection:report.stock.move,month:0 |
15 | #: selection:stock.frequence,yearly_choose_month:0 |
16 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
17 | +#: code:addons/procurement_cycle/report/chronogram.py:82 |
18 | msgid "October" |
19 | msgstr "Octobre" |
20 | |
21 | @@ -1253,6 +1254,7 @@ |
22 | #: code:addons/procurement_cycle/replenishment.py:218 |
23 | #: code:addons/procurement_cycle/replenishment.py:226 |
24 | #: code:addons/procurement_cycle/replenishment.py:229 |
25 | +#: code:addons/procurement_cycle/replenishment.py:230 |
26 | #, python-format |
27 | msgid "Info" |
28 | msgstr "Info" |
29 | @@ -1715,6 +1717,9 @@ |
30 | #: selection:replenishment.inventory.review.line,rule:0 |
31 | #: selection:replenishment.order_calc,rule:0 |
32 | #: selection:replenishment.segment,rule:0 |
33 | +#: field:replenishment.order_calc.line,min_max:0 |
34 | +#: selection:replenishment.order_calc.line,rule:0 |
35 | +#: selection:replenishment.segment.line.min_max_auto_supply.history,field:0 |
36 | msgid "Min/Max" |
37 | msgstr "Min/Max" |
38 | |
39 | @@ -7563,7 +7568,7 @@ |
40 | msgid "All entries must be hard posted before closing this Register!" |
41 | msgstr "Toutes les écritures doivent être comptabilisées définitivement avant de fermer ce Registre ! " |
42 | |
43 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
44 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
45 | #: selection:account.entries.report,month:0 |
46 | #: selection:account.invoice.report,month:0 |
47 | #: selection:analytic.entries.report,month:0 |
48 | @@ -7575,6 +7580,7 @@ |
49 | #: selection:report.stock.move,month:0 |
50 | #: selection:stock.frequence,yearly_choose_month:0 |
51 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
52 | +#: code:addons/procurement_cycle/report/chronogram.py:82 |
53 | msgid "July" |
54 | msgstr "Juillet" |
55 | |
56 | @@ -7761,7 +7767,7 @@ |
57 | msgid "Is intl engagement" |
58 | msgstr "Is intl engagement" |
59 | |
60 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
61 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
62 | #: selection:account.entries.report,month:0 |
63 | #: selection:account.invoice.report,month:0 |
64 | #: selection:analytic.entries.report,month:0 |
65 | @@ -7773,6 +7779,7 @@ |
66 | #: selection:report.stock.move,month:0 |
67 | #: selection:stock.frequence,yearly_choose_month:0 |
68 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
69 | +#: code:addons/procurement_cycle/report/chronogram.py:81 |
70 | msgid "January" |
71 | msgstr "Janvier" |
72 | |
73 | @@ -10590,7 +10597,7 @@ |
74 | msgstr "\n" |
75 | " " |
76 | |
77 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
78 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
79 | #: selection:account.entries.report,month:0 |
80 | #: selection:account.invoice.report,month:0 |
81 | #: selection:analytic.entries.report,month:0 |
82 | @@ -10602,6 +10609,7 @@ |
83 | #: selection:report.stock.move,month:0 |
84 | #: selection:stock.frequence,yearly_choose_month:0 |
85 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
86 | +#: code:addons/procurement_cycle/report/chronogram.py:81 |
87 | msgid "June" |
88 | msgstr "Juin" |
89 | |
90 | @@ -29136,7 +29144,7 @@ |
91 | msgid "Update(s) sent: %d import update(s) + %d delete update(s) on %d update(s)" |
92 | msgstr "Update(s) sent: %d import update(s) + %d delete update(s) on %d update(s)" |
93 | |
94 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
95 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
96 | #: selection:account.entries.report,month:0 |
97 | #: selection:account.invoice.report,month:0 |
98 | #: selection:analytic.entries.report,month:0 |
99 | @@ -29148,6 +29156,7 @@ |
100 | #: selection:report.stock.move,month:0 |
101 | #: selection:stock.frequence,yearly_choose_month:0 |
102 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
103 | +#: code:addons/procurement_cycle/report/chronogram.py:81 |
104 | msgid "February" |
105 | msgstr "Février" |
106 | |
107 | @@ -30573,8 +30582,9 @@ |
108 | msgid "Financing Contract List" |
109 | msgstr "Contrat de Financement - Liste" |
110 | |
111 | -#. module: msf_partner |
112 | +#. module: msf_partner, procurement_cycle |
113 | #: view:res.partner:0 |
114 | +#: report:addons/procurement_cycle/report/chronogram.mako:1322 |
115 | msgid "Supplier LT" |
116 | msgstr "Délai Fournisseur " |
117 | |
118 | @@ -46409,7 +46419,7 @@ |
119 | msgid "UoS Quantity" |
120 | msgstr "Quantité en Unité de Vente" |
121 | |
122 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
123 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
124 | #: selection:account.entries.report,month:0 |
125 | #: selection:account.invoice.report,month:0 |
126 | #: selection:analytic.entries.report,month:0 |
127 | @@ -46421,6 +46431,7 @@ |
128 | #: selection:report.stock.move,month:0 |
129 | #: selection:stock.frequence,yearly_choose_month:0 |
130 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
131 | +#: code:addons/procurement_cycle/report/chronogram.py:82 |
132 | msgid "August" |
133 | msgstr "Août" |
134 | |
135 | @@ -48475,7 +48486,7 @@ |
136 | msgid "Tracking Moves Analysis" |
137 | msgstr "Analyse du Suivi des Mouvements" |
138 | |
139 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
140 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
141 | #: selection:account.entries.report,month:0 |
142 | #: selection:account.invoice.report,month:0 |
143 | #: selection:analytic.entries.report,month:0 |
144 | @@ -48487,6 +48498,7 @@ |
145 | #: selection:report.stock.move,month:0 |
146 | #: selection:stock.frequence,yearly_choose_month:0 |
147 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
148 | +#: code:addons/procurement_cycle/report/chronogram.py:82 |
149 | msgid "September" |
150 | msgstr "Septembre" |
151 | |
152 | @@ -58569,7 +58581,7 @@ |
153 | msgid "If you chose lines coming from Field Orders, External/ESC suppliers will be available for Internal/Inter-section/Intermission customers and Internal/External/Inter-section/Intermission/ESC suppliers will be available for External customers" |
154 | msgstr "Si vous aviez choisi des lignes venant de Commandes de Terrain, des fournisseurs Externe/ESC seront disponibles pour des clients Interne/Inter-section/Intermission et des fournisseurs Interne/Externe/Inter-section/Intermission/ESC seront disponibles pour des clients Externe" |
155 | |
156 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
157 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
158 | #: selection:account.entries.report,month:0 |
159 | #: selection:account.invoice.report,month:0 |
160 | #: selection:analytic.entries.report,month:0 |
161 | @@ -58581,6 +58593,7 @@ |
162 | #: selection:report.stock.move,month:0 |
163 | #: selection:stock.frequence,yearly_choose_month:0 |
164 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
165 | +#: code:addons/procurement_cycle/report/chronogram.py:82 |
166 | msgid "December" |
167 | msgstr "Décembre" |
168 | |
169 | @@ -71046,7 +71059,7 @@ |
170 | msgid "Base Language 'en_US' can not be deleted !" |
171 | msgstr "Langue de base 'en_US' ne peut pas être supprimée !" |
172 | |
173 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
174 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
175 | #: selection:account.entries.report,month:0 |
176 | #: selection:account.invoice.report,month:0 |
177 | #: selection:analytic.entries.report,month:0 |
178 | @@ -71058,6 +71071,7 @@ |
179 | #: selection:report.stock.move,month:0 |
180 | #: selection:stock.frequence,yearly_choose_month:0 |
181 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
182 | +#: code:addons/procurement_cycle/report/chronogram.py:81 |
183 | msgid "April" |
184 | msgstr "Avril" |
185 | |
186 | @@ -77072,7 +77086,7 @@ |
187 | msgid "O. l." |
188 | msgstr "O. l." |
189 | |
190 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
191 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
192 | #: selection:account.entries.report,month:0 |
193 | #: selection:account.invoice.report,month:0 |
194 | #: selection:analytic.entries.report,month:0 |
195 | @@ -77084,6 +77098,7 @@ |
196 | #: selection:report.stock.move,month:0 |
197 | #: selection:stock.frequence,yearly_choose_month:0 |
198 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
199 | +#: code:addons/procurement_cycle/report/chronogram.py:81 |
200 | msgid "March" |
201 | msgstr "Mars" |
202 | |
203 | @@ -85622,9 +85637,10 @@ |
204 | msgid "You cannot select 'Top prop Instances' because 'Instances' is already selected." |
205 | msgstr "Vous ne pouvez pas selectionner 'Instance prop. parente' car 'Instances' est déjà selectionné." |
206 | |
207 | -#. module: sales_followup |
208 | +#. module: sales_followup, procurement_cycle |
209 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:284 |
210 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:283 |
211 | +#: report:addons/procurement_cycle/report/chronogram.mako:2149 |
212 | msgid "RDD" |
213 | msgstr "DLS" |
214 | |
215 | @@ -86148,7 +86164,7 @@ |
216 | msgid "Customer reference :" |
217 | msgstr "Référence client :" |
218 | |
219 | -#. modules: purchase, account, sale, stock_schedule, board, stock |
220 | +#. modules: purchase, account, sale, stock_schedule, board, stock, procurement_cycle |
221 | #: selection:account.entries.report,month:0 |
222 | #: selection:account.invoice.report,month:0 |
223 | #: selection:analytic.entries.report,month:0 |
224 | @@ -86160,6 +86176,7 @@ |
225 | #: selection:report.stock.move,month:0 |
226 | #: selection:stock.frequence,yearly_choose_month:0 |
227 | #: selection:stock.frequence,yearly_choose_month_freq:0 |
228 | +#: code:addons/procurement_cycle/report/chronogram.py:82 |
229 | msgid "November" |
230 | msgstr "Novembre" |
231 | |
232 | @@ -106860,6 +106877,8 @@ |
233 | |
234 | #. module: procurement_cycle |
235 | #: view:replenishment.segment:0 |
236 | +#: model:ir.actions.report.xml,name:procurement_cycle.report_replenishment_parent_segment_chronogram_xls |
237 | +#: report:addons/procurement_cycle/report/chronogram.mako:502 |
238 | msgid "Chronogram" |
239 | msgstr "Chronogramme" |
240 | |
241 | @@ -107461,6 +107480,8 @@ |
242 | #: report:addons/procurement_cycle/report/replenishment_inventory_review.mako:831 |
243 | #: code:addons/procurement_cycle/replenishment.py:445 |
244 | #: report:addons/procurement_cycle/report/replenishment_inventory_review.mako:919 |
245 | +#: code:addons/procurement_cycle/replenishment.py:812 |
246 | +#: report:addons/procurement_cycle/report/replenishment_inventory_review.mako:932 |
247 | #, python-format |
248 | msgid "Min" |
249 | msgstr "Min" |
250 | @@ -107483,6 +107504,7 @@ |
251 | #: report:addons/msf_supply_doc_export/report/report_composition_kit_xls.mako:84 |
252 | #: report:addons/msf_supply_doc_export/report/report_real_composition_kit_xls.mako:106 |
253 | #: report:addons/msf_supply_doc_export/report/report_real_composition_kit_xls.mako:107 |
254 | +#: report:addons/procurement_cycle/report/replenishment_segment.mako:429 |
255 | msgid "N" |
256 | msgstr "N" |
257 | |
258 | @@ -110913,7 +110935,7 @@ |
259 | #: code:addons/register_accounting/wizard/temp_posting.py:55 |
260 | #, python-format |
261 | msgid "Impossible to retrieve automatically the lines to temp post for this register. Please select them manually and click on \"Temp Posting\"." |
262 | -msgstr "Impossible de récupérer automatiquement les lignes à comptabiliser temporairement pour ce registre. Veuillez les sélectionner manuellement et cliquer sur \"Comptabilisation Temporaire"\"." |
263 | +msgstr "Impossible de récupérer automatiquement les lignes à comptabiliser temporairement pour ce registre. Veuillez les sélectionner manuellement et cliquer sur \"Comptabilisation Temporaire\"." |
264 | |
265 | #. module: procurement_cycle |
266 | #: code:addons/procurement_cycle/replenishment_wizard.py:102 |
267 | @@ -111288,6 +111310,7 @@ |
268 | #, python-format |
269 | msgid "PO %s created by duplication: Order Type changed from DPO to Regular" |
270 | msgstr "BdC %s créé par duplication: Type de Commande modifié de BC Direct à Normal" |
271 | +<<<<<<< TREE |
272 | |
273 | #. module: kit |
274 | #: view:kit.creation:0 |
275 | @@ -111560,3 +111583,103 @@ |
276 | #: report:addons/finance/report/fo_follow_up_finance_xls.mako:410 |
277 | msgid "DETAILS INTERMISSION VOUCHERS OUT" |
278 | msgstr "DÉTAILS BONS INTERMISSION OUT" |
279 | +======= |
280 | + |
281 | +#. module: procurement_cycle |
282 | +#: report:addons/procurement_cycle/report/chronogram.mako:502 |
283 | +msgid "CHRONOGRAM" |
284 | +msgstr "CHRONOGRAMME" |
285 | + |
286 | +#. module: procurement_cycle |
287 | +#: report:addons/procurement_cycle/report/chronogram.mako:1594 |
288 | +msgid "Cover time" |
289 | +msgstr "Temps de couverture" |
290 | + |
291 | +#. module: procurement_cycle |
292 | +#: report:addons/procurement_cycle/report/chronogram.mako:1859 |
293 | +msgid "Deadlines" |
294 | +msgstr "Dates limites" |
295 | + |
296 | +#. module: procurement_cycle |
297 | +#: report:addons/procurement_cycle/report/chronogram.mako:1461 |
298 | +msgid "Handling LT" |
299 | +msgstr "Délai de Manutention" |
300 | + |
301 | +#. module: procurement_cycle |
302 | +#: report:addons/procurement_cycle/report/chronogram.mako:2041 |
303 | +msgid "IR created" |
304 | +msgstr "DI créée" |
305 | + |
306 | +#. module: procurement_cycle |
307 | +#: code:addons/procurement_cycle/replenishment.py:588 |
308 | +#, python-format |
309 | +msgid "Only integers are allowed for lead time/order coverage values. Values have been rounded." |
310 | +msgstr "Seuls des entiers sont acceptés pour le délai/courverture. Les valeurs ont été arrondies." |
311 | + |
312 | +#. module: procurement_cycle |
313 | +#: report:addons/procurement_cycle/report/chronogram.mako:2001 |
314 | +msgid "Order Calculation created" |
315 | +msgstr "Calcul de Commande créé" |
316 | + |
317 | +#. module: procurement_cycle |
318 | +#: report:addons/procurement_cycle/report/chronogram.mako:935 |
319 | +msgid "Order Preparation" |
320 | +msgstr "Préparation de Commande" |
321 | + |
322 | +#. module: procurement_cycle |
323 | +#: report:addons/procurement_cycle/report/chronogram.mako:2005 |
324 | +msgid "Order calculation validated" |
325 | +msgstr "Calcul de Commande validé" |
326 | + |
327 | +#. module: procurement_cycle |
328 | +#: report:addons/procurement_cycle/report/chronogram.mako:1044 |
329 | +msgid "Order creation" |
330 | +msgstr "Création de la commande" |
331 | + |
332 | +#. module: procurement_cycle |
333 | +#: report:addons/procurement_cycle/report/chronogram.mako:1183 |
334 | +msgid "Order validation" |
335 | +msgstr "Validation de la commande" |
336 | + |
337 | +#. module: procurement_cycle |
338 | +#: report:addons/procurement_cycle/report/chronogram.mako:2113 |
339 | +msgid "PO received by Supplier" |
340 | +msgstr "BC reçu par le fournisseur" |
341 | + |
342 | +#. module: procurement_cycle |
343 | +#: report:addons/procurement_cycle/report/chronogram.mako:2077 |
344 | +msgid "PO validated" |
345 | +msgstr "BC Validé" |
346 | + |
347 | +#. module: procurement_cycle |
348 | +#: view:replenishment.segment:0 |
349 | +msgid "Parent Description" |
350 | +msgstr "Description du Parent" |
351 | + |
352 | +#. module: procurement_cycle |
353 | +#: report:addons/procurement_cycle/report/chronogram.mako:1997 |
354 | +msgid "Segment Updated" |
355 | +msgstr "Segment mis à jour" |
356 | + |
357 | +#. module: procurement_cycle |
358 | +#: report:addons/procurement_cycle/report/chronogram.mako:1993 |
359 | +msgid "Start (inv or FMC discussions)" |
360 | +msgstr "Début (discussions inv ou PCM)" |
361 | + |
362 | +#. module: procurement_cycle |
363 | +#: report:addons/procurement_cycle/report/chronogram.mako:1993 |
364 | +msgid "Order Cycle" |
365 | +msgstr "Cycle de Commande" |
366 | + |
367 | +#. module: procurement_cycle |
368 | +#: code:addons/procurement_cycle/replenishment.py:586 |
369 | +#, python-format |
370 | +msgid "The decimal part of lead time/order coverage values must be 0, 0.25, 0.5 or 0.75. Values have been rounded." |
371 | +msgstr "La partie décimale du délai/courverture doit être 0, 0.25, 0.5 ou 0.75. Les valeurs ont été arrondies." |
372 | + |
373 | +#. module: procurement_cycle |
374 | +#: code:addons/procurement_cycle/replenishment.py:587 |
375 | +#, python-format |
376 | +msgid "The decimal part of lead time/order coverage values must be 0 or 0.5. Values have been rounded." |
377 | +msgstr "La partie décimale du délai/courverture doit être 0 ou 0.5. Les valeurs ont été arrondies." |
378 | +>>>>>>> MERGE-SOURCE |
379 | |
380 | === modified file 'bin/addons/procurement_cycle/__init__.py' |
381 | --- bin/addons/procurement_cycle/__init__.py 2020-10-16 16:09:35 +0000 |
382 | +++ bin/addons/procurement_cycle/__init__.py 2021-02-05 11:25:27 +0000 |
383 | @@ -19,8 +19,23 @@ |
384 | # |
385 | ############################################################################## |
386 | |
387 | +def normalize_td(time_unit, value): |
388 | + """ |
389 | + timedelta does not support float for months |
390 | + """ |
391 | + |
392 | + unit = {'d': 'days', 'm': 'months', 'w': 'weeks'}.get(time_unit, 'd') |
393 | + value = value or 0 |
394 | + if unit == 'months': |
395 | + if value%1 != 0: |
396 | + return {'months': int(value), 'days': 30.44 * (value%1)} |
397 | + else: |
398 | + value = int(value) |
399 | + return {unit: value} |
400 | + |
401 | import replenishment |
402 | import wizard |
403 | import report |
404 | import replenishment_wizard |
405 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
406 | + |
407 | |
408 | === modified file 'bin/addons/procurement_cycle/replenishment.py' |
409 | --- bin/addons/procurement_cycle/replenishment.py 2020-11-19 16:44:13 +0000 |
410 | +++ bin/addons/procurement_cycle/replenishment.py 2021-02-05 11:25:27 +0000 |
411 | @@ -16,6 +16,7 @@ |
412 | import math |
413 | import re |
414 | import hashlib |
415 | +from . import normalize_td |
416 | |
417 | life_cycle_status = [('active', _('Active')), ('new', _('New')), ('replaced', _('Replaced')), ('replacing', _('Replacing')), ('phasingout', _('Phasing Out')), ('activereplacing', _('Active-Replacing'))] |
418 | class replenishment_location_config(osv.osv): |
419 | @@ -469,19 +470,6 @@ |
420 | |
421 | replenishment_location_config() |
422 | |
423 | -def normalize_td(time_unit, value): |
424 | - """ |
425 | - timedelta does not support float for months |
426 | - """ |
427 | - |
428 | - unit = {'d': 'days', 'm': 'months', 'w': 'weeks'}.get(time_unit, 'd') |
429 | - value = value or 0 |
430 | - if unit == 'months': |
431 | - if value%1 != 0: |
432 | - return {'months': int(value), 'days': 30.44 * (value%1)} |
433 | - else: |
434 | - value = int(value) |
435 | - return {unit: value} |
436 | |
437 | class replenishment_parent_segment(osv.osv): |
438 | _name = 'replenishment.parent.segment' |
439 | @@ -588,12 +576,55 @@ |
440 | return super(replenishment_parent_segment, self).create(cr, uid, vals, context) |
441 | |
442 | def on_change_lt(self, cr, uid, ids, time_unit, order_preparation_lt, order_creation_lt, order_validation_lt, supplier_lt, handling_lt, order_coverage, previous_order_rdd, date_next_order_received_modified, context=None): |
443 | - ret = {} |
444 | - ret['internal_lt'] = (order_preparation_lt or 0) + (order_creation_lt or 0) + (order_validation_lt or 0) |
445 | - ret['external_lt'] = (supplier_lt or 0) + (handling_lt or 0) |
446 | - ret['total_lt'] = ret['internal_lt'] + ret['external_lt'] |
447 | - ret.update(self.compute_next_order_received(cr, uid, ids, time_unit, order_preparation_lt, order_creation_lt, order_validation_lt, supplier_lt, handling_lt, order_coverage, previous_order_rdd, date_next_order_received_modified, context).get('value', {})) |
448 | - return {'value': ret} |
449 | + allowed = { |
450 | + 'm': [0, 0.25, 0.5, 0.75], |
451 | + 'w': [0, 0.5], |
452 | + 'd': [0], |
453 | + } |
454 | + |
455 | + error_message = { |
456 | + 'm': _('The decimal part of lead time/order coverage values must be 0, 0.25, 0.5 or 0.75. Values have been rounded.'), |
457 | + 'w': _('The decimal part of lead time/order coverage values must be 0 or 0.5. Values have been rounded.'), |
458 | + 'd': _('Only integers are allowed for lead time/order coverage values. Values have been rounded.'), |
459 | + } |
460 | + |
461 | + rounding = { |
462 | + 'm': 4., |
463 | + 'w': 2., |
464 | + 'd': 1, |
465 | + |
466 | + } |
467 | + |
468 | + input_data = { |
469 | + 'order_preparation_lt': order_preparation_lt, |
470 | + 'order_creation_lt': order_creation_lt, |
471 | + 'order_validation_lt': order_validation_lt, |
472 | + 'supplier_lt': supplier_lt, |
473 | + 'handling_lt': handling_lt, |
474 | + 'order_coverage': order_coverage, |
475 | + } |
476 | + |
477 | + output_values = {} |
478 | + message = False |
479 | + for field in input_data: |
480 | + if input_data[field] and time_unit and input_data[field] % 1 not in allowed.get(time_unit): |
481 | + if round(input_data[field] % 1, 2) not in allowed.get(time_unit): |
482 | + message = error_message.get(time_unit) |
483 | + output_values[field] = round(input_data[field]*rounding[time_unit])/rounding[time_unit] |
484 | + input_data[field] = output_values[field] |
485 | + |
486 | + output_values['internal_lt'] = (input_data['order_preparation_lt'] or 0) + (input_data['order_creation_lt'] or 0) + (input_data['order_validation_lt'] or 0) |
487 | + output_values['external_lt'] = (input_data['supplier_lt'] or 0) + (input_data['handling_lt'] or 0) |
488 | + output_values['total_lt'] = output_values['internal_lt'] + output_values['external_lt'] |
489 | + output_values.update(self.compute_next_order_received(cr, uid, ids, time_unit, input_data['order_preparation_lt'], input_data['order_creation_lt'], input_data['order_validation_lt'], input_data['supplier_lt'], input_data['handling_lt'], input_data['order_coverage'], previous_order_rdd, date_next_order_received_modified, context).get('value', {})) |
490 | + |
491 | + ret = {'value': output_values} |
492 | + if message: |
493 | + ret['warning'] = { |
494 | + 'title': _('Warning'), |
495 | + 'message': message, |
496 | + } |
497 | + return ret |
498 | |
499 | def compute_next_order_received(self, cr, uid, ids, time_unit, order_preparation_lt, order_creation_lt, order_validation_lt, supplier_lt, handling_lt, order_coverage, previous_order_rdd, date_next_order_received_modified, context=None): |
500 | ret = {} |
501 | @@ -2302,7 +2333,7 @@ |
502 | 'rr_fmc_to_11': fields.date('To 11'), |
503 | 'rr_fmc_12': fields.float_null('RR FMC 12', related_uom='uom_id', digits=(16, 2)), |
504 | 'rr_fmc_from_12': fields.date('From 12'), |
505 | - 'rr_fmc_to_12': fields.date('To 12', digits=(16, 2)), |
506 | + 'rr_fmc_to_12': fields.date('To 12'), |
507 | 'replacing_product_id': fields.many2one('product.product', 'Replacing product', select=1), |
508 | 'replaced_product_id': fields.many2one('product.product', 'Replaced product', select=1), |
509 | 'warning': fields.function(_get_warning, method=1, string='Warning', multi='get_warn', type='text'), |
510 | |
511 | === modified file 'bin/addons/procurement_cycle/replenishment_report.xml' |
512 | --- bin/addons/procurement_cycle/replenishment_report.xml 2020-10-19 13:56:57 +0000 |
513 | +++ bin/addons/procurement_cycle/replenishment_report.xml 2021-02-05 11:25:27 +0000 |
514 | @@ -2,6 +2,16 @@ |
515 | <openerp> |
516 | <data> |
517 | <report |
518 | + id="report_replenishment_parent_segment_chronogram_xls" |
519 | + string="Chronogram" |
520 | + model="replenishment.parent.segment" |
521 | + name="report_replenishment_parent_segment_chronogram_xls" |
522 | + file="procurement_cycle/report/chronogram.mako" |
523 | + report_type="webkit" |
524 | + menu="True" |
525 | + /> |
526 | + |
527 | + <report |
528 | id="report_replenishment_segment_xls" |
529 | string="Segment" |
530 | model="replenishment.segment" |
531 | |
532 | === modified file 'bin/addons/procurement_cycle/replenishment_view.xml' |
533 | --- bin/addons/procurement_cycle/replenishment_view.xml 2020-11-19 16:44:13 +0000 |
534 | +++ bin/addons/procurement_cycle/replenishment_view.xml 2021-02-05 11:25:27 +0000 |
535 | @@ -239,7 +239,7 @@ |
536 | <field name="name_parent_seg" /> |
537 | <field name="description_parent_seg" attrs="{'readonly': [('state_parent', '!=', 'draft')]}"/> |
538 | <field name="location_config_id" attrs="{'readonly': [('state_parent', '!=', 'draft')]}" domain="[('is_current_instance', '=', True)]" on_change="change_location_config_id(location_config_id, ir_requesting_location)"/> |
539 | - <field name="time_unit_lt" on_change="compute_next_order_received(time_unit_lt, order_preparation_lt, order_creation_lt, order_validation_lt, supplier_lt, handling_lt, order_coverage, previous_order_rdd, date_next_order_received_modified)" attrs="{'readonly': [('state_parent', '!=', 'draft')]}" /> |
540 | + <field name="time_unit_lt" on_change="on_change_lt(time_unit_lt, order_preparation_lt, order_creation_lt, order_validation_lt, supplier_lt, handling_lt, order_coverage, previous_order_rdd, date_next_order_received_modified)" attrs="{'readonly': [('state_parent', '!=', 'draft')]}" /> |
541 | <notebook colspan="4"> |
542 | <page string="Parameters"> |
543 | <html colspan="4"> |
544 | @@ -275,7 +275,7 @@ |
545 | </group> |
546 | |
547 | <group colspan="2" col="2"> |
548 | - <field name="order_coverage" attrs="{'readonly': [('state_parent', '!=', 'draft')], 'required': [('state_parent', '=', 'draft')]}" on_change="compute_next_order_received(time_unit_lt, order_preparation_lt, order_creation_lt, order_validation_lt, supplier_lt, handling_lt, order_coverage, previous_order_rdd, date_next_order_received_modified)"/> |
549 | + <field name="order_coverage" attrs="{'readonly': [('state_parent', '!=', 'draft')], 'required': [('state_parent', '=', 'draft')]}" on_change="on_change_lt(time_unit_lt, order_preparation_lt, order_creation_lt, order_validation_lt, supplier_lt, handling_lt, order_coverage, previous_order_rdd, date_next_order_received_modified)"/> |
550 | </group> |
551 | </group> |
552 | |
553 | |
554 | === modified file 'bin/addons/procurement_cycle/report/__init__.py' |
555 | --- bin/addons/procurement_cycle/report/__init__.py 2020-05-04 08:13:23 +0000 |
556 | +++ bin/addons/procurement_cycle/report/__init__.py 2021-02-05 11:25:27 +0000 |
557 | @@ -3,3 +3,4 @@ |
558 | import replenishment_inventory_review |
559 | import replenishment_product_list |
560 | import product_stock_out |
561 | +import chronogram |
562 | |
563 | === added file 'bin/addons/procurement_cycle/report/chronogram.mako' |
564 | --- bin/addons/procurement_cycle/report/chronogram.mako 1970-01-01 00:00:00 +0000 |
565 | +++ bin/addons/procurement_cycle/report/chronogram.mako 2021-02-05 11:25:27 +0000 |
566 | @@ -0,0 +1,755 @@ |
567 | +<?xml version="1.0"?> |
568 | +<?mso-application progid="Excel.Sheet"?> |
569 | +<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" |
570 | + xmlns:o="urn:schemas-microsoft-com:office:office" |
571 | + xmlns:x="urn:schemas-microsoft-com:office:excel" |
572 | + xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" |
573 | + xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" |
574 | + xmlns:html="http://www.w3.org/TR/REC-html40"> |
575 | + <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> |
576 | + <Author>Raffaelle HAGEN</Author> |
577 | + <LastAuthor>Utilisateur Windows</LastAuthor> |
578 | + <Created>2019-06-26T13:32:27Z</Created> |
579 | + <LastSaved>2020-11-19T09:42:13Z</LastSaved> |
580 | + <Version>16.00</Version> |
581 | + </DocumentProperties> |
582 | + <CustomDocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> |
583 | + <ContentTypeId dt:dt="string">0x010100E4DD688E32F80C4987463C2B29626C1F</ContentTypeId> |
584 | + </CustomDocumentProperties> |
585 | + <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"> |
586 | + <AllowPNG/> |
587 | + </OfficeDocumentSettings> |
588 | + <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> |
589 | + <WindowHeight>10590</WindowHeight> |
590 | + <WindowWidth>28800</WindowWidth> |
591 | + <WindowTopX>0</WindowTopX> |
592 | + <WindowTopY>0</WindowTopY> |
593 | + <ProtectStructure>False</ProtectStructure> |
594 | + <ProtectWindows>False</ProtectWindows> |
595 | + </ExcelWorkbook> |
596 | + <Styles> |
597 | + <Style ss:ID="Default" ss:Name="Normal"> |
598 | + <Alignment ss:Vertical="Bottom"/> |
599 | + <Borders/> |
600 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/> |
601 | + <Interior/> |
602 | + <NumberFormat/> |
603 | + <Protection/> |
604 | + </Style> |
605 | + <Style ss:ID="m1920381004656"> |
606 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
607 | + <Borders> |
608 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
609 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
610 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
611 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
612 | + </Borders> |
613 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="18" ss:Color="#000000"/> |
614 | + <Interior ss:Color="#00B0F0" ss:Pattern="Solid"/> |
615 | + </Style> |
616 | + <Style ss:ID="m1920381004696"> |
617 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
618 | + <Borders> |
619 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
620 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
621 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
622 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
623 | + </Borders> |
624 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="14" ss:Color="#000000"/> |
625 | + <Interior ss:Color="#548235" ss:Pattern="Solid"/> |
626 | + </Style> |
627 | + <Style ss:ID="m1920381004716"> |
628 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
629 | + <Borders> |
630 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
631 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
632 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
633 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
634 | + </Borders> |
635 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="18" ss:Color="#000000"/> |
636 | + <Interior ss:Color="#92D050" ss:Pattern="Solid"/> |
637 | + </Style> |
638 | + <Style ss:ID="m1920381004736"> |
639 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
640 | + <Borders> |
641 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
642 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
643 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
644 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> |
645 | + </Borders> |
646 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="18" ss:Color="#000000"/> |
647 | + <Interior ss:Color="#AEAAAA" ss:Pattern="Solid"/> |
648 | + </Style> |
649 | + <Style ss:ID="s16"> |
650 | + <Interior/> |
651 | + </Style> |
652 | + <Style ss:ID="s18"> |
653 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
654 | + </Style> |
655 | + <Style ss:ID="s19"> |
656 | + <Borders> |
657 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
658 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
659 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
660 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
661 | + </Borders> |
662 | + <Interior ss:Color="#FFC000" ss:Pattern="Solid"/> |
663 | + </Style> |
664 | + <Style ss:ID="s20"> |
665 | + <Alignment ss:Vertical="Bottom" ss:WrapText="1"/> |
666 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#00B0F0"/> |
667 | + </Style> |
668 | + <Style ss:ID="s21"> |
669 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
670 | + <Borders> |
671 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
672 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
673 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
674 | + </Borders> |
675 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="14" ss:Color="#000000"/> |
676 | + <Interior ss:Color="#E2EFDA" ss:Pattern="Solid"/> |
677 | + </Style> |
678 | + <Style ss:ID="s22"> |
679 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/> |
680 | + <Borders> |
681 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
682 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
683 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
684 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
685 | + </Borders> |
686 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="14" ss:Color="#000000"/> |
687 | + <Interior ss:Color="#9EC9CC" ss:Pattern="Solid"/> |
688 | + </Style> |
689 | + <Style ss:ID="s23"> |
690 | + <Alignment ss:Vertical="Bottom" ss:WrapText="1"/> |
691 | + </Style> |
692 | + <Style ss:ID="s24"> |
693 | + <Borders> |
694 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
695 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
696 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
697 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
698 | + </Borders> |
699 | + <Interior ss:Color="#FFFF00" ss:Pattern="Solid"/> |
700 | + </Style> |
701 | + <Style ss:ID="s25"> |
702 | + <Borders> |
703 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
704 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
705 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
706 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
707 | + </Borders> |
708 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
709 | + </Style> |
710 | + <Style ss:ID="s26"> |
711 | + <Borders> |
712 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
713 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
714 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
715 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
716 | + </Borders> |
717 | + <Interior ss:Color="#92D050" ss:Pattern="Solid"/> |
718 | + </Style> |
719 | + <Style ss:ID="s27"> |
720 | + <Borders> |
721 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
722 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
723 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
724 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
725 | + </Borders> |
726 | + <Interior ss:Color="#00B0F0" ss:Pattern="Solid"/> |
727 | + </Style> |
728 | + <Style ss:ID="s28"> |
729 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
730 | + </Style> |
731 | + <Style ss:ID="s29"> |
732 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
733 | + </Style> |
734 | + <Style ss:ID="s30"> |
735 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
736 | + <Interior/> |
737 | + </Style> |
738 | + <Style ss:ID="s31"> |
739 | + <Borders> |
740 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
741 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
742 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
743 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
744 | + </Borders> |
745 | + <Interior ss:Color="#E2EFDA" ss:Pattern="Solid"/> |
746 | + </Style> |
747 | + <Style ss:ID="s32"> |
748 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
749 | + </Style> |
750 | + <Style ss:ID="s33"> |
751 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
752 | + <Borders> |
753 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
754 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/> |
755 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
756 | + </Borders> |
757 | + </Style> |
758 | + <Style ss:ID="s34"> |
759 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
760 | + <Borders/> |
761 | + </Style> |
762 | + <Style ss:ID="s35"> |
763 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
764 | + <Borders> |
765 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
766 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/> |
767 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
768 | + </Borders> |
769 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
770 | + </Style> |
771 | + <Style ss:ID="s36"> |
772 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
773 | + <Borders> |
774 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
775 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/> |
776 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
777 | + </Borders> |
778 | + <Interior ss:Color="#FFC000" ss:Pattern="Solid"/> |
779 | + </Style> |
780 | + <Style ss:ID="s37"> |
781 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
782 | + <Borders/> |
783 | + <Interior/> |
784 | + </Style> |
785 | + <Style ss:ID="s38"> |
786 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
787 | + <Borders> |
788 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
789 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
790 | + </Borders> |
791 | + <Interior/> |
792 | + </Style> |
793 | + <Style ss:ID="s39"> |
794 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
795 | + <Borders> |
796 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
797 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/> |
798 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
799 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
800 | + </Borders> |
801 | + <Interior ss:Color="#8EA9DB" ss:Pattern="Solid"/> |
802 | + </Style> |
803 | + <Style ss:ID="s40"> |
804 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
805 | + <Borders> |
806 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
807 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/> |
808 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
809 | + </Borders> |
810 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
811 | + </Style> |
812 | + <Style ss:ID="s41"> |
813 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
814 | + <Borders> |
815 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
816 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
817 | + </Borders> |
818 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
819 | + </Style> |
820 | + <Style ss:ID="s42"> |
821 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
822 | + <Borders> |
823 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
824 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/> |
825 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
826 | + </Borders> |
827 | + <Interior ss:Color="#FFC000" ss:Pattern="Solid"/> |
828 | + </Style> |
829 | + <Style ss:ID="s43"> |
830 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
831 | + <Borders> |
832 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
833 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
834 | + </Borders> |
835 | + <Interior ss:Color="#FFC000" ss:Pattern="Solid"/> |
836 | + </Style> |
837 | + <Style ss:ID="s44"> |
838 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
839 | + <Borders> |
840 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
841 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/> |
842 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
843 | + </Borders> |
844 | + <Interior ss:Color="#FFFF00" ss:Pattern="Solid"/> |
845 | + </Style> |
846 | + <Style ss:ID="s45"> |
847 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
848 | + <Borders> |
849 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
850 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
851 | + </Borders> |
852 | + <Interior ss:Color="#FFFF00" ss:Pattern="Solid"/> |
853 | + </Style> |
854 | + <Style ss:ID="s46"> |
855 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
856 | + <Borders> |
857 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
858 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/> |
859 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
860 | + </Borders> |
861 | + <Interior ss:Color="#FFFF00" ss:Pattern="Solid"/> |
862 | + </Style> |
863 | + <Style ss:ID="s47"> |
864 | + <Alignment ss:Horizontal="Left" ss:Vertical="Center"/> |
865 | + <Borders> |
866 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
867 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/> |
868 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/> |
869 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
870 | + </Borders> |
871 | + <Interior ss:Color="#92D050" ss:Pattern="Solid"/> |
872 | + </Style> |
873 | + <Style ss:ID="s48"> |
874 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
875 | + <Borders> |
876 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
877 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
878 | + </Borders> |
879 | + <Interior ss:Color="#92D050" ss:Pattern="Solid"/> |
880 | + </Style> |
881 | + <Style ss:ID="s49"> |
882 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
883 | + <Borders> |
884 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
885 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/> |
886 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
887 | + </Borders> |
888 | + <Interior ss:Color="#92D050" ss:Pattern="Solid"/> |
889 | + </Style> |
890 | + <Style ss:ID="s50"> |
891 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
892 | + <Borders> |
893 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
894 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
895 | + </Borders> |
896 | + <Interior ss:Color="#00B0F0" ss:Pattern="Solid"/> |
897 | + </Style> |
898 | + <Style ss:ID="s51"> |
899 | + <Alignment ss:Horizontal="Left" ss:Vertical="Center"/> |
900 | + <Borders> |
901 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
902 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> |
903 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
904 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
905 | + </Borders> |
906 | + <Interior ss:Color="#E2EFDA" ss:Pattern="Solid"/> |
907 | + </Style> |
908 | + <Style ss:ID="s52"> |
909 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
910 | + <Borders> |
911 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
912 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
913 | + </Borders> |
914 | + <Interior ss:Color="#E2EFDA" ss:Pattern="Solid"/> |
915 | + </Style> |
916 | + <Style ss:ID="s53"> |
917 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
918 | + <Borders> |
919 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
920 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> |
921 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
922 | + </Borders> |
923 | + <Interior ss:Color="#E2EFDA" ss:Pattern="Solid"/> |
924 | + </Style> |
925 | + <Style ss:ID="s54"> |
926 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
927 | + <Borders> |
928 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
929 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/> |
930 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
931 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
932 | + </Borders> |
933 | + <Interior/> |
934 | + </Style> |
935 | + <Style ss:ID="s55"> |
936 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
937 | + <Borders> |
938 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
939 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/> |
940 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/> |
941 | + </Borders> |
942 | + <Interior/> |
943 | + </Style> |
944 | + <Style ss:ID="s56"> |
945 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
946 | + <Interior/> |
947 | + </Style> |
948 | + <Style ss:ID="s57"> |
949 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
950 | + <Borders> |
951 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
952 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/> |
953 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
954 | + </Borders> |
955 | + </Style> |
956 | + <Style ss:ID="s58left"> |
957 | + <Alignment ss:Horizontal="Left" ss:Vertical="Center"/> |
958 | + <Borders> |
959 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
960 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
961 | + </Borders> |
962 | + </Style> |
963 | + <Style ss:ID="s58"> |
964 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
965 | + <Borders> |
966 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
967 | + </Borders> |
968 | + </Style> |
969 | + <Style ss:ID="s58right"> |
970 | + <Alignment ss:Horizontal="Right" ss:Vertical="Center"/> |
971 | + <Borders> |
972 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
973 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
974 | + </Borders> |
975 | + </Style> |
976 | + <Style ss:ID="s59"> |
977 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
978 | + <Borders> |
979 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/> |
980 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/> |
981 | + </Borders> |
982 | + </Style> |
983 | + <Style ss:ID="s63"> |
984 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom" ss:WrapText="1"/> |
985 | + </Style> |
986 | + <Style ss:ID="s78"> |
987 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
988 | + <Borders> |
989 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
990 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
991 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
992 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
993 | + </Borders> |
994 | + </Style> |
995 | + <Style ss:ID="s81"> |
996 | + <Alignment ss:Horizontal="Center" ss:Vertical="Center"/> |
997 | + <Borders> |
998 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> |
999 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1000 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1001 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1002 | + </Borders> |
1003 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="18" ss:Color="#000000"/> |
1004 | + <Interior ss:Color="#8EA9DB" ss:Pattern="Solid"/> |
1005 | + </Style> |
1006 | + <Style ss:ID="s142"> |
1007 | + <Alignment ss:Vertical="Center" ss:WrapText="1"/> |
1008 | + </Style> |
1009 | + <Style ss:ID="s143"> |
1010 | + <Alignment ss:Vertical="Center"/> |
1011 | + </Style> |
1012 | + <Style ss:ID="s146"> |
1013 | + <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> |
1014 | + <Borders> |
1015 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1016 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1017 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1018 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1019 | + </Borders> |
1020 | + <Interior ss:Color="#FF0000" ss:Pattern="Solid"/> |
1021 | + </Style> |
1022 | + <Style ss:ID="s147"> |
1023 | + <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> |
1024 | + <Borders> |
1025 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1026 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1027 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1028 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1029 | + </Borders> |
1030 | + <Interior ss:Color="#FFC000" ss:Pattern="Solid"/> |
1031 | + </Style> |
1032 | + <Style ss:ID="s148"> |
1033 | + <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> |
1034 | + <Borders> |
1035 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1036 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1037 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1038 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1039 | + </Borders> |
1040 | + <Interior ss:Color="#FFFF00" ss:Pattern="Solid"/> |
1041 | + </Style> |
1042 | + <Style ss:ID="s149"> |
1043 | + <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> |
1044 | + <Borders> |
1045 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1046 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1047 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1048 | + </Borders> |
1049 | + <Interior ss:Color="#92D050" ss:Pattern="Solid"/> |
1050 | + </Style> |
1051 | + <Style ss:ID="s150"> |
1052 | + <Alignment ss:Horizontal="Right" ss:Vertical="Center"/> |
1053 | + <Borders> |
1054 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
1055 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
1056 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
1057 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
1058 | + </Borders> |
1059 | + <Interior ss:Color="#E2EFDA" ss:Pattern="Solid"/> |
1060 | + </Style> |
1061 | + </Styles> |
1062 | + <Worksheet ss:Name="${_('Chronogram')|x}"> |
1063 | + <Table x:FullColumns="1" x:FullRows="1" ss:DefaultRowHeight="15"> |
1064 | + <Column ss:AutoFitWidth="0" ss:Width="48.75"/> |
1065 | + <Column ss:AutoFitWidth="0" ss:Width="166.5"/> |
1066 | + <Column ss:AutoFitWidth="0" ss:Width="23.25" ss:Span="207"/> |
1067 | + <Row> |
1068 | + <Cell ss:Index="2" ss:StyleID="s78"><Data ss:Type="String">${_('CHRONOGRAM')|x}</Data></Cell> |
1069 | + <% start = get_start(objects[0]) %> |
1070 | + |
1071 | + |
1072 | + % if objects[0].time_unit_lt == 'w': |
1073 | + <% currentdate = start['date'] %> |
1074 | + % for x in range(0, 24): |
1075 | + <% date = currentdate + relativedelta(months=x) %> |
1076 | + <Cell ss:MergeAcross="${num_cells_in_month(date)}" ss:StyleID="s78"><Data ss:Type="String">${month(date.month)|x}</Data></Cell> |
1077 | + % if x == 0: |
1078 | + <% currentdate = currentdate + relativedelta(day=1) %> |
1079 | + % endif |
1080 | + % endfor |
1081 | + % else: |
1082 | + <Cell ss:MergeAcross="${start['cols']}" ss:StyleID="s78"><Data ss:Type="String">${month(start['date'].month)|x}</Data></Cell> |
1083 | + <!-- header to display months --> |
1084 | + % for x in range(1, 24): |
1085 | + % if objects[0].time_unit_lt == 'd': |
1086 | + <Cell ss:MergeAcross="${(start['date'] + relativedelta(months=x+1, day=1, days=-1)).day - 1}" ss:StyleID="s78"><Data ss:Type="String">${month((start['date'] + relativedelta(months=x)).month)|x}</Data></Cell> |
1087 | + % elif objects[0].time_unit_lt == 'm': |
1088 | + <Cell ss:MergeAcross="3" ss:StyleID="s78"><Data ss:Type="String">${month((start['date'] + relativedelta(months=x)).month)|x}</Data></Cell> |
1089 | + % endif |
1090 | + % endfor |
1091 | + % endif |
1092 | + </Row> |
1093 | + |
1094 | + <Row ss:AutoFitHeight="0" ss:Height="46.125" ss:StyleID="s18"> |
1095 | + <!-- header to display days --> |
1096 | + <Cell ss:Index="2" ss:StyleID="s57"/> |
1097 | + % if objects[0].time_unit_lt == 'w': |
1098 | + <% currentdate = start['date'] %> |
1099 | + <% enddate = start['date'] + relativedelta(months=24) %> |
1100 | + % while currentdate <= enddate: |
1101 | + <Cell ss:StyleID="s58left"><Data ss:Type="Number">${currentdate.day}</Data></Cell> |
1102 | + <Cell ss:StyleID="s58right" /> |
1103 | + <% currentdate += relativedelta(days=7) %> |
1104 | + % endwhile |
1105 | + |
1106 | + % else: |
1107 | + <!-- current month --> |
1108 | + % if objects[0].time_unit_lt == 'd': |
1109 | + % for x in range(0, start['cols']+1): |
1110 | + <Cell ss:StyleID="s58"><Data ss:Type="Number">${(start['date'] + relativedelta(days=x)).day}</Data></Cell> |
1111 | + % endfor |
1112 | + % elif objects[0].time_unit_lt == 'm': |
1113 | + <Cell ss:StyleID="s58left"><Data ss:Type="Number">1</Data></Cell> |
1114 | + <Cell ss:StyleID="s58" ss:MergeAcross="1"><Data ss:Type="Number">15</Data></Cell> |
1115 | + <Cell ss:StyleID="s58right"><Data ss:Type="Number">${(start['date'] + relativedelta(months=1, day=1, days=-1)).day}</Data></Cell> |
1116 | + % endif |
1117 | + <!-- other months --> |
1118 | + % for x in range(1, 24): |
1119 | + % if objects[0].time_unit_lt == 'd': |
1120 | + % for d in range(1, (start['date'] + relativedelta(months=x+1, day=1, days=-1)).day + 1): |
1121 | + <Cell ss:StyleID="s58"><Data ss:Type="Number">${d}</Data></Cell> |
1122 | + % endfor |
1123 | + % elif objects[0].time_unit_lt == 'm': |
1124 | + <Cell ss:StyleID="s58left"><Data ss:Type="Number">1</Data></Cell> |
1125 | + <Cell ss:StyleID="s58" ss:MergeAcross="1"><Data ss:Type="Number">15</Data></Cell> |
1126 | + <Cell ss:StyleID="s58right"><Data ss:Type="Number">${(start['date'] + relativedelta(months=x+1, day=1, days=-1)).day}</Data></Cell> |
1127 | + % endif |
1128 | + % endfor |
1129 | + |
1130 | + % endif |
1131 | + </Row> |
1132 | + |
1133 | + % for cycle in [1, 2, 3, 4, 5]: |
1134 | + <Row ss:AutoFitHeight="0" ss:Height="14.25" ss:StyleID="s18"> |
1135 | + <Cell ss:StyleID="s34"/> |
1136 | + <Cell ss:StyleID="s39"><Data ss:Type="String">${_('Order Cycle')|x} ${cycle}</Data></Cell> |
1137 | + <% first_offset = get_1_offset(start['date'], objects[0], cycle) %> |
1138 | + % if first_offset is not False: |
1139 | + <Cell ss:StyleID="s32" |
1140 | + % if first_offset: |
1141 | + ss:MergeAcross="${first_offset}" |
1142 | + % endif |
1143 | + /> |
1144 | + % endif |
1145 | + |
1146 | + <% nb_cells = get_cells(objects[0].order_preparation_lt, objects[0].time_unit_lt) %> |
1147 | + % if nb_cells == 1: |
1148 | + <Cell ss:StyleID="s40"><Data ss:Type="Number">12</Data></Cell> |
1149 | + % elif nb_cells > 1: |
1150 | + <Cell ss:StyleID="s40"><Data ss:Type="Number">1</Data></Cell> |
1151 | + % if nb_cells > 2: |
1152 | + <Cell ss:StyleID="s41" |
1153 | + % if nb_cells > 3: |
1154 | + ss:MergeAcross="${nb_cells-3}" |
1155 | + % endif |
1156 | + /> |
1157 | + % endif |
1158 | + <Cell ss:StyleID="s35"><Data ss:Type="Number">2</Data></Cell> |
1159 | + % endif |
1160 | + |
1161 | + |
1162 | + <% nb_cells = get_cells(objects[0].order_creation_lt, objects[0].time_unit_lt) %> |
1163 | + % if nb_cells == 1: |
1164 | + <Cell ss:StyleID="s42"><Data ss:Type="Number">34</Data></Cell> |
1165 | + % elif nb_cells > 1: |
1166 | + <Cell ss:StyleID="s42"><Data ss:Type="Number">3</Data></Cell> |
1167 | + % if nb_cells > 2: |
1168 | + <Cell ss:StyleID="s43" |
1169 | + % if nb_cells > 3: |
1170 | + ss:MergeAcross="${nb_cells-3}" |
1171 | + % endif |
1172 | + /> |
1173 | + % endif |
1174 | + <Cell ss:StyleID="s36"><Data ss:Type="Number">4</Data></Cell> |
1175 | + % endif |
1176 | + |
1177 | + <% nb_cells = get_cells(objects[0].order_validation_lt, objects[0].time_unit_lt) %> |
1178 | + % if nb_cells == 1: |
1179 | + <Cell ss:StyleID="s44"><Data ss:Type="Number">56</Data></Cell> |
1180 | + % elif nb_cells > 1: |
1181 | + <Cell ss:StyleID="s44"><Data ss:Type="Number">5</Data></Cell> |
1182 | + % if nb_cells > 2: |
1183 | + <Cell ss:StyleID="s45" |
1184 | + % if nb_cells > 3: |
1185 | + ss:MergeAcross="${nb_cells-3}" |
1186 | + % endif |
1187 | + /> |
1188 | + % endif |
1189 | + <Cell ss:StyleID="s46"><Data ss:Type="Number">6</Data></Cell> |
1190 | + % endif |
1191 | + |
1192 | + |
1193 | + <% nb_cells = get_cells(objects[0].supplier_lt, objects[0].time_unit_lt) %> |
1194 | + % if nb_cells: |
1195 | + <Cell ss:StyleID="s47" |
1196 | + % if nb_cells > 1: |
1197 | + ss:MergeAcross="${nb_cells-1}" |
1198 | + % endif |
1199 | + ><Data ss:Type="Number">7</Data></Cell> |
1200 | + % endif |
1201 | + |
1202 | + <% nb_cells = get_cells(objects[0].handling_lt, objects[0].time_unit_lt) %> |
1203 | + % if nb_cells: |
1204 | + <Cell ss:StyleID="s50" |
1205 | + % if nb_cells > 1: |
1206 | + ss:MergeAcross="${nb_cells-1}" |
1207 | + % endif |
1208 | + /> |
1209 | + % endif |
1210 | + |
1211 | + <% nb_cells = get_cells(objects[0].order_coverage, objects[0].time_unit_lt) %> |
1212 | + % if nb_cells: |
1213 | + <Cell ss:StyleID="s51" |
1214 | + % if nb_cells > 1: |
1215 | + ss:MergeAcross="${nb_cells-1}" |
1216 | + % endif |
1217 | + ><Data ss:Type="Number">8</Data></Cell> |
1218 | + % endif |
1219 | + </Row> |
1220 | + <Row ss:AutoFitHeight="0" ss:Height="6.75" ss:StyleID="s56"> |
1221 | + <Cell /> |
1222 | + </Row> |
1223 | + % endfor |
1224 | + <Row ss:Height="15.75"/> |
1225 | + <Row> |
1226 | + <Cell ss:Index="14" ss:StyleID="s28"/> |
1227 | + </Row> |
1228 | + <Row> |
1229 | + <Cell ss:Index="14" ss:StyleID="s28"/> |
1230 | + </Row> |
1231 | + <Row> |
1232 | + <Cell ss:Index="14" ss:StyleID="s28"/> |
1233 | + </Row> |
1234 | + <Row> |
1235 | + <Cell ss:Index="14" ss:StyleID="s28"/> |
1236 | + </Row> |
1237 | + <Row> |
1238 | + <Cell ss:Index="6" ss:StyleID="s29"><Data ss:Type="String">${_('Deadlines')|x}</Data></Cell> |
1239 | + </Row> |
1240 | + <Row> |
1241 | + <Cell ss:Index="2" ss:StyleID="s25"><Data ss:Type="String">${_('Order Preparation')|x}</Data></Cell> |
1242 | + <Cell ss:Index="4" ss:StyleID="s146"><Data ss:Type="Number">1</Data></Cell> |
1243 | + <Cell><Data ss:Type="String">${_('Start (inv or FMC discussions)')|x}</Data></Cell> |
1244 | + </Row> |
1245 | + <Row> |
1246 | + <Cell ss:Index="2" ss:StyleID="s19"><Data ss:Type="String">${_('Order creation')|x}</Data></Cell> |
1247 | + <Cell ss:Index="4" ss:StyleID="s146"><Data ss:Type="Number">2</Data></Cell> |
1248 | + <Cell><Data ss:Type="String">${_('Segment Updated')|x}</Data></Cell> |
1249 | + </Row> |
1250 | + <Row> |
1251 | + <Cell ss:Index="2" ss:StyleID="s24"><Data ss:Type="String">${_('Order validation')|x}</Data></Cell> |
1252 | + <Cell ss:Index="4" ss:StyleID="s147"><Data ss:Type="Number">3</Data></Cell> |
1253 | + <Cell><Data ss:Type="String">${_('Order Calculation created')|x}</Data></Cell> |
1254 | + </Row> |
1255 | + <Row> |
1256 | + <Cell ss:Index="2" ss:StyleID="s26"><Data ss:Type="String">${_('Supplier LT')|x}</Data></Cell> |
1257 | + <Cell ss:Index="4" ss:StyleID="s147"><Data ss:Type="Number">4</Data></Cell> |
1258 | + <Cell><Data ss:Type="String">${_('Order calculation validated')|x}</Data></Cell> |
1259 | + </Row> |
1260 | + <Row> |
1261 | + <Cell ss:Index="2" ss:StyleID="s27"><Data ss:Type="String">${_('Handling LT')|x}</Data></Cell> |
1262 | + <Cell ss:Index="4" ss:StyleID="s148"><Data ss:Type="Number">5</Data></Cell> |
1263 | + <Cell><Data ss:Type="String">${_('IR created')|x}</Data></Cell> |
1264 | + </Row> |
1265 | + <Row> |
1266 | + <Cell ss:Index="2" ss:StyleID="s31"><Data ss:Type="String">${_('Cover time')|x}</Data></Cell> |
1267 | + <Cell ss:Index="4" ss:StyleID="s148"><Data ss:Type="Number">6</Data></Cell> |
1268 | + <Cell><Data ss:Type="String">${_('PO validated')|x}</Data></Cell> |
1269 | + </Row> |
1270 | + <Row> |
1271 | + <Cell ss:Index="4" ss:StyleID="s149"><Data ss:Type="Number">7</Data></Cell> |
1272 | + <Cell><Data ss:Type="String">${_('PO received by Supplier')|x}</Data></Cell> |
1273 | + </Row> |
1274 | + <Row> |
1275 | + <Cell ss:Index="4" ss:StyleID="s150"><Data ss:Type="Number">8</Data></Cell> |
1276 | + <Cell><Data ss:Type="String">${_('RDD')|x}</Data></Cell> |
1277 | + </Row> |
1278 | + <Row /> |
1279 | + </Table> |
1280 | + <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> |
1281 | + <PageSetup> |
1282 | + <Header x:Margin="0.3"/> |
1283 | + <Footer x:Margin="0.3"/> |
1284 | + <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/> |
1285 | + </PageSetup> |
1286 | + <Print> |
1287 | + <ValidPrinterInfo/> |
1288 | + <PaperSizeIndex>9</PaperSizeIndex> |
1289 | + <HorizontalResolution>600</HorizontalResolution> |
1290 | + <VerticalResolution>600</VerticalResolution> |
1291 | + </Print> |
1292 | + <Zoom>80</Zoom> |
1293 | + <Selected/> |
1294 | + <FreezePanes/> |
1295 | + <FrozenNoSplit/> |
1296 | + <SplitHorizontal>1</SplitHorizontal> |
1297 | + <TopRowBottomPane>1</TopRowBottomPane> |
1298 | + <SplitVertical>2</SplitVertical> |
1299 | + <LeftColumnRightPane>2</LeftColumnRightPane> |
1300 | + <ActivePane>0</ActivePane> |
1301 | + <Panes> |
1302 | + <Pane> |
1303 | + <Number>3</Number> |
1304 | + </Pane> |
1305 | + <Pane> |
1306 | + <Number>1</Number> |
1307 | + <ActiveCol>4</ActiveCol> |
1308 | + </Pane> |
1309 | + <Pane> |
1310 | + <Number>2</Number> |
1311 | + </Pane> |
1312 | + <Pane> |
1313 | + <Number>0</Number> |
1314 | + <ActiveCol>1</ActiveCol> |
1315 | + </Pane> |
1316 | + </Panes> |
1317 | + <ProtectObjects>False</ProtectObjects> |
1318 | + <ProtectScenarios>False</ProtectScenarios> |
1319 | + </WorksheetOptions> |
1320 | + </Worksheet> |
1321 | +</Workbook> |
1322 | |
1323 | === added file 'bin/addons/procurement_cycle/report/chronogram.py' |
1324 | --- bin/addons/procurement_cycle/report/chronogram.py 1970-01-01 00:00:00 +0000 |
1325 | +++ bin/addons/procurement_cycle/report/chronogram.py 2021-02-05 11:25:27 +0000 |
1326 | @@ -0,0 +1,100 @@ |
1327 | +# -*- coding: utf-8 -*- |
1328 | +from report import report_sxw |
1329 | +from spreadsheet_xml.spreadsheet_xml_write import SpreadsheetReport |
1330 | +from datetime import datetime |
1331 | +from dateutil import relativedelta |
1332 | +from tools.translate import _ |
1333 | +import math |
1334 | +import calendar |
1335 | +from .. import normalize_td |
1336 | + |
1337 | +class chronogram(report_sxw.rml_parse): |
1338 | + |
1339 | + def __init__(self, cr, uid, name, context): |
1340 | + super(chronogram, self).__init__(cr, uid, name, context=context) |
1341 | + self.localcontext.update({ |
1342 | + 'get_start': self.get_start, |
1343 | + 'relativedelta': relativedelta.relativedelta, |
1344 | + 'MO': relativedelta.MO, |
1345 | + 'month': self.month, |
1346 | + 'ceil': math.ceil, |
1347 | + 'num_cells_in_month': self.num_cells_in_month, |
1348 | + 'get_1_offset': self.get_1_offset, |
1349 | + 'get_cells': self.get_cells, |
1350 | + }) |
1351 | + |
1352 | + |
1353 | + def get_cells(self, value, unit): |
1354 | + if unit == 'd': |
1355 | + return int(round(value)) |
1356 | + |
1357 | + if unit == 'm': |
1358 | + return int(round(value * 4)) |
1359 | + |
1360 | + if unit == 'w': |
1361 | + return int(round(value * 2)) |
1362 | + |
1363 | + def get_1_offset(self, calendar_start, o, cycle): |
1364 | + ''' |
1365 | + returns the number of empty cells before the Order Preperation Date |
1366 | + |
1367 | + ''' |
1368 | + dt = datetime.strptime(o.date_preparing, '%Y-%m-%d') |
1369 | + if cycle > 1: |
1370 | + dt += relativedelta.relativedelta(**normalize_td(o.time_unit_lt, (cycle-1) * (o.order_coverage or 0))) |
1371 | + if calendar_start == dt: |
1372 | + return False |
1373 | + |
1374 | + divisor = 1 |
1375 | + if o.time_unit_lt == 'm': |
1376 | + divisor = (calendar_start + relativedelta.relativedelta(months=1, day=1, days=-1)).day |
1377 | + elif o.time_unit_lt == 'w': |
1378 | + divisor = 7. |
1379 | + return self.get_cells((dt-calendar_start).days / float(divisor), o.time_unit_lt) - 1 |
1380 | + |
1381 | + |
1382 | + def num_cells_in_month(self, dt): |
1383 | + ''' |
1384 | + UoT = w |
1385 | + ''' |
1386 | + |
1387 | + m = calendar.Calendar(0).monthdayscalendar(dt.year, dt.month) |
1388 | + nb_days = (dt + relativedelta.relativedelta(months=1, day=1, days=-1)).day - dt.day |
1389 | + |
1390 | + if dt.day == 1: |
1391 | + cells = (len(m) -2) * 2 |
1392 | + index_k = [0, -1] |
1393 | + else: |
1394 | + cells = nb_days/7 * 2 |
1395 | + index_k = [-1] |
1396 | + |
1397 | + for index in index_k: |
1398 | + nb_d = len([x for x in m[index] if x != 0]) |
1399 | + if nb_d > 5: |
1400 | + cells += 2 |
1401 | + elif nb_d >= 2: |
1402 | + cells += 1 |
1403 | + return cells - 1 |
1404 | + |
1405 | + def month(self, nb): |
1406 | + return [ |
1407 | + '', _('January'), _('February'), _('March'), _('April'), _('May'), _('June'), |
1408 | + _('July'), _('August'), _('September'), _('October'), _('November'), _('December') |
1409 | + ][nb] |
1410 | + |
1411 | + def get_start(self, o): |
1412 | + date_preparing = datetime.strptime(o.date_preparing, '%Y-%m-%d') |
1413 | + |
1414 | + if o.time_unit_lt == 'w': |
1415 | + cols = 0 |
1416 | + start_date = date_preparing + relativedelta.relativedelta(day=1, weekday=relativedelta.MO(0)) |
1417 | + elif o.time_unit_lt in 'd': |
1418 | + start_date = date_preparing + relativedelta.relativedelta(weekday=relativedelta.MO(-1)) |
1419 | + cols = (start_date + relativedelta.relativedelta(months=1, day=1, days=-1)).day - start_date.day |
1420 | + elif o.time_unit_lt == 'm': |
1421 | + start_date = date_preparing + relativedelta.relativedelta(day=1) |
1422 | + cols = 3 |
1423 | + |
1424 | + return {'date': start_date, 'cols': cols} |
1425 | + |
1426 | +SpreadsheetReport('report.report_replenishment_parent_segment_chronogram_xls', 'replenishment.parent.segment', 'addons/procurement_cycle/report/chronogram.mako', parser=chronogram) |