Generic improvements have been made to improve the Project App and its onboarding.
## Web module
- kankan examples modal: change the 'use this for my kanban' button into 'use this for my project'. To do this, a small change is made in the web module to use the options variable called `applyExamplesText` to change the label of the button in project app.
- A private method called `_getFavoriteIcon` is added in `FavoriteWidget` to easily change the icon based on the boolean value when we override this widget in another module.
## Project App
For project.task model:
- the label of the priority label has been changed from "Priority" to "Starred".
- the user_id field should not be clickable in form view.
For project.project model:
- the fa-star icon has been replaced by the fa-bookmark and fa-bookmark-o icons in the kanban view.
- When the user is the 'Project User', the 'share' button and 'project overview' stat button are hidden in the project form view.
- the 'sales order' stat button is only visible to users who have at least the `sales > all documents access right level` in project form view.
task-2440564
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#65095
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In a multicompany environment, when a expense is created from the
expense email alias, the expense account is computed with SUPERUSER
context, so depending on the SUPERUSER set company, we could get
a mismatch of expense and employee's company and the account one, wich
causes a subsequent error when trying to post the expense.
closesodoo/odoo#65413
X-original-commit: da758c44b19a9339f0c0b1b6a74c11e3e5491a64
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: simongoffin <sig@odoo.com>
Followup to odoo/odoo#65314: turns out there's a bunch of other leave
requests in the file which will eventually fall on a weekend, and will
probably blow up due to the new validation in 14.0:
- hr_holidays_sl_al in March 2021 because April 17th, 2021 is a
saturday
- hr_holidays_cl_mit_2 in June 2021 because June 5th, 2021 is a
saturday
- hr_holidays_sl_vad in September 2021 because September 25th, 2021 is
a saturday
- hr_holidays_sl_kim in April 2021 because May 1st, 2021 is a saturday
- hr_holidays_sl_kim_2 in March 2021 because July 3rd, 2021 is a
saturday
Solution
========
Instead of hard-coding month-days, move to the first monday after the
original date e.g. if we were looking for the 20, now get the monday
after the 22. In relativedelta terms, `weekday=0` is "the next
monday". The date is then formatted inclusive of the month-day rather
than hard-coding one.
One nit is for the end date:"the next wednesday" may come before "the
next monday" if we're on TU or WE. So we need to first jump to the
next MO *then* to the WE after that, which makes the code a bit
longer (and more redundant). As a result the end date is now "the
wednesday after <the start date>" rather than being a literal 2 days
later or whatever.
The PR updates all the 1-day and 2-day intervals, it also updates the
3 days inclusive (those over 3 which include start and end dates
rather than without) including those updated by #65314 for clarity /
coherence of small intervals. Longer intervals are left untouched,
although we may eventually want to update them so `number_of_days`
computations are more reliable.
Redundancy issues
-----------------
There are a bunch of redundancies / verbosities which don't seem
easy or possible to remove:
* While lxml does resolve entities by default it doesn't load
DTDs (let alone validate them), aliasing various datetimes
& deltas as entities is not an option, not to mention for security
reasons we'd rather stop resolving entities entirely than allow
custom ones.
* While it's possible to define nested safe_eval'd `context` on nodes,
the evaluation context for *those* contains neither datetime nor
relativedelta, so storing a bunch of constants in the (environment's)
context and using that in the expression is not an option either.
* Leaving `date_from`/`date_to` off of some records breaks, probably
because some other field necessary to properly compute *them* is
missing.
Other changes
=============
* Removed explicit settings to `number_of_days` and explicit calls to
`_compute_number_of_days`, seems redundant and unnecessary as the
compute works fine as long as we let it.
* While at it, updated the calls to `action_approve`: moved them next
to the corresponding record (instead of being on the other side of
the file) and used direct references to the subject records rather
than complicated searches.
* Also updated two leave allocations to be created validated OOTB
instead of manually calling action_validate as that's what's being
done elsewhere in the file.
Notes
=====
* In relativedelta lingo, "the next X" is inclusive of the current
date e.g. when looking for the next WE, if the date being offset is
already WE there will be no movement, this can be unexpected.
* Normally relativedelta would be used with the MO/TU/WE/... constants
for weekdays, but we're not exposing those to `@eval` so integer
literals it is.
closesodoo/odoo#65430
X-original-commit: 7840b21483c0012174e6028a39b114ce56f06158
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
When changing the bank account by the outstanding account of a payment, invoice's payment_state should be recomputed by the orm.
So, when writing 'account_id' on the liquidity line, 'is_matched' must be recomputed on payment (_compute_reconciliation_status). Then, if reconciled to some invoices, 'payment_state' must be recomputed as well (_compute_amount).
closesodoo/odoo#65427
X-original-commit: 7caf5316407ab8950216592e38551f29207076de
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
The purpose of this task is to clean up and provide clear export
file names.
Currently, When exporting data:
- From a pivot view, the file name is 'table'
- From a list view, the file name is technical name of model
so in this commit, Change the export file name as below:
- For list view quick export and standard record export,
the filename will be 'model_description(model_technical_name)'
- For pivot view quick export,
the file name will be 'Pivot(string set on view)(model_technical_name)'
and if string is not set then 'PivotUntitled(model_technical_name)'
In all the cases space and forward slash will be removed.
closesodoo/odoo#64123
Taskid: 2237840
Related: odoo/enterprise#15579
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Issue
- Install "Field Service" app
- Create new task
- Try to select Planned start/end date and valid
Daterange picker is hiding when trying to scroll down to valid selection.
Cause
The daterange picker is closed when ev.target is not inside the picker,
however ev.target always return the document element.
Solution
Do not hide daterange picker on scrolling if on mobile.
Note : It will only apply if scrolling on the daterange picker and
will still hide if scrolling outside this last one.
opw-2428099
closesodoo/odoo#65435
X-original-commit: 1d9b6f56e70faee13cda0ccb9893ed49904ab319
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Filling the new column in SQL is dramatically faster than doing it via
the ORM, which iterates over all the records in the table.
The test case is creating a related field for 100+ records with distinct
values. Setting the field's value was taking more than 100 queries. It
now takes 3 queries.
task-2449313
opw-2380445
opw-2389376
https://github.com/odoo/enterprise/pull/15910closesodoo/odoo#65432
X-original-commit: d66652b4aa514546356306e3eb48eaecaba07c33
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This tour js is used to check if the process is not broken. To do this,
we create an unit test to launch this tour js.
Before launching this test we create a prepaid service product in the
unit test.
Steps of this tour js:
1) Go to the Sales app,
2) Create a Sales Order with the prepaid service product and we order 10
hours for this product.
3) Go to the Project App,
4) Create a billable project to timesheet for the customer who orders
these hours,
5) Create task in this project and add a timesheet into it,
6) Show in this task, we can see the Sales Order Item linked to the
created timesheet, because this field is hidden by default.
7) Go to the Settings > Projects,
8) Create a new project and show the three different
configurations to invoice services in a project. That is, 'task rate',
'project rate' and 'employee rate'.
task-2439304
This commit add a test for project with pricing_type in ['fixed_rate',
'employee_rate']. This test checks when the user changes the partner_id
in the project, if the SO and SOL in project and also in mapping are
removed if the customer selected isn't the one in the SO.
task-2439304
This commit removes the project.task.create.sale.order model because
this wizard is no longer used. Before we use this wizard to create a SO
from ticket and task, but in reality this feature is no used.
The test using this wizard has been changed to keep the behaviour of it.
This test checks if the invoiced timesheet does not change the project
when the linked task changes the project.
Moreover, the both projects used in this test have been switched because
when we invoice the SO the timesheet is in the template project and this
one is not billable.
Thus, we create no invoice. To create an invoice as we expect, we must
have the timesheet in the global project.
task-2439304
This test check if the compute method for the remaining_hours field in
the SOL containing a prepaid service product is correct and also the one
for the remaining_hours_so field in the task which contains a SOL with
prepaid service product.
task-2439304
This commit adds a test to check if the user can manually edit a
SOL in timesheet model. If he do this, then we also check the SOL
doesn't change when the SOL in task changes. Also, we check the
qty_delivered changed for each SOL impacted.
task-2439304
Before this commit the user who has the
sales_team.group_sale_salesman group can access to the Sales Order stat
button in project and task form view. The problem is if the Sales Order
is not own one, he cannot access to it.
This commit changes the visibility of this button to show it when the
user has sales_team.group_sale_salesman_all_leads group.
task-2440564
Before this commit, the user who is not a Project Manager can access to
the project overview.
This commit removes this access to give this access only for the Project
Manager.
task-2440564
Before this commit, the user who is not a Project Manager can share the
project based on the visibility of the project.
This commit hides this button for this user, only the Project Manager
can use this button.
task-2440564
Before this commit, the user can click on the user_id field in
project.task form view to see the user form view of the user linked in
the current task.
This commit adds an option (no_open=True) in this field to prevent the
user to access the user form view.
task-2440564
Before this commit, the customization of text in button to apply kanban
example is never used because the variable which contains the text is
missspelled and thus is always undefined. That's why, we always have the
default text in this button.
This commit changes the `options.applyExampleText` to
`options.applyExamplesText` to get the text customization in project
module for instance and adds a test in order to check that the text
is well rendered.
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
task-2440564
Closes#65095
All fields not provided default to 0, so the the exact values are
`%Y-%m-20 00:00:00` - `%Y-%m-22 00:00:00`.
Because this is only 2 days it can entirely overlap with a week-end
(e.g. 2021-02-20/21), leading to `number_of_days` computed to 0 and
triggering an error at confirmation (`"The following employees are not
supposed to work during that period"`).
Change familly trip as the same issue would occure in May 2021
closesodoo/odoo#65326
X-original-commit: ada1da9a0cea6aaa3f91ee34fd3b273be79e1e3d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Steps to reproduce the bug:
- Let's consider a user U with fr_BE as lang
- Log as U and active developper tool
- Go on any record, click on debug button
- Select Technical translation
- Choose a translation and click on the transifex url button
Bug:
The URL contained the iso code fr_BE but this iso code didn't match
any code in Transifex.
From: https://www.transifex.com/odoo/odoo-14/languages/
We can see that the only iso codes with a '_' are: 'zh_CN', 'zh_TW', 'pt_BR'
opw:2448533
closesodoo/odoo#65308
X-original-commit: d609a75ccbfaa62b6070de4769880a94d896ff73
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: mart-e <mat@odoo.com>
When the suspense account is not reconcilable, 'suspense_lines.reconciled' always gives 'False' leading to a not reconciled statement line.
closesodoo/odoo#65290
X-original-commit: 73ddcfbcc58b7a6542ced4bd8b20dd67c9f446ee
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Purpose
=======
The parameter "lead_enrich_auto" enable or disable the enrich CRON.
This is done in an onchange and so, if we enable manually the CRON, the
change will not be reflected on the parameter.
Task 2443338
closesodoo/odoo#65007
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps:
- Go to Settings > Companies > Manage Companies
- Create a company (1) with a different currency than the one you're in
- Go to inventory > Products > Products > Create a product (2)
- Storable Product
- Cost: 10
- Click Update Quantity
- Create a new quantity line with 1 in On Hand Quantity
- Switch to company (1)
- Go to Inventory > Products > Products > Edit product (2)
- Storable Product
- Cost: 15
- Click Update Quantity
- Create a new quantity line with 1 in On Hand Quantity
- Go back to the product
- Click the "Forecasted" smart button
Bug:
Traceback here:
https://github.com/odoo/odoo/blob/47bfdf0592a5dd93870ca1a9da326351d70087bb/addons/stock_account/report/report_stock_forecasted.py#L17
ValueError: Expected singleton: res.currency(2, 1)
Explanation:
The amount is the sum of the `stock.valuation.layer`s of a product
across all companies and these companies may have different currencies.
This commit scopes the computation of the amount inside the company of
the current warehouse.
Also the `stock.quant` values displayed in the "On Hand" report are not
correct for the other companies when displaying their data by selecting
all the checkboxes in the global company dropdown.
This commit also fixes the amounts in the On Hand view by using the
standard price per company and attributing the correct currency to the
`stock.quant`.
opw:2444593
closesodoo/odoo#65267
X-original-commit: 67d975be75963678d25ae54289b2f1de639c8bed
Signed-off-by: backspac <backspac@users.noreply.github.com>
What are the steps to reproduce your issue ?
1. Install project
2. Open any project
3. Switch to list view and display by Stage
4. Open categoryA and select some records
5. Open CategoryB
What is currently happening ?
The button create is not displayed
What are you expecting to happen ?
Don't hide create button
opw-2423701
closesodoo/odoo#65266
X-original-commit: 813b9fc42f5d0cc4e35afb642291200b90d1f545
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
By default, the `ls` command has a width limit. Everything after this
limit will be split on a second line.
This happened when listing the modules present on the Iot Box in v12.
The list of modules was split accross two lines, the modules on the
second line were then not loaded when starting the Odoo service.
closesodoo/odoo#65259
X-original-commit: 60b58322dc803dfbf734374b63f9556563a19b8f
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
With commit[1], we introduced a feature that from the sales team, we can
see the overdue opportunities for a particual teams. However, the filter
that we use for related action which is supposed to show overdue opportunities
is not not added, and the filtration is not working as expected, showing us
all the opportunites for a team.
This commit fixes the issue by adding the invisible filter with proper
domain set within opportunities' search view and thus enables us to
filter overdue opportunites.
commit[1] - https://github.com/odoo/odoo/commit/1da63f0ab0fb4212bee46f960c6bbe8ca9251cac
TaskID : 2323612
closesodoo/odoo#65258
X-original-commit: 68577d32c7fe0cb18ba4fb788cee65ec8b54b65b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Scenario:
- create mass mailing with icons and without title
- save and get error "The followign fields are invalid: Subject"
- fill subject and save
- edit
=> the icons have disappeared
This is because mass mailing widget is using:
- a "body_html" field that contains inlined html
- a wysiwyg editor to edit field "body_arch"
- a textarea containing "body_arch" value to be saved
When we save this happens:
1. we save the current value of wysiwyg into textarea
2. wysiwyg content is inlined (eg. transforming font in image)
3. inlined wysiwyg content is set to "body_html" field
4. if there:
- is no error while saving => body_html and body_arch are saved and
will be used on next edition
- if there is an error the fields are not saved, and we now have an
inlined content on wysiwyg, so next time we save the "body_arch" is
going to be inlined:
=> this for example breaking the icons on edition
Issue discovered when fixing opw-2447756
closes#65208closesodoo/odoo#65221
X-original-commit: 0f5f53837bc403960e307ab85e9fe68423c23f5f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Currently, when new alias with an already used prefix is created, it shows the
warning stating "The e-mail alias is already used. Please enter another one."
It does not help much because the user do not know where the alias is used.
This commit improves the warning message by including the document name and
parent model name (if available) if the alias is linked to any model, or it
shows if alias is already used for handling bounce/catchall if that is the
case.
Task Id-2375552
closesodoo/odoo#62367
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Right now there is a button in the CRM settings called 'Update Probabilities'.
When clicking on it probabilities of leads created after certain date
are updated. Problem with this flow is that user can click on the button by
mistake and there is no going back.
Moreover this does not trigger a save on settings and changes done by user
are not saved. This is standard behavior of config settings.
This commit improves the behavior by opening a wizard on click of the button
instead of directmy updating the probabilities. It allows users to change
fields used in PLS, change start date, or even cancel the update process.
Task ID-2355562
closesodoo/odoo#60733
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When we "Install Newsletter Popup" from website editor
(which installs the 'mass_mailing' app), the snippet popup
doesn't open after setting a Newsletter.
This is because the code at 'website_mass_mailing' module
which has the following config:
'depends': ['website', 'mass_mailing'],
'auto_install': True,
Requires 'google_recaptcha.ReCaptchaV3' while 'google_recaptcha'
module is not installed.
The goal of this commit is to fix this issue by setting
'google_recaptcha' as a dependency for the 'website_mass_mailing'
module.
task-2312878
closesodoo/odoo#62715
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
before this commit: smiley box popover in rtl langauge takes full space it is
because of left:0 given on o_popover class by default, which will be converted
to right:0 when in rtl language and popover position will computed by popper
will set left:'some pixels' due to which it takes full space.
after this commit: smiley box will be displayed with expected width,
unnecessary will not be added, as we have removed left:0 css, hence it will not
be converted to right:0 when in RTL mode.
task-2418264
closesodoo/odoo#65419
X-original-commit: 0bd842ad62901499abb703c92b15496cdfa05cc0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
As user access the ecommerce and add to cart a free product (0$ total)
Checkout and Confirm
No email will be sent for confirmation
This occur because the confirmation email is normally sent in the
transaction callback, which is not created when the amount is 0
opw-2440335
closesodoo/odoo#65235
X-original-commit: ed3e69df1564eca3becdc57181608bc0211ca4c5
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Fine tunning of c8f031ad77, this commit has the missing code
compatibility for sms_calendar.
closesodoo/odoo#65064
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This PR adds two main features: quick edit and auto save
Quick Edit
---
The quick edit allows to click on fields in readonly form view to switch
into edit mode. After switching mode, the clicked field is automatically
focused.
A few fields have a custom quick edit behaviour after mode switched:
- checkboxes automatically toggle.
- radio buttons are set to the selected value.
- one2many list's cell are focused.
One2many list fields now show the "add a line" in readonly mode.
In order to minify the differences between edit and readonly modes
multiple things have been done done:
- a lot of `o_edit_only`,`o_read_only` labels have been removed and
`placeholder` have been set on fields in a lot of xml templates.
- the render function of many2one and x2many radio
fields have been changed to render them the same in edit mode and read mode.
- margins in inner form groups have been removed.
- a minimum height on rows has been set to align them.
- empty fields are now visible. (as a blank line)
Auto Save
---
Auto save is self explanatory.
With auto save, changing the pager, going back in the breadcrumb,
going to another action or clicking on a menu item doesn't ask to
confirm changes if any but automatically saves them.
In settings, the confirm dialog has been revamped.
We can now decide to "Save" or "Discard" the changes or "Stay Here" to
do nothing.
closesodoo/odoo#60693
Related: odoo/enterprise#14931
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps:
- Edit the current company (1):
- Country: Switzerland
- Currency: CHF
- Install l10n_ch
- Go to Invoicing > Configuration > Bank Accounts
- Edit Bank:
- Bank Account: create a new one:
- Account Holder: (1)
- Go to Configuration > Journal
- Edit Customer Invoices:
- Advanced Settings tab:
- Communication Standards: Switzerland
- Go to Customers > Customers
- Create a new customer (2):
- Fill in street, city, zip code and country
- Edit (2):
- Contacts & Addresses tab:
- Add:
- Select Invoice Address
- Contact Name: Keep this field blank
- Go to Customers > Invoices
- Create a new one:
- Customer: "(2), Invoice Address"
- Add a product
- Validate it
- Click Print QR-Bill
Bug:
Traceback here:
https://github.com/odoo/odoo/blob/b76e9ef658bde0178fa1660b6ad27b880e91632a/addons/l10n_ch/models/res_bank.py#L129
TypeError: 'bool' object is not subscriptable
Explanation:
The contact name of an address is optional. When nothing is filled in
that field, it returns `False`, hence the error.
Using the commercial company name ensures a name is put in the invoice,
even if the contact doesn't belong to a company.
opw:2447158
closesodoo/odoo#65417
X-original-commit: 2537bb01675279f08edf65077e6d41a5bd968ec4
Signed-off-by: backspac <backspac@users.noreply.github.com>
This commit makes the field html quick editable.
We can click on a field html to switch the form view to edit mode but
if we click on a link in the field, the link will have the priority.
task 2330101
This commit adds the quick edit behaviour.
The quick edit allows to click on fields in readonly form view to switch
into edit mode. After switching mode, the clicked field is automatically
focused.
A few fields have a custom quick edit behaviour after mode switched:
- checkboxes automatically toggle.
- radio buttons are set to the selected value.
- one2many list's cell are focused.
One2many list fields now show the "add a line" in readonly mode.
task 2330101
This commit adds the auto save for editable list and form views
but not for settings.
Now with auto save, changing the pager, going back in the breadcrumb,
going to an other action or clicking on a menu item won't ask to
confirm changes if any but will automatically save them.
In settings, the confirm dialog has been revamped.
We can now decide to "Save" or "Discard" the changes or "Stay Here" to
do nothing.
task 2330101
This commit does 4 things in order to reduce the shift when switching
mode in form view:
1. modifies the render function of many2one and x2many radio
fields to render them the same in edit mode and read mode.
2. removes margins in inner form groups.
3. sets a minimum height on rows to align them.
4. empty fields are now visible. (as a blank line)
task 2330101