跳至内容
菜单
此问题已终结
1 回复
4401 查看

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.

形象
丢弃
最佳答案

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
形象
丢弃
相关帖文 回复 查看 活动
1
9月 23
5069
10
6月 16
33199
1
10月 15
9402
4
8月 15
3686
1
3月 15
4794