Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4771 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
wrz 23
5631
10
cze 16
33807
1
paź 15
9944
4
sie 15
4187
1
mar 15
5279