Commit Graph
126133 Commits
Author SHA1 Message Date
Christophe Simonis 7b092761c6 [MERGE] forward port branch 11.0 up to 423d06ff978 2018-11-28 17:55:37 +01:00
Christophe Simonis efe7ca16b7 [MERGE] forward port branch 11.0 up to bb6f6c57f9 2018-11-28 17:44:46 +01:00
len-odoo 694af9a19a [FIX] website_form_editor: adapt datepicker snippets to BootStrap4
Fairly explicit.
See commits 25e82a5c68, 46f48c35a0.

opw 1911788

closes odoo/enterprise#3170
2018-11-28 15:36:00 +00:00
Christophe Simonis bb6f6c57f9 [MERGE] forward port branch saas-15 up to 925210714f 2018-11-28 16:13:24 +01:00
Goffin Simon c2e3d3a779 [FIX] stock_picking_batch: Barcode not displayed in report_picking_batch
The barcode was never displayed in report_picking_batch.

opw:1910478

closes odoo/odoo#29103
2018-11-28 14:52:51 +00:00
Nicolas Martinelli 38f00af5d1 [FIX] event: badge layout
When printing the badge of an attendee, several information are not
shown. This is due to the BS4 migration.

Closes #29195

opw-1912074

closes odoo/odoo#29221
2018-12-03 14:32:56 +00:00
Alexandre Kühn 7cdfe99d44 [FIX] mail: do not auto-focus new open chat window
Revision on https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c

Before this commit, when receiving a new message from a new DM
or livechat, the newly opened chat window was automatically
focused and marking messages as read.

Chat windows that are automatically opened without any user
interaction, such as when receiving a new message from a chat,
should not be focused. Those chat windows are "passive", and
the user must click on them in order to have focus and mark
messages as read (the chat window is no longer passive as a
result). The bug has been introduced by the refactoring from
the commit above.

In fact, there was a very short period of time during which the
chat window was passive. However, due to the way chat window
server-side state synchronization works, the chat window was
automatically closed then re-opened. This resulted in some visual
flickering of the chat window ('open' > 'close' > 'open'), and
the conversation was automatically marked as read. This was a
consequence of the actions 'open' > 'close' > 'open' that removed
the passive property of the chat window.

Chat window server-side synchronization relies on a notification
that tells the state of the conversation. Due to bad design, this
notification had exactly the same format as the one for notifying
all browser tabs of a newly joined conversation.

This commit fixes the issue by distinguishing "channel join"
and "chat window state" notification, so that the former is not
treated as a chat window notification. It fixes the problem
because it was precisely the "channel join" notification that caused
the chat window to close and loose its passive property.

Task-ID 1914735
opw-1914371

closes odoo/odoo#29223
2018-12-03 16:17:59 +00:00
Nicolas Lempereur 3fd009a7a7 [FIX] l10n_ch: style imp and add 0 on account isr
It has been reported that it would be nice to have font OCRB all over
the report and number in boxes (for the ISR version of amount with
boxes).

This commit do some tweaks and adapt positions and font-size to do this.

Also a shortcut for an account number can be used in switzerland
(see d9448d7389), but in the ISR scanline the account number must be
fully printed so this commit do the zero padding (on the middle part of
the account number).

opw-1903608
closes #29000
2018-11-30 15:38:44 +00:00
Xavier Morel bedd4be0ed [FIX] doc: line blocks to literal
closes odoo/odoo#29219
2018-12-03 10:59:34 +00:00
Sébastien Theys 1d45184630 [FIX] website,website_hr_recruitment: fix crawler (job url)
Commit 2ab6ce80d6 introduced an issue where the
URL for new job offer was added in the DOM even when website_hr_recruitment is
not installed.

This is a problem because the crawler tries to navigate that URL and returns an
error because the route does not exist without website_hr_recruitment.

closes odoo/odoo#29217
2018-12-03 10:35:06 +00:00
len-odoo 8f3ac2530f [FIX] base, partner_autocomplete: remove vat from the partner selection field
Commit a6e1eb9f0a
introduced the show_vat context key, that displays the Tax ID of a customer
after its name when present, similarly to show_address.

However it appears on the field when being edited, then disappears at save,
which is confusing.
Other unclean things tended to happen: you would have "name - taxid" on customer
field, but "name" on invoice address and delivery address.
Furthermore a client could edit the name manually to erase the Tax ID, and thus
recreate a new record for the same customer.

We introduce a method to clean the name from the Tax ID, and use it so that it
is directly the client's name that is selected at edit.

Note that we also replace the standard dash in the 'name - taxid'
by a figuredash (‒, U+2012) so as to avoid potential egregious splits
because of legitimate customer names.

Similar to commit: 3cbfc40303
(same thing for show_address)

opw 1911954

closes odoo/odoo#29189
2018-12-03 09:23:33 +00:00
Lucas Perais (lpe) 9d1aa41bfb [FIX] account: randomize invoice reference if no match
Take explanation of
commit d94e8a0
but this time, have a suffix with a flavor of %(year)s

Before this commit, validating the invoice crashes

After this commit it doesn't.

OPW 1912954

closes odoo/odoo#29160
2018-12-03 08:45:05 +00:00
Lucas Perais (lpe) 31d1a62bb3 [FIX] point_of_sale: typo in event handler
OPW 1914014

closes odoo/odoo#29194
2018-11-30 16:26:15 +00:00
Olivier Dony 52a6b1e3af [DOC] mixins: remove message_subscribe_users()
It was dropped from 12.0 some time ago by b6d2351df4 and #23377
2018-12-03 02:22:57 +01:00
Odoo Translation Bot 1208ac6ce3 [I18N] Update translation terms from Transifex 2018-12-02 01:25:05 +01:00
Toufik Ben Jaa f289c9ceef [FIX] payment: set correct payment communication
- When a payment is done through a `payment.transaction` the
  communication should be the transaction's reference instead of its
  invoices reference.

closes odoo/odoo#29187
2018-11-30 12:53:37 +00:00
Raphael Collet 6a71a68046 [FIX] models: onchange sends all fields upon change in x2many
On a record with a large x2many, the web client does not load all the data of
the lines (because of paging).  If a line is modified by an onchange, at some
point the client will determine whether lines are valid (all required fields
are provided).  It is possible that the client cannot evaluate the validity of
the modified line because of missing fields.  In order to avoid this situaion,
the server sends all fields on modified lines.

closes odoo/odoo#29177
2018-11-30 09:57:11 +00:00
William Henrotin a226723e52 [FIX] mrp: avoid accessing empty data
Once we log an exception via next activity in a production, we search moves that have been updated uphill to write the useful information about the change. The issue is by default, the key 'move_orig_id' is searched while some moves could be linked with 'created_purchase_line_id' key.

This commit avoid mapping 'move_orig_id' on empty recordset and so avoid a traceback.

opw:1911399

closes odoo/odoo#29087
2018-11-30 08:47:34 +00:00
Géry Debongnie 25d63eee7c [FIX] web: prevent crash in some cases (o2m)
Recent works in the orm (see [1] for example) changed the behaviour of
the server in the case of onchanges: it tries to optimize Odoo by
sending a minimal diff to the web client in onchanges.

Concretely, this means that the web client receives commands 4 (link to)
instead of command 1 (update + record data). It also sends a minimal
diff in that case. This is a big issue for the web client, because it relied
on the knowledge of the data from the command 1 to be able to evaluate some
modifiers.

The good news is that we can mitigate the issue in one case: we do not
actually need to evaluate the modifiers in the case of a command 4
(comming from the server), because we can assume that the record is
valid. So, we simply bypass the check in that case.

Note that this should fix most of the problem, but a deeper problem
still remains: a crash can still happen when an onchange modifies a
record in a one2many (but in a different page), and we also have a
modifier which needs to be evaluated.

opw: #1904514

[1] https://github.com/odoo/odoo/pull/29086

closes odoo/odoo#29172
2018-11-30 08:56:29 +00:00
goliveirab fd9b2c9f36 [FIX] account: Bad query
Fix Error:

`ERROR: syntax error at or near ")"
LINE 7: ...        WHERE full_reconcile_id IS NULL and account_id IN ()`

This can occurs when:

- using write to some account like:

`some_account.write({'reconcile': True})`

closes odoo/odoo#29164
2018-11-29 21:23:47 +00:00
Christophe Simonis 82a1e1dcc3 [FIX] hr_expense: adapt test to new demo data 2018-11-29 19:18:56 +01:00
Christophe Simonis f5c3dafb04 [MERGE] forward port branch saas-11.3 up to c0eef42711 2018-11-29 18:38:55 +01:00
Denis Ledoux 5644ab53ab [FIX] sale: improve team pipeline dashboard quotation counts performance
Doing the `read_group` on `sale.order` rather than
`sale.report` to get the quotations amount and count
significantly improve the performance (5x faster on big databases).

This is because `sale.report` is a view,
with a bunch of fields taking time to compute / fetch.

Besides, the algorithm to get the number of quotations
was an heuristic based on the "group by name" on the `sale.report`,
which was not as precise,
as multiple quotations could potentially have the same name,
and slowed down the query,
because it returned one line per quotation,
versus one line per team with this revision.

closes odoo/odoo#29139
2018-11-29 11:46:22 +00:00
Denis Ledoux 9fbac5fcbb [IMP] crm: improve team pipeline dashboard leads/opps counts performance
The team pipeline dashboard fields
`unassigned_leads_count`, `opportunities_count`, `opportunities_amount`

do a big search on leads, filtered
by type (lead/opp), team, and unassigned user_id (salesman)

Adding an index on user_id, team_id, type significantly
improves the filtering, and therefore the dashboard rendering,
especially when displaying a few teams only
e.g; the teams you are part or responsible of.

The index on `user_id` is removed,
as it become a duplicate as `user_id` is the first column
of this new index.
2018-11-29 11:46:22 +00:00
Nicolas Lempereur 8e7c255237 [FIX] *: fix % in translation not on transifex +da
Fix issue of %s or %(name)s present in source but not in translation
in language not available on transifex.com/odoo/

Also correct a account danish (da) translation that was reported to be
an issue.

closes #29100
2018-11-29 12:52:45 +00:00
Nicolas Lempereur cad04fa0ea [FIX] mail: have signature in chatter by default
The signature is shown by default when sending a mail and in particular
case it is not shown.

In c8d283a592 there was a small regression that in some instance the
signature that was shown before is not shown anymore. This is because
the default in those instance is to not show signature.

eg. a message sent in a chatter would not have signature in sent emails

With this commit, the previous behavior is reintroduced.

opw-1903001
opw-1896262
closes #29088
2018-11-29 13:48:51 +00:00
jem-odoo 798b77bbd3 [FIX] sale_timesheet: missing onchange
The onchange is defined on the projduct.template, but the user
can edit the product configuration from a SO: it will be the
form view of product.product.
This commit applies the onchange of the product template
on the product product.

closes odoo/odoo#29140
2018-11-29 10:47:55 +00:00
Toufik Ben Jaa e8b5ef5b5e [FIX] purchase: crash on portal when no product image
- Since commit https://github.com/odoo/odoo/commit/8108a60dc38432243bef4f934784b119c77cf91d the purchase order crashes if a
  `purchase.order.line` product has no image.

  This is due to the fact that we pass a boolean value (False) to the
  function `image_data_uri` on the template `purchase.portal_my_purchase_order`
  which crashes.

closes odoo/odoo#29137
2018-11-29 11:24:16 +00:00
Olivier Dony 52a970bce3 [FIX] base: make demo install warning more prominent
Users may not notice the warning and carry the risk of irreversibly
damaging their production database. Making the warning message more
frightening should help avoid this.

closes odoo/odoo#29128
2018-11-29 11:13:39 +00:00
jem-odoo 3f8519f1a4 [FIX] hr_timesheet: project stat button on analytic account
Before this commit, when more than 1 projects are linked to
a same analytic account, clicking on the stat button from the
form view of analytic account, nothing happens.
This commit fixes this case by displaying the kanban view
of all the project linked to this analytic account.

closes odoo/odoo#29131
2018-11-29 09:42:26 +00:00
len-odoo a48a4b1c0b [FIX] web_editor: remove embed video option when composing an email
Embedding a video can't work because it embeds an iframe, which is not supported
by most email clients for security reasons.
(What happens when Gmail shows embedded videos in displayed emails, is that you
send a link in the email body, and it is at rendering that Gmail adds the iframe
into the page.)

In true bugfix fashion, we hide the button.
When the "res_model" is "mail.compose.message", we generate a widget with the
noVideo option.

Essentially a foward-port of v11 commit: 264f89f63f

opw 1905497

closes odoo/odoo#28912
2018-11-29 07:58:40 +00:00
Robot Odoo 05d31187d4 [MERGE] account: Improve partner suggestion in the reconciliation widget
See commits for more details.

-task:
https://www.odoo.com/web#id=1909317&model=project.task&view_type=form&menu_id=
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#28758
2018-11-29 12:32:26 +01:00
Hetashree Chauhan a5f31c324b [FIX] sale: reload targeted value
Before this commit:
when user set any target invoicing value he/she needs to refresh the
page.

After this commit:
As soon as user set the target invoice value it shows on the dashboard,
no need to refresh the page.

This commit is related to master bug

opw-1902250

closes odoo/odoo#29129
2018-11-29 09:08:50 +00:00
Robot Odoo 5a57420e48 [MERGE][FIX] portal, *: stop breaking behaviors on dblclick
* web, website, payment, website_sale

See sub-commits for details.

closes odoo/odoo#29001
2018-11-29 11:28:28 +01:00
qsm-odoo 02dcef80c9 [FIX] portal, *: stop breaking behaviors on dblclick
* payment, website_sale

This commit solves the problem described in the issues mentioned below
by using the new system introduced by the parent commit.

That new system is even more integrated with website "animations" but
the mentioned issues' features are not yet converted to use those (this
will be a master task to make "Website Widget" be defined in portal to
use all of those integrated features). This commit however converts an
already protected behavior of website_sale using that "animation"
integration.

Closes https://github.com/odoo/odoo/issues/27976
Closes https://github.com/odoo/odoo/issues/28704
2018-11-28 16:11:24 +00:00
Lucas Perais (lpe) c432667fbf [FIX] base,web_editor: get_view_id should return singleton
Because of 9a98a4d60e
and since the key of an ir.ui.view cannot be unique
(multiwebsite), duplicating views made several parts of Odoo crash

After this commit, we limit to one the views that are searched with their key
Responsibility is given to the user to change the priority and/or the key
in order to predict which view will be taken

OPW 1913335,1913100,1913186,1913112,1913240

closes odoo/odoo#29105
2018-11-28 15:26:48 +00:00
qsm-odoo 4f3635b2b1 [IMP] website, *: add event handler possibilities
* web

This commit introduces helpers for async handlers, especially for button
clicks. Those helpers are now used automatically for website widgets
(animations) if the 'async' word is placed in front of a handler name
in the `events` key definition.
2018-11-28 15:00:42 +00:00
Christophe Simonis 925210714f [MERGE] forward port branch saas-14 up to 8ee67f2a19 2018-11-28 15:43:17 +01:00
Robot Odoo 34b26bc7d6 [IMP] hr_attendance: faster loading of employees kanban view
**Description of the issue/feature this PR addresses:**

Addon hr_attendance adds a check_in/check_out status icon in every card of the employee kanban view. The status is figured out using computed field ``attendance_state``, itself relying on a computed Many2one field, ``last_attendance_id``.

The current way to compute the latter field seems to fetch all attendances before getting the most recent one. For each employee. Which causes the employee kanban view to load very slowly (~30 sec in 90-employee Camptocamp's instance).

This PR suggests to load only the last attendance entry.
Co-authored with @guewen

**Current behavior before PR:**

Employee kanban view loads very slowly.

**Desired behavior after PR is merged:**

Employee kanban view loads reasonably fast.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#28953
2018-11-28 14:49:44 +01:00
Christophe Simonis 8ee67f2a19 [MERGE] forward port branch 10.0 up to 42c42832b3 2018-11-28 14:41:28 +01:00
len-odoo 3987d11a80 [FIX] account: use the total amount instead of the amount before rounding
Create a "Cash Rounding Method" C with
    Rounding Precision: 0.05,
    Rounding Strategy: Modify tax amount,
    Rounding Method: DOWN.
Create an invoice I with rounding of currency C, with some tax line and nonzero
rounding.

When you now print the invoice, the tax amount is not the same,
as it shows the field "amount" instead of "amount_total".

Fix courtesy of Olivier Jossen, Braintec

opw 1909215

closes odoo/odoo#29079
2018-11-28 13:03:01 +00:00
Florent de Labarre f9c483d9f5 [FIX] account: -0.0
A value of -0.0 is not interpreted as 0.0 by the JS layer, so the
correct button doesn't show.

opw-1913900

closes odoo/odoo#29162
2018-11-30 07:43:35 +00:00
Nicolas Martinelli 4df201716f [FIX] account: account type
Make the `user_type_id` read-only to avoid writing the account type on
the account when changing on the AML.

opw-1904517

closes odoo/odoo#29168
2018-11-30 07:02:34 +00:00
qsm-odoo a153ed42a0 [FIX] website, *: properly clean website widgets
* web_editor

When an user saves its website, all the animations are destroyed so that
a clean DOM is saved. This is particularly important for snippets like
the latest post one that would crash the page if not cleaned before
saving.

Two cases were found where animations were not cleaned before saving and
this is what this commit fixes:
- When an user used the undo/redo system, all animations were lost as
  the DOM is recreated.
- When an user duplicated a snippet, animations were not restarted on
  the cloned element.

closes odoo/odoo#29159
2018-11-29 16:41:33 +00:00
Goffin Simon c05abb2db8 [FIX] sale: Wrong amount amount invoiced in sale.report
Steps to reproduce the bug:

Let's consider a product P with a unit price = 10

- Create a SO for two lines of the same product P
- Validate the SO and create the invoice
- Refund the invoice and validate it
- Go to Reporting > Sale report and select "Invoiced amount" as measures

Bug= -20 was displayed for the invoiced amount.

Technically, the two refund invoice lines of P were used two times in function
_compute_invoice_amount because for each SO line we catched all the refund lines
of the same product.

opw:1906445

closes odoo/odoo#29095
2018-11-28 12:34:55 +00:00
Lucas Perais (lpe) 15bcae2dc0 [FIX] web: action manager fullscreen toggle
From a standard view with the main menu (what is called a target=current action)
open a target=fullscreen action
Then, go back to the first action, with the breadcrumbs for example

Before this commit, the original view was displayed fullscreen,
which impaired business navigation because the main menu was not there anymore

After this commit, the original view has the main menu

OPW 1906373

closes odoo/odoo#29096
2018-11-28 12:23:41 +00:00
Jorge Pinna Puissant 651a11588f [FIX] product: fix pricelist view on mobile phone
opw-1914133

The list of pricing in the product view was generate by default on
mobile phone. It only displayed a list with the product name.
After the commit, a kanban view is displayed. The view shows the
same informations on the mobile phone than on PC.
The princinglistitem's form view was adapted for a mobile phone use.

closes odoo/odoo#29429
2018-12-13 08:35:09 +00:00
wan 7854c651e3 [FIX] account: fix _toggle_reconcile_to_false() on empty recordset
When the method _toggle_reconcile_to_false was called on an empty recordset (e.g existing account is imported with reconcile=False and the field was already False), an SQL error was raised.

Fixes #29326

closes odoo/odoo#29458
2018-12-12 13:31:19 +00:00
Romain Derie 9c4eab3ef4 [FIX] website: ensure only editor can force website with URL 'fw'
Before this commit, everyone could use the `fw` query string to force a
website during the dispatching. Plus, it would not require multi-website to be
enabled (multi-website only display UI elements, it does not affect behaviors
as they are already triggered even if multi-website is disabled).

This was intended but caused an issue for public users.
Indeed, the code that would force a website during the http dispatching would
be executed in `_add_dispatch_parameters`, after the auth methods.

Then, the request.uid would be the one from the website we were leaving and not
the one of the website we are forcing.
Public user would then not be recognized as such (if both websites have their
own public user) and would have interface glitchs (considered as connected).
Note: Next reload or page navigation would set the request.uid correctly.

Now:
To avoid such a behavior, we decided to allow only designer user to be able to
switch website with the `fw` query string, and only if multi-website is
enabled.
Note: The designer group check is done on the leaving website and not the
      forcing one as `_add_dispatch_parameters` is executed after auth methods.
      There is no way to check with which user the user will be logged on the
      forcing website (Public, Same user, different user?).
      Also, it would have to handle the same domain/different domain.

Step to reproduce:
  - Activate multi-website
  - Activate multi-company
  - Create SiteA and SiteB
  - Create CompanyA and CompanyB
  - Set CompanyA on SiteA and CompanyB on SiteB
  - A new public user will be bootstraped for CompanyB
  - Optionnaly, setting manually a different public user for CompanyB will do
    the same.
  - Go to website 1, request.uid is PubUserA and request.website is SiteA
  - Navigate to website 2 with `?fw=2` in URL, request.uid will be PubUserA and
    request.website will be SiteB.
    This is wrong, request.uid should be PubUserB as we are on SiteB

This will result in multiple bug, mainly the non logged user will see the
dropdown in the navbar as if they were logged in showing 'PubUserA'.

Fixes #27998

closes odoo/odoo#29136
2018-12-12 14:21:53 +00:00
Jeremy Kersten dc30b955e0 [FIX] website: don't show switcher website if only 1 website
In some case, you can have multi website enabel with only 1 website:
    - If you create a second and deleted it.
    - Or after a migration to check common view and specific view e.g.

In this case, before this commit, you have switcher of country that is just
an empty dropdown.

closes odoo/odoo#29481
2018-12-12 15:47:55 +00:00