콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
6771 화면

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'))

아바타
취소
베스트 답변

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 

아바타
취소

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

관련 게시물 답글 화면 활동
4
8월 24
6528
0
1월 24
1073
1
1월 23
4115
0
10월 22
1658
0
8월 22
3