Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Problem with @api.model_create_multi on res.partner in odoo.sh, Odoo 16

Naroči se

Get notified when there's activity on this post

This question has been flagged
ORModoo16features
2 Odgovori
4056 Prikazi
Avatar
ABDOU NASSER

As we all know, @api.model_create_multi allows us to insert or create values at once from a list, instead of doing it one by one. As example, if we have:

values = [{...}, {...}]

Doing

record.create(values)

is better than

for val in values:
    record.create(val)

The other thing to take into consideration is that regarding the res.partner model, everywhere there is a create() method, it has the decorator @api.model_create_multi which allows us to pass a list of values to res.partner when we want to create records.

Now, the problem we are facing (only in odoo.sh) is that we are creating some partners from some data we take to another system via a connector. Those data are coming fine, and we have a list of all required data we are passing to the create().

If we have 5 contacts, the action we are calling will create only one contact and then one other, and then another one, etc... but in our local it's working fine, all the 5 contacts are created at once.

Here is the code: https://gist.github.com/nasser-bloopark/dfe8c5b42d6f2bd84ae37aafc0e4f468

After some investigations, we found that the issue is in the line destination_model.create(create_values).

Note that we didn't override the method create() anywhere, and we are using the OCA module partner_firstname as dependency to this custom module.

So, my question is: is there something I missed here or some other tips we can use from the ORM to fix this issue ?

0
Avatar
Opusti
Avatar
Stanislas Gueniffey (stgu)
Best Answer

Hello Abdou Nasser,
May I recommend to open a ticket ?
The code you provide seems unrelated to the issue you describe. As you expect since you say the problem only occurs in odoo.sh. Therefore it's hard to debug something like this.

Generally speaking, I would expect records to be created one by one if there's inter-dependency among the created records or if a sequence is used in their creation.

Also generally speaking, your odoo.sh instance may have less resources, for example less available threads.

I see the module partner_firstname does override the create() method, but if it works properly in local that shouldn't be the issue.

0
Avatar
Opusti
ABDOU NASSER
Avtor

Thank you Stanislas Gueniffey
I have contacted the odoo support and waiting
For now, i have put the create() in the for loop

Avatar
Pedro M. Baeza
Best Answer

Check if any of the code you have in the instance is overwriting the create method of res.partner and mangling the super calling.

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

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
DeprecationWarning: The longpolling-port is a deprecated alias to the gevent-port option, please use the latter Solved
odoo16features
Avatar
Avatar
Avatar
Avatar
Avatar
5
sep. 25
25303
How to Add wizard under print button inside the form view.
odoo16features
Avatar
Avatar
Avatar
Avatar
3
avg. 25
3858
How to add @api.onchange in _get_view() method odoo 16
odoo16features
Avatar
Avatar
1
maj 25
3759
get all partners which are internal users or portal users odoo16
odoo16features
Avatar
Avatar
1
apr. 25
4607
How to add decoration color green with bold to a record with a single conditon
odoo16features
Avatar
Avatar
1
apr. 25
5427
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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