Search code examples
odooopenerp-7odoo-8

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


I want to inherit the value of amount_total from accounts module to my custom module. amount_total is a field in accounts module, so how can I retrieve it's value in my custom module. I have already set dependency on account in my openerp file. But still in eclipse it says as undefined variable:amount_total

custom.py ,

class account_invoice(models.Model):

  _inherit = "account.invoice"  

  print amount_total

Solution

  • You just need to use self.amount_total. form inside a method. like:

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