跳至内容
菜单
此问题已终结

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

形象
丢弃
编写者 最佳答案

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>

形象
丢弃
最佳答案

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.

形象
丢弃
编写者

Its not working!

相关帖文 回复 查看 活动
2
11月 23
3139
7
4月 21
20508
1
10月 20
4880
2
11月 16
4232
1
3月 15
13673