Commit Graph
116463 Commits
Author SHA1 Message Date
Christophe Matthieu 6a5dc8bcd1 [FIX] mail: remove attachment feature in add followers modal
Before this fix, the attachments are don't save to the record and are
remove with the wizard. We can't add the attachments to mail.message
(like 'mail.compose.message') because it's auto_delete/unlink and the
attachments are removed before the recipient can read it.
2018-07-11 15:38:59 +02:00
Christophe Matthieu 50ab181762 [FIX] mail: add access_token for image from base64 and cid 2018-07-11 15:38:59 +02:00
Christophe Matthieu 3472a34e8a [FIX] mail: write all attachments only once
wrong indent.
2018-07-11 15:38:59 +02:00
Christophe Matthieu 0cf5987610 [FIX] web_editor: display record linked to the record when add followers 2018-07-11 15:38:59 +02:00
Christophe Matthieu f83f532237 [FIX] web_editor: send an image thumbnail for attachment link in mail
Before this fix attachmentThumbnailToLinkImg is not called for
style-inline options. The mail received does not have thumbnail and the
user can't click on the invisible link.

opw-1863659
2018-07-11 15:38:59 +02:00
Martin Trigaux 97dbb8c6af [I18N] l10n_*: correct bad %s
opw-1853119
2018-07-11 09:04:53 +02:00
gmarcon baf6b29d45 [FIX] web: build xls file with maximum size
An MS Excel file can have maximum 32767 characters

Fixes #25653 
Closes #25700 

https://support.office.com/en-us/article/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3
2018-07-10 16:25:04 +02:00
Alexandre Kühn 212ed85ac4 [FIX] mail: upload again a same file on the composer
Before this commit, it was not possible to upload again a file on the
browser from the composer, when it was added then removed from the attachments.

When a file is uploaded on the browser, it writes on a special input
some data to identify this file. In order to detect a new upload,
the code listens on the JQuery event `change` on this input. Since the
value of this input was not cleared after an attachment removal, the
user couldn't reupload the same file, because the value of the input
will be unchanged.

This commit solves this issue by clearing the special input when removing
an attachment, so that adding the same file again will trigger a `change`
on this input.
2018-07-10 15:30:30 +02:00
Goffin Simon 371a92fb30 [FIX] hr_timesheet: Removing task on a timesheet line
Steps to reproduce the bug:

- A product is configured as a service + invoicing policy as "Timesheet on task" + Create a task in an existing project.

- Create a SO with this product and confirm it.

- Go to the task, and create a timesheet on it, the delivered quantity on the SO is correctly updated.

- Now, go to the Timesheets app and remove the task from the analytic line.

Bug:

The Delivered quantity on the Sale Order was not updated.

PS: The case where so_line is in the values is already taken into account by the overwrite of
function write in addons/sale/models/analytic.py

But as task implies so line (as explained in addons/sale_timesheet/models/account.py in function _timesheet_preprocess),
the delivered qty of a so line must be recomputed when its task is modified.

opw:1864313
2018-07-10 13:52:31 +02:00
Martin Trigaux 96f01c08f8 [FIX] service: properly invalidate session of deteled users
If a user A deletes the res.users record of user B while B is connected,
the verification of the session token fails with a comparison of a boolean and
bytes values.
While the check should obviously fail, this patch gracefully inform the user B
its session has expired and redirect him to the login page.

Without the patch, the session is never invalidated in the user browser,
redirecting to a forbidden error page as long as the session has not been manually
cleared from the browser.

Fixes #25530
Closes #25654
Closes #25682
2018-07-10 13:49:41 +02:00
Christophe Simonis e354142ce7 [MERGE] forward port branch saas-15 up to c22e479246 2018-07-10 13:21:06 +02:00
Christophe Simonis c22e479246 [MERGE] forward port branch saas-14 up to 5d8076c842 2018-07-10 12:22:55 +02:00
Lucas Perais (lpe) 7384401e63 [FIX] website_sale_delivery: we shouldn't be able to pay if there is no delivery method
Have some delivery method that do not apply to the country of the customer

Before this commit, the customer could access the Pay now button and confirm the sale

In v10.0 this was impossible as the retrieval of errors in python wiped out the variables that would
make the xml element of the payment not to render
In v11.0 this has changed in a more modular manner

After this commit, we hide the element in html.

OPW 1864744

Two use cases are dealt with:
Should hide payment AND display errors when order contains deliverable product

Should show payment AND not display errors when order contains only services (event tickets)

Linked v10.0 PR #25692
closes #25679
2018-07-10 11:51:00 +02:00
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
Martin Trigaux 24e01664d4 [IMP] doc: add javascript example
Document changes like b87a95b6d6
2018-07-10 10:03:43 +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
Nicolas Lempereur 940246f583 [FIX] web: remove Work+Sans online font import
The Work+Sans font of google fonts was hotlinked and available in
reports since saas-14's 3d04e448.

There does not seem to be a reason to do it and:

- hotlinking may add resources usage / processing time,

- server need outside internet access or the font doesn't load,

- it has been reported to cause the header/footer of some pages to
  disappear, probably because of a problem with loading the content in
  a given delay to render it.

- it was always loaded for report, even if used only once among all the
  reports of Odoo

For these reasons, this commit removes the hotlinking of this font.

The ISR report of l10n_ch that used this font will thus fall back on
'Verdana', 'Geneva' then the default sans-serif font which doesn't
seem to be a drawback over 'Work Sans' font.

If at one time we should reintroduce it, it should be contained in the
given report and possibly have the font locally and not externally.

opw-1861368
closes #25683
2018-07-09 15:56:48 +02:00
Lucas Perais (lpe) c288830409 [FIX] website_gengo: adapt JS to v11 editor
Before this commit, the widgets of website_gengo were not adapted to the new translate and web editor

After this commit, they are adapted

Although, gengo_sandbox of res.config would need to be redefined as related to company_id.gengo_sandbox. It has been done in saas-11.2

OPW 1862013
closes #25647
2018-07-09 15:34:34 +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 d6a71fae93 [I18N] Update translation terms from Transifex 2018-07-08 04:09:36 +02:00
Odoo Translation Bot 33b698254a [I18N] Update translation terms from Transifex 2018-07-08 00:26:19 +02:00
Olivier Dony cf1ec5d316 [FIX] website_blog: fix typo in 83bfdb0d21 2018-07-06 16:55:31 +02:00
len-odoo dc5e0e5833 [FIX] base: allow to give a name attribute to the res.groups copy method
Before, the name given to the copy method was always 'the old name (copy)'
(even bypassing what might have been given to the default values dict).

opw 1862214
2018-07-06 14:47:51 +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
len-odoo a58ffb9e78 [FIX] mail: use ids parameter in the process_mail_queue method
If the parameter ids is given to the process_mail_queue method, it is supposed
to only process the ids it was given, not all mails.
Commit https://github.com/odoo/odoo/commit/4b122ad41d873febe288ab1f8c6cdc078ca2a479
replaced ids by self.ids, and thus default filter was always applied.

fix suggested by @suganthikarunanithi, Sodexis team

opw 1860484
2018-07-06 09:47:44 +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
len-odoo 6a3b2b94d0 [FIX] base: allow to give a name attribute to the res.partner copy method
Before, the name given to the copy method was always 'the old name (copy)'
(even bypassing what might have been given to the default values dict).

opw 1862214
2018-07-06 08:45:40 +02:00
len-odoo c8474c8ab4 [FIX] web: trigger a warning modal when deleting a line while editing in a one2many
In a one2many, if the user clicked the trash button while editing another line,
the row was not unselected.
Thus the modal was not triggered, which entailed that the currently edited line
was always saved.
In particular, it allowed to give empty values to required fields.

opw 1834346
2018-07-06 07:52:52 +02:00
Olivier Dony 896e3f4c1e [DOC] deploy: add brute-force detection advice, warn about DB manager 2018-07-05 17:21:40 +02:00
Christophe Simonis 84210074e5 [MERGE] forward port branch saas-15 up to b06c09db60 2018-07-05 16:23:47 +02:00
Christophe Simonis b06c09db60 [MERGE] forward port branch saas-14 up to 92e5da6b8f 2018-07-05 15:35:24 +02:00
Martin Trigaux a978a3647a [FIX] mail: multi-company access to TZ
- Create 2 Companies A & B
- Set User B in Company B
- Record some `mail.activity` for User B on a lead belonging to Company
  B.
- With a manager user in Company A, go to Kanban view of leads and
  remove filters => all leads, including leads in Company B, are
  displayed

An access error occurs.

`read_progress_bar` method, tries to access the field `activity_state`
which is: `states = record.activity_ids.mapped('state')`. The state of
a `mail.activity` is using the tz of the partner. To read the
`activity_state` of a lead, one needs to access
`record.activity_ids.user_id.partner_id.tz`
=> multi-company security rules raised

opw: 1850984, 1859470
2018-07-05 15:29:34 +02:00
Christophe Simonis 92e5da6b8f [MERGE] forward port branch 10.0 up to 26e7d5d8ee 2018-07-05 15:05:21 +02:00
len-odoo 7764db7a34 [FIX] web: handle onchange on a on2many with an embedded one2many on multiple pages
Suppose there is a one2many field embedded in a one2many,
(say we are viewing record A with one2many field B itself with a one2many C).
Furthermore, there is a second page of the one2many field B.
If an onchange is applied on B, then the server replies with a 1 command for all
B records attached to the currently viewed object A.
This includes a list of commands [[5], [4, C_id]*] for each B record,
in particular B records that are on the second page.
Since they are on the second page, they might not have been fetched by the
frontend; in that case the corresponding C_ids are thus unknown.
As a consequence, on save the frontend sends a command 0 to create the records
for all unknown C_ids.
Since it doesn't have any value to give to the 0 command, the row creation
usually crash in the backend.

Another wrong behaviour is fixed at the same time: if the server sends an update
on the list of C ids with 4 commands.
In that case, if the record has not been prefetched, we have no way to know
if the list changed or not.

To solve this, when we receive the 4 commands by the server, we send back 4
commands.

coauthored by @aab-odoo

opw 1835936
2018-07-05 15:03:37 +02:00
Christophe Simonis 26e7d5d8ee [MERGE] forward port branch 9.0 up to b5c50fa824 2018-07-05 14:19:33 +02:00
Alexandre Kühn 7af09db878 [FIX] web: no concurrent reload on basic model
Before this commit, there was a traceback in the following scenario:

Let's have a kanban view with groupby and a domain.
If we clear the domain then clear the groupby, there could be a crash.

This crash occurs because when we clear the groupby, it performs a `reload`,
and assumes that the datapoint contains grouped data. However, if this
computation takes some time, it is possible to overwrite the datapoint so that
there is no longer grouped data.

This commit fixes the issue by enforcing at most 1 execution of the method
`reload` active at any time. Consequently, successive reloads operations are
now much slower.

Note that it uses the single non-reentrant mutex on the basic_model to enforce
this rule, which means:

  - No more concurrent `reload` and `save`.
  - If an execution having the mutex in `reload` come accross the same mutex,
    it is blocked forever. This is hopefully not the case at the moment,
    however a reentrant mutex should be considered in the future.
2018-07-05 14:04:33 +02:00
Nicolas Lempereur b27d009ab4 [FIX] barcodes: documentation in description
The barcodes modules had documentation only available on apps.odoo.com,
following a recent change, odoo modules are not displayed on
apps.odoo.com anymore.

Thus this commit merges the documentation onto the module description so
it is available on the module page.

opw-1846035
closes #25621
2018-07-05 13:00:28 +02:00
Romain Derie 21f1a593a1 [FIX] website: new content links not triggered
Clicking outside the new content options should close the overlay.
Every options are triggering a JS event (mostly opening a modal) that works
fine.

But the 'New Job offer' options is simply a href link which is not going
through anymore since there was a call to `preventDefault`.

opw-1860196
2018-07-05 12:42:01 +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
Shubham Johar 26d384ef61 [FIX] website: leave 'create screen' when click outside
The purpose of this commit is to hide the Create menu when the user click on
any area other than the link icons.

Note: It was already the case in V10.0 since the options were inside a modal.
      Natively bootstrap would close the modal when clicking outside of it.
      We lost that behavior while refactoring in V11.0 with 297297696 that
      replaced the modal by a pseudo-dropdown

opw-1860196
Closes #25389
2018-07-04 16:04:00 +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
Goffin Simon ab5fcb2965 [FIX]purchase: A duplicated shipment is not associated with the original PO
When duplicating a shipment, the shipment was not linked to the original PO.

opw:1854387
2018-07-04 11:42:41 +02:00
Mykhailo Panarin 80b325bbb2 [CLA] create mpanarin
Backport to 9.0 of #23708

Closes #25595
2018-07-04 10:58:44 +02:00
Maulik Raval 578edc0458 [CLA] signature for maulik-raval
Closes #25489
2018-07-04 10:08:44 +02:00