Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

RuntimeError: maximum recursion depth exceeded

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
error
2 Besvarelser
31306 Visninger
Avatar
Atchuthan

Hi guyz, I'm getting this error: RuntimeError: maximum recursion depth exceeded. But the code was working fine before sometime.

When I searched regarding this issue, many results pointed to execution time taken due to python and also explanations were difficult to understand.

Can anyone give me suggestion regarding this error.

In sample.py:

from osv import fields, osv
import time

class sample(osv.osv):
    def onchange_state(self, cr, uid, ids, state_id, context=None):
        if state_id:
            country_id = self.pool.get('res.country.state').browse(cr, uid, state_id, context).country_id.id
            return {'value':{'country_id':country_id}}
        return {}   
    def _calculate(self, cr, uid, ids, fields, arg, context):
        x={}
        for record in self.browse(cr, uid, ids):
            x[record.id]= record.field_a + record.field_b
        return x
    _name = "sample"
    _table = "sample"
    _rec_name = "name"
    _log_access = True
    _description = "Simple Form"
    _columns = {
             'name':fields.char('Name', size=32, required=True),
             "age" : fields.integer("age"),
             "length": fields.integer("length"),    
             'address': fields.text('Address'),
             'flag': fields.boolean('Flag'),
             'date': fields.date('Date'),
             'datetime': fields.datetime('Date with Time'),
             'confirm': fields.selection((('unconfirmed', 'Unconfirmed'), ('confirmed', 'Confirmed')),
                  'Selection Box'),
             'image': fields.binary("Image"),
             "phone" : fields.char("phone"),

             'user_id': fields.many2one('res.users', 'Salesperson'),
             'partner_id': fields.many2one('res.partner', 'Customer', ondelete='cascade'),
             'location_id' : fields.related('location_id', type="many2one", relation="stock.location", string="Location Id"),
             'state_id': fields.many2one("res.country.state", 'State'),
             'country_id': fields.many2one('res.country', 'Country'),
             'country': fields.related('country_id', type='many2one', relation='res.country', string='Country'), 

             'duration' : fields.float('Duration'),

             'field_a' : fields.integer('Number1') ,
             'field_b' : fields.integer('Number2'),
             'result'  : fields.function(_calculate, type='integer', obj='sample', method=True, store=False, string='Result'),
    }

    _defaults = {  
        'date': fields.date.context_today,
        }

sample()

In sample_view.xml:

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>

        <record model="ir.ui.view" id="test_tree_view">
            <field name="name">test.tree</field>
            <field name="model">sample</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="test" toolbar="1">
                    <field name="name" />
                    <field name="age" />
                    <field name="date" />
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="test_form_view">
            <field name="name">test.form</field>
            <field name="model">sample</field>
            <field name="arch" type="xml">
                <form string="test" version="7.0">

                    <header>
                        <button name="header_button" string="Create" type="object" />
                        <field name="confirm" widget="statusbar" statusbar_visible="unconfirmed,coked"
                            statusbar_colors='{"unconfirmed":"red","confirmed":"blue"}'
                            clickable="True" />
                        <!-- <field name="name" widget="statusbar" statusbar_visible="draft,sent,invoiced,done" 
                            statusbar_colors='{"draft":"red","done":"blue"}' /> -->
                    </header>

                    <sheet>
                        <group>
                            <label string="Label" colspan="2" />
                            <field name="name" select="1" />
                            <field name="state_id" string="State" onchange="onchange_state" />
                            <field name="country_id" string="Country" />
                            <field name="country" />
                            <field name="location_id" /> 
                            <separator string="seperator tag inserted here"
                                colspan="4" />
                            <newline />
                            <notebook colspan="4" tabpos="up">
                                <page string="basic data field">
                                    <group>
                                        <field name="age" select="2" />
                                        <field name="length" select="3" />
                                        <field name="address" placeholder="Provide current address..." />
                                        <field name="flag" />
                                        <field name="date" />
                                        <field name="datetime" />
                                        <field name="confirm" />
                                        <field name="image" />
                                        <field name="state_id" />
                                        <field name="country_id" />
                                    </group>
                                </page>
                                <page string="relational data field">
                                    <group>
                                        <field name="user_id" string="user_id(many2one)" />
                                        <!-- <field name="partner_ids" string="partner_ids(one2many)" /> -->
                                    </group>
                                </page>
                                <page string="functional data field">
                                    <group>
                                        <field name="field_a" />
                                        <field name="field_b" />
                                        <field name="result" />
                                    </group>
                                </page>
                                <page string="calendar">
                                    <group>
                                        <field name="user_id" string="conducted by" />
                                        <field name="datetime" string="scheduled date" />
                                        <field name="duration" />
                                        <field name="partner_id" string="member to attend" />
                                    </group>
                                </page>
                            </notebook>
                        </group>

                        <!-- <button name="Submit" string="Button" icon="STOCK_APPLY" special="save" 
                            colspan="2" type="action" target="new" confirm="Ask for Confirmation" /> -->

                    </sheet>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="sample_kanban_view">
            <field name="name">Kanban</field>
            <field name="model">sample</field>
            <field name="arch" type="xml">
                <kanban>
                    <field name="name" />
                    <!-- <field name="code" /> <field name="lst_price" /> -->
                    <templates>
                        <t t-name="kanban-box">
                            <div class="oe_kanban_vignette oe_semantic_html_override">
                                <a type="open">
                                    <img t-att-src="kanban_image('sample', 'image', record.id.value)"
                                        class="oe_kanban_image" />
                                </a>
                                <div class="oe_kanban_details">
                                    <h4>
                                        <a type="open">
                                            <!-- <t t-if="record.code.raw_value"> [ <field name="code" /> 
                                                ] </t> -->
                                            <field name="name" />
                                        </a>
                                    </h4>
                                    <div name="tags" />
                                    <ul>
                                        <li>
                                            Age:
                                            <field name="age"></field>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <record model="ir.ui.view" id="sample_graph">
            <field name="name">sample.graph</field>
            <field name="model">sample</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph string="Graph string" orientation="horizontal" type="bar">
                    <field name="name" group="True" />
                    <field name="age" operator="*" />
                </graph>
            </field>
        </record>

        <record model="ir.ui.view" id="sample_calendar_view">
            <field name="name">sample.calendar</field>
            <field name="model">sample</field>
            <field name="type">calendar</field>
            <field name="arch" type="xml">
                <calendar string="Reminders" date_start="datetime" color="user_id"
                    date_delay="duration" mode="week">
                    <field name="name" modifiers="{'required': true}" />
                    <field name="partner_id" modifiers="{}" />
                </calendar>
            </field>
        </record>

        <record model="ir.ui.view" id="sample_search_view">
            <field name="name">sample.search</field>
            <field name="model">sample</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search>
                    <group expand="1" string="Group By...">
                        <filter string="Users" icon="terp-project" domain="[]"
                            context="{'group_by':'user_id'}" />
                        <filter string="Partner" icon="terp-project" domain="[]"
                            context="{'group_by':'partner_id'}"  />
                        <separator orientation="vertical" />
                        <filter string="Date" icon="terp-project" domain="[]"
                            context="{'group_by':'date'}" />
                        <filter string="Current State" domain="[('confirm','in',('unconfirmed','confirmed'))]" help="Confirmed and Unconfirmed Tasks" icon="terp-project"/>
                        <field name="location_id" string="Location"
                            filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]" />
                    </group>
                </search>
            </field>
        </record>

        <record model="ir.ui.view" id="sample_gantt_view">
            <field name="name">sample.gantt</field>
            <field name="model">sample</field>
            <field name="type">gantt</field>
            <field name="arch" type="xml">
                <gantt color="user_id" date_delay="duration" date_start="datetime"
                    string="Tasks" mode="3months">
                    <level object="crm.make.sale" link="partnet_id" domain="[]">
                        <field name="name" />
                    </level>
                </gantt>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_test_form">
            <field name="name">sample</field>
            <field name="res_model">sample</field>
            <field name="view_type">form</field>
            <field name="view_mode">kanban,tree,form,graph,calendar,gantt</field>
        </record>

        <menuitem name="testParent" icon="terp-project" id="testParent_menu"
            sequence="0" />

        <menuitem name="NotesChild" parent="testParent_menu" id="NotesChild_menu" />

        <menuitem name="Header" parent="NotesChild_menu" id="Header_menu_mainform"
            action="action_test_form" />
    </data>

</openerp>

__openerp__.py:

#coomentnds
{
    "name" : "sample",
    "version" : "0.1",
    "author" : "Atchuthan",
    "category" : "Generic Modules/Others",
    "depends" : ["base", "stock"],
    "description" : "Simple demo form",
    "demo_xml" : [],
    "data" : ["sample_view.xml"],
    "active": False,
    "installable": True
}
0
Avatar
Kassér
Gustavo

what is the name of the module you were working with? were you working with partners, categories, or bill of materials?

Atchuthan
Forfatter

i created a custom module

Gustavo

could you post it? looks like there is a bug in your module

Atchuthan
Forfatter

code added

Gustavo

the code looks OK, could you post the traceback?

Atchuthan
Forfatter

traceback updated

Atchuthan
Forfatter

This code is working properly fine now... So why was there a error?

No code changes done.

Avatar
Christian Twinckle
Bedste svar

https://answers.launchpad.net/openobject-addons/+question/179149

check this answer.may be this answer will help you.

Thank you.

0
Avatar
Kassér
Atchuthan
Forfatter

I already viewed this link with OpenERP bug issues @ https://bugs.launchpad.net/openobject-addons/+bug/891474.

They are telling it as "configuration mistake" but why is it working fine now?..

I didnt change any code to remove error. Today when I tried to open my custom module, it worked fine.

Avatar
Sudhir Arya (ERP Harbor Consulting Services)
Bedste svar

It seems problem is in following line:

for picking, todo in self._chain_compute(cr, uid, moves, context=context).items():
0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
nov. 25
592
Payment Page Return Error with Razorpay on Mobile Devices
error
Avatar
0
sep. 25
1278
Error after installing "purchase" app in Odoo version 18
error
Avatar
Avatar
1
dec. 24
7101
error schema for TourStep Error
error
Avatar
0
nov. 24
2647
Can't modify manifest version of custom module [Odoo.sh]
error
Avatar
Avatar
Avatar
2
jul. 24
5422
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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