Odoo Hilfe

1

0
1 Antwort
0
BrowseInfo Indien
10.10.17, 06:36

Hi Pawan,
 

You can pass context from xml and in the name get method you can check in if condition , if you get your flag here only then apply a pet name instead of res partner default name.


 @api.multi

    def name_get(self):

        result = []

        if self._context.get('flag'):   #flag = value that you have passed from the xml

            for record in self:

                name = '['

                if record.pet_name:

                    name += record.pet_name + ']' + ' ' + record.name

                else:

                    name += '] ' + record.name

                result.append((record.id, name))

        return result

\


1 Kommentar
SunArc Technologies, Pawan Kumar Sharma Indien
11.10.17, 00:37

Where is the class, For which we want to implement? and it show error like: "list index out of range".

Fragen Sie
Keep Informed
1 Verfolger
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now