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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Účetnictví
- Sklad
- PoS
- Project
- MRP
This question has been flagged
1
Odpovědět
4349
Zobrazení
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Přihlásit seRelated Posts | Odpovědi | Zobrazení | Aktivita | |
---|---|---|---|---|
|
1
zář 23
|
4972 | ||
How to use On change function?
Vyřešeno
|
|
10
čvn 16
|
33065 | |
|
1
říj 15
|
9268 | ||
|
4
srp 15
|
3612 | ||
|
1
bře 15
|
4720 |