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

Module: Property Management System

Entity: pms.property

Compute Method: _compute_laundry_room

Inputs Method Outputs
for rec in self:
            room_type_id = self.env.ref(
                "pms_base.pms_room_type_laundry", raise_if_not_found=False
            )
            amenity_type_id = self.env.ref(
                "pms_base.pms_amenity_type_3", raise_if_not_found=False
            )
            room_count_laundry = len(
                rec.room_ids.filtered(lambda x, _t=room_type_id: x.type_id == _t)
            )
            amenity_count_laundry = len(
                rec.amenity_ids.filtered(lambda x, _t=amenity_type_id: x.type_id == _t)
            )
            if room_count_laundry or amenity_count_laundry:
                rec.laundry_room = True
            else:
                rec.laundry_room = False

Back to entity