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 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Christophe CHAUVET | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 212 | ||||||||
Proposed branch: | lp:~syleam/wms/5.0-christophe-chauvet | ||||||||
Merge into: | lp:wms | ||||||||
Diff against target: |
2322 lines (+1033/-291) 20 files modified
wms/i18n/fr_FR.po (+141/-61) wms/i18n/wms.pot (+128/-50) wms/object/burst.py (+27/-9) wms/object/picking.py (+33/-16) wms/object/tracking.py (+1/-1) wms/object/warehouse.py (+28/-2) wms/view/burst.xml (+2/-2) wms/view/location.xml (+8/-0) wms/view/warehouse.xml (+28/-4) wms/wizard/burst.py (+3/-3) wms/wizard/generate_wave.py (+4/-4) wms/wizard/wizard.xml (+4/-4) wms_inventory/__terp__.py (+1/-0) wms_inventory/i18n/fr_FR.po (+199/-38) wms_inventory/i18n/wms_inventory.pot (+188/-44) wms_inventory/object/__init__.py (+1/-0) wms_inventory/object/inventory.py (+158/-53) wms_inventory/object/warehouse.py (+37/-0) wms_inventory/view/warehouse.xml (+41/-0) wms_location/object/location.py (+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+51498@code.launchpad.net |
Commit message
bugfix merge for 2 bugs
Description of the change
Fix 2 bugs and new features for inventory
To post a comment you must log in.
- 212. By Christophe CHAUVET
-
merge
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-02-24 20:58:12 +0000 |
3 | +++ wms/i18n/fr_FR.po 2011-02-28 08:44:57 +0000 |
4 | @@ -5,8 +5,8 @@ |
5 | msgstr "" |
6 | "Project-Id-Version: OpenERP Server 5.0.12\n" |
7 | "Report-Msgid-Bugs-To: support@openerp.com\n" |
8 | -"POT-Creation-Date: 2011-02-24 20:33:56+0000\n" |
9 | -"PO-Revision-Date: 2011-02-24 21:57+0100\n" |
10 | +"POT-Creation-Date: 2011-02-27 21:41:21+0000\n" |
11 | +"PO-Revision-Date: 2011-02-27 22:43+0100\n" |
12 | "Last-Translator: Christophe Chauvet <christophe.chauvet@syleam.fr>\n" |
13 | "Language-Team: \n" |
14 | "MIME-Version: 1.0\n" |
15 | @@ -15,6 +15,12 @@ |
16 | "X-Generator: Translate Toolkit 1.3.0\n" |
17 | |
18 | #. module: wms |
19 | +#: model:stock.location,name:wms.stock_location_output_thursday |
20 | +#: model:stock.round,name:wms.stock_round_thursday |
21 | +msgid "Thursday" |
22 | +msgstr "Jeudi" |
23 | + |
24 | +#. module: wms |
25 | #: model:ir.actions.wizard,name:wms.wizard_generate_wave |
26 | msgid "Generate wave" |
27 | msgstr "Générer une vague" |
28 | @@ -31,11 +37,6 @@ |
29 | msgstr "Reception en rafale" |
30 | |
31 | #. module: wms |
32 | -#: view:stock.burst:0 |
33 | -msgid "Pickings" |
34 | -msgstr "Pickings" |
35 | - |
36 | -#. module: wms |
37 | #: help:product.ul,is_inside:0 |
38 | msgid "Check this if the content is include in this volume" |
39 | msgstr "Cocher ceci si le contenu est inclus dans le volume" |
40 | @@ -62,6 +63,11 @@ |
41 | msgstr "Enregistre le prix facturé, vérifier l'unité de facturation également" |
42 | |
43 | #. module: wms |
44 | +#: field:stock.picking,wave_id:0 |
45 | +msgid "Wave" |
46 | +msgstr "Vague" |
47 | + |
48 | +#. module: wms |
49 | #: field:product.ul,volume:0 |
50 | msgid "Volume" |
51 | msgstr "Volume" |
52 | @@ -149,6 +155,11 @@ |
53 | msgstr "Suivi" |
54 | |
55 | #. module: wms |
56 | +#: wizard_button:wms.burst,init,end:0 |
57 | +msgid "Finnish" |
58 | +msgstr "Terminé" |
59 | + |
60 | +#. module: wms |
61 | #: help:product.ul,product_id:0 |
62 | msgid "Product for replenishment" |
63 | msgstr "Produit pour le réapprovisionnement" |
64 | @@ -204,12 +215,23 @@ |
65 | msgstr "Est ce que le contenu est à l'intérieur ?" |
66 | |
67 | #. module: wms |
68 | +#: field:stock.warehouse,parent_id:0 |
69 | +msgid "Parent warehouse" |
70 | +msgstr "Entrepôt parent" |
71 | + |
72 | +#. module: wms |
73 | +#: view:stock.burst:0 |
74 | +msgid "Pickings in" |
75 | +msgstr "Receptions liés" |
76 | + |
77 | +#. module: wms |
78 | #: field:wms.report.stock.available,qty:0 |
79 | msgid "Qty" |
80 | msgstr "Qté" |
81 | |
82 | #. module: wms |
83 | #: wizard_button:picking.generate.wave,init,valid:0 |
84 | +#: wizard_button:wms.burst,init,valid:0 |
85 | msgid "OK" |
86 | msgstr "OK" |
87 | |
88 | @@ -271,9 +293,14 @@ |
89 | msgstr "Lot de production" |
90 | |
91 | #. module: wms |
92 | -#: help:stock.picking,warehouse_id:0 |
93 | -msgid "Indicate the warehouse for this picking" |
94 | -msgstr "Indiquer l'entrepôt pour ce bon" |
95 | +#: view:stock.warehouse:0 |
96 | +msgid "burst" |
97 | +msgstr "Rafale" |
98 | + |
99 | +#. module: wms |
100 | +#: help:stock.warehouse,keep_missing_product_in:0 |
101 | +msgid "If check, missing product line on receipt order stay with quantity = 0" |
102 | +msgstr "Si coché, les lignes de produits manquant sur les receptions reste avec une quantité égal à 0 " |
103 | |
104 | #. module: wms |
105 | #: view:stock.picking:0 |
106 | @@ -281,6 +308,11 @@ |
107 | msgstr "Vérifier la disponibilité" |
108 | |
109 | #. module: wms |
110 | +#: field:stock.warehouse,check_tracking_burst:0 |
111 | +msgid "check tracking" |
112 | +msgstr "Activer le suivi" |
113 | + |
114 | +#. module: wms |
115 | #: field:res.partner,is_transporter:0 |
116 | msgid "Transporter ?" |
117 | msgstr "Transporteur ?" |
118 | @@ -334,16 +366,37 @@ |
119 | msgstr "PUMP" |
120 | |
121 | #. module: wms |
122 | +#: view:stock.burst:0 |
123 | +msgid "Pickings out" |
124 | +msgstr "Préparatiions liés" |
125 | + |
126 | +#. module: wms |
127 | +#: constraint:stock.warehouse:0 |
128 | +msgid "You cannot create recursive warehouse !" |
129 | +msgstr "Vous ne pouvez pas créer d'entrepôts récursifs !" |
130 | + |
131 | +#. module: wms |
132 | #: help:product.ul,warehouse_ids:0 |
133 | msgid "Select the warehouse where the UL must be seen" |
134 | msgstr "Selectionner le ou les entrepot(s) ou sera visible cette unité" |
135 | |
136 | #. module: wms |
137 | +#: model:ir.actions.wizard,name:wms.stock_burst |
138 | +msgid "Fast entry" |
139 | +msgstr "Saisie rapide" |
140 | + |
141 | +#. module: wms |
142 | #: help:product.product,qty_physical:0 |
143 | msgid "Currenti real quantities of products, include reserved" |
144 | msgstr "Quantité réel courant du produit, incluant le réservé" |
145 | |
146 | #. module: wms |
147 | +#: code:addons/wms/wizard/generate_wave.py:0 |
148 | +#, python-format |
149 | +msgid "Select cart" |
150 | +msgstr "Sélectionner un chariot" |
151 | + |
152 | +#. module: wms |
153 | #: view:stock.burst.line:0 |
154 | msgid "Line" |
155 | msgstr "Ligne" |
156 | @@ -365,6 +418,7 @@ |
157 | |
158 | #. module: wms |
159 | #: field:stock.burst.line,remark_id:0 |
160 | +#: wizard_field:wms.burst,init,remark_id:0 |
161 | msgid "Observation" |
162 | msgstr "Observation" |
163 | |
164 | @@ -374,12 +428,6 @@ |
165 | msgstr "Erreur: L'unité secondaire doit être dans un catégorie différente que l'unité principale" |
166 | |
167 | #. module: wms |
168 | -#: code:addons/wms/wizard/generate_wave.py:0 |
169 | -#, python-format |
170 | -msgid "You cannot affect chariot on picking in done or cancel" |
171 | -msgstr "Vous ne pouvez pas affecter un chariot sur un bon terminé ou annulé" |
172 | - |
173 | -#. module: wms |
174 | #: field:product.ul,width:0 |
175 | msgid "Width" |
176 | msgstr "Largeur" |
177 | @@ -395,12 +443,6 @@ |
178 | msgstr "Enreigistre le PUMP dans les mouvements de stock" |
179 | |
180 | #. module: wms |
181 | -#: code:addons/wms/wizard/generate_wave.py:0 |
182 | -#, python-format |
183 | -msgid "Only picking out must be affected to a chariot!" |
184 | -msgstr "Seule des préparations peuvent être affecter dans un chariot!" |
185 | - |
186 | -#. module: wms |
187 | #: view:stock.picking:0 |
188 | msgid "Force Availability" |
189 | msgstr "Forcer la disponibilité" |
190 | @@ -411,11 +453,6 @@ |
191 | msgstr "Commentaire" |
192 | |
193 | #. module: wms |
194 | -#: wizard_field:picking.generate.wave,init,chariot_id:0 |
195 | -msgid "Chariot" |
196 | -msgstr "Chariot" |
197 | - |
198 | -#. module: wms |
199 | #: view:stock.burst:0 |
200 | msgid "Partial" |
201 | msgstr "Partiel" |
202 | @@ -457,12 +494,22 @@ |
203 | msgstr "Carton déchiré" |
204 | |
205 | #. module: wms |
206 | +#: help:stock.warehouse,parent_id:0 |
207 | +msgid "Define the parent warehouse" |
208 | +msgstr "Définier l'entrepôt parent" |
209 | + |
210 | +#. module: wms |
211 | #: code:addons/wms/object/burst.py:0 |
212 | #, python-format |
213 | msgid "Not in initial receipt" |
214 | msgstr "Absent dans le bon initial" |
215 | |
216 | #. module: wms |
217 | +#: help:stock.location,analysis_id:0 |
218 | +msgid "Select the ABC of product that can be store by default in this location" |
219 | +msgstr "Sélectionner la classe ABC du produit qui sera stocké par défaut dans cet emplacement" |
220 | + |
221 | +#. module: wms |
222 | #: constraint:product.template:0 |
223 | msgid "Error: The default UOM and the purchase UOM must be in the same category." |
224 | msgstr "Erreur: l'unité par défaut et l'unité d'achat doivent appartenir à la même catégorie." |
225 | @@ -474,9 +521,9 @@ |
226 | msgstr "Note" |
227 | |
228 | #. module: wms |
229 | -#: model:ir.actions.act_window,name:wms.act_product_product_2_stock_move_in |
230 | -msgid "Incoming stock" |
231 | -msgstr "Stock entrant" |
232 | +#: view:product.product:0 |
233 | +msgid "Qty Available" |
234 | +msgstr "Qté disponible" |
235 | |
236 | #. module: wms |
237 | #: field:res.company,average_price_stock_picking_internal:0 |
238 | @@ -520,6 +567,11 @@ |
239 | msgstr "Ce champ pourra être utilser lors de l'impression" |
240 | |
241 | #. module: wms |
242 | +#: wizard_field:picking.generate.wave,init,cart_id:0 |
243 | +msgid "Cart" |
244 | +msgstr "Chariot de préparation" |
245 | + |
246 | +#. module: wms |
247 | #: view:stock.picking:0 |
248 | msgid "Validate" |
249 | msgstr "Valider" |
250 | @@ -535,14 +587,19 @@ |
251 | msgstr "Actif" |
252 | |
253 | #. module: wms |
254 | +#: help:stock.picking,wave_id:0 |
255 | +msgid "Picking wave affectation for this picking" |
256 | +msgstr "Affectation à la vague pour cette préparation" |
257 | + |
258 | +#. module: wms |
259 | #: model:product.template,name:wms.product_magic_mouse_product_template |
260 | msgid "Magic Mouse" |
261 | msgstr "Magic Mouse" |
262 | |
263 | #. module: wms |
264 | -#: model:ir.actions.act_window,name:wms.action_picking_wms_out_board |
265 | -msgid "Picking Orders" |
266 | -msgstr "Bons de préparations" |
267 | +#: help:stock.picking,warehouse_id:0 |
268 | +msgid "Indicate the warehouse for this picking" |
269 | +msgstr "Indiquer l'entrepôt pour ce bon" |
270 | |
271 | #. module: wms |
272 | #: help:res.partner,round_id:0 |
273 | @@ -572,10 +629,9 @@ |
274 | msgstr "DPA" |
275 | |
276 | #. module: wms |
277 | -#: model:stock.location,name:wms.stock_location_output_thursday |
278 | -#: model:stock.round,name:wms.stock_round_thursday |
279 | -msgid "Thursday" |
280 | -msgstr "Jeudi" |
281 | +#: model:stock.location,name:wms.stock_location_w1_output |
282 | +msgid "Output 1" |
283 | +msgstr "Sortie 1" |
284 | |
285 | #. module: wms |
286 | #: code:addons/wms/object/burst.py:0 |
287 | @@ -593,12 +649,18 @@ |
288 | msgstr "Nom de la tournée" |
289 | |
290 | #. module: wms |
291 | +#: model:ir.model,name:wms.model_stock_move_remark |
292 | +msgid "Remark for the stock move" |
293 | +msgstr "Observation pour ce mouvement de stock" |
294 | + |
295 | +#. module: wms |
296 | #: model:ir.model,name:wms.model_stock_burst_line |
297 | msgid "Burst picking line" |
298 | msgstr "Ligne de saisie en rafale" |
299 | |
300 | #. module: wms |
301 | #: field:stock.burst.line,quantity:0 |
302 | +#: wizard_field:wms.burst,init,quantity:0 |
303 | msgid "Quantity" |
304 | msgstr "Quantité" |
305 | |
306 | @@ -627,14 +689,17 @@ |
307 | msgstr "Code" |
308 | |
309 | #. module: wms |
310 | -#: model:ir.model,name:wms.model_stock_move_remark |
311 | -msgid "Remark for the stock move" |
312 | -msgstr "Observation pour ce mouvement de stock" |
313 | +#: field:stock.warehouse,keep_missing_product_in:0 |
314 | +msgid "Keep product in" |
315 | +msgstr "Garder la trace des produits entrants" |
316 | |
317 | #. module: wms |
318 | +#: code:addons/wms/wizard/burst.py:0 |
319 | #: model:ir.ui.menu,name:wms.menu_stock_burst |
320 | #: view:stock.burst:0 |
321 | #: field:stock.burst.line,burst_id:0 |
322 | +#: wizard_view:wms.burst,init:0 |
323 | +#, python-format |
324 | msgid "Burst" |
325 | msgstr "Mode rafale" |
326 | |
327 | @@ -667,6 +732,12 @@ |
328 | msgstr "Annuler" |
329 | |
330 | #. module: wms |
331 | +#: code:addons/wms/wizard/generate_wave.py:0 |
332 | +#, python-format |
333 | +msgid "You cannot affect cart on picking in done or cancel" |
334 | +msgstr "Vous ne pouvez affecter un chariot sur des préparations terminées ou annulées" |
335 | + |
336 | +#. module: wms |
337 | #: view:res.company:0 |
338 | msgid "Average price calculate on stock picking" |
339 | msgstr "Calcul du PUMP sur les mouvements de stock de type :" |
340 | @@ -682,9 +753,9 @@ |
341 | msgstr "Rediriger" |
342 | |
343 | #. module: wms |
344 | -#: help:stock.location,analysis_id:0 |
345 | -msgid "Select the ABC of product that can be store by default in this location" |
346 | -msgstr "Sélectionner la classe ABC du produit qui sera stocké par défaut dans cet emplacement" |
347 | +#: view:stock.warehouse:0 |
348 | +msgid "Information" |
349 | +msgstr "Information" |
350 | |
351 | #. module: wms |
352 | #: field:stock.picking,picking_time:0 |
353 | @@ -697,6 +768,11 @@ |
354 | msgstr "The Object name must start with x_ and not contain any special character !" |
355 | |
356 | #. module: wms |
357 | +#: model:ir.actions.act_window,name:wms.action_picking_wms_out_board |
358 | +msgid "Picking Orders" |
359 | +msgstr "Bons de préparations" |
360 | + |
361 | +#. module: wms |
362 | #: model:ir.actions.act_window,name:wms.act_open_stock_picking_transfer_view |
363 | #: model:ir.ui.menu,name:wms.menu_stock_picking_transfer |
364 | #: view:stock.picking:0 |
365 | @@ -723,9 +799,10 @@ |
366 | msgstr "Vous devez assigner un lot de production pour ce produit" |
367 | |
368 | #. module: wms |
369 | -#: model:stock.location,name:wms.stock_location_w1_output |
370 | -msgid "Output 1" |
371 | -msgstr "Sortie 1" |
372 | +#: code:addons/wms/wizard/generate_wave.py:0 |
373 | +#, python-format |
374 | +msgid "Affect a cart for these picking" |
375 | +msgstr "Affecter un chariot à ces bons de préparations" |
376 | |
377 | #. module: wms |
378 | #: model:ir.module.module,description:wms.module_meta_information |
379 | @@ -767,6 +844,12 @@ |
380 | "\n" |
381 | |
382 | #. module: wms |
383 | +#: code:addons/wms/wizard/generate_wave.py:0 |
384 | +#, python-format |
385 | +msgid "Only picking out must be affected to a cart!" |
386 | +msgstr "Seul des bons de préparation peuvent être affecter à un chariot!" |
387 | + |
388 | +#. module: wms |
389 | #: field:res.users,context_warehouse_id:0 |
390 | #: field:stock.picking,warehouse_id:0 |
391 | #: field:wms.report.stock.available,warehouse_id:0 |
392 | @@ -798,6 +881,7 @@ |
393 | #: field:stock.burst.line,product_id:0 |
394 | #: field:stock.picking,product_id:0 |
395 | #: field:stock.tracking,product_id:0 |
396 | +#: wizard_field:wms.burst,init,product_id:0 |
397 | #: field:wms.report.stock.available,product_id:0 |
398 | msgid "Product" |
399 | msgstr "Produit" |
400 | @@ -818,9 +902,9 @@ |
401 | msgstr "Fournit le concept de classe ABC" |
402 | |
403 | #. module: wms |
404 | -#: field:stock.picking,wave_id:0 |
405 | -msgid "Wave" |
406 | -msgstr "Vague" |
407 | +#: help:stock.warehouse,check_tracking_burst:0 |
408 | +msgid "Check tracking on burst out" |
409 | +msgstr "Activer le suivi en préparation rafale" |
410 | |
411 | #. module: wms |
412 | #: field:res.company,average_price_stock_picking_delivery:0 |
413 | @@ -901,13 +985,9 @@ |
414 | msgstr "Dimension/Poids de l'unité logistique seulement" |
415 | |
416 | #. module: wms |
417 | -#: code:addons/wms/wizard/generate_wave.py:0 |
418 | -#, python-format |
419 | -msgid "" |
420 | -"Not enough location on this chariot.\n" |
421 | -"Required %d\n" |
422 | -"Available %d" |
423 | -msgstr "Pas assez d'emplacement sur ce chariot.\n" |
424 | +#: model:ir.actions.act_window,name:wms.act_product_product_2_stock_move_in |
425 | +msgid "Incoming stock" |
426 | +msgstr "Stock entrant" |
427 | |
428 | #. module: wms |
429 | #: model:ir.model,name:wms.model_stock_burst |
430 | @@ -930,11 +1010,6 @@ |
431 | msgstr "Utiliser pour faire un traitement différent, lorsque la remarque est sélectionnée!" |
432 | |
433 | #. module: wms |
434 | -#: view:product.product:0 |
435 | -msgid "Qty Available" |
436 | -msgstr "Qté disponible" |
437 | - |
438 | -#. module: wms |
439 | #: field:product.product,analysis_id:0 |
440 | #: field:stock.location,analysis_id:0 |
441 | msgid "ABC Class" |
442 | @@ -977,3 +1052,8 @@ |
443 | msgid "You try to assign a lot which is not from the same product" |
444 | msgstr "Vous essayez d'assigner un lot qui n'appartient pas au même produit" |
445 | |
446 | +#~ msgid "test" |
447 | +#~ msgstr "test" |
448 | +#~ msgid "Pickings" |
449 | +#~ msgstr "Pickings" |
450 | + |
451 | |
452 | === modified file 'wms/i18n/wms.pot' |
453 | --- wms/i18n/wms.pot 2011-02-24 20:58:12 +0000 |
454 | +++ wms/i18n/wms.pot 2011-02-28 08:44:57 +0000 |
455 | @@ -4,10 +4,10 @@ |
456 | # |
457 | msgid "" |
458 | msgstr "" |
459 | -"Project-Id-Version: OpenERP Server 5.0.12\n" |
460 | +"Project-Id-Version: OpenERP Server 5.0.15\n" |
461 | "Report-Msgid-Bugs-To: support@openerp.com\n" |
462 | -"POT-Creation-Date: 2011-02-24 20:33:56+0000\n" |
463 | -"PO-Revision-Date: 2011-02-24 20:33:56+0000\n" |
464 | +"POT-Creation-Date: 2011-02-27 21:41:21+0000\n" |
465 | +"PO-Revision-Date: 2011-02-27 21:41:21+0000\n" |
466 | "Last-Translator: <>\n" |
467 | "Language-Team: \n" |
468 | "MIME-Version: 1.0\n" |
469 | @@ -16,6 +16,12 @@ |
470 | "Plural-Forms: \n" |
471 | |
472 | #. module: wms |
473 | +#: model:stock.location,name:wms.stock_location_output_thursday |
474 | +#: model:stock.round,name:wms.stock_round_thursday |
475 | +msgid "Thursday" |
476 | +msgstr "" |
477 | + |
478 | +#. module: wms |
479 | #: model:ir.actions.wizard,name:wms.wizard_generate_wave |
480 | msgid "Generate wave" |
481 | msgstr "" |
482 | @@ -32,11 +38,6 @@ |
483 | msgstr "" |
484 | |
485 | #. module: wms |
486 | -#: view:stock.burst:0 |
487 | -msgid "Pickings" |
488 | -msgstr "" |
489 | - |
490 | -#. module: wms |
491 | #: help:product.ul,is_inside:0 |
492 | msgid "Check this if the content is include in this volume" |
493 | msgstr "" |
494 | @@ -63,6 +64,11 @@ |
495 | msgstr "" |
496 | |
497 | #. module: wms |
498 | +#: field:stock.picking,wave_id:0 |
499 | +msgid "Wave" |
500 | +msgstr "" |
501 | + |
502 | +#. module: wms |
503 | #: field:product.ul,volume:0 |
504 | msgid "Volume" |
505 | msgstr "" |
506 | @@ -150,6 +156,11 @@ |
507 | msgstr "" |
508 | |
509 | #. module: wms |
510 | +#: wizard_button:wms.burst,init,end:0 |
511 | +msgid "Finnish" |
512 | +msgstr "" |
513 | + |
514 | +#. module: wms |
515 | #: help:product.ul,product_id:0 |
516 | msgid "Product for replenishment" |
517 | msgstr "" |
518 | @@ -205,12 +216,23 @@ |
519 | msgstr "" |
520 | |
521 | #. module: wms |
522 | +#: field:stock.warehouse,parent_id:0 |
523 | +msgid "Parent warehouse" |
524 | +msgstr "" |
525 | + |
526 | +#. module: wms |
527 | +#: view:stock.burst:0 |
528 | +msgid "Pickings in" |
529 | +msgstr "" |
530 | + |
531 | +#. module: wms |
532 | #: field:wms.report.stock.available,qty:0 |
533 | msgid "Qty" |
534 | msgstr "" |
535 | |
536 | #. module: wms |
537 | #: wizard_button:picking.generate.wave,init,valid:0 |
538 | +#: wizard_button:wms.burst,init,valid:0 |
539 | msgid "OK" |
540 | msgstr "" |
541 | |
542 | @@ -272,8 +294,13 @@ |
543 | msgstr "" |
544 | |
545 | #. module: wms |
546 | -#: help:stock.picking,warehouse_id:0 |
547 | -msgid "Indicate the warehouse for this picking" |
548 | +#: view:stock.warehouse:0 |
549 | +msgid "burst" |
550 | +msgstr "" |
551 | + |
552 | +#. module: wms |
553 | +#: help:stock.warehouse,keep_missing_product_in:0 |
554 | +msgid "If check, missing product line on receipt order stay with quantity = 0" |
555 | msgstr "" |
556 | |
557 | #. module: wms |
558 | @@ -282,6 +309,11 @@ |
559 | msgstr "" |
560 | |
561 | #. module: wms |
562 | +#: field:stock.warehouse,check_tracking_burst:0 |
563 | +msgid "check tracking" |
564 | +msgstr "" |
565 | + |
566 | +#. module: wms |
567 | #: field:res.partner,is_transporter:0 |
568 | msgid "Transporter ?" |
569 | msgstr "" |
570 | @@ -335,16 +367,37 @@ |
571 | msgstr "" |
572 | |
573 | #. module: wms |
574 | +#: view:stock.burst:0 |
575 | +msgid "Pickings out" |
576 | +msgstr "" |
577 | + |
578 | +#. module: wms |
579 | +#: constraint:stock.warehouse:0 |
580 | +msgid "You cannot create recursive warehouse !" |
581 | +msgstr "" |
582 | + |
583 | +#. module: wms |
584 | #: help:product.ul,warehouse_ids:0 |
585 | msgid "Select the warehouse where the UL must be seen" |
586 | msgstr "" |
587 | |
588 | #. module: wms |
589 | +#: model:ir.actions.wizard,name:wms.stock_burst |
590 | +msgid "Fast entry" |
591 | +msgstr "" |
592 | + |
593 | +#. module: wms |
594 | #: help:product.product,qty_physical:0 |
595 | msgid "Currenti real quantities of products, include reserved" |
596 | msgstr "" |
597 | |
598 | #. module: wms |
599 | +#: code:addons/wms/wizard/generate_wave.py:0 |
600 | +#, python-format |
601 | +msgid "Select cart" |
602 | +msgstr "" |
603 | + |
604 | +#. module: wms |
605 | #: view:stock.burst.line:0 |
606 | msgid "Line" |
607 | msgstr "" |
608 | @@ -366,6 +419,7 @@ |
609 | |
610 | #. module: wms |
611 | #: field:stock.burst.line,remark_id:0 |
612 | +#: wizard_field:wms.burst,init,remark_id:0 |
613 | msgid "Observation" |
614 | msgstr "" |
615 | |
616 | @@ -375,12 +429,6 @@ |
617 | msgstr "" |
618 | |
619 | #. module: wms |
620 | -#: code:addons/wms/wizard/generate_wave.py:0 |
621 | -#, python-format |
622 | -msgid "You cannot affect chariot on picking in done or cancel" |
623 | -msgstr "" |
624 | - |
625 | -#. module: wms |
626 | #: field:product.ul,width:0 |
627 | msgid "Width" |
628 | msgstr "" |
629 | @@ -396,12 +444,6 @@ |
630 | msgstr "" |
631 | |
632 | #. module: wms |
633 | -#: code:addons/wms/wizard/generate_wave.py:0 |
634 | -#, python-format |
635 | -msgid "Only picking out must be affected to a chariot!" |
636 | -msgstr "" |
637 | - |
638 | -#. module: wms |
639 | #: view:stock.picking:0 |
640 | msgid "Force Availability" |
641 | msgstr "" |
642 | @@ -412,11 +454,6 @@ |
643 | msgstr "" |
644 | |
645 | #. module: wms |
646 | -#: wizard_field:picking.generate.wave,init,chariot_id:0 |
647 | -msgid "Chariot" |
648 | -msgstr "" |
649 | - |
650 | -#. module: wms |
651 | #: view:stock.burst:0 |
652 | msgid "Partial" |
653 | msgstr "" |
654 | @@ -458,12 +495,22 @@ |
655 | msgstr "" |
656 | |
657 | #. module: wms |
658 | +#: help:stock.warehouse,parent_id:0 |
659 | +msgid "Define the parent warehouse" |
660 | +msgstr "" |
661 | + |
662 | +#. module: wms |
663 | #: code:addons/wms/object/burst.py:0 |
664 | #, python-format |
665 | msgid "Not in initial receipt" |
666 | msgstr "" |
667 | |
668 | #. module: wms |
669 | +#: help:stock.location,analysis_id:0 |
670 | +msgid "Select the ABC of product that can be store by default in this location" |
671 | +msgstr "" |
672 | + |
673 | +#. module: wms |
674 | #: constraint:product.template:0 |
675 | msgid "Error: The default UOM and the purchase UOM must be in the same category." |
676 | msgstr "" |
677 | @@ -475,8 +522,8 @@ |
678 | msgstr "" |
679 | |
680 | #. module: wms |
681 | -#: model:ir.actions.act_window,name:wms.act_product_product_2_stock_move_in |
682 | -msgid "Incoming stock" |
683 | +#: view:product.product:0 |
684 | +msgid "Qty Available" |
685 | msgstr "" |
686 | |
687 | #. module: wms |
688 | @@ -521,6 +568,11 @@ |
689 | msgstr "" |
690 | |
691 | #. module: wms |
692 | +#: wizard_field:picking.generate.wave,init,cart_id:0 |
693 | +msgid "Cart" |
694 | +msgstr "" |
695 | + |
696 | +#. module: wms |
697 | #: view:stock.picking:0 |
698 | msgid "Validate" |
699 | msgstr "" |
700 | @@ -536,13 +588,18 @@ |
701 | msgstr "" |
702 | |
703 | #. module: wms |
704 | +#: help:stock.picking,wave_id:0 |
705 | +msgid "Picking wave affectation for this picking" |
706 | +msgstr "" |
707 | + |
708 | +#. module: wms |
709 | #: model:product.template,name:wms.product_magic_mouse_product_template |
710 | msgid "Magic Mouse" |
711 | msgstr "" |
712 | |
713 | #. module: wms |
714 | -#: model:ir.actions.act_window,name:wms.action_picking_wms_out_board |
715 | -msgid "Picking Orders" |
716 | +#: help:stock.picking,warehouse_id:0 |
717 | +msgid "Indicate the warehouse for this picking" |
718 | msgstr "" |
719 | |
720 | #. module: wms |
721 | @@ -573,9 +630,8 @@ |
722 | msgstr "" |
723 | |
724 | #. module: wms |
725 | -#: model:stock.location,name:wms.stock_location_output_thursday |
726 | -#: model:stock.round,name:wms.stock_round_thursday |
727 | -msgid "Thursday" |
728 | +#: model:stock.location,name:wms.stock_location_w1_output |
729 | +msgid "Output 1" |
730 | msgstr "" |
731 | |
732 | #. module: wms |
733 | @@ -594,12 +650,18 @@ |
734 | msgstr "" |
735 | |
736 | #. module: wms |
737 | +#: model:ir.model,name:wms.model_stock_move_remark |
738 | +msgid "Remark for the stock move" |
739 | +msgstr "" |
740 | + |
741 | +#. module: wms |
742 | #: model:ir.model,name:wms.model_stock_burst_line |
743 | msgid "Burst picking line" |
744 | msgstr "" |
745 | |
746 | #. module: wms |
747 | #: field:stock.burst.line,quantity:0 |
748 | +#: wizard_field:wms.burst,init,quantity:0 |
749 | msgid "Quantity" |
750 | msgstr "" |
751 | |
752 | @@ -628,14 +690,17 @@ |
753 | msgstr "" |
754 | |
755 | #. module: wms |
756 | -#: model:ir.model,name:wms.model_stock_move_remark |
757 | -msgid "Remark for the stock move" |
758 | +#: field:stock.warehouse,keep_missing_product_in:0 |
759 | +msgid "Keep product in" |
760 | msgstr "" |
761 | |
762 | #. module: wms |
763 | +#: code:addons/wms/wizard/burst.py:0 |
764 | #: model:ir.ui.menu,name:wms.menu_stock_burst |
765 | #: view:stock.burst:0 |
766 | #: field:stock.burst.line,burst_id:0 |
767 | +#: wizard_view:wms.burst,init:0 |
768 | +#, python-format |
769 | msgid "Burst" |
770 | msgstr "" |
771 | |
772 | @@ -668,6 +733,12 @@ |
773 | msgstr "" |
774 | |
775 | #. module: wms |
776 | +#: code:addons/wms/wizard/generate_wave.py:0 |
777 | +#, python-format |
778 | +msgid "You cannot affect cart on picking in done or cancel" |
779 | +msgstr "" |
780 | + |
781 | +#. module: wms |
782 | #: view:res.company:0 |
783 | msgid "Average price calculate on stock picking" |
784 | msgstr "" |
785 | @@ -683,8 +754,8 @@ |
786 | msgstr "" |
787 | |
788 | #. module: wms |
789 | -#: help:stock.location,analysis_id:0 |
790 | -msgid "Select the ABC of product that can be store by default in this location" |
791 | +#: view:stock.warehouse:0 |
792 | +msgid "Information" |
793 | msgstr "" |
794 | |
795 | #. module: wms |
796 | @@ -698,6 +769,11 @@ |
797 | msgstr "" |
798 | |
799 | #. module: wms |
800 | +#: model:ir.actions.act_window,name:wms.action_picking_wms_out_board |
801 | +msgid "Picking Orders" |
802 | +msgstr "" |
803 | + |
804 | +#. module: wms |
805 | #: model:ir.actions.act_window,name:wms.act_open_stock_picking_transfer_view |
806 | #: model:ir.ui.menu,name:wms.menu_stock_picking_transfer |
807 | #: view:stock.picking:0 |
808 | @@ -724,8 +800,9 @@ |
809 | msgstr "" |
810 | |
811 | #. module: wms |
812 | -#: model:stock.location,name:wms.stock_location_w1_output |
813 | -msgid "Output 1" |
814 | +#: code:addons/wms/wizard/generate_wave.py:0 |
815 | +#, python-format |
816 | +msgid "Affect a cart for these picking" |
817 | msgstr "" |
818 | |
819 | #. module: wms |
820 | @@ -751,6 +828,12 @@ |
821 | msgstr "" |
822 | |
823 | #. module: wms |
824 | +#: code:addons/wms/wizard/generate_wave.py:0 |
825 | +#, python-format |
826 | +msgid "Only picking out must be affected to a cart!" |
827 | +msgstr "" |
828 | + |
829 | +#. module: wms |
830 | #: field:res.users,context_warehouse_id:0 |
831 | #: field:stock.picking,warehouse_id:0 |
832 | #: field:wms.report.stock.available,warehouse_id:0 |
833 | @@ -782,6 +865,7 @@ |
834 | #: field:stock.burst.line,product_id:0 |
835 | #: field:stock.picking,product_id:0 |
836 | #: field:stock.tracking,product_id:0 |
837 | +#: wizard_field:wms.burst,init,product_id:0 |
838 | #: field:wms.report.stock.available,product_id:0 |
839 | msgid "Product" |
840 | msgstr "" |
841 | @@ -802,8 +886,8 @@ |
842 | msgstr "" |
843 | |
844 | #. module: wms |
845 | -#: field:stock.picking,wave_id:0 |
846 | -msgid "Wave" |
847 | +#: help:stock.warehouse,check_tracking_burst:0 |
848 | +msgid "Check tracking on burst out" |
849 | msgstr "" |
850 | |
851 | #. module: wms |
852 | @@ -885,9 +969,8 @@ |
853 | msgstr "" |
854 | |
855 | #. module: wms |
856 | -#: code:addons/wms/wizard/generate_wave.py:0 |
857 | -#, python-format |
858 | -msgid "Not enough location on this chariot.\nRequired %d\nAvailable %d" |
859 | +#: model:ir.actions.act_window,name:wms.act_product_product_2_stock_move_in |
860 | +msgid "Incoming stock" |
861 | msgstr "" |
862 | |
863 | #. module: wms |
864 | @@ -911,11 +994,6 @@ |
865 | msgstr "" |
866 | |
867 | #. module: wms |
868 | -#: view:product.product:0 |
869 | -msgid "Qty Available" |
870 | -msgstr "" |
871 | - |
872 | -#. module: wms |
873 | #: field:product.product,analysis_id:0 |
874 | #: field:stock.location,analysis_id:0 |
875 | msgid "ABC Class" |
876 | |
877 | === modified file 'wms/object/burst.py' |
878 | --- wms/object/burst.py 2011-02-22 16:02:33 +0000 |
879 | +++ wms/object/burst.py 2011-02-28 08:44:57 +0000 |
880 | @@ -57,7 +57,7 @@ |
881 | |
882 | return super(stock_burst, self).copy(cr, uid, id, default, context=context) |
883 | |
884 | - def _merge(self, cr, uid, ids, context=None): |
885 | + def _merge(self, cr, uid, id, context=None): |
886 | """ |
887 | Merge burst lines |
888 | Returns burst lines in dico : {'product_key': (total_qty, [(qty, line_id, remark_id), (qty, line_id, remark_id), ])} |
889 | @@ -67,15 +67,16 @@ |
890 | |
891 | # Retrieve burst lines |
892 | burst_line_obj = self.pool.get('stock.burst.line') |
893 | - burst_line_ids = burst_line_obj.search(cr, uid, [('burst_id', '=', ids[0]), ('is_done', '=', False)], context=context) |
894 | + burst_line_ids = burst_line_obj.search(cr, uid, [('burst_id', '=', id), ('is_done', '=', False)], context=context) |
895 | burst_lines = burst_line_obj.browse(cr, uid, burst_line_ids, context=context) |
896 | |
897 | known_lines = {} |
898 | lines_to_delete = [] |
899 | + burst_type = self.read(cr, uid, id, ['type'], context=context)['type'] |
900 | for line in burst_lines: |
901 | - product_key = "%d_%d_%d" % (line.product_id.id, line.prodlot_id and line.prodlot_id.id or 0, line.tracking_id and line.tracking_id.id or 0) |
902 | + product_key = "%d_%d_%d" % (line.product_id.id, line.prodlot_id and line.prodlot_id.id or 0, |
903 | + line.tracking_id and line.tracking_id.id or 0) |
904 | # Remarks are not significant for type 'out' |
905 | - burst_type = self.read(cr, uid, ids, ['type'], context=context)[0]['type'] |
906 | rem_id = (burst_type != 'out') and line.remark_id.id or 0 |
907 | # Check if product_id is known |
908 | if product_key in known_lines.keys(): |
909 | @@ -103,8 +104,10 @@ |
910 | lines_list.append((line.quantity, line.id, rem_id)) |
911 | # final format : |
912 | known_lines[p] = (total, lines_list) |
913 | + |
914 | # Delete lines to delete |
915 | - burst_line_obj.unlink(cr, uid, lines_to_delete, context=context) |
916 | + if lines_to_delete: |
917 | + burst_line_obj.unlink(cr, uid, lines_to_delete, context=context) |
918 | |
919 | return known_lines |
920 | |
921 | @@ -117,7 +120,7 @@ |
922 | |
923 | # Retrieve merged burst lines |
924 | burst_line_obj = self.pool.get('stock.burst.line') |
925 | - burst_lines = self._merge(cr, uid, ids, context=context) |
926 | + burst_lines = self._merge(cr, uid, ids[0], context=context) |
927 | # No new line : quit |
928 | if not burst_lines: |
929 | return |
930 | @@ -128,9 +131,9 @@ |
931 | picking_id = self.read(cr, uid, ids, ['stock_picking_id'], context=context)[0]['stock_picking_id'][0] |
932 | backorder_ids = self.pool.get('stock.picking').search(cr, uid, [('backorder_id', '=', picking_id), ('state', 'not in', ('done', 'cancel', 'draft'))], context=context) |
933 | if backorder_ids: |
934 | - picking = self.pool.get('stock.picking').browse(cr, uid, [backorder_ids[0]], context=context)[0] |
935 | + picking = self.pool.get('stock.picking').browse(cr, uid, backorder_ids[0], context=context) |
936 | else: |
937 | - picking = self.pool.get('stock.picking').browse(cr, uid, [picking_id], context=context)[0] |
938 | + picking = self.pool.get('stock.picking').browse(cr, uid, picking_id, context=context) |
939 | picking_moves = picking_obj.move_merge(cr, uid, picking.id, context=context) |
940 | |
941 | # Compare burst lines and move lines |
942 | @@ -198,7 +201,9 @@ |
943 | missing.append((move_id, qty)) |
944 | |
945 | wf_service = netsvc.LocalService("workflow") |
946 | + del_empty_move = [] |
947 | if len(missing) > 0: |
948 | + no_keep = (picking.type == 'in' and not picking.warehouse_id.keep_missing_product_in) or False |
949 | # Generate new picking for missing products |
950 | new_picking = picking_obj.copy(cr, uid, picking_id, |
951 | { |
952 | @@ -211,6 +216,12 @@ |
953 | for (move_id, qty) in missing: |
954 | # Generate move lines in new_picking for missing products |
955 | move_obj.copy(cr, uid, move_id, {'product_qty': qty, 'picking_id': new_picking, 'remark_id': False}) |
956 | + if no_keep: |
957 | + del_empty_move.append(move_id) |
958 | + |
959 | + if del_empty_move: |
960 | + #move_obj.write(cr, uid, del_empty_move, {'state': 'draft'}) |
961 | + move_obj.unlink(cr, uid, del_empty_move) |
962 | |
963 | # Sets state to assigned for new picking |
964 | wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr) |
965 | @@ -218,13 +229,20 @@ |
966 | if burst_type != 'out': |
967 | picking_obj.force_assign(cr, uid, [new_picking]) |
968 | |
969 | + for val in done_move_lines: |
970 | + if val in del_empty_move: |
971 | + done_move_lines.remove(val) |
972 | + |
973 | # Set state to Done for picking |
974 | - move_obj.write(cr, uid, done_move_lines, {'state': 'done'}, context=context) |
975 | + if done_move_lines: |
976 | + move_obj.write(cr, uid, done_move_lines, {'state': 'done'}, context=context) |
977 | + |
978 | picking_obj.force_assign(cr, uid, [picking.id]) |
979 | wf_service.trg_validate(uid, 'stock.picking', picking.id, 'button_done', cr) |
980 | |
981 | # Set is_done=True for finished burst lines |
982 | burst_line_obj.write(cr, uid, done_burst_lines, {'is_done': True}, context=context) |
983 | + |
984 | # Add picking in M2M |
985 | self.write(cr, uid, ids, {'picking_ids': [(4, picking.id)]}, context=context) |
986 | |
987 | |
988 | === modified file 'wms/object/picking.py' |
989 | --- wms/object/picking.py 2011-02-24 13:07:22 +0000 |
990 | +++ wms/object/picking.py 2011-02-28 08:44:57 +0000 |
991 | @@ -26,6 +26,15 @@ |
992 | from osv import fields |
993 | from tools.translate import _ |
994 | |
995 | +_picking_state = [ |
996 | + ('draft', 'Draft'), |
997 | + ('auto', 'Waiting'), |
998 | + ('confirmed', 'Confirmed'), |
999 | + ('assigned', 'Assigned'), |
1000 | + ('done', 'Done'), |
1001 | + ('cancel', 'Cancelled'), |
1002 | +] |
1003 | + |
1004 | |
1005 | class StockPicking(osv.osv): |
1006 | """ |
1007 | @@ -52,7 +61,8 @@ |
1008 | 'transporter_number': fields.char('Tracking number', size=128), |
1009 | 'product_id': fields.related('move_lines', 'product_id', type='many2one', relation='product.product', string='Product'), |
1010 | 'round_id': fields.many2one('stock.round', 'Round', help='Use for manage deliveries'), |
1011 | - 'wave_id': fields.many2one('stock.location', 'Wave'), |
1012 | + 'wave_id': fields.many2one('stock.location', 'Wave', help='Picking wave affectation for this picking'), |
1013 | + 'state': fields.selection(_picking_state, 'Status', readonly=True), |
1014 | } |
1015 | |
1016 | _defaults = { |
1017 | @@ -61,6 +71,7 @@ |
1018 | 'transporter_id': lambda *a: False, |
1019 | 'transporter_number': lambda *a: False, |
1020 | 'round_id': lambda *a: False, |
1021 | + 'state': lambda *a: 'draft', |
1022 | } |
1023 | |
1024 | def default_get(self, cr, uid, fields_list, context=None): |
1025 | @@ -126,7 +137,7 @@ |
1026 | |
1027 | def product_crossdock_location(self, cr, uid, product_id, warehouse_id, context=None): |
1028 | """ |
1029 | - Search id |
1030 | + Search id |
1031 | """ |
1032 | if context is None: |
1033 | context = {} |
1034 | @@ -187,7 +198,7 @@ |
1035 | ['crossdock_location_id'], context=context)['crossdock_location_id'] |
1036 | if not default_crossdock: |
1037 | raise osv.except_osv(_('Error'), _('No default crossdock location defined on the warehouse!')) |
1038 | - crossdock_id = isinstance(default_crossdock, list) and default_crossdock[0] or default_crossdock |
1039 | + crossdock_id = isinstance(default_crossdock, tuple) and default_crossdock[0] or default_crossdock |
1040 | |
1041 | ### |
1042 | ## If we have an outgoing quantity, and location type is crossdock, we split in two line |
1043 | @@ -201,7 +212,7 @@ |
1044 | args = [ |
1045 | ('picking_id', 'in', picking_ids), |
1046 | ('product_id', '=', move.product_id.id), |
1047 | - ('state', 'in', ['confirmed', 'waiting']), |
1048 | + ('state', 'in', ['assigned', 'confirmed', 'waiting']), |
1049 | ] |
1050 | reserve_ids = move_obj.search(cr, uid, args, |
1051 | limit=abs(move.product_qty), order='date_planned', context=context) |
1052 | @@ -212,11 +223,12 @@ |
1053 | total_crossdock += r.product_qty |
1054 | |
1055 | # Check if we must split the line in two if there is enougth quantity available |
1056 | - if move.product_qty > total_crossdock: |
1057 | + if total_crossdock and move.product_qty > total_crossdock: |
1058 | args = { |
1059 | 'product_qty': (move.product_qty - total_crossdock), |
1060 | 'state': 'done', |
1061 | 'crossdock_ok': True, |
1062 | + 'move_dest_id': False, |
1063 | } |
1064 | new_id = move_obj.copy(cr, uid, move.id, args, context=context) |
1065 | args = { |
1066 | @@ -226,7 +238,7 @@ |
1067 | 'crossdock_ok': True, |
1068 | } |
1069 | move_obj.write(cr, uid, [move.id], args, context=context) |
1070 | - else: |
1071 | + elif total_crossdock: |
1072 | # We don't have enougth quantity, how many moves can be assigned with quantity |
1073 | args = { |
1074 | 'location_dest_id': crossdock_id, |
1075 | @@ -244,11 +256,12 @@ |
1076 | else: |
1077 | break |
1078 | |
1079 | - args = { |
1080 | - 'location_id': crossdock_id, |
1081 | - 'state': 'assigned', |
1082 | - } |
1083 | - move_obj.write(cr, uid, reserve_ids, args, context=context) |
1084 | + if total_crossdock: |
1085 | + args = { |
1086 | + 'location_id': crossdock_id, |
1087 | + 'state': 'assigned', |
1088 | + } |
1089 | + move_obj.write(cr, uid, reserve_ids, args, context=context) |
1090 | |
1091 | return new_id or move.id |
1092 | |
1093 | @@ -308,15 +321,15 @@ |
1094 | # For each picking out in confirm, check all lines and verify if it available |
1095 | # If yes, execute the workflow. |
1096 | args = [ |
1097 | - ('type','=','out'), |
1098 | - ('state','=','confirmed'), |
1099 | + ('type', '=', 'out'), |
1100 | + ('state', '=', 'confirmed'), |
1101 | ] |
1102 | p_ids = self.search(cr, uid, args) |
1103 | pick_list = [] |
1104 | for p in self.browse(cr, uid, p_ids): |
1105 | l_ok = True |
1106 | for l in p.move_lines: |
1107 | - if l.state not in ('assigned','cancel'): |
1108 | + if l.state not in ('assigned', 'cancel'): |
1109 | l_ok = False |
1110 | |
1111 | if l_ok: |
1112 | @@ -340,7 +353,8 @@ |
1113 | known_moves = {} |
1114 | moves_to_delete = [] |
1115 | for move in move_obj.browse(cr, uid, move_ids, context=context): |
1116 | - product_key = "%d_%d_%d" % (move.product_id.id, move.prodlot_id and move.prodlot_id.id or 0, move.tracking_id and move.tracking_id.id or 0) |
1117 | + product_key = "%d_%d_%d" % (move.product_id.id, move.prodlot_id and move.prodlot_id.id or 0, |
1118 | + move.tracking_id and move.tracking_id.id or 0) |
1119 | # Check if product_id is known |
1120 | if product_key in known_moves.keys(): |
1121 | # Add quantities |
1122 | @@ -355,7 +369,10 @@ |
1123 | known_moves[p] = (move.product_qty, move.id, ) |
1124 | |
1125 | # Delete moves to delete |
1126 | - move_obj.unlink(cr, uid, moves_to_delete, context=context) |
1127 | + if moves_to_delete: |
1128 | + ctx = context.copy() |
1129 | + ctx['call_unlink'] = True |
1130 | + move_obj.unlink(cr, uid, moves_to_delete, context=ctx) |
1131 | |
1132 | return known_moves |
1133 | |
1134 | |
1135 | === modified file 'wms/object/tracking.py' |
1136 | --- wms/object/tracking.py 2010-07-01 08:22:53 +0000 |
1137 | +++ wms/object/tracking.py 2011-02-28 08:44:57 +0000 |
1138 | @@ -29,7 +29,7 @@ |
1139 | _inherit = 'stock.tracking' |
1140 | |
1141 | _columns = { |
1142 | - 'product_id': fields.many2one('product.product', 'Product', required=True), |
1143 | + 'product_id': fields.many2one('product.product', 'Product'), |
1144 | } |
1145 | |
1146 | _defaults = { |
1147 | |
1148 | === modified file 'wms/object/warehouse.py' |
1149 | --- wms/object/warehouse.py 2011-01-31 18:09:20 +0000 |
1150 | +++ wms/object/warehouse.py 2011-02-28 08:44:57 +0000 |
1151 | @@ -36,9 +36,35 @@ |
1152 | 'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=False, domain=[('usage', '<>', 'view')]), |
1153 | 'lot_output_id': fields.many2one('stock.location', 'Location Output', required=False, domain=[('usage', '<>', 'view')]), |
1154 | 'code': fields.char('Code', size=16, help='Enter the warehouse code'), |
1155 | + 'parent_id': fields.many2one('stock.warehouse', 'Parent warehouse', help='Define the parent warehouse'), |
1156 | 'crossdock_location_id': fields.many2one('stock.location', 'Crossdock location', |
1157 | help='Choose the crossdock location on this warehouse'), |
1158 | - } |
1159 | + 'check_tracking_burst': fields.boolean('check tracking', help='Check tracking on burst out'), |
1160 | + 'keep_missing_product_in': fields.boolean('Keep product in', help='If check, missing product line on receipt order stay with quantity = 0'), |
1161 | + } |
1162 | + |
1163 | + _defaults = { |
1164 | + 'check_tracking_burst': lambda *a: False, |
1165 | + 'keep_missing_product_in': lambda *a: True, |
1166 | + } |
1167 | + |
1168 | + def _check_recursion(self, cr, uid, ids): |
1169 | + """ |
1170 | + Check if the selected parent warehouse create a recursive loop |
1171 | + """ |
1172 | + level = 100 |
1173 | + while len(ids): |
1174 | + cr.execute('select distinct parent_id from stock_warehouse where id in %s', (tuple(ids),)) |
1175 | + ids = filter(None, map(lambda x:x[0], cr.fetchall())) |
1176 | + if not level: |
1177 | + return False |
1178 | + level -= 1 |
1179 | + return True |
1180 | + |
1181 | + _constraints = [ |
1182 | + (_check_recursion, 'You cannot create recursive warehouse !', ['parent_id']), |
1183 | + ] |
1184 | + |
1185 | |
1186 | def search(self, cr, uid, args, offset=0, limit=None, order=None, |
1187 | context=None, count=False): |
1188 | @@ -51,7 +77,7 @@ |
1189 | ids = super(Warehouse, self).search(cr, uid, args, offset=offset, limit=limit, |
1190 | order=order, context=context, count=count) |
1191 | for w in self.browse(cr, uid, ids, context=context): |
1192 | - if not w.lot_stock_id or not w.lot_input_id or not w.lot_output_id: |
1193 | + if not context.get('new_warehouse', False) and (not w.lot_stock_id or not w.lot_input_id or not w.lot_output_id): |
1194 | raise osv.except_osv(_('Error'), _('Warehouse "%s" not correctly configure !') % w.name) |
1195 | |
1196 | return ids |
1197 | |
1198 | === modified file 'wms/view/burst.xml' |
1199 | --- wms/view/burst.xml 2011-02-22 16:02:33 +0000 |
1200 | +++ wms/view/burst.xml 2011-02-28 08:44:57 +0000 |
1201 | @@ -95,7 +95,7 @@ |
1202 | <field name="line_ids" string="Lines" colspan="4" nolabel="1" |
1203 | attrs="{'readonly': [('state','=', 'done')]}"/> |
1204 | </page> |
1205 | - <page string="Pickings"> |
1206 | + <page string="Pickings in"> |
1207 | <field name="picking_ids" nolabel="1" attrs="{'readonly': [('state','=', 'done')]}"/> |
1208 | </page> |
1209 | </notebook> |
1210 | @@ -126,7 +126,7 @@ |
1211 | <field name="line_ids" string="Lines" colspan="4" nolabel="1" |
1212 | attrs="{'readonly': [('state','=', 'done')]}"/> |
1213 | </page> |
1214 | - <page string="Pickings"> |
1215 | + <page string="Pickings out"> |
1216 | <field name="picking_ids" nolabel="1" attrs="{'readonly': [('state','=', 'done')]}"/> |
1217 | </page> |
1218 | </notebook> |
1219 | |
1220 | === modified file 'wms/view/location.xml' |
1221 | --- wms/view/location.xml 2010-06-22 05:47:58 +0000 |
1222 | +++ wms/view/location.xml 2011-02-28 08:44:57 +0000 |
1223 | @@ -39,5 +39,13 @@ |
1224 | </field> |
1225 | </record> |
1226 | |
1227 | + <!-- ************************************************************** --> |
1228 | + <!-- ** Add value to the context, to bypass the protection id ***** --> |
1229 | + <!-- ** the warehouse is not well configure *********************** --> |
1230 | + <!-- ************************************************************** --> |
1231 | + <record id="stock.action_location_form" model="ir.actions.act_window"> |
1232 | + <field name="context">{'new_warehouse': True}</field> |
1233 | + </record> |
1234 | + |
1235 | </data> |
1236 | </openerp> |
1237 | |
1238 | === modified file 'wms/view/warehouse.xml' |
1239 | --- wms/view/warehouse.xml 2011-01-20 22:50:19 +0000 |
1240 | +++ wms/view/warehouse.xml 2011-02-28 08:44:57 +0000 |
1241 | @@ -44,10 +44,21 @@ |
1242 | </xpath> |
1243 | <xpath expr="/form/field[@name='name']" position="after"> |
1244 | <field name="code"/> |
1245 | + <field name="parent_id"/> |
1246 | <field name="company_id"/> |
1247 | + <newline/> |
1248 | </xpath> |
1249 | <xpath expr="/form/field[@name='lot_output_id']" position="after"> |
1250 | - <field name="crossdock_location_id" domain="[('usage','=', 'crossdock')]"/> |
1251 | + <field name="crossdock_location_id" domain="[('warehouse_id','=', active_id),('usage','=', 'crossdock')]"/> |
1252 | + </xpath> |
1253 | + <xpath expr="/form/field[@name='partner_address_id']" position="after"> |
1254 | + <notebook colspan="4"> |
1255 | + <page string="Information"> |
1256 | + <separator string="burst" colspan="4"/> |
1257 | + <field name="check_tracking_burst"/> |
1258 | + <field name="keep_missing_product_in" invisible="1"/> |
1259 | + </page> |
1260 | + </notebook> |
1261 | </xpath> |
1262 | </data> |
1263 | |
1264 | @@ -62,12 +73,25 @@ |
1265 | <field name="inherit_id" ref="stock.view_warehouse_tree"/> |
1266 | <field name="arch" type="xml"> |
1267 | |
1268 | - <xpath expr="/tree/field[@name='name']" position="before"> |
1269 | - <field name="code"/> |
1270 | - </xpath> |
1271 | + <data> |
1272 | + <xpath expr="/tree/field[@name='name']" position="before"> |
1273 | + <field name="code"/> |
1274 | + </xpath> |
1275 | + <xpath expr="/tree/field[@name='name']" position="after"> |
1276 | + <field name="parent_id"/> |
1277 | + </xpath> |
1278 | + </data> |
1279 | |
1280 | </field> |
1281 | </record> |
1282 | |
1283 | + <!-- ************************************************************** --> |
1284 | + <!-- ** Add value to the context, to bypass the protection id ***** --> |
1285 | + <!-- ** the warehouse is not well configure *********************** --> |
1286 | + <!-- ************************************************************** --> |
1287 | + <record id="stock.action_warehouse_form" model="ir.actions.act_window"> |
1288 | + <field name="context">{'new_warehouse': True}</field> |
1289 | + </record> |
1290 | + |
1291 | </data> |
1292 | </openerp> |
1293 | |
1294 | === modified file 'wms/wizard/burst.py' |
1295 | --- wms/wizard/burst.py 2011-02-03 15:35:26 +0000 |
1296 | +++ wms/wizard/burst.py 2011-02-28 08:44:57 +0000 |
1297 | @@ -28,12 +28,12 @@ |
1298 | from tools.translate import _ |
1299 | |
1300 | init_form = """<?xml version="1.0" ?> |
1301 | -<form string="Burst"> |
1302 | +<form string="%s"> |
1303 | <field name="product_id" colspan="4"/> |
1304 | <field name="quantity"/> |
1305 | <field name="remark_id"/> |
1306 | </form> |
1307 | -""" |
1308 | +""" % (_('Burst')) |
1309 | |
1310 | init_fields = { |
1311 | 'product_id': {'string': 'Product', 'type': 'many2one', 'relation': 'product.product', 'required': True, }, |
1312 | @@ -98,7 +98,7 @@ |
1313 | 'type': 'form', |
1314 | 'arch': init_form, |
1315 | 'fields': init_fields, |
1316 | - 'state': [('end','Cancel','gtk-cancel'), ('valid', 'OK', 'gtk-ok', True)], |
1317 | + 'state': [('end','Finnish','gtk-cancel'), ('valid', 'OK', 'gtk-ok', True)], |
1318 | } |
1319 | }, |
1320 | 'valid': { |
1321 | |
1322 | === modified file 'wms/wizard/generate_wave.py' |
1323 | --- wms/wizard/generate_wave.py 2011-02-24 22:02:45 +0000 |
1324 | +++ wms/wizard/generate_wave.py 2011-02-28 08:44:57 +0000 |
1325 | @@ -31,11 +31,11 @@ |
1326 | _moves_arch = UpdateableStr() |
1327 | |
1328 | init_form = """<?xml version="1.0" ?> |
1329 | -<form string="Select cart"> |
1330 | - <separator string="Affect a cart for these picking" colspan="4"/> |
1331 | +<form string="%s"> |
1332 | + <separator string="%s" colspan="4"/> |
1333 | <field name="cart_id" colspan="4" domain="[('categ_id','=', %d)]"/> |
1334 | </form> |
1335 | -""" |
1336 | +""" |
1337 | |
1338 | init_fields = { |
1339 | 'cart_id': {'string': 'Cart', 'type': 'many2one', 'required': True, 'relation': 'stock.location'}, |
1340 | @@ -60,7 +60,7 @@ |
1341 | ir_id = ir_mod_obj._get_id(cr, uid, 'wms_location', 'location_category_chariot') |
1342 | id = ir_mod_obj.read(cr, uid, ir_id, ['res_id'])['res_id'] |
1343 | |
1344 | - _moves_arch.string = init_form % id |
1345 | + _moves_arch.string = init_form % (_('Select cart'), _('Affect a cart for these picking'), id) |
1346 | |
1347 | for i in pool.get('stock.picking').browse(cr, uid, data['ids'], context=context): |
1348 | if i.type != 'out': |
1349 | |
1350 | === modified file 'wms/wizard/wizard.xml' |
1351 | --- wms/wizard/wizard.xml 2011-02-24 13:07:22 +0000 |
1352 | +++ wms/wizard/wizard.xml 2011-02-28 08:44:57 +0000 |
1353 | @@ -31,11 +31,11 @@ |
1354 | name="wms.partial_picking" |
1355 | string="Partial packing"/> |
1356 | |
1357 | - <wizard |
1358 | - id="stock.burst" |
1359 | + <wizard id="stock_burst" |
1360 | + string="Fast entry" |
1361 | model="stock.burst" |
1362 | - name="wms.burst" |
1363 | - string="Burst"/> |
1364 | + multi="False" |
1365 | + name="wms.burst"/> |
1366 | |
1367 | <wizard id="wizard_generate_wave" |
1368 | string="Generate wave" |
1369 | |
1370 | === modified file 'wms_inventory/__terp__.py' |
1371 | --- wms_inventory/__terp__.py 2010-06-29 05:35:00 +0000 |
1372 | +++ wms_inventory/__terp__.py 2011-02-28 08:44:57 +0000 |
1373 | @@ -42,6 +42,7 @@ |
1374 | #'security/groups.xml', |
1375 | #'security/ir.model.access.csv', |
1376 | #'view/menu.xml', |
1377 | + 'view/warehouse.xml', |
1378 | 'view/inventory.xml', |
1379 | #'wizard/wizard.xml', |
1380 | #'report/report.xml', |
1381 | |
1382 | === modified file 'wms_inventory/i18n/fr_FR.po' |
1383 | --- wms_inventory/i18n/fr_FR.po 2010-06-29 09:41:10 +0000 |
1384 | +++ wms_inventory/i18n/fr_FR.po 2011-02-28 08:44:57 +0000 |
1385 | @@ -5,8 +5,8 @@ |
1386 | msgstr "" |
1387 | "Project-Id-Version: PACKAGE VERSION\n" |
1388 | "Report-Msgid-Bugs-To: support@openerp.com\n" |
1389 | -"POT-Creation-Date: 2010-06-29 09:40:16+0000\n" |
1390 | -"PO-Revision-Date: 2010-06-29 11:40+0100\n" |
1391 | +"POT-Creation-Date: 2011-02-27 18:39:06+0000\n" |
1392 | +"PO-Revision-Date: 2011-02-27 19:39+0100\n" |
1393 | "Last-Translator: Christophe Chauvet <christophe.chauvet@syleam.fr>\n" |
1394 | "Language-Team: LANGUAGE <LL@li.org>\n" |
1395 | "MIME-Version: 1.0\n" |
1396 | @@ -15,9 +15,67 @@ |
1397 | "X-Generator: Translate Toolkit 1.3.0\n" |
1398 | |
1399 | #. module: wms_inventory |
1400 | -#: constraint:ir.ui.view:0 |
1401 | -msgid "Invalid XML for View Architecture!" |
1402 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1403 | +#, python-format |
1404 | +msgid "nothing to regulate" |
1405 | +msgstr "Rien à régulariser" |
1406 | + |
1407 | +#. module: wms_inventory |
1408 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1409 | +#, python-format |
1410 | +msgid "global" |
1411 | +msgstr "globale" |
1412 | + |
1413 | +#. module: wms_inventory |
1414 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1415 | +#, python-format |
1416 | +msgid "quantity count %.2f" |
1417 | +msgstr "quantité comptée %.2f" |
1418 | + |
1419 | +#. module: wms_inventory |
1420 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1421 | +#, python-format |
1422 | +msgid "Default inventory location %s" |
1423 | +msgstr "Emplacement d'inventaire par défaut %s" |
1424 | + |
1425 | +#. module: wms_inventory |
1426 | +#: model:ir.module.module,description:wms_inventory.module_meta_information |
1427 | +msgid "" |
1428 | +"Module to extended inventory process\n" |
1429 | +"- enter production lot in inventory line\n" |
1430 | +"- enter serial number in inventory line\n" |
1431 | msgstr "" |
1432 | +"Module étendu de gestion du processus de l'inventaire\n" |
1433 | +"- gestion des lot de production dans les lignes d'inventaires\n" |
1434 | +"- gestion des numéros de série dans les lignes d'inventaires\n" |
1435 | + |
1436 | +#. module: wms_inventory |
1437 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1438 | +#, python-format |
1439 | +msgid "quantity to reset %.2f" |
1440 | +msgstr "quantité à reinitialisée %.2f" |
1441 | + |
1442 | +#. module: wms_inventory |
1443 | +#: field:stock.inventory,warehouse_id:0 |
1444 | +msgid "Warehouse" |
1445 | +msgstr "Entrepôt" |
1446 | + |
1447 | +#. module: wms_inventory |
1448 | +#: field:stock.inventory,type:0 |
1449 | +msgid "Type" |
1450 | +msgstr "TYpe" |
1451 | + |
1452 | +#. module: wms_inventory |
1453 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1454 | +#, python-format |
1455 | +msgid " -> Partial Inventory" |
1456 | +msgstr " -> Inventaire partiel" |
1457 | + |
1458 | +#. module: wms_inventory |
1459 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1460 | +#, python-format |
1461 | +msgid " [%s]" |
1462 | +msgstr " [%s]" |
1463 | |
1464 | #. module: wms_inventory |
1465 | #: help:stock.inventory,warehouse_id:0 |
1466 | @@ -25,11 +83,118 @@ |
1467 | msgstr "Sélectionner l'entrepôt ou sera fait cet inventaire" |
1468 | |
1469 | #. module: wms_inventory |
1470 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1471 | +#, python-format |
1472 | +msgid "init" |
1473 | +msgstr "init" |
1474 | + |
1475 | +#. module: wms_inventory |
1476 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1477 | +#, python-format |
1478 | +msgid "Cost price %.2f" |
1479 | +msgstr "P.U.M.P. %.2f" |
1480 | + |
1481 | +#. module: wms_inventory |
1482 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1483 | +#, python-format |
1484 | +msgid "Inventory number %s" |
1485 | +msgstr "Inventaire numéro %s" |
1486 | + |
1487 | +#. module: wms_inventory |
1488 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1489 | +#, python-format |
1490 | +msgid "analyze" |
1491 | +msgstr "analyse" |
1492 | + |
1493 | +#. module: wms_inventory |
1494 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1495 | +#, python-format |
1496 | +msgid "product %s" |
1497 | +msgstr "produit %s" |
1498 | + |
1499 | +#. module: wms_inventory |
1500 | +#: constraint:ir.ui.view:0 |
1501 | +msgid "Invalid XML for View Architecture!" |
1502 | +msgstr "XML non valide pour cette vue!" |
1503 | + |
1504 | +#. module: wms_inventory |
1505 | +#: field:stock.inventory.line,tracking_id:0 |
1506 | +msgid "Tracking" |
1507 | +msgstr "Suivi" |
1508 | + |
1509 | +#. module: wms_inventory |
1510 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1511 | +#, python-format |
1512 | +msgid "quantity to regulate %.2f" |
1513 | +msgstr "quantité à régularisé %.2f" |
1514 | + |
1515 | +#. module: wms_inventory |
1516 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1517 | +#, python-format |
1518 | +msgid " -> Global Inventory" |
1519 | +msgstr " -> Inventaire globale" |
1520 | + |
1521 | +#. module: wms_inventory |
1522 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1523 | +#, python-format |
1524 | +msgid "Start to analyse each line" |
1525 | +msgstr "Démarrer une analyse pour chaque ligne" |
1526 | + |
1527 | +#. module: wms_inventory |
1528 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1529 | +#, python-format |
1530 | +msgid "Validate each inventory line" |
1531 | +msgstr "Validation de chaque ligne d'inventaire" |
1532 | + |
1533 | +#. module: wms_inventory |
1534 | +#: help:stock.inventory,type:0 |
1535 | +msgid "If global, reset all quantity product not found in this inventory" |
1536 | +msgstr "Si globale, remise à zéro des quantités produits sur non trouvé dans l'inventaire" |
1537 | + |
1538 | +#. module: wms_inventory |
1539 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1540 | +#, python-format |
1541 | +msgid "" |
1542 | +"Inventory %s failed\n" |
1543 | +"see below\n" |
1544 | +msgstr "Échec de l'inventaire %s\n" |
1545 | + |
1546 | +#. module: wms_inventory |
1547 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1548 | +#, python-format |
1549 | +msgid "Inventory %s has been finished" |
1550 | +msgstr "L'inventaire %s est terminé." |
1551 | + |
1552 | +#. module: wms_inventory |
1553 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1554 | +#, python-format |
1555 | +msgid "Finish the current inventory" |
1556 | +msgstr "Fin de l'inventaire actuel" |
1557 | + |
1558 | +#. module: wms_inventory |
1559 | +#: field:stock.warehouse,lot_inventory_id:0 |
1560 | +#: help:stock.warehouse,lot_inventory_id:0 |
1561 | +msgid "Default inventory location" |
1562 | +msgstr "Emplacement de régul d'inventaire par défaut" |
1563 | + |
1564 | +#. module: wms_inventory |
1565 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1566 | +#, python-format |
1567 | +msgid "Compute inventory %s done" |
1568 | +msgstr "Calcul de l'inventaire %s terminé" |
1569 | + |
1570 | +#. module: wms_inventory |
1571 | #: selection:stock.inventory,type:0 |
1572 | msgid "Partial" |
1573 | msgstr "Partiel" |
1574 | |
1575 | #. module: wms_inventory |
1576 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1577 | +#, python-format |
1578 | +msgid "tracking %s" |
1579 | +msgstr "suivi %s" |
1580 | + |
1581 | +#. module: wms_inventory |
1582 | #: selection:stock.inventory,type:0 |
1583 | msgid "Global" |
1584 | msgstr "Globale" |
1585 | @@ -37,16 +202,8 @@ |
1586 | #. module: wms_inventory |
1587 | #: code:addons/wms_inventory/object/inventory.py:0 |
1588 | #, python-format |
1589 | -msgid "Compute inventory %s done" |
1590 | -msgstr "Calcul de l'inventaire %s terminé" |
1591 | - |
1592 | -#. module: wms_inventory |
1593 | -#: model:ir.module.module,description:wms_inventory.module_meta_information |
1594 | -msgid "" |
1595 | -"Module to extended inventory process\n" |
1596 | -"- enter production lot in inventory line\n" |
1597 | -"- enter serial number in inventory line\n" |
1598 | -msgstr "" |
1599 | +msgid "quantity in stock %.2f at location %s" |
1600 | +msgstr "Quantité en stock %.2f à cet emplacement %s" |
1601 | |
1602 | #. module: wms_inventory |
1603 | #: model:ir.module.module,shortdesc:wms_inventory.module_meta_information |
1604 | @@ -54,30 +211,22 @@ |
1605 | msgstr "WMS Inventory" |
1606 | |
1607 | #. module: wms_inventory |
1608 | -#: help:stock.inventory,type:0 |
1609 | -msgid "If global, reset all quantity product not found in this inventory" |
1610 | -msgstr "Si globale, remise à zéro des quantités produits sur non trouvé dans l'inventaire" |
1611 | - |
1612 | -#. module: wms_inventory |
1613 | -#: field:stock.inventory.line,tracking_id:0 |
1614 | -msgid "Tracking" |
1615 | -msgstr "Suivi" |
1616 | - |
1617 | -#. module: wms_inventory |
1618 | -#: field:stock.inventory,warehouse_id:0 |
1619 | -msgid "Warehouse" |
1620 | -msgstr "Entrepôt" |
1621 | - |
1622 | -#. module: wms_inventory |
1623 | -#: code:addons/wms_inventory/object/inventory.py:0 |
1624 | -#, python-format |
1625 | -msgid "Inventory %s has been finished" |
1626 | -msgstr "L'inventaire %s est terminé." |
1627 | - |
1628 | -#. module: wms_inventory |
1629 | -#: field:stock.inventory,type:0 |
1630 | -msgid "Type" |
1631 | -msgstr "TYpe" |
1632 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1633 | +#, python-format |
1634 | +msgid "error" |
1635 | +msgstr "erreur" |
1636 | + |
1637 | +#. module: wms_inventory |
1638 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1639 | +#, python-format |
1640 | +msgid "action" |
1641 | +msgstr "action" |
1642 | + |
1643 | +#. module: wms_inventory |
1644 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1645 | +#, python-format |
1646 | +msgid "production lot %s" |
1647 | +msgstr "lot de production %s" |
1648 | |
1649 | #. module: wms_inventory |
1650 | #: field:stock.inventory.line,prodlot_id:0 |
1651 | @@ -85,6 +234,18 @@ |
1652 | msgstr "Lot de production" |
1653 | |
1654 | #, python-format |
1655 | +#~ msgid "quantity in stock %.2f" |
1656 | +#~ msgstr "quantité en stock %.2f" |
1657 | + |
1658 | +#, python-format |
1659 | +#~ msgid " %s" |
1660 | +#~ msgstr " %s" |
1661 | + |
1662 | +#, python-format |
1663 | +#~ msgid "Cost price %s" |
1664 | +#~ msgstr "PUMP %s" |
1665 | + |
1666 | +#, python-format |
1667 | #~ msgid "\"\"Inventory %s has been finished\"\"" |
1668 | #~ msgstr "\"\"l'inventaire %s est terminé\"\"" |
1669 | |
1670 | |
1671 | === modified file 'wms_inventory/i18n/wms_inventory.pot' |
1672 | --- wms_inventory/i18n/wms_inventory.pot 2010-06-29 09:41:10 +0000 |
1673 | +++ wms_inventory/i18n/wms_inventory.pot 2011-02-28 08:44:57 +0000 |
1674 | @@ -4,10 +4,10 @@ |
1675 | # |
1676 | msgid "" |
1677 | msgstr "" |
1678 | -"Project-Id-Version: OpenERP Server 5.0.11\n" |
1679 | +"Project-Id-Version: OpenERP Server 5.0.12\n" |
1680 | "Report-Msgid-Bugs-To: support@openerp.com\n" |
1681 | -"POT-Creation-Date: 2010-06-29 09:40:16+0000\n" |
1682 | -"PO-Revision-Date: 2010-06-29 09:40:16+0000\n" |
1683 | +"POT-Creation-Date: 2011-02-27 18:39:06+0000\n" |
1684 | +"PO-Revision-Date: 2011-02-27 18:39:06+0000\n" |
1685 | "Last-Translator: <>\n" |
1686 | "Language-Team: \n" |
1687 | "MIME-Version: 1.0\n" |
1688 | @@ -16,29 +16,27 @@ |
1689 | "Plural-Forms: \n" |
1690 | |
1691 | #. module: wms_inventory |
1692 | -#: constraint:ir.ui.view:0 |
1693 | -msgid "Invalid XML for View Architecture!" |
1694 | -msgstr "" |
1695 | - |
1696 | -#. module: wms_inventory |
1697 | -#: help:stock.inventory,warehouse_id:0 |
1698 | -msgid "Select the warehouse where the inventory is made" |
1699 | -msgstr "" |
1700 | - |
1701 | -#. module: wms_inventory |
1702 | -#: selection:stock.inventory,type:0 |
1703 | -msgid "Partial" |
1704 | -msgstr "" |
1705 | - |
1706 | -#. module: wms_inventory |
1707 | -#: selection:stock.inventory,type:0 |
1708 | -msgid "Global" |
1709 | -msgstr "" |
1710 | - |
1711 | -#. module: wms_inventory |
1712 | -#: code:addons/wms_inventory/object/inventory.py:0 |
1713 | -#, python-format |
1714 | -msgid "Compute inventory %s done" |
1715 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1716 | +#, python-format |
1717 | +msgid "nothing to regulate" |
1718 | +msgstr "" |
1719 | + |
1720 | +#. module: wms_inventory |
1721 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1722 | +#, python-format |
1723 | +msgid "global" |
1724 | +msgstr "" |
1725 | + |
1726 | +#. module: wms_inventory |
1727 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1728 | +#, python-format |
1729 | +msgid "quantity count %.2f" |
1730 | +msgstr "" |
1731 | + |
1732 | +#. module: wms_inventory |
1733 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1734 | +#, python-format |
1735 | +msgid "Default inventory location %s" |
1736 | msgstr "" |
1737 | |
1738 | #. module: wms_inventory |
1739 | @@ -50,18 +48,9 @@ |
1740 | msgstr "" |
1741 | |
1742 | #. module: wms_inventory |
1743 | -#: model:ir.module.module,shortdesc:wms_inventory.module_meta_information |
1744 | -msgid "Wms Inventory" |
1745 | -msgstr "" |
1746 | - |
1747 | -#. module: wms_inventory |
1748 | -#: help:stock.inventory,type:0 |
1749 | -msgid "If global, reset all quantity product not found in this inventory" |
1750 | -msgstr "" |
1751 | - |
1752 | -#. module: wms_inventory |
1753 | -#: field:stock.inventory.line,tracking_id:0 |
1754 | -msgid "Tracking" |
1755 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1756 | +#, python-format |
1757 | +msgid "quantity to reset %.2f" |
1758 | msgstr "" |
1759 | |
1760 | #. module: wms_inventory |
1761 | @@ -70,17 +59,172 @@ |
1762 | msgstr "" |
1763 | |
1764 | #. module: wms_inventory |
1765 | -#: code:addons/wms_inventory/object/inventory.py:0 |
1766 | -#, python-format |
1767 | -msgid "Inventory %s has been finished" |
1768 | -msgstr "" |
1769 | - |
1770 | -#. module: wms_inventory |
1771 | #: field:stock.inventory,type:0 |
1772 | msgid "Type" |
1773 | msgstr "" |
1774 | |
1775 | #. module: wms_inventory |
1776 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1777 | +#, python-format |
1778 | +msgid " -> Partial Inventory" |
1779 | +msgstr "" |
1780 | + |
1781 | +#. module: wms_inventory |
1782 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1783 | +#, python-format |
1784 | +msgid " [%s]" |
1785 | +msgstr "" |
1786 | + |
1787 | +#. module: wms_inventory |
1788 | +#: help:stock.inventory,warehouse_id:0 |
1789 | +msgid "Select the warehouse where the inventory is made" |
1790 | +msgstr "" |
1791 | + |
1792 | +#. module: wms_inventory |
1793 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1794 | +#, python-format |
1795 | +msgid "init" |
1796 | +msgstr "" |
1797 | + |
1798 | +#. module: wms_inventory |
1799 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1800 | +#, python-format |
1801 | +msgid "Cost price %.2f" |
1802 | +msgstr "" |
1803 | + |
1804 | +#. module: wms_inventory |
1805 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1806 | +#, python-format |
1807 | +msgid "Inventory number %s" |
1808 | +msgstr "" |
1809 | + |
1810 | +#. module: wms_inventory |
1811 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1812 | +#, python-format |
1813 | +msgid "analyze" |
1814 | +msgstr "" |
1815 | + |
1816 | +#. module: wms_inventory |
1817 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1818 | +#, python-format |
1819 | +msgid "product %s" |
1820 | +msgstr "" |
1821 | + |
1822 | +#. module: wms_inventory |
1823 | +#: constraint:ir.ui.view:0 |
1824 | +msgid "Invalid XML for View Architecture!" |
1825 | +msgstr "" |
1826 | + |
1827 | +#. module: wms_inventory |
1828 | +#: field:stock.inventory.line,tracking_id:0 |
1829 | +msgid "Tracking" |
1830 | +msgstr "" |
1831 | + |
1832 | +#. module: wms_inventory |
1833 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1834 | +#, python-format |
1835 | +msgid "quantity to regulate %.2f" |
1836 | +msgstr "" |
1837 | + |
1838 | +#. module: wms_inventory |
1839 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1840 | +#, python-format |
1841 | +msgid " -> Global Inventory" |
1842 | +msgstr "" |
1843 | + |
1844 | +#. module: wms_inventory |
1845 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1846 | +#, python-format |
1847 | +msgid "Start to analyse each line" |
1848 | +msgstr "" |
1849 | + |
1850 | +#. module: wms_inventory |
1851 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1852 | +#, python-format |
1853 | +msgid "Validate each inventory line" |
1854 | +msgstr "" |
1855 | + |
1856 | +#. module: wms_inventory |
1857 | +#: help:stock.inventory,type:0 |
1858 | +msgid "If global, reset all quantity product not found in this inventory" |
1859 | +msgstr "" |
1860 | + |
1861 | +#. module: wms_inventory |
1862 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1863 | +#, python-format |
1864 | +msgid "Inventory %s failed\nsee below\n" |
1865 | +msgstr "" |
1866 | + |
1867 | +#. module: wms_inventory |
1868 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1869 | +#, python-format |
1870 | +msgid "Inventory %s has been finished" |
1871 | +msgstr "" |
1872 | + |
1873 | +#. module: wms_inventory |
1874 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1875 | +#, python-format |
1876 | +msgid "Finish the current inventory" |
1877 | +msgstr "" |
1878 | + |
1879 | +#. module: wms_inventory |
1880 | +#: field:stock.warehouse,lot_inventory_id:0 |
1881 | +#: help:stock.warehouse,lot_inventory_id:0 |
1882 | +msgid "Default inventory location" |
1883 | +msgstr "" |
1884 | + |
1885 | +#. module: wms_inventory |
1886 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1887 | +#, python-format |
1888 | +msgid "Compute inventory %s done" |
1889 | +msgstr "" |
1890 | + |
1891 | +#. module: wms_inventory |
1892 | +#: selection:stock.inventory,type:0 |
1893 | +msgid "Partial" |
1894 | +msgstr "" |
1895 | + |
1896 | +#. module: wms_inventory |
1897 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1898 | +#, python-format |
1899 | +msgid "tracking %s" |
1900 | +msgstr "" |
1901 | + |
1902 | +#. module: wms_inventory |
1903 | +#: selection:stock.inventory,type:0 |
1904 | +msgid "Global" |
1905 | +msgstr "" |
1906 | + |
1907 | +#. module: wms_inventory |
1908 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1909 | +#, python-format |
1910 | +msgid "quantity in stock %.2f at location %s" |
1911 | +msgstr "" |
1912 | + |
1913 | +#. module: wms_inventory |
1914 | +#: model:ir.module.module,shortdesc:wms_inventory.module_meta_information |
1915 | +msgid "Wms Inventory" |
1916 | +msgstr "" |
1917 | + |
1918 | +#. module: wms_inventory |
1919 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1920 | +#, python-format |
1921 | +msgid "error" |
1922 | +msgstr "" |
1923 | + |
1924 | +#. module: wms_inventory |
1925 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1926 | +#, python-format |
1927 | +msgid "action" |
1928 | +msgstr "" |
1929 | + |
1930 | +#. module: wms_inventory |
1931 | +#: code:addons/wms_inventory/object/inventory.py:0 |
1932 | +#, python-format |
1933 | +msgid "production lot %s" |
1934 | +msgstr "" |
1935 | + |
1936 | +#. module: wms_inventory |
1937 | #: field:stock.inventory.line,prodlot_id:0 |
1938 | msgid "Production Lot" |
1939 | msgstr "" |
1940 | |
1941 | === modified file 'wms_inventory/object/__init__.py' |
1942 | --- wms_inventory/object/__init__.py 2010-06-29 05:35:00 +0000 |
1943 | +++ wms_inventory/object/__init__.py 2011-02-28 08:44:57 +0000 |
1944 | @@ -22,6 +22,7 @@ |
1945 | # |
1946 | ############################################################################## |
1947 | |
1948 | +import warehouse |
1949 | import inventory |
1950 | |
1951 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1952 | |
1953 | === modified file 'wms_inventory/object/inventory.py' |
1954 | --- wms_inventory/object/inventory.py 2010-07-06 06:33:28 +0000 |
1955 | +++ wms_inventory/object/inventory.py 2011-02-28 08:44:57 +0000 |
1956 | @@ -30,13 +30,15 @@ |
1957 | import thread |
1958 | import pooler |
1959 | import time |
1960 | +import tempfile |
1961 | +import base64 |
1962 | |
1963 | |
1964 | class Inventory(osv.osv): |
1965 | _inherit = 'stock.inventory' |
1966 | |
1967 | _columns = { |
1968 | - 'type': fields.selection([('global','Global'),('partial','Partial')], 'Type', |
1969 | + 'type': fields.selection([('global', 'Global'), ('partial', 'Partial')], 'Type', |
1970 | help='If global, reset all quantity product not found in this inventory'), |
1971 | 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, |
1972 | help='Select the warehouse where the inventory is made'), |
1973 | @@ -47,7 +49,6 @@ |
1974 | 'warehouse_id': lambda obj, cr, uid, context: obj.pool.get('res.users')._default_warehouse(cr, uid, context), |
1975 | } |
1976 | |
1977 | - |
1978 | def action_done(self, cr, uid, ids, context=None): |
1979 | """ |
1980 | Validate the inventory, it take a lot of time and must be launch in multi thread |
1981 | @@ -57,66 +58,156 @@ |
1982 | Treatment launch as a new thread |
1983 | Must be include production lot and tracking |
1984 | """ |
1985 | + def log_message(fic, section, message): |
1986 | + """ |
1987 | + Format the content of the logfile |
1988 | + """ |
1989 | + fic.write('[%s] %s: %s\n' % (time.strftime('%Y-%m-%d %H:%M:%S'), section.encode('utf-8'), message.encode('utf-8'))) |
1990 | + |
1991 | logger = netsvc.Logger() |
1992 | - logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] Start compute the inventory *********' % cr.dbname) |
1993 | + logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] Start compute the inventory *********' % cr.dbname) |
1994 | cr = pooler.get_db(cr.dbname).cursor() |
1995 | for inv in self.browse(cr, uid, ids): |
1996 | - logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] Inventory %s' % (cr.dbname, inv.name)) |
1997 | - move_ids = [] |
1998 | - move_line = [] |
1999 | - inv_ok = True |
2000 | + logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] Inventory %s' % (cr.dbname, inv.name)) |
2001 | + # For each inventory, we save all step in the log file |
2002 | + outfp = tempfile.NamedTemporaryFile(prefix='openerp', suffix='inventory') |
2003 | + log_message(outfp, _('init'), _('Inventory number %s') % inv.name) |
2004 | + if inv.type == 'partial': |
2005 | + log_message(outfp, _('init'), _(' -> Partial Inventory')) |
2006 | + else: |
2007 | + log_message(outfp, _('init'), _(' -> Global Inventory')) |
2008 | inv_message = '' |
2009 | - for line in inv.inventory_line_id: |
2010 | - pid = line.product_id.id |
2011 | - price = line.product_id.standard_price or 0.0 |
2012 | - prodlot = line.prodlot_id and line.prodlot_id.id or False |
2013 | - tracking = line.tracking_id and line.tracking_id.id or False |
2014 | - amount = self.pool.get('stock.location')._stock_get(cr, uid, line.location_id.id, [pid], |
2015 | - {'uom': line.product_uom.id, 'prodlot': prodlot, 'tracking': tracking}) |
2016 | - change = line.product_qty - amount |
2017 | - if change: |
2018 | - location_id = line.product_id.product_tmpl_id.property_stock_inventory.id |
2019 | - value = { |
2020 | - 'name': 'INV:' + str(line.inventory_id.id) + ':' + line.inventory_id.name, |
2021 | - 'product_id': line.product_id.id, |
2022 | - 'product_uom': line.product_uom.id, |
2023 | - 'date': inv.date, |
2024 | - 'date_planned': inv.date, |
2025 | - 'state': 'assigned', |
2026 | - 'prodlot_id': prodlot, |
2027 | - 'tracking_id': tracking, |
2028 | - } |
2029 | - if change > 0: |
2030 | - value.update( { |
2031 | - 'product_qty': change, |
2032 | - 'location_id': location_id, |
2033 | - 'location_dest_id': line.location_id.id, |
2034 | - }) |
2035 | + # If default inventory location is missing in the warehouse, we add information in the logfile and exit properly |
2036 | + if inv.warehouse_id.lot_inventory_id: |
2037 | + log_message(outfp, _('init'), _('Default inventory location %s') % inv.warehouse_id.lot_inventory_id.name) |
2038 | + move_ids = [] |
2039 | + move_line = [] |
2040 | + inv_ok = True |
2041 | + tmp_prod = [] |
2042 | + log_message(outfp, 'init', _('Start to analyse each line')) |
2043 | + for line in inv.inventory_line_id: |
2044 | + log_message(outfp, _('analyze'), '**********************') |
2045 | + pid = line.product_id.id |
2046 | + log_message(outfp, _('analyze'), _('product %s') % line.product_id.name) |
2047 | + log_message(outfp, _('analyze'), _(' [%s]') % line.product_id.default_code) |
2048 | + price = line.product_id.standard_price or 0.0 |
2049 | + log_message(outfp, _('analyze'), _('Cost price %.2f') % line.product_id.standard_price) |
2050 | + prodlot = line.prodlot_id and line.prodlot_id.id or False |
2051 | + if prodlot: |
2052 | + log_message(outfp, _('analyze'), _('production lot %s') % line.prodlot_id.name) |
2053 | + tracking = line.tracking_id and line.tracking_id.id or False |
2054 | + if tracking: |
2055 | + log_message(outfp, _('analyze'), _('tracking %s') % line.tracking_id.name) |
2056 | + |
2057 | + amount = self.pool.get('stock.location')._stock_get(cr, uid, line.location_id.id, [pid], |
2058 | + {'uom': line.product_uom.id, 'prodlot': prodlot, 'tracking': tracking}) |
2059 | + log_message(outfp, _('analyze'), _('quantity in stock %.2f at location %s') % (amount, line.location_id.name)) |
2060 | + log_message(outfp, _('analyze'), _('quantity count %.2f') % line.product_qty) |
2061 | + |
2062 | + # for global inventory, we keep if we found this product |
2063 | + tmp_prod.append('%d_%d_%d_%d' % (line.product_id.id, line.location_id.id, prodlot or 0, tracking or 0)) |
2064 | + change = line.product_qty - amount |
2065 | + if not change: |
2066 | + log_message(outfp, _('action'), _('nothing to regulate')) |
2067 | else: |
2068 | - value.update( { |
2069 | - 'product_qty': -change, |
2070 | - 'location_id': line.location_id.id, |
2071 | + log_message(outfp, _('action'), _('quantity to regulate %.2f') % change) |
2072 | + location_id = line.product_id.product_tmpl_id.property_stock_inventory.id or inv.warehouse_id.lot_inventory_id.id |
2073 | + value = { |
2074 | + 'name': 'INV:' + str(line.inventory_id.id) + ':' + line.inventory_id.name, |
2075 | + 'product_id': line.product_id.id, |
2076 | + 'product_uom': line.product_uom.id, |
2077 | + 'date': inv.date, |
2078 | + 'date_planned': inv.date, |
2079 | + 'state': 'assigned', |
2080 | + 'prodlot_id': prodlot, |
2081 | + 'tracking_id': tracking, |
2082 | + } |
2083 | + if change > 0: |
2084 | + value.update({ |
2085 | + 'product_qty': change, |
2086 | + 'location_id': location_id, |
2087 | + 'location_dest_id': line.location_id.id, |
2088 | + }) |
2089 | + else: |
2090 | + value.update({ |
2091 | + 'product_qty': -change, |
2092 | + 'location_id': line.location_id.id, |
2093 | + 'location_dest_id': location_id, |
2094 | + }) |
2095 | + try: |
2096 | + move_ids.append(self.pool.get('stock.move').create(cr, uid, value)) |
2097 | + except except_orm, e: |
2098 | + logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] %s %s' % (cr.dbname, e.name, e.value)) |
2099 | + log_message(outfp, _('error'), '[%s] %s %s' % (cr.dbname, e.name, e.value)) |
2100 | + inv_message += ' %s: %s\n' % (e.name, e.value) |
2101 | + inv_ok = False |
2102 | + |
2103 | + ## |
2104 | + ## Global inventory must reset the missing product, on this warehouse |
2105 | + log_message(outfp, _('global'), '===========================================') |
2106 | + if inv.type == 'global': |
2107 | + avail_obj = self.pool.get('wms.report.stock.available') |
2108 | + args = [ |
2109 | + ('warehouse_id', '=', inv.warehouse_id.id), |
2110 | + ] |
2111 | + avail_ids = avail_obj.search(cr, uid, args, context=context) |
2112 | + for a in avail_obj.browse(cr, uid, avail_ids, context=context): |
2113 | + log_message(outfp, _('analyze'), '**********************') |
2114 | + # Check if this product was already found at this location |
2115 | + tmp_key = '%d_%d_%d_%d' % (a.product_id.id, a.location_id.id, |
2116 | + a.prodlot_id and a.prodlot_id.id or 0, a.tracking_id and a.tracking_id.id or 0) |
2117 | + |
2118 | + if tmp_key in tmp_prod: |
2119 | + continue |
2120 | + |
2121 | + log_message(outfp, _('analyze'), _('product %s') % a.product_id.name) |
2122 | + log_message(outfp, _('analyze'), _(' [%s]') % a.product_id.default_code) |
2123 | + if a.prodlot_id: |
2124 | + log_message(outfp, _('analyze'), _('production lot %s') % a.prodlot_id.name) |
2125 | + if a.tracking_id: |
2126 | + log_message(outfp, _('analyze'), _('tracking %s') % a.tracking_id.name) |
2127 | + log_message(outfp, _('action'), _('quantity to reset %.2f') % a.qty) |
2128 | + |
2129 | + location_id = line.product_id.product_tmpl_id.property_stock_inventory.id or inv.warehouse_id.lot_inventory_id.id |
2130 | + value = { |
2131 | + 'name': 'INV: reset qty: ' + line.inventory_id.name, |
2132 | + 'product_id': a.product_id.id, |
2133 | + 'product_uom': a.uom_id.id, |
2134 | + 'date': inv.date, |
2135 | + 'date_planned': inv.date, |
2136 | + 'state': 'assigned', |
2137 | + 'prodlot_id': a.prodlot_id and a.prodlot_id.id or False, |
2138 | + 'tracking_id': a.tracking_id and a.tracking_id.id or False, |
2139 | + 'product_qty': a.qty, |
2140 | + 'location_id': a.location_id.id, |
2141 | 'location_dest_id': location_id, |
2142 | - }) |
2143 | + } |
2144 | + try: |
2145 | + move_ids.append(self.pool.get('stock.move').create(cr, uid, value)) |
2146 | + except except_orm, e: |
2147 | + logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] %s %s' % (cr.dbname, e.name, e.value)) |
2148 | + log_message(outfp, _('error'), '[%s] %s %s' % (cr.dbname, e.name, e.value)) |
2149 | + inv_message += ' %s: %s\n' % (e.name, e.value) |
2150 | + inv_ok = False |
2151 | + |
2152 | + logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] Compute each line' % cr.dbname) |
2153 | + log_message(outfp, _('action'), _('Validate each inventory line')) |
2154 | + if len(move_ids) and inv_ok: |
2155 | try: |
2156 | - move_ids.append(self.pool.get('stock.move').create(cr, uid, value)) |
2157 | + self.pool.get('stock.move').action_done(cr, uid, move_ids, |
2158 | + context=context) |
2159 | except except_orm, e: |
2160 | - logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] %s %s' % (cr.dbname, e.name, e.value)) |
2161 | + logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] %s %s' % (cr.dbname, e.name, e.value)) |
2162 | inv_message += ' %s: %s\n' % (e.name, e.value) |
2163 | inv_ok = False |
2164 | - logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] Compute each line' % cr.dbname) |
2165 | - if len(move_ids) and inv_ok: |
2166 | - try: |
2167 | - self.pool.get('stock.move').action_done(cr, uid, move_ids, |
2168 | - context=context) |
2169 | - except except_orm, e: |
2170 | - logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] %s %s' % (cr.dbname, e.name, e.value)) |
2171 | - inv_message += ' %s: %s\n' % (e.name, e.value) |
2172 | - inv_ok = False |
2173 | |
2174 | - if inv_ok: |
2175 | - self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), |
2176 | - 'move_ids': [(6, 0, move_ids)]}) |
2177 | + log_message(outfp, _('action'), _('Finish the current inventory')) |
2178 | + if inv_ok: |
2179 | + self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), |
2180 | + 'move_ids': [(6, 0, move_ids)]}) |
2181 | + else: |
2182 | + log_message(outfp, 'error', 'defaut inventory location is missing on the warehouse %s' % inv.warehouse_id.name) |
2183 | + inv_ok = False |
2184 | |
2185 | ### |
2186 | ## Send a request to the user whom launch the validation |
2187 | @@ -131,12 +222,25 @@ |
2188 | 'name': _('Compute inventory %s done') % inv.name, |
2189 | 'act_from': uid, |
2190 | 'act_to': uid, |
2191 | - 'body' : body, |
2192 | + 'body': body, |
2193 | }, context=context) |
2194 | |
2195 | + # Store the logfile as attachment |
2196 | + outfp.flush() |
2197 | + outfp.seek(0) |
2198 | + vals = { |
2199 | + 'datas': base64.encodestring(outfp.read()), |
2200 | + 'datas_fname': 'inv_%s' % inv.name, |
2201 | + 'name': 'INV %s' % inv.name, |
2202 | + 'res_model': 'stock.inventory', |
2203 | + 'res_id': inv.id, |
2204 | + } |
2205 | + self.pool.get('ir.attachment').create(cr, uid, vals, context=context) |
2206 | + outfp.close() |
2207 | + |
2208 | cr.commit() |
2209 | cr.close() |
2210 | - logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] End compute the inventory ***********' % cr.dbname) |
2211 | + logger.notifyChannel('wms_inventory', netsvc.LOG_INFO, '[%s] End compute the inventory ***********' % cr.dbname) |
2212 | return True |
2213 | |
2214 | thread.start_new_thread(threading_done, (cr, uid, ids, context)) |
2215 | @@ -144,6 +248,7 @@ |
2216 | |
2217 | Inventory() |
2218 | |
2219 | + |
2220 | class InventoryLine(osv.osv): |
2221 | _inherit = 'stock.inventory.line' |
2222 | |
2223 | |
2224 | === added file 'wms_inventory/object/warehouse.py' |
2225 | --- wms_inventory/object/warehouse.py 1970-01-01 00:00:00 +0000 |
2226 | +++ wms_inventory/object/warehouse.py 2011-02-28 08:44:57 +0000 |
2227 | @@ -0,0 +1,37 @@ |
2228 | +# -*- coding: utf-8 -*- |
2229 | +############################################################################## |
2230 | +# |
2231 | +# wms_inventory module for OpenERP, Module to extended inventory process |
2232 | +# Copyright (C) 2011 SYLEAM (<http://www.syleam.fr/>) |
2233 | +# Christophe CHAUVET <christophe.chauvet@syleam.fr> |
2234 | +# |
2235 | +# This file is a part of wms_inventory |
2236 | +# |
2237 | +# wms_inventory is free software: you can redistribute it and/or modify |
2238 | +# it under the terms of the GNU General Public License as published by |
2239 | +# the Free Software Foundation, either version 3 of the License, or |
2240 | +# (at your option) any later version. |
2241 | +# |
2242 | +# wms_inventory is distributed in the hope that it will be useful, |
2243 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2244 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2245 | +# GNU General Public License for more details. |
2246 | +# |
2247 | +# You should have received a copy of the GNU General Public License |
2248 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2249 | +# |
2250 | +############################################################################## |
2251 | + |
2252 | +from osv import osv |
2253 | +from osv import fields |
2254 | + |
2255 | +class StockWarehouse(osv.osv): |
2256 | + _inherit = 'stock.warehouse' |
2257 | + |
2258 | + _columns = { |
2259 | + 'lot_inventory_id': fields.many2one('stock.location', 'Default inventory location', help='Default inventory location'), |
2260 | + } |
2261 | + |
2262 | +StockWarehouse() |
2263 | + |
2264 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2265 | |
2266 | === added file 'wms_inventory/view/warehouse.xml' |
2267 | --- wms_inventory/view/warehouse.xml 1970-01-01 00:00:00 +0000 |
2268 | +++ wms_inventory/view/warehouse.xml 2011-02-28 08:44:57 +0000 |
2269 | @@ -0,0 +1,41 @@ |
2270 | +<?xml version="1.0" encoding="UTF-8"?> |
2271 | +<openerp> |
2272 | + <data> |
2273 | + ############################################################################## |
2274 | + # |
2275 | + # wms_inventory module for OpenERP, Module to extended inventory process |
2276 | + # Copyright (C) 2011 SYLEAM ([http://www.syleam.fr/]) |
2277 | + # Christophe CHAUVET [christophe.chauvet@syleam.fr] |
2278 | + # |
2279 | + # This file is a part of wms_inventory |
2280 | + # |
2281 | + # wms_inventory is free software: you can redistribute it and/or modify |
2282 | + # it under the terms of the GNU General Public License as published by |
2283 | + # the Free Software Foundation, either version 3 of the License, or |
2284 | + # (at your option) any later version. |
2285 | + # |
2286 | + # wms_inventory is distributed in the hope that it will be useful, |
2287 | + # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2288 | + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2289 | + # GNU General Public License for more details. |
2290 | + # |
2291 | + # You should have received a copy of the GNU General Public License |
2292 | + # along with this program. If not, see [http://www.gnu.org/licenses/]. |
2293 | + # |
2294 | + ############################################################################## |
2295 | + |
2296 | + <record id="view_stock_warehouse_inventory_form" model="ir.ui.view"> |
2297 | + <field name="name">stock.warehouse - inventory</field> |
2298 | + <field name="model">stock.warehouse</field> |
2299 | + <field name="type">form</field> |
2300 | + <field name="priority" eval="18"/> |
2301 | + <field name="inherit_id" ref="stock.view_warehouse"/> |
2302 | + <field name="arch" type="xml"> |
2303 | + <xpath expr="/form/field[@name='crossdock_location_id']" position="after"> |
2304 | + <field name="lot_inventory_id" domain="[('warehouse_id','=', active_id),('usage','=', 'inventory')]"/> |
2305 | + </xpath> |
2306 | + </field> |
2307 | + </record> |
2308 | + |
2309 | + </data> |
2310 | +</openerp> |
2311 | |
2312 | === modified file 'wms_location/object/location.py' |
2313 | --- wms_location/object/location.py 2011-01-24 21:52:52 +0000 |
2314 | +++ wms_location/object/location.py 2011-02-28 08:44:57 +0000 |
2315 | @@ -110,6 +110,7 @@ |
2316 | ('product_uom', '=', context.get('uom')), |
2317 | ('prodlot_id', '=', context.get('prodlot', False)), |
2318 | ('tracking_id', '=', context.get('tracking', False)), |
2319 | + ('state', '=', 'done'), |
2320 | ] |
2321 | move_ids = move_obj.search(cr, uid, args, context=context) |
2322 | move = move_obj.read(cr, uid, move_ids, ['product_qty'], context=context) |
The regression test pass successfull