0

我的自定义模块从来没有任何问题,突然我收到了这个错误:

Client Traceback (most recent call last):
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\openerp\addons\web\http.py", line 203, in dispatch
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\openerp\addons\web\controllers\main.py", line 1410, in load
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\openerp\addons\web\session.py", line 43, in proxy
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\openerp\addons\web\session.py", line 31, in proxy_method
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\openerp\addons\web\session.py", line 104, in send


Server Traceback (most recent call last):
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\openerp\addons\web\session.py", line 90, in send
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\netsvc.py", line 293, in dispatch_rpc
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\service\web_services.py", line 622, in dispatch
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\service\security.py", line 40, in check
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\pooler.py", line 49, in get_pool
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\pooler.py", line 33, in get_db_and_pool
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\modules\registry.py", line 192, in get
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\modules\registry.py", line 218, in new
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\modules\loading.py", line 344, in load_modules
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\modules\loading.py", line 259, in load_marked_modules
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\modules\loading.py", line 168, in load_module_graph
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\modules\module.py", line 374, in init_module_models
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\osv\orm.py", line 3004, in _auto_init
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\osv\orm.py", line 3309, in _o2m_raise_on_missing_reference
except_orm: ('Programming Error', "There is no reference field 'Items del Certificado' found for 'certificados.line'")

这是我的 module.py 的代码

class certificados(osv.osv):

_name = 'certificados.certificados'
_description="Certificados de No Produccion"
_inherit=['mail.thread', 'ir.needaction_mixin']

_columns = {
'Registro_Numero' : fields.integer('Registro Numero'),
'Fecha_de_Emision': fields.date('Fecha de Emision', required=True, select=True),
'Fecha_de_Solicitud': fields.date('Fecha de Solicitud', required=True, select=True),
'Fecha_del_Documento': fields.date('Fecha del Documento', required=True, select=True),
'Vigencia' : fields.integer('Vigencia'), 'cert_ids' : fields.one2many('certificados.line','requisicion_id','Items del Certificado'),
'descripcion' : fields.text('Descripcion'),
'notas' : fields.text('Notas'),
}


class certificados_line(osv.osv):

_name = 'certificados.line'
_description="Certificados No Produccion"

def multi_a_b(self, cr, uid, ids, name, arg, context=None):
res = {}
for record in self.browse(cr, uid, ids,context):
   res[record.id] = record.Cantidad * record.Precio_Unitario_Declarado
return res

_columns = {
'Codigo_Arancelario' : fields.integer('Codigo Arancelario'),
'product_id' : fields.many2one('product.product', 'Material'),
'Descripcion_Arancelaria' : fields.char('Descripcion Arancelaria', size=42, required = True, translate = True), 
'Especificaciones_Tecnicas' : fields.char('Especificaciones Tecnicas', size=60, required = True, translate = True), 
'Cantidad' : fields.float('Cantidad'), 'Unidad_de_Medida': fields.many2one('product.uom', 'Unidad de Medida'),
'Precio_Unitario_Declarado' : fields.float('Precio Unitario Declarado'), 'Moneda' : fields.many2one('res.currency', 'Moneda'),
'Valor_En_Divisas' : fields.function(multi_a_b, type='integer', string='Valor En Divisas'),
'requisicion_id' : fields.many2one('certificados.certificados', 'Certificados de No Produccion', ondelete='cascade'),
'Cantidad_Consumida' : fields.float('Cantidad Consumida'), 'Cantidad_Disponible' : fields.float('Cantidad Disponible'),
}


certificados_line()

问题实际上cert_ids出在对象的领域certificados.certificados,但正如我之前所说,直到现在它还没有给我任何问题......任何人都可以说出什么可能是错误的?或者我应该在哪里引用这个字段?

提前致谢。

4

0 回答 0