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

Installing my module I load several companies and I want to set my chart of account for each company. I do this in the post install hook.

super_user=registry['res.users'].browse(cr, SUPERUSER_ID, SUPERUSER_ID,context=None)
company_ids=registry['res.company'].search(cr, SUPERUSER_ID,[],context=None)
for company_id in company_ids:
    super_user.company_id=company_id
    registry['account.chart.template'].browse(cr, SUPERUSER_ID, chart_id,context=None).try_loading_for_current_company()

The code works but I'm in doubts about super_user.company_id=company_id.

Is it ok?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lip 24
2460
1
lut 24
2174
1
sty 24
6150
1
sie 23
2337
2
mar 23
3339