Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions base_geoengine/i18n/base_geoengine.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-16 14:09+0000\n"
"PO-Revision-Date: 2026-09-16 14:09+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -540,6 +542,13 @@ msgstr ""
msgid "Params WMS"
msgstr ""

#. module: base_geoengine
#. odoo-javascript
#: code:addons/base_geoengine/static/src/js/views/geoengine/geoengine_renderer/geoengine_renderer.esm.js:0
#, python-format
msgid "Please update latitude and longitude details for: \"%s\""
msgstr ""

#. module: base_geoengine
#: model:ir.model.fields.selection,name:base_geoengine.selection__ir_model_fields__geo_type__point
msgid "Point"
Expand Down
21 changes: 14 additions & 7 deletions base_geoengine/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-04-08 12:45+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"POT-Creation-Date: 2026-09-16 14:09+0000\n"
"PO-Revision-Date: 2026-09-16 14:09+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.15.2\n"
"Plural-Forms: \n"

#. module: base_geoengine
#. odoo-python
Expand Down Expand Up @@ -562,6 +561,14 @@ msgstr "Parametri"
msgid "Params WMS"
msgstr "Parametri WMS"

#. module: base_geoengine
#. odoo-javascript
#: code:addons/base_geoengine/static/src/js/views/geoengine/geoengine_renderer/geoengine_renderer.esm.js:0
#, python-format
msgid "Please update latitude and longitude details for: \"%s\""
msgstr ""
"Si prega di aggiornare le coordinate di latitudine e longitudine per: \"%s\""

#. module: base_geoengine
#: model:ir.model.fields.selection,name:base_geoengine.selection__ir_model_fields__geo_type__point
msgid "Point"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ import {
} from "@web/model/relational_model/utils";
import {evaluateExpr} from "@web/core/py_js/py";
import {loadBundle, templates} from "@web/core/assets";
import {_t} from "@web/core/l10n/translation";
import {parseXML} from "@web/core/utils/xml";
import {rasterLayersStore} from "../../../raster_layers_store.esm";
import {registry} from "@web/core/registry";
import {sprintf} from "@web/core/utils/strings";
import {useService} from "@web/core/utils/hooks";
import {vectorLayersStore} from "../../../vector_layers_store.esm";

Expand Down Expand Up @@ -59,6 +61,7 @@ export class GeoengineRenderer extends Component {
this.view = useService("view");
this.user = useService("user");
this.fields = useService("field");
this.notification = useService("notification");

// For related model we need to load all the service needed by RelationalModel
this.services = {};
Expand Down Expand Up @@ -565,8 +568,22 @@ export class GeoengineRenderer extends Component {
/**
* When you click on a record in the RecordsPanel, this method is called to display the popup.
* @param {*} record
* @returns {false} when records does not coordinate details in it
*/
onDisplayPopupRecord(record) {
if (record.data && record.data.shape === false) {
this.notification.add(
sprintf(
_t('Please update latitude and longitude details for: "%s"'),
record.data.display_name
),
{
type: "warning",
}
);
this.clickToHidePopup();
return false;
}
const popup = this.getPopup();
const feature = this.vectorSource.getFeatureById(record.resId);
if (feature) {
Expand Down Expand Up @@ -737,7 +754,10 @@ export class GeoengineRenderer extends Component {
this.styleVectorLayerAndLegend(vector, data, layer);
this.useRelatedModel(vector, layer, data);
} else {
const data = this.props.data.records;
// Filter records with coordinates for styling vector layers & legends
const data = this.props.data.records.filter(
(record) => record.data[vector.geo_field_id[1]] !== false
);
this.styleVectorLayerAndLegend(vector, data, layer);
this.addSourceToLayer(data, vector, layer);
}
Expand Down Expand Up @@ -826,7 +846,10 @@ export class GeoengineRenderer extends Component {
this.styleVectorLayerAndLegend(cfg, data, lv);
this.useRelatedModel(cfg, lv, data);
} else {
const data = this.props.data.records;
const geo_field_id_name = cfg.geo_field_id[1];
const data = this.props.data.records.filter(
(record) => record.data[geo_field_id_name] !== false
);
if (!data.length) {
return new ol.layer.Vector({
source: new ol.source.Vector(),
Expand All @@ -853,10 +876,13 @@ export class GeoengineRenderer extends Component {

async getModelData(cfg, fields_to_read) {
const domain = this.evalModelDomain(cfg);
const geo_field_id_name = cfg.geo_field_id[1];
let data = await this.orm.searchRead(cfg.model, [domain][0], fields_to_read);
const modelsRecords = this.models.find((e) => e.model.resModel === cfg.model)
.model.records;
data = data.map((dat) => modelsRecords.find((rec) => rec.resId === dat.id));
data = data
.map((dat) => modelsRecords.find((rec) => rec.resId === dat.id))
.filter((rec) => rec.data[geo_field_id_name] !== false);
return data;
}

Expand Down
Loading