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

Module: Geospatial support for base_geolocalize

Entity: res.partner

Compute Method: _compute_geo_point

Inputs Method Outputs
  • partner_latitude
  • partner_longitude
"""
        Set the `geo_point` of the partner depending of its `partner_latitude`
        and its `partner_longitude`
        **Notes**
        If one of those parameters is not set then reset the partner's
        geo_point and do not recompute it
        """
for rec in self:
            if not rec.partner_latitude or not rec.partner_longitude:
                rec.geo_point = False
            else:
                rec.geo_point = fields.GeoPoint.from_latlon(
                    rec.env.cr, rec.partner_latitude, rec.partner_longitude
                )

Back to entity