Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
12576 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur

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.

Beste antwoord

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
Annuleer

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

Gerelateerde posts Antwoorden Weergaven Activiteit
1
apr. 25
3776
0
mrt. 24
1450
5
dec. 23
22443
1
jun. 23
1867
0
okt. 22
2631