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

Module: Pos Attachment

Entity: pos.order

Compute Method: _compute_attached_docs_count

Inputs Method Outputs
  • id
Document = self.env["ir.attachment"]
for order in self:
            order.doc_count = Document.search_count(
                [
                    ("res_model", "=", "pos.order"),
                    ("res_id", "=", order.id),
                ]
            )

Back to entity