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

Hi there,

In Odoo 12 (and other versions too), when we save a Sales Order and keep it in "draft" (not confirmed), the system is numbering the document.

I need Odoo to keep the document with "no number" until it is confirmed by the user.

The idea is to have all "not confirmed" sales orders  and in draft state, to wait for a number until they are confirmed.

How can I achieve that?

Thank you very much

Best regards

아바타
취소
베스트 답변

Hi,

Right now in Odoo the sequence for the sale order is assigned when the record is created. If you want to change the sequence generation upon confirming the sale order, you can Inherit the sale.order and override the action of the button and confirm and write the code for the generation of the sequence.

In the sales module in the sale.py module, you can see how the sequence is generate during the creation by overriding the create method.


Thanks

아바타
취소
작성자

Thank you Niyas. Based on your answer I was abble to change the code that generates the sequence (create action) and added the code that generates the sequence to the action_confirm. It's working as expected.

베스트 답변

Hi, I'm afraid it is hardly possible without re-defining the method of assigning this number on the Python level (if you are programming have a look at the model 'ir.sequence'). The point is that, each time an object (a sale order) is created, Odoo invokes the method, which increments the number in a related ir.sequence.

However, in the interface you can manually change what is the next number and its appearance (whether to show year and which symbols). To that end: in the debug mode go to Settings > Technical > Sequences & Identifiers > Sequences, and search for 'Sales Order'.

아바타
취소

I did this and now it's not sequencing and giving me error like order reference. Help Please

관련 게시물 답글 화면 활동
1
4월 25
3784
0
3월 24
1452
5
12월 23
22452
1
6월 23
1867
0
10월 22
2636