Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

RuntimeError: maximum recursion depth exceeded

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
error
2 Trả lời
31307 Lượt xem
Ảnh đại diện
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
Ảnh đại diện
Huỷ bỏ
Gustavo

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

Atchuthan
Tác giả

i created a custom module

Gustavo

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

Atchuthan
Tác giả

code added

Gustavo

the code looks OK, could you post the traceback?

Atchuthan
Tác giả

traceback updated

Atchuthan
Tác giả

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

No code changes done.

Ảnh đại diện
Christian Twinckle
Câu trả lời hay nhất

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

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

Thank you.

0
Ảnh đại diện
Huỷ bỏ
Atchuthan
Tác giả

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.

Ảnh đại diện
Sudhir Arya (ERP Harbor Consulting Services)
Câu trả lời hay nhất

It seems problem is in following line:

for picking, todo in self._chain_compute(cr, uid, moves, context=context).items():
0
Ảnh đại diện
Huỷ bỏ
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
?"Your country might be blocked by our hosting provider" error when I create new website
error
Ảnh đại diện
0
thg 11 25
592
Payment Page Return Error with Razorpay on Mobile Devices
error
Ảnh đại diện
0
thg 9 25
1278
Error after installing "purchase" app in Odoo version 18
error
Ảnh đại diện
Ảnh đại diện
1
thg 12 24
7101
error schema for TourStep Error
error
Ảnh đại diện
0
thg 11 24
2647
Can't modify manifest version of custom module [Odoo.sh]
error
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
2
thg 7 24
5422
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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