Odoo Help

0

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

By
MonsieurB
on 5/24/16, 8:15 AM 486 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
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

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

Question tools

1 follower(s)

Stats

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