Using pyodata with old MS CRM 2015
See original GitHub issueHi,
Thank you for this wonderfull piece of code. pyodata can also be used successfully with MS CRM 2015 with 2 minors changes :
- the first one is to change PATCH method by MERGE Method in service.py (MS CRM 365 is now using PATCH)
- the second one is a small try/catch in EdmStructTypeSerializer.from_json to avoid some None result that raise an exception (At the end of this report)
Is there a way to integrate these changes in a vendor specific python file as it exists for SAP ?
Change made in def from_json(edm_type, value):
if type_prop.name in value:
> try:
result[type_prop.name] = type_prop.typ.traits.from_json(value[type_prop.name])
> except (TypeError, AttributeError):
> modlog().warning(value)
return result
This catchs the following errors in MS CRM 2015 to trap None ‘Value’ :
WARNING:pyodata.model:{'__metadata': {'type': 'Microsoft.Crm.Sdk.Data.Services.EntityReference'}, 'Id': 'f3d1cca6-0313-e711-80be-005056011e04', 'LogicalName': 'systemuser', 'Name': None} WARNING:pyodata.model:{'__metadata': {'type': 'Microsoft.Crm.Sdk.Data.Services.EntityReference'}, 'Id': None, 'LogicalName': None, 'Name': None} WARNING:pyodata.model:{'__metadata': {'type': 'Microsoft.Crm.Sdk.Data.Services.OptionSetValue'}, 'Value': None}
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (10 by maintainers)
After merging of #102 this issue seems to be ready to be closed. @bip91 could you confirm that latest head 7972f31 works for you?
I will create release 1.5.0 soon.
Sorry for this erroneous first feedback, with a fully new fresh installation it works like a charm. Patch is working for me.