Hi,
When I try to search multiple orders in the order list, if the order does not exist, odoo doesn't show any message like: order XXX not found. So I may think the order is there.
So How to raise a message to notice me?
Thanks.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
When I try to search multiple orders in the order list, if the order does not exist, odoo doesn't show any message like: order XXX not found. So I may think the order is there.
So How to raise a message to notice me?
Thanks.
Hi,
For this you can raise a warning message in your custom code if the searched record doesn't exist.
For example:
If you are searching for sale order with name 'order_ref', you can add as below
from odoo.exceptions import UserError
class SaleOrder(models.Model):
_inherit = 'sale.order'
def search_sale_order(self):
order_id = self.env['sale.order'].search([('name', '=', 'order_ref')])
if not order_id:
raise UserError(_("Order Not Found !"))
Thank you
Hi Mehjabin.
But how to apply this "search_sale_order" function to the search function?
I have tried to make an add-on with your code, but it doesn't work.
I think 'order_ref' may be wrong. Can you give more hints please?
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 | |
---|---|---|---|---|
Create a message not a note
Đã xử lý
|
|
1
thg 11 20
|
2113 | |
|
4
thg 7 24
|
15082 | ||
|
1
thg 6 22
|
6183 | ||
|
1
thg 4 22
|
3120 | ||
Javascript warning message
Đã xử lý
|
|
1
thg 3 21
|
7371 |