如何将字段值从一个模块继承到另一个模块?

how to inherit field value from one module to another module?

我想将 amount_total 的值从帐户模块继承到我的自定义模块。 amount_total 是帐户模块中的一个字段,因此如何在我的自定义模块中检索它的值。我已经在我的 openerp 文件中设置了对帐户的依赖。但仍然在日食中它说未定义 variable:amount_total

custom.py ,

class account_invoice(models.Model):

  _inherit = "account.invoice"  

  print amount_total

你只需要使用self.amount_total。在一个方法中形成。喜欢:

@api.one
def print_amount(self):
    print self.amount_total