I need a solution when i call on_changed function from drop down changed then it should fetch the data from the table and update data into second drop down. Could you please give me the sample code of tow related drop down.
Esta pergunta foi sinalizada
1
Responder
5759
Visualizações
Hi,
Refer this code
def onchange_chart_id(self, cr, uid, ids, chart_account_id=False, context=None):
res = {}
if chart_account_id:
company_id = self.pool.get('account.account').browse(cr, uid, chart_account_id, context=context).company_id.id
now = time.strftime('%Y-%m-%d')
domain = [('company_id', '=', company_id), ('date_start', '<', now), ('date_stop', '>', now)]
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, domain, limit=1)
res['value'] = {'company_id': company_id, 'fiscalyear_id': fiscalyears and fiscalyears[0] or False}
return res
Está gostando da discussão? Não fique apenas lendo, participe!
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscrever-se| Publicações relacionadas | Respostas | Visualizações | Atividade | |
|---|---|---|---|---|
|
|
1
set. 23
|
6908 | ||
|
How to use On change function?
Resolvido
|
|
10
jun. 16
|
35448 | |
|
|
1
out. 15
|
11208 | ||
|
|
4
ago. 15
|
5470 | ||
|
|
1
mar. 15
|
6313 |