Hello and good day.
I want to ask and consult if there are any ways, through back-end or front-end, to disable 'Ok' in the Confirmation wizard so that it won't be clicked twice. Clicking the 'Ok' causes record inconsistencies, allowing multiple records to be created or modified.
Thank you so much!
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,
Please refer to the code:
from odoo import models, api
from odoo.exceptions import UserError
class YourWizard(models.TransientModel):
_name = 'your.wizard'
@api.model
def action_confirm(self):
if self.env.context.get('already_confirmed', False):
raise UserError("This wizard has already been confirmed!")
# Prevent double processing
self = self.with_context(already_confirmed=True)
# Your confirmation logic here
# e.g., create records, update records
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 | |
---|---|---|---|---|
|
3
thg 8 22
|
9531 | ||
|
9
thg 11 22
|
11042 | ||
|
1
thg 8 22
|
8204 | ||
|
3
thg 8 22
|
6428 | ||
|
1
thg 7 22
|
12153 |