Skip to content

Commit

Permalink
skip a few tests for which demo data won't pass on Odoo 9
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Nov 23, 2015
1 parent c783d14 commit 3229eae
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions spec/ooor_spec.rb
Expand Up @@ -258,13 +258,15 @@
o.id.should be_kind_of(Integer)
end

if OOOR_ODOO_VERSION != '9.0'
it "should be able to to create an invoice" do
i = AccountInvoice.new(:origin => 'ooor_test')
partner_id = ResPartner.search([['name', 'ilike', 'Agrolait']])[0]
i.on_change('onchange_partner_id', :partner_id, partner_id, 'out_invoice', partner_id, false, false)
i.save
i.id.should be_kind_of(Integer)
end
end

if OOOR_ODOO_VERSION == '7.0'
it "should be able to call on_change" do
Expand Down Expand Up @@ -379,12 +381,14 @@
so.order_line.build().should be_kind_of(SaleOrderLine)
end

if OOOR_ODOO_VERSION != '9.0'
it "should recast string m2o string id to an integer (it happens in forms)" do
uom_id = @ooor.const_get('product.uom').search()[0]
p = ProductProduct.new(name: "z recast id", uom_id: uom_id.to_s)
p.save
p.uom_id.id.should == uom_id
end
end

it "should recast string m2m string ids to an array of integer (it happens in forms)" do
categ_ids = @ooor.const_get('res.partner.category').search()[0..1]
Expand Down Expand Up @@ -471,6 +475,7 @@
collection.all.size.should == 5
end

if OOOR_ODOO_VERSION != '9.0'
it "should support name_search in ARel (used in association widgets with Ooorest)" do
if OOOR_ODOO_VERSION == '7.0'
expected = "All products / Saleable / Components"
Expand All @@ -479,6 +484,7 @@
end
Ooor.default_session.const_get('product.category').all(name_search: 'Com')[0].name.should == expected
end
end

it "should be possible to invoke batch methods on relations" do
Ooor.default_session.const_get('product.product').where(type: 'service').write(type: 'service').should == true
Expand All @@ -503,6 +509,7 @@
end

describe "wizard management" do
if OOOR_ODOO_VERSION != '9.0'
it "should be possible to pay an invoice in one step" do
inv = AccountInvoice.find(:first).copy() # creates a draft invoice
inv.state.should == "draft"
Expand All @@ -511,11 +518,10 @@
voucher = @ooor.const_get('account.voucher').new({:amount=>inv.amount_total, :type=>"receipt", :partner_id => inv.partner_id.id}, {"default_amount"=>inv.amount_total, "invoice_id"=>inv.id})
voucher.on_change("onchange_partner_id", [], :partner_id, inv.partner_id.id, @ooor.const_get('account.journal').find('account.bank_journal').id, 0.0, 1, 'receipt', false)
voucher.save
# voucher.wkf_action 'proforma_voucher'

# inv.reload
end
end

if OOOR_ODOO_VERSION != '9.0'
it "should be possible to call resource actions and workflow actions" do
s = SaleOrder.find(:first).copy()
s.wkf_action('order_confirm')
Expand All @@ -528,6 +534,7 @@
i.action_cancel_draft
s.reload.state.should == "invoice_except"
end
end
end

describe "Delete resources" do
Expand Down Expand Up @@ -588,13 +595,15 @@
end
end

if OOOR_ODOO_VERSION != '9.0' # TODO make it work on 9
it "should find by permalink" do
Ooor.session_handler.reset!() # alias isn't part of the connection spec, we don't want connection reuse here
with_ooor_session(url: OOOR_URL, username: OOOR_USERNAME, password: OOOR_PASSWORD, database: OOOR_DATABASE, :aliases => {en_US: {products: 'product.product'}}, :param_keys => {'product.product' => 'name'}) do |session|
lang = Ooor::Locale.to_erp_locale('en')
session['products'].find_by_permalink('Service', context: {'lang' => lang}, fields: ['name']).should be_kind_of(Ooor::Base)
end
end
end
end

describe "Ative-Record like Reflections" do
Expand Down

0 comments on commit 3229eae

Please sign in to comment.