Created
September 6, 2017 05:48
-
-
Save repodevs/e77ec4391c3059a0f0639bc53de76cf0 to your computer and use it in GitHub Desktop.
odoo name_get inherit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# © 2017 Niaga Solution - Edi Santoso <[email protected]> | |
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). | |
from odoo import api, models | |
class Contact(models.Model): | |
_inherit = 'res.partner' | |
@api.multi | |
def name_get(self): | |
res = super(Contact, self).name_get() | |
res_dict = dict(res) | |
for record in self: | |
if record.unit_id: | |
res_dict[record.id] = "(%s) %s" % (record.unit_id.code, record.name) | |
return res_dict.items() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mhdsyarif coba ini mas
ini akan menampilkan
nama
-> Jikas User tidak mempunyai e-mailnama / [email protected]
-> Jika user punya e-mail