Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
12565 Представления

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

Related Posts Ответы Просмотры Активность
1
апр. 25
3773
0
мар. 24
1447
5
дек. 23
22438
1
июн. 23
1863
0
окт. 22
2628