Odoo Help

Welcome!

This community 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.

0

pré remplir un champs d'assistant lors de son appel

By
MonsieurB
on 5/24/16, 8:15 AM 226 views

Bonjour, je voudrai pré remplir un champs d'assistant lors de son appel.Pré-remplir avec une valeur dynamique et pas seulement une string ou un entier.

Hello , I will wish to know how to pre-fill a field of a wizard when it is called

pre-filled with a dynamic value, not just a static string or integer.

1

Prakash Sharma

--Prakash Sharma--
815
| 2 1 4
Delhi, India
--Prakash Sharma--

I like to surround myself with brave, creative people.

My motivation for learning different technologies and algos drive me. I love challenges of a steep learning curve which I believe makes me a better learner. I have a strong desire to learn different technologies, which would enable me to become a full stack developer.

Prakash Sharma
On 5/24/16, 9:55 AM

override the default_get like:

    @api.model
def default_get(self, fields):
res = super(AccountMoveLineReconcile, self).default_get(fields)
data = self.trans_rec_get()
if 'trans_nbr' in fields:
res.update({'trans_nbr': data['trans_nbr']})
if 'credit' in fields:
res.update({'credit': data['credit']})
if 'debit' in fields:
res.update({'debit': data['debit']})
if 'writeoff' in fields:
res.update({'writeoff': data['writeoff']})
return res


0
MonsieurB
On 5/25/16, 1:13 PM

YES ! RESOLU

impec cela m'as aidé. Pour un wizard

@api.model
def default_get(self, fields):
    res = super(WizardBusinessCreator, self).default_get(fields)
    entreprise = self.env.user.company_id
    myNextId = getNextAnalyticName(self, entreprise.id)
    if 'description' in fields:
    res.update({'description': myNextId})
    return res

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/24/16, 8:15 AM
Seen: 226 times
Last updated: 5/25/16, 1:13 PM