1) fix automatic creation of documents when attachments are added to product templates/variants chatters 2) fix duplication of documents 3) fix deletion of documents Delete child record before deleting parent record. Before this commit, when trying to delete a product document, we deleted the parent record first, before trying to delete the child, which had been deleted (cascade) already. Part-of: odoo/odoo#135894