Skip to Content
Menu
This question has been flagged
2 Replies
5745 Rodiniai

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

Portretas
Atmesti
Best Answer

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.

Portretas
Atmesti
Autorius Best Answer

The Answer is Posted Here

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


Portretas
Atmesti

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

Autorius

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?

Autorius

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

Related Posts Replies Rodiniai Veikla
1
gruod. 21
2813
1
vas. 17
9376
1
kov. 15
4814
1
liep. 23
2650
0
liep. 22
5302