-
Notifications
You must be signed in to change notification settings - Fork 269
[16.0][IMP] fieldservice_geoengie: Fix vector Layer related Errors #1453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 16.0
Are you sure you want to change the base?
Conversation
ce2da70 to
d73c57e
Compare
d73c57e to
905d4ab
Compare
905d4ab to
be19652
Compare
HekkiMelody
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review, LGTM
| SUPPORTED_ATT = [ | ||
| "float", | ||
| "integer", | ||
| "integer_big", | ||
| "related", | ||
| "function", | ||
| "date", | ||
| "datetime", | ||
| "char", | ||
| "text", | ||
| "selection", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chore (non-blocking): I see these elsewhere in the code as well, but I suspect they may have remained from previous versions, as I cannot find values of ttype matching some of these.
On a fresh odoo installation, opening a shell and inspecting env["ir.model.fields"]._fields["ttype"].selection I get the following fields
['binary', 'boolean', 'char', 'date', 'datetime', 'float', 'html', 'integer', 'json', 'many2many', 'many2one', 'many2one_reference', 'monetary', 'one2many', 'properties', 'properties_definition', 'reference', 'selection', 'text', 'serialized']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env["ir.model.fields"]._fields["ttype"].selection - list all available ttype values.
fieldservice_geoengine supports only fields based on SUPPORTED_ATT and NUM_ATT which is used in domain to filter from ttype values.
ttype will not match the fields of supported_att and num_att variables and it should list all available types. ttype list seems right and this is my understanding. Please correct me, if my views differ from your thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I probably wasn't very clear. I didn't mean to imply that fields should be added to SUPPORTED_ATT, but rather that some may be removed (maybe?), like integer_big, related and function.
Either way, non-blocking.
| rec.geo_repr == "colored" | ||
| and ( | ||
| rec.classification != "unique" | ||
| and rec.classification != "custom" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (non-blocking): readability
| rec.geo_repr == "colored" | |
| and ( | |
| rec.classification != "unique" | |
| and rec.classification != "custom" | |
| ) | |
| rec.geo_repr == "colored" | |
| and rec.classification not in ("unique", "custom") |
I would also add brackets for clarity
(rec.geo_repr == "colored"
and rec.classification not in ("unique", "custom"))
or ....There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as suggested
be19652 to
3634d45
Compare
Notifying user to define selected attribute_field_id of supported type from vector layer in infoBox template to avoid JS error. Addressed JS Error when supported data type even defined in geoengine view as well. When a field from attribute_field_id values selected from vector layer is not suitable for "custom" classification, it is notified to the user to avoid JS Error.Similarly for interval classification is also taken care. Domain for attribute_field_id is filter based on classification selection in vector layer to avoid JS Error.
3634d45 to
461ee9e
Compare




Depends on base_geoengine PR #417
Domain for "attribute_field_id" is filtered based on "classification" field selection in vector layer, which helps to avoid JS error seen as "fsm.order" and "fsm.location" related fields are not validated based on "NUM_ATT" types. base_geoengine_validation.
Notifying user to define selected field from attribute_field_id of supported type in geoengine view which avoids below JS error observed:

Notifying users when a field of supported type from attribute_field_id is not suitable to use for classification type "custom" which avoids below observed JS Error:

As fieldservice_geoengine omits validation for custom classification related to "type" check on field selected in "attribute_field_id", when user selects fields of type "date" with "custom", below JS error observed:
