ooor 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/app/models/open_object_resource.rb +1 -1
- data/spec/ooor_spec.rb +11 -7
- metadata +3 -3
@@ -348,7 +348,7 @@ class OpenObjectResource < ActiveResource::Base
|
|
348
348
|
load(attributes)
|
349
349
|
else
|
350
350
|
self.class.reload_fields_definition() unless self.class.fields_defined
|
351
|
-
default_get_list ||= Set.new(self.class.many2one_relations.collect {|k, field| self.class.const_get(field.relation).fields.keys}.flatten + self.class.fields.keys).to_a
|
351
|
+
default_get_list ||= Set.new(self.class.many2one_relations.reject {|k, v| attributes.keys.index(k.to_sym)}.collect {|k, field| self.class.const_get(field.relation).fields.keys}.flatten + self.class.fields.keys).to_a
|
352
352
|
load(self.class.rpc_execute("default_get", default_get_list, context).symbolize_keys!.merge(attributes.symbolize_keys!))
|
353
353
|
end
|
354
354
|
end
|
data/spec/ooor_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe Ooor do
|
|
9
9
|
@username = 'admin'
|
10
10
|
@password = 'admin'
|
11
11
|
@database = 'ooor_test'
|
12
|
-
@ooor = Ooor.new(:url => @url, :username => @username, :
|
12
|
+
@ooor = Ooor.new(:url => @url, :username => @username, :password => @password)
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should keep quiet if no database is mentioned" do
|
@@ -30,7 +30,7 @@ describe Ooor do
|
|
30
30
|
|
31
31
|
describe "Configure existing database" do
|
32
32
|
before(:all) do
|
33
|
-
@ooor = Ooor.new(:url => @url, :username => @username, :
|
33
|
+
@ooor = Ooor.new(:url => @url, :username => @username, :password => @password, :database => @database)
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should be able to load a profile" do
|
@@ -59,7 +59,7 @@ describe Ooor do
|
|
59
59
|
|
60
60
|
describe "Do operations on configured database" do
|
61
61
|
before(:all) do
|
62
|
-
@ooor = Ooor.new(:url => @url, :username => @username, :
|
62
|
+
@ooor = Ooor.new(:url => @url, :username => @username, :password => @password, :database => @database,
|
63
63
|
:models => ['res.user', 'res.partner', 'product.product', 'sale.order', 'account.invoice', 'product.category', 'stock.move', 'ir.ui.menu'])
|
64
64
|
end
|
65
65
|
|
@@ -191,6 +191,10 @@ describe Ooor do
|
|
191
191
|
p = ProductProduct.new
|
192
192
|
p.sale_delay.should be_kind_of(Integer)
|
193
193
|
end
|
194
|
+
|
195
|
+
it "should skipped inherited default fields properly, for instance at product variant creation" do
|
196
|
+
ProductProduct.create(:product_tmpl_id => 25, :code => 'OOOR variant').should be_kind_of(ProductProduct)
|
197
|
+
end
|
194
198
|
end
|
195
199
|
|
196
200
|
describe "Basic updates" do
|
@@ -287,7 +291,7 @@ describe Ooor do
|
|
287
291
|
|
288
292
|
describe "Offer Web Client core features" do
|
289
293
|
before(:all) do
|
290
|
-
@ooor = Ooor.new(:url => @url, :username => @username, :
|
294
|
+
@ooor = Ooor.new(:url => @url, :username => @username, :password => @password, :database => @database,
|
291
295
|
:models => ['res.user', 'res.partner', 'product.product', 'sale.order', 'account.invoice', 'product.category', 'stock.move', 'ir.ui.menu'])
|
292
296
|
end
|
293
297
|
|
@@ -318,7 +322,7 @@ describe Ooor do
|
|
318
322
|
|
319
323
|
describe "UML features" do
|
320
324
|
before(:all) do
|
321
|
-
@ooor = Ooor.new(:url => @url, :username => @username, :
|
325
|
+
@ooor = Ooor.new(:url => @url, :username => @username, :password => @password, :database => @database,
|
322
326
|
:models => ['res.user', 'res.partner', 'product.product', 'sale.order', 'account.invoice', 'product.category', 'stock.move', 'ir.ui.menu'])
|
323
327
|
end
|
324
328
|
|
@@ -338,8 +342,8 @@ describe Ooor do
|
|
338
342
|
|
339
343
|
describe "Multi-instance and class name scoping" do
|
340
344
|
before(:all) do
|
341
|
-
@ooor1 = Ooor.new(:url => @url, :username => @username, :
|
342
|
-
@ooor2 = Ooor.new(:url => @url, :username => @username, :
|
345
|
+
@ooor1 = Ooor.new(:url => @url, :username => @username, :password => @password, :database => @database, :scope_prefix => 'OE1', :models => ['product.product'])
|
346
|
+
@ooor2 = Ooor.new(:url => @url, :username => @username, :password => @password, :database => @database, :scope_prefix => 'OE2', :models => ['product.product'])
|
343
347
|
end
|
344
348
|
|
345
349
|
it "should still be possible to find a ressource using an absolute id" do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 1.3.
|
8
|
+
- 2
|
9
|
+
version: 1.3.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Raphael Valyi - www.akretion.com
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-12 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|