Skip to Content
Menu
This question has been flagged
2 Replies
12577 Rodiniai

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

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Autorius

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.

Best Answer

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

Portretas
Atmesti

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

Related Posts Replies Rodiniai Veikla
1
bal. 25
3776
0
kov. 24
1450
5
gruod. 23
22443
1
birž. 23
1867
0
spal. 22
2631