ir.rule are default values but can be customized based on the
company's policy and needs.
This is typically a record that is in noupdate as should be
customization-friendly.
Let's assume a form view with an x2many list, containing itself
an x2many field (no widget, so simply displaying the number of
records). When a record of the list is clicked, a form view
opens and displays the same sub x2many field, with widget
many2many_tags. Both list and form views of the x2many aren't
inline (thus have to be fetched on demand).
Before this commit, it crashed when the user clicked on a row
of the x2many list.
The bug has been introduced by a9cebd5a, which wrongly removed the
code handling this specific situation. At least, now we have a
test attesting that this code isn't useless.
Note that the diff isn't as scary as it looks like (we just added
an if/else, and thus indented the former code inside the else
clause).
closesodoo/odoo#48116
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Currently when the 'active' field is exist in model but when not added
to the view then it will only display the 'unarchive' options on action
and it does not works as well.
So Find out some model and to fix that behaviour added the active
invisible field on the view so archive/unarchive should works properly
closesodoo/odoo#46839
Taskid: 2204135
Related: https://github.com/odoo/enterprise/pull/9000
Related: odoo/enterprise#9000
Closes: #46839
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
visitor.partner is a many2one to partner. But partner.visitor_ids is a
many2many.
The result is when you set the partner_id on visitor, the (what should be)
inverse field is not set accordingly.
This inverse field should be a one2many fields. This commit fixes the field
definition.
Task ID: 2127691
PR #40577
Related: odoo/upgrade#905
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently the quantity outside warehouse in the forecast report is erroneous.
It only takes the quants and not the stock.move incoming and outgoing for those location.
So the qty is only correct for the current datetime.
Remove this functionality and remove the filter 'warehouse is set' since it's always the case.
closesodoo/odoo#47997
Task: 2217047
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Currently when you create time off type with no validation and then
create new time off request, save and status is approved.
However, if you refuse the time off and reset to Draft and confirm it
then status will be 'To approve' when it should be 'Approved'.
So after this commit, on confirm of refused time off with validation
type 'no validation' automatically move to the 'Approved' instead of
'To Approve'.
closes odoo/odoo#48087
Taskid: 2206222
Closes: #47738
X-original-commit: 3d2391d350ea7ed572cf6818ab3f607c99fe0bf5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Importing 100 records and getting 100 errors (often the same every
time because a required field was not mapped) is not super useful and
spams the logs a lot.
Cutting off at one point seems useful.
Note: integrates warnings-related fix from #47972 reported by Grzegorz
Marczyński in #47936.
closesodoo/odoo#48095
X-original-commit: 6b05f1d13c862dd66e89f35607d072315be80995
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Purpose of this commit is to improve english wording in Odoo
regarding res.partner.industry model.
For that purpose we rename "Sectors of activity" with
"Industries" everywhere we use that naming.
Original feedback #2212682
Task ID #2214290Closes#47559
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
- install crm and mass_mailing
- go to crm > configuration > settings > activate leads
- go to crm > leads > select at least 2 leads > action > send mail
- set a subject > set a mass mailing name > send
Previous behavior:
you get a traceback
ValueError: Invalid field 'template_id' on model 'mailing.mailing'
Current behavior:
the mass mail is sent
opw-2212605
closesodoo/odoo#48088
X-original-commit: c87db90d5dbab4d02a9378a1fc905c9b2935cbe2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
- Create a 12% tax, price included
- Create an invoice for a single product @ 52.50
The total is 52.51.
This happens be cause the tax is computed on a non-rounded base amount.
opw-2198712
closesodoo/odoo#48084
X-original-commit: f307c29160675583c1c40ccf0f4452c6a1461cbe
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Install Germany - Accounting.
In General Settings, set "European A4 for DIN" as the Format and
"external_layout_din5008" as the layout.
Print Followup report letter
The report has misplaced elements, the other company address should be
present on the left and there is the extra address below the FollowUp
header.
Modifying the style to hide the address below the followup title
and the xml addon for din to fetch the address from the partner fix the
issue
opw-2187240
closesodoo/odoo#48057
X-original-commit: 2b9bf77c85c8840b9f585a59ee0ba4b8a3255120
Related: odoo/enterprise#9377
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit,
Hovering on a responsible on the right column of the calendar will:
- show a classic yellow tooltip
- show a custom tooltip with a bigger image
After this commit,
Hovering on a responsible on the right column of the calendar will:
- show a custom tooltip with a bigger image if image exist
else, show classic tooltip
PR odoo/odoo#45353
Task-2194828
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Otherwise, `_get_menu_ids()` won't be recomputed, meaning removing a group from
a menu won't make it appear for restricted user, and adding a group on a menu
won't hide that menu, until a clear cache occurs.
Introduced with 02e01dce516
closesodoo/odoo#48065
X-original-commit: 0131e6d9103f68950ee23c6b0ef1af972370416e
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Purpose of the task is to fix layout of kanban view in notes.
Currently the kanban view of the note is having bad layout of activity.
The activity is shown under the note and at left side.
After this commit, it will fixes the layout by setting the
float-right and mr4 in div of activity_ids and remove unnecessary
div of it and also adding the spaces above the images.
closes odoo/odoo#44445
Taskid: 2186292
Closes: #44445
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, if an action context would contain a key/value pair
like
search_default_foo : 0
the filter foo would be activated, while it should be not considered
as default.
The present commit fixes that situation.
closesodoo/odoo#47958
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Write on business field on account.move.line
may lead to an unbalanced move due to currency conversion
from the price_subtotal to debit or credit
How to reproduce:
You need to create an invoice in a different currency
than the company currency
The rate form currency to company currency should be much
bigger then 1 for example 8 or 10
Create a line the will have a pricesubtotal
with 3 decimal
For example:
price unit : 28.8
qty: 4
discount: 22%
the price_subtotal will be 89.856
rounded in the form to 89.86
Based on that with a rate of 7.79356837023608
You end up with a credit of 700.33
then write on the line, for example the analytic account
It will trigger the computation of the price subtotal
and directly with that value the credit
and you endup with a credit 700.30
which is not balanced with the 700.33 of the other line
Solution:
Always round the pricesubtotal computed with the currency before
using it in any further computation
closesodoo/odoo#47305
X-original-commit: a60017df0e947e32f0606ee1487224d2c00470a4
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Adding required fields on company model is annoying for tests. Indeed multi
company tests may run during module installation, notably in CRM. Those tests
generally require to create a new company which is not possible if the column
is required but module not already loaded in registry. This is the case
if for example account_invoice_extract is installed and updating CRM
when testing website_crm_score.
When possible, avoid required fields on a such used model as company. In this
case we simply make the field required in the view, and handle a void value
as the default disabled one, leading to no functional change.
closesodoo/odoo#48059
Related: odoo/enterprise#9381
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose
=======
When being logged on company A and clicking on company B, I should
log into the company A only.
Currently in mobile, the checkbox next to A remains enabled before the
refresh. With this commit, this behavior is fixed.
closesodoo/odoo#48045
Taskid: 2205603
X-original-commit: 19f196c0afd73c5d64b612aa413e6e6772e0c288
Related: odoo/enterprise#9373
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When the 'collaborative pads' option is activated for a project,
and the visibility is set to 'portal users', it is possible to define
the access level to pads to edit task descriptions.
- If set to 'internal users', the behavior stays the same.
- If set to 'portal users', a portal user has access to a pad to edit
task descriptions on the portal.
When configured for portal users access, by default, the task description
is displayed with an 'edit' button on top of it.
On 'edit' button click, the page is re-rendered with an additional
url parmater 'edit=1' to switch to edit mode.
In edit mode, the task description is shown in a collaborative pad,
with a 'Save' button on top of it.
On 'save' button click, the page is re-rendered with the 'edit' url
parameter, to switch in classic mode (read-only).
TaskID: 2204379
[IMP] project: collaborative pads in portal
In order to be (easily) able to add buttons to the right of the description
title, the description title is put inside a d-flex div.
closesodoo/odoo#46591
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
With Odoo Enterprise Edition, the license is still GNU LGPL.
A DOM id is added here to allow targeting the license link in `web_enterprise`
Task 2198484
closesodoo/odoo#46263
Related: odoo/enterprise#8776
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, when checking the gained karma per month or per week in
/profile/users route, the users gained more karma than they actually have.
This is due to the way demo data are loaded : karma tracking history is added
but when the final karma is set on the user, a new line of karma tracking is
created on the DB (via write or create method). But as the transaction with
karma tracking demo data is not commited yet, the old value is still 0.
That leads to add a new karma tracking line that have old_value = 0 and
new_value = user.karma. At the end the users 'gained' as addition the amount
of the karma they have.
E.g : Mitchell Admin has 2500 karma and his karma tracking history is the
following: 0 -> 1000 then 1000 -> 1500 then 1500 -> 2500.
In total, Mitchell should have gained 2500 XP: (2500-1500)+(1500-1000)+(1000-0)
But, before this commit, as there is an additional 0 to 2500 karma tracking
line, Mitchell Admin gain in total : (2500-0)+(2500-1500)+(1500-1000)+(1000-0)
= 5000 karma.
This commit clean that additional karma tracking line to get a correct karma
tracking history.
Task ID: 2209743
PR #48042closesodoo/odoo#48061
X-original-commit: 858f80e2529b17d1857d77f372c378ae235443de
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit and following the refactoring of the home menu and the control
panel to the Owl framework, some of the helpers of the 'clickEverywhere' test have
not been properly updated to the new classes/behaviours.
Now the selectors target the right elements and some actions that were previously
synchronous are now properly awaited (home menu toggling, filter menu interactions,
etc.).
Also slightly changed the behaviour of the clickAll functions:
- requesting a click on a null element will make the test crash (added some conditions
to avoid this in a standard flow).
- any error crashing the test at a deeper level will be displayed in the console
- an animation frame is awaited after clicking on an element. This is to comply
with the Owl rendering system.
closesodoo/odoo#47762
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
685f4eff50 added date_approved as
fields.Date.context_today
b5cea7e2b6 has changed the field
as a Datetime
Both together introduced a miss calculation of the date_approved
closesodoo/odoo#48055
X-original-commit: 6dff3024d19c9dd44c71992469540e3f09dd3247
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Fixes#47727Closes#47955
Before this commit, it was possible to change the Vendor/Currency of the PO when Grouped by Vendor/Currency on Kanban view which is not Ideal Behavior.
Now we block drag and drop using these fields.
closesodoo/odoo#48050
X-original-commit: 7b19964a203c205b67d8f3bc05c1279362d38a61
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Before this commit, widget='text' was not available in web_studio since 'html'
was missing from the supportedFieldTypes list of the TextField.
After this commit you can use widget text (and other derivated type of text).
task-sbu-feedback
closesodoo/odoo#48043
X-original-commit: 34bd90e7fc2aa094eac92b6f635c2d8d933ecb86
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This will ensure the performances stay correct for a blank page (no layout),
a standard page and a homepage (which has its own controller).
Related to #47257
task-2211013
X-original-commit: 08e01b5fc4a71b8f7639a953137fbb546ddf3b3e
Before this commit, we would get all the pages for the requested URL then
filter to get the most specific.
This can just be done in SQL by sorting website_id desc so the specific are
returned first.
Note that this will respect 41897f0dba.
This will avoid having to prefetch the generic page when it is useless.
Related to #47257
task-2211013
X-original-commit: b31294592a80d9e55f887f0122cc01225b64966c
To avoid a SQL Query on hot state, the website menus ids are now prefetch.
Related to #47257
task-2211013
X-original-commit: 73421c27f01e7100403eaa72e027c34dbdf9f720
Before this commit, url_lang (= url_for) will make query to find the lang_code
but we alrady have this info in ormcache with get_available method.
So instead to rebrowse (search query) the lang, we use a new method that will
try to find it in cache if possible before to make the query.
The gain on each page is n-1 (where n is # lang installed)
Because the switcher of languages do an url_for for each lang available.
Related to #47257
task-2211013
X-original-commit: 2cecbe356ce283e15fb0bbd0a6e9aa4735af520e
Before this commit, each module override _get_translation_frontend_modules_domain
from ir.http to add its own translation in website if needed and that module
is not starting by website_. Updating the domain from the super() call.
Since we know in most of the case the name, it is useless to do a:
select name from module where name = 'name1' or name = 'name2'...
Now we support a new override of _get_translation_frontend_modules_name that will
allow to add the known module name directly in the list instead to make a search.
In case nobody override _get_translation_frontend_modules_domain, we don't need to
make an extra rpc to find the module.
Related to #47257
task-2211013
X-original-commit: 0dc54814161ab55c34dd2242f65dea23d19fdfca
Before this commit, we compute the hash on each request, to know if we need to
download the file from the frontend or if we can use cache.
Now we store the hash computed in cache. The cache will be invalidated when we
touch one of these translations (openerp-web in the comments) or when you
install a new lang (already the case).
+ avoid to use read on a record, since it will not use the cache from record.
Related to #47257
task-2211013
X-original-commit: d5aaecbc51de19ef1d8d9988b691177fc73a4b86
Let the homepage being set in bootstraping
Without this, any -i will set generic homepage as website homepage_id.
This is not really an issue for enduser as they probably don't do -i once
website is already installed.
But this code was useless anyway, as the homepage_id set in XML would be
overriden during bootstraping of the homepage in website create() override.
Note that this is important to have the correct homepage_id in DB, otherwise
it has to prefetch the generic homepage.
Related to #47257
task-2211013
X-original-commit: 385203d7632daeaab762c57319cc93b8312cc043
Access_token has a restricted group, so it not fetched by defaut.
In our case, we know that after the first access to partner_id, that will fill
the cache without access_token, we will access access_token (so new query).
So we access first the access_token, to have only one request that fill the
cache with the access_token, and the partner_id used later.
Related to #47257
task-2211013
X-original-commit: 7dd69d10d00d5f4a7c12ec414d63f868a10683be
Before this commit, on each rendering of frontend layout, we make a new request
to check if env lang was in rtl or ltr.
Now we use a cached method, that have more than probably already cached this
record.
Related to #47257
task-2211013
X-original-commit: 7566b06500e42593919631cc6fa180aececfc623
Before this commit, in all cases, we search the backend menu to open if you
click on edit backend menu.
But the backend menu edit is useless for non editor user.
This feature has been introduce in v13, since eLearning have his own apps, so
when you edit in backend, you want to see the slide form view, into the
elearning app and no website App.
Related to #47257
task-2211013
X-original-commit: 1da7e53f4cdd82574688eb62f7a1cb8ddca871e6
Since this field is not sanitized, it is safe (perf wise) to prefetch it.
It should not be CPU heavy, plus whenever we access a `website.menu`, it is
most likely we will read that field.
with following structure, 5 SQL queries will be avoided:
- Top menu
- Home
- Contact us
- Sub Contact us
- Sub Sub Contact us
Related to #47257
task-2211013
X-original-commit: 20cddcd899e7a119fa9f365e62527499f8e5ff7d
Without this commit, the website menus would not be prefetch all in once.
Thus, every call to `submenu` template (called recursively) would do SQL
queries. One when accessing website.menu_id, then for every access on menu's
child_ids. It would also make an extra request for groups since the menus have
an ir.rule for that.
with following structure, 13 SQL queries will be avoided, regardless if there is
a group or not on the menus:
- Top menu
- Home
- Contact us
- Sub Contact us
- Sub Sub Contact us
Related to #47257
task-2211013
X-original-commit: 7fb016f9966bb5e2289ba17eacafb8887626514e
Related to 18e5416636
Due to changes made into the related commit, the buttons to start or
continue an inventory adjustment no more work.
closesodoo/odoo#47795
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Since trying to create a record in a grouped tree view has no effect
(previously that opens a new record in form view), this commit removes
useless dynamically added default group for the quant list view.
task-2217907
Related to b08e3d114a
Since the related commit, when a product has no available quantity, the
button "Update Quantity" and the stat button "Qty. On Hand" doesn't work
properly: the view doesn't find the default product(s) and doesn't adapt
the fields according to the product (for instance: serial/lot number).
To fix that, we need to take also all active product variants of the
template, even they have no available quantity.
task-2217907
Purpose
=======
- Change the font-awesome icon from fa-book to fa-question.
- Change the icon color to text-secondary (the same than the multi-company
icon).
- Adjust the icon size to the uppercase text size.
closesodoo/odoo#47210
Taskid: 2209062
Related: odoo/enterprise#9116
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
### PURPOSE
Support correct answers, scoring mechanism, and demo data on additional question types:
- Numerical Value
- Date
- Datetime
Additional improvements and fixes include:
- When checking answer type, add in check to allow 0 as a valid survey answer to a question of type Numerical Value.
- Include "most common" tab for question type Date in results page.
- Do not show skipped answer (i.e. blank User Response value) rows in results page tables (for results of non-choice questions).
### SPECIFICATIONS
**New question types scoring:**
Previously only the question_types: 'simple_choice' and 'multiple_choice' could be scored and have a "correct" answer(s). This change makes it so that question_types: 'numerical_box', 'date', and 'datetime' can also have a "correct" answer and an associated 'answer_score'. Some restructuring of scoring logic was required in order to accommodate and better streamline new question_types scoring.
Demo and testing data also added for these new scorable question types. New demo data includes both scored and unscored (i.e. answer_score = 0) instances for the 3 question types to ensure differing behavior is viewable in survey results. During this update, errors in existing demo data were fixed when discovered. The same demo data additions/updates were duplicated in the relevant tests.
**Additional improvements/fixes:**
- Answer type check: additional conditional needed to handle 0 evaluating to False even though it is a valid entry as a numerical value.
- "most common" tab added only for Date since it is currently not expected to be useful for Datetime questions. Implementation is left generic for future additional question types scoring implementations.
- Skipped answers were shown either as a blank value for Date, Datetime, Multiple Line Text Box, Single Line Text Box or 0.0 for Numerical Value question types. A simple check to skip these skipped lines from being shown in the results page is all that is needed.
- Light rewriting of question form view to include answer-related options and choices directly in the "Answer" tab.
LINKS
Upgrade PR: odoo/upgrade#835
Task ID: 2061937
closesodoo/odoo#43014
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Under a survey's results (i.e. summary of all user submissions) the
question type 'numerical_box' has a "Most Common" tab of its results
displaying the top 5 survey user answers. This commit adds the same tab
to question type 'date'. It is expected this tab will be most useful for
'date' questions that are scored.
Implementation was left generic to allow for other question types to
easily adopt similar display. For now, question types: 'text_box' and
'char_box' results do not have a "Most Common" tab since this currently
adds no benefit (once scoring is implemented for 'char_box', then there
may be a benefit for it). 'datetime' is also expected to not benefit
from this additional tab and requires a more complicated implementation
to handle timezone display consistently between tabs and potential
"Right answer" (see related task id: 2169184).
Upgrade PR: odoo/upgrade#835
Task ID: 2061937
Adding additional demo and test data for new scorable question types:
'numerical_box', 'date', and 'datetime'. Includes both a scored and
unscored (i.e. answer_score = 0) version for each question type to
ensure differing behavior is viewable in survey results.
Also updating existing data/tests to:
1. Follow American standard for $ placement.
2. Have hardcoded 'answer_is_correct' and 'answer_score' demo data (due
to updated correct answer implementation being done via frontend
input only)
3. Update minor errors in the existing demo data (for example, removing
2nd answer for a single answer choice question for the same survey
submission).
Upgrade PR: odoo/upgrade#835
Task ID: 2061937
Previously only the question_types 'simple_choice' and 'multiple_choice' were
scoreable and could have "correct" answer(s).
In this commit we change this behavior so that question_types 'numerical_box',
'date', and 'datetime' can also have a "correct" answer and an associated
answer_score.
Task ID: 2061937
Community PR #43014
Upgrade PR odoo/upgrade#835
porpose of the task is to avoid the reload of the web client
when you add an optional product, in the customer portal
this commit will fix the issue of window reload when add optional product and delete
product in customer portal.
removed order line from sale order, when a customer set the quantity of an option line to 0 in the portal
task-1961015
Closes#32551
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: mba-odoo <mba@odoo.com>
We have an editable list with 4 fields:
- fieldA (say boolean)
- fieldB with readonly modifier, readonly iff fieldA is true
- fieldC with readonly modifier, readonly iff fieldA is false
- fieldD
Add a new row to the list: fieldA being false by default, fieldC
is readonly whereas fieldB isn't.
Change the value of fieldA: fieldB becomes readonly, and fieldC is
now editable.
From that point, before this commit, clicking on fieldC activated
fieldD (instead of fieldC).
The bug occurred since 3fd7b20, which added a delay between
the moment fields are re-rendered (and inserted at the end of
allFieldWidgets) and the moment there previous instances are
destroyed (and the new ones take their place in the list). So when
several fields were re-rendered at the same time, the order in
allFieldWidgets could not match the actual column order anymore,
and cause issues like the one described above.
Part of task 2210323
closesodoo/odoo#48039
X-original-commit: 89b9717c08e148ad94db17d8746faa2312b6a07a
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>