Setup was conditionally done in render lifecycle methods, but it could be moved
to init instead, allowing to simplify the code and remove unnecessary methods
and overrides.
Part of task-2871070
closesodoo/odoo#94307
Related: odoo/enterprise#28893
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
In a search method, the error comes from the user and thus the error should be an UserError. ValueError should be used for other cases.
closesodoo/odoo#93944
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When browser_js tests, especially tours, it can sometimes be useful to connect to
chrome devtools in order to follow test execution. This can be tricky since we need to
find the `devtools_port`, browse 127.0.0.1/:`devtools_port` and clic on the link opening the
devtools from a remote adress with a specific version using the devtools websocket adress to
observe the test.
This commit adds an additionnal browser_js parameter, `watch` enabeling to automatically open
a new chrome window/tab with this specific url.
closesodoo/odoo#66769
Related: odoo/documentation#2305
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Before this commit, if the user uses Studio app to customize the form
view of timesheet and adds `product_uom_id` field in that view, then if
for instance that field is invisible, it will be in in the vals when the
user will create a timesheet. In that case, the value given to that
field will be False since the field has no default value. Since in the
compute of `total_timesheet_time` defined in project used that field to
convert the `unit_amount` of each timesheet linked to this project in
the right UoM, the `product_uom_id` field has to be defined if the AAL
is a timesheet, otherwise, the timesheets without any UoM set on
`product_uom_id` will be excluded in the compute.
This commit fixes the issue by setting a UoM if the UoM is not in vals
or if the value is False for a timesheet.
opw-2884148
closesodoo/odoo#94643
X-original-commit: 9ec6f14c2a6863ed45c24e8695bb56512996fa16
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Steps to follow:
- Use a mobile view in the browser dev tools
- Open the POS app
- Perform a Sale
- Close the session
opw-2788751
closesodoo/odoo#94587
X-original-commit: 654cdb5b8a46c9b44d432f05bcaf29d20fe3e306
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
When we use the "Retry" button in case of a failed SMS mailing, it puts
the mailing back to the queue, which will be processed when on the next
cron call of `Mail Marketing: Process queue` (generally on the next
day). However, it should immediately generate a cron trigger in this
case so that SMS(s) can be sent right away.
The same goes for Email Marketing, where it should immediately generate
a cron trigger so the mailing can be sent immediately.
With this commit, instead of simply putting the mailing back to the
queue, we utilize the method `action_put_in_queue` which immediately
generates the cron trigger in both cases.
taskID-2760101
closesodoo/odoo#94269
X-original-commit: 572a7effb271ad134bb936751292668ae7b2b590
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
- install l10n_fr, account_accountant
- generate an invoice with tax "TVA 0% autres opérations non imposables (vente)"
- Got to Accounting > Reporting > Tax Report
Issue:
The last invoice would appear in the 02 "Autres opérations imposables" meanwhile it should appear
in the Autres opérations non imposables
Solution:
Change the base data to fit
opw-2882543
closesodoo/odoo#94613
X-original-commit: f18d99699d37dc5c67f3cdae98d70865db0d8282
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Steps to reproduce:
1- install sale, invoicing
2- create a product p with price pr
3- create a new Sales Order SO with p and edit the price
to any other price than pr
4- create an invoice
5- go to SO, reduce quantity to 0 ( customer returns the item )
6- the unit price is set back to pr and there is no way to edit it
Bug:
in 836f463c97 the `_compute_price_unit`
method was changed from onchange to depends which caused the edits now
to be commited to memory.
While it can be beneficial for other flows, for this specific use case,
it is not
Fix:
make an exception for lines with already invoiced quantities
OPW-2830824
closesodoo/odoo#94482
X-original-commit: b77346926f634f2f06fe1b06b68835a360ae91c5
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
This commit checks that users without the access right 'Template Editor'
are not allowed to add dynamic qweb in the translations of a mail
template.
Old tests have been updated to keep the assertRaises and all the code
that handle the invalidation cache, ... But now we ensure that the
Access Error raised is the expected one.
Original tests was testing that a user without the group 'Mail Editor'
got an access error due to the missing group, but since the commit
1a3e713 the Access Error is because you cannot edit a template that is
not created by yourself.
closesodoo/odoo#94597
X-original-commit: 127a598e96e0e4a9952c009d98b705ceccf40def
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Backport of odoo/odoo#81474
Before odoo/odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.
closesodoo/odoo#94618
X-original-commit: 90cec4073e065c142043fcea1d68a10c7cb72e73
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
The drag and drop mega test is quite simple: the python gets the list of
all the snippets (by rendering a view + etree), then it just starts a JS
tour by passing all those snippets in the tour URL.
From there, the JS tour is in charged of building its own steps based on
the list of snippets it received from the python.
The MOST important part is to be 100% sure that the built steps are as
expected: ~5 steps / snippets: ~220 steps with website only and ~280
steps with all modules.
If we don't have that check, the tour could suddenly not test anything
because the step list would be empty, but the test wouldn't fail.
Thus, we don't want to programmatically try to compute that step amount
but want it to remain an hardcoded number, which is lowered in this
commit as if we have 220 (it could be 200, 150..) steps, it means that
the steps were built as expected.
Note that since the test is run on post_install, 280 was fine since all
modules were installed.
But the nightly build is also testing this test with only the website
module, ultimately failing.
Note that this check was actually not working at all since [1] as there
was a typo on `length`.
[1]: https://github.com/odoo/odoo/commit/61b19dafd1fb79120f701b94038bbe859aa2e271closesodoo/odoo#94614
X-original-commit: 23c6b49ba43e6146143bf83bdfd7ce93934961ea
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Steps to reproduce:
- Create a partner-individual, assign to a company
- Create an invoice and set the new partner as the customer
- Go to the partner view
- Delete it
Issue:
- It is possible to delete it
Cause:
The constraint in "account.move.line" uses the "commercial_partner_id" as the partner
Solution:
- Prevent the unlink if the partner is used in 'account.move' -> To delete in Master
- add "ondelete='restrict' for partner and commercial_parner in 'account.move'
opw-2858789
closesodoo/odoo#94591
X-original-commit: 7d37f5ef7ecd87aea666d96dc8200a74c8dc0b31
Signed-off-by: William André (wan) <wan@odoo.com>
The createMessageComponent helper was used during tests to mount
a message component and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient so that the message component
can be mounted in its real environment.
closesodoo/odoo#94243
Related: odoo/enterprise#28720
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Purpose of this commit is to add a first populate implementation in CRM to
create leads. Indeed as CRM application may have to handle lots of leads we
should ease data creation to test performance in several use cases.
Task-2679887
closesodoo/odoo#79150
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Use dict.get() instead of a subscriptable call. This way we let through
selection values that are not loaded into the registry, instead
of raising an error.
This is especially useful in the upgrade environment
where such values may be unavailable (because of being
lambda-defined in a custom module for instance).
closesodoo/odoo#94530
X-original-commit: 36a6943740f9b4fbd9a78986bee4cd84bb8469c7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit aims to improve the recruitment reports clarity,
particularly the confusion between source and medium
TaskID : 2837445
closesodoo/odoo#90975
Related: odoo/enterprise#27148
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Seen list (aka already mailed records) computation is done in SQL to speedup
computation. It is based on an heuristic to find fields to check (either
a partner, either an email). However it checks fields are present in model
but does not check they are stored. This leads to traceback if fields
are not stored.
Task-2852943
X-original-commit: fa11070d4533475778ea933225e30d06a09406bc
Part-of: odoo/odoo#94532
Add a model and a test allowing to test the seen list using raw SQL based
on partner_id field. Test indicates a not stored partner_id field currently
crashes beyond redemption.
Task-2852943
X-original-commit: a15bda3bed339a0ac422a3c82ec9cc295a11a785
Part-of: odoo/odoo#94532
Emails could not be resent from the chatter after failing to be sent.
This was due to parts of code not being updated after a refactoring of OWL.
Multiple other instances of non-updated code are updated here.
Task-2887153
closesodoo/odoo#94529
X-original-commit: 8fbdb1b52b9051e92e4980d5af73460a46fe70da
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-9https://github.com/odoo/owl/releases/tag/v2.0.0-beta-10
Details:
closesodoo/odoo#94523
Fix: event: no crash when using t-on + modifier on slots/components
Fix: component: fix props comparison code
Fix: component: fix wrong behaviour when using t-on on t-component
Fix: component: props values are own property of props object
Fix: t-out: allow expressions evaluating as number
Fix: compiler: add support for #{...} in string interpolation
Fix: compiler: escape backticks in attributes
Fix: crash when dynamic class have leading space
Imp: slots: add support for t-props on slots props
Imp: tooling: add another d.ts file
Imp: app: small scale perf improvement
Imp: app: add fast path for when component has no prop
Imp: validation: add support for value types
Imp: add support for t-call-context
Ref: compiler: remove useless ; in compiled output
Ref: move some code around
X-original-commit: 3c7e2cb5a2224ff624e0899ca392be8b3828b43a
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Since 12bc2ab, there are two projects created for each SO
instead of one in the demo data.
This is because in the sale lines, one product creates a project
with a template, but others create a project without a template,
which creates two projects.
This commit adds a project template to the products without one to
create a single project per SO.
closesodoo/odoo#94514
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit does below improvements:
1/ If salesperson and sales team are set on an individual partner, we propagate
those to parent company being created from m2o of the form view.
2/ If the existing parent company is manually linked to an individual partner
being created, and salesperson and sales team are not set on the individual,
we set those values from the linked parent (if set on the parent).
Task-2636290
closesodoo/odoo#78696
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit imporves the usability of scoring fields and single-multi
choice question in survey. It does the following changes:
Backend:
- if it's a scored question, respective correct answer must be provided
otherwise it will now give a warning while trying to save
- points are hidden unless it's a scored question (and will be inline now,
next to 'Scored' checkbox)
- compute answer_is_correct based on question type of numerical, date,
datetime for both scored and non-scored questions.
Frontend:
- if the answer is wrong, display the answer inside a red container and below
the wrong answer, also display the correct one in green font
- if the answer is right, display the answer in a green container
- if the answer is skipped, display the text 'Skipped' inside red container
with lower opacity
- hide the div for question description if it's empty, to avoid unwanted
space bewteen questions
- added two different icons 'fa-check-circle' and 'fa-times-circle' for correct
and incorrect answers respectively for single-multi choice question
- show answer is correct and incorrect based on is_correct not on scored values
- show skipped string for single choice, multi choice and matrix questions in
result page if question was skipped
closesodoo/odoo#63915
Taskid: 2276724
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce the bug:
- Install mrp and purchase
- Create a new user “U1” > give him only the “purchase” user access
- Log in as “U1”
- Go to purchase app > create a new PO
- Try to select any product
Problem:
A user error is triggered because we check if the product has a BOM
but since the user does not have access to MRP, an error is raised
opw-2885982
closesodoo/odoo#94489
X-original-commit: de359c0470fba1d5e9dfee416abe46661e35cce6
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
The createChatterContainer helper was used during tests to mount
a chatter container and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's mount a webClient and open a form view
containing a chatter.
closesodoo/odoo#94175
Related: odoo/enterprise#28684
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: auth_signup, knowledge, mass_mailing, portal, survey, test_website,
test_website_modules, test_website_slides_full, web, web_editor,
web_tour, web_unsplash, website_blog, website_crm,
website_crm_partner_assign, website_customer, website_event,
website_event_exhibitor, website_event_meet, website_event_track,
website_forum, website_hr_recruitment, website_knowledge,
website_links, website_livechat, website_mail_group,
website_mass_mailing, website_membership, website_sale,
website_sale_autocomplete, website_sale_comparison,
website_sale_loyalty, website_sale_slides, website_sale_wishlist,
website_slides, website_slides_forum, website_twitter, base
A new client action is introduced, to display the website in an iframe.
This allows to remove the "frontend" Odoo UI entirely. Everything
related to the website configuration (and especially the edit mode) will
now be done on the backend side.
The idea behind this mainly comes from the fact that we needed the
website in an iframe during edition to be able to render a mobile
preview properly. It was also required so that options which reloads
the page... are able to only reload the page and not the entire editor
with it. From there, it was decided that actually, since the website is
in an iframe, it could be in the backend and every website UI could
rely on this.
In the end, this comes with many functional and technical advantages.
Here are some of them (a few of them are not entirely done with this
merge but will follow the merge in the upcoming weeks, see this as a
non-exhaustive list of possibilities that are unlocked by this work):
Technical:
- No duplicated logic for website UI and backend (purple navbar is the
backend one, slightly customized).
- No conflicting logic for website UI and website content (like dialog
opening, ...).
- No forced CSS for our website / web_editor UI, no conflict with
website themes.
- Everything converted in OWL, in backend code (no special OWL for
frontend).
- "Legacy" code moved as frontend code or removed.
- No website content CSS for the case "when there is the Odoo purple
navbar at the top".
- Backend views & features available (e.g. creating a new event -> form
view instead of custom code with onchanges, validations, etc)
Functional:
- All website features available while editing your website (product
configuration, settings, etc), no switch backend/frontend, no
redirection, no reload (just the iframe).
- All other app features available while editing your website (discuss,
calendar, all other apps, ...).
- Typing a website URL in your browser reaches your website (very small
Odoo UI overlay at the top left as a connected user).
- Mobile preview: directly resizing the website rendering, in edit mode
too and with a better phone image.
- Editor: mobile view edition (the editor is instanciated around the
website content instead of inside of it (iframe))
- Can reload the website without reloading all the tools (editor, html
editor, menu edition, etc) (customize_show options for instance ->
moved as standard editor options which reloads the website only)
- Website UI in your language instead of website language
On the backend side, some customizations were done so that the UI feels
like it works as before (note that it will be reworked in upcoming weeks):
- A `website_systray` registry is defined to replace the systray items
with the website's one when previewing the website.
- The webclient's navbar is patched to display additional dropdown menus
related to the website edition.
- A website service that holds the global state of the website is
introduced. Components from the systray and the dropdown menus can
access and modify it.
- A component adapter for the wysiwyg (that will display the snippets
menu) is added, that allows for caching the wysiwyg libraries, thus
improving editions responsiveness.
See sub-commits for details. This work is known to not be bug-free and
will be bug-fixed, improved and reworked in the upcoming weeks.
task-2687506
Thanks to the whole team for reviewing and testing !
(ARD, BVR, BSO, GDI, MOU, PDE, QSM, RDE, SOBO, YOL)
closesodoo/odoo#89223
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Younn Olivier <yol@odoo.com>
Co-authored-by: Arthur Detroux <ard@odoo.com>
Co-authored-by: Mehdi Outagant <mou@odoo.com>
Co-authored-by: Benjamin Vray <bvr@odoo.com>
The documentation page for the external API was moved elsewhere with PR
odoo/documentation#2026.
closesodoo/odoo#94488
X-original-commit: 99eb55e14782bd32c4b2281681a62eb5f3d34407
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
To reproduce the issue:
1. Create a storable product P
2. Update the on-hand quantity: 5 x P
3. Create a planned delivery order with 4 x P
- Note: once saved, the forecast symbole is green
4. On the delivery order, set the quantity to 5 and save
Error: The symbol is now red, which is incorrect: there are 5 available
P in the stock
The color condition is incorrect, when `forecast_availability` is equal
to zero, it means that there will be just the right quantity:
https://github.com/odoo/odoo/blob/892232b5aef42dd2706cb9d1d027b1c463ca50dd/addons/stock/models/stock_move.py#L446-L448
task-2822157
X-original-commit: b49577d1aa0dda3b3890c7150db0242254cf46c5
Part-of: odoo/odoo#94332
Before this commit:
When creating a mail template for a marketing campaign targeting mailing
contact, the reply_to_mode would be set to 'thread', and the reply_to
field would be be read-only. Since there is no way to target a mailing
list from a marketing campaign (see the domain on marketing.campaign's
model_id), and there is no default followers mailing.contact, email
responses would be "lost".
After this commit:
The reply_to_mode is set to 'email', and the reply_to is set
accordingly
OPW-2803314
closesodoo/odoo#94507
X-original-commit: f47da5d3183479597b572046566f67621f6db837
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Francis Sylvain (syf) <syf@odoo.com>
Before this commit, when a restricted editor search for an image, he
will have an error 404 not found, when he try to access to the unsplash
key. Now he can search for image on Unsplash.
closesodoo/odoo#94506
X-original-commit: bbdd91e778a46c68461574dbea146e178f8c3c3f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
In a multi-company environment, when we transform a lead (which has no
salesperson) into an opportunity, we get an error if the customer has
a company set.
To reproduce the issue
1) Create a new company
2) Create a Lead for a customer with the Company set
3) Remove the Sales Team
4) Set the company on the Lead
5) Convert to an opportunity and you will see an error showing up
Solution
A previous commit (1fad826743de9c8f916ef083e8de453212df6959) adapted the `_compute_company_id`
computation in which a case was forgotten (the case described here-above).
The fix was to force the `company_id` to the one of the `partner_id` if it
has one.
OPW-2805181
Task-2888330
closesodoo/odoo#88108closesodoo/odoo#94493
X-original-commit: fc3bb66a863cd3ff8c92d70dd43146a5610a4a43
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently using a customer with a company set on a lead without company
crashes, as it keep a void company on the lead. This is not compatible
with the company set on the partner itself.
OPW-2805181
Task-2888330
X-original-commit: 51be6cab5c4437ef56de5d1b25c0ba8486d25291
Part-of: odoo/odoo#94493
This commit introduces a node option 'keydown_debounce_delay' on the
character field and on emoji mixin, so that use can define the custom
debounce delay (in milliseconds) instead of fixed 2000 ms for
triggering an onchange on the field. Note that this delay will be
applied only when 'onchange_on_keydown' node option is also provided.
Also, we've utilized the odoo's debounce instead of the one provided by
underscore js, for 2 reasons:
1 - odoo's debounce is already well tested (see the file
/web/static/tests/core/utils/timing_tests.js)
2 - to take a step forward for reducing external lib dependency
task-2821978
closesodoo/odoo#94486
X-original-commit: ab80cdc0809e1347d201f21ac9474e66e9270f94
Related: odoo/enterprise#28822
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose
=======
The flow where we copy / paste the authorization code will be
depreciated. Because of that, we know use the newest authentication
system which use redirect URI.
Technical
=========
Now, the user is redirected to an Odoo endpoint "google_gmail/confirm"
and the access token / refresh token are automatically fetched.
Documentation
https://developers.google.com/identity/protocols/oauth2/native-app
Task-2852560
closesodoo/odoo#94476
X-original-commit: 69bd9bc6b36fdd55e8e859667bcddddad6db7d06
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to Reproduce:
- Connect as Admin
- Install event_booth_sale module
- Give only sales right to Demo user
(get rid of everything else (especially event)
- Connect as Demo
- Create a new SO
- Add an event_booth as product to the SO
- Try to confirm the SO
Issue:
Access error.
Cause:
When confirming the SO, we also update the selected event_booth
while the sales right are not enough to update event_booth model.
Solution:
Use sudo to update event_booth, since SO already confirmed.
Also fix unlink of booth, for the same reason.
opw-2823555
Task-2842621
closesodoo/odoo#94475
Forward-port-of: odoo/odoo#93983
Forward-port-of: odoo/odoo#88914
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When unlinking booths a check is done on sale orders to prevent their deletion when
a SO is linked and raise a nice error message. However as there is a group on the
field (coming from Sales app) we should sudo the filtered.
Task-2842621
X-original-commit: 9cdc2eec25dd57a74be993b0db0fd81460d6aed6
Part-of: odoo/odoo#94475
Notably using post-install allows to run event_booth tests even when sale
dependencies are installed. Otherwise they cannot run at install due to
required column not being filled in DB.
X-original-commit: aa769df87c0ef0e7ac6924c3e8f5595e8c82eba7
Part-of: odoo/odoo#94475
Steps to Reproduce:
- Connect as Admin
- Install event_booth_sale module
- Give only sales right to Demo user and remove event rights
- Connect as Demo
- Create a new SO
- Add an event booth as product to the SO
- Try to confirm the SO
Issue:
Access error.
Cause:
When comfirming the SO, we also update the selected event_booth
while sales rights are not enough to update event_booth model.
Solution:
Use sudo to update event_booth.
opw-2823555
Task-2842621
X-original-commit: 3f78c6aab091388afaf1e75fc8e9e66db5b8ab4a
Part-of: odoo/odoo#94475
In the `_stock_account_prepare_anglo_saxon_in_lines_vals` method, we
loop the moves' invoice lines but we called `filtered` on it to remove
ineligible lines.
That said, we have a conditional `continue` at the beginning of the loop
precisely for the same reason, which is redundant.
As it's better to filter out inside a loop instead of call `filtered`
(one loop instead of two), this commit removes the call to `filtered`.
closesodoo/odoo#94456
X-original-commit: a0a90fb20410d663d4615e7a055fce18c868116b
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Steve Van Essche <svs@odoo.com>
This commit adds a new menu item in the "Site" menu section.
This "Edit Event Menu" item is only shown when a [data-content_menu_id]
element is displayed within the iframe (such data attribute is added on
the event menus).
The contentMenuId is taken from the currentWebsite.metadata to keep data
taken from the iframe's document centralized in the service.
The spec is different from the previous implementation, that was
prompting a dialog to select the menu to edit, before prompting the
dialog to edit the menu. Here we have two different dropwdown items.
See merge commit for more information.
task-2687506
This commit hides the Edit button when visiting a page that is not
editable (e.g. sitemap.xml, a link to an image, etc).
See merge commit for more information.
task-2687506