I can't get multi company to work.
1) I want to have a "master" company where I administer chart of accounts, periods, journals to be shared with many "child"-companies
2) users of a child should not be able to see or generate transactions in other child companies
General settings: Manage multiple companies checked
Invoiceing: Select company Master company "this company has its own chart of account" checked, unchecked for "child"-company (I have tried with uncheck for all companies too)
I have tried a company structure where master are patent to child and reverse.
Record rules:
Journal multi-company ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
(does this mean that journal.company_id (master company) has to be child to user.company_id (child company)? A user of child can list journals belonging to master when master has child as parent, but not when the child company have master as parent.)
sale.py:
journal_ids = self.pool.get('account.journal').search(cr, uid,
[('type', '=', 'sale'), ('company_id', '=', order.company_id.id)],
limit=1)
if not journal_ids:
raise osv.except_osv(_('Error!'),
_('Please define sales journal for this company: "%s" (id:%d).') % (order.company_id.name, order.company_id.id))
account_incoice.py:
company_id = self._context.get('company_id', self.env.user.company_id.id)
domain = [
('type', 'in', filter(None, map(TYPE2JOURNAL.get, inv_types))),
('company_id', '=', company_id),
]
return self.env['account.journal'].search(domain, limit=1)
accounts = self.env['account.account'].search([('name', '=', line.account_id.name), ('company_id', '=', company_id)])
I cant see that its possible to be a user of the child company and use master chart of account or journal.