Commit Graph
117975 Commits
Author SHA1 Message Date
Simon Lejeune b4f1e316e6 [FIX] stock_account: average and anglo saxon
Remove behaviour introduced by [1], if there's a price difference the
price difference account will be used. This code block did not take into
account the fact that out move have a negative price unit, resulting in
inverted debit/credit. Furthermore, there's no special case for return
of standard and fifo.

[1] 1df16a189e

opw-1828196
2018-04-26 14:48:16 +02:00
Nicolas Martinelli 33b6edfd2f [FIX] mail: onchange activity
- Set a default value for the field 'Activity Type'
- Schedule an activity

The default value doesn't appear.

The default value is taken into account, but the onchange override the
value.

opw-1838066
2018-04-26 12:53:30 +02:00
qsm-odoo 734724691a [FIX] web: restore btn-link variations and badge style
+ printing improvements

Some style was lost for mysterious reasons during the less2scss
convertion.
2018-04-26 12:35:24 +02:00
Laurent Smet 5439e72a4e [IMP] payment*: auto-create journal for payment.acquirer
This commit adds the auto-creation journal for installed acquirers.
This is not easy because:
- The acquirers are created on the 'payment' module but are enabled only when the specific module
is installed. E.g. Paypal is enabled with 'payment_paypal'.
- To create a journal, a chart of accounts is required. However, the post_init_hook on the
'account' module makes the installation order harder. E.g install payment_paypal directly:
The module are installed in the order: account -> payment -> payment_paypal -> l10n_generic_coa.

To fix the problem, the journals are created at two moments:
- During the installation of the chart of accounts.
- At the installation of an acquirer module. E.g. payment_paypal.

Was PR #23904
Was task: 1831620
2018-04-26 11:26:22 +02:00
Mohammed Shekha d9662321e2 [IMP] web: Kanban: correct cover image margins
The cover image top and bottom margins should be the same on a kanban record.

The bottom margin on `o_attachment_image` has thus been removed as it is already
defined on `o_kanban_record_body` class, which makes a double bottom margin.

Task 54019
2018-04-26 11:08:54 +02:00
Géry Debongnie c5f50c56a9 [FIX] web: fix a race condition in web client
Here is an interesting scenario, involving the reconciliation tour again
(because it is our only tour that does async stuff before changing url):

- web client starts normally
- tour reconciliation starts, perform an rpc to find some id
- web client fetches users default action, it is empty, so clicks on
  first menu item to load initial action, which is discuss. this will
  make the web client load the action with datamanager (it should be the
  action manager's job!).
- reconciliation tour rpc completes, it changes the url, this will do a
  do_action
- the load_action rpc from the web client completes, it will then
  perform a do_action, which will drop the action initiated by the tour
- tour fails.

The issue here is that the on_menu_action method from the web client is
not really safe, from a concurrency point of view: it performs some
asynchronous work, and then unilateraly decides to do a doAction.  With
this commit, we simply add the do_action request to the action manager,
which uses internally a "dropprevious" system.  This means that it will
always use the last action, just as expected.
2018-04-26 09:45:06 +02:00
Géry Debongnie 535490a073 [FIX] web: fix a race condition in web client
Here is an interesting scenario, involving the reconciliation tour again
(because it is our only tour that does async stuff before changing url):

- web client starts normally
- tour reconciliation starts, perform an rpc to find some id
- web client fetches users default action, it is empty, so clicks on
  first menu item to load initial action, which is discuss. this will
  make the web client load the action with datamanager (it should be the
  action manager's job!).
- reconciliation tour rpc completes, it changes the url, this will do a
  do_action
- the load_action rpc from the web client completes, it will then
  perform a do_action, which will drop the action initiated by the tour
- tour fails.

The issue here is that the on_menu_action method from the web client is
not really safe, from a concurrency point of view: it performs some
asynchronous work, and then unilateraly decides to do a doAction.  With
this commit, we simply add the do_action request to the action manager,
which uses internally a "dropprevious" system.  This means that it will
always use the last action, just as expected.
2018-04-26 09:44:22 +02:00
Géry Debongnie f47c544977 [FIX] web: fix a race condition in web client
Here is an interesting scenario, involving the reconciliation tour again
(because it is our only tour that does async stuff before changing url):

- web client starts normally
- tour reconciliation starts, perform an rpc to find some id
- web client fetches users default action, it is empty, so clicks on
  first menu item to load initial action, which is discuss. this will
  make the web client load the action with datamanager (it should be the
  action manager's job!).
- reconciliation tour rpc completes, it changes the url, this will do a
  do_action
- the load_action rpc from the web client completes, it will then
  perform a do_action, which will drop the action initiated by the tour
- tour fails.

The issue here is that the on_menu_action method from the web client is
not really safe, from a concurrency point of view: it performs some
asynchronous work, and then unilateraly decides to do a doAction.  With
this commit, we simply add the do_action request to the action manager,
which uses internally a "dropprevious" system.  This means that it will
always use the last action, just as expected.
2018-04-26 09:43:41 +02:00
Christophe Monniez 5666bc3d32 [IMP] packaging: automate package update in Windows build
When building the Windows installer, a virtual machine is used with
prepackaged python modules.

With this commit, the packaging script will try to install on the
virtual machine the python packages specified in requirements.txt.
Each package is installed individually, that way, if an install fails,
the install of the other packages continues.
At the end of the process, successfully packages are listed so that they
will appear in the build log files.

Also, the Makefile was cleaned in this commit (removal of py2exe stuffs).
2018-04-26 09:22:38 +02:00
Goffin Simon 5588c2e02b [FIX] purchase: Wrong behavior of "Received product" button on purchase order
Steps to reproduce the bug:

- Create a stockable product P
- Create PO and confirm it
- Cancel the PO
- Reset the PO to Draft and reconfirm it
- Validate shipment order

Bug:

- The "Receive product" button is still displayed but every shipment orders of the
PO have been treated.

NB: The field is_shipped is only used to display the button "Received product".

opw:1838539
2018-04-26 09:22:20 +02:00
Miquel Raïch 0c76bd3c63 [FIX] account_asset: avoid company mismatch
It was possible to change manually the company of an asset, although its category would be belonging to another company and thus its depreciation lines and journal items also.

To tackle this problem, we set the company_id field of an asset as related to its category

Was PR #23498. Courtesy of Miquel Raïch
2018-04-26 09:19:38 +02:00
Manuel Vázquez Acosta 33704bc717 [FIX] web: Explicitly decode the JS files in tests.
When in Python 3, then function `open` defaults to open the file in text mode
with and the encoding (if not passed) is taken from
`locale.getpreferredencoding`.

Using `getpreferredencoding` is not necessarily a good practice.  Because
files might no be encoded that way.

When testing Odoo not in runbot (which has LANG set to C.UTF-8) you may get:

Traceback (most recent call last):
  File "/home/gitlab-runner/src/odoo11/addons/web/tests/test_js.py", line 24, in test_check_suite
    self._check_only_call('web.qunit_suite')
  File "/home/gitlab-runner/src/odoo11/addons/web/tests/test_js.py", line 37, in _check_only_call
    if RE_ONLY.search(fp.read()):
  File "/home/gitlab-runner/virtualenvs/odoo11-MlnlRiTaP2/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4757: ordinal not in range(128)

The proposed solution is to read the file in binary mode, and decode to
unicode/str ourselves using utf-8.  We don't use the encoding argument of
`open`, so that the code works in both Python 3 and Python 2.

PR  #24434
2018-04-26 09:14:29 +02:00
Nicolas Martinelli da27836f45 [FIX] account: unreconcile payment
- Company currency in EUR
- Create 2 rates for USD:
  1.0 on 2018-01-01
  0.5 on 2018-02-01
- Create an invoice on 2018-01-02 of 111 USD
- Register a payment on 2018-02-02 of 111 USD
- Unreconcile the payment

An error occurs: 'You are trying to reconcile some entries that are
already reconciled!'

In this specific case where the rate decreases, the exchange rate entry
is reconciled with the payment, so we need to keep the payment entries.
2018-04-26 08:37:33 +02:00
gustavovalverde 1a80fc1ee7 [FIX] l10n_do: Add fiscal purchase journals 2018-04-25 18:09:05 +02:00
Fabien Pinckaersand 051dfea35e [IMP] account: new way of auto-completion of vendor bills/credit notes
This adds the possibilty to select another account.invoice object in a vendor bill or credit note, to automatically copy its lines.

When the purchase app is installed, the same field can be used for auto-completion and users can choose between vendor bills or purchase orders (preferably PO)

Co-authored-by: dat@openerp.com
2018-04-25 17:12:15 +02:00
Martin Geubelle c0809dd41d [FIX] web: reload progressbar values after archiving records
Before this, the progressbar values were not updated (both count and progress)
after archiving all the records of a column.

Multiple things have been done here to update it.

Firstly, a optimization had been done to avoid reloading the progressbar when
updating a column ; this optimization was not correct due to this precise use
case. This will update the progressbar.

Secondly, the `aggregateValues` are reset when putting empty groups back in the
datapoint. This attribute is used to compute the counter if a `sum_field` is set
on the progressbar widget. It needs to be reset because the loop that computes
it won't iterate on empty groups.

Eventually, the mockRPC of the progressbar route was not taking the `group_by`
argument into account (probably a typo).
2018-04-25 16:54:43 +02:00
qdp-odoo fd53539f8e [FIX] account: fix unreconciliation with several exchange rate entries
Use case fixed: manual reconciliation through the account.move.line list of items with several currencies, that will create a full reconcilation with several exchange rate entries to balance the amounts in all foreign currencies. Unreconciling these lines was wrongly creating an account.move with a lot of lines with debit = credit = amount_currency = 0.
2018-04-25 16:20:37 +02:00
Arnold Moyaux 6fac0b0241 [FIX] stock: extra move incorrect qty
Usecase to reproduce:
- Create a product A with a qty on hand 5.5
- Create a delivery order with an initial demand of 5.5
- Validate it with a qty equals to 5.95
The initial demand is updated to 5.951 then reduced to 5.95
and a backorder is created with an initial demand of 0.001.
That should not happen since I process extra quantities.

It python 5.95 - 5.5 = 0.4500000000000002 and the float_compare
use a round UP method thus it returns 0.451 and the following
flow is based on a wrong value.
In this case a float compare is used before the float round, so an
HALF-UP rounding should be okay since a very small quantity diff should
be filter by the compare.

Fixes #24401
2018-04-25 15:43:21 +02:00
04c44c479d [IMP] base(_import),web: mute Add/Create button in x2m
... by setting it 'btn-default', because users hesitate between
that button, and those in the control panel.

Task 32950

Co-authored-by: dbh <dbh@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2018-04-25 15:09:35 +02:00
Aaron Bohy f85a54257d [FIX] web: BasicRenderer: button's name attr in DOM
Rev. 374af56 changed the way 'button' nodes are rendered in basic
views (form, list, kanban). As a consequence, their 'name'
attribute wasn't transmitted to the produced html elements anymore.
However, this attribute is very convenient to debug views, and to
write selectors in tests. For instance, it broke the test added by
rev. 8d17a2a once forwardported in master.

This commit reverts 1ce5bea.
2018-04-25 15:08:53 +02:00
Nicolas Martinelli 32e7dfe0c4 [FIX] account: unreconcile payment
- Company currency in EUR
- Create 2 rates for USD:
  1.0 on 2018-01-01
  0.5 on 2018-02-01
- Create an invoice on 2018-01-02 of 111 USD
- Register a payment on 2018-02-02 of 111 USD
- Unreconcile the payment

An error occurs: 'You are trying to reconcile some entries that are
already reconciled!'

In this specific case where the rate decreases, the exchange rate entry
is reconciled with the payment, so we need to keep the payment entries.
2018-04-25 14:53:42 +02:00
Simon Lejeune c812122d5e [FIX] stock: picking: do_unreserve
When a scrapped move is part of an open picking, it was not possible to
unreserve the picking. A scrapped move is done and scrapped ; this
combination should be allowed.

opw-1835186
2018-04-25 14:03:32 +02:00
Nicolas Martinelli 9e5c1f68a5 [FIX] delivery: fix test
Once again, related to commit 0e881fcd3a

opw-1837132
2018-04-25 12:53:47 +02:00
Nicolas Martinelli 37a901c061 [FIX] account: reconciliation model with Tax 0
- Create the following reconciliation model:
  Line 1 is 50% of amount, tax is 20%
  Line 2 is 50% of amount, tax is 0%
- Use this reconciliation model to reconcile an amount of 1000.

4 lines are created:
- 2 lines for base amount (500)
- 1 line for the 20% tax (100)
- 1 line for the 0% tax (1000)

Obviously, the last line is incorrect, and should be 0.

opw-1837049
2018-04-25 12:50:03 +02:00
Christophe Simonis 1ce5bea306 [FIX] base: adapt js test to new button rendering
Now, button name is not set in dom anymore.
2018-04-25 12:29:34 +02:00
Moisés López c2fec7ed88 [FIX] base_vat_autocomplete: add compatibility with python-stdnum>=1.9
The `country_codes` variable was replaced by `_country_codes` at
arthurdejong/python-stdnum@c113613b70

Make sure the syntax is the same

Closes #24395
2018-04-25 11:04:31 +02:00
Hiral BhavsarandMohammed Shekha 5c651a09e1 [IMP] web: Kanban: allow to archive/restore column records
This feature has been removed in rev. odoo/odoo@e533085 but this commit
reintroduces it. It was considered as "too dangerous" for new users.

Instead of removing the feature, a confirmation request has been added to warn
the user about his potentially harmful action.

The same warning has also been added in List view when archiving records.

Task 60393

Co-authored-by: Mohammed Shekha <msh@openerp.com>
2018-04-25 09:50:44 +02:00
Goffin Simon 019c8b9975 [FIX] delivery: Wrong delivery costs on free_over = True
The calculation of the delivery cost for a sale order / invoice was not correct when
free over  a limit had been satisfied.

Steps to reproduce the bug:

- Set a delivery method DM with a fixed price = 10.0 and free when the amount of the order exceeds 100
- Create a SO for an amount of 150 and set on it DM
- Confirm the SO and deliver it

Bug:

A SO line with DM was created with a fixed price of 10.0 instead of 0.0

opw:1838070
2018-04-25 09:17:00 +02:00
Vincent Schippefilt 549573e24c [FIX] web: allow standard shortcuts on firefox
when navigating with the keyboard, using the ALT key is the trigger
for most of the access keys. In Firefox on Linux, this prevents a number
of existing shortcuts (like ALT+Left arrow for browser back).

This fix allows browsers to execute those shortcuts.

Note: in Firefox on linux ALT+F E V S B T H are assigned to menus and
cannot be stopped, removing the keypress handler does not change
anything.
2018-04-25 09:11:45 +02:00
Vincent Schippefilt de72b13064 [FIX] web: fix crash keyboard related crash in graph view
Before this fix, when going on the graph view from the dashboard view (
using the fullscreen button on dashboard), the focus is on the search
input, hitting the tab key creates a crash.

This fix gives a default implementation of giveFocus to the
abstractrenderer so there is no crash.
2018-04-25 09:11:44 +02:00
Nicolas Lempereur 7b6744ecb7 [FIX] web: pivot race condition load data
When doing several grouping quickly (or if the system is slow) on the
pivot view, we may try to display data that now doesn't corresponds to
the current selected groupBys.

This commit ensures that when we load data of the pivot view, we drop
the previous data loading that are currently being carried out.

Without the fix, the added test failed with:

  TypeError: Cannot read property 'length' of undefined

because the test does:

- select one level of group by
- select two levels of group by
- resolve the first level of group by
- resolve the second level of group by

Without the fix, we would try to display the data for one level of group
by when the pivot view had two levels selected.

With the fix, displaying the first level of group by was discarded once
a second one was being requested.

opw-1825892
closes #24396
2018-04-25 09:11:10 +02:00
Jeremy Kersten e6e07ec1a3 [FIX] website_slide: avoid traceback when channel not readable
If the user has limited_access, download_security field was not read due to the
override of check_field_access_rights and so the field not set.
When you try to access/read it, you got: Selection is not iterable.

Now we check in sudo the download_security.

We also add the **kw that should be present in all routes.
Avoid: "slide_download() got an unexpected keyword argument 'debug'"

We also remove this controller from the sitemap.
2018-04-24 21:18:02 +02:00
Christophe Simonis b192431aee [MERGE] forward port branch saas-11.3 up to ec5e27bb7c 2018-04-24 17:42:41 +02:00
Christophe Simonis ec5e27bb7c [MERGE] forward port branch saas-11.2 up to 7fd9dbdd9f 2018-04-24 16:35:06 +02:00
Christophe Simonis 7fd9dbdd9f [MERGE] forward port branch 11.0 up to b9ce1affbf 2018-04-24 15:55:17 +02:00
Géry Debongnie 8d17a2ae55 [FIX] base: do not read settings record again
The settings view is supposed to open a new record on the model
res.config.settings, perform the default_get and onchange calls, then
display the result.

However, once this is done, if the user then clicked on some links
(which do save the current record and navigate to another action), then
click on the breadcrumbs to come back to the settings view, then the
settings view will reload the current record, which has an id, and this
also will update the url.

This could be a problem.  For example, in a multicompany settings,
reloading a settings view from an id will reload the settings for a
given company, even if the user changed its current company.

To fix this issue, we make sure the basic model for the settings view
'forgets' the res_id key, so it will be compelled to actually reread a
new settings form record.
2018-04-24 14:42:34 +02:00
Géry Debongnie 3b3f6cc069 [FIX] mail: update test broken by forward port
The _mockMessageFetch method was changed in the mockserver in saas11.2.
The forward port then obviously broke this test, which depended on the
fact that it returns an empty list.
2018-04-24 14:37:14 +02:00
Christophe Monniez ddf601d443 [FIX] packaging: remove libsass dependency in debian package
A dependency to libsass was added in debian package and in the docker
file. The Odoo nightly builds of the deb package was failing because
this lib is named libsass0 in Debian.

Finally, this dependency is not required because python3-libsass already depends on libsass0.
2018-04-24 13:51:13 +02:00
Darshil Trivedi 04e7a2c7f1 [IMP] web: Kanban: change the color of folded columns
Task 58934
2018-04-24 12:16:00 +02:00
qdp-odoo b9ce1affbf [REV] account: reverts commit 0351b492d5.
Unexpected runbot failure detected. Pach reverted for further investigation. Sorry for the disturbance
2018-04-24 12:10:06 +02:00
qdp-odoo 0351b492d5 [FIX] account: fix unreconciliation implying several exchange rate entries
Use case fixed: manual reconciliation through the account.move.line list of items with several currencies, that will create a full reconcilation with several exchange rate entries to balance the amounts in all foreign currencies. Unreconciling these lines was wrongly creating an account.move with a lot of lines with debit = credit = amount_currency = 0.
2018-04-24 10:46:51 +02:00
Géry Debongnie fcc6e9e3be [FIX] web: correct docstring (was showing incorrect type)
This is my mistake, I added the docstring without properly checking the
type.
2018-04-24 10:22:24 +02:00
Mohammed Shekha c1bf1c6a54 [FIX] web: preserve new column order after creation
When a user creates a new column in a kanban view, leave the action and
comes back, the order is not preserved.  With this commit, we force a
call to resequence to ensure that the order does not change.
2018-04-24 10:18:33 +02:00
qdp-odoo 61fe7a7820 [FIX] account: allow switching from CoA if empty moves exists
This is needed in case we open the Chart of Account step from the configuration bar, as it will silently create the opening journal entry
2018-04-24 09:21:01 +02:00
Arnold Moyaux 3412dae02d [FIX] mrp: dynamic bom report correct bom cost
The variable used in order to sum the total cost
was the same that the one used in order to save
sub bom cost. The total cost was override at each
loop and the total cost was equals to twice the last
bom line cost.
2018-04-24 09:15:40 +02:00
Christophe Simonis 8344b61b49 [REL] back to v12 alpha
Seems to be a recurring error...
2018-04-23 20:19:39 +02:00
Christophe Simonis 713d13986b [FIX] hr_holidays: correct xml declaration
Conflict resolution error of last forward-port
2018-04-23 19:55:08 +02:00
Christophe Simonis 1f22b81203 [MERGE] forward port branch saas-11.2 up to 7113b70762 2018-04-23 19:36:25 +02:00
Christophe Simonis 7113b70762 [FIX] test_performance: adapt new test to new api 2018-04-23 19:13:23 +02:00
Christophe Simonis e8bf128318 [MERGE] forward port branch 11.0 up to 3ab25b60bc 2018-04-23 18:15:25 +02:00