Commit Graph
117156 Commits
Author SHA1 Message Date
Gert Pellin 1b5f2ac420 [FIX] hw_scale: read values from Adam scale
with migration from python2 to python3 not all regexes where converted
to byte-array.

backport of b4bcf86f8e to 11.0

closes odoo/odoo#27252
2018-09-28 13:21:56 +00:00
Nicolas LempereurandWolfgang Taferner 46f2e1918f [FIX] base: access_token error handling correctly
When an attachment is requested with an access_token, a server error
would occur in some situation.

With this changeset when an access token is specified:

- returns a 404 error if the attachment does not exist
- returns a 403 error if the attachment has no access_token

Without this change, the added test would fail with:

```
 status = test_access(access_token='Secret')
 self.assertEqual(status, 403,
     "no access if access token for attachment without access token")
 | if not consteq(obj.access_token, access_token):
 | TypeError: unsupported operand types(s) or combination of types: 'bool' and 'str'

 status = test_access(access_token='Secret')
 self.assertEqual(status, 404,
     "no access with access token for deleted attachment")
 | if not consteq(obj.access_token, access_token):
 | odoo.exceptions.MissingError: ('Record does not exist or has been deleted.', None)
```

close #26647
opw-1884419
closes #27275

Co-authored-by: Wolfgang Taferner <wtaferner@users.noreply.github.com>
2018-09-28 10:42:51 +00:00
len-odoo 2a697f1c5b [FIX] document: update environment before attachments update
Fine-tuning of commit:
b3a3ad8099
ac1e187eea

The environment should be updated before the call to _updateAttachments,
as it depends on the env active_id.

opw 1888651

closes odoo/odoo#27277
2018-09-27 10:11:12 +00:00
Xavier Morel 8eb8495710 [FIX] doc: backport of ac37ca39e
github_link compatibility with Sphinx 1.8

Backport to 11.0
2018-09-28 12:23:41 +02:00
Martin Trigaux b18a4cba0e [CLA] Inspur signs Odoo CCLA
Done at opw-1889259
2018-09-28 11:55:10 +02:00
Pedro M. Baeza d61a248523 [FIX] l10n_es: Correct prefix_code for group 6
closes odoo/odoo#27228
2018-09-25 14:05:48 +00:00
Nicolas Martinelli d3ee7a7a15 [FIX] sale_mrp, sale_stock: procurement qty of kits
- Create a BOM kit for product F with:
  2 Unit(s) of A
  1 Unit(s) of B
- Create a SO for 1 Unit(s) of F, confirm
  => a picking with 2 Unit(s) of A and 1 Unit(s) of B is created
- Modify the Ordered Qty to 2 Unit(s)

The picking is not updated.

This is because `_get_qty_procurement` wrongly computed the product
quantity based on the moves' quantities. This is not correct since the
moves are for products A and B, not product F.

At this point, it is not possible to make sure of the real procurement
quantity. therefore, we use a very simple approach: we compare the sold
quantity before and after modification, and return the difference.

opw-1881227

closes odoo/odoo#27064
2018-09-19 09:27:17 +00:00
Nicolas Martinelli 8a88bbeb8b [FIX] website_forum: translate the welcome message
opw-1884718

closes odoo/odoo#27273
2018-09-27 09:04:53 +00:00
qsm-odoo 66d3783428 [FIX] website: add correct ID on demo pages container
closes odoo/odoo#27244
2018-09-26 16:13:49 +00:00
len-odoo fd122aec52 [FIX] website: fix image carousel
We fix a number of problems:
    - grayscale filter not being applied except on desktop Firefox
    - incorrect vertical-align on iOS
    - image sliders being displayed below the margin on iOS
    - carousel indicators flickering at initial load
    - very short indicator panel, almost unusable on mobile
    - misaligned indicators because of first margin
There are two modes on which these fixes apply:
    - image gallery in slideshow
    - slideshow in modal
       (e.g. obtained by clicking on the gallery set on masonry mode)
Note that due to a refactoring, the gallerySlider was not loaded in the modal,
completely breaking the indicators.

Coauthored by @nle-odoo

opw 1874274

closes odoo/odoo#27226
2018-09-26 14:14:14 +00:00
len-odoo 09340bb7f0 [FIX] mail: set the thread_id when creating a new thread
After a refactoring for v11, the id of a newly created thread is not returned
anymore.
Therefore server actions weren't being executed on newly created records.

opw 1886383

closes odoo/odoo#27238
2018-09-26 08:36:14 +00:00
Rémi Rahir 2bf1af77fb [FIX] iap: fixing get() for non-amin users
closes odoo/odoo#27219
2018-09-25 16:11:26 +00:00
Christophe Simonis 6ce408c824 [MERGE] forward port branch saas-15 up to a0d832efdc 2018-09-26 12:41:31 +02:00
Toufik Benjaa f7d7eb06ab [FIX] account: avoid to rewrite product image when refunding invoice
- When refunding an invoice the field product_image is modified and
  tries to write on the product image field for no reason.
2018-09-26 12:15:09 +02:00
Graeme Gellatly 9e9d8e3632 [FIX] purchase: add state field in form view
The inline tree view of the purchase order lines has a state field that is used
in attrs.
The popup form does not have the state view.
Even if the state field is not used in the form view, closing the form view
produces an error as the field state is not found.

This patch is a workaround to avoid the error.

The real issue should be fixed in the future but is more complex.

closes odoo/odoo#27208
2018-09-25 14:52:20 +00:00
len-odoo 31d2b49a78 [FIX] stock_account: updating price with negative quantity on hand divide by 0
In the case where the user forces a sale with a negative product quantity on
hand, then the average price update might divide by zero.
We guard against this case.

opw 1886967

closes odoo/odoo#27232
2018-09-25 15:10:44 +00:00
Romain Derie 9ef7763ecd [FIX] website: create ir.ui.view / website.page in the same record
Somehow, having theses 2 new `website.page` records created separately from
their `ir.ui.view` would throw an error in dev-xml when installing website
module.
A task has been created in website team to track the origin of this bug.

In the meantime, this commit will avoid the traceback by creating the view
inside the page record. As the page's view is not intented to be inherited, it
is the best way to write it anyway.

Step to reproduce:
  - Start odoo in dev xml
  - Install website app

Related to #27199

closes odoo/odoo#27210
2018-09-25 17:22:10 +00:00
Nicolas Martinelli d5c16cdadf [FIX] project: copy project
- Create a project
- Create some tasks with followers
- Create an outgoing mail server with active = False
- Copy that project

When copied, the project tries to send emails to followers using the
inactive mail server. This leads to a traceback.

The addition of the context key dates back to 2009 with 853789d0aa.
The purpose was to copy all tasks, including the archived ones.

We keep this behavior, but without propagating the `active_test` during
the copy of the tasks.

opw-1887354

closes odoo/odoo#27192
2018-09-24 13:22:42 +00:00
Goffin Simon 66c125ae96 [FIX] stock: Picking validation
Steps to reproduce the bug:

- Create a picking
- Create a line with product "A"
- Validate Picking
- Duplicate Picking
- Add a new line for product "A"
- Validate Picking

Bug:

A missing error was raised.

PS: The function _action_done on model 'stock.move' calls the function _action_confirm
where some stock.move records could be unlinked by function _merge_moves
But the recordset was not updated afetwards.

opw:1885053

closes odoo/odoo#27209
2018-09-25 08:04:07 +00:00
Goffin Simon c72352d667 [FIX] stock: Not possible to cancel a pick
- Set the Outgoing shipping of your warehouse to pick + pack + ship
- Create a SO with a stockable product and validate it
- Set the qty done to 1 in the ship and validate it
- Cancel the pack

Bug:

It was impossible to cancel the pick.

opw:1887098

closes odoo/odoo#27193
2018-09-24 12:50:59 +00:00
Christophe Simonis 48aac01c13 [MERGE] forward port branch saas-14 up to 55ab1ac691 2018-09-11 18:54:08 +02:00
Christophe Simonis 55ab1ac691 [MERGE] forward port branch 10.0 up to cd66b0984e 2018-09-11 17:44:14 +02:00
Christophe Simonis cd66b0984e [FIX] base: only sync partners when type change 2018-09-11 17:08:14 +02:00
Christophe Simonis 63afaf438b [MERGE] forward port branch 9.0 up to 415aa05806 2018-09-11 17:07:35 +02:00
Nicolas Lempereur dc9b3df431 [FIX] calendar: keep recurring after edited one
Since 76b7242 if we have a recurring event with 3 occurences:

 [4th 4:00-4th 5:00] [14th 4:00-14th 5:00] [24th 4:00-24th 4:00]

And we detach the first one to modify it, then when getting the
info of reccurring events not detached the system get:

- starts: [14th 4:00] [24th 4:00]
- stops: [4th 5:00] [14th 5:00] [24th 5:00]

And wrongly apply the current filtering over:

 [14th 4:00-4th 5:00] [24th 4:00-14th 5:00]

So the issue hides recurrences of event wrongly if:

- they have not been detached
- they don't have a duration of 0
- one or several previous events have been detached
- the stop date of the nth previous event occurrence (nth equaling
  number of detached previous events) is not in the current filtering.

With this change, the stops are also filtered based on start of
occurrence + duration.

Without the change, the added test fails with:

 False != '155-20120301120100' : Last event should be found searching it by date range

note: for 10.0 up to not including 11.0 which is solved with #26901

opw-1866151
closes #26887
2018-09-11 16:29:05 +02:00
Laurent Smet 415aa05806 [IMP] account: add error when setting a foreign currency on account
If currency set on account, all journal items part of this account must have either the same
currency or no currency.
2018-09-11 16:04:52 +02:00
Christophe Simonis 7563abbde8 [MERGE] forward port branch saas-14 up to 1b5933cc3d 2018-09-10 17:24:13 +02:00
Christophe Simonis 1b5933cc3d [MERGE] forward port branch 10.0 up to 0776306813 2018-09-10 17:23:50 +02:00
Nicolas Martinelli 0776306813 [FIX] membership: recompute state
Commit https://github.com/odoo/odoo/commit/2b587d34ff30147c03baf16e998effe46ce5d9cf#diff-2d656902930900b836412f086c924643R164
incorrectly removed the content of the cron.

Indeed, `membership_state` is a computed field which depends on time
(which is usually a bad idea). Therefore, we must force its
recomputation.

opw-1878878
2018-09-10 15:03:35 +02:00
Odoo Translation Bot 988cadaf5d [I18N] Update translation terms from Transifex 2018-09-09 00:29:00 +02:00
Iván Todorovich 8781286f1c [FIX] account: multi-company bank statement reconciliation
In a multicompany environment, if the user is not logged-in in the same company as the statement's company (even though he might have access to it), the reconcile interface was filtering on the user's company instead of the bank statement lines's company.

Was PR #26782
2018-09-07 15:24:33 +02:00
Iván Todorovich 6d36343d5d [CLA] Signature for ivantodorovich 2018-09-07 15:24:10 +02:00
Christophe Simonis 5a5d6d1e8e [MERGE] forward port branch saas-14 up to c7de55dc3c 2018-09-06 15:30:59 +02:00
Christophe Simonis c7de55dc3c [MERGE] forward port branch 10.0 up to 72f76caa39 2018-09-06 15:29:08 +02:00
Nicolas Lempereur 72f76caa39 [FIX] web: relativedelta>11months work as expected
Since march 2015, using in a domain "relativedelta(months=X)" with
X being bigger than 11 or lower than -11 would result in an error.

This is because in the refactoring adding modules (e8a00bc50d) the two
functions divmod and utils.divmod with different implementation in
pyeval.js were replaced by one function divmod in web.utils module.

But there was still an usage of the removed implementation.

opw-1880766
closes #26816
2018-09-06 13:14:42 +02:00
Christophe Simonis e1e27aa009 [MERGE] forward port branch saas-14 up to 6773d3644e 2018-09-05 17:27:46 +02:00
Christophe Simonis 6773d3644e [MERGE] forward port branch 10.0 up to 1d0940d96f 2018-09-05 17:27:13 +02:00
Goffin Simon 568445a327 [FIX] pos_sale: group_by for POS in dashboard
Steps to reproduce the bug:

-Go to Sales > Dashboard > Point of Sale > Settings
-Set nothing as group_by value
-Go back to Dashboard

Bug:

A traceback was raised.

opw:1881444
2018-09-05 13:40:06 +02:00
Nicolas Lempereur 1d0940d96f [FIX] base: allow get_template serialization retry
When two transactions conflicts (eg. deleting same data, see [1]) Odoo
will retry the whole transaction several times hoping for the best.

But when rendering template, the error handling would prevent this
feature. For example a recurring issue was:

- loading quickly two times the /web route
- for each recompute the assets

=> this could lead to 2 concurrents transactions that would delete
previous same attachment (ie. DELETE FROM ir_attachment where id=3).

With this changeset, when getting a template fails because of a
transaction rollback, we let the issue bubble up so our retry system is
used.

So instead of a "500 Internal Server Error" page and in log:

  bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
  ERROR: could not serialize access due to concurrent update
  "GET /web HTTP/1.1" 200 -
  "GET /web HTTP/1.1" 500 -
  ... big traceback ...
  load could not load template

we would get the requested page without error and:

  bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
  ERROR: could not serialize access due to concurrent update
  "GET /web HTTP/1.1" 200 -
  SERIALIZATION_FAILURE, retry 1/5 in 0.8920 sec..
  "GET /web HTTP/1.1" 200 -

As a side node, the issue was exacerbated in some instances:

- when running a database on another server: assets are recomputed
- when a module was installed/uninstalled: assets may are recomputed
- when updating the source code: assets may be recomputed
- when starting server: requests could be stacked waiting for readiness
- when using google chrome: the "Use a prediction service to load pages
  more quickly" option may load a page two times. for example:
    -> an URL is entered in address bar
    -> a prediction request to it is started URL
    -> go to this page (Enter) when that request is not already resolved
    -> the prediction request is cancelled and a new request is started

[1] https://www.postgresql.org/docs/9.6/static/transaction-iso.html#XACT-REPEATABLE-READ

note: 10.0 backport of 11.0 #26778

opw-1849167
closes #26785
2018-09-05 10:20:50 +02:00
Nicolas Martinelli e673484b35 [FIX] web_editor: image name
Add the image name in the website for SEO purpose. This is a backport
of:
88a5d9a000
886c07dabb
152e3f8686

opw-1880472
2018-09-05 09:42:10 +02:00
Christophe Simonis 653bbbc733 [MERGE] forward port branch saas-14 up to 14f8ef59b8 2018-09-04 16:48:31 +02:00
Christophe Monniez 229c119999 [FIX] hr_recruitment: limit new hired filter to group
In Employees views, selecting New Hired filters leads to an access error
with a simple user.

With this commit, this filter is limited to the corresponding users
group.

Backport of 804b9b7c5e
2018-09-04 16:40:21 +02:00
Christophe Simonis 14f8ef59b8 [MERGE] forward port branch 10.0 up to 0f0e43ae55 2018-09-04 16:11:09 +02:00
Christophe Simonis 0f0e43ae55 [MERGE] forward port branch 9.0 up to 61b771256c 2018-09-04 15:23:54 +02:00
Lucas Perais (lpe) 06cd145a79 [FIX] sale_timesheet: fixup timesheet cost
fixup e65c8826ef
fixup da2140b

closes #26746
2018-09-04 09:09:30 +02:00
Nicolas Lempereur 61b771256c [FIX] web_editor: back to first -> history stay ok
If we do:

- one change that will be saved in history
- go back to the document before any change
- do other change

we can easily get in a state were the history is no longer recorded.

The history is kept like this:

- pos: our position in the history
- aUndo: the snapshots of history
- toSnap: the last history snapshop that is to be saved

so for example if we start without change (at originalState):

  {pos: 0, aUndo=[], toSnap=null}

Then we do two changes (change1, change2):

  {pos: 2, aUndo=[originalState, change1], toSnap=change2}

If we make an undo, we will get to:

  {pos: 1, aUndo=[originalState,change1,change2], toSnap=null)

If we make another change (change3):

  {pos: 2, aUndo=[originalState, change1], toSnap=change3}

So the history after the position is removed.

But when we get back to the original, the state would forever be:

  {pos: 0, aUndo=[originalState], toSnap=change85}

because when doing a change, the code only removed history from the
max(pos, 1) index.

opw-1870119
closes #26701
2018-09-03 16:30:03 +02:00
Nicolas Lempereur 793988c7ed [FIX] web_editor: normal up/down in content in cell
In the editor in a table cell, when we press UP/DOWN keys:

- we have default editor/browser behavior if there is content before
  (UP) or after (DOWN) the element we are currently on
- else we go to the previous (UP) or next (DOWN) row if available
- else we go to the next content if available
- else we have the default editor/browser behavior

But when checking if there is an element before/after the content, we
did not take into account if there was an ancestor node inside the cell
that had content after, so for example with this structure:

```
<table>
<tr><td>
  <p>hello <b>world</b></p>
  <p>cruel</p>
</td></tr>
<tr><td>
  <p>bingo</p>
</td></tr>
</table>
```

if the current range was on 'world' text node, we would just check if
there is content after this text node, not if there is content after its
`<p/>` ancestor.

Before the fix we would get on the next row, after we would have default
editor/browser behavior: ie. if cruel is on another line, going to this
line.

opw-1870119
closes #26701
2018-09-03 16:30:03 +02:00
Odoo Translation Bot 8846a0c21b [I18N] Update translation terms from Transifex 2018-09-02 00:29:56 +02:00
Odoo Translation Bot b5471da2e0 [I18N] Update translation terms from Transifex 2018-09-01 02:38:40 +02:00
Nicolas LempereurandWolfgang Pichler 79e18ac6af [FIX] base: user fields_get no add group if asked
The override of fields_get adds "virtual" fields corresponding to
groups.

If for example we make "res.users" have inherit "mail.thread", we get
these "virtual" field as if they had "track_visibility", since we do a
"fields_get" with fields having track_visibility expecting to only get
back "track_visibility" ones.

So the system would then fail trying to track visibility on fields like
"in_group_5" and for example a res.users could not be created anymore.

With this fix, we fix the fields_get so it respect the fields we ask of
it.

fixes #22332
opw-1878654
closes #22338
closes #26705

Co-authored-by: Wolfgang Pichler <wpichler@callino.at>
2018-08-31 12:02:21 +02:00