Skip to Content
Menu
This question has been flagged
1 Reply
5671 Views

Hello, I have a question about continuous integration and tests.

As we really new to CI maybe someone can help with workflow.

Our WorkFlow is like this.

Developer 

makes a commit -> push then Jenkins creates a new database and runs all tests from main odoo addons and then from our costume modules.

The problem is that for example in my custom add I do something like this(see code belowe).

The tests from sale_stock, sale, and purchase modules start crashing because in those tests there is no such group as we check in action_confirm method.

So I wonder maybe our workflow is bad?

maybe Odoo base modules tests should start first and after them, our custom modules should be installed?

@api.multi
def action_confirm(self):
super(SaleOrder, self).action_confirm()
user_id = self.env.uid or self._context.get('uid')
usr = self.env['res.users'].browse(user_id)
if not usr.has_group('config.group_allow_create_so'):

raise AccessError(_('You dont have permission to confirm Sale Order, contact your system administrator'))

Avatar
Discard
Best Answer

I wonder maybe our workflow is bad?
    Odoo's workflow is general workflow it didn't fit in all the business cases so you can change it according to your
    business need.

maybe Odoo base modules tests should start first and after them, our custom modules should be installed?
    all the test cases are written in odoo for test this general workflow. and if you change it will break so in this case either extend those test cases and adapt it according to your code change or if your flow is complete deferent from a generic one remove it completely and write a new one in your module according to your need 

Avatar
Discard

I thought it wasn't possible to extend the unit tests in Odoo.

Related Posts Replies Views Activity
4
Aug 24
4229
0
Jan 24
254
1
Jan 23
2447
0
Oct 22
836
0
Aug 22
3