Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
5479 Vues

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
Ignorer
Auteur Meilleure réponse

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

Its not working!

Publications associées Réponses Vues Activité
2
nov. 23
3135
7
avr. 21
20506
1
oct. 20
4877
2
nov. 16
4226
1
mars 15
13671