Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6684 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona

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

Post correlati Risposte Visualizzazioni Attività
4
ago 24
6309
0
gen 24
991
1
gen 23
3991
0
ott 22
1555
0
ago 22
3