I was looking for a way to provide a partner view in a multi-company environment which would only list partners related to the company of the current user. I bundled my solution into a new module and uploaded the module to the community trunk branch (lp:~openerp-community/openobject-addons/trunk-addons-community).
After installing the module, an optional company reference will be added to the partner categories. The company reference will default to the current users company and will inherit the company value from the parent category if the parent relation changes.
By assigning partners to categories, they will implicitly be linked to a company if the chosen categorie includes a company reference.
Once you updated your partner and partner category data, you can use the new Company Partners view (Partners -> Company Partners) to get a filtered view of the partners belonging to your company. The view domain contains a function call get_company_categories(), which gets replaced in the override of the ir_action_window.read() method.
Post new comment