Commit Graph
150205 Commits
Author SHA1 Message Date
Aurélien Warnon de324e682b [IMP] mail: allow opening the chat window when inviting members to a channel
Currently, when inviting members to a mail.channel using the "add_members"
method, it is not possible to signal to web client to automatically open that
conversation in a chat window.

This commit adds a parameter to that method to allow that behavior, and also
slightly adapts the notification handling to open the chat window accordingly
on the web client side.

This is necessary for the upcoming chatbot, where we want to invite operators
to the channel and make them see the new conversation immediately.

Task-2030386

Part-of: odoo/odoo#84000
2022-04-01 18:49:56 +02:00
Aurélien Warnon 89eb064977 [IMP] mail: allow not posting join notifications when adding members
Currently, when adding members to a mail.channel using the add_members method,
we always post notification message on the channel mentioning that someone has
joined the channel / was invited to join by another user.

This commit simply adds a method parameter allowing to disable that behavior.

This change is necessary for the upcoming chatbot, where we want to add members
but handle the join notifications differently.

Task-2030386

Part-of: odoo/odoo#84000
2022-04-01 18:49:56 +02:00
John Laterre (jol) 5d0111d079 [IMP] base: prevent blocking access to commerical fields
Currently, when creating a partner, there could be a situation
in which a commerical field has some access restriction
due to `groups` being set on a the field declaration.

The `sudo()` makes sure it does not happen.

closes odoo/odoo#83205

Related: odoo/enterprise#25828
Signed-off-by: William André (wan) <wan@odoo.com>
2022-04-01 18:49:46 +02:00
John Laterre (jol) ff0275be6b [IMP] account: credit limit by partners
The basic idea of this functionality is for users
to be able to put limits on Partners that would
trigger non-blocking warnings when trying to confirm new:

- Sales Orders
- Invoices

when that partner has too many open invoices.

task-2722165

Part-of: odoo/odoo#83205
2022-04-01 18:49:46 +02:00
Wolfgang Taferner f826718365 [FIX] stock_account: stock inventory garbage adjustments
In case you applied inventory in batch the system would create a lot of useless
stock moves and stock move lines.

closes odoo/odoo#87771

X-original-commit: 07f18f62db490608b316cc9482f228252ed8fc63
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Wolfgang Taferner <w.taferner@wtioit.at>
2022-04-01 17:57:02 +02:00
roen-odoo 9788447a7a [FIX] web: Avoid showing bootstrap error
Current behavior:
In some particular cases bootstrap was throwing an error "Uncaught Error: Please use show on visible elements"
wich appeared on the users screens.

Steps to reproduce:
- Could only reproduce on copy of clients Db
- Go in CRM and go in any lead
- Create a new activity
- Swap to an activity with less fields
- Then quickly put your mouse on the top of a field that just disappeared
- The "Please use show on visible elements" error appears.

Here's a video where I reproduce it on clients Db : https://watch.screencastify.com/v/gksBwwF0McirZzSFwaAP

opw-2720853

closes odoo/odoo#87770

X-original-commit: 3404c9500fad4004d6d8beef6041ac51439078cd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-04-01 17:56:58 +02:00
Alexandre Kühn 68ef0cd276 [IMP] mail: remove ComposerSuggestionComponent/is getters
Task-2793280

closes odoo/odoo#87735

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-01 17:56:54 +02:00
thcl-odoo ce0648adce [FIX] mail: take all messages into account on unlink
Current behavior :
When you delete a record (for example project.task), all the messages related
to this record aren't deleted.
This, in case a user has his notifications managed in Odoo, may prevent him
from accessing the History tab in the Discuss app because these messages are
linked to a record that doesn't exist anymore and it will raise a Missing Record
error

Steps :
*with demo data*
- Install Project
- Make Marc Demo notifications managed in Odoo
- Delete a task project to which Marc Demo is assigned
(*with Marc Demo*)
- Go to Discuss and try to access History tab

OPW-2764855

closes odoo/odoo#87732

X-original-commit: ee8feeb73c920827090b1a5ecf78e8b1d21bbae4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
2022-04-01 17:56:50 +02:00
Julien Castiaux 814a34c3c9 [FIX] http_routing,website: missing request attribute during install
Steps to reproduce:

1) start from a clean database (http_routing should not be installed).
2) go to the app menu and install project (don't install via `-i`!!).
3) traceback: `request` has not attribute `is_frontend` while rendering
   a template.

The `is_frontend` attribute on request is set by the http_routing
module. At the moment the "install now" button is clicked, http_routing
was not installed so the `is_frontend` attribute was not set.

FF to the end of the installation: the registry is reloaded to include
the modules that have been installed, http_routing among them.

We are in a tricky situation: (1) there is a request, (2) http_routing
is installed and (3) the `is_frontend` attribute is missing from the
request.

This situation is illegal, when http_routing is installed, the
`is_frontend` attribut should always be set. In this work we reset the
missing attributes using sensitive default values via post-init hooks.

closes odoo/odoo#87684

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-04-01 17:56:45 +02:00
Nicolas (vin) e2b3ec6d5c [IMP] account_*: some Back2Basics improvements
Improve a few things in accounts modules:
    - Users wants to be able to change the account in the general ledger
    list view
    - Do not group by date by default when auditing a tax line.
    - Make the currency fields only show in debug mode for accounts and assets
    - Disallow to delete taxes linked to a tax repartition line, and
    clarify the error message when trying to delete one linked to a
    fiscal position's account mapping

Task id # 2810379
[IMP] account_*: some Back2Basics improvements

Improve a few things in accounts modules:
    - Users wants to be able to change the account in the general ledger
    list view
    - Do not group by date by default when auditing a tax line.
    - Disallow to delete taxes linked to a tax repartition line, and
    clarify the error message when trying to delete one linked to a
    fiscal position's account mapping

Task id # 2810379

closes odoo/odoo#87659

Related: odoo/enterprise#25770
Signed-off-by: Laurent Smet <las@odoo.com>
2022-04-01 17:56:38 +02:00
Florian Charlier f0e1e60528 [IMP] {*_,,}event{,,_sms}: update sms reminder template
* = website

Change the wording of the sms reminder template to make it sound friendlier and
more complete. The sms will include the event address if it is defined.
Otherwise, it will link to the event page if website is installed.

A one line-formatted version of the venue is added to the model to be used in
the template and other places.

This required to update `event_registration.get_date_range_str` to not include
the time when describing an event happening more than a month from the current
date, which makes sense as there is no reason to specify the time only in that
case, and we add the time somewhere else when it's useful anyway.

For consistency, Wembley Stadium is updated to London timezone in the demo
data.

Task-2777183

closes odoo/odoo#85664

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-01 17:56:24 +02:00
Pierre-Yves Dufays eca543ef40 [REM] mail, sms, snailmail: discard notifications without confirmation
Skip the confirmation step when wanting to get rid of a notification
for emails, sms or letters that were not sent.

Technical:
- All 3 wizards to confirm the discarding of the notification have been removed
(the ones for mail, sms and letter) have been removed
- The method to discard notification has been centralized in MailThread
(notify_cancel_by_type in addons/mail/models/mail_thread.py)
- This centralization has been done as well on the client code as the same
server code is called whether it is a mail, a sms or a letter
(in addons/mail/static/src/models/notification_group/notification_group.js)
- Existing front and back test have been adapted
- A test of notify_cancel_by_type for mail has been added
(addons/test_mail/tests/test_mail_management.py)
- add missing author_id in mail_notification demo data

Task-2752190

closes odoo/odoo#84452

Related: odoo/upgrade#3246
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-01 17:56:20 +02:00
Florian Charlier e82e12e3a4 [IMP] calendar: improve UI/UX
A reorganization of the calendar alarm form view was necessary for easier
extension with new fields
(such as the one from appointment, see links).

The partner is now the author of notifications about their invitation
(instead of public user).

Task-2709580
See odoo/enterprise#23191

closes odoo/odoo#82387

Related: odoo/upgrade#3383
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-01 17:56:00 +02:00
Andrea Grazioso (agr-odoo) 1554ffd74d [FIX] point_of_sale: no fiscal position in refund
- Create a fiscal position [FPOS]
- Assign [FPOS] to a customer [DEMO]
- Add [FPOS] to the available fiscal positions of POS
- Open pos session, add a product, select [DEMO], [FPOS] will be
automatically selected. Confirm order and pay
- Click on refund button and select the previous order

[FPOS] will not be automatically selected for the refund order

opw-2799179

closes odoo/odoo#87503

X-original-commit: 4f8e257f2fc8e3d505342f9e1d6cb243a25e83e2
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-04-01 16:48:08 +02:00
Xavier BOL (xbo) e26bdb3282 [IMP] project,*: sort the row displayed in profitability section
Before this commit, the order of rows shown in costs and revenues is not
fixed and depends on the order of the modules.

This commit adds a sequence on each row and then sort the rows to fix
the order of those rows.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 88d94c852a [IMP] sale_timesheet: add billable_{milestones,manual} in timesheet_invoice_type 2022-04-01 15:33:00 +02:00
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