Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
5478 Visualizações

I should Enter the username in vendor field.....

VENDOR
Mohanraj

Mohanraj

Mohanraj_Jan

Mohanraj_MD.....Etc


It displays all related vendor names,

*****************************************************************************************************


Same I try to entered a Mobile No's. it does not throw any data's....

VENDOR
+919876543210

Create "+919876543210"

*****************************************************************************************************


Now I need,

That situation, Entered mobile number in the vendor fields it takes to the related vendor comes under that field?

Please Give me a any other Solution for this Requirement.

Thankyou by

Mohanraj Janakiraman

Avatar
Cancelar
Autor Melhor resposta

Finally i got the Answer Please check and use it:

*****************************************


.py Changes for purchase:

class skit_Partner(models.Model):

    _inherit = 'res.partner'

    def name_get(self):
        result = {}
        if self._context.get('view_customer', False):
            for partner in self: 
                result[partner.id] = str(partner.name) + ' _' + str(partner.supplier_code)
        else:
            for partner in self:
                    result[partner.id] = partner.name
 
        return result.items()

    @api.model
    def name_search(self, name, args=None, operator='ilike', limit=100):
        args = args or []
        recs = self.browse()
        if name:
            recs = self.search((args + ['|', ('supplier_code', 'ilike', name), ('name', 'ilike', name)]),
                               limit=limit)
        if not recs:
            recs = self.search([('name', operator, name)] + args, limit=limit)
        return recs.name_get()

.xml Changes:        
                <xpath expr="//field[@name='partner_id']" position="replace">
                    <field name="partner_id" context="{'view_customer': True}" />
                </xpath>

Avatar
Cancelar
Melhor resposta

modify your search fields. include phone, mobile etc columns so you will have changes. but it might slow things down.

adding new indexes might help too.

Avatar
Cancelar
Autor

Its not working!

Publicações relacionadas Respostas Visualizações Atividade
2
nov. 23
3135
7
abr. 21
20506
1
out. 20
4877
2
nov. 16
4226
1
mar. 15
13671