<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/hr_org_chart/controllers, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[MERGE] forward port branch saas-12.4 up to 9ed4872ea03</title>
<updated>2019-09-24T17:45:37+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2019-09-24T16:59:15+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d67b2483e5bfa5d8c1e6ef1a64fb933f5e080ad5'/>
<id>d67b2483e5bfa5d8c1e6ef1a64fb933f5e080ad5</id>
<content type='text'>
closes odoo/odoo#37372

Signed-off-by: Christophe Simonis &lt;chs@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes odoo/odoo#37372

Signed-off-by: Christophe Simonis &lt;chs@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] hr{_org_chart}: multi-company access issues on employees</title>
<updated>2019-09-23T10:12:31+00:00</updated>
<author>
<name>Toufik Ben Jaa</name>
<email>tbe@odoo.com</email>
</author>
<published>2019-09-23T09:36:11+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=3a81d43aff409b43138bc37f678d34067939c1ce'/>
<id>3a81d43aff409b43138bc37f678d34067939c1ce</id>
<content type='text'>
- Avoid to crash when trying to render an employee's org chart
  when in a different company than yours.
- Retrieve the context from the current environment instead of
  the `_check_employee` function parameters.

closes odoo/odoo#37251

Signed-off-by: Romain Libert (rli) &lt;rli@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Avoid to crash when trying to render an employee's org chart
  when in a different company than yours.
- Retrieve the context from the current environment instead of
  the `_check_employee` function parameters.

closes odoo/odoo#37251

Signed-off-by: Romain Libert (rli) &lt;rli@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] forward port branch saas-12.3 up to 409679866b2</title>
<updated>2019-06-06T09:54:35+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2019-06-06T09:54:35+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=71a50a2214748fec413c5a0f042d0e7172ae6ea9'/>
<id>71a50a2214748fec413c5a0f042d0e7172ae6ea9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] hr_org_chart: Adapt module with new hr.employee.public model</title>
<updated>2019-05-31T08:21:20+00:00</updated>
<author>
<name>RomainLibert</name>
<email>rli@odoo.com</email>
</author>
<published>2019-04-02T09:06:08+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d09d5c2e8af1b5c00b84c8961d8024e5cbfe76d3'/>
<id>d09d5c2e8af1b5c00b84c8961d8024e5cbfe76d3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] api.py: Rename company_id/company_ids into company/companies</title>
<updated>2019-05-29T08:09:15+00:00</updated>
<author>
<name>Yannick Tivisse</name>
<email>yti@odoo.com</email>
</author>
<published>2019-05-22T09:03:55+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=f5dfe4727c086c7577da2aef12c2d3548ba938a3'/>
<id>f5dfe4727c086c7577da2aef12c2d3548ba938a3</id>
<content type='text'>
The goal is to be coherent with the user property.

Actually, company_id and company_ids on the environment are no fields.

Calling env.company_id returns a browse record, not an id.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The goal is to be coherent with the user property.

Actually, company_id and company_ids on the environment are no fields.

Calling env.company_id returns a browse record, not an id.</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] hr: Review the UX for 'My Profile' view</title>
<updated>2019-07-18T10:27:50+00:00</updated>
<author>
<name>Kevin Baptiste</name>
<email>kba@odoo.com</email>
</author>
<published>2019-06-13T13:56:02+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e9d989827686d1089c1ea1c9a6b47b62a09e2de4'/>
<id>e9d989827686d1089c1ea1c9a6b47b62a09e2de4</id>
<content type='text'>
1/ web: adapt formatDate to handle NaN values
DashboardRenderer might return NaN for `Date` or `DateTime` fields if
their original value is null or incorrect.

2/ hr: add job_title in demo data

3/ hr_recruitment: link employee in the chatter for new recruits

4/ hr: remove employee documents in the model

5/ hr_attendance: improve resiliency of relative_time

6/ hr: display manager on res_users

7/ hr: change Address Book to Employee Directory

TaskID: 2009111

closes odoo/odoo#34180

Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1/ web: adapt formatDate to handle NaN values
DashboardRenderer might return NaN for `Date` or `DateTime` fields if
their original value is null or incorrect.

2/ hr: add job_title in demo data

3/ hr_recruitment: link employee in the chatter for new recruits

4/ hr: remove employee documents in the model

5/ hr_attendance: improve resiliency of relative_time

6/ hr: display manager on res_users

7/ hr: change Address Book to Employee Directory

TaskID: 2009111

closes odoo/odoo#34180

Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] hr_org_chart: Fix traceback on employee creation</title>
<updated>2019-06-25T08:04:08+00:00</updated>
<author>
<name>Shreya Modi</name>
<email>smo@odoo.com</email>
</author>
<published>2019-06-14T06:46:49+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e092060dfeea1eeba852e06106fe66f147cacd00'/>
<id>e092060dfeea1eeba852e06106fe66f147cacd00</id>
<content type='text'>
While creating employee and selecting a company other than the current company,
saving record shows a traceback.

Currently xml template expects managers and children key returned from
/get_org_chart controller but /get_org_chart was returning blank dict, and which
is used as qweb context to render template.

Return {'managers': [], 'children': []} if _check_employee returns False

task-2000269</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While creating employee and selecting a company other than the current company,
saving record shows a traceback.

Currently xml template expects managers and children key returned from
/get_org_chart controller but /get_org_chart was returning blank dict, and which
is used as qweb context to render template.

Return {'managers': [], 'children': []} if _check_employee returns False

task-2000269</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] hr_org_chart: multicompany managers trigger access right issues</title>
<updated>2019-05-22T13:57:29+00:00</updated>
<author>
<name>Toufik Ben Jaa</name>
<email>tbe@odoo.com</email>
</author>
<published>2019-05-22T13:57:29+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=86f8be14661dc028742cad0cfa37405768d4673b'/>
<id>86f8be14661dc028742cad0cfa37405768d4673b</id>
<content type='text'>
- When displaying the organisational chart an access right error can be
triggered if the current user cannot read employees from other
companies and if one of the displayed employee's manager is in an other
company.

closes odoo/odoo#33576

Signed-off-by: Toufik Benjaa (tbe) &lt;tbe@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- When displaying the organisational chart an access right error can be
triggered if the current user cannot read employees from other
companies and if one of the displayed employee's manager is in an other
company.

closes odoo/odoo#33576

Signed-off-by: Toufik Benjaa (tbe) &lt;tbe@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] base: Contextualize the multi company</title>
<updated>2019-05-13T08:57:49+00:00</updated>
<author>
<name>Yannick Tivisse</name>
<email>yti@odoo.com</email>
</author>
<published>2019-04-25T15:42:05+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a5b6f31cf28e5381e1c85f66730bcdb55998e643'/>
<id>a5b6f31cf28e5381e1c85f66730bcdb55998e643</id>
<content type='text'>
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -&gt; Traceback -&gt; Log into
the correct company, re-copy/paste -&gt; Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -&gt; Traceback -&gt; Log into
the correct company, re-copy/paste -&gt; Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] hr_org_chart: Allow recursion in hierarchy</title>
<updated>2018-12-06T13:56:45+00:00</updated>
<author>
<name>lul-odoo</name>
<email>lul@odoo.com</email>
</author>
<published>2018-10-16T07:49:42+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=48254cc8a153e061b64c399abb90cf4d4440bd65'/>
<id>48254cc8a153e061b64c399abb90cf4d4440bd65</id>
<content type='text'>
Employees can appear multiple times in the org chart

Purpose
=======

Allow recursive hierarchy (an employee can be its own manager; e.g. the CEO is manager of everyone
but is also member of a department managed by the CTO who is himself managed by the CEO).
This means an employee might appear in multiple place in the organisational chart.

The button to see more of the hierarchy in the organisation chart opens all employees under the N+2 of the
current employee being displayed but does not open the view of the N+2.

Specification
=============

Add 'subordinates_ids' computed field on 'hr.employee' to get all subordinates (direct and indirect).

closes odoo/odoo#27900</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Employees can appear multiple times in the org chart

Purpose
=======

Allow recursive hierarchy (an employee can be its own manager; e.g. the CEO is manager of everyone
but is also member of a department managed by the CTO who is himself managed by the CEO).
This means an employee might appear in multiple place in the organisational chart.

The button to see more of the hierarchy in the organisation chart opens all employees under the N+2 of the
current employee being displayed but does not open the view of the N+2.

Specification
=============

Add 'subordinates_ids' computed field on 'hr.employee' to get all subordinates (direct and indirect).

closes odoo/odoo#27900</pre>
</div>
</content>
</entry>
</feed>
