2013-04-22 67 views
-1

我得到這個錯誤語法錯誤:非關鍵字精氨酸關鍵字ARG後 - OpenERP的

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 162, in load_module_graph 
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\modules\module.py", line 405, in load_openerp_module 
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\.\openerp\modules\module.py", line 133, in load_module 
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\openerp\addons\certificados\__init__.py", line 1, in <module> 
File "C:\Program Files\OpenERP 7.0-20130321-002353\Server\server\openerp\addons\certificados\certificados.py", line 37 
'Valor_En_Divisas' : fields.function(multi_a_b, type='integer', 'Valor En Divisas'), 
SyntaxError: non-keyword arg after keyword arg 

這是我module.py

_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', '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'), 

} 

存在 「Valor_En_Divisas」 錯誤代碼語法,但我不知道什麼是給我這個錯誤?

任何幫助將不勝感激。

回答

5

你有一個非關鍵字參數:

fields.function(multi_a_b, type='integer', 'Valor En Divisas'), 
              ^^^^^^^^^^^^^^^^^^ 

關鍵字參數之後:

fields.function(multi_a_b, type='integer', 'Valor En Divisas'), 
          ^^^^^^^^^^^^^^ 

要解決它,使那最後一個關鍵字參數:

fields.function(multi_a_b, type='integer', string='Valor En Divisas'), 
+0

謝謝你非常非常,我會嘗試儘快:)謝謝,我會在10分鐘hehehe stackoverflow規則接受你的答案;) – NeoVe 2013-04-22 03:57:00

+0

謝謝,它看起來很有效,但是我應該以另一種方式在我的xml中聲明它?喜歡把字符串什麼的?給我提供了無效的XML體系結構,這個錯誤通常是當一個字段沒有寫在xml中的視圖上 – NeoVe 2013-04-22 04:25:47

+0

@ user2089267:該字符串應該使用什麼參數?在文檔中找到名稱。我被告知,它被另一個用戶叫做'string',但它可能是一個不同的名字 – Blender 2013-04-22 04:27:45

相關問題