如何在会计和财务模块的openerp 7中将金额转换为文本?

如何在会计和财务模块的openerp 7中将金额转换为文本?,openerp,Openerp,帮助我解决问题: NameError:未定义全局名称“cr”看起来这一行在report.py文件下。所以您的报表中没有cr、uid、ids和上下文变量 在OpenERP中,self引用当前对象。所以你可以试试这个: cr.execute("""select sum(debit-credit) from account_move_line where id={0}',(account.id)""") amount = cr.fetchall() 希望这能解决你的问题 self.cr.execut

帮助我解决问题:


NameError:未定义全局名称“cr”

看起来这一行在report.py文件下。所以您的报表中没有cr、uid、ids和上下文变量

在OpenERP中,self引用当前对象。所以你可以试试这个:

cr.execute("""select sum(debit-credit) from account_move_line where id={0}',(account.id)""")
amount = cr.fetchall()
希望这能解决你的问题

self.cr.execute("""select sum(debit-credit) from account_move_line where id={0}',(account.id)""")
amount = self.cr.fetchall()