Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: France - E-Invoicing (Approved Platform)

Entity: l10n.fr.pdp.reports.flow

Compute Method: _compute_payload_attachment

Inputs Method Outputs
  • res_id
  • id
"""Compute the payload attachment record linked to this flow."""
attachments = self.env['ir.attachment'].search([
            ('res_model', '=', self._name),
            ('res_id', 'in', self.ids),
            ('mimetype', '=', 'application/xml'),
            ('name', 'not like', 'message.%'),
        ], order='id desc')
attachments_map = {}
for attachment in attachments:
            attachments_map.setdefault(attachment.res_id, attachment)
for flow in self:
            flow.payload_id = attachments_map.get(flow.id)

Back to entity