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
- Kirjanpito
- Varastointi
- PoS
- Project
- MRP
Tämä kysymys on merkitty
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.
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
RekisteröidyAiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
---|---|---|---|---|
|
3
elok. 22
|
9531 | ||
|
9
marrask. 22
|
11044 | ||
|
1
elok. 22
|
8205 | ||
|
3
elok. 22
|
6432 | ||
|
1
heinäk. 22
|
12155 |