Assume a situation where you trigger a method which is going to create a
nested picking with move_lines included and having a filter set which
means that your context includes {'default_product_id': 20}
{
'location_dest_id': 9,
'location_id': 19,
'move_lines': [(0,
0,
{'location_dest_id': 1,
'location_id': 2,
'name': u'name',
'partner_id': 1,
'product_id': 10,
'product_uom': 1,
'product_uom_qty': 1.0})],
'origin': u'Origin',
'partner_id': 1,
'picking_type_id': 59
}
Before the creation of the objects it will inject the default product in
the top level of the dict which should create a picking with one or more
move_lines.
Based on this this injection will overwrite all product_id values of the
created move lines as the picking is created last and the default value
will write ALL move lines with this specific product from the context.
closesodoo/odoo#45076
X-original-commit: 1da687b644e581081ce21687c5eb32285c872a2a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Issue
- Deactivate demo data
- Install several modules (e.g. Sales, Helpdesk)
- Go on Home
- Hard refresh
All tours' tips are shown
Cause
In 02dab5dc88, we wait the DOM to be ready.
The DOM wasn't ready in previous version, this is
why it seems to work.
As the DOM is ready, in check_for_tooltip we
have a visible trigger so trigerred = true
and the tip is activated.
If you activate the debug mode, the DOM is
not ready too, this is why it works fine
in debug mode.
Solution
I don't think that not waiting the DOM to be
ready is good so I think we should keep that
and handle the case when we update the tours
from the _register method. So that, we use
the else part of the update method which
will break after a tip has been activated.
OPW-2188525
closesodoo/odoo#45073
X-original-commit: 5f0451c54cb785cc940b78a489316bed5ad9d888
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
[FIRST ISSUE]
Steps to reproduce the bug:
- Create a pricelist PL with 50% reduction on all products.
- Create a SO with PL
- Add an optional product P
Bug:
The price is correct for P but the discount displayed was 0%.
[SECOND ISSUE]
Steps to reproduce the bug:
- Add the option line to the order
Bug:
A new line was create for P in the SO with the correct price but the discount was not displayed
PS: The discount field on the model sale.order.option has been implemented to add a new discount
to the displayed price unit of the option. But it has not been implemented to show the discount computed with
the pricelist.
opw:2186470
closesodoo/odoo#45056
X-original-commit: bcb304bbad3d10ca5efc7411fff4c9efff8fa6b3
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
- Activate variants and pricelists
- Go to Product > Products Variants
- Search for anything on the 'Pricelist' filter
A traceback is raised: 'Can only create cache keys from hashable
values...'.
This comes from the following change:
https://github.com/odoo/odoo/blob/4b06fe19fa68255b7982d15e5847da2f6d6209fd/addons/web/static/src/js/views/control_panel/control_panel_model.js#L962
It returns a list instead of a string. Since a list is not hashable, it
causes the issue.
There are not much solutions since the context key `pricelist` can be a
`list` or an `int` (an ID). We force the cache key conversion to a tuple
to avoid the `TypeError` and handle the `list` use case (which was
broken on top of crashing).
opw-2187757
closesodoo/odoo#45064
X-original-commit: ec0a8767143b4c4818418281803c4f52fefa8d2a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Go to Accounting / Reporting / Management / Invoices
Select Pivot view
Add "Total" measure
expand results adding "invoice #" and product
Total will be incorrect because it is summing up the value reported from
several lines of the query in which the total is taken as the invoice
total, so it will display total * # lines.
Using the price retrieved from the single lines fix the issue, but it
needs to be converted according to the currency rate of the invoice.
Moreover the test need to be modified because the amount_total variable
of the report should NOT be the move amount_total but the amount from
all the lines converted in company currency
opw-2187369
closesodoo/odoo#45050
X-original-commit: 1558bb2a62cf169e6b19a2aa4dd92fcd8ff1b25a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Usecase to reproduce:
- Set the lot_stock_id as a view location
- Create a PO and validate it
-> The forecast quantity on stat button is correct but it's missing in
the forecast quantity report.
It happens because the condition for stock_move is based on valuation
strategy. However it's not correct since it's not True that a product
is in the stock if it's valuated (as subcontracting, owner, ...)
In order to fix it uses the warehouse in order to define if a move is in
or out (the same way than the _get_domain_locations on product).
X-original-commit: d7da1b733b4cece73d26805e6371499026bed0cd
When adding a custom field, the ORM also adds it to all the inherits'ed
models, but with the state `base`, because those inherited fields are
automatic (created by the ORM). However, dependencies are enforced for
`base` fields, while they can be ignored for `manual` ones. This is a
problem when a custom field is fucked up: its inherited fields will make
the registry crash.
We fix the issue by not enforcing dependency check on fields inherits'ed
from custom fields.
opw-2191114
closesodoo/odoo#45024
X-original-commit: 2db0787dc9e8717200aaf1d71ac64df1c17f4143
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
The translation alert dialog was attached to the entire view in case no
status bar was found. This resulted in the following layout on large
screens:
chrome
--------------------------------------
| alert dialog | form view | chatter |
| | | |
--------------------------------------
Whereas when a status bar was set on the form view, the rendering was as
follow:
chrome
--------------------------------------
| status bar | chatter |
| alert dialog | |
| form view | |
--------------------------------------
The fix make sure the alert dialog is always placed just above the form
view just like when there is a status bar.
closesodoo/odoo#44878
Task: 2075172
X-original-commit: dacdc30681510e9c2db23610c5be5285a72a8949
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Before this commit the purchase_rfq action had two context keys
defined. One being empty {} and one with quotation_only set to
True. After this commit there is just one context (the one that is
actually used and applied) on the action.
Empty key added in 12.0 at 6138686d41b
Second key added in 13.0 at b5cea7e2b6closesodoo/odoo#44990
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
In a database with many users / events to synchronize, the cron
`ir_cron_sync_all_cals` may time out. Consequently, even if a `commit`
is performed for each user, some users are never synchronized.
In this commit, we first sort the users by last synchronization date,
meaning that all users will ultimately be synchronized, even if the cron
times out. On top of that, we introduce the context key
`last_sync_hours` to prevent the synchronization in case the cron is
restarted after timeout.
opw-2158372
closesodoo/odoo#45032
X-original-commit: 2f21def63c61324e2286dbee6abead091171a041
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Co-authored-by: Nicolas Martinelli <nim@odoo.com>
Without these magic filters the various options in the activity
widget (late, today, future) will show all activities instead.
opw-2172833
closesodoo/odoo#45036
X-original-commit: 081cb02d554760be1da0d4d10ad9a287c7bf462e
Signed-off-by: jorenvo <jorenvo@users.noreply.github.com>
Purpose
=======
Launch the test at 00:05:00.
Then when opening the advance payment wizard, the field
date_invoice_timesheet would be set to yesterday, instead of
today.
Adapt the default value on the wizard, and the related tests.
closesodoo/odoo#45023
Taskid: 2178983
X-original-commit: 0a46e92cf742ca811b1685860619dba1d0dc7bd5
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
When reading binary content such as `image_128` on `res.users`,
`AccessError` should be raised when necessary.
Steps to reproduce:
- Populate cache in superuser mode.
- Access cached field with public user.
- Read access is allowed but should not.
Concrete example:
- Unpublish `demo` user.
- Access `/slides` with `public` user.
- The template data is generated as `sudo`.
- The same data is then accessed as `public`.
- AccessError should be raised when requesting
`/profile/avatar/<int:user_id>` but is not.
Closes#43826closesodoo/odoo#45033
X-original-commit: e0112db4d6131751475365ab4c42de848f925dce
Signed-off-by: Christophe Simonis <chs@odoo.com>
Previously, when clicking on the next post at the bottom of a blog post,
a spinning loader circle would always appear in the bottom left of the
screen in an incorrect position. This commit removes that spinner.
This commit also adds support for the half-screen cover size, which
until now would animate as though it was full screen. All in all this
just makes the transition animation much more seamless, which was the
point of having it in the first place.
task-2166790
closesodoo/odoo#44198
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The user is never able to delete a website, since there is at least one page,
the homepage, which is bootstraped during website creation.
From that point, even if nothing was done on that website, it was not possible
to remove it.
As website deletion is already a technical thing (debug mode), and since
website.page do not make sense without their website, removing those on cascade
will allow the user to remove a non-modified website.
task-2092845
closesodoo/odoo#45018
X-original-commit: ba6206baae7e3defbb6d28bcfe48eb5bed38d4c7
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
As an admin or website publisher, you have the possibility to switch website in
the navbar. This will force a website in your session*.
If this website is removed at some point, your session will be broken as the
dispatch will lead to a traceback, trying to read un unexisting website.
* There is other way to have the website forced in the session: theme install,
go to website from settings, create website from settings..
opw-2092845
X-original-commit: 835d1201b8a26168bb003a5fc664e692005cb0a2
When snippets deeply alter the DOM (e.g. image reordering in gallery),
the related option might be destroyed since they are referencing old
DOM. If such a case occurred, the destroyed option was still waiting for
an option update response by the editor before being considered as
finished... which then never occurred and blocked the editor.
closesodoo/odoo#44998
X-original-commit: 9eeea4c4107dc15984c475582d5ee58a17cd2568
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Issue
- Install Blog
- Go on a Blog post
- Customize > Enable Share links & Sidebar
- Click on a social share link
Redirected to #
Cause
The website_blog.js has been refactored fron v12
to v13, it seems that the onShareLink method has
been forgotten in the event handlers.
Solution
I added it and make it working with the actual view.
OPW-2170706
closesodoo/odoo#44992
X-original-commit: 0e90afb789690be3723f0c3522b50b2ce7dfb8e5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When the apply-to data attribute was first introduced, a mistake was
made when storing the results of the methods calls, using _.each instead
of _.map to associate each target element with the promise of the method
execution, as a result, Promise.all would resolve immediately instead of
waiting. While there are no currently documented bug caused by this,
they are just waiting to happen.
This commit fixes that.
closesodoo/odoo#44988
X-original-commit: 32271be1f696c11b3e5157426b8f7c9efa93134b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Selecting a css color equals to a theme color via the custom color
was not selecting the theme color.
Opening and closing the custom color without picking a color was
unselecting the selected color.
Now the custom color picker has the selected color as default even if it
does not appear in the palette as selected. This was appearing in the
parallax snippet as no custom color is displayed.
closesodoo/odoo#44986
X-original-commit: 0c8be24ac72c223c12eadbdcf635628f203a6766
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since we use Promise instead of jQuery deferred, the onRemove method
class was no longer triggered before the actual removal of the elements.
Original fix with https://github.com/odoo/odoo/pull/43918
This PR is the same with the async/await form, not breaking the history
of half of the removeSnippet method's lines.
closesodoo/odoo#44963
X-original-commit: 37941159c82d487ff172f0e6b27028f23ab32810
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: fja-odoo <fja@odoo.com>
*: website
Some dialog promises were not resolved on close, blocking the editor.
closesodoo/odoo#44953
X-original-commit: 20f97470cdc59a817526305806e94b222f26a0f2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Followup on 5ce8f1e375
Before this commit, There would be traceback on Launching Plan with `Responsible` set to `other` and No `Responsible Person` defined on activity due to Extra argument.
In this commit, We remove that extra Argument.
closesodoo/odoo#44965
X-original-commit: 009e5526ee398415693d1d3df8f3c2ac546fd258
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose
=======
Whenever a visitor start a livechat session but finally close the session
without sending any messages, the livechat session is empty and stay in DB.
Livechat session counter counts all the sessions (with and without message)
but when opening the sessions tree view, the view is filtered by default on
session with messages. There is no reason to see the empty sessions as it
does not give any information (except "the visitor hesitated to start
livechat and finally did not" which is quite useless info)
The goal is to keep only sessions with messages.
When the visitor is closing the livechat window, if the session is empty,
the session should be deleted. But what happens if a visitor start a livechat
session, send no message and just leave the website without closing the
livechat window ? --> empty live chat session will remains in database.
The ir_autovacuum already handle the deletion of empty sessions to main a
clean DB.
Specifications
==============
- Apply 'with messages' domain on session count in the livechat channel view
- Apply 'with messages' domain on session count in the lead view
- Apply 'with messages' domain on livechat session view
- Remove With message filter
- Remove Without message filter
- If send message on a deleted session :
just tell the visitor that operator is not available anymore
AND delete livechat session cookie (as he waited 1 day to send a message)
Empty sessions becomes invisible : not possible for users to see empty session
(in count or in views) and cron is cleaning empty sessions every day.
This commit also adapts visitor session count and view accordingly.
Task ID: 2146962
PR #41065
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The filter for Purchase orders in the Purchase report did not filter out Sent RFQ,
despite the fact that they were not really ordered yet.
opw:2158248
closesodoo/odoo#44892
X-original-commit: 201cfb46462590bb2460bc76317e37742c789fae
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
When grouping records in kanban view, if a quick create widget was
already opened, clicking on the "+" to launch another quick creation
would crash.
Fixes https://github.com/odoo/odoo/issues/44680closesodoo/odoo#44949
X-original-commit: b482df17058e6f2117b616e6b152a7f2c90dc121
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This parameter declared on mailing and project classes is not used anymore.
Let us remove it to clean model definitions.
closesodoo/odoo#39401
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The typical command to launch odoo in the install documentation is usable as it is after following the complete instructions.
There is two changes done here:
- Remove the ../my_modules from the command, as it is a directory not used in the page at all.
- Remove the db-filter option not mandatory since the 11.0 version and add a '-d' argument. This will create the db instead of showing the database selector to the reader.
closesodoo/odoo#44899
X-original-commit: 6a5d43dac042d76a12d1757962a0aec641fa1ae8
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
* = website_crm, website_hr_recruitment, website_sale
Changing label position on existing field was replacing the label with
the default one.
Redirection message was not updating the overlay
Going from show message to redirect without hidding the mesage made the
form d-none
When a select field's label's position was changed the select was not
editable anymore.
Some other miscellaneous fixes
task-2191409
closesodoo/odoo#44911
X-original-commit: 3cf87cc1cb179598cecb736728378e330d3b2e22
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This restores the behavior for 12.0; we don't want those amount within the national tax report.
closesodoo/odoo#44894
X-original-commit: bd21046f9259f0c755deeba8a1d207da6578e957
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This route was public by mistake, probably introduced to test during
ddf32f4 but no reason to make it public, public user has not the write
access on models anyway.
Courtesy of Swapnesh Shah
closesodoo/odoo#44915
X-original-commit: 66ac96b25aa4cf2b074f6c06b57ed8be72d6d647
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
- Go to Settings > Technical > Resource > Working Times
- Have a Resource Calendar RC with Average hour per day != 8.00
- Have an Employee E with Working Hours == RC
- Leaves > Configuration > Leave Types
- Have a Leave Type LT with Take Leaves in Hours
- Leaves > Managers > All > Allocations
- Create an Allocation A with Employee E and Leave Type LT
- Enter any number in Duration
The number of hours entered changes as we leave the field.
Being totally honest, what happens here is not clear at all, but using
the corresponding `resource_id.calendar_id` field seems to fix the
problem.
opw-2191795
closesodoo/odoo#44903
X-original-commit: e239b354da9fa072e03e4d1186927fa3d74bcfe6
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
If some filter domains use M2O to models current user cannot access,
using sudo() permit to filter even when user cannot access linked
models.
for the accuracy of the fix, add a unit test which reproduce the exact
reported bug.
closesodoo/odoo#44923
X-original-commit: 30e2153539643491fad889811a54a8e580fa9c58
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
When you have su == True in your env and you call _name_search
the _name_search was switching back to su = False
when you call with_user with the same user or with None
To reproduce the issue, take a model where a user has
no access.control.list allowing to read the model
call name_search with sudo.
X-original-commit: 8755269f9877e039663adaec8500b530b6d67c68
Issue
- Install Website
- Go on your website
- Add text block with image
- Change ONLY the image's alt and/or the image's title text
- Save dialog
- Save page
Not saved
Cause
The element doesn't become dirty after changes in alt dialog.
Solution
Trigger content_changed to make the element become dirty.
OPW-2189909
closesodoo/odoo#44885
X-original-commit: 4f1712075fbc4d95d83690fbcfe72f9b72260254
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Make sure `is_website` is an existing field of the model at creation.
opw-2192139
closesodoo/odoo#44870
X-original-commit: 5daf25f2c693c17e75223f8e3502d5c4121cb3b5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Explanation about flushing in action_switch_invoice_into_refund_credit_note:
Because the 'type' is set before 'amount_total', 'amount_total' is recomputed with the
wrong type and then make the condition badly evaluated.
For some reason, the field wasn't badly recomputed before:
https://github.com/odoo/odoo/commit/020e2a5e85036976b309b439582d70b5b775e54fclosesodoo/odoo#44868
X-original-commit: a82e62d1925ebfd4f49360fdc5f3a8d28de5a0d9
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
- install e-commerce;
- In the website settings, orders followup, set a salesperson;
- By something as a public user;
- Pay the order.
Before this commit:
- 2 emails where create to assign the salesperson to the SO, but these
emails didn't have a from and the salesperson didn't receive the
emails.
- 1 email was also create to assign the salesperson to the contact, this
mail is not necessary.
Now, only one email that assigns the salesperson to the SO is sent,
with a correct from address.
opw-2189683
closesodoo/odoo#44861
X-original-commit: 7c08eb158858b9573d3d84a0b54df0bfca754105
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before this commit, no recompulation were performed at the end of the
tracking procedure. This is because the main flush() occurred before
the tracking of values. The absence of flushing is problematic in the
case where the tracking is used to create/update records.
closesodoo/odoo#44851
X-original-commit: c60da49a1d81fa73b60135185d5b706eec771475
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>