Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Set the chart of account for several companies during a module installaton, odoo 9.0

By
Artem
on 9/23/16, 4:18 AM 78 views

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?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/23/16, 4:18 AM
Seen: 78 times
Last updated: 9/23/16, 5:04 AM