I have a form and a notebook tree , not save the form with the empty line of notebook.
in that notebook must a field
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I have a form and a notebook tree , not save the form with the empty line of notebook.
in that notebook must a field
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
Create an account today to enjoy exclusive features and engage with our awesome community!
Prijavi