cucumber-openerpscenario 0.1.8 → 0.1.9

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,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{cucumber-openerpscenario}
3
- s.version = "0.1.8"
3
+ s.version = "0.1.9"
4
4
  s.date = %q{2013-03-06}
5
5
  s.authors = ["Nicolas Bessi - Camptocamp"]
6
6
  s.summary = %q{cucumber on OpenERP}
@@ -47,6 +47,10 @@ def _manage_col_search(field_def, value)
47
47
  comm_ext, arguments = prepare_args(value.gsub('by ', ''))
48
48
  arguments.push({:fields=>['id']})
49
49
  oid = oclass.send(('find_by_'+comm_ext).to_sym, *arguments)
50
+ elsif value.start_with? 'all by'
51
+ comm_ext, arguments = prepare_args(value.gsub('all by', ''))
52
+ arguments.push({:fields=>['id']})
53
+ oid = oclass.send(('find_all_by_'+comm_ext).to_sym, *arguments)
50
54
  else
51
55
  eval "oid = oclass.#{value}"
52
56
  end
@@ -91,8 +95,15 @@ def manage_item_table(item, table)
91
95
  field_name = dict['name']
92
96
  value = dict['value']
93
97
  value_type = item.class.fields.fetch(field_name, {}).fetch('type', '')
94
-
95
- item.send("#{field_name}=".to_sym, _item_value(relations, field_name, value, value_type))
98
+ r_val = _item_value(relations, field_name, value, value_type)
99
+ unless item.class.many2one_associations.include? field_name
100
+ if r_val
101
+ unless r_val.is_a? Array
102
+ r_val = [r_val]
103
+ end
104
+ end
105
+ end
106
+ item.send("#{field_name}=".to_sym, r_val)
96
107
  end
97
108
  end
98
109
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cucumber-openerpscenario
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.8
5
+ version: 0.1.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nicolas Bessi - Camptocamp
@@ -84,6 +84,7 @@ files:
84
84
  - cucumber-openerp.gemspec
85
85
  - cucumber-openerpscenario-0.1.6.gem
86
86
  - cucumber-openerpscenario-0.1.7.gem
87
+ - cucumber-openerpscenario-0.1.8.gem
87
88
  - lib/.DS_Store
88
89
  - lib/cucumber/.DS_Store
89
90
  - lib/cucumber/lib/.DS_Store