I am using odoo 12 community version
beginner. please help
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
If you are looking to clear data entered in the one2many field and date field, you can try the below code,
@api.multi
def action_clear(self):
for rec in self:
rec.write({'order_line': [(5, 0, 0)],
'validity_date': ''})
Here in the above code, order_line is the One2many field and validity_date is the date field.
Thanks
thx you saved a day!
Thanks, but what about the date field?
See the updated answer
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.