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

Module: Field Service Address No Change

Entity: fsm.order

Compute Method: _compute_location_id_fields

Inputs Method Outputs
  • location_id
  • stage_id
  • location_id.territory_id
  • location_id.branch_id
  • location_id.district_id
  • location_id.region_id
  • location_id.street
  • location_id.street2
  • location_id.zip
  • location_id.city
  • location_id.state_id
  • location_id.state_id.name
  • location_id.country_id
  • location_id.country_id.name
for rec in self:
            if rec.location_id and rec.stage_id != self.env.ref(
                "fieldservice.fsm_stage_completed"
            ):
                rec.territory_id = rec.location_id.territory_id
                rec.branch_id = rec.location_id.branch_id
                rec.district_id = rec.location_id.district_id
                rec.region_id = rec.location_id.region_id
                rec.street = rec.location_id.street
                rec.street2 = rec.location_id.street2
                rec.zip = rec.location_id.zip
                rec.city = rec.location_id.city
                rec.state_name = rec.location_id.state_id.name or False
                rec.country_name = rec.location_id.country_id.name or False

Back to entity