Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2832 Переглядів

Hello everyone, sorry for the inconvenience and sorry for being a newbie.

I have a checkbox field, this checkbox when it is not selected, shows its corresponding fields, when it is selected, it shows other fields that are corresponding to the checkbox in true.


What I want to do is that if the user selects the checkbox, the user can continue filling the form with respect to the checkbox set to true, but once the form is filled, if the user tries to fill the fields that are in the checkbox set to false, Odoo launches an alert where you mention that if you are sure to change the fields to False, if the user accepts, that all the information that I filled in the checkbox to true will be deleted... the same would also apply in reverse...
Is there a way to be able to do this?
Thanks, Odoo 14 community.
Sorry for the inconvenience.

Аватар
Відмінити
Найкраща відповідь

class ABC(models.Model):
_name = 'abc'


@api.onchange('checkbox_field')
def onchange_checkbox_field(self):
return action_of_wizard


class wizard(models.Transient):

def action_confirm:
# get the active id and model
# make all fields related to the checkbox false


views of wizard has a text line of you intended message

Аватар
Відмінити
Автор

Thanks!

Related Posts Відповіді Переглядів Дія
2
серп. 25
2471
3
лют. 25
3791
0
трав. 24
46
1
квіт. 24
3510
4
вер. 23
5045