def METHOD_NAME(self, xml):
    file_name = "NFe%s.xml" % self.dfe_id.last_nsu
    self.attachment_id = self.env["ir.attachment"].create(
        {
            "name": file_name,
            "datas": base64.b64encode(xml),
            "store_fname": file_name,
            "description": "NFe via Manifesto",
            "res_model": self._name,
            "res_id": self.id,
        }
    )