Update Azure table storage entity except one property - azure-storage

Requirement is up insert 10k records at time and avoid the one property.
When ever I am doing insert or merge it's overriding the existing property which is already process and updated in the entity.
Scenario :
We will receive records from API in the below format
{Name : "Item1-Test1","Color":"Blue"}
{Name : "Item1-Test2","Color":"Red"}
{Name : "Item1-Test3","Color":"Yellow"}
{Name : "Item1-Test4","Color":"White"}
We will add cost property while storing the in Azure table storage below (using for)
{Name : "Item1-Test1","Color":"Blue", Cost :"0"}
{Name : "Item1-Test2","Color":"Red", Cost :"0"}
{Name : "Item1-Test3","Color":"Yellow", Cost :"0"}
{Name : "Item1-Test4","Color":"White", Cost :"0"}
The cost column is processed in code and will be updated based on the requirement as below
(querying cost = 0 and updating the records )
{Name : "Item1-Test1","Color":"Blue", Cost :"100"}
{Name : "Item1-Test2","Color":"Red", Cost :"250"}
{Name : "Item1-Test3","Color":"Yellow", Cost :"100"}
{Name : "Item1-Test4","Color":"White", Cost :"1000"}
We might receive same entity again if we hit the API again. So we are manually manually query the each row to verify that record exist or not in the Azure table and we updating updating the properties other than cost.
As we are receiving more record around 10k to 100k.The verification is consuming more time while insertion.
Challenge faced:
If we skip the cost property while inserting entity newly, we are not able query on the records.
If we add the cost property while inserting it's overriding the existing cost value.

Related

Realm - insert object at the beginning of table

I insert/update my Realm database like this:
Realm.getDefaultInstance().use {
realmInstance -> realmInstance.executeTransaction {
realm -> realm.insertOrUpdate(data)
}
}
But this puts newly added data at the end of the table content. How can I put the data at the beginning?
Respone from API:
Latest item
Other items
Scenerio A: This is the first time I receive items from API. I insert them in database in the same exact order.
After a while, I've to send the latest item from my local storage. Usually this would be the last item in local database, but as the list is in reverse order from API, I've to send the first item (you can see order of list). Well. After some while I get a new data from API. We insert in database. From this moment, the latest item will be always the last one in database. I could avoid this mess if I just always knew, that the latest item would be the very first item. It would work for both cases.

How to update external_id for partners/companies and Where is default external_id is generating in odoo?

I want to update all the external ids of res.partner in system while creating partners using create() method. Also, I am not getting the functionality where the default external id name(res_partner_id) is generating.
Example :
Default generated external_id : res_partner_[id]
External id to be updated : abcd_res_partner_country_id_[id]
An External ID is an identifier for a data record. The mechanism behind this is quite simple: Odoo keeps a table with the mapping between the named External IDs and their corresponding numeric database IDs. That is the ir.model.data model.
To inspect the existing mappings, go to the Technical section of the Settings menu, and select the Sequences & Identifiers | External Identifiers menu item.
Recommended link: https://www.odoo.com/forum/help-1/question/how-to-update-external-id-50395

Podio External ID change

We use an external setup that sends information on our orders into Podio and from there we manage them. We have had an issue with our Email field and it's lead to the External ID 'email' being lost (we are up to email-6' now before realising the issue). Is it possible to reset/restore the External ID to be 'Email' instead of 'Email-6' and if so could you please point to how we can do it. The developers we use don't work with us anymore so it's a bit of a nightmare to sort out. We are reasonably tech savvy but not wiz kids by any stretch of the imagination. I've copied below what our old developers said:
"What I'm pretty sure is your case, is that you have deleted the original Email field from the template, and now you are trying to put it back. The problem is that, only by appearance, you have a single Email field in your template, but when Fabnami is sending the data, the collected customer email is attached to the field with external ID "email", not the one you have only labeled as Email. The result is that podio will exhume the deleted field and will display it using the last labels it has. In your case there will be the original field with label "Email" and ExternalID "email" plus a second empty field with label "Email" but different External ID."
I hope you can help :)
Each time, when the field get created, external_id get created in parallel(1 to 1 mapping). If you delete the field the external id get deleted along with that. You can't reset the external id "email" to "email-6".
There is a option to recover the first deleted field "Email" -> external is id "email", but with the recovery payment.
Each time, when the field get created, external_id get created in parallel. If you delete the field the external id get deleted along with that. You can't reset the external id "email" to "email-6".
There is a option to recover the first deleted field "Email" -> external is id "email", but with the recovery payment.

Where are the calculated fields from Odoo stored in the sql server when stored is set to true

If I create a new field on a model, making it a calculated or related field, and set the store parameter to be true. When I look on the sql server using pg admin, on the table itself, i can't fiend the field. I think this would be logic if the data entered wouldn't be stored, but calculated each time it was shown on a view (from, tree, ...).
Example in the POS orderline the field tax_ids is a calculated / related field. The tax_id is stored, because if I change the id on product level, it doesn't affect the order line, when consulting it after changing the tax id. So this data is stored. But when I try to find the field in the pos_order_line model on the sql server it doesn't show on the pos orderline. In odoo, settings models, it does show on the pos_order_line model. So where does odoo store the data?

Mongo db . Read records while maintaining last readrecord information

My problem is as follows : On a daily basis , records are appended into the Mongo database . There is no specific column for showing timestamp or id (The user has designed the table thus). Whilst retrieving records from the database , is there any meta information (such as the BSON document_id) which will help to retrieve records based on a certain time range (11-12-2013 to 12-12-2013 ). ?
Timestamp can be extracted from ObjectId Mongo dcs
More details here