Commit Graph
125961 Commits
Author SHA1 Message Date
William Henrotin a45e843dec [REF] mrp: share similar code
The quantity to consume for a component is computed in different places
(community and enterprise modules, workorder and produce wizard) during
a production. This commit share those computations into a static function.

closes odoo/odoo#32864

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-23 13:24:43 +00:00
wan 92480b8697 [IMP] account: bank account configuration, remove views
Task 1966321

There are 3 different ways to configure a bank account and it’s confusing:
- config bar wizard
- journal
- bank account (Menu: Configuration/Accounting/Bank accounts)

We want to use the wizard for creation and the journal for configuration, so removing the bank account (Menu: Configuration/Accounting/Bank accounts) view).

closes odoo/odoo#32590

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-17 13:14:47 +00:00
wan e6f1cdc145 [IMP] account: display moves to check for all journals on dashboard
Task 1966334

closes odoo/odoo#32595

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-19 08:57:22 +00:00
Antoine Guenet 9b8eafaad1 [IMP] qunit: dump the body on OdooAfterTestHook fail
closes odoo/odoo#32829

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-04-19 12:15:03 +00:00
Antoine Guenet 706bf85512 [FIX] web_editor: disable tooltips in keyboard tests and on option off
The link and media tooltips were not taking Summernote's `tooltip`
option into account. That option ensures that tooltips are disabled if
the option is off (which is for instance the case on mobile).
This fix ensures that these tooltips are disabled when the option is
set to `false`.
It also disables tooltips in the keyboard tests. They are not relevant
to the keyboard tests and occasionally caused the DOM to not be properly
cleaned after the tests were run (most likely due to their 2000ms
`setTimeout`).
2019-04-19 10:23:21 +00:00
Arnold Moyaux 45e80f56b9 [FIX] mrp: allow skipping lot/sn on workorder
Usecase to reproduce:
- Create a MO for drawer with SEC assemble BoM
- Plan the workorders
- In the first workorder record the production without specify a lot or
serial number.
- Second workorder, register a new serial for finished product and
record production.

A UserError that prevent to use a new serial number is raised. It
happens because the system check the remaing quantity on other
workorders + the quantity already produced for the current lot. In this
case the remaining quantity for the first workorder is 0 and the current
lot was not produced. However it should count the lines without lot as
a 'remaining quantity' since they could be used later to create a new
serial or lot number.

This commit register the lines without lot and use them to raise the
UserError and compute the allowed lot domain for finished lots.

closes odoo/odoo#32632

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-23 09:20:06 +00:00
Nicolas Bayet 270f821e94 [IMP] account: add reconcile model in l10n_be accounting and tweak the menu
- set the tax adjustment menu to be seen only in debug mode
- add a new reconcile model for suspense account
- change chart_template.py to consider 'to_check' field when loading
  the COA

closes odoo/odoo#32780

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-19 12:32:29 +00:00
William Henrotin 19a5780dd1 [IMP] mrp: allow create component in demo
This commit ticks the 'Create component lot' checkbox for
the demo manufacturing operation type of first warehouse.
This change will leave the default behaviour for all warehouses
but tests with demo data are now more straightforward and do
not demand too much parametrization

Task : 1970450

closes odoo/odoo#32772

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-19 12:16:54 +00:00
William Henrotin 644474cb93 [FIX] stock, mrp: handle multi method
Commit 84ae731d5d used 'self.code' in a method
called by a multi one. As 'self.code' expect a singleton, the transaction
raise an error in case of multiple records into the recordset

This commit calls the method into a loop on 'self and change its signature
to pass 'code' and be sure its a non multi one
2019-04-19 12:16:54 +00:00
Joren Van Onder f18e4fc0ea [FIX] pos_hr: make employee selection work again
this is undefined, use self.

Oversight of 5f3b5f0a9d.

closes odoo/odoo#32860

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-22 23:57:55 +00:00
qsm-odoo 75f16ee07f [FIX] web, website: adapt menu loading to jQuery 3
Javascript is responsible of showing the menu, potentially with some
parts regrouped in an extra dropdown, on page load (this is what we
call the "autohide" feature). This was done on both the menu and the
affix menu. It worked on the affix menu because the affix menu widget
was initialized before (by luck: alphabetical order).

Since the jQuery 3 update https://github.com/odoo/odoo/commit/bb004e3d7f3df5a5af6b2e994ec0af79e2da890f
deferred are always delayed (even if their resolve condition is met on
creation). This made the animations to be initialized in the same order
as before but their 'start' method to be delayed (as the willStart was
delayed). So what happened before was:

1) Find menus to enable affix
2) Enable affix on found menus (duplicate the menus to do that)
3) Find menus to enable autohide
4) Enable autohide on found menus (both the menu and the duplicated one
   were found)

And since jQuery 3:

1) Find menus to enable affix
2) Find menus to enable autohide
3) Enable affix on found menus (duplicate the menus to do that)
4) Enable autohide on found menus (the duplicated one was not found at
   step 2 since it did not exist yet)

In fact, widget starting should never have relied on alphabetical order.
The fix only consists of starting widgets on the duplicated menu once it
is ready. This is what this commit does.

However, doing this revealed another bug: if the widgets are started
only for a DOM portion like a '.a' element, a widget with a multiple
parts selector like a '.a .b' selector will not be considered, as
searching inside a '.a' element will not allow to match elements with
a selector containing a '.a'. This is in fact not really a "bug" but a
limitation, so unless we get problems because of this in stable
versions, we can only "fix" this for the current saas. This is fixed
thanks to `dom.cssFind` which already existed. This commit however
improves it to try making it more efficient.

closes odoo/odoo#32465

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-19 12:07:14 +00:00
qsm-odoo a742bf3d5b [FIX] website_sale: fix double click on add to cart
Using "async" in the event parameter is not enough, you have to
return correct promises in the event handlers.

closes odoo/odoo#32479

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-19 11:17:56 +00:00
RomainLibert bf1e39540f [FIX] web: remove traceback when attaching a document
The closure overrides the arguments, which makes it impossible to
recover the attachment_ids hence sending null python code which then
breaks.

closes odoo/odoo#32810

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-04-18 14:02:14 +00:00
Cedric Snauwaert af1841560b [IMP] account: automatic periodical VAT closure
closes odoo/odoo#32619

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-17 12:10:33 +00:00
Cedric Snauwaert b72756be1f [IMP] account: next activities in misc journals dashboard 2019-04-17 12:10:24 +00:00
qdp-odoo 19aa35fabb [FIX] account: fix test_account_move_tax_lock_date.
Make sure the move, journal and the accounts will share the same company to prevent undeterministic error in runbot ('Cannot create moves for different companies.')

closes odoo/odoo#32759

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-17 08:34:48 +00:00
Yenthe666 8c402ca38a [FIX] stock: remove duplicated field definiton
closes odoo/odoo#32708

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-16 08:01:46 +00:00
Simon Lejeune 8c377471b6 [REF] sale_mrp: speedup tests
Before on rubot
odoo.addons.sale_mrp.tests.test_sale_mrp_flow tested in 97.08s, 117272 queries

After on runbot
odoo.addons.sale_mrp.tests.test_sale_mrp_flow tested in 50.84s, 61903 queries

closes odoo/odoo#32537

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-15 07:32:32 +00:00
Simon Lejeune 4ad81157e7 [REF] mrp_subcontracting: speedup tests
Before on runbot
odoo.addons.mrp_subcontracting.tests.test_subcontracting tested in 11.40s, 14213 queries

After on runbot
odoo.addons.mrp_subcontracting.tests.test_subcontracting tested in 7.95s, 9863 queries
2019-04-15 07:32:32 +00:00
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
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
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
Martin Geubelle 120359bf0c [FIX] web: restore handle and remove button width on list
Rev. odoo/odoo@9fbb4fb wrongly removed the fixed width on handle and
button width on list views.

This commit restores it.

closes odoo/odoo#32467

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-05 13:37:56 +00:00
Martin Geubelle cdd644befc [FIX] web: correctly update modifiers in editable list with buttons
Since rev. odoo/odoo@015958d it is possible to add buttons in list group
headers. These buttons are defined in <groupby> nodes, pointing to m2o
fields. Modifiers specified on these buttons thus use fields on the m2o
comodel.

There was a traceback in editable list view, when grouping by a m2o
that defines a groupby button with modifiers as the modifiers are not
registered with the same datapoint. When updating the modifiers, one
must ensure that the modifier are related to the updated record.

closes odoo/odoo#32456

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-08 11:23:24 +00:00
Aurélien Warnon b424aba504 [FIX] sale_product_configurator: remove es6 JS code
Task#1964518

This commit removes es6 code that was unintentionaly introduced
by the product configurator for better compatibility

closes odoo/odoo#32452

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-12 06:37:09 +00:00
Christophe Simonis 3fc2577c01 [MERGE] forward port branch saas-12.2 up to be3c981423 2019-04-11 19:27:36 +02:00
Christophe Simonis be3c981423 [MERGE] forward port branch saas-12.1 up to 636df25f21 2019-04-11 18:17:25 +02:00
Christophe Simonis 636df25f21 [MERGE] forward port branch 12.0 up to c9d3653f48 2019-04-11 18:00:27 +02:00
Christophe Simonis e7a0d82c3c [FIX] account_check_printing: correct test
Since 491deeb3d4, only check related to
reconciled invoices are printed. Adapt test to take it into account.
2019-04-11 17:24:25 +02:00
Arnold Moyaux c9d3653f48 [FIX] mrp: state on workorder with 0 batch size
Usecase:
- Go on a BoM with a routing. Go on the first operation and set
the next operation(batch field) as 'Once a minimum number of products is
processed'.
- Set the batch size (minimum operation) to 0.
- Create a MO and plan it.
- The second work order has state 'pending' instead of 'ready'

It happens because the system automatically set the first wo as
'ready' and the following as 'pending' and don't check the batch
and batch_size.

closes odoo/odoo#32628

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-11 13:21:54 +00:00
Hugo Vinicius Garcia Razera 2a88e0197a [CLA] Sign Odoo CLA for hviniciusg
closes odoo/odoo#32591

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-11 11:55:38 +00:00
Yannick Tivisse 87a30cca7d [IMP] l10n_be_hr_payroll: Add an overridable method to compute costs
closes odoo/odoo#32582

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-04-11 11:19:50 +00:00
Nans Lefebvre 9365dc5d17 [FIX] account: better message on user group error
The validation error introduced in 552da8dc can pop up in contexts where
it is not expected;
e.g. not in editing user rights but while upgrading a module.
Therefore we make it more explicit, giving the user a way to resolve the error.

closes odoo/odoo#32623

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-11 10:29:30 +00:00
Xavier Morel 6bd9e71d9d [FIX] SSF: misinterpretation of onchange command (4)
From an onchange, at this point, (4) doesn't mean "no change" it means
"reset to database values". Through the interplay of client and server
reverse-engineering one another at this point the client (is supposed
to) assume the o2m results are "complete" and a diff from the
current *in-database* values rather than the in-client (sent to the
server) ones.

So a (1) should completely replace all existing values, and a (4)
should just remove all of them (but keep the record linked).

closes odoo/odoo#32617

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-04-11 07:49:21 +00:00