Skip to Content
Menu
This question has been flagged
2 Replies
11088 Views

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

Avatar
Discard
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

Avatar
Discard
Author

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

Avatar
Discard

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

Related Posts Replies Views Activity
0
Mar 24
275
5
Dec 23
19492
1
Jun 23
988
0
Oct 22
1499
0
Sep 22
662