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

Hi all,


I would like to know how to force the customer to have at least one product inside quotations.

With this, they will not be able to save the quotation ( so create a new line in the database) if there is no product.

I was thinking to add only required=true for the order_line but it is not working.


Someone has an idea?


-----EDIT SOLUTION----

It is working with this solution inside the create function:

def create(self, cr, uid, vals, context=None):

context = context or {}

if not vals['order_line']:

raise osv.except_osv(_('Error!'),_('You cannot confirm a Quotation which has no line.'))


Many thanks,


Selverine



아바타
취소
베스트 답변

One way is using a python constraint in the model to check the number of order lines in the sale.order

아바타
취소
작성자 베스트 답변

Ok, but where and how to do it?

And why required=true is not working for this field? It's because it is a OnetoMany?


Many thanks,


Selverine

아바타
취소
관련 게시물 답글 화면 활동
0
3월 15
3028
6
12월 20
7584
2
2월 18
5228
1
8월 16
4510
2
9월 25
436