Commit Graph
127612 Commits
Author SHA1 Message Date
Simon Lejeune 81afb10083 [REF] stock_account: speedup tests
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
2019-04-15 07:32:32 +00:00
Simon Lejeune c5ff803fcc [REF] stock: speedup tests
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.
2019-04-15 07:32:32 +00:00
Jorge Pinna Puissant df68900870 [FIX] point_of_sale: anglo-saxon accounting entries same partner
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

closes odoo/odoo#32672

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-15 06:34:00 +00:00
Laurent Mignon (ACSONE) d637fe4010 [IMP] mail: restore support for all report_types in mail attachments
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 #28513
closes #30013
closes #32532

closes odoo/odoo#32773

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-17 18:23:08 +00:00
Arnold Moyaux 12da02d161 [REF] mrp: rename subproduct in byproduct
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.

closes odoo/odoo#32540

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-04-12 12:50:34 +00:00
Arnold Moyaux b5780cf8bb [FIX] mrp: by-products typo + default type on product
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.
2019-04-12 12:50:34 +00:00
Arnold Moyaux 1fac199517 [FIX] mrp: tracability on extra move line
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.
2019-04-12 12:50:34 +00:00
Arnold Moyaux 030db4a4b0 [IMP] mrp: tracability on byproducts
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.
2019-04-12 12:50:34 +00:00
Arnold Moyaux 3b4e33672a [IMP] mrp: unbuild byproducts
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.
2019-04-12 12:50:34 +00:00
Arnold Moyaux a4c0994cf4 [REF] mrp: byproduct as a workorder line
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.
2019-04-12 12:50:34 +00:00
Arnold Moyaux 6f25cf1aa7 [REF] mrp: add groups for byproducts
Since mrp_byproduct is in mrp. We want to keep the byproduct as an
additional feature. So this commit add a group and hide byproducts
fields in views.
2019-04-12 08:46:07 +00:00
Arnold Moyaux 4b2c73b0e0 [DEL] mrp_byproduct: remove module 2019-04-12 08:46:07 +00:00
Arnold Moyaux 5d1e73c5cb [MOV] mrp, mrp_byproduct: move byproduct in mrp
Move code from mrp_byproduct to mrp module. The purpose is to
delete mrp_byproduct module.
2019-04-12 08:46:07 +00:00
Aaron Bohy a3d98dae68 [FIX] web: do not open datepicker on focus
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.

closes odoo/odoo#32408

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-04-12 12:42:02 +00:00
Damien Bouvy 19aa7c403a [FIX] stock: enable auto_join for stock_move_line <-> stock_picking
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.

closes odoo/odoo#32645

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-04-12 08:41:19 +00:00
Julien Castiaux c42551b5d2 [FIX] crm, sale: safe override of sales team
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.

closes odoo/odoo#32742

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-16 15:10:45 +00:00
Goffin Simon 8631d3cc64 [FIX] sale: _get_conversion_rate called with no date
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

closes odoo/odoo#32726

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-16 13:00:36 +00:00
Lucas Perais (lpe) 06b3a290f5 [FIX] calendar: templates with right lang
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

closes odoo/odoo#32717

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-16 11:43:35 +00:00
Goffin Simon ae61ed7f50 [FIX] delivery: Delivery method zip using the customer not shipping address
The available_carriers must be computed according to the shipping address.

opw:1967445

closes odoo/odoo#32693

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-15 13:20:46 +00:00
Lucas Perais (lpe) 9787abaeb0 [FIX] board: support group_by as string in action
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

closes odoo/odoo#32471

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-12 07:57:58 +00:00
Aaron Bohy 7bc53ac30e [FIX] web: crash in editable lists with date field
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.
2019-04-12 06:31:11 +00:00
David Monjoie cbafa9eddc [FIX] web: fix many2manytags widget height in editable list view
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.
2019-04-12 06:14:09 +00:00
Aaron Bohy b94c87c28d [FIX] web: list: update buttons when removing a search facet
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.
2019-04-12 06:14:08 +00:00
Aaron Bohy 6722e66517 [FIX] web: list: editable="top" with less than 4 records
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.
2019-04-12 06:14:08 +00:00
Aaron Bohy d43624b5c5 [FIX] web: list: execute group button with keyboard navigation
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
2019-04-12 06:14:08 +00:00
Aaron Bohy d971e4f4c7 [FIX] web: x2many list: edit and long click 'Add a line'
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
2019-04-12 06:14:08 +00:00
Cedric Snauwaert f7432d0d04 [FIX] l10n_be: remove duplicated tax groups
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%)

closes odoo/odoo#32585

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-12 11:37:35 +00:00
Arnold Moyaux e5b19bd5aa [FIX] stock: force group by date when ordered by date
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.

closes odoo/odoo#32633

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-11 15:43:21 +00:00
Thibault Delavallée 8c642167e9 [FIX] website_slides: propose to signup instead of login
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.

closes odoo/odoo#33755

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-29 13:40:04 +00:00
Thibault Delavallée 2d0d68a2e3 [FIX] website_slides: remove unnecessary links in achievement section
Those links do nothing as they link to the main page. Currently just remove
them as no real spec has been given.
2019-05-29 13:40:04 +00:00
Toufik Ben Jaa ffc4bdc4c6 [FIX] lunch: add multicompany icon on settings
- The overdraft setting of lunch is company dependent but had no
icons specifying it on the settings view.

This commit adds the icon

closes odoo/odoo#33761

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-29 13:39:00 +00:00
qmo-odoo 2bb4aa4850 [FIX] website_slides: Make section names editable in front end
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>
2019-05-24 06:41:06 +00:00
Denis Ledoux b85a135a89 [FIX] website_slides: order channels by the natural order when unspecified
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.

closes odoo/odoo#33745

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-29 09:49:43 +00:00
Joren Van Onder decc1b3c1a [FIX] lunch: don't merge with other users' orders
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.

closes odoo/odoo#33731

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-28 22:16:08 +00:00
Toufik Ben Jaa 86f8be1466 [FIX] hr_org_chart: multicompany managers trigger access right issues
- 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.

closes odoo/odoo#33576

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-22 13:57:29 +00:00
Nicolas Seinlet 1f70d53e5a [FIX] hr_maintenance: see employee equipments
For employee check the employee's equipments while on user pref see own
ones.

closes odoo/odoo#33602

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-23 09:18:08 +00:00
Jeremy Kersten 9f56353b79 [FIX] w_profile: don't call _get_users_karma_position without users
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 #14667

closes odoo/odoo#33715

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-28 09:51:38 +00:00
qsm-odoo c5bab6e240 [FIX] web: restore color of card bodies with row class
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

closes odoo/odoo#33710

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-28 08:59:54 +00:00
Christophe Simonis 5ac0c7960c [MERGE] forward port branch saas-12.1 up to 9bcc0498c0 2019-05-28 12:25:14 +02:00
Jeremy Kersten 45e1d196f9 [FIX] website_profile: use company from the partner
This commit closes #14667 again

closes odoo/odoo#33697

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-27 10:14:23 +00:00
Jeremy Kersten cd2e1164b7 [FIX] website_forum: add missing col from bootstrap migration 2019-05-27 09:36:20 +00:00
Aaron Bohy a5b56e5498 [FIX] lunch: remove flickering of lunch widget
closes odoo/odoo#33685

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-05-27 12:18:31 +00:00
Odoo Translation Bot c62fa35180 [I18N] Update translation terms from Transifex 2019-05-26 06:06:19 +02:00
Nicolas Martinelli 39937634b7 [FIX] mail: hide im_status RPC
If the `/longpolling/im_status` route is slow to respond, the UI might
be blocked while there is no good reason to do it.

closes odoo/odoo#33643

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-05-24 09:23:02 +00:00
Toufik Ben Jaa ea92ce6018 [FIX] website_forum: access right issue on validation queue
- 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.

closes odoo/odoo#33626

Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
2019-05-23 15:03:17 +00:00
RomainLibert 4ae4af623d [FIX] lunch: make sure that user has a last_lunch_location
We should have the frontend and backend in sync on the last_location
of the user

closes odoo/odoo#33608

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-23 15:27:17 +00:00
Gorash 4cbf5dc97b [FIX] web_editor: avoid double open of media modal when slow network
closes odoo/odoo#33327

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-05-22 11:49:52 +00:00
Gorash 4cbbab3d28 [FIX] web_editor: don't close all modal on click an 'x' help modal
We monkey patch summernote here to fix the issue, but the summernote will not
update and are removed in V13.
2019-05-22 11:49:52 +00:00
Gorash 9fd27ff101 [FIX] web_editor: indent multiple lines at a time with editable as parent 2019-05-13 07:40:36 +00:00
Antoine Guenet e2ca200046 [FIX] web_editor: remove o_checklist class on convert to ordered list
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.

closes odoo/odoo#31432

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-22 11:55:23 +00:00