Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5714 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

The Answer is Posted Here

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


Ảnh đại diện
Huỷ bỏ

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

Tác giả

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?

Tác giả

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'...

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 12 21
2786
1
thg 2 17
9343
1
thg 3 15
4798
1
thg 7 23
2630
0
thg 7 22
5285