Commit Graph
124195 Commits
Author SHA1 Message Date
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
Romain Derie b9b1c08837 [IMP] base: add key in ir.ui.view search view
With multi-website support, the `key` field is more important than ever as it
kind of replace the xml_id behavior.

Thus, on the ir.ui.view list view it is common to search on `key`. Having it in
the search bar is mandatory.

closes odoo/odoo#29417
2018-12-11 10:39:55 +00:00
Jeremy Kersten a5f4195432 [FIX] report: don't call subst() if not defined
In case you are printing in html a report with minimal layout, you will have an error
since the function is not defined, but called by the onload of the body tag.

Now we don't call subst if it is not needed (and so not declared)

closes odoo/odoo#29341
2018-12-07 09:05:42 +00:00
Jeremy Kersten 8a05ad7843 [FIX] web: remove report_assets_common JS from minimal_layout
This assets has a lot of JS that is loaded by wkhtmltopdf without any reasons.
Wkhtmltopdf don't like long js to load (it is why subst has been write inline)

This commit allow to print again (on slowly server) several documents in the
same pdf. Before this commit, the JS was not loaded before the default js-delay
and so the subst function never called with as result a pdf of only 1 page.

After this commit you can again print several documents in the same pdf and
subst function is applied.

opw-1909000

courtesy of @beledouxdenis that help to debug this error since it is only
reproductible on paas server.

This commit follow the same logic that commit odoo/odoo@3c61ee5
And issue wkhtmltopdf/wkhtmltopdf#2083 is not yet fixed
2018-12-07 09:02:14 +00:00
Toufik Ben Jaa 37fa21a2af [FIX] account: avoid crash when request not bound to database
- When installing account using a request (e.g. http route auth set to `None`) not bound to a database,
  the installation fails.

  To avoid this, we check if the request we are using is bound to a
  database, if not, the fallback code is executed.
2018-12-12 15:19:25 +01:00
XavierDo 54ad2f57ce [FIX] mail: avoid to post multiple join message on channel
When a new user is subscribed to a channel, (multi-user, without emails)
a message is posted on this channel.

The mechanic used for that is unfortunately not very reliable
Javascript will call channel_join_and_get_info every time a channel
is added (client side) even if the user is already in the channel.

This fix simply check that the action_follow actually add the
user to the channel before sending the message.

We should avoid to call channel_join_and_get_info in this case and only call
channel_info but this fix will temporary fix the issue.

closes odoo/odoo#29441
2018-12-11 17:36:04 +00:00
Antoine Prieels (ANP) e81ef3a603 [FIX] snailmail: Do not resend letters in state 'error' in cron
closes odoo/odoo#29456
2018-12-12 09:36:36 +00:00
Antoine Prieels (ANP) 8b930c648d [IMP] partner_autocomplete: Notify when user out of credits
closes odoo/odoo#29309
2018-11-28 10:32:20 +00:00
qsm-odoo fea93a9dd6 [FIX] web: restore card-body border corners
Again (and definitely?) completes https://github.com/odoo/odoo/pull/29253

As the mentioned PR forces a background on card bodies, that background
went over the card border corners as those are rounded. This commit
fixes that by adding the correct border radius on card bodies, the same
way bootstrap does it by default for card headers and card footers.

closes odoo/odoo#29325
2018-12-06 15:38:16 +00:00
qsm-odoo a8fec3b5cd [IMP] portal, website: change the default website body bg
Use a very very very light gray as body background color for
the website so that default white cards have some contrast with the
body. Also adapt the portal system to use the portal colors when the
body bg color is equal to that very very very light gray (while it was
compared to $white before).

closes odoo/odoo#29318
2018-12-06 14:18:36 +00:00
Cedric Snauwaert a6d250a053 [IMP] sale: notify matching SO in reconciliation widget
We now display a message informing the user that the statement line is matching a sent/to_invoice SO. The user can thus decide to follow the link and confirm the SO, create the invoice and come back on the reconciliation widget to reconcile the prepayment with the validated invoice (automatically detected).

Was task #1879015

closes odoo/odoo#29312
2018-12-06 14:01:38 +00:00
Robot Odoo ee2b9554ed [MERGE][REF] survey*_: improve survey demo data
Purpose of this merge is to update the demo data for surveys used in various
applications, notably the base one in survey.

It impacts survey (feedback survey to make coherent with odoo demo data and
remove references to odoo as a product in odoo), hr_recruitment_survey (sample
recruitment survey moved from data to demo and simplified).

This merge is linked to task ID 1912228 and PR #29303.
2018-12-06 18:53:04 +01:00
Andrea Ulliana 4a350ff8cc [IMP] product: clean forms and improve archiving
Several last cleaning in the product and product variant form :
- various labelling and design improvements
- sales, purchased and manufactured stat button (number of sales was
incorrect and click will now open normal sales analysis)
- now archiving related product.template if there is only one active product.product

Task-1880039  closes #28633
2018-12-06 14:27:14 +00:00
Robot Odoo 03bcd2235b [MERGE] (l10n_be_)hr_payroll: Clean data and code
1/ hr_contract_salary: Remove hr.contract.advantage.template model

   It was a failed attempt to make somethig generic. Sometimes we are not the only ones to choose.

   Closes #28727

2/ hr_payroll: Retrieve localdict default value from a method

3/ l10n_be_hr_payroll: Merge both miscellaneous onss rules

   This is useless to have 2 separate rules.

4/ l10n_be_hr_payroll: Move withholding tax reductions into the same rule

   Compute the 'precompte professionnel' directly instead of having more than
   10 rules just for that.

5/ l10n_be_hr_payroll: Update 'Bonus à l'emploi' up to 01/09/2018

   See: https://www.socialsecurity.be/employer/instructions/dmfa/fr/latest/instructions/deductions/workers_reductions/workbonus.html

6/ l10n_be_hr_payroll: Remove duplicated salary rule

   This rule is a reduction for the ONSS contribution, not a reduction for
   the précompte professionnel.

   The reduction for the ONSS contribution is already implemented.

7/ l10n_be_hr_payroll: Rename C.P. 218 into CP 200

   The CP 218 is deprecated since 2015. See https://www.jesuisemployeur.be/banque-d-info/actualites/la-cp-218-devient-la-cp-200-qu-en-est-il-des-entreprises-qui-relevent-actuellement-des-cp-100-et-200

8/ l10n_be_hr_payroll: Use the magic formula for the PP computation

   The 'Précompte Professionel' can be deducted from a formula if you're
   patient enough to read https://finances.belgium.be/sites/default/files/downloads/700-formule-cle-20180101.pdf

   This commit remove all the hr.salary.rules from the official tables
   and use the formula instead. This should improve the performances too.

9/ hr_payroll: Show only localizations on res_config

10/ hr_payroll: Install the correct module when enabling accounting

   Closes #29207

11/ l10n_br_hr_payroll_account: Remove useless dependency

12/ l10n_in_hr_payroll: Add dependency to l10n_in

13/ l10n_be_hr_payroll: Add dependency to l10n_be

TaskID: 1915125

closes odoo/odoo#29246
2018-12-06 17:47:54 +01:00
Thibault Delavallée 7df9cd7ca6 [IMP] survey: improve demo survey
Purpose of this commit is to provide a new simpler survey as demo data in
survey application. Current survey is about Odoo use which is not coherent
with the demo data set used currently in Odoo. It is now a survey about
ecommerce use with an example of each different questions.

Survey tour is updated accordingly. It now uses a standard routing instead
of the test route. Indeed purpose of tests is to use real life use case
not corner case like testing capabilities of survey application.

This commit is linked to task ID 1912228 and PR #29303.
2018-12-06 14:49:15 +01:00
Thibault Delavallée 0ed7499a34 [IMP] hr_recruitment_survey: clean demo survey
Purpose of this merge is to simplify demo survey in hr_recruitment_survey,
make it shorter, simpler and a bit more updated.

This commit is linked to task ID 1912228 and PR #29303.
2018-12-06 14:46:57 +01:00
Thibault Delavallée c71c87ee87 [MOV] hr_recruitment_survey: set demo survey as demo instead of data
It is absolutely not necessary to have a small recruitment survey as a
data. It should be a demo, notably because it is used in demo jobs in
order to have a sample survey available.

This commit is linked to task ID 1912228 and PR #29303.
2018-12-06 14:46:27 +01:00
Yannick Tivisse db0de92122 [IMP] hr_contract_salary: Remove hr.contract.advantage.template model
It was a failed attempt to make somethig generic. Sometimes we are not the only ones to choose.

Closes #28727
2018-12-06 13:45:59 +01:00
Yannick Tivisse cc2703026a [IMP] hr_payroll: Retrieve localdict default value from a method 2018-12-06 13:45:59 +01:00
Yannick Tivisse 78f4f95a4b [IMP] l10n_be_hr_payroll: Merge both miscellaneous onss rules
This is useless to have 2 separate rules.
2018-12-06 13:45:59 +01:00
Yannick Tivisse 934b9ccc36 [IMP] l10n_be_hr_payroll: Move withholding tax reductions into the same rule
Compute the 'precompte professionnel' directly instead of having more than
10 rules just for that.
2018-12-06 13:45:59 +01:00
Yannick Tivisse f67636ed2f [IMP] l10n_be_hr_payroll: Update 'Bonus à l'emploi' up to 01/09/2018
See: https://www.socialsecurity.be/employer/instructions/dmfa/fr/latest/instructions/deductions/workers_reductions/workbonus.html
2018-12-06 13:45:59 +01:00
Yannick Tivisse a6a0519171 [IMP] l10n_be_hr_payroll: Remove duplicated salary rule
This rule is a reduction for the ONSS contribution, not a reduction for
the précompte professionnel.

The reduction for the ONSS contribution is already implemented.
2018-12-06 13:45:59 +01:00
Yannick Tivisse a6b8b8d3dc [IMP] l10n_be_hr_payroll: Rename C.P. 218 into CP 200
The CP 218 is deprecated since 2015. See https://www.jesuisemployeur.be/banque-d-info/actualites/la-cp-218-devient-la-cp-200-qu-en-est-il-des-entreprises-qui-relevent-actuellement-des-cp-100-et-200
2018-12-06 13:15:36 +01:00
Yannick Tivisse e956b5d278 [IMP] l10n_be_hr_payroll: Use the magic formula for the PP computation
The 'Précompte Professionel' can be deducted from a formula if you're
patient enough to read https://finances.belgium.be/sites/default/files/downloads/700-formule-cle-20180101.pdf

This commit remove all the hr.salary.rules from the official tables
and use the formula instead. This should improve the performances too.
2018-12-06 13:15:36 +01:00
Yannick Tivisse d7a2148360 [IMP] hr_payroll: Show only localizations on res_config 2018-12-06 13:15:36 +01:00