Skip to content

Commit

Permalink
[FIX] Insert in company_ids relation's table only ids of records that…
Browse files Browse the repository at this point in the history
… are bound to some company
  • Loading branch information
SimoRubi authored and rousseldenis committed Mar 9, 2021
1 parent 09e469c commit ad2189e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base_multi_company/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
'name': 'Multi Company Base',
'summary': 'Provides a base for adding multi-company support to models.',
'version': '10.0.1.0.1',
'version': '10.0.2.0.0',
'author': "LasLabs, Tecnativa, Odoo Community Association (OCA)",
'category': 'base',
'website': 'https://laslabs.com',
Expand Down
2 changes: 1 addition & 1 deletion base_multi_company/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def post_init_hook(cr, rule_ref, model_name):
SQL = """
INSERT INTO %s
(%s, %s)
SELECT id, company_id FROM %s
SELECT id, company_id FROM %s WHERE company_id IS NOT NULL
""" % (table_name, column1, column2, model._table)
env.cr.execute(SQL)

Expand Down

0 comments on commit ad2189e

Please sign in to comment.