Before on runbot
odoo.addons.stock_account.tests.test_stockvaluation tested in 25.52s, 59252 queries
After on runbot
odoo.addons.stock_account.tests.test_stockvaluation tested in 20.43s, 38535 queries
before on runbot:
odoo.addons.stock.tests.test_move tested in 31.79s, 63166 queries
odoo.addons.stock.tests.test_move2 tested in 33.69s, 68046 queries
odoo.addons.stock.tests.test_quant tested in 8.48s, 15351 queries
odoo.addons.stock.tests.test_stock_flow tested in 16.99s, 31506 queries
amounting to 90 seconds on a build page
after om runbot:
odoo.addons.stock.tests.test_move tested in 12.41s, 24197 queries
odoo.addons.stock.tests.test_move2 tested in 13.55s, 24254 queries
odoo.addons.stock.tests.test_stock_flow tested in 9.74s, 15795 queries
amounting to 37 seconds on a build page
Use savepoint case instead of transaction case.
We took the opportunity to rename the master data more appropriately,
which results now in a bigger diff in TestMove and TestQuant. In
TestQuant, the master data creation had to be moved in the setUpClass
too.
We removed test_shipment as test_backorder_1-4 in tet_move_2 covers the
same parts of the code.
Anglo-saxon Accounting entries are created always with the same Partner
id (the last one).
This commit is a fine tuning of the commit : 5ca0ef978f
opw-1961409
closesodoo/odoo#32672
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Commit 48018411 introduced a new ir.action.report type: qweb-text.
Commit 3425752 introduced an explicit check on the type, for html or pdf.
This removed the ability to support arbitrary reports through the call to the
generic render method, which dispatches to the correct one for a report_type.
We add support for the text format following the same logic.
The explicit error will be raised if the rendering fails,
e.g. in the case where the render method is not defined.
Thanks to @gdgellatly for reporting.
opw 1966208
closes#28513closes#30013closes#32532closesodoo/odoo#32773
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
subproduct and byproduct are both used in code.
However the UI always shows by-product only.
Rename sub.product, sub_product,... in byproduct
in order to use the same term everywhere.
closesodoo/odoo#32540
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Be consistent with by-products and byproducts. Only use by-products.
When a product is created from the BoM view, it has a default type
as storable product, set the same type when the product is created
from by-products tab.
Usecase to reproduce:
- BoM with final product tracked by SN
- Produce wizard add a component tracked by SN (not from BoM)
- Produce and mark the MO as done
The tracability report do not show the extra component used.
It happens because _record_production call _action_done on moves raw
and finished. _action_done create extra move with moves that created
more than expected (the purpose is to trigger rules). However in stock
the new move is created then merged in its parent but in mrp moves are
not merge. _record production set the tracability for initial moves but
ignore the extra moves created. So the tracability report is not
complete.
Fix it by catching the new moves created after _action_done and set
the consume_line_ids for the extra moves also.
In MRP the tracability is only set between the finished
products and the components. However when the by-products is
tracked by serial number, it could be usefull to know from which
components it was created. This commit add the link between by-products
and raw materials (only in produce wizard at the moment).
Technically we replaced the one2many field by a many2many.
Unbuild a manufacturing order only undo the final product and its
components. The byproduct created will not be undo with the correct
ratio. This commit will allow to undo a ratio of byproducts for a
specific MO or base on the BoM if the byproducts are not tracked.
Technical refactoring in order to set by-products the same way
than raw materials. Before this commit byproduct were always set
at the last workorder or automaticaly set at the end of produce
wizard with the same quantity than in the BoM. In order to modify
it, the user has to produce the finished product then unlock and edit
the finished move line linked to the byproduct. In this commit, the
user could specify at which workorder the byproduct is created and
he could directly specify another quantity done in the produce wizard
inside a specific tab for by-products.
Technicaly, abstract workorder will add a new many2one key on workorder
line in order to set 2 different one2many (one for finished goods and
the other for raw materials). The key is set depending the many2one
key for production on the linked stock move. On the by-products itself,
it is now managed as a workorder line, thus the code to generate them
and transform them in a finished stock move line is the same than for
the raw components.
Before this rev., the datepicker was opened when a date(time) field
was focused (e.g. with keyboard navigation). We don't want this
behavior anymore, and we want the datepicker to open only when the
user clicks in the input. This rev. makes this change.
Moreover, this allowed to refined the keyboard navigation (ESC) in
editable list views: when a datepicker is opened, and the user
presses ESC, we close the datepicker, but we keep the row in
edition, whereas before this rev., the row was switched to readonly.
closesodoo/odoo#32408
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Avoid pathological SQL queries with extremely long list of ids in a
WHERE clause. The strong relation between these models make an auto_join
a no brainer.
closesodoo/odoo#32645
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
The user can delete teams created during the installation of the Sale
Team module, both CRM and Sale modify those teams but the way they
modify the teams doesn't take their deletion into account.
This reverts commit 30a848bffb to replace
post_init_hooks by `forcecreate=False` in the datas.
closesodoo/odoo#32742
Signed-off-by: Christophe Simonis <chs@odoo.com>
Steps to reproduce the bug:
- Define two pricelists P1(€) the default one and P2($) with discount_policy = 'without_discount'
- Activate P1 and P2 on the website
- Go on the shop and select P2
Bug:
An error was raised from function _get_conversion_rate because the arguments date and company_id were not defined
because the function _get_real_price_currency was called from _website_product_id_change with
the model "self.env['sale.order.line'] and not with a recordset. So the fields self.company_id and self.order_id.date_order
were not defined.
opw:1969849
closesodoo/odoo#32726
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Before this commit, the standard mail templates for calendar
did not have a language
After this commit, we set it to the the partner's language
OPW 1946686
closesodoo/odoo#32717
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The available_carriers must be computed according to the shipping address.
opw:1967445
closesodoo/odoo#32693
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
the group by key in action context can be a single string
containing the name of a single field or a list of string
reprenting a list of field names
Before this commit, the board did not take this into account
After this commit, it does and supports both expressions
OPW 1956130
closesodoo/odoo#32471
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Assume an editable list view with a date(time) widget, click to
edit a line, focus the date field (the datepicker opens), press
ESC: there is a crash in the lib, and the datepicker remains open
forever.
This fix is twofold:
- we added a check in the lib to prevent it from crashing (it is
easily reproducible: it crashes when an opened datepicker is
removed from the DOM).
- we added an event handler of ESC keydown event to hide the
datepicker before the field is removed from the DOM.
Subpixels computation is different accross browsers and platforms as no
rounding rule is specified by HTML5. Difference in this computation
breaks one of the editable list tests on Chrome and Firefox on MacOS.
In an editable list view with at least a facet (e.g. filter) in
the search view, start editing a row, then click on the 'x' to
remove the facet. The view being updated and re-rendered, the row
in edition (if still present) is back in readonly. However, the
buttons in the control panel are not updated ('Save' and 'Discard'
are still displayed, instead of 'Create' and 'Import').
Normally, when the user clicks outside the list, the edition is
left smoothly. However, this scenario is a corner-case because the
element we clicked on (the 'x' in the facet), is no longer in the
DOM when we enter the list '_onWindowClicked' handler, being in
charge of deciding whether or not we should leave the edition. For
this specific case, this handler doesn't leave the edition, because
it assumes that we have clicked on an sub-element of the list that
is no longer in the DOM (e.g. a modal opened from a field widget).
Since it's no longer in the DOM, there is no way to determine
whether it was in the list or not.
This whole '_onWindowClicked' logic is problematic, but we don't
have any better solution for now. So this rev. fixes the issue by
always resetting the buttons to 'readonly' when the view is
updated, which is valid in the case of the list view.
Unfortunately, we couldn't reproduce the bug in a test, because of
a difference between user clicks (with the mouse) in the browser,
and programmatical clicks (triggered in JS) as we do in the tests.
For natural clicks, there is a delay between the (different level
of) handlers call (probably a nextTick) whereas all handlers are
executed in the same tick for programmatically triggered clicks.
For instance, when the user clicks on the 'x' to remove the facet,
the 'click' handler on '.o_facet_remove' is executed, and the
searchbar is re-rendered (new Widget, so next micro-task tick, but
still before the next tick), and in the next tick, the 'click'
handler on 'html' is executed (and the event is triggered on
core.bus, followed by the execution on '_onWindowClicked'). In the
test, both handlers are executed directly, and thus when in
executing '_onWinowClicked', the searchbar hasn't been replaced by
the new one yet, and the clicked '.o_facet_remove' is still in the
DOM. The row is then unselected, and the buttons are correctly
updated.
Before this rev., when adding then discarding a new record in a
(main) editable="top" list, the record was added to the top of
the list, and then replaced by an empty row when discarding,
whereas that empty row should have been rendered below potential
data rows.
Recent work on the list view allowed to add buttons in group
headers (see 015958dc17). However, we couldn't execute the action
of the button by pressing Enter, because the Enter keydown was
stopPropagated by another handler (folding the group).
This rev. makes this work, and also improves a bit the style of
the buttons in group headers.
Task 1915702
Assume an x2many editable list where the user edits a record (input
field), and then clicks on 'Add a line' (and keeps it pressed for a
while, before releasing the click).
When the 'mousedown' event occurs, the 'change' event is triggered
on the edited field, and (once potential onchanges have been
applied), the list is updated, i.e. all rows except for the one
being edited a re-rendered.
However, the 'Add a line' handler listens to the 'click' event,
which never occurs if we release the click after the rows have been
re-rendered.
This is an issue for every rows, not only 'Add a line', but for
data rows, the issue is already present in former versions, and is
not that easy to fix). The 'Add a line' case is a consequence of
the recent work on list views (see 234d92c4f0), so we can fix it
independently.
Task 1915702
There was one tax group per tax which was strange, so remove all duplicated tax group and only keep one tax group per tax percentage (0%, 6%, 12%, 21%)
closesodoo/odoo#32585
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
When displaying forecasted inventory if there is no default order,
the default order forced on date and id. In that case, if the date is
not in the "group by", it causes warning.
With this commit, the date is forced in the SQL view.
closesodoo/odoo#32633
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
When joining a course of liking a slide if the user is not logged there
is a popover asking him to login. If auth signup allows user creation
link instead redirects to signup instead of login to save a click and
improve onboarding.
closesodoo/odoo#33755
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- The overdraft setting of lunch is company dependent but had no
icons specifying it on the settings view.
This commit adds the icon
closesodoo/odoo#33761
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
This commit allows the user to edit the name of the sections
in the front end with the web editor
Task ID: 1999661
PR: #33633
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In the backend, the user has the possibility in the channels list to drag and drop
channels to define their order, thanks to the `sequence`.
This order was then not respected in the front-end when displaying the slides channel
`/slides/all`.
This was basically not possible for the user to control the order in which
the channels were displayed.
With this revision, when the order is not specified to the controller,
or is wrong, it fallbacks to `None`, which therefore follows the slides channel natural
order, which is `sequence, id`. The user can now control the order of the slides channels
in the front-end.
closesodoo/odoo#33745
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
1/ As admin, add Lunch Maki to your order
2/ As demo, add Lunch Maki to your order
Admin now has 2 Lunch Makis, demo has none.
closesodoo/odoo#33731
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
- When displaying the organisational chart an access right error can be
triggered if the current user cannot read employees from other
companies and if one of the displayed employee's manager is in an other
company.
closesodoo/odoo#33576
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Before this commit, if you was searching something that return no results,
you will call the sql query generating an error syntax:
Traceback:
ERROR: syntax error at or near ")"
LINE 8: WHERE sub.id IN ()
Now, we don't make more useless query if we know that there are no users.
+ preventive fix the call of this method without user_ids
This commit is related to #14667closesodoo/odoo#33715
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Following https://github.com/odoo/odoo/commit/ddf2d2dd666c6e3fa2b6b7f943575657a42d6d8b,
the card bodies received a background color.
The 'row' class should not be used on a 'card-body' element but if it is
done, our custom bg color would overflow the card. As a fix for those
cases (normally only one at the time this fix is made), remove the
background color.
opw-1946124
closesodoo/odoo#33710
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
If the `/longpolling/im_status` route is slow to respond, the UI might
be blocked while there is no good reason to do it.
closesodoo/odoo#33643
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
- If you are a portal user when trying to access the validation queue
an access right error can be triggered when trying to read the post's
user name if the record rules don't let you read on this specific
user.
closesodoo/odoo#33626
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
We should have the frontend and backend in sync on the last_location
of the user
closesodoo/odoo#33608
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Converting a checklist into an ordered list didn't remove the
o_checklist class. In consequence, converting a checklist to an
ordered list and then to an unordered list failed as the unordered list
with the o_checklist class is effectively a checklist. This fixes that
bug.
closesodoo/odoo#31432
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>