0
我编写自定义模块,但是我有_defaults函数的问题。如何在自定义模块中使用_defaults函数openerp
当我安装模块,它抛出一个错误
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 = {
}
没有你留下的_defaults字典。故意空? –
当_deaults函数有内容时也会出现同样的问题。感谢您的意见 !。 – haris
这是一个缩进错误,您需要检查它。缩进必须匹配。 –