콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
5914 화면

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
2952
1
2월 17
9570
1
3월 15
5018
1
7월 23
2812
0
7월 22
5421