تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
2121 أدوات العرض

Hello Odooers,

For instance, when a customer orders 1 unit of a product with 0 units, a backorder is created for that order. In delivery orders, the demand is set to 1 unit, and when a user inputs the quantity with 1 unit. Supposedly a wizard pop-up "Create Backorder?" will show after clicking the button 'Validate'. But instead after clicking the 'Validate' button, it will automatically validate it even though the product has 0 units. 

I try to create a Server Action to implement this. But when I try to implement it, an "Invalid Operations" occurs. Answers will be appreciated. Thank you.


"Invalid Operations" 

You cannot validate a transfer if no quantities are reserved. To force the transfer, encode quantities.

 

Below is the code for Server Action:

for stock in records:

for line in records.move_ids_without_package:

if  line.quantity == line.product_uom_qty:

    action = stock.button_validate()

action = stock.button_validate()

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

There is already a default feature in odoo, where you can create backorder automatically without clicking the Validate button,


Go to Inventory then Configuration under that go to Operation Types, Select Internal Transfers

Under the General Page

You can see Create Backorder set it to Always


Then the Backorder will be created always



Hope it helps.

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Hello Cybrosys,

Your answer really helps me everytime. But, I want to display the wizard pop-up "Create Backorder?" whenever a customer order a product that low in stock. Is there any solution? Thank you so much. 

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
سبتمبر 24
2488
4
مايو 25
2149
2
مايو 25
5494
1
مارس 25
1395
4
مارس 25
4172