Hello, we are using the Odoo 16 community edition. I need an option to mass lock sales orders once they are delivered. Any suggestions?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi,
* To lock the sales order after delivery, we need to inherit the 'Validate' button in the Delivery Order (stock.picking).
class StockPicking(models.Model):
"""Inherits stock.picking"""
_inherit = 'stock.picking'
def button_validate(self):
"""Call the function for locking the sale order
while clicking on the validate button"""
res = super().button_validate()
self.sale_id.action_done()
return res
This will result in the corresponding sales order being locked whenever the delivery is confirmed.
* For mass locking, we have to add a server action.
1- Enable developer mode
2- Go to Settings > Technical > Server Actions
3 - Add new server action.
Action name: Mass Lock Sale Order
Model: Sales Order
Action Do: Execute Python code
Python Code :
for record in records:
action = record.action_done()
Click the 'Create Contextual Action' button
4- Go to sales orders and filter all the orders that are to be locked.
To get all delivered orders, add the following filter.
5- Select all the orders and click on the 'Mass Lock Sale Order' from the action menu.
6- You can see all the selected orders are now turned to locked state.
For more information, refer to the following
* https://www.cybrosys.com/blog/how-to-lock-confirmed-orders-in-odoo-16-sales-module
*https://youtu.be/DJ-V1ZLYcu0?si=1WdYlGnHgSgy7vmE
Hope it helps.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 12 24
|
1339 | ||
|
2
thg 4 25
|
1891 | ||
|
0
thg 4 25
|
1167 | ||
|
0
thg 3 25
|
1076 | ||
|
1
thg 3 25
|
1567 |