运行时错误:在od中使用split()函数时调用Python对象时超出了最大递归深度

2024-05-20 17:33:51 发布

您现在位置:Python中文网/ 问答频道 /正文

运行时错误:调用Python对象时超出了最大递归深度 我在使用python的split函数作为选择字段或odoo9中的manyOne字段时遇到了这个错误。在

我想把绳子分开,和另一根绳子连接起来,但首先我得把它另一根分开。但是对于split()它显示了上面的错误。请帮我摆脱它。。。。。在

这是.py文件

from  openerp import models, fields, api
import sys
sys.setrecursionlimit(1500)
class erp_product_template(models.Model):
_name='product.template' 
    _inherit='product.template'
    erp_sub=fields.Many2one("product.sub11",string="Sub Category")
    erp_cats=fields.Many2one("product.maincats",string="Main Category")

    temp1=fields.Char("Testing Char Field")
    temp1=erp_sub.split("/")

    class erp_MainModal(models.Model):
        _name="product.maincats"
        name=fields.Selection([('SL0','SL0'),('SL1','SL1'),('SL2','SL2'),('SL3','SL3'),('SL4','SL4'),('SL5','SL5'),('SL6','SL6'),('SL7','SL7'),('SL8','SL8')]) 

    class erp_sub11(models.Model):
        _name="product.sub11"
        name=fields.Selection([('ECDS0','SL0/ECDS0'),('ECDS1','SL0/ECDS1'),('ECDS2','SL0/ECDS2'),('ECDS3','SL0/ECDS3')])    

    class erp_sub_sub1(models.Model):
        _name="product.sub_sub1"
        name=fields.Selection([('08','ECDS0/08'),('09','ECDS0/09'),('10','ECDS2/10'),('11','ECDS3/11')])   

这是xml文件

^{pr2}$

Tags: namefieldserpmodelmodels错误templateproduct