Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Guest House
    • Drankenhandelaar
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Solar Energy Systems
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC Services
    Others
    • Nonprofit Organization
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

7.0 orm.py raises exeption on write -> split_for_in_conditions has changed !

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
ormopenerp7.0
2 Antwoorden
4472 Weergaven
Avatar
Joeri Belis

I installed latest 7 release from github. But were i had no problem with an older codebase of 7, i now ran into an exception raised in orm.py.

When i do a write in my custom module, orm.pay raises

  File "/home/openerp/openerp/odoo/openerp/addons/base/res/res_partner.py", line 536, in write
    result = super(res_partner,self).write(cr, uid, ids, vals, context=context)
  File "/home/openerp/openerp/odoo/openerp/addons/mail/mail_thread.py", line 297, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/home/openerp/openerp/odoo/openerp/osv/orm.py", line 4276, in write
    _('One of the records you are trying to modify has already been deleted (Document type: %s).') % self._description)


It all comes down to this piece of code in the orm.py. The 

cr.rowcount != len(sub_ids)

What could be a reason why the update would give a different rowcount vs the ids i need to update

 if len(upd0):
        self.check_access_rule(cr, user, ids, 'write', context=context)
        for sub_ids in cr.split_for_in_conditions(ids):
            cr.execute('update ' + self._table + ' set ' + ','.join(upd0) + ' ' \
                       'where id IN %s', upd1 + [sub_ids])
            if cr.rowcount != len(sub_ids):
                raise except_orm(_('AccessError'),
                                 _('One of the records you are trying to modify has already been deleted (Document type: %s).') % self._description)


0
Avatar
Annuleer
Axel Mendoza

post more about your scenario, like something of how to reproduce your bug

Avatar
Joeri Belis
Auteur Beste antwoord

Debugging some more i found that my ids have doubles in the list of ids

That would explain why the result from cr.rowcount = 997 and i have 1000 ids. the 3 doubles.

This is because split_for_in_conditions in sql_db.py changed between versions

from

    def split_for_in_conditions(self, ids):
"""Split a list of identifiers into one or more smaller tuples
safe for IN conditions, after uniquifying them."""
return tools.misc.split_every(self.IN_MAX, set(ids))

to:

    def split_for_in_conditions(self, ids):
"""Split a list of identifiers into one or more smaller tuples
safe for IN conditions, after uniquifying them."""
return tools.misc.split_every(self.IN_MAX, ids)

They removed the set() !

But any idea when and why this feature got changed!

And do i need to change my code to handle doubles in a list of ids i want to update?

or is this a bug that odoo is going to fix lowlevel?

0
Avatar
Annuleer
Joeri Belis
Auteur

[FIX] orm: ordering on >1000 records … https://github.com/odoo/odoo/commit/cb5f00f58016d087cf5387c3eadf9144f45a0397

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Education or School Management module is available for openerp 7.0? Opgelost
openerp7.0
Avatar
Avatar
2
feb. 24
29309
Security (6,0) and (4) in openerp Opgelost
openerp7.0
Avatar
Avatar
Avatar
Avatar
3
jun. 23
56977
Prestashop Odoo
openerp7.0
Avatar
0
jul. 22
3035
ORM Relationship in Odoo 12
orm
Avatar
0
sep. 19
98
Move or forward emails from Sales Pipeline to original Email Account
openerp7.0
Avatar
0
okt. 17
4204
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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