While parsing modifiers for field city: for modifier "readonly": Unknown field type in domain - odoo

Working on a module for Odoo 14 CE
My module depends from another module called "base_locations"
base_locations extends the functionalities related to inserting data about cities and regions in the standard Odoo but it's distributed by the Odoo Community Association, so I assume it's pretty standard stuff
In one of my views I have a "city" field
<field name="city"/>
The field "city" is defined in a model belonging to the base_location module
But when I try to access the view, this error pops up in the web GUI
Error: While parsing modifiers for field city: for modifier "readonly": Unknown field type in domain
_registerModifiers#http://localhost:8069/web/static/src/js/views/basic/basic_renderer.js:633:23
_renderFieldWidget#http://localhost:8069/web/static/src/js/views/basic/basic_renderer.js:727:30
_renderFieldWidget#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:530:21
OdooClass.extend/</prototype[name]</<#http://localhost:8069/web/static/src/js/core/class.js:90:38
_renderInnerGroupField#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:677:24
_renderInnerGroup/<#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:641:29
_renderInnerGroup#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:613:23
_renderTagGroup#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:866:25
_renderNode#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:722:29
_renderNode#http://localhost:8069/mail/static/src/widgets/form_renderer/form_renderer.js:140:21
OdooClass.extend/Class.include/</prototype[name]</<#http://localhost:8069/web/static/src/js/core/class.js:123:38
_renderTagForm#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:852:38
_renderNode#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:722:29
_renderNode#http://localhost:8069/mail/static/src/widgets/form_renderer/form_renderer.js:140:21
OdooClass.extend/Class.include/</prototype[name]</<#http://localhost:8069/web/static/src/js/core/class.js:123:38
_renderView#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:1054:26
_render#http://localhost:8069/web/static/src/js/views/abstract_renderer.js:141:20
_render#http://localhost:8069/web/static/src/js/views/basic/basic_renderer.js:675:20
OdooClass.extend/</prototype[name]</<#http://localhost:8069/web/static/src/js/core/class.js:90:38
start#http://localhost:8069/web/static/src/js/views/abstract_renderer.js:55:33
OdooClass.extend/</prototype[name]</<#http://localhost:8069/web/static/src/js/core/class.js:90:38
start#http://localhost:8069/web/static/src/js/views/form/form_renderer.js:53:28
OdooClass.extend/</prototype[name]</<#http://localhost:8069/web/static/src/js/core/class.js:90:38
_widgetRenderAndInsert/<#http://localhost:8069/web/static/src/js/core/widget.js:440:25
If I comment out this city field, the view works
How do I go about this error message ?
Especially the first line is quite obscure to me
Error: While parsing modifiers for field city: for modifier "readonly": Unknown field type in domain
which parsing phase is this referring to, exactly ?
And field type ? Domain ?
I don't get what this mesage is refering to

Related

Sulu: Entity has no field or association error

I'm following Sulu example here: https://github.com/sulu/sulu-workshop/
trying to set translations for custom entity type.
My entity file has getter for field "home_team" defined like:
/**
* #Serializer\VirtualProperty(name="home_team")
*/
public function getHomeTeam(): ?string
{
$translation = $this->getTranslation($this->locale);
if (!$translation) {
return null;
}
return $translation->getHomeTeam();
}
So field is not actually part of that entity, but of it's translation entity since it suppose to be translatable.
When I try to create new object of that entity type it works well. I can see in database that field values are stored well and I don't get any error.
But on overview page instead of list of all objects I get error:
[Semantical Error] line 0, col 73 near 'home_team AS': Error: Class App\Entity\MatchEvent has no field or association named home_team
Any idea what could be wrong here?
If you wanna see the translation in the listView you have to create a real translationEntity, like in the workshop project. In this post it is already explained, how to translate a custom entity correctly.
If you have already created your translationEntity you have to configure the relation of the translation to your main entity via a join. Here is an example in the workshop for this configuration.
Sulu uses optimised queries to create the list-object directly from the database. So the entity itself does not get hydrated or serialised for performance reasons. Thus your virtualProperty is never executed.

How to create an upsert bulk job for 'Account' object in Salesforce? what will be the externalIdFieldName?

I tried with the below body(payload) to create an upsert bulk job for Account push to Salesforce.
{
"object" : "Account",
"externalIdFieldName":"Website",
"contentType" : "CSV",
"operation" : "upsert",
"lineEnding" : "LF"
}
However, I receive an error as below, unable to find a way out. Could you please help with the correct 'externalIdFieldName' ??
[
{
"errorCode": "INVALIDJOB",
"message": "InvalidJob : Field name provided, website does not match an External ID, Salesforce Id, or indexed field for Account"
}
]
As the message states, Account.Website does not meet the qualifications to be used to upsert. A field used for upsert matching must be the Id field, or must be indexed, or have the Id Lookup property, none of which this field possesses.
You can look up these properties for standard fields in the SOAP Reference. Other than Id, there aren't any standard fields you can upsert against on Account; you'll be limited to custom fields that have the External Id property set (making them indexed).
For contrast, see Contact, where Email has the idLookup property and can be an upsert target.

Change/Update Field name in the NiFi Schema Text property Across various parallel flows

I have few identical parallel flows(as shown in screenshot). I have convertRecord in each of the identical flows and in the Record Reader I have used "Schema Text Field Property" as access strategy and specified the "Schema text". For Example:
{
"type": "record",
"name": "AVLRecord0",
"fields" : [
{"name": "TimeOfDay", "type": "string", "logicalType":"timestamp-millis"},
{"name":"Field1", "type": "double"},
{"name":"Field2", "type": "double"},
{"name":"Field3", "type": "double"},
{"name": "Filename", "type": "string"}
]
}
Lets say the above schema I have used across various parallel flows ConvertRecord, and now I want to update one field name from Field to Field_Name so is there any way I can do it in one go across all the convert record Schema Text?
If I want to change/update one of the Field in the schema Text do I have to change/Update the field name in each processor manually? Or there is a global way that will change the field name across all the parallel flow I have?
Is there Any way that I can update the Schema Text across various processors In one go?
Any help is much appreciated! Thanks
As you are using Schema Text Field Property so you need to change in all ConvertRecord processor manually.
Try with this approach:
In ConvertRecord processor use Schema Access Strategy as
Use Schema Name Property
Then set up AvroSchemaRegistry and define your schema by adding new property
I have added sch as schema.name and defined the avro schema.
After GetFile Processor use UpdateAttribute processor and add schema.name attribute(for ex: with value sch) to the flowfile.
Now in reader controller service use the Schema Access strategy as Use Schema Name Property and Schema Registry asAvroSchemaRegistry` that has already setup.
By following this way we are not defining schema on all ConvertRecord processors instead we are referring to same schema that defined in AvroSchemaRegistry in case if you want to change one field name it is easy to go into Registry and change the value.
Flow:
1.GetFile
2.UpdateAttribute //add schema.name attribute
3.ConvertRecord //define/use AvroSchemaRegistry and access strategy as schemaname property
..other processors
Refer to this link for more details regards to defining/using AvroSchemaRegistry.

What is an opaque type in Elm and why is it valuable?

I've used types before but don't know what an opaque type is. I've seen it mentioned as well. Is it better to expose an opaque type than a type alias?
Let’s answer this question by first looking at type aliases:
A type alias is fully transparent. This means that any other module importing it will have full access to its inner workings. Let’s say we’ve got a User module exposing a User type:
module User exposing User
type alias User =
{ userName : String
, age : Int
}
Anyone importing User can manipulate the data, e.g. newUser = { oldUser | age = 25 }. Or do someUser = User "Bill" 27. These manipulations are fine when you have control over the context that they exist in.
However, if User is part of a library then every change to the User type is a breaking change to people that use the library. For example, if an email field is added to User, then the constructor example (someUser = User "Bill" 27) will give a compiler error.
Even inside of a project codebase, a type alias can provide too much information to other modules which leads to code that is difficult to maintain and evolve. Perhaps a User changes drastically at some point and has a completely new set of properties. This would require changes wherever the code manipulates Users.
Opaque types are valuable because they avoid these issues. Here’s an opaque version of User:
module User exposing User
type User =
User
{ userName : String
, age : Int
}
With this version, other modules cannot access or manipulate the data directly. Often, this means you will make and expose some getter and functions:
initUser : String -> Int -> User
userName : User -> String
age : User -> String
setAge : Int -> User -> User
This is more work, but it has advantages:
Other modules only care about the User functions and don’t need to know what data is in the type
The type can be updated without breaking code outside the containing module
Much of this explanation comes from #wintvelt: elmlang.slack.com

Element ':item' contains data from a type that maps to the name 'http://...:Location'. The deserializer has no knowledge of any type that maps to thi

I'm writing code to consume the Bing Geocode service (Bing Maps), and I am successfully able to pull JSON data via wcf, unfortunately I seem to be unable to map a piece of the data returned.
I created all the appropriate DataContracts as needed and populated them with the required members, but I when I start getting into the children I get the following error:
Element ':item' contains data from a type that maps to the name 'http://schemas.microsoft.com/search/local/ws/rest/v1:Location'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'Location' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.
So I commented out the "children" objects, and was basically able to discern that it was blowing up when it tries to read the 'Location' part of the JSON object
in my code below, it concerns the part here:
"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",
for what its worth, the url is bad, but I don't care. I don't want to use that type (which apparently maps back to a schema at Microsoft's website). Is there a way to tell WCF to ignore that link? Its not like I can.
What Bing returns
{
"authenticationResultCode":"ValidCredentials",
"brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png",
"copyright":"Copyright © 2010 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
"resourceSets":[
{
"estimatedTotal":1,
"resources":[
{
"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1",
"bbox":[
47.635884282429323,
-122.13737419709076,
47.643609717570676,
-122.12208780290925
],
"name":"1 Microsoft Way, Redmond, WA 98052-8300",
"point":{
"type":"Point",
"coordinates":[
47.639747,
-122.129731
]
},
"address":{
"addressLine":"1 Microsoft Way",
"adminDistrict":"WA",
"adminDistrict2":"King County",
"countryRegion":"United States",
"formattedAddress":"1 Microsoft Way, Redmond, WA 98052-8300",
"locality":"Redmond",
"postalCode":"98052-8300"
},
"confidence":"High",
"entityType":"Address"
}
]
}
],
"statusCode":200,
"statusDescription":"OK",
"traceId":"43c6a4dc130749bbb14eb72bf12c4198 "
}
Found it. Its because I had to accomodate for the ref'd __type in my data contract (it needed to know what type to use. The solution was this:
[DataContract(Namespace = "http://schemas.microsoft.com/search/local/ws/rest/v1", Name="Location")]
btw, I found the answer here
: Problem with deserializing JSON on datamember "__type"