cucumber-openerpscenario 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- #################################################################################
3
- # #
4
- # OERPScenario, OpenERP Functional Tests #
5
- # Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com> #
6
- # #
7
- # This program is free software: you can redistribute it and/or modify #
8
- # it under the terms of the GNU General Public License as published by #
9
- # the Free Software Foundation, either version 3 Afero of the License, or #
10
- # (at your option) any later version. #
11
- # #
12
- # This program is distributed in the hope that it will be useful, #
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15
- # GNU General Public License for more details. #
16
- # #
17
- # You should have received a copy of the GNU General Public License #
18
- # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19
- # #
20
- #################################################################################
21
- require 'pp'
22
- require 'rubygems'
23
- require 'ooor'
24
-
25
- begin
26
- if Object.const_defined? 'StockPicking'
27
- StockPicking.class_eval do
28
- $utils.log.debug("Extending #{self.class} #{self.name}")
29
- # Add useful methode on stock picking handling
30
-
31
- def self.to_ary
32
- return [name]
33
- end
34
-
35
- def validate_picking()
36
- res = {'delivery_date' => (DateTime.now).strftime(fmt="%Y-%m-%d %H:%M:%S")}
37
- stock_moves = move_lines
38
- stock_moves.each do |move_line|
39
- res["move#{move_line.id}"] = {'prodlot_id' => move_line.prodlot_id && move_line.prodlot_id.id || false, 'product_id' => move_line.product_id.id, 'product_uom' => move_line.product_uom.id, 'product_qty' => move_line.product_qty}
40
- end
41
- StockPicking.do_partial([id], res)
42
- end
43
- end
44
- else
45
- $utils.log.debug("StockPicking helper not initialized")
46
- end
47
- rescue Exception => e
48
- $utils.log.fatal("ERROR : #{e.to_s}")
49
- end