Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

i want when hubspot_update_response is 200 the hubspot id is store into odoo. how can i get this..?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
pythonodoo
1 Respondre
1754 Vistes
Avatar
Ketul patel

i write a python code. i want when hubspot_update_response is 200 the

 hubspot id is store into odoo. how can i get this..? 

i was try but i am getting following error.. "ERROR: could not serialize

 access due to concurrent update"

here is my code..

if hubspot_search_data["total"] > 0:
# Contact already exists, update instead of creating a new one
hubspot_contact = {
"id": hubspot_search_data["results"][0]["id"],
"properties": {
"firstname": odoo_contact["name"],
"phone": odoo_contact["phone"],
"hubspot_hash": odoo_hash,
}
}
update_data = {
"inputs": [hubspot_contact]
}

hubspot_update_url = f"{hubspot_headers['base_url']}/crm/v3/objects/{hubspot_headers['model_name']}/batch/update"
hubspot_update_response = requests.post(hubspot_update_url, headers=hubspot_headers,
json=update_data)

if hubspot_update_response.status_code == 200:
hubspot_id = hubspot_update_response.json()["results"][0]["id"]
partner = self.env['res.partner'].search([('id', '=', odoo_contact["id"])], limit=1)
if partner:
partner.write({'hubspot_id': hubspot_id})
print(
f"Hubspot ID {hubspot_id} has been stored in the Odoo database for contact {odoo_contact['email']}")
else:
print(f"Error: Cannot find contact with ID {odoo_contact['id']} in Odoo database.")

here is my update data :

---- update_data------ {'inputs': [{'id': '17151', 'properties': {'firstname': 'hubspot6', 'phone': '123456781111', 'hubspot_hash': '3e2e37f16d4999807b6b16ac818a07788ff9f1b8d9fdf69e2331e2fb91d16282'}}]}

but it can't update hubspot_id value in odoo database.

and i am getting following error..

2023-03-31 05:43:26,273 15919 INFO integrationextra odoo.addons.base.models.ir_cron: Job `Contacts Scheduler` done. 
2023-03-31 05:43:26,274 15919 ERROR integrationextra odoo.sql_db: bad query: UPDATE "res_partner" SET "hubspot_id" = '17351', "write_date" = '2023-03-31 05:43:03.555219', "write_uid" = 1 WHERE id IN (415)
ERROR: could not serialize access due to concurrent update

0
Avatar
Descartar
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

The error says about the issue of concurrent update, you can try the same once again and see how it goes. When the postgres is loaded with many operations, like lets say, concurrent updating of same data, this is raised.

Try the same again and see how it goes.


Also make sure the data type of hubspot_id in the partner model and the value you are writing is of same data type.

Thanks

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Save filtered tree view to load as it is at another time Solved
python odoo
Avatar
Avatar
Avatar
2
d’ag. 25
3638
Private functions and public functions in odoo python Solved
python odoo
Avatar
Avatar
Avatar
Avatar
3
de febr. 25
5096
odoo ghost module
python odoo
Avatar
0
de maig 24
46
Call python method from inherit_id attribute
python odoo
Avatar
Avatar
1
d’abr. 24
4400
how Restrict users to see only his own invoice ?
python odoo
Avatar
Avatar
Avatar
Avatar
Avatar
4
de set. 23
6362
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now