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

Module: Argentinean - Stock

Entity: stock.picking

Compute Method: _compute_l10n_ar_delivery_guide_flags

Inputs Method Outputs
"""
        Compute flags for allowing delivery guide generation and sending.
        - Generation allowed if: state is 'done', document type exists, and no guide number.
        - Send allowed if: guide number exists on outgoing pickings.
        """
for picking in self:
            has_doc_type = bool(picking.picking_type_id.l10n_ar_document_type_id)
            picking.l10n_ar_allow_generate_delivery_guide = (
                picking.state == 'done' and has_doc_type and not picking.l10n_ar_delivery_guide_number
            )
            picking.l10n_ar_allow_send_delivery_guide = picking.l10n_ar_delivery_guide_number and picking.picking_type_id.code == 'outgoing'

Back to entity