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.batch

Compute Method: _compute_l10n_ar_delivery_guide_buttons

Inputs Method Outputs
  • state
  • picking_type_id
  • picking_type_id.l10n_ar_document_type_id
  • picking_ids
for batch in self:
            is_done = batch.state == 'done'
            has_doc_type = bool(batch.picking_type_id.l10n_ar_document_type_id)
            batch.l10n_ar_show_generate_delivery_guide = (
                has_doc_type and is_done and any(batch.picking_ids.mapped('l10n_ar_allow_generate_delivery_guide'))
            )
            batch.l10n_ar_show_send_delivery_guide = (
                has_doc_type and is_done and any(batch.picking_ids.mapped('l10n_ar_allow_send_delivery_guide'))
            )

Back to entity