I am trying to retrieve comment field(customer internal notes) from res_partner to account invoice module.Right now I just want to print it later I will include it in xml code. I tried in three ways like this,
1)comment2 = fields.Char(string='Comment',related='res_partner.comment',compute='_compute_com')
@api.multi
def _compute_com(self):
print self.comment2
2)comment = fields.Many2one('res.partner','Comment',compute='_compute_com')
@api.multi
def _compute_com(self):
print self.comment
3)partner_comment = fields.Char(compute='_compute_com')
@api.multi
def _compute_com(self):
Comment = self.env['res.partner'].browse(partner_id).comment
print Comment