Merge lp:~camptocamp/stock-logistic-flows/7.0-picking_dispatch_wave-according-defined-number-of-sales_rde into lp:stock-logistic-flows
Status: | Merged |
---|---|
Merged at revision: | 62 |
Proposed branch: | lp:~camptocamp/stock-logistic-flows/7.0-picking_dispatch_wave-according-defined-number-of-sales_rde |
Merge into: | lp:stock-logistic-flows |
Diff against target: |
469 lines (+432/-0) 7 files modified
picking_dispatch_wave/__init__.py (+22/-0) picking_dispatch_wave/__openerp__.py (+46/-0) picking_dispatch_wave/dispatch_wave.py (+119/-0) picking_dispatch_wave/dispatch_wave_view.xml (+46/-0) picking_dispatch_wave/i18n/fr.po (+82/-0) picking_dispatch_wave/i18n/picking_dispatch_wave.pot (+70/-0) picking_dispatch_wave/test/test_dispatch_wave.yml (+47/-0) |
To merge this branch: | bzr merge lp:~camptocamp/stock-logistic-flows/7.0-picking_dispatch_wave-according-defined-number-of-sales_rde |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nicolas Bessi - Camptocamp (community) | Approve | ||
Yannick Vaucher @ Camptocamp | tests | Approve | |
Alexandre Fayolle - camptocamp | code review, test | Approve | |
Review via email: mp+214568@code.launchpad.net |
Commit message
Description of the change
Hello,
This MP adds an addon named picking_
- Allows to set a 'sale order wave' to pick according a number n of sales that you set.
1.The picker sets a number n of sale orders.
2.The wizard will select moves from n oldest sales that are linked to ready pickings.
3.A picking dispatch is created with found moves
Regards,
Romain
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
Romain Deheele - Camptocamp (romaindeheele) wrote : | # |
Hi,
Tests are added.
SQL is removed and replaced by ORM searchs.
Description has been updated.
Romain
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
LGTM
- 65. By Yannick Vaucher @ Camptocamp
-
[PEP8]
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
Shouldn't *_to_done private method be *_to_do or _to_be_done ?
Here are few remarks about translations:
* After installatation on fresh install with last code Wizard fields and label aren't translated. (But this may not be related to this MP)
* In translation, in french there should be a space before punctuation.
* "selon le nombre de commandes de vente voulu." I would replace 'voulu' by 'défini'.
* l.291 +msgstr "Prépare un bon de préparation" -> Préparer
* picker_id help message is not translated nor picking_id field name
- 66. By Romain Deheele - Camptocamp
-
[UPD] terms review and translation changes
Romain Deheele - Camptocamp (romaindeheele) wrote : | # |
Thanks Yannick,
I've reworked terms and translation.
Romain
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
Ok translations works now
Thanks for the changes.
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
(my tests)
- Installed the module
- tried to create a picking dispatch
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
Need fixing.
Set has a better performance than list and it should avoid duplicate.
Please see inline comment
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote : | # |
- 67. By Romain Deheele - Camptocamp
-
use set() instead of [], rename nb variable, moves selected only if picking state is assigned
Romain Deheele - Camptocamp (romaindeheele) wrote : | # |
Thanks Nicolas,
I made changes accordingly.
I add a condition : only assigned pickings are selected.
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) : | # |
Preview Diff
1 | === added directory 'picking_dispatch_wave' | |||
2 | === added file 'picking_dispatch_wave/__init__.py' | |||
3 | --- picking_dispatch_wave/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ picking_dispatch_wave/__init__.py 2014-06-13 15:52:45 +0000 | |||
5 | @@ -0,0 +1,22 @@ | |||
6 | 1 | # -*- coding: utf-8 -*- | ||
7 | 2 | ############################################################################## | ||
8 | 3 | # | ||
9 | 4 | # Author: Alexandre Fayolle, Romain Deheele | ||
10 | 5 | # Copyright 2014 Camptocamp SA | ||
11 | 6 | # | ||
12 | 7 | # This program is free software: you can redistribute it and/or modify | ||
13 | 8 | # it under the terms of the GNU Affero General Public License as | ||
14 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
15 | 10 | # License, or (at your option) any later version. | ||
16 | 11 | # | ||
17 | 12 | # This program is distributed in the hope that it will be useful, | ||
18 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | 15 | # GNU Affero General Public License for more details. | ||
21 | 16 | # | ||
22 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
23 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
24 | 19 | # | ||
25 | 20 | ############################################################################## | ||
26 | 21 | |||
27 | 22 | from . import dispatch_wave # noqa | ||
28 | 0 | 23 | ||
29 | === added file 'picking_dispatch_wave/__openerp__.py' | |||
30 | --- picking_dispatch_wave/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
31 | +++ picking_dispatch_wave/__openerp__.py 2014-06-13 15:52:45 +0000 | |||
32 | @@ -0,0 +1,46 @@ | |||
33 | 1 | # -*- coding: utf-8 -*- | ||
34 | 2 | ############################################################################## | ||
35 | 3 | # | ||
36 | 4 | # Author: Alexandre Fayolle, Romain Deheele | ||
37 | 5 | # Copyright 2014 Camptocamp SA | ||
38 | 6 | # | ||
39 | 7 | # This program is free software: you can redistribute it and/or modify | ||
40 | 8 | # it under the terms of the GNU Affero General Public License as | ||
41 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
42 | 10 | # License, or (at your option) any later version. | ||
43 | 11 | # | ||
44 | 12 | # This program is distributed in the hope that it will be useful, | ||
45 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
46 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
47 | 15 | # GNU Affero General Public License for more details. | ||
48 | 16 | # | ||
49 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
50 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
51 | 19 | # | ||
52 | 20 | ############################################################################## | ||
53 | 21 | |||
54 | 22 | |||
55 | 23 | { | ||
56 | 24 | "name": "Picking Dispatch Wave", | ||
57 | 25 | "version": "0.1", | ||
58 | 26 | "depends": ['picking_dispatch', 'sale_stock'], | ||
59 | 27 | "author": "Camptocamp", | ||
60 | 28 | 'license': 'AGPL-3', | ||
61 | 29 | "description": """Allows to set a picking dispatch | ||
62 | 30 | including the number maximum of pickings that you want to pick: | ||
63 | 31 | |||
64 | 32 | * The picker sets a number n of pickings to do. | ||
65 | 33 | |||
66 | 34 | * The wizard will select moves from n pickings with oldest min_date. | ||
67 | 35 | |||
68 | 36 | * A picking dispatch is created with found moves | ||
69 | 37 | |||
70 | 38 | It's sort of basic wave picking. | ||
71 | 39 | """, | ||
72 | 40 | "website": "http://www.camptocamp.com", | ||
73 | 41 | "category": "Warehouse Management", | ||
74 | 42 | "demo": [], | ||
75 | 43 | "data": ['dispatch_wave_view.xml'], | ||
76 | 44 | "test": ['test/test_dispatch_wave.yml'], | ||
77 | 45 | "installable": True, | ||
78 | 46 | } | ||
79 | 0 | 47 | ||
80 | === added file 'picking_dispatch_wave/dispatch_wave.py' | |||
81 | --- picking_dispatch_wave/dispatch_wave.py 1970-01-01 00:00:00 +0000 | |||
82 | +++ picking_dispatch_wave/dispatch_wave.py 2014-06-13 15:52:45 +0000 | |||
83 | @@ -0,0 +1,119 @@ | |||
84 | 1 | # -*- coding: utf-8 -*- | ||
85 | 2 | ############################################################################## | ||
86 | 3 | # | ||
87 | 4 | # Author: Alexandre Fayolle, Romain Deheele | ||
88 | 5 | # Copyright 2014 Camptocamp SA | ||
89 | 6 | # | ||
90 | 7 | # This program is free software: you can redistribute it and/or modify | ||
91 | 8 | # it under the terms of the GNU Affero General Public License as | ||
92 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
93 | 10 | # License, or (at your option) any later version. | ||
94 | 11 | # | ||
95 | 12 | # This program is distributed in the hope that it will be useful, | ||
96 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
97 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
98 | 15 | # GNU Affero General Public License for more details. | ||
99 | 16 | # | ||
100 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
101 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
102 | 19 | # | ||
103 | 20 | ############################################################################# | ||
104 | 21 | import logging | ||
105 | 22 | |||
106 | 23 | from openerp.osv import orm, fields | ||
107 | 24 | from openerp.tools.translate import _ | ||
108 | 25 | _logger = logging.getLogger(__name__) | ||
109 | 26 | |||
110 | 27 | |||
111 | 28 | class StockPickingDispatchWave(orm.TransientModel): | ||
112 | 29 | _name = "stock.picking.dispatch.wave" | ||
113 | 30 | |||
114 | 31 | def _get_pickings_to_do(self, cr, uid, max_nb, context=None): | ||
115 | 32 | context = context or {} | ||
116 | 33 | move_obj = self.pool['stock.move'] | ||
117 | 34 | move_ids = [] | ||
118 | 35 | picking_ids = set() | ||
119 | 36 | move_ids = move_obj.search(cr, uid, | ||
120 | 37 | [('dispatch_id', '=', False), | ||
121 | 38 | ('state', '=', 'assigned'), | ||
122 | 39 | ('type', '=', 'out')], | ||
123 | 40 | order='date_expected DESC', | ||
124 | 41 | context=context) | ||
125 | 42 | for move in move_obj.browse(cr, uid, move_ids, context=context): | ||
126 | 43 | if len(picking_ids) == max_nb: | ||
127 | 44 | break | ||
128 | 45 | if move.picking_id.state == 'assigned' and \ | ||
129 | 46 | move.picking_id.id not in picking_ids: | ||
130 | 47 | picking_ids.add(move.picking_id.id) | ||
131 | 48 | return picking_ids | ||
132 | 49 | |||
133 | 50 | def _get_moves_from_picking_list(self, cr, uid, picking_ids, context=None): | ||
134 | 51 | context = context or {} | ||
135 | 52 | move_obj = self.pool['stock.move'] | ||
136 | 53 | move_ids = move_obj.search(cr, uid, | ||
137 | 54 | [('picking_id', 'in', picking_ids)], | ||
138 | 55 | context=context) | ||
139 | 56 | return move_ids | ||
140 | 57 | |||
141 | 58 | def _get_moves_from_pickings_to_do(self, cr, uid, max_nb, context=None): | ||
142 | 59 | context = context or {} | ||
143 | 60 | move_ids = [] | ||
144 | 61 | picking_ids = self.\ | ||
145 | 62 | _get_pickings_to_do(cr, uid, max_nb, context=context) | ||
146 | 63 | if picking_ids: | ||
147 | 64 | move_ids = self._get_moves_from_picking_list(cr, uid, picking_ids, | ||
148 | 65 | context=context) | ||
149 | 66 | return move_ids | ||
150 | 67 | |||
151 | 68 | _columns = { | ||
152 | 69 | 'max_pickings_to_do': fields.integer('Number maximum of pickings ' | ||
153 | 70 | 'to prepare', | ||
154 | 71 | help='number maximum of pickings ' | ||
155 | 72 | 'that we want to prepare'), | ||
156 | 73 | 'picker_id': fields.many2one('res.users', 'User', required=True, | ||
157 | 74 | help='the user to which the pickings ' | ||
158 | 75 | 'are assigned'), | ||
159 | 76 | } | ||
160 | 77 | |||
161 | 78 | _defaults = { | ||
162 | 79 | 'max_pickings_to_do': 0, | ||
163 | 80 | 'picker_id': lambda self, cr, uid, ctx: uid, | ||
164 | 81 | } | ||
165 | 82 | |||
166 | 83 | def action_create_picking_dispatch(self, cr, uid, ids, context=None): | ||
167 | 84 | context = context or {} | ||
168 | 85 | wave = self.browse(cr, uid, ids, context=context)[0] | ||
169 | 86 | if wave.max_pickings_to_do: | ||
170 | 87 | move_ids = self.\ | ||
171 | 88 | _get_moves_from_pickings_to_do(cr, uid, | ||
172 | 89 | wave.max_pickings_to_do, | ||
173 | 90 | context=context) | ||
174 | 91 | if move_ids: | ||
175 | 92 | # create picking_dispatch | ||
176 | 93 | dispatch_obj = self.pool['picking.dispatch'] | ||
177 | 94 | dispatch_vals = { | ||
178 | 95 | 'picker_id': wave.picker_id.id | ||
179 | 96 | } | ||
180 | 97 | dispatch_id = dispatch_obj.create(cr, uid, | ||
181 | 98 | dispatch_vals, | ||
182 | 99 | context=context) | ||
183 | 100 | # affect move_ids on the new dispatch | ||
184 | 101 | self.pool['stock.move'].write(cr, uid, move_ids, | ||
185 | 102 | {'dispatch_id': dispatch_id}, | ||
186 | 103 | context=context) | ||
187 | 104 | context['active_id'] = dispatch_id | ||
188 | 105 | return { | ||
189 | 106 | 'domain': str([('id', '=', dispatch_id)]), | ||
190 | 107 | 'view_type': 'form', | ||
191 | 108 | 'view_mode': 'form', | ||
192 | 109 | 'res_model': 'picking.dispatch', | ||
193 | 110 | 'type': 'ir.actions.act_window', | ||
194 | 111 | 'context': context, | ||
195 | 112 | 'res_id': dispatch_id, | ||
196 | 113 | } | ||
197 | 114 | else: | ||
198 | 115 | raise orm.except_orm(_('Information'), | ||
199 | 116 | _('No ready pickings to deliver!')) | ||
200 | 117 | else: | ||
201 | 118 | raise orm.except_orm(_('Error'), | ||
202 | 119 | _('You need to set at least one unit to do.')) | ||
203 | 0 | 120 | ||
204 | === added file 'picking_dispatch_wave/dispatch_wave_view.xml' | |||
205 | --- picking_dispatch_wave/dispatch_wave_view.xml 1970-01-01 00:00:00 +0000 | |||
206 | +++ picking_dispatch_wave/dispatch_wave_view.xml 2014-06-13 15:52:45 +0000 | |||
207 | @@ -0,0 +1,46 @@ | |||
208 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
209 | 2 | <openerp> | ||
210 | 3 | <data> | ||
211 | 4 | |||
212 | 5 | <act_window id="action_prepare_picking_dispatch" | ||
213 | 6 | name="Picking Wave" | ||
214 | 7 | res_model="stock.picking.dispatch.wave" | ||
215 | 8 | view_type="form" | ||
216 | 9 | view_mode="form" | ||
217 | 10 | target="new" | ||
218 | 11 | /> | ||
219 | 12 | |||
220 | 13 | <menuitem id="menu_prepare_picking_dispatch" | ||
221 | 14 | parent="stock.menu_stock_warehouse_mgmt" | ||
222 | 15 | sequence="40" | ||
223 | 16 | action="action_prepare_picking_dispatch" | ||
224 | 17 | groups="stock.group_stock_user,stock.group_stock_manager" | ||
225 | 18 | /> | ||
226 | 19 | |||
227 | 20 | <record model="ir.ui.view" id="picking_dispatch_prepare_form"> | ||
228 | 21 | <field name="name">stock.picking.dispatch.wave form</field> | ||
229 | 22 | <field name="model">stock.picking.dispatch.wave</field> | ||
230 | 23 | <field name="arch" type="xml"> | ||
231 | 24 | <form string="Picking Wave" version="7.0"> | ||
232 | 25 | <group> | ||
233 | 26 | <p class="oe_grey"> | ||
234 | 27 | This action will prepare you a picking dispatch | ||
235 | 28 | according the number of pickings that you set. | ||
236 | 29 | </p> | ||
237 | 30 | </group> | ||
238 | 31 | <group> | ||
239 | 32 | <field name="max_pickings_to_do"/> | ||
240 | 33 | <field name="picker_id"/> | ||
241 | 34 | </group> | ||
242 | 35 | <footer> | ||
243 | 36 | <button name="action_create_picking_dispatch" string="Create Picking Dispatch" type="object" | ||
244 | 37 | class="oe_highlight"/> | ||
245 | 38 | or | ||
246 | 39 | <button string="Cancel" class="oe_link" special="cancel" /> | ||
247 | 40 | </footer> | ||
248 | 41 | </form> | ||
249 | 42 | </field> | ||
250 | 43 | </record> | ||
251 | 44 | |||
252 | 45 | </data> | ||
253 | 46 | </openerp> | ||
254 | 0 | 47 | ||
255 | === added directory 'picking_dispatch_wave/i18n' | |||
256 | === added file 'picking_dispatch_wave/i18n/fr.po' | |||
257 | --- picking_dispatch_wave/i18n/fr.po 1970-01-01 00:00:00 +0000 | |||
258 | +++ picking_dispatch_wave/i18n/fr.po 2014-06-13 15:52:45 +0000 | |||
259 | @@ -0,0 +1,82 @@ | |||
260 | 1 | # Translation of OpenERP Server. | ||
261 | 2 | # This file contains the translation of the following modules: | ||
262 | 3 | # * picking_dispatch_wave | ||
263 | 4 | # | ||
264 | 5 | msgid "" | ||
265 | 6 | msgstr "" | ||
266 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
267 | 8 | "Report-Msgid-Bugs-To: \n" | ||
268 | 9 | "POT-Creation-Date: 2014-06-13 15:12+0000\n" | ||
269 | 10 | "PO-Revision-Date: 2014-06-13 15:12+0000\n" | ||
270 | 11 | "Last-Translator: <>\n" | ||
271 | 12 | "Language-Team: \n" | ||
272 | 13 | "MIME-Version: 1.0\n" | ||
273 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
274 | 15 | "Content-Transfer-Encoding: \n" | ||
275 | 16 | "Plural-Forms: \n" | ||
276 | 17 | |||
277 | 18 | #. module: picking_dispatch_wave | ||
278 | 19 | #: view:stock.picking.dispatch.wave:0 | ||
279 | 20 | msgid "This action will prepare you a picking dispatch\n" | ||
280 | 21 | " according the number of pickings that you set." | ||
281 | 22 | msgstr "Cette action va vous préparer un bon de préparation\n" | ||
282 | 23 | " selon le nombre de livraisons défini." | ||
283 | 24 | |||
284 | 25 | #. module: picking_dispatch_wave | ||
285 | 26 | #: model:ir.actions.act_window,name:picking_dispatch_wave.action_prepare_picking_dispatch | ||
286 | 27 | #: model:ir.ui.menu,name:picking_dispatch_wave.menu_prepare_picking_dispatch | ||
287 | 28 | #: view:stock.picking.dispatch.wave:0 | ||
288 | 29 | msgid "Picking Wave" | ||
289 | 30 | msgstr "Préparer n livraisons" | ||
290 | 31 | |||
291 | 32 | #. module: picking_dispatch_wave | ||
292 | 33 | #: help:stock.picking.dispatch.wave,max_pickings_to_do:0 | ||
293 | 34 | msgid "number maximum of pickings that we want to prepare" | ||
294 | 35 | msgstr "Nombre maximum de livraisons que vous voulez préparez" | ||
295 | 36 | |||
296 | 37 | #. module: picking_dispatch_wave | ||
297 | 38 | #: field:stock.picking.dispatch.wave,max_pickings_to_do:0 | ||
298 | 39 | msgid "Number maximum of pickings to prepare" | ||
299 | 40 | msgstr "Nombre maximum de livraisons à préparer" | ||
300 | 41 | |||
301 | 42 | #. module: picking_dispatch_wave | ||
302 | 43 | #: field:stock.picking.dispatch.wave,picker_id:0 | ||
303 | 44 | msgid "User" | ||
304 | 45 | msgstr "Utilisateur" | ||
305 | 46 | |||
306 | 47 | #. module: picking_dispatch_wave | ||
307 | 48 | #: view:stock.picking.dispatch.wave:0 | ||
308 | 49 | msgid "Cancel" | ||
309 | 50 | msgstr "Annuler" | ||
310 | 51 | |||
311 | 52 | #. module: picking_dispatch_wave | ||
312 | 53 | #: view:stock.picking.dispatch.wave:0 | ||
313 | 54 | msgid "Create Picking Dispatch" | ||
314 | 55 | msgstr "Créer un bon de préparation" | ||
315 | 56 | |||
316 | 57 | #. module: picking_dispatch_wave | ||
317 | 58 | #: view:stock.picking.dispatch.wave:0 | ||
318 | 59 | msgid "or" | ||
319 | 60 | msgstr "ou" | ||
320 | 61 | |||
321 | 62 | #. module: picking_dispatch_wave | ||
322 | 63 | #: help:stock.picking.dispatch.wave,picker_id:0 | ||
323 | 64 | msgid "the user to which the pickings are assigned" | ||
324 | 65 | msgstr "l'utilisateur à qui les livraisons sont attribuées" | ||
325 | 66 | |||
326 | 67 | #. module: picking_dispatch_wave | ||
327 | 68 | #: model:ir.model,name:picking_dispatch_wave.model_stock_picking_dispatch_wave | ||
328 | 69 | msgid "stock.picking.dispatch.wave" | ||
329 | 70 | msgstr "stock.picking.dispatch.wave" | ||
330 | 71 | |||
331 | 72 | #. module: picking_dispatch_wave | ||
332 | 73 | #: code:addons/picking_dispatch_wave/dispatch_wave.py:116 | ||
333 | 74 | #, python-format | ||
334 | 75 | msgid "You need to set at least one unit to do." | ||
335 | 76 | msgstr "Sélectionner au moins une livraison à préparer" | ||
336 | 77 | |||
337 | 78 | #. module: picking_dispatch_wave | ||
338 | 79 | #: code:addons/picking_dispatch_wave/dispatch_wave.py:113 | ||
339 | 80 | #, python-format | ||
340 | 81 | msgid "No ready pickings to deliver!" | ||
341 | 82 | msgstr "Aucune livraison à préparer !" | ||
342 | 0 | 83 | ||
343 | === added file 'picking_dispatch_wave/i18n/picking_dispatch_wave.pot' | |||
344 | --- picking_dispatch_wave/i18n/picking_dispatch_wave.pot 1970-01-01 00:00:00 +0000 | |||
345 | +++ picking_dispatch_wave/i18n/picking_dispatch_wave.pot 2014-06-13 15:52:45 +0000 | |||
346 | @@ -0,0 +1,70 @@ | |||
347 | 1 | # Translation of OpenERP Server. | ||
348 | 2 | # This file contains the translation of the following modules: | ||
349 | 3 | # * picking_dispatch_wave | ||
350 | 4 | # | ||
351 | 5 | msgid "" | ||
352 | 6 | msgstr "" | ||
353 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
354 | 8 | "Report-Msgid-Bugs-To: \n" | ||
355 | 9 | "POT-Creation-Date: 2014-06-13 15:12+0000\n" | ||
356 | 10 | "PO-Revision-Date: 2014-06-13 15:12+0000\n" | ||
357 | 11 | "Last-Translator: <>\n" | ||
358 | 12 | "Language-Team: \n" | ||
359 | 13 | "MIME-Version: 1.0\n" | ||
360 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
361 | 15 | "Content-Transfer-Encoding: \n" | ||
362 | 16 | "Plural-Forms: \n" | ||
363 | 17 | |||
364 | 18 | #. module: picking_dispatch_wave | ||
365 | 19 | #: view:stock.picking.dispatch.wave:0 | ||
366 | 20 | msgid "This action will prepare you a picking dispatch\n" | ||
367 | 21 | " according the number of pickings that you set." | ||
368 | 22 | msgstr "" | ||
369 | 23 | |||
370 | 24 | #. module: picking_dispatch_wave | ||
371 | 25 | #: model:ir.actions.act_window,name:picking_dispatch_wave.action_prepare_picking_dispatch | ||
372 | 26 | #: model:ir.ui.menu,name:picking_dispatch_wave.menu_prepare_picking_dispatch | ||
373 | 27 | #: view:stock.picking.dispatch.wave:0 | ||
374 | 28 | msgid "Picking Wave" | ||
375 | 29 | msgstr "" | ||
376 | 30 | |||
377 | 31 | #. module: picking_dispatch_wave | ||
378 | 32 | #: help:stock.picking.dispatch.wave,max_pickings_to_do:0 | ||
379 | 33 | msgid "number maximum of pickings that we want to prepare" | ||
380 | 34 | msgstr "" | ||
381 | 35 | |||
382 | 36 | #. module: picking_dispatch_wave | ||
383 | 37 | #: field:stock.picking.dispatch.wave,max_pickings_to_do:0 | ||
384 | 38 | msgid "Number maximum of pickings to prepare" | ||
385 | 39 | msgstr "" | ||
386 | 40 | |||
387 | 41 | #. module: picking_dispatch_wave | ||
388 | 42 | #: field:stock.picking.dispatch.wave,picker_id:0 | ||
389 | 43 | msgid "User" | ||
390 | 44 | msgstr "" | ||
391 | 45 | |||
392 | 46 | #. module: picking_dispatch_wave | ||
393 | 47 | #: view:stock.picking.dispatch.wave:0 | ||
394 | 48 | msgid "Cancel" | ||
395 | 49 | msgstr "" | ||
396 | 50 | |||
397 | 51 | #. module: picking_dispatch_wave | ||
398 | 52 | #: view:stock.picking.dispatch.wave:0 | ||
399 | 53 | msgid "Create Picking Dispatch" | ||
400 | 54 | msgstr "" | ||
401 | 55 | |||
402 | 56 | #. module: picking_dispatch_wave | ||
403 | 57 | #: view:stock.picking.dispatch.wave:0 | ||
404 | 58 | msgid "or" | ||
405 | 59 | msgstr "" | ||
406 | 60 | |||
407 | 61 | #. module: picking_dispatch_wave | ||
408 | 62 | #: help:stock.picking.dispatch.wave,picker_id:0 | ||
409 | 63 | msgid "the user to which the pickings are assigned" | ||
410 | 64 | msgstr "" | ||
411 | 65 | |||
412 | 66 | #. module: picking_dispatch_wave | ||
413 | 67 | #: model:ir.model,name:picking_dispatch_wave.model_stock_picking_dispatch_wave | ||
414 | 68 | msgid "stock.picking.dispatch.wave" | ||
415 | 69 | msgstr "" | ||
416 | 70 | |||
417 | 0 | 71 | ||
418 | === added directory 'picking_dispatch_wave/test' | |||
419 | === added file 'picking_dispatch_wave/test/test_dispatch_wave.yml' | |||
420 | --- picking_dispatch_wave/test/test_dispatch_wave.yml 1970-01-01 00:00:00 +0000 | |||
421 | +++ picking_dispatch_wave/test/test_dispatch_wave.yml 2014-06-13 15:52:45 +0000 | |||
422 | @@ -0,0 +1,47 @@ | |||
423 | 1 | - | ||
424 | 2 | In order to test stock picking wave | ||
425 | 3 | I have to ensure when a picking dispatch wave is set, a picking dispatch is well created. | ||
426 | 4 | - | ||
427 | 5 | I create a product | ||
428 | 6 | - | ||
429 | 7 | !record {model: product.product, id: prod_wave}: | ||
430 | 8 | name: product_wave | ||
431 | 9 | procure_method: make_to_stock | ||
432 | 10 | supply_method: buy | ||
433 | 11 | - | ||
434 | 12 | I create a SO | ||
435 | 13 | - | ||
436 | 14 | !record {model: sale.order, id: so_wave}: | ||
437 | 15 | partner_id: base.res_partner_2 | ||
438 | 16 | order_policy: 'manual' | ||
439 | 17 | picking_policy: 'direct' | ||
440 | 18 | order_line: | ||
441 | 19 | - product_id: prod_wave | ||
442 | 20 | product_uom_qty: 3 | ||
443 | 21 | - | ||
444 | 22 | Then I confirm the order | ||
445 | 23 | - | ||
446 | 24 | !workflow {model: sale.order, action: order_confirm, ref: so_wave} | ||
447 | 25 | - | ||
448 | 26 | Then (for test needs) I force the picking as ready to deliver | ||
449 | 27 | - | ||
450 | 28 | !python {model: stock.picking}: | | ||
451 | 29 | picking = self.search(cr, uid, [('sale_id', '=', ref("so_wave"))]) | ||
452 | 30 | self.force_assign(cr, uid, picking) | ||
453 | 31 | - | ||
454 | 32 | Then I ask a picking dispatch wave with 1 unit. | ||
455 | 33 | - | ||
456 | 34 | !record {model: stock.picking.dispatch.wave, id: wiz_wave}: | ||
457 | 35 | max_pickings_to_do: 1 | ||
458 | 36 | picker_id: base.user_demo | ||
459 | 37 | - | ||
460 | 38 | Then I confirm the demand | ||
461 | 39 | - | ||
462 | 40 | !python {model: stock.picking.dispatch.wave}: | ||
463 | 41 | self.action_create_picking_dispatch(cr, uid, [ref("wiz_wave")], context=context) | ||
464 | 42 | - | ||
465 | 43 | Then I check if the picking dispatch is created | ||
466 | 44 | - | ||
467 | 45 | !python {model: picking.dispatch}: | | ||
468 | 46 | dispatchs = self.search(cr, uid, [('state','=','draft'),('picker_id','=',ref("base.user_demo"))]) | ||
469 | 47 | assert len(dispatchs) == 1, "The dispatch is ready" |
Needs fixing:
* convert the description in __openerp__.py to Restructured Text
* please add a test
* I'm concerned the SQL query may bypass the multicompany security rules
* NEVER DO SQL PARAMETER SUBSTITUTION WITH THE % OPERATOR!!!!