Skip to Content
Menú
This question has been flagged
3 Respostes
5474 Vistes

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
Descartar
Autor Best Answer

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
Descartar
Best Answer

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
Descartar
Autor

Its not working!

Related Posts Respostes Vistes Activitat
2
de nov. 23
3134
7
d’abr. 21
20506
1
d’oct. 20
4876
2
de nov. 16
4224
1
de març 15
13671