Merge lp:~dorian-kemps/unifield-server/US-6536 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5613
Proposed branch: lp:~dorian-kemps/unifield-server/US-6536
Merge into: lp:unifield-server
Diff against target: 426 lines (+96/-17)
2 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+36/-11)
bin/addons/stock_override/report/report_stock_move.py (+60/-6)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-6536
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+378106@code.launchpad.net
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 2019-11-21 16:33:04 +0000
3+++ bin/addons/msf_profile/i18n/fr_MF.po 2020-01-27 10:41:38 +0000
4@@ -1477,7 +1477,7 @@
5 msgid "Partner Form"
6 msgstr "Formulaire du Partenaire"
7
8-#. modules: purchase, tender_flow, service_purchasing, sale, purchase_allocation_report, purchase_followup, return_claim, order_types, purchase_compare_rfq, sourcing, consumption_calculation, stock
9+#. modules: purchase, tender_flow, service_purchasing, sale, purchase_allocation_report, purchase_followup, return_claim, order_types, purchase_compare_rfq, sourcing, consumption_calculation, stock, stock_override
10 #: selection:stock.move,order_category:0
11 #: view:purchase.order:0
12 #: selection:purchase.order,categ:0
13@@ -1499,6 +1499,7 @@
14 #: selection:sale.order.line,categ:0
15 #: selection:internal.request.import,imp_categ:0
16 #: selection:stock.reception.wizard,order_category:0
17+#: code:addons/stock_override/report/report_stock_move.py:529
18 msgid "Medical"
19 msgstr "Médical"
20
21@@ -1858,6 +1859,7 @@
22 #: selection:stock.reception.wizard,order_type:0
23 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:36
24 #: field:supplier.performance.wizard,po_type_donation_exp:0
25+#: code:addons/stock_override/report/report_stock_move.py:28
26 #, python-format
27 msgid "Donation before expiry"
28 msgstr "Donation avant expiration"
29@@ -3626,7 +3628,7 @@
30 msgid "You cannot add any new move while validating the picking, rather you can split the lines prior to validation!"
31 msgstr "Vous ne pouvez ajouter aucun nouveau mouvement tout en validant le picking. Veuillez plutôt fractionner les lignes avant Validation!"
32
33-#. modules: purchase_allocation_report, service_purchasing, stock, purchase_followup, sale, msf_supply_doc_export, procurement_request
34+#. modules: purchase_allocation_report, service_purchasing, stock, purchase_followup, sale, msf_supply_doc_export, procurement_request, stock_override
35 #: report:addons/purchase_allocation_report/report/po_allocation_report.mako:158
36 #: report:po.line.allocation.report:0
37 #: field:purchase.order.followup,categ:0
38@@ -3644,6 +3646,7 @@
39 #: report:addons/stock/report/stock_reception_report_xls.mako:230
40 #: field:stock.reception.wizard,order_category:0
41 #: report:addons/stock/report/stock_delivery_report_xls.mako:213
42+#: code:addons/stock_override/report/report_stock_move.py:826
43 msgid "Order Category"
44 msgstr "Catégorie de Commande"
45
46@@ -4054,16 +4057,19 @@
47 msgid "UoM Stock"
48 msgstr "Stock UdM"
49
50-#. modules: stock, sync_client, base, stock_override, stock_move_tracking
51+#. modules: stock, sync_client, base, stock_move_tracking
52 #: view:stock.move:0
53 #: field:ir.translation,src:0
54 #: view:sync.client.message_received:0
55 #: view:sync.client.update_received:0
56-#: report:addons/stock_override/report/report_stock_move_xls.mako:142
57 #: report:tracking.move.report:0
58+msgid "Source"
59+msgstr "Origine"
60+
61+#. module: stock_override
62 #: code:addons/stock_override/report/report_stock_move.py:759
63 msgid "Source"
64-msgstr "Origine"
65+msgstr "Source"
66
67 #. module: base
68 #: field:ir.actions.report.xml,auto:0
69@@ -5533,6 +5539,7 @@
70 #: selection:stock.reception.wizard,order_type:0
71 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:37
72 #: field:supplier.performance.wizard,po_type_donation_st:0
73+#: code:addons/stock_override/report/report_stock_move.py:29
74 #, python-format
75 msgid "Standard donation"
76 msgstr "Donation normale"
77@@ -10179,6 +10186,7 @@
78 #: selection:account.invoice.line,partner_type:0
79 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:32
80 #: field:supplier.performance.wizard,partner_type_intermission:0
81+#: code:addons/stock_override/report/report_stock_move.py:23
82 msgid "Intermission"
83 msgstr "Intermission"
84
85@@ -13054,6 +13062,7 @@
86 #: selection:account.invoice.line,partner_type:0
87 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:30
88 #: field:supplier.performance.wizard,partner_type_external:0
89+#: code:addons/stock_override/report/report_stock_move.py:21
90 msgid "External"
91 msgstr "Externe"
92
93@@ -20712,6 +20721,7 @@
94 #: selection:stock.picking,partner_type_stock_picking:0
95 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:29
96 #: field:supplier.performance.wizard,partner_type_section:0
97+#: code:addons/stock_override/report/report_stock_move.py:20
98 msgid "Inter-section"
99 msgstr "Inter-section"
100
101@@ -24287,6 +24297,7 @@
102 #: selection:stock.reception.wizard,order_type:0
103 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:38
104 #: field:supplier.performance.wizard,po_type_loan:0
105+#: code:addons/stock_override/report/report_stock_move.py:27
106 #, python-format
107 msgid "Loan"
108 msgstr "Prêt"
109@@ -30133,6 +30144,7 @@
110 #: selection:stock.reception.wizard,order_type:0
111 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:35
112 #: field:supplier.performance.wizard,po_type_regular:0
113+#: code:addons/stock_override/report/report_stock_move.py:27
114 #, python-format
115 msgid "Regular"
116 msgstr "Normal"
117@@ -45887,7 +45899,7 @@
118 msgid "Activate the payroll feature"
119 msgstr "Activer l'attribut Paie"
120
121-#. modules: purchase, product, purchase_allocation_report, service_purchasing, consumption_calculation, sale, sales_followup, purchase_compare_rfq, sourcing, order_types, tender_flow, return_claim, purchase_followup, stock
122+#. modules: purchase, product, purchase_allocation_report, service_purchasing, consumption_calculation, sale, sales_followup, purchase_compare_rfq, sourcing, order_types, tender_flow, return_claim, purchase_followup, stock, stock_override
123 #: selection:real.average.consumption,categ:0
124 #: selection:stock.move,order_category:0
125 #: view:product.product:0
126@@ -45912,6 +45924,7 @@
127 #: selection:purchase.report,categ:0
128 #: selection:tender,categ:0
129 #: selection:stock.reception.wizard,order_category:0
130+#: code:addons/stock_override/report/report_stock_move.py:532
131 msgid "Transport"
132 msgstr "Transport"
133
134@@ -46312,6 +46325,7 @@
135 #: selection:account.invoice.line,partner_type:0
136 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:31
137 #: field:supplier.performance.wizard,partner_type_esc:0
138+#: code:addons/stock_override/report/report_stock_move.py:22
139 msgid "ESC"
140 msgstr "ESC"
141
142@@ -50991,11 +51005,12 @@
143 msgid "Search Donation"
144 msgstr "Rechercher Donation"
145
146-#. modules: sale, account_override, account
147+#. modules: sale, account_override, account, stock_override
148 #: report:addons/sale/report/sale_donation_stock_moves_report_xls.mako:127
149 #: field:sale.donation.stock.moves,partner_type:0
150 #: field:account.invoice,partner_type:0
151 #: field:account.invoice.line,partner_type:0
152+#: code:addons/stock_override/report/report_stock_move.py:826
153 msgid "Partner Type"
154 msgstr "Type de Partenaire"
155
156@@ -52553,6 +52568,7 @@
157 #: selection:stock.reception.wizard,order_type:0
158 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:40
159 #: field:supplier.performance.wizard,po_type_purchase_list:0
160+#: code:addons/stock_override/report/report_stock_move.py:32
161 #, python-format
162 msgid "Purchase List"
163 msgstr "Liste d'Achats"
164@@ -53308,6 +53324,7 @@
165 #: selection:stock.reception.wizard,order_type:0
166 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:41
167 #: field:supplier.performance.wizard,po_type_direct:0
168+#: code:addons/stock_override/report/report_stock_move.py:33
169 #, python-format
170 msgid "Direct Purchase Order"
171 msgstr "Bon de Commande Direct"
172@@ -56396,6 +56413,7 @@
173 #: selection:stock.reception.wizard,order_type:0
174 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:39
175 #: field:supplier.performance.wizard,po_type_in_kind:0
176+#: code:addons/stock_override/report/report_stock_move.py:27
177 #, python-format
178 msgid "In Kind Donation"
179 msgstr "Donation en Nature"
180@@ -56406,7 +56424,7 @@
181 msgid "Other Types"
182 msgstr "Autres Types"
183
184-#. modules: purchase, tender_flow, service_purchasing, sale, purchase_allocation_report, purchase_followup, return_claim, order_types, purchase_compare_rfq, sourcing, consumption_calculation, stock
185+#. modules: purchase, tender_flow, service_purchasing, sale, purchase_allocation_report, purchase_followup, return_claim, order_types, purchase_compare_rfq, sourcing, consumption_calculation, stock, stock_override
186 #: selection:stock.move,order_category:0
187 #: view:purchase.order:0
188 #: selection:purchase.order,categ:0
189@@ -56428,6 +56446,7 @@
190 #: selection:sale.order.line,categ:0
191 #: selection:internal.request.import,imp_categ:0
192 #: selection:stock.reception.wizard,order_category:0
193+#: code:addons/stock_override/report/report_stock_move.py:530
194 msgid "Logistic"
195 msgstr "Logistique"
196
197@@ -61929,6 +61948,7 @@
198 #: field:stock.reception.wizard,order_type:0
199 #: code:addons/msf_supply_doc_export/msf_supply_doc_export.py:882
200 #: report:addons/stock/report/stock_delivery_report_xls.mako:212
201+#: code:addons/stock_override/report/report_stock_move.py:826
202 msgid "Order Type"
203 msgstr "Type de Commande"
204
205@@ -74705,6 +74725,7 @@
206 #: report:addons/stock/report/stock_reception_report_xls.mako:234
207 #: report:tracking.move.report:0
208 #: report:addons/stock/report/stock_delivery_report_xls.mako:210
209+#: code:addons/stock_override/report/report_stock_move.py:826
210 #, python-format
211 msgid "Origin"
212 msgstr "Origine"
213@@ -90411,7 +90432,7 @@
214 msgid "Export search result"
215 msgstr "Exporter le résultat de la recherche"
216
217-#. modules: purchase, tender_flow, msf_outgoing, reason_types_moves, product_asset, sale, purchase_allocation_report, base, order_types, specific_locations, return_claim, service_purchasing, purchase_followup, purchase_compare_rfq, sourcing, consumption_calculation, stock
218+#. modules: purchase, tender_flow, msf_outgoing, reason_types_moves, product_asset, sale, purchase_allocation_report, base, order_types, specific_locations, return_claim, service_purchasing, purchase_followup, purchase_compare_rfq, sourcing, consumption_calculation, stock, stock_override
219 #: selection:res.partner.address,type:0
220 #: field:shipment,carrier_other:0
221 #: field:shipment,consignee_other:0
222@@ -90440,6 +90461,7 @@
223 #: selection:sale.order.line,categ:0
224 #: selection:internal.request.import,imp_categ:0
225 #: selection:stock.reception.wizard,order_category:0
226+#: code:addons/stock_override/report/report_stock_move.py:533
227 msgid "Other"
228 msgstr "Autre"
229
230@@ -95651,6 +95673,7 @@
231 #: selection:account.invoice.line,partner_type:0
232 #: code:addons/msf_supply_doc_export/wizard/supplier_performance_wizard.py:28
233 #: field:supplier.performance.wizard,partner_type_internal:0
234+#: code:addons/stock_override/report/report_stock_move.py:19
235 #, python-format
236 msgid "Internal"
237 msgstr "Interne"
238@@ -96649,7 +96672,7 @@
239 msgid "America/Port-au-Prince"
240 msgstr "Amériques/Port-au-Prince"
241
242-#. modules: purchase, tender_flow, purchase_allocation_report, supplier_catalogue, service_purchasing, consumption_calculation, sale, msf_config_locations, procurement, sourcing, order_types, return_claim, purchase_compare_rfq, purchase_followup, stock
243+#. modules: purchase, tender_flow, purchase_allocation_report, supplier_catalogue, service_purchasing, consumption_calculation, sale, msf_config_locations, procurement, sourcing, order_types, return_claim, purchase_compare_rfq, purchase_followup, stock, stock_override
244 #: selection:real.average.consumption,categ:0
245 #: model:stock.location,name:msf_config_locations.stock_location_service
246 #: selection:stock.move,order_category:0
247@@ -96674,6 +96697,7 @@
248 #: view:tender:0
249 #: selection:tender,categ:0
250 #: selection:stock.reception.wizard,order_category:0
251+#: code:addons/stock_override/report/report_stock_move.py:531
252 msgid "Service"
253 msgstr "Service"
254
255@@ -103236,7 +103260,7 @@
256 msgid "Specific Destination Location"
257 msgstr "Zone de Destination Spécifique"
258
259-#. module: stock
260+#. module: stock, stock_override
261 #: report:addons/stock/report/stock_expired_damaged_report_xls.mako:206
262 #: report:addons/stock/report/stock_expired_damaged_report_xls.mako:217
263 #: field:stock.expired.damaged.report,nomen_manda_0:0
264@@ -103244,6 +103268,7 @@
265 #: field:stock.reception.wizard,nomen_manda_0:0
266 #: report:addons/stock/report/stock_delivery_report_xls.mako:190
267 #: field:stock.delivery.wizard,nomen_manda_0:0
268+#: code:addons/stock_override/report/report_stock_move.py:826
269 msgid "Product Main Type"
270 msgstr "Type Principal du Produit"
271
272
273=== modified file 'bin/addons/stock_override/report/report_stock_move.py'
274--- bin/addons/stock_override/report/report_stock_move.py 2019-10-30 16:33:21 +0000
275+++ bin/addons/stock_override/report/report_stock_move.py 2020-01-27 10:41:38 +0000
276@@ -15,6 +15,7 @@
277 import tempfile
278 import base64
279
280+
281 class report_stock_move(osv.osv):
282 _name = "report.stock.move"
283 _rec_name = 'location_id'
284@@ -503,10 +504,35 @@
285 )
286
287 def getLines(self, cr, uid, datas, currency_id, context=None):
288-
289 if context is None:
290 context = {}
291
292+ PARTNER_TYPES = {
293+ 'internal': _('Internal'),
294+ 'section': _('Inter-section'),
295+ 'external': _('External'),
296+ 'esc': _('ESC'),
297+ 'intermission': _('Intermission'),
298+ }
299+
300+ ORDER_TYPES = {
301+ 'regular': _('Regular'),
302+ 'donation_exp': _('Donation before expiry'),
303+ 'donation_st': _('Standard donation'),
304+ 'loan': _('Loan'),
305+ 'in_kind': _('In Kind Donation'),
306+ 'purchase_list': _('Purchase List'),
307+ 'direct': _('Direct Purchase Order'),
308+ }
309+
310+ ORDER_CATEGORIES = {
311+ 'medical': _('Medical'),
312+ 'log': _('Logistic'),
313+ 'service': _('Service'),
314+ 'transport': _('Transport'),
315+ 'other': _('Other'),
316+ }
317+
318 _logger = logging.getLogger('in.out.report')
319 prod_obj = self.pool.get('product.product')
320 curr_obj = self.pool.get('res.currency')
321@@ -552,12 +578,19 @@
322 pick.name as pick_name,
323 m.date as date,
324 uom.name as uom_name,
325+ nom.name as nom_name,
326 t.standard_price as standard_price,
327 m.location_id as location_src_id,
328 m.location_dest_id as location_dest_id,
329+ par.name as partner_name,
330+ par.partner_type as partner_type,
331 m.reason_type_id as reason_type_id,
332 lot.name as lot_name,
333 lot.life_date as life_date,
334+ COALESCE(pick.origin, m.origin) as origin,
335+ pi.ref as pi_name,
336+ case when m.sale_line_id is not null and not so.procurement_request then so.order_type when m.purchase_line_id is not null then po.order_type end as order_type,
337+ case when m.sale_line_id is not null then so.categ when m.purchase_line_id is not null then po.categ end as order_category,
338 case when pick.subtype not in ('ppl', 'packing') then null when so.procurement_request then %s else pl.currency_id end as bug_pl
339 from
340 stock_move m
341@@ -566,10 +599,16 @@
342 inner join product_template t on t.id = p.product_tmpl_id
343 left join stock_picking pick on m.picking_id = pick.id
344 left join stock_production_lot lot on lot.id = m.prodlot_id
345- left join ir_translation trans on trans.name='product.template,name' and trans.res_id=t.id and lang=%s
346+ left join ir_translation trans on trans.name='product.template,name' and trans.res_id=t.id and trans.lang=%s
347 left join sale_order_line sol on m.sale_line_id = sol.id
348 left join sale_order so on sol.order_id = so.id
349+ left join purchase_order_line pol on m.purchase_line_id = pol.id
350+ left join purchase_order po on pol.order_id = po.id
351 left join product_pricelist pl on so.pricelist_id = pl.id
352+ left join product_nomenclature nom on nom.id = t.nomen_manda_0
353+ left join res_partner par on par.id = m.partner_id
354+ left join physical_inventory_discrepancy pi_discr on pi_discr.move_id = m.id
355+ left join physical_inventory pi on pi.id = pi_discr.inventory_id
356 where
357 m.id in %s
358 order by p.default_code, m.date asc, lot.name
359@@ -607,7 +646,6 @@
360 else:
361 prod_stock = prod_stock_cache[move['product_id']]['stock']
362
363-
364 if move['prodlot_id']:
365 ctx.update({'prodlot_id': move['prodlot_id'], 'from_strict_date': bn_stock_cache.get(move['prodlot_id'], {}).get('to_date', False)})
366 if ctx['to_date'] != ctx['from_strict_date']:
367@@ -645,6 +683,7 @@
368 move['default_code'],
369 move['product_name'],
370 move['uom_name'],
371+ move['nom_name'],
372 move_date and datetime.datetime.strptime(move_date, '%Y-%m-%d %H:%M:%S') or '',
373 move['lot_name'] or '',
374 move['life_date'] and datetime.datetime.strptime(move['life_date'], '%Y-%m-%d'),
375@@ -655,8 +694,13 @@
376 prod_stock,
377 location_info.get(move['location_src_id']),
378 location_info.get(move['location_dest_id']),
379+ move['partner_name'],
380+ PARTNER_TYPES.get(move['partner_type']) or '',
381 reason_info.get(move['reason_type_id']) or '',
382- move['pick_name'] or move['move_name'] or '',
383+ move['pi_name'] or move['pick_name'] or move['move_name'] or '',
384+ move['pi_name'] and move['move_name'] or move['origin'] or '',
385+ ORDER_TYPES.get(move['order_type']) or '',
386+ ORDER_CATEGORIES.get(move['order_category']) or '',
387 ]
388
389 raise StopIteration
390@@ -726,6 +770,13 @@
391 """)
392 row_style.borders = borders
393
394+ row_left_style = easyxf("""
395+ font: height 200;
396+ font: name Calibri;
397+ align: wrap on, vert center, horiz left;
398+ """)
399+ row_left_style.borders = borders
400+
401 date_time_format = easyxf(
402 """
403 font: height 200;
404@@ -774,7 +825,7 @@
405
406 row_count += 1
407 pos = 0
408- headers = [(_('Product Code'), '', 25), (_('Product Description'), '', 70), (_('UoM'), '', 11), (_('Stock Move Date'), date_time_format,20), (_('Batch'), '',30), (_('Exp Date'), date_format, 11), (_('Quantity'), '', 10), (_('Unit Price (%s)') % (currency.name,), '', 10), (_('Movement value (%s)') % (currency.name,) , '', 10), (_('BN stock after movement (instance)'), '', 10), (_('Total stock after movement (instance)'), '', 10), (_('Source'), '', 40), (_('Destination'), '', 40), (_('Reason Type'), '', 30), (_('Document Ref.'), '', 40)]
409+ headers = [(_('Product Code'), '', 25), (_('Product Description'), '', 70), (_('UoM'), '', 11), (_('Product Main Type'), '', 11), (_('Stock Move Date'), date_time_format,20), (_('Batch'), '',30), (_('Exp Date'), date_format, 11), (_('Quantity'), '', 10), (_('Unit Price (%s)') % (currency.name,), '', 10), (_('Movement value (%s)') % (currency.name,) , '', 10), (_('BN stock after movement (instance)'), '', 10), (_('Total stock after movement (instance)'), '', 10), (_('Source'), '', 40), (_('Destination'), '', 40), (_('Partner'), '', 30), (_('Partner Type'), '', 15), (_('Reason Type'), '', 30), (_('Document Ref.'), '', 40), (_('Origin'), '', 70), (_('Order Type'), '', 15), (_('Order Category'), '', 11)]
410
411 for header_row, col_type, size in headers:
412 sheet.col(pos).width = size * 256
413@@ -793,7 +844,10 @@
414 if value and headers[col_count][1]:
415 style = headers[col_count][1]
416 else:
417- style = row_style
418+ if col_count == 18: # Change style on Origin column
419+ style = row_left_style
420+ else:
421+ style = row_style
422 sheet.write(row_count, col_count, value, style)
423 col_count += 1
424 #sheet.row(row_count).height = 60*20
425
426=== removed file 'bin/addons/stock_override/report/report_stock_move_xls.mako.THIS'

Subscribers

People subscribed via source and target branches