Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
2568 Lượt xem

Hi,

i have the problem, that if i create a sales order with product A which is not in Stock the delivery order gets moved to "Waiting". so far so good. Now i add Stock for product A and the order is still "waiting". I have to manually enter the delivery order and press the button "check Availability" - then it jumps to "to process". is it possible to automatically check all waiting orders for Availability every 30 minutes or so?

Best regards!
Lennart Berens

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

If the reservation method is set to automatic (on delivery operation) then on product availability reservation is automatic.

It is also likely in some cases that the added stock reserves earlier delivery orders. This can be validated by clicking the forecast icon on product line.

If reservation is set to before schedule date or manual, check availability process would be required to make reservation. 

The above is the expected behaviour in V17, could you confirm the version you are on and the reservation method set on delivery operation?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

<record id="ir_cron_check_availability" model="ir.cron">
        <field name="name">Sale: Stock Check Availability</field>
        <field name="model_id" ref="model_sale.order"/>
        <field name="state">code</field>
        <field name="code">model.check_availability()</field>
        <field name="interval_number">30</field>
        <field name="interval_type">minutes</field>
        <field name="numbercall">-1</field>
        <field eval="False" name="doall"/>
    </record>


Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thank you, that seems to be the right direction. if i understand the code correctly this basically adds a Sheduled Action that calls the code  model.check_availability()
i just tried to create a sheduled action, but i get the error  

AttributeError: 'sale.order' object has no attribute 'check_availability'

I will try to implement the record via a module later on - but maybe you can instantly tell what mistake i made. For me it looks like i am using a non existing attribute - but i assume model.check_availability is stock odoo 17?

Ảnh đại diện
Huỷ bỏ

I don't think there is a method named 'check_availability'. You have to create it, or you can call the action_assign() of stock.picking instead, which will automatically reserve the available stock.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 25
1214
1
thg 6 24
3114
1
thg 12 22
1109
4
thg 12 18
4990
2
thg 10 15
13361