Commit Graph
117156 Commits
Author SHA1 Message Date
Christophe Simonis 5d8076c842 [MERGE] forward port branch 10.0 up to 5e682451cb 2018-07-10 11:30:59 +02:00
Christophe Simonis 5e682451cb [MERGE] forward port branch 9.0 up to 8b25099aea 2018-07-10 11:25:27 +02:00
RomainLibert e08f999468 [FIX] calendar: add onchange on start_date and stop_date
When creating an event using the list view, no value is set in the
fields start and stop.

If selecting all day, we could only change the value of start_date and
stop_date which does not change the value in start or stop.

This makes it impossible to create an event from the list view.

This problem is not present in the calendar view since this view sets a
value in start and stop, and the start and stop are recomputed via the
inverse fields.

Closes #25680
2018-07-10 11:14:16 +02:00
Andreas Perhab 8b25099aea [FIX] auth_oauth: validate db against db_filter 2018-07-09 18:55:11 +02:00
Florent de Labarre 95990a31b4 [FIX] ir.autovacuum: should be executed by the admin
Closes #23453
2018-07-09 18:55:10 +02:00
Martin Trigaux dc0914b8a5 [FIX] web: allow getting session_info as non-authenticated
The call to /web/session/authenticate should return an empty session_info
in case of wrong login/password.
It was producing a traceback (due to self.ensure_one() and search)
Introduced at d1cd293ece and fdb250942

Fixes #24071
2018-07-09 13:35:14 +02:00
Lucas Perais (lpe) 5fc392e34a [FIX] account: revert reconciled payment with exchange difference entry
Company is in USD
Do an invoice in EUR with a specific rate (and post it)
Do a payment on this invoice with another rate (and post it)

revert the payment's move

Before this commit, the move_lines of the original/reverted move pair were not reconciled
to one another
This could cause problems in some reports (aged reports for example)

After this commit, the lines in the original/revert move pair are reconciled
provided that they *can* be reconciled
Which is either belonging to a reconciliable account, or to an account of type liquidity

OPW 1861273
closes #25592
2018-07-09 10:07:36 +02:00
Lucas Perais (lpe) 42e74aae51 [FIX] account: revert reconciled payment with exchange difference entry
This is essentially a backport of 7544c22de9
and
4f40c9da7b

Company is in USD
Do an invoice in EUR with a specific rate (and post it)
Do a payment on this invoice with another rate (and post it)

revert the payment's move

Before this commit, the move_lines of the original/reverted move pair were not reconciled
to one another
This could cause problems in some reports (aged reports for example)

After this commit, the lines in the original/revert move pair are reconciled
provided that they *can* be reconciled
Which is either belonging to a reconciliable account, or to an account of type liquidity

OPW 1861273
closes #25600
2018-07-09 10:05:18 +02:00
Lucas Perais (lpe) 67b5cde62b [FIX] point_of_sale: new session should open with user as cashier
Open a new session with user A, the cashier is A.
Close the session and post the entries.
The responsible for the session is user A and the salesman on the sale order is A.

Then log in to the database with user B.
Open a new session on the same pos.

Before this commit, the cashier on the second session was A

After this commit, the cashier on the second session is B

OPW 1864207
closes #25628
2018-07-09 09:04:20 +02:00
Odoo Translation Bot 33b698254a [I18N] Update translation terms from Transifex 2018-07-08 00:26:19 +02:00
Thibault Delavallée 91486656ab [FIX] mail: log correct user deleting the record
When using sudo, the administrator is logged as deleting the action.
For audit reason, log the correct user.
To avoid access rights errors, only group system can delete the action.
2018-07-07 17:35:42 +02:00
Thibault Delavallée 6033439c67 [IMP] website_mail: allow per-module override of token_field
Instead of forcing a token field through an override, set it at the class level
to be changed in other model inheriting from the MailThread
2018-07-08 09:04:42 +02:00
Simon Lejeune e5984fbfc3 [FIX] base: strengthen ir.attachment access rights
An ir.attachment record can be served as a request's reponse if:
  - a request triggers a 404
  - the ir.attachment record has its url field matching the url of
    the failed and is of binary type

Following rev[1], portal users have the right to create these kind of
records, and it is a security concern.

This patch restrict the ability to create and write on the ir.attachment
records that may be served through the dispatch's exception mechanism to
settings users.

As the asset bundles files are served through the use of these special
ir.attachment, we make sure to retrieve only ir.attachment records
created by the superuser in the `get_attachment` method.

As website administrators often need to play with these special
ir.attachment, we also let to this group the permission to manage them.

[1] 61065b6d04
2018-07-29 14:10:42 +02:00
Nicolas Martinelli 8b8adcb5e6 [FIX] google_calendar: backport 6bbf38e171 to 10.0
Test `e.code` only in case of `HTTPError`. In case of a `UserError`,
`e.code` crashes.

opw-1851319

Fixes #25627
2018-07-06 13:40:56 +02:00
Damien Bouvy b1a373c664 Revert "[FIX] stock: do_new_transfer callable in xml-rpc"
This reverts commit ef444da57a.

Changing a function signature is not supposed to happen in stable;
we have already received 3 opw's about broken customizations or
modules that extend the stock because code such as:
res = self.do_next_transfer()
if not res:
	<bla bla>

stops without any warning.
2018-07-06 08:47:40 +02:00
Christophe Simonis b06c09db60 [MERGE] forward port branch saas-14 up to 92e5da6b8f 2018-07-05 15:35:24 +02:00
Christophe Simonis 92e5da6b8f [MERGE] forward port branch 10.0 up to 26e7d5d8ee 2018-07-05 15:05:21 +02:00
Christophe Simonis 26e7d5d8ee [MERGE] forward port branch 9.0 up to b5c50fa824 2018-07-05 14:19:33 +02:00
Christophe Simonis b5c50fa824 [FIX] core: set up registry before running migration scripts
As `pre-` migration scripts may use the registry, we must ensure that
all fields are set up before execution in order to have a consistent
registry.

This is required when loading a registry which contains modules to
install/upgrade without `-u` flag. In this case, the setup was only done
*after* module loading.
2018-07-05 12:26:28 +02:00
Goffin Simon 30ede6a16a [FIX] pos_sale, sales_team: Timezone problem in dashboard graph
The function _get_graph computing the dashboard graph must take the timezone of the user
into account to compute the right start_date S and the right end_date E.

The query  made on model 'report.pos.order' by read_group in _graph_data must take the
timezone of the user into account to substract the right offset to compute the start_date S
and end_date E in UTC because the result returned by read_group is formated in the timezone
of the user afterwards.

Example:

In function _get_graph:

Start_date in 'Asia/Ulaanbaatar' timezone = 2018-06-05
End_date in 'Asia/Ulaanbaatar' timezone = 2018-07-04

So End_date - Start_date + 1 = 30

In function _graph_data:

Start_date in 'Asia/Ulaanbaatar' timezone = 2018-06-05 00:00:00
End_date in 'Asia/Ulaanbaatar' timezone = 2018-07-04 23:59:59

So in UTC -9 hours:

Start_date in UTC = 2018-06-04 15:00:00
End_date in UTC = 2018-07-04 14:59:59

SELECT min("report_pos_order".id) AS id,
       count("report_pos_order".id) AS "date_count" ,
       sum("report_pos_order"."price_total") AS "price_total" ,
       date_trunc('day', timezone('Asia/Ulaanbaatar',
       timezone('UTC',"report_pos_order"."date"))) as "date:day"
FROM "report_pos_order"
WHERE (((("report_pos_order"."date" >= Start_date)  AND
      ("report_pos_order"."date" <= End_date))  AND
      ("report_pos_order"."config_id" in (1,2,3)))  AND
      ("report_pos_order"."state" in ('paid','done','invoiced')))
GROUP BY date_trunc('day', timezone('Asia/Ulaanbaatar', timezone('UTC',"report_pos_order"."date")))
ORDER BY "date:day"

And the result of this request will be between 2018-06-05 00:00:00 and 2018-07-04 23:59:59 but
before the fix the result was between 2018-06-05 00:09:00 and 2018-07-05 08:59:59 and then
End_date - Start_date + 1 was equal to 31. That's why a "IndexError: list index out of range"
can be raised in _get_graph.

In this way, no mismatch is possible between the datas computed by _graph_data and the dict
"values" allocated by _get_graph.

opw:1862996
2018-07-04 13:21:46 +02:00
Mykhailo Panarin 80b325bbb2 [CLA] create mpanarin
Backport to 9.0 of #23708

Closes #25595
2018-07-04 10:58:44 +02:00
Adrian Torres bca2926b01 [FIX] base: properly unlink child views
Before this commit:

* Install module A
* Edit a view from module A, add a custom field
* Uninstall module A
* Reinstall module A
* Try to access the module A's previously modified view
    -> Can't access the view, or even sometimes the app at all.

Cause:

When uninstalling module A, the custom field added to module A's is
properly unlinked, however the custom/studio view is not unlinked, therefore
the view references a field that no longer exists, when accessing the
view it will obviously crash (sometimes the traceback is not even
displayed to the user!).

Solution:

Emulate an ondelete cascade for child views only when in uninstall mode.
2018-07-03 11:11:25 +02:00
Simon Lejeune d5efba2561 [FIX] report: avoid local file resources
Make sure building reports using local resources are disabled.
This avoids get different report result based on the system if the
given resources are or not present (e.g. custom style)
2018-07-03 10:53:42 +02:00
Odoo Translation Bot 7cf29f04be [I18N] Update translation terms from Transifex 2018-08-01 02:42:16 +02:00
Goffin Simon 44bd29fc84 [FIX] mrp: quantity_done with tracked products
Steps to reproduce the bug:

- Create 3 stockable products P1, P2, P3
- P1 is tracked by serial numbers
- Create a BOM for P3 with one P1 and one P2 as components
- Set the quantity on hand to 5 for P1 and P2
- Create a MO for P3, produce it and mark the MO as done
- On the MO in the sheet "Consumed product", the quantity_done for
P1 and P2 are equal to 1.0
- Change the tracking of P1 to "No tracking"

Bug:

- Check the sheet "Consumed product" on the MO and the quantity_done
was equal to 0.0 instead of 1.0

opw:1856340
2018-07-02 14:38:28 +02:00
MOENS Alexandre 45117f0287 [FIX] Project : Changing data & views loading order
This changes the order in which the data and the views are loaded.

Caused a problem in some fringe cases.
Install then uninstall project, playing around with discuss, when reinstalling project ,
system is trying to notify a partner and the weird order
in which the data and the views are loaded makes it bite the dust

opw:1861157
2018-07-02 13:12:03 +02:00
Odoo Translation Bot 83d2dd5521 [I18N] Update translation terms from Transifex 2018-07-01 02:38:03 +02:00
Odoo Translation Bot cebab1eb7e [I18N] Update translation terms from Transifex 2018-07-01 00:24:24 +02:00
Christophe Simonis ce84bacd72 [FIX] event: remove access right to gone model 2018-06-29 16:33:37 +02:00
Christophe Simonis 6e24b5b5e3 [MERGE] forward port branch saas-14 up to e338542f93 2018-06-29 15:29:48 +02:00
Christophe Simonis e338542f93 [MERGE] forward port branch 10.0 up to 58c70226b7 2018-06-29 14:32:03 +02:00
Christophe Simonis 58c70226b7 [MERGE] forward port branch 9.0 up to 4ca9ee2548 2018-06-29 13:50:31 +02:00
Martin Trigaux 13f02f2c0a Revert "[FIX] mail: Render mail in the template language"
This reverts commit 5a0dcd3c20.

Same as 6ad6df59b5
Was mistakly merged, should not be integrated into stable
2018-06-29 13:02:16 +02:00
Martin Trigaux 6ad6df59b5 Revert "[IMP] mail: Subject and body readonly if mass_x composition_mode"
This reverts commit 2774e3b4a8.

Wrong manipulation of the "merge button"
The fix was already merged at 5a0dcd3c2
2018-06-29 10:39:46 +02:00
Martin Trigaux 4ca9ee2548 [FIX] google_calendar: backport 052bc38805 to 9.0
Backport following opw-1851612

[FIX] google_calendar: do not create an event with an invalid id

The id is useful to update existing events but sometimes we are getting some
ids that are not accepted by Google

Getting an error:
odoo.addons.google_account.models.google_service: Bad google request : {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid resource id value."
   }
  ],
  "code": 400,
  "message": "Invalid resource id value."
 }
}

Looks like existing events can have a _ in their id but new one, no longer.
It seems that these events are created by outlook calendar when synchronized
with Google Calendar.
2018-06-29 10:32:28 +02:00
Carlos Dauden 2774e3b4a8 [IMP] mail: Subject and body readonly if mass_x composition_mode 2018-06-28 21:06:32 +02:00
Nicolas Martinelli 5a0dcd3c20 [FIX] mail: Render mail in the template language
On an optimization done for not rendering each time the template, the possibility
of sending the template in the proper language when multiple recipients was lost.

This is being refactoring in master, but for this version, Odoo won't merge a
change in the behavior, although it's the correct one as in previous versions.

Extracted by pedrobaeza from https://gist.github.com/nim-odoo/8a9749037370343f05c7e6681324f576

(cherry picked from commit 386a936)
2018-06-28 21:06:32 +02:00
Nicolas Martinelli fa1f050218 [FIX] sale_stock: performance
In some undertermined circumstances, a `KeyError` might appear in:
https://github.com/odoo/odoo/blob/f9737d79e77e9abf634c8eaa4b6ea331e2aa814d/odoo/models.py#L4898-L4904

Despite the lack of reproducible use case, it seems that this was
introduced from 59b010ac36. In the meantime, other
optimizations were introduced in the prefetching of related fields, and
it seems that the fix is not necessary anymore.

Running the same script than described in
https://github.com/odoo/odoo/issues/19536#issuecomment-333118947 , we
observe the following performances:

Before the fix:
```
On change with 10 lines (10 new, 0 existing) took 0.306
On change with 20 lines (10 new, 10 existing) took 0.221
On change with 30 lines (10 new, 20 existing) took 0.208
On change with 40 lines (10 new, 30 existing) took 0.271
On change with 50 lines (10 new, 40 existing) took 0.306
On change with 60 lines (10 new, 50 existing) took 0.319
On change with 70 lines (10 new, 60 existing) took 0.354
On change with 80 lines (10 new, 70 existing) took 0.382
On change with 90 lines (10 new, 80 existing) took 0.506
On change with 100 lines (10 new, 90 existing) took 0.503
```

After the fix:
```
On change with 10 lines (10 new, 0 existing) took 0.238
On change with 20 lines (10 new, 10 existing) took 0.259
On change with 30 lines (10 new, 20 existing) took 0.250
On change with 40 lines (10 new, 30 existing) took 0.233
On change with 50 lines (10 new, 40 existing) took 0.287
On change with 60 lines (10 new, 50 existing) took 0.325
On change with 70 lines (10 new, 60 existing) took 0.345
On change with 80 lines (10 new, 70 existing) took 0.451
On change with 90 lines (10 new, 80 existing) took 0.496
On change with 100 lines (10 new, 90 existing) took 0.423
```

The fix doesn't seem to be necessary anymore, so we go back to the
previous implementation of the computed field.

Closes #25448
Fixes #19536
opw-1861468
2018-06-28 13:24:15 +02:00
Toufik Benjaa 29c00a56da [IMP] http: Sessions implicit deactivation
- Store a token inside sessions to allow implicit session deactivation when needed.

backport of @da1f153d61d747d9357694382fe04f96c0ca886a @c8243e71c6da37547a19f61c58f25d5d03e13d38
2018-06-27 16:39:45 +02:00
Nicolas Martinelli 10253a735f [FIX] sale: invoice template
- Activate the Sale option 'Tax-Included Prices'
- Create and print an invoice
  => the total is displayed on each line
- Activate the Sale option 'Sections on Sales Orders'
- Create and print an invoice
  => the total is NOT displayed on each line

The option 'Tax Display' only applies to SO, not to invoices. Moreover,
we make consistent the wording.

opw-1856623
2018-06-27 16:17:27 +02:00
Martin Trigaux c1b6cfaab8 [FIX] google_account: backport of c444b5a293
In this commit, our hero backport c444b5a293 to 9.0

[FIX] google_account: fix google request exception management

Error thrown by google request is an urllib2.HTTPError that can be read
and loaded in JSON. However in some cases the result of the read may
be void or not JSON-ready. This was causing a crash in the error
management and hid the actual issue.

This commit tries to read and JSON-load the error but fall back on
simply displaying the raw error in case of issue when handling it.

opw-1851612
2018-06-27 15:52:03 +02:00
Martin Trigaux bc69d1298b [I18N] export saas-15 source terms
To be able to properly translate them
Linked to translation report at opw-1859044
2018-06-27 12:18:30 +02:00
Martin Trigaux 7a768bba8f [I18N] mass_mailing: remove Croatian translations from German translation
There was some Croatian translations in the German translation by mistake.
Remove them.

opw-1859044
2018-06-27 12:16:51 +02:00
Ruchir Shukla ef444da57a [FIX] stock: do_new_transfer callable in xml-rpc
When returning None, the XML-RPC can trigger an error, making
the api unusable in certain cases.
So, we added return True and if the context is None we
use an empty dict, so if the context is returned in a dict,
it is not returning None either.  Tests were adapted too.

Closes #22264
2018-06-26 15:07:23 +02:00
Adrien Dieudonne 47de788cbb [FIX] web: amount on bank.statement not displayed in mobile
Before this commit, it was not possible to add an amount to a new
bank statement. The input (.o_form_field_monetary) appeared as disabled.

This bug was due to this commit: @a1224f5ca
This rule should be only applied to .o_form_field_radio.

Closes #18887
Task ID: 35832
2018-06-26 13:35:18 +02:00
Lucas Perais (lpe) a2d3663cff [FIX] event, event_sale, website_event: allow portal access to own registrations
OPW 1859364
2018-06-26 13:23:56 +02:00
Lucas Perais (lpe) ea7bddcc3e [FIX] event, event_sale, website_event: allow portal access to own registrations
OPW 1859364
2018-06-26 13:13:15 +02:00
Christophe Simonis bda926034a [MERGE] forward port branch saas-14 up to c9a01ab30a 2018-06-26 13:13:05 +02:00
Christophe Simonis c9a01ab30a [MERGE] forward port branch 10.0 up to 58c92d9374 2018-06-26 12:57:31 +02:00
Christophe Simonis 58c92d9374 [MERGE] forward port branch 9.0 up to 22084bc52e 2018-06-26 12:27:30 +02:00