コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
5717 ビュー

Hello guys,

Hi guys i was using Odoo 10, Is there a way to search partner using vat number instead of partner name when creating invoice?

Thanks in advance

アバター
破棄
最善の回答

Hai Henok Wubet, 

class res_partner(models.Model):
    _inherit = 'res.partner'

     @api.multi
     def name_get(self):
         res = []
         for each in self:
             name = each.name
             if each.desc:
                 res.append((each.id, name + '[' + str(each.vat) + ']'))
             else:
                 res.append((each.id, each.name))
         return res

thank you.

アバター
破棄
著作者 最善の回答

The Answer is Posted Here

https://stackoverflow.com/questions/45459567/odoo-searching-partner-using-vat-number


アバター
破棄

this module is work only in odoo V8, You just convert it into 10. then only it works properly.

著作者

Is there any way to convert it to odoo10?

and there are too many res_partner.py files on which file should i put the function? or you want me to create a new module based on the code?

著作者

Hi i tried your code but i have got this error when i opened sales to invoice

AttributeError: 'res.partner' object has no attribute 'desc'...

関連投稿 返信 ビュー 活動
1
12月 21
2787
1
2月 17
9343
1
3月 15
4801
1
7月 23
2639
0
7月 22
5287