Commit Graph
151539 Commits
Author SHA1 Message Date
Xavier BOL (xbo) 7df8cf0496 [IMP] project: refactor to easily create right side panel components
Before this commit, the components created and used in the right side
panel are components for the `project.milestone` and we cannot reused
some components for another context.

This commit refactors a little bit to create a parent component with the
common code useful for another components than `project.milestone` ones.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 518a5becd6 [IMP] sale_project: allow to change the domain for profitability from SO
Before this commit, the domain used to find the SOLs inscreasing the
revenues of the project is fixed, so it is not possible to override the
domain without rewriting the method which computes the revenues from the
SOLs linked to the project.

This commit adds a hook to easily modify the domain used.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) dc002ed5aa [FIX] project_hr_expense: avoid calling read_group if no AA in project
Before this commit, when all projects in `self` have no AA set, the
`read_group` used to `_compute_expense_count` is called. However, if AA
is in projects in `self` then `expense_count` field is always equal to
0 for each project because the link between the project and the expense
is made with AA.

This commit checks if at least a project has a AA set before calling the
`read_group` otherwise `expense_count=0` for all projects contained in
`self`.
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 31b2ddc42f [IMP] project*,sale_timesheet: add profitability label
Before this commit, the label is giving with the data computed for the
project profitability.

This commit separes the label with the data to avoid translating many
times the same things.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) db065941d1 [REM] sale_timesheet: remove project profitability report 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 3f098a782f [IMP] sale_timesheet: remove the profitability report 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 2562801d63 [IMP] project_mrp: add action for MO in project profitability
Before this commit, the Manufacturing orders are displayed in the costs
but the user sees which MO impacts the costs of the project
profitability.

This commit adds an action to allow the users to see all the MO related
to the project. However, the MO section will be clickable in the project
profitability only if the user has access to the MO.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 658c485e51 [IMP] project_purchase: add action to get the purchase orders
Before this commit, the project profitability shows the total due to the
purchase orders linked to the project. However, the user cannot easily
sees which purchase orders impact the project profitability.

This commit adds an action to see all purchase orders related to the
project. However, the 'Purchase Orders' section in the costs will be
clickable only if the user has access to the purchase orders

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) d400f1f310 [IMP] sale_timesheet: add action to see all timesheets related
Before this commit, the project profitability takes into account all
timesheets related to the project but the user cannot see which
timesheets for which row in the revenues or costs for a project.

This commit adds an action for each row containing timesheets to
correctly see which timesheets are found for an exact row. For instance,
the user will be able to see all timesheets for the 'Timesheets (Non
Billable)' row. The name of each row will be clickable only if the
user has access to the timesheet app.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) ca8aaa0a0d [IMP] sale_project: add action to get all SOLs related to revenues
Before this commit, the materials row displayed in the revenues of the
project profitability in the right side panel shows only the result of
all SOLs containing a material product. The user cannot see which SOLs
give that result.

This commit adds an action to see all SOLs related to that row. If the
user has access to the Sales app then the name in that row (that is,
'Material') will be clickable to redirect the user to the view of SOLs
found for that row.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) b187e49cb9 [IMP] project_sale_expense: add action to see the expenses
Before this commit, the expenses inscreasing the revenues or the costs
in the project profitability are not visible for the user because he can
just see the result and not which expenses are related to that result.

This commit adds the action to see the expenses related to the revenues
that is, all expenses reinvoiced to the customer for that project or the
expenses related to the costs of the project. However, the user needs to
have access to the expenses to access to the action, otherwise the name
section is not clickable.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 5558d2a578 [IMP] project_hr_expense: add action to get expense for profitability
Before this commit, the expense costs are not clickable to see the
expenses impacting the project profitability in that row.

This commit adds the action to allow the user to click on the name on
the row to see all the expenses related.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 4d20d315e9 [IMP] project: get action for profitability sections
This commit adds a generic method for all sections in the project
profitability to get the correct action based on the which section the
user clicks. Moreover, a new parameter is added into
`_get_profitability_items` method to add the action data in the
profitability items or not. This parameter will be useful for the unit
tests.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) b4abfd9ad3 [IMP] project: allow clicking on Name of each row in profitability 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 4006d6c9fb [IMP] project: avoid displaying section if no data
Before this commit, the profitability section is shown even if data is
found. That is, no cost and/or revenue are found to display the project
profitability.

This commit hides this section in the case where no data is found.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 812940237d [IMP] project,*: filter AAL to avoid compute many times in profitability 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 08112964f7 [IMP] project_mrp: add manufactoring orders in project profitability 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) bd4b36d971 [IMP] project_purchase: add purchase in project profitability 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 2731e7cb08 [ADD] project_sale_expense: add reinvoice expense in project profitability
Before this commit, the reinvoice expenses are not takken into account
for the project profitability.

This commit adds a new module called `project_sale_expense` to make the
bridge between the sale_expense and project_hr_expense and so in this
module, the revenues impacted by the reinvoice expenses will be computed
and takken into account for the project profitability.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 232e75421e [IMP] project_hr_expense: add expense in project profitability 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) d1a9347c32 [IMP] sale_timesheet: compute the project profitability from AAL
This commit continues to compute the project profitability with the
AAL models, it is essentially the timesheets related to the project
in which the profitabily is computing to get the costs impacted by those
timesheets related.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 50315deaa2 [IMP] sale_project,sale_timesheet: compute project revenues from SO 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 42ce97a479 [IMP] sale_project: add general to service method in product
Before this commit, we don't have any method to get a dict containing
the mapping with the invoice_policy and the service_type to get the
service_policy. A mapping method exists for that use case but this
method creates the dict each time and we need to map more than one time.

For those reasons, this commit adds a method to get the dict containing
the `(invoice_policy, service_type)` as key and `service_policy` as
value.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 6ba17be98d [IMP] sale_project: load more SOLs in project update if more than 25
Before this commit, the SOLs displaying in the Sales section of the
right side panel is 25, but if there are more than 25 SOLs linked to a
project, it is not possible to see the others.

This commit adds a button to load the others SOLs if there are more than
25 SOLs linked to the current project.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 3e721c28c4 [IMP] project: add format monetary in project update components 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) f13568c809 [IMP] project: review project profitability in right side panel
This commit reviews the project profitability displayed in right side
panel of project update kanban view. The goal of this commit is to add
more information to allow the user to see all information concerning the
profitability of his project.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 7f218598fe [IMP] project_purchase: improve performance for purchase_orders_count
Before this commit, when the `purchase_orders_count` field is computed,
we do a search in `purchase.order.line` to get the purchase order linked
to the projects in `self` of the `_compute_purchase_orders_count`
method. However, if no project has AA set this search is useless, we can
directly set `purchase_orders_count` to 0 for all projects because the
linked between the POs and the projects is made with AA of the project.

This commit changes the method to search the PO linked to the projects
only when at least one project has AA set, otherwise we directly set the
`purchase_orders_count` to 0 for all projects contained in `self`.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 265a45a0c6 [FIX] sale_timesheet: fix timesheet_invoice_type compute when amount<0
Before this commit, when the user creates an expense for the project and
reinvoice it. When this expense is approved and a post entry is
generated. An SOL is created in the SO and also a AAL to take into
account the cost. However, the `timesheet_invoice_type` for this AAL is
equal to `service_revenues` even if the amount is less than 0. The
reason is when the AAL is not a timesheet and linked to a SOL
containing a service product than the AAL is considered as a service
revenue even if the amount is less than 0 but in this case, the AAL is a
cost and not a revenue.

This commit fixes this issue by checking if the amount is greater or
equal to 0 to set the `timesheet_invoice_type` to `service_revenues`
otherwise we set to `other_costs`.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 7c3e8cf963 [IMP] sale_{project,timesheet}: get sales order items linked to the project
This commit renames some methods and add a query into timesheets to also
fetch the SOLs linked to the timesheets linked to the projects. So, now
all SOLs selected in the project app for that project will be take into
account.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 4567edf97e [ADD] sale_project_stock: show stock.move when click on SOL in project update
This commit adds an action to allow the user to click on SOL contains
other project than product one to see the `stock.move` related of the SOL
clicked.

task-2710808
2022-04-01 15:32:59 +02:00
Xavier BOL (xbo) 08501fa130 [IMP] project,sale_{project,timesheet}: review 'Sales' section in project update
This commit completly reviews the Sales section. This section will
display all Sales Order Items linked to the current project shown
instead of displaying the sold section with the total sold section.
This section will shown the name and ordered, delivered and
invoiced quantities for each Sales Order Item related.

The name displayed in this section will be clickable if the product linked to
the Sales Order Item is a service one and if there is at least one
timesheet linked.
Finally, this commit also moves the Sales section initially defined in
sale_timesheet module into the `sale_project` one.

task-2710808
2022-04-01 15:32:59 +02:00
Xavier BOL (xbo) 80bf615bbb [REM] project_*,{hr,sale}_timesheet: remove some stat buttons in project update
This commit removes stat buttons displayed in the right side panel in
project update kanban view to prepare the revamp of the content
shown in that project update. Indeed, the content in the right side
panel will show the information shown in those stat buttons but with more
details.

task-2710808
2022-04-01 15:32:59 +02:00
Andrea Grazioso (agr-odoo) fc535a62f4 [FIX] account: traceback when adding tax on a tax-free model
Have a Reconciliation model [DEMO] without tax
Create a bank statement
Open reconciliation widget
Select 'Manual Operation', select [DEMO], add any tax

Traceback will raise
This occur because the server will generate a line without `tax_ids`
field, that will remain undefined in the frontend

opw-2777191

closes odoo/odoo#87704

X-original-commit: 08f5dc605ccf42429d6405ec6c192322909c6c34
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-04-01 15:07:09 +02:00
Miquel Raïch 0675222da6 [FIX] l10n_es: improve some tax descriptions
closes odoo/odoo#87615

X-original-commit: 288b5460a239ddfc02077afb7ec53611304f71af
Signed-off-by: Olivier Colson <oco@odoo.com>
2022-04-01 15:07:05 +02:00
Xavier Morel 6c3bbdbef8 [FIX] core: fix "generator didn't yield" in assertRaises
Because the `savepoint` and `clear` calls are nested inside the
`assertRaises` context, if one of them happens to throw *the exception
we're looking for* the interpreter will jump back to the `with`, the
`assertRaises` will swallow the exception (and count it as a success)
and the function will end having not gone through a `yield`.

This is rather frustrating to debug as it's easy to forget that a
`with` is a control flow structure, leading to a seemingly impossible
error.

We can fix this by initializing and `__enter__`-ing the savepoint
first, but doing this by hand is a bit iffy and not really
future-proof as the addition of more fallible steps during the
initialization phase of `_assertRaises` could lead to the savepoint
not being properly disposed of. Furthermore once in the scope of the
"actual" assertRaises we want the savepoint to unwind first (otherwise
the savepoint won't be rolled back when the exception *we are
expecting* gets raised).

As it turns out `ExitStack` offers the solution to our woes though
it's a bit tricky at first glance: while modifying the cleanup queue
in-place is haram, `pop_all` allows moving cleanup callbacks from one
queue to the next.

This means we can first add the savepoint to one stack and get its
errors (if any) correctly reported, cover the rest of the
initialization, then move the savepoint from one stack to an other, in
order to correctly order the coverage of the `yield` (and the userland
code).

closes odoo/odoo#87733

X-original-commit: b1cd4e4e3c918b4b08d27b30b1017fc898d4b08a
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-04-01 13:37:21 +02:00
Odoo's Mergebot c8a5766b7e [FW][ADD] fetchmail_outlook, microsoft_outlook: add OAuth authentication
Purpose
=======
As it has been done for Gmail, we want to add the OAuth authentication
for the incoming / outgoing mail server.

Specifications
==============
The user has to create a project on Outlook and fill the credentials
in Odoo. Once it's done, he can create an incoming / outgoing mail
server.

For the authentication flow is a bit different from Gmail. For Outlook
the user is redirected to Outlook where he'll accept the permission.
Once it's done, he's redirected again to the mail server form view and
the tokens are automatically added on the mail server.

Technical
=========
There are 3 tokens used for the OAuth authentication.
1. The authentication code. This one is only used to get the refresh
   token and the first access token. It's the code returned by the user
   browser during the authentication flow.
2. The refresh token. This one will never change once the user is
   authenticated. This token is used to get new access token once they
   are expired.
3. The access token. Those tokens have an expiration date (1 hour) and
   are used in the XOAUTH2 protocol to authenticate the IMAP / SMTP
   connection.

During the authentication process, we can also give a state that will
be returned by the user browser. This state contains
1. The model and the ID of the mail server (as the same mixin manage
   both incoming and outgoing mail server)
2. A CSRF token which sign those values and is verified once the browser
   redirect the user to the Odoo database. This is useful so a malicious
   user can not send a link to an admin to disconnect the mail server.

Task-2751996

closes odoo/odoo#87731

Forward-port-of: odoo/odoo#87682
Forward-port-of: odoo/odoo#87040
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-01 13:37:17 +02:00
std-odoo bcdf9e12a8 [ADD] fetchmail_outlook, microsoft_outlook: add OAuth authentication
Purpose
=======
As it has been done for Gmail, we want to add the OAuth authentication
for the incoming / outgoing mail server.

Specifications
==============
The user has to create a project on Outlook and fill the credentials
in Odoo. Once it's done, he can create an incoming / outgoing mail
server.

For the authentication flow is a bit different from Gmail. For Outlook
the user is redirected to Outlook where he'll accept the permission.
Once it's done, he's redirected again to the mail server form view and
the tokens are automatically added on the mail server.

Technical
=========
There are 3 tokens used for the OAuth authentication.
1. The authentication code. This one is only used to get the refresh
   token and the first access token. It's the code returned by the user
   browser during the authentication flow.
2. The refresh token. This one will never change once the user is
   authenticated. This token is used to get new access token once they
   are expired.
3. The access token. Those tokens have an expiration date (1 hour) and
   are used in the XOAUTH2 protocol to authenticate the IMAP / SMTP
   connection.

During the authentication process, we can also give a state that will
be returned by the user browser. This state contains
1. The model and the ID of the mail server (as the same mixin manage
   both incoming and outgoing mail server)
2. A CSRF token which sign those values and is verified once the browser
   redirect the user to the Odoo database. This is useful so a malicious
   user can not send a link to an admin to disconnect the mail server.

Task-2751996

X-original-commit: 18dad5b13b0af81ef2089fc039b3a866a2895a53
Part-of: odoo/odoo#87731
2022-04-01 13:37:16 +02:00
std-odoo 1d63e668e2 [IMP] {microsoft, fetchmail}_outlook: do not reset the email config
Purpose
=======
Do not reset the email configuration when unchecking "is Gmail".

Task-2751996

X-original-commit: d65aef9829cf5554c8d4a6c107ba5269a054ed78
Part-of: odoo/odoo#87731
2022-04-01 13:37:16 +02:00
std-odoo fdde704712 [FIX] google_gmail: do not copy the authorization code
Bug
===
When we copy a GMail outgoing / incoming mail server, an error
occurs because we try to refetch the access token, based on the same
authorization code (which can be used only once).

To fix this issue, we do not copy the authorization code (and other
related fields).

Task-2751996

X-original-commit: 47c056215c5f50d8a1d9e862ee275eceefdb09e7
Part-of: odoo/odoo#87731
2022-04-01 13:37:15 +02:00
Kevin Baptiste 6c5f38ae37 [IMP] hr_recruitment: improve flow (back2basics)
* Redesign views
    * New layout for the job kanban card + redesigned menu
* Create new reports
    * Candidate Sources: get a better view on where applicants are
      coming from;
    * Time in Stage: shows how long an applicant is in the current
      stage.
* Archiving a job archives applicants as well

odoo/enterprise#24816
odoo/upgrade#3395

closes odoo/odoo#85479

Taskid: 2738082
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-04-01 13:37:09 +02:00
Kevin Baptiste 80c662f808 [IMP] survey: hide website navbar
The website navbar was showing again, whilst it should not.

Taskid: 2738082
Part-of: odoo/odoo#85479
2022-04-01 13:37:08 +02:00
Brieuc-brd dcf3d6e508 [REF] mail: ComposerSuggestionList, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2781992

closes odoo/odoo#87719

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-01 12:31:11 +02:00
Brieuc-brd 0edc49c56a [REF] mail: ComposerSuggestion, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2781992

closes odoo/odoo#87534

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-01 12:31:07 +02:00
william 08ef4e9223 [IMP] account: detect holes in sequences
The resequence feature and the possibility to edit the invoice number in
draft are powerful flexibility tools. Though, misusing them can lead to
holes in a sequence that can be hard to detect.

This task aims at providing alerts on the dashboard (on Sales and
Purchases journals' cards) highlighting the holes in the sections

_____________

Suppose the following sequence on a journal

BILL/2022/01/0001
BILL/2022/01/0002
BILL/2022/01/0004

> BILL/2022/01/0003 is missing.

Then show a link on this journal's card in the kanban view of journals
(accounting dashboard) mentioning.

> Check the sequence

Pressing the button opens the list view of bills on this specific
journal.

BILL/2022/01/0004 appears in red ; since it is after a hole

task-2767272

closes odoo/odoo#84788

Signed-off-by: Laurent Smet <las@odoo.com>
2022-04-01 12:31:03 +02:00
Aaron Bohy dba9cd97ef [IMP] web: qunit: add tests counter in topbar
This commit adds an information in the topbar (thus always visible)
to indicate the number of tests that have passed, failed and the
number of tests that have been skipped.

closes odoo/odoo#87713

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-04-01 10:36:18 +02:00
Leonardo Pavan Rocha e0c922c82a [IMP] google_calendar, hr_holidays, hr_work_entry_holidays: update query count
In 2685472 new computed fields were added in calendar_event. This commit
updates the query counter tests that were failing.

task-2685472

closes odoo/odoo#79654

Related: odoo/upgrade#3182
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-04-01 10:36:10 +02:00
Leonardo Pavan Rocha 1744a800dc [IMP] calendar: add discuss video url in calendar
This commit aims to integrate the calendar module with discuss video calls.
Now it is possible to add discuss videocalls by clicking on a button below
the videocall_location field. The discuss videocall_location is a URL that
is computed and it creates a discuss channel only when someone accesses that
URL.

For recurring events, the same discuss channel is used for all events.
However, each event in the recurrency has its own videocall_location URL.
This is done on purpose in order to allow the functionality even if the base
event of the recurrency is deleted. For single events, each event will create
a discuss channel.

task-2685472

Part-of: odoo/odoo#79654
2022-04-01 10:36:09 +02:00
Leonardo Pavan Rocha a338b66bf0 [IMP] web: allow js_class in FormViewDialog
This commit allows custom classes (js_class) to be used in FormViewDialog.

task-2685472

Part-of: odoo/odoo#79654
2022-04-01 10:36:09 +02:00
Leonardo Pavan Rocha 7373cdfdcf [FIX] calendar: title undefined when double clicking event
Currently in calendar if you double click an event in the calendar view, it
opens a dialog with the event title as undefined. This occurs, because the
title is not correctly passed in the context. This commit adds the correct
title to it, therefore fixing the error.

task-2685472

Part-of: odoo/odoo#79654
2022-04-01 10:36:09 +02:00
dbkosky e2d90dee10 [FIX] l10n_it_edi, l10n_it_edi_sdicoop: Translations and better filter names
Italian translation added.

Add string parameter to the fields so that the filter names are more
usable. Since the filter names are taken automatically from the field
names, the string paramter allows us to change the filter names:
L10N It Edi Transaction -> FatturaPA Transaction
L10N It Edi Attachment  -> FatturaPA Attachment
L10N It Send State      -> FatturaPA Send State

closes odoo/odoo#87711

Task-id: 2795241
X-original-commit: 6473aa55f08d130119aceb15deee68eb041bf25e
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2022-04-01 09:38:49 +02:00