Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
835 Prikazi

I have a form and a notebook tree , not save the form with the empty line of notebook.

in that notebook must a field

Avatar
Opusti
Best Answer

Hi,

You can achieve it using python constrains. See more about constrains here: https://www.youtube.com/watch?v=50cecNF3OyQ

In your case, you can add a constrain as follows in your main model:

@api.constrains('line_ids')
def _check_lines(self):
for record in self:
if not record.line_ids:
raise ValidationError(_("Warning Message!."))


Update line_ids with your o2m field name and validation message as per your use case.

Thanks

Avatar
Opusti