I need to create a "reset" automated action for unset file which have been uploaded with a form in python code.
At the time this is what I have :
for rec in records:
rec['x_studio_proposition_bu_director'] = False
rec['x_studio_proposition_ceo'] = False
rec['x_studio_legal_proposition_approval'] = False
rec['x_studio_rnd_check'] = False
rec['x_studio_marketing_approval'] = False
rec['x_studio_rnd_comments'] = ""
rec['x_studio_marketing_comments'] = ""
remove(rec['x_studio_quote_file'])
rec['x_studio_proposal_file'] = ""
rec['x_studio_special_legal_attachment'] = ""
I'm trying some tests but I want to unset x_studio_quote_file, x_studio_proposal_file and x_studio_special_legal_attachment. Other fields are unchecked or text emptied.
,How Can I do that ?
And before empty the fields, possible to copy the name of the file to another field(text by example) or better: create a new empty file field with new label (for keep historic) ?
Thanks Chris !
but rec['x_studio_proposal_file'] = False doesn't work for delete an attachment
I tested it again in Odoo 12 and 13 and both images and file attachments disappear after the Automated Action is run. I will document it.