我编写了自定义模块,但在使用默认函数时遇到了问题。你知道吗
当我安装模块时,它抛出了一个错误
Indentation Error: unexpected indent for "_defaults = {".
medical_diagnostic_hypothesis.py
from openerp.osv import fields, orm
class MedicalDiagnostic_hypothesis(orm.Model):
_name = 'medical.diagnostic_hypothesis'
#_inherit = ['mail.thread', 'ir.needaction_mixin']
_columns = {
'name': fields.char(size=256, string='Diagnostic ID', required=True),
'partner_id': fields.many2one('res.partner', 'Partner',
required=True ),
'pathology_category_id': fields.many2one('medical.pathology.category',
'Pathology',required=True ),
'diagnostic': fields.char(size=256, string='Diagnostic'),
'treatment_method': fields.char(size=256, string='Treatment Method'),
}
_defaults = {
}
尝试使用此代码。(作适当的缩进)
医疗诊断_假设.py
更多关于indentation in python.
相关问题 更多 >
编程相关推荐