Odoo Help


Writing tests with new v8 api?

Andrius Laukavičius
on 9/22/14, 3:51 AM 1,170 views

I want to write tests on v8 modules, but dont seem to find a way to use new api. In all examples I see that cr, uid is still used etc. Is it possible to write tests with new api. If so how (any references etc)?

Jusab Sida (jsi)
On 2/25/15, 1:22 AM

Hello Andrius Laukavičius,

             Yes, you can write tests using all new api stuff.


from openerp.tests import common

class testPartnerCreate(common.TransactionCase):
    def setUp(self):
        super(testPartnerCreate, self).setUp()

    def test_create(self):
        res_partner = self.env['res.partner']

        test_partner1 = res_partner.create(
                name="Demo bhai",
                city="test city",


Hope this will help.


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/22/14, 3:51 AM
Seen: 1170 times
Last updated: 3/16/15, 8:10 AM