Merge lp:~syleam/wms/5.0-christophe-chauvet into lp:wms
- 5.0-christophe-chauvet
- Merge into 5.0
Proposed by
Christophe CHAUVET
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 218 | ||||||||
Proposed branch: | lp:~syleam/wms/5.0-christophe-chauvet | ||||||||
Merge into: | lp:wms | ||||||||
Diff against target: |
735 lines (+254/-72) 5 files modified
wms/i18n/fr_FR.po (+134/-48) wms/object/move.py (+3/-0) wms/object/picking.py (+114/-24) wms/object/warehouse.py (+2/-0) wms/view/warehouse.xml (+1/-0) |
||||||||
To merge this branch: | bzr merge lp:~syleam/wms/5.0-christophe-chauvet | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christophe CHAUVET | Approve | ||
Review via email: mp+53476@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Christophe CHAUVET (christophe-chauvet) : | # |
review:
Approve
- 218. By Christophe CHAUVET
-
merge from lp:~syleam/wms/5.0-christophe-chauvet
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'wms/i18n/fr_FR.po' |
2 | --- wms/i18n/fr_FR.po 2011-03-02 08:08:10 +0000 |
3 | +++ wms/i18n/fr_FR.po 2011-03-15 16:48:33 +0000 |
4 | @@ -1,20 +1,19 @@ |
5 | # Translation of OpenERP Server. |
6 | # This file contains the translation of the following modules: |
7 | -# * wms |
8 | -# * stock |
9 | -# |
10 | +# * wms |
11 | +# * stock |
12 | msgid "" |
13 | msgstr "" |
14 | "Project-Id-Version: OpenERP Server 5.0.15\n" |
15 | "Report-Msgid-Bugs-To: support@openerp.com\n" |
16 | -"POT-Creation-Date: 2011-02-28 21:58:44+0000\n" |
17 | -"PO-Revision-Date: 2011-03-02 09:07+0100\n" |
18 | +"POT-Creation-Date: 2011-03-15 13:45:18+0000\n" |
19 | +"PO-Revision-Date: 2011-03-15 14:48+0100\n" |
20 | "Last-Translator: Christophe Chauvet <christophe.chauvet@syleam.fr>\n" |
21 | "Language-Team: \n" |
22 | "MIME-Version: 1.0\n" |
23 | "Content-Type: text/plain; charset=UTF-8\n" |
24 | "Content-Transfer-Encoding: 8bit\n" |
25 | -"Plural-Forms: \n" |
26 | +"X-Generator: Translate Toolkit 1.3.0\n" |
27 | |
28 | #. module: stock |
29 | #: field:product.product,track_outgoing:0 |
30 | @@ -78,6 +77,11 @@ |
31 | msgstr "STOCK_MEDIA_FORWARD" |
32 | |
33 | #. module: wms |
34 | +#: field:stock.warehouse,return_location_id:0 |
35 | +msgid "Return location" |
36 | +msgstr "Emplacement de retourn" |
37 | + |
38 | +#. module: wms |
39 | #: help:stock.warehouse,parent_id:0 |
40 | msgid "Define the parent warehouse" |
41 | msgstr "Définir l'entrepôt parent" |
42 | @@ -173,12 +177,6 @@ |
43 | msgstr "Est ce que le contenu est à l'intérieur ?" |
44 | |
45 | #. module: stock |
46 | -#: code:addons/stock/wizard/wizard_return.py:0 |
47 | -#, python-format |
48 | -msgid "Warning !" |
49 | -msgstr "Avertissement !" |
50 | - |
51 | -#. module: stock |
52 | #: model:ir.actions.act_window,name:stock.action_picking_tree4 |
53 | #: model:ir.ui.menu,name:stock.menu_action_picking_tree4 |
54 | msgid "Incoming Products" |
55 | @@ -190,12 +188,12 @@ |
56 | msgid "Reference" |
57 | msgstr "Référence" |
58 | |
59 | -#. modules: wms, stock |
60 | -#: wizard_view:wms.burst,init:0 |
61 | +#. module: wms |
62 | #: code:addons/wms/wizard/burst.py:0 |
63 | #: model:ir.ui.menu,name:wms.menu_stock_burst |
64 | #: view:stock.burst:0 |
65 | #: field:stock.burst.line,burst_id:0 |
66 | +#: wizard_view:wms.burst,init:0 |
67 | #, python-format |
68 | msgid "Burst" |
69 | msgstr "Mode rafale" |
70 | @@ -251,10 +249,9 @@ |
71 | msgstr "STOCK_CANCEL" |
72 | |
73 | #. module: stock |
74 | -#: code:addons/stock/wizard/inventory_merge.py:0 |
75 | -#, python-format |
76 | -msgid "Please select at least two inventories." |
77 | -msgstr "Merci de sélectionner au moins deux inventaires" |
78 | +#: selection:stock.location,usage:0 |
79 | +msgid "Internal Location" |
80 | +msgstr "Emplacement interne" |
81 | |
82 | #. module: stock |
83 | #: view:stock.inventory:0 |
84 | @@ -566,8 +563,8 @@ |
85 | #: field:stock.move,product_qty:0 |
86 | #: rml:stock.picking.list:0 |
87 | #: field:stock.report.prodlots,name:0 |
88 | +#: field:stock.burst.line,quantity:0 |
89 | #: wizard_field:wms.burst,init,quantity:0 |
90 | -#: field:stock.burst.line,quantity:0 |
91 | msgid "Quantity" |
92 | msgstr "Quantité" |
93 | |
94 | @@ -622,6 +619,16 @@ |
95 | msgstr "Fournisseurs IT" |
96 | |
97 | #. module: wms |
98 | +#: field:stock.picking,transporter_number:0 |
99 | +msgid "Tracking number" |
100 | +msgstr "Numéro de suivi" |
101 | + |
102 | +#. module: wms |
103 | +#: help:stock.warehouse,return_location_id:0 |
104 | +msgid "Choose the return location on this warehouse" |
105 | +msgstr "Choisir un emplacement de retour pour cet entrepôt" |
106 | + |
107 | +#. module: wms |
108 | #: view:res.company:0 |
109 | msgid "Average price calculate on stock picking" |
110 | msgstr "Calcul du PUMP sur les mouvements de stock de type :" |
111 | @@ -689,6 +696,37 @@ |
112 | msgstr "Cet emplacement de stock sera utilisé au lieu de celui par défaut, comme emplacement source sur les movements de stock générés quand vous effectuez un inventaire" |
113 | |
114 | #. module: wms |
115 | +#: model:product.template,description:wms.product_ipad2_product_template |
116 | +msgid "" |
117 | +" * Wi-Fi + 3G model: UMTS/HSDPA/HSUPA (850, 900, 1900, 2100 MHz); GSM/EDGE (850, 900, 1800, 1900 MHz)\n" |
118 | +" * Wi-Fi + 3G for Verizon model: CDMA EV-DO Rev. A (800, 1900 MHz)\n" |
119 | +" * Data only3\n" |
120 | +" * Wi-Fi (802.11a/b/g/n)\n" |
121 | +" * Bluetooth 2.1 + EDR technology\n" |
122 | +" * 9.7-inch (diagonal) LED-backlit glossy widescreen Multi-Touch display with IPS technology\n" |
123 | +" * 1024-by-768-pixel resolution at 132 pixels per inch (ppi)\n" |
124 | +" * Fingerprint-resistant oleophobic coating\n" |
125 | +" * Support for display of multiple languages and characters simultaneously\n" |
126 | +" * Back camera: Video recording, HD (720p) up to 30 frames per second with audio; still camera with 5x digital zoom\n" |
127 | +" * Front camera: Video recording, VGA up to 30 frames per second with audio; VGA-quality still camera\n" |
128 | +" * Tap to control exposure for video or stills\n" |
129 | +" * Photo and video geotagging over Wi-Fi" |
130 | +msgstr "" |
131 | +" * Wi-Fi + 3G model: UMTS/HSDPA/HSUPA (850, 900, 1900, 2100 MHz); GSM/EDGE (850, 900, 1800, 1900 MHz)\n" |
132 | +" * Wi-Fi + 3G for Verizon model: CDMA EV-DO Rev. A (800, 1900 MHz)\n" |
133 | +" * Data only3\n" |
134 | +" * Wi-Fi (802.11a/b/g/n)\n" |
135 | +" * Bluetooth 2.1 + EDR technology\n" |
136 | +" * 9.7-inch (diagonal) LED-backlit glossy widescreen Multi-Touch display with IPS technology\n" |
137 | +" * 1024-by-768-pixel resolution at 132 pixels per inch (ppi)\n" |
138 | +" * Fingerprint-resistant oleophobic coating\n" |
139 | +" * Support for display of multiple languages and characters simultaneously\n" |
140 | +" * Back camera: Video recording, HD (720p) up to 30 frames per second with audio; still camera with 5x digital zoom\n" |
141 | +" * Front camera: Video recording, VGA up to 30 frames per second with audio; VGA-quality still camera\n" |
142 | +" * Tap to control exposure for video or stills\n" |
143 | +" * Photo and video geotagging over Wi-Fi" |
144 | + |
145 | +#. module: wms |
146 | #: model:stock.location,name:wms.stock_location_chariot1 |
147 | msgid "Chariot 1" |
148 | msgstr "Chariot 1" |
149 | @@ -715,12 +753,6 @@ |
150 | msgstr "Vague" |
151 | |
152 | #. module: stock |
153 | -#: code:addons/stock/wizard/wizard_return.py:0 |
154 | -#, python-format |
155 | -msgid "You cannot return a packing which is not completed yet! Make sure the packing is in \"done\" state!" |
156 | -msgstr "Vous ne pouvez pas retourner un colisage qui n'est pas encore terminé! Assurez vous que le colisage est en état \"terminé\"!" |
157 | - |
158 | -#. module: stock |
159 | #: selection:stock.location,icon:0 |
160 | msgid "STOCK_ZOOM_FIT" |
161 | msgstr "STOCK_ZOOM_FIT" |
162 | @@ -773,6 +805,11 @@ |
163 | msgstr "Stock virtuel" |
164 | |
165 | #. module: stock |
166 | +#: selection:stock.location,usage:0 |
167 | +msgid "View" |
168 | +msgstr "Vue" |
169 | + |
170 | +#. module: stock |
171 | #: selection:stock.location,icon:0 |
172 | msgid "STOCK_DIALOG_ERROR" |
173 | msgstr "STOCK_DIALOG_ERROR" |
174 | @@ -1149,6 +1186,7 @@ |
175 | |
176 | #. module: stock |
177 | #: field:res.partner,property_stock_customer:0 |
178 | +#: selection:stock.location,usage:0 |
179 | msgid "Customer Location" |
180 | msgstr "Emplacement Client" |
181 | |
182 | @@ -1185,9 +1223,9 @@ |
183 | msgid "Downstream traceability" |
184 | msgstr "Traçabilté aval" |
185 | |
186 | -#. modules: wms, stock |
187 | +#. module: wms |
188 | +#: field:stock.burst.line,remark_id:0 |
189 | #: wizard_field:wms.burst,init,remark_id:0 |
190 | -#: field:stock.burst.line,remark_id:0 |
191 | msgid "Observation" |
192 | msgstr "Observation" |
193 | |
194 | @@ -1223,6 +1261,7 @@ |
195 | |
196 | #. module: stock |
197 | #: field:res.partner,property_stock_supplier:0 |
198 | +#: selection:stock.location,usage:0 |
199 | msgid "Supplier Location" |
200 | msgstr "Emplacement fournisseur" |
201 | |
202 | @@ -1364,6 +1403,12 @@ |
203 | msgid "Merging is only allowed on draft inventories." |
204 | msgstr "La fusion est seulement autorisée sur les inventaires en brouillon." |
205 | |
206 | +#. module: stock |
207 | +#: code:addons/stock/wizard/inventory_merge.py:0 |
208 | +#, python-format |
209 | +msgid "Please select at least two inventories." |
210 | +msgstr "Merci de sélectionner au moins deux inventaires" |
211 | + |
212 | #. module: wms |
213 | #: field:stock.move,crossdock_ok:0 |
214 | msgid "Crossdock_ok" |
215 | @@ -1505,6 +1550,7 @@ |
216 | #: model:ir.model,name:stock.model_stock_inventory |
217 | #: field:stock.inventory,name:0 |
218 | #: field:stock.inventory.line,inventory_id:0 |
219 | +#: selection:stock.location,usage:0 |
220 | msgid "Inventory" |
221 | msgstr "Inventaire" |
222 | |
223 | @@ -1777,6 +1823,11 @@ |
224 | msgid "Select the warehouse where the category must be seen" |
225 | msgstr "Selectionner le ou les entrepot(s) ou sera visible cette catégorie" |
226 | |
227 | +#. module: wms |
228 | +#: model:ir.actions.act_window,name:wms.act_product_product_2_stock_move_out |
229 | +msgid "Outging stock" |
230 | +msgstr "Stock sortant" |
231 | + |
232 | #. module: stock |
233 | #: field:product.product,track_incoming:0 |
234 | msgid "Track Incoming Lots" |
235 | @@ -1801,7 +1852,7 @@ |
236 | msgid "Future Qty" |
237 | msgstr "Qté prévisionnelle" |
238 | |
239 | -#. modules: wms, stock |
240 | +#. module: wms |
241 | #: wizard_button:wms.burst,init,end:0 |
242 | msgid "Finnish" |
243 | msgstr "Terminé" |
244 | @@ -2060,6 +2111,11 @@ |
245 | msgid "Outgoing Products" |
246 | msgstr "Produits à expédier" |
247 | |
248 | +#. module: wms |
249 | +#: model:stock.location,name:wms.stock_location_input_w0 |
250 | +msgid "Input" |
251 | +msgstr "Entrée" |
252 | + |
253 | #. module: stock |
254 | #: selection:stock.location,icon:0 |
255 | msgid "STOCK_COLOR_PICKER" |
256 | @@ -2091,6 +2147,11 @@ |
257 | msgstr "Date de création" |
258 | |
259 | #. module: stock |
260 | +#: selection:stock.location,usage:0 |
261 | +msgid "Procurement" |
262 | +msgstr "Réapprovisionnement" |
263 | + |
264 | +#. module: stock |
265 | #: model:stock.location,name:stock.stock_location_4 |
266 | msgid "Maxtor Suppliers" |
267 | msgstr "Fournisseur Maxtor" |
268 | @@ -2250,12 +2311,6 @@ |
269 | msgstr "STOCK_DND_MULTIPLE" |
270 | |
271 | #. module: stock |
272 | -#: code:addons/stock/wizard/wizard_return.py:0 |
273 | -#, python-format |
274 | -msgid "You cannot return a packing with a product quantity zero or less!" |
275 | -msgstr "You cannot return a packing with a product quantity zero or less!" |
276 | - |
277 | -#. module: stock |
278 | #: selection:stock.location,icon:0 |
279 | msgid "STOCK_SPELL_CHECK" |
280 | msgstr "STOCK_SPELL_CHECK" |
281 | @@ -2377,6 +2432,7 @@ |
282 | #. modules: wms, stock |
283 | #: selection:stock.inventory,state:0 |
284 | #: selection:stock.move,state:0 |
285 | +#: view:stock.picking:0 |
286 | #: selection:stock.picking,state:0 |
287 | #: view:stock.burst:0 |
288 | #: selection:stock.burst,state:0 |
289 | @@ -2493,11 +2549,11 @@ |
290 | #: field:stock.move,product_id:0 |
291 | #: field:stock.production.lot,product_id:0 |
292 | #: field:stock.report.prodlots,product_id:0 |
293 | -#: wizard_field:wms.burst,init,product_id:0 |
294 | #: field:product.ul,product_id:0 |
295 | #: field:stock.burst.line,product_id:0 |
296 | #: field:stock.picking,product_id:0 |
297 | #: field:stock.tracking,product_id:0 |
298 | +#: wizard_field:wms.burst,init,product_id:0 |
299 | #: field:wms.report.stock.available,product_id:0 |
300 | msgid "Product" |
301 | msgstr "Produit" |
302 | @@ -2664,9 +2720,9 @@ |
303 | msgstr "Lots" |
304 | |
305 | #. module: wms |
306 | -#: model:ir.actions.act_window,name:wms.act_product_product_2_stock_move_out |
307 | -msgid "Outging stock" |
308 | -msgstr "Stock sortant" |
309 | +#: field:stock.move,move_crossdock_ids:0 |
310 | +msgid "Crossdock movement" |
311 | +msgstr "Mouvement de crossdock" |
312 | |
313 | #. module: stock |
314 | #: selection:stock.picking,move_type:0 |
315 | @@ -2752,8 +2808,7 @@ |
316 | "This is used only if you selected a chained location type.\n" |
317 | "The 'Automatic Move' value will create a stock move after the current one that will be validated automatically. With 'Manual Operation', the stock move has to be validated by a worker. With 'Automatic No Step Added', the location is replaced in the original move." |
318 | msgstr "" |
319 | -"Ceci est employé seulement si vous choisissiez un type d'emplacement chaîné. \n" |
320 | -"La valeur \"Mouvement automatique\" créera un mouvement de stock, après le mouvement courant, qui sera validé automatiquement.\n" |
321 | +"Ceci est employé seulement si vous choisissiez un type d'emplacement chaîné. La valeur \"Mouvement automatique\" créera un mouvement de stock, après le mouvement courant, qui sera validé automatiquement.\n" |
322 | "Avec \"Opération manuelle\", le mouvement de stock doit être validé par un opérateur.\n" |
323 | "Avec \"Automatique sans étape supplémentaire\", l'emplacement est remplacé dans le mouvement de stock initial." |
324 | |
325 | @@ -2853,9 +2908,9 @@ |
326 | msgid "Max. Planned Date" |
327 | msgstr "Date précu maxi." |
328 | |
329 | -#. modules: wms, stock |
330 | +#. module: wms |
331 | +#: wizard_button:picking.generate.wave,init,valid:0 |
332 | #: wizard_button:wms.burst,init,valid:0 |
333 | -#: wizard_button:picking.generate.wave,init,valid:0 |
334 | msgid "OK" |
335 | msgstr "OK" |
336 | |
337 | @@ -2883,7 +2938,6 @@ |
338 | #. module: stock |
339 | #: code:addons/stock/wizard/inventory_merge.py:0 |
340 | #: code:addons/stock/wizard/inventory_merge_zero.py:0 |
341 | -#: code:addons/stock/wizard/wizard_return.py:0 |
342 | #, python-format |
343 | msgid "Warning" |
344 | msgstr "Averstissement" |
345 | @@ -2990,8 +3044,7 @@ |
346 | msgid "Reporting" |
347 | msgstr "Rapport" |
348 | |
349 | -#. modules: wms, stock |
350 | -#: model:ir.actions.wizard,name:stock.burst |
351 | +#. module: wms |
352 | #: model:ir.actions.wizard,name:wms.stock_burst |
353 | msgid "Fast entry" |
354 | msgstr "Saisie rapide" |
355 | @@ -3061,9 +3114,9 @@ |
356 | msgstr "Poids" |
357 | |
358 | #. module: wms |
359 | -#: field:stock.picking,transporter_number:0 |
360 | -msgid "Tracking number" |
361 | -msgstr "Numéro de suivi" |
362 | +#: help:stock.warehouse,force_reserved_location:0 |
363 | +msgid "Force move product in reserved location" |
364 | +msgstr "Forcer le mouvement de produit vers en emplacement de réservation" |
365 | |
366 | #. module: stock |
367 | #: field:stock.location,chained_auto_packing:0 |
368 | @@ -3086,6 +3139,12 @@ |
369 | msgid "Usefull when sale module not installed" |
370 | msgstr "Utile lorsque le module vente n'est pas installé" |
371 | |
372 | +#. module: wms |
373 | +#: code:addons/wms/object/picking.py:0 |
374 | +#, python-format |
375 | +msgid "Message" |
376 | +msgstr "Message !" |
377 | + |
378 | #. module: stock |
379 | #: selection:stock.location,icon:0 |
380 | msgid "STOCK_GOTO_LAST" |
381 | @@ -3129,6 +3188,16 @@ |
382 | msgid "STOCK_JUSTIFY_CENTER" |
383 | msgstr "STOCK_JUSTIFY_CENTER" |
384 | |
385 | +#. module: wms |
386 | +#: model:product.template,name:wms.product_ipad2_product_template |
387 | +msgid "IPAD2" |
388 | +msgstr "IPAD2" |
389 | + |
390 | +#. module: wms |
391 | +#: field:stock.warehouse,force_reserved_location:0 |
392 | +msgid "Force reserved" |
393 | +msgstr "Forcer la réservation" |
394 | + |
395 | #. module: stock |
396 | #: model:ir.actions.act_window,name:stock.action_picking_tree3 |
397 | #: model:ir.actions.act_window,name:stock.action_picking_tree8 |
398 | @@ -3346,6 +3415,7 @@ |
399 | |
400 | #. module: stock |
401 | #: model:stock.location,name:stock.location_production |
402 | +#: selection:stock.location,usage:0 |
403 | msgid "Production" |
404 | msgstr "Production" |
405 | |
406 | @@ -3552,3 +3622,19 @@ |
407 | msgid "Physical Locations" |
408 | msgstr "Emplacements physiques" |
409 | |
410 | +#, fuzzy |
411 | +#~ msgid "Virtuals location" |
412 | +#~ msgstr "Emplacements Virtuels" |
413 | + |
414 | +#, python-format |
415 | +#~ msgid "Warning !" |
416 | +#~ msgstr "Avertissement !" |
417 | + |
418 | +#, python-format |
419 | +#~ msgid "You cannot return a packing which is not completed yet! Make sure the packing is in \"done\" state!" |
420 | +#~ msgstr "Vous ne pouvez pas retourner un colisage qui n'est pas encore terminé! Assurez vous que le colisage est en état \"terminé\"!" |
421 | + |
422 | +#, python-format |
423 | +#~ msgid "You cannot return a packing with a product quantity zero or less!" |
424 | +#~ msgstr "You cannot return a packing with a product quantity zero or less!" |
425 | + |
426 | |
427 | === modified file 'wms/object/move.py' |
428 | --- wms/object/move.py 2011-03-07 13:17:46 +0000 |
429 | +++ wms/object/move.py 2011-03-15 16:48:33 +0000 |
430 | @@ -58,6 +58,7 @@ |
431 | 'invoice_uom_id': fields.many2one('product.uom', 'Invoice UOM', help='Store the invoice UOM'), |
432 | 'crossdock_ok': fields.boolean('Crossdock_ok', help='If check, the crossdoc process have been made'), |
433 | 'order_qty': fields.float('Order Qty.', help='Usefull when sale module not installed'), |
434 | + 'move_crossdock_ids': fields.many2many('stock.move', 'stock_move_crossdock_rel', 'receipt_id', 'prepare_id', 'Crossdock movement', ), |
435 | } |
436 | |
437 | _defaults = { |
438 | @@ -135,6 +136,7 @@ |
439 | The assignement must be keep the production_lot and tracking |
440 | and purpose |
441 | """ |
442 | + print 'check_assign' |
443 | done = [] |
444 | count = 0 |
445 | pickings = {} |
446 | @@ -149,6 +151,7 @@ |
447 | continue |
448 | |
449 | if move.state in ('confirmed', 'waiting'): |
450 | + print 'plop' |
451 | prodlot = move.prodlot_id and move.prodlot_id.id or False |
452 | tracking = move.tracking_id and move.tracking_id.id or False |
453 | res = self.pool.get('stock.location')._product_reserve(cr, uid, [move.location_id.id], move.product_id.id, move.product_qty, |
454 | |
455 | === modified file 'wms/object/picking.py' |
456 | --- wms/object/picking.py 2011-03-07 13:17:46 +0000 |
457 | +++ wms/object/picking.py 2011-03-15 16:48:33 +0000 |
458 | @@ -155,6 +155,24 @@ |
459 | move_ids = self.pool.get('wms.report.stock.available').search(cr, uid, [('product_id', '=', product_id), ('location_id', 'in', loc_ids)], context=context) |
460 | return [x.location_id.id for x in self.pool.get('wms.report.stock.available').browse(cr, uid, move_ids, context=context)] |
461 | |
462 | + def product_crossdock_quantity(self, cr, uid, product_id, warehouse_id, context=None): |
463 | + """ |
464 | + Retrieve the quantity available for this product on his crossdock location |
465 | + """ |
466 | + if context is None: |
467 | + context = {} |
468 | + |
469 | + res = 0.0 |
470 | + cr_ids = self.product_crossdock_location(cr, uid, product_id, warehouse_id, context=context) |
471 | + if cr_ids: |
472 | + ctx = context.copy() |
473 | + ctx['states'] = ('assigned','done',) |
474 | + ctx['what'] = ('in', 'out') |
475 | + ctx['location'] = cr_ids[0] |
476 | + res = self.pool.get('product.product').get_product_available(cr, uid, [product_id], context=ctx)[product_id] |
477 | + |
478 | + return res |
479 | + |
480 | def crossdock_location_available(self, cr, uid, warehouse_ids, context=None): |
481 | """ |
482 | Return the list ids of empty crossdock location for these warehouse |
483 | @@ -198,11 +216,11 @@ |
484 | :return: True if the movement is correct |
485 | :rtype: boolean |
486 | """ |
487 | + print '[I] create_crossdock_move' |
488 | if context is None: |
489 | context = {} |
490 | |
491 | move_obj = self.pool.get('stock.move') |
492 | - |
493 | if crossdock_id is None: |
494 | default_crossdock = self.pool.get('stock.warehouse').read(cr, uid, move.location_dest_id.warehouse_id.id, |
495 | ['crossdock_location_id'], context=context)['crossdock_location_id'] |
496 | @@ -215,40 +233,85 @@ |
497 | ## |
498 | new_id = False |
499 | print 'produit: %s' % move.product_id.name |
500 | - if abs(move.product_id.outgoing_qty) > 0: |
501 | - |
502 | - # Search how many quantity must be put in crossdock |
503 | - picking_ids = self.search(cr, uid, [('type', '=', 'out'), ('state', 'in', ['confirmed', 'assigned'])], |
504 | - context=context) |
505 | - args = [ |
506 | - ('picking_id', 'in', picking_ids), |
507 | - ('product_id', '=', move.product_id.id), |
508 | - ('state', 'in', ['assigned', 'confirmed', 'waiting']), |
509 | - ('crossdock_ok', '=', False), |
510 | - ] |
511 | - reserve_ids = move_obj.search(cr, uid, args, order='date_planned', context=context) |
512 | - print 'reserve_ids ', reserve_ids |
513 | - |
514 | + print 'quantite manquante %.2f' % move.product_id.outgoing_qty |
515 | + #if abs(move.product_id.outgoing_qty) > 0: |
516 | + |
517 | + ### |
518 | + ## Search how many quantity have been reserved, and move all of them to the crossdock location |
519 | + ## |
520 | + picking_ids = self.search(cr, uid, [('type', '=', 'out'), ('state', 'in', ['confirmed', 'assigned'])], |
521 | + context=context) |
522 | + args = [ |
523 | + ('picking_id', 'in', picking_ids), |
524 | + ('product_id', '=', move.product_id.id), |
525 | + ('state', 'in', ['assigned', 'confirmed', 'waiting']), |
526 | + ('crossdock_ok', '=', False), |
527 | + ] |
528 | + reserve_ids = move_obj.search(cr, uid, args, order='date_planned', context=context) |
529 | + print 'reserve_ids ', reserve_ids |
530 | + |
531 | + if reserve_ids: |
532 | reserves = move_obj.browse(cr, uid, reserve_ids, context=context) |
533 | + |
534 | + ### |
535 | + ## Check if this product have available quantity in te crossdock location |
536 | + ## |
537 | + cross_qty = self.product_crossdock_quantity(cr, uid, move.product_id.id, move.picking_id.warehouse_id.id) |
538 | + print 'cross_qty ', cross_qty |
539 | + |
540 | + |
541 | total_ids = [] |
542 | total_crossdock = 0.0 |
543 | + partial_ids = [] |
544 | + partial_crossdock = 0.0 |
545 | for r in reserves: |
546 | + res_qty = r.product_qty |
547 | + if cross_qty >= res_qty: |
548 | + print 'cross_qty >= res_qty (%.2f >= %.2f)' % (cross_qty, res_qty) |
549 | + cross_qty = cross_qty - res_qty |
550 | + res_qty = 0.0 |
551 | + else: |
552 | + print 'cross_qty < res_qty (%.2f < %.2f)' % (cross_qty, res_qty) |
553 | + res_qty = res_qty - cross_qty |
554 | + cross_qty = 0.0 |
555 | + |
556 | + print '------' |
557 | print 'total_crossdock ', total_crossdock |
558 | print 'r.product_qty ', r.product_qty |
559 | print 'move.product_qty ', move.product_qty |
560 | - if (total_crossdock + r.product_qty) > move.product_qty: |
561 | - print 'on sort' |
562 | + print 'res_qty ', res_qty |
563 | + print '(total_crossdock + res_qty) > move.product_qty (%.2f + %.2f) > %.2f' % (total_crossdock, res_qty, move.product_qty) |
564 | + if (total_crossdock + res_qty) > move.product_qty: |
565 | + print 'a pas tout, donc partiel' |
566 | + partial_ids.append(r.id) |
567 | + partial_crossdock += res_qty |
568 | break |
569 | total_ids.append(r.id) |
570 | - total_crossdock += r.product_qty |
571 | + total_crossdock += res_qty |
572 | |
573 | print '===================================' |
574 | + print 'move.product_qty ', move.product_qty |
575 | print 'total_ids ', total_ids |
576 | print 'total_crossdock ', total_crossdock |
577 | + print 'partial_ids ', partial_ids |
578 | + print 'partial_crossdock ', partial_crossdock |
579 | print '===================================' |
580 | |
581 | - # Check if we must split the line in two if there is enougth quantity available |
582 | - if total_crossdock and move.product_qty > total_crossdock: |
583 | + if partial_ids and move.picking_id.warehouse_id.force_reserved_location: |
584 | + ### |
585 | + ## if partial line is force to reserved, we move all quantity to the crossdock location |
586 | + ## |
587 | + args = { |
588 | + 'location_dest_id': crossdock_id, |
589 | + 'state': 'done', |
590 | + 'crossdock_ok': True, |
591 | + } |
592 | + move_obj.write(cr, uid, [move.id], args, context=context) |
593 | + |
594 | + elif total_crossdock and move.product_qty > total_crossdock: |
595 | + ### |
596 | + ## If we have more quantity that reversed one, we split the move line in two |
597 | + ## |
598 | print '[ENOUGTH] ************************' |
599 | rest = (move.product_qty - total_crossdock) |
600 | args = { |
601 | @@ -267,8 +330,8 @@ |
602 | move_obj.write(cr, uid, [move.id], args, context=context) |
603 | |
604 | # Check if move_dest_id is link to an internal picking |
605 | - if move.move_dest_id and move.move_dest_id.type == 'internal': |
606 | - print 'yeah ca pass' |
607 | + if move.move_dest_id and move.move_dest_id.picking_id.type == 'internal': |
608 | + print 'On rectifie les quantites du bon de rangement' |
609 | move_obj.write(cr, uid, [move.move_dest_id.id], {'product_qty': rest}, context=context) |
610 | |
611 | elif total_crossdock: |
612 | @@ -280,6 +343,9 @@ |
613 | } |
614 | move_obj.write(cr, uid, [move.id], args, context=context) |
615 | |
616 | + ### |
617 | + ## made all movement on out picking available |
618 | + ## |
619 | if total_ids: |
620 | args = { |
621 | 'location_id': crossdock_id, |
622 | @@ -288,14 +354,31 @@ |
623 | } |
624 | move_obj.write(cr, uid, total_ids, args, context=context) |
625 | |
626 | + ### |
627 | + ## If checkbox "force_reserved_location" move product to the reserved location |
628 | + ## |
629 | + if partial_ids and move.picking_id.warehouse_id.force_reserved_location: |
630 | + print 'pas assez mais reserver' |
631 | + args = { |
632 | + 'location_id': crossdock_id, |
633 | + } |
634 | + move_obj.write(cr, uid, partial_ids, args, context=context) |
635 | + |
636 | + print '[O] create_crossdock_move' |
637 | return new_id or move.id |
638 | |
639 | def affect_reserved_product(self, cr, uid, move_id, location_id=False, context=None): |
640 | """ |
641 | When product is reserved, we must affect receipt quantity to this one |
642 | + |
643 | + :param move_id: Movement ID |
644 | + :type move_id: integer |
645 | + :param location_id: Location id for the product of this movement |
646 | + :type location_id: integer |
647 | :return: The quantity reserved by the picking out |
648 | :rtype: float |
649 | """ |
650 | + print '[I] affect_reserved_product' |
651 | if context is None: |
652 | context = {} |
653 | |
654 | @@ -339,6 +422,7 @@ |
655 | # On the receipt link, change the location_dest_id to replace by the available one |
656 | move_obj.write(cr, uid, [move_id], {'location_dest_id': location_id}, context=context) |
657 | |
658 | + print '[O] affect_reserved_product' |
659 | return move.move_dest_id.product_qty |
660 | |
661 | def test_finnished(self, cr, uid, ids): |
662 | @@ -347,6 +431,7 @@ |
663 | 1) check if all move are finnished |
664 | 2) if not return False |
665 | """ |
666 | + print '[I] test_finished ************************************************' |
667 | in_ids = [] |
668 | other_ids = [] |
669 | for p in self.browse(cr, uid, ids): |
670 | @@ -384,7 +469,7 @@ |
671 | # If product is reserved to one picking, check it first |
672 | # if not, check if product is in crossdock mode and if out picking is available |
673 | if move.move_dest_id and move.move_dest_id.picking_id and move.move_dest_id.picking_id.type == 'out': |
674 | - print 'WHAT ELSE' |
675 | + print 'This product is reserved' |
676 | pro_crossdock = self.product_crossdock_location(cr, uid, move.product_id.id, |
677 | move.location_dest_id.warehouse_id.id) |
678 | if pro_crossdock: |
679 | @@ -395,13 +480,17 @@ |
680 | self.affect_reserved_product(cr, uid, move.id, tmp_crossdock) |
681 | |
682 | elif not move.crossdock_ok and move.product_id.location_type == 'crossdock' and move.product_qty > 0: |
683 | - |
684 | + ### |
685 | + ## Check if product is already assigned to a crossdock location |
686 | + ## If not retrieve one crossodck location or use the default one on the warehouse |
687 | + ## |
688 | pro_crossdock = self.product_crossdock_location(cr, uid, move.product_id.id, |
689 | move.location_dest_id.warehouse_id.id) |
690 | if pro_crossdock: |
691 | tmp_crossdock = pro_crossdock[0] |
692 | else: |
693 | tmp_crossdock = cd_ids and cd_ids.pop() or None |
694 | + |
695 | m_id = self.create_crossdock_move(cr, uid, move, crossdock_id=tmp_crossdock) |
696 | new_move_ids.append(m_id) |
697 | |
698 | @@ -427,6 +516,7 @@ |
699 | for i in pick_list: |
700 | self.force_assign(cr, uid, [i]) |
701 | |
702 | + print '[O] test_finished' |
703 | return super(StockPicking, self).test_finnished(cr, uid, ids) |
704 | |
705 | def move_merge(self, cr, uid, picking_id, context=None): |
706 | |
707 | === modified file 'wms/object/warehouse.py' |
708 | --- wms/object/warehouse.py 2011-03-04 11:09:39 +0000 |
709 | +++ wms/object/warehouse.py 2011-03-15 16:48:33 +0000 |
710 | @@ -43,11 +43,13 @@ |
711 | help='Choose the return location on this warehouse'), |
712 | 'check_tracking_burst': fields.boolean('check tracking', help='Check tracking on burst out'), |
713 | 'keep_missing_product_in': fields.boolean('Keep product in', help='If check, missing product line on receipt order stay with quantity = 0'), |
714 | + 'force_reserved_location': fields.boolean('Force reserved', help='Force move product in reserved location'), |
715 | } |
716 | |
717 | _defaults = { |
718 | 'check_tracking_burst': lambda *a: False, |
719 | 'keep_missing_product_in': lambda *a: True, |
720 | + 'force_reserved_location': lambda *a: False, |
721 | } |
722 | |
723 | def _check_recursion(self, cr, uid, ids): |
724 | |
725 | === modified file 'wms/view/warehouse.xml' |
726 | --- wms/view/warehouse.xml 2011-03-04 11:09:39 +0000 |
727 | +++ wms/view/warehouse.xml 2011-03-15 16:48:33 +0000 |
728 | @@ -60,6 +60,7 @@ |
729 | <separator string="burst" colspan="4"/> |
730 | <field name="check_tracking_burst"/> |
731 | <field name="keep_missing_product_in" invisible="1"/> |
732 | + <field name="force_reserved_location"/> |
733 | </page> |
734 | </notebook> |
735 | </xpath> |