Commit Graph
133679 Commits
Author SHA1 Message Date
jbw 7b5664660f [IMP] hr_expense enable attachment preview in journal view
Adding preview of expenses attachment to journal view.

When creating an expense, files can be attached (e.g. scanned receipts).
Those attachment files where not displayed in "Accounting > Accounting > Journals > Purchases" move_line list.
They now appear in the document preview.

Task = 2176443

closes odoo/odoo#44161

Related: odoo/enterprise#8002
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-02-03 15:35:08 +00:00
Cedric Snauwaert 80c67aa26f [FIX] account: outstanding credit widget should be displayed in state in_payment
closes odoo/odoo#44595

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2020-02-04 13:35:34 +00:00
Xavier-Do 9c26d4d870 [IMP] core: rename upgrades-paths to upgrade-path
Since this option is soon to be used, this rename is a last tweek
to make it more logical to use since it will point to a single
upgrade dir most of the time.

closes odoo/odoo#44593

X-original-commit: 1c8e2809fb296abce6114b7da906d48a240df418
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-02-04 13:19:02 +00:00
Olivier Dony 39018e7515 [FIX] base_setup: show demo data button only in debug mode
During the port to 13.0 and the new Settings dashboard,
the "Load demo data" button visibility condition was reversed.

Cfr #34290 or https://github.com/odoo/odoo/pull/34290/files#diff-e5df7b873d03867c9527da957b762802L131

closes odoo/odoo#44587

X-original-commit: 61b7d53731623db42896f61a4c2772761d7892de
Signed-off-by: Christophe Simonis <chs@odoo.com>
2020-02-04 12:27:09 +00:00
Odoo's Mergebot fdba9a878f [IMP] website_blog: improve onboarding
The creation of a new blog post is noisy.
The user is disturbed with colors (purple box, blue borders, etc).

task-2144335

closes odoo/odoo#43692

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-02-04 15:20:19 +01:00
Romain Derie 2b0e88a6f0 [IMP] website: allow user to change cover color
Before this commit, the covers from event & blog, which shares the same
template, would be set a fixed bg-primary color which couldn't be
changed.

This commit adds the possibility to change that bg color.

task-2144335
2020-02-04 13:06:08 +00:00
Romain Derie 4eb2aeb8e7 [IMP] website: make cover_properties a mixin field
Next commit will add new cover properties entries for the bg color.
Still, we want a default `bg-primary` class. Instead of addind 3 new default
value in existing cover_property fields, the chance is taken to make a mixin
out of that field to avoid code duplication.

task-2144335
2020-02-04 13:06:08 +00:00
Katherine Zaoral d0cbd2a06d [FIX] account: be able to found the proper transfer account
Properly set the transfer account in the company taking account the accounts defined in th company domain.  We found this error because in l10n_ar module we have 3 chart of accounts based on the company AFIP responsability which actually have same transfer_account_code_prefix. For that reason it was setting a transfer account to the company which is not belongs to the current company.

closes odoo/odoo#44586

X-original-commit: d38228836b8944740f04ca355c997c4b6a346e48
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-02-04 12:25:39 +00:00
Debauche Stéphane e4e84196f6 [FIX] im_livechat: add missing dependency to livechat widget
Bug
===
A dependecy is missing "lazyloader.js"

Task #2118959
opw-2188615

closes odoo/odoo#44577

X-original-commit: ea787bec2631e7d26c7011a88395d29126859c38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-04 11:32:02 +00:00
aab-odoo 7de76891c1 [FIX] stock: already defined test module
When there are two modules with the same name, an error is thrown
and only one of them is executed.

closes odoo/odoo#44573

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-02-04 11:27:24 +00:00
Romain Derie 8fc61fd2b4 [REM] website(_blog/_event): remove filtercolor option on cover
task-2144335
2020-02-04 10:59:22 +00:00
Jeremy Kersten 537644ec3e [IMP] website_blog: activate cover snippet on edit mode enter
As this is the first thing you want to do when creating a blog, it will ease
the onboarding.

task-2144335
2020-02-04 10:59:22 +00:00
Swapnesh Shah 5706ff62df [FIX] account: Set newly created template
Before this commit, Creating New Template from "Send Invoice" wizard doesn't update template_id on the Wizard.

In this commit, We write newly created template_id on the wizard.

closes odoo/odoo#44561

X-original-commit: 454e6ed9d956ac131d6476c95e59b2ab390df5b6
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-02-04 09:55:06 +00:00
Swapnesh Shah c3151daea7 [FIX] account: Use current date as fallback to convert currency
Fixes #43705
Before this commit, There will be tracback on converting currecy if there is not date on tax line.

Now we use current date to as fallback to convert currency.

closes odoo/odoo#44559

X-original-commit: 2b88d71c6e4815334f0edaa24d6041c5facd811e
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-02-04 09:41:30 +00:00
Martin Trigaux d11ee78019 [IMP] bus: unescape notification message
The title of notification is the author name escaped (for security
reasons).

   if (message.hasAuthor()) {
       title = _.escape(message.getAuthorName());
   }

When forwarded to the system notification, it does not need to be
escaped though, as the system notification is not HTML based.

Without this patch, a user named "Bob's friend" sending a message was
creating a notification with the title "Bob&#x27;s friend"

Unescaping the notification body just in case but the HTML of the body
in a mail.messages should be stripped by _notifyIncomingMessage.
Unescaping will just ignored unescaped characters and should do
nothing on messages not escaped.

Fixes odoo/odoo#24846

closes odoo/odoo#44550

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-04 10:33:19 +00:00
Odoo's Mergebot d64bf7e6cd [MERGE] web_studio: model configurator
Improvements for custom models and some default behaviours
linked to the Studio model configurator (Enterprise task).

In a nutshell:
- mark the default `x_name` field of a custom model as 'to be copied'
- improvement for kanban views that makes it easier to user with
  custom models

The interesting part is in the Enterprise `web_studio` module.

Task 2091654
Enterprise PR: odoo/enterprise#7326

closes odoo/odoo#42055

Related: odoo/enterprise#7326
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-02-04 13:16:40 +01:00
Damien Bouvy c2fccc9118 [IMP] base: make name of custom models copied by default
Copying a custom model's record seems pointless by default, since
no field is actually copied.

It makes sense to copy at least the `x_name` field, to make it clear
to the user that the system understood it was duplicating something
and not just creating something entirely new.
2020-02-04 10:46:41 +00:00
Damien Bouvy 18e06fa90a [IMP] web: kanban content container
The 'new' (read: the classes not in the 'compatibility layer section')
classes of the kanban views did not allow to cleanly separate an image
header from a content container.

This commit adds such a container, allowing a very simple layout that
should work all the time for a typical 'card with left image and right
content layout':
```xml
<div class="o_kanban_record oe_kanban_global_click o_kanban_record_has_image_fill">
  <field class="o_kanban_image_fill_left" name="image_128"
         widget="image"
         options="{'zoom': true, 'background': true, 'preventClicks': false}"/>
  <div class="o_kanban_record_details">
    <div class="o_kanban_record_top">
      <div class="o_kanban_record_headings">
        <strong class="o_kanban_record_title">
          <field name="x_name"/>
        </strong>
      </div>
    </div>
    <div class="o_kanban_record_body">
      <!-- some fields here (e.g. tags,...) -->
    </div>
    <div class="o_kanban_record_bottom">
      <div class="oe_kanban_bottom_left">
        <!-- some fields here (e.g. kanban status,...) -->
      </div>
      <div class="oe_kanban_bottom_right">
        <!-- some fields here (e.g. user image,...)-->
      </div>
    </div>
  </div>
</div>
```

Before this commit, the absence of a container for the right side meant
that the top/body/bottom were flex-growed in a flex-direction: row
element, appearing as 3 columns instead of rows.
2020-02-04 10:46:40 +00:00
Damien Bouvy ea4c934728 [IMP] web: allow background-style images for custom models
The `FieldBinaryImage` assumes that the image mixin is used to manage
its fields - this is mostly true, until you use custom fields.

This commit makes using the 'background' option of the Image widget
possible by fallbacking the thumbnail field's name to the name of
the field itself instead of `image_128` when we're dealing with a custom
field.
2020-02-04 10:46:40 +00:00
Nicolas Martinelli 411dd85a80 [FIX] purchase: vendor reference
- Create a product A
  MTO, Buy
  Add a supplier S1 and set a specific reference
- Create a product B
  MTO, Buy
  Add a supplier S2 and set a specific reference
- Create a SO with A & B, confirm
- 2 RFQ are created

The first RFQ is created with the correct reference, but not the second
one.

This is because `display_name` depends on context keys: it is computed
once for both products with `partner_id` set as `S1`, while it should be
recomputed for product B with `partner_id` set as `S2`.

In order to avoid this, we use `with_prefetch()` to avoid reusing the
prefetched value.

opw-2176638

closes odoo/odoo#44564

X-original-commit: d96c1910be8f242455de9b443fc9db82155b4dd1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-04 10:09:27 +00:00
Victor Feyens 1ed07959db [REM] web_diagram: remaining files
The web_diagram module was removed in saas-13.1,
along with the diagram view support but some translation files were
brought back by forwardports.

closes odoo/odoo#44563

X-original-commit: 3f50601736b23dac78720d24d5b67bf6b94f5f43
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-04 10:09:04 +00:00
Nicolas Martinelli a02a4b112a [FIX] l10n_ch: ISR with partial payment
- Create an invoice for 1000
- Make a partial payment (e.g. cash) for 250
- Print the ISR

The ISR contains an amount of 1000 (total amount), while it should be
750 (amount left to pay).

opw-2180538

closes odoo/odoo#44552

X-original-commit: 421bbcd5270b889874dc99a9a8cead0272e1e3da
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-04 08:48:20 +00:00
Jason Van Malder 5b252215dc [FIX] web_editor: replace root style/class attrib
Issue

    - Install eLearning
    - Edit the header > change image
    - Save

    Image not changed

Cause

    We do not take new style/class attrib in account in
    replace_arch_section.

Solution

    Take them in account

OPW-2122947
OPW-2182109

closes odoo/odoo#44541

X-original-commit: 8579c0cae839c615415120b79d6ec22c71f7affd
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-02-04 08:00:14 +00:00
Nicolas Martinelli 17ff09c90c [FIX] repair: set lot
The parameter `lot_id` must be a recordset, not an `int`.

opw-2188752

closes odoo/odoo#44525

X-original-commit: aeafd2a84e309ee4a496f9a109d7fe6b0fb9cd3d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-03 18:08:03 +00:00
Martin Trigaux be7b57a6fa [FIX] account: give a correct example
The computation was incorrect, the answer was 10, not 110 with the
previous formula

Courtesy of Frederico Freire Boaventura

closes odoo/odoo#44514

X-original-commit: 577e1ad8314cac6e61f60f997f338df4b7a1da38
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-03 16:16:20 +00:00
Romain Derie d92f76592c [IMP] website(_blog/_slides): show a toaster when a record is published
This commit shows a toaster when publishing a record through the toggle in the
topbar.
The `_description` field is used to do that, as it is supposed to contains a
'business oriented' descriptive name, see task-37311. Indeed, this field is
used in studio and in mail templates.

task-2144335
2020-02-03 15:25:20 +00:00
Romain Derie 9725e61969 [IMP] website_blog: make footer oe_structure placeholder less visible
task-2144335
2020-02-03 15:25:20 +00:00
Romain Derie b3ffb756a2 [IMP] web: restore blockquote style lost with BS4
Before this commit, the web_editor option 'Style' which has a `Quote` entry
would not do anything visually.

Indeed, what it does is inserting a `<blockquote/>` element in the DOM but is
has no style anymore in BS4.

This commit restore the style we had with BS3.

task-2144335
2020-02-03 15:25:20 +00:00
Romain Derie 1ecdb5b6b8 [IMP] website(_blog): remove several border in edit mode
This commit removes some noise of the UI in edit mode, to have a more easy
interface for onboarding blog creation.

task-2144335
2020-02-03 15:25:20 +00:00
Romain Derie 27e4f8a3e1 [IMP] website, website_blog: use better naming for block options
task-2144335
2020-02-03 15:25:20 +00:00
Romain Derie d64eb2981f [REM] website, website_blog, website_event: remove text size on cover
task-2144335
2020-02-03 15:25:20 +00:00
Romain Derie 860c7d79dd [IMP] website_blog: hide All Blog in breadcrumb if only one blog
task-2144335
2020-02-03 15:25:20 +00:00
jerome hanke (jhk) 17f62f6441 [FIX] mail: abstract getAvatarSource has default
Steps to reproduce:
- install sales
- create a new quotation

Previous behavior:
the avatar next to the author's name is empty in the mailthread

Current behavior:
avatar is displayed as expected

opw-2187231

closes odoo/odoo#44407

X-original-commit: 24ba9f9954a71eba46d44fe242cd2e6dba125da6
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-01-31 15:27:19 +00:00
Thibault Francois 08dfa9ffc4 [FIX] account: take into account force_company for default journal
The default journal depends on the company define in the context or the company in the environment
In case of online signature/payment of a SO in a different company then the public user
The company will be wrong and the journal_id as well
It lead to a fail of the payment since the payment could not be reconciled with the invoices

This is happening because the force_company is not taken into account for the default journal

This commit take the force_company into account, it take the precedences on the default_company

closes odoo/odoo#44238

X-original-commit: 8158e286b0020daa994b593377a2c99234e66086
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-29 18:38:34 +00:00
Jeremy Kersten e3fa264d10 [IMP] hr_holidays: improve display name
Before this commit, the date range was not known without open the record in backend.
It is really painfull to don't know when a guy of your team ping you on a new leave
the date from the current leave. (today ? next week ? ...)

Now we have the date into the name_get and so the subject of the email.

task-2001439

Nothing related to next activity ;) but idea was the same.

closes odoo/odoo#44462

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-02-03 11:29:50 +00:00
Denis Ledoux 355cb45603 [IMP] base_automation, web: give possibility to disable/edit failing automated actions
If an automated action raises an exception, in the traceback modal:
 - For admins, display Disable & Edit automated action buttons
   to be able to directly know with wihch automated action the error occurred,
   and to give the possibility to edit or disable it quickly,
 - For regular users, just add a paragraph to tell with which automated action the error occurred,
   so they can give this useful information to their administrator

This is specially useful for databases which have just been
upgraded to a newer version, and for which the server action
is failing because its code is no longer supported.

closes odoo/odoo#44513

X-original-commit: 8f3940c132bbbc99e47fa3f0cba0e768159d9af2
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2020-02-03 16:16:01 +00:00
jbm-odoo dc1402c79b [FIX] stock_account: Avoid divide by 0
closes odoo/odoo#43188

Related: odoo/enterprise#7676
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-03 13:11:58 +00:00
jbm-odoo 620730ed70 [IMP] stock: Add context key to avoid send sms
In stock, before sending an sms, we check if there aren't the key
'skip_sms' in the context. It is useful, for example, in fsm
application.

TaskID: 2081191
2020-02-03 13:11:58 +00:00
Lucas Lefèvre ac8c30beec [IMP] hr_timesheet, sale_timesheet: Set task analytic account
Purpose
=======

Currently, it is only possible to set an Analytic Account for a whole Project, there
is no distinction by task. However, if the user has 1 task per customer, he cannot
track the costs and revenues for that specific customer easily. He has to manually
change the AA of the timesheets' analytic lines. An option would be to set a
different AA on the SO generating the task, but the AA of the project takes over
anyway.

Specifications
==============

If the user sets an AA on the SO, it should bypass the one set on the project
Add an AA field below the Email cc one on tasks in debug mode
- should be related to the AA field from the SO
- it should also bypass the AA set on the project
All the timesheets from this task should be related to the AA field set on the SO/Task

closes odoo/odoo#40844

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-31 11:02:14 +00:00
Martin Trigaux eafa9f4abc [FIX] *: python 3.8 compatibility
time.clock is deprecated since python 3.3 and no longer exists in python 3.8
time.process_time was introduced in python 3.3

Replace "is" by "==" as this produces a SyntaxWarning in python 3.8

Fixes odoo/odoo#41313

closes odoo/odoo#44502

X-original-commit: f03b4cb5576f264b6845242ba112f02422af4f5f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-03 14:38:20 +00:00
qsm-odoo 5a6165da84 [REF] website: remove useless edit mode css rule
Part of https://github.com/odoo/odoo/pull/44500

closes odoo/odoo#44500

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-03 14:16:54 +00:00
qsm-odoo 8cd6f089dc [REF] website: move edit mode s_popup rule into the right file
Part of https://github.com/odoo/odoo/pull/44500
2020-02-03 14:16:43 +00:00
qsm-odoo a5281de40e [FIX] web_editor: always notify snippet option 'reset' after 'preview'
Some code was added to prevent notifying a 'reset' if there was no
'preview' before. Unfortunately, checking "if there was a 'preview'
before" cannot be done properly so some 'reset' were stopped while they
should not have. This commit simply removes the code which is in fact
not needed.

closes odoo/odoo#44499

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-03 13:58:38 +00:00
Mathieu Duckerts-AntoineandJason Van Malder 95f40530f3 [FIX] web: fix date filters
Issue

    If month - 1 or month - 2 are in the previous year, the filter is
    incorrect.

    ex: Date = Jan. 2020, Filter = Dec. 2019
        => last_year__last_month = 2018-12 instead 2019-12

Cause

    If date is 2020-01-20

    Selecting December => adding param "last_month"
    Selecting 2019 => adding param "last_year"

    Applying "last_month" => date become 2019-12-01
    Applying "last_year" => date become 2018-12-01

Solution

    Detect the right year to activate by default
    when a month is selected and no year is selected.
    With that solution it is not possible to get records in Jan. 2020
    or in Dec. 2019 only for instance but the global functioning
    of date filters stays the same as before.

OPW-2169528

closes odoo/odoo#44208

X-original-commit: 096fdc7d3fe0799aa761c6ad3597569a002c698e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Jason Van Malder <jvm@odoo.com>
2020-02-03 13:57:17 +00:00
Denis Roussel 68f5883aff [FIX] ir_property: Allows to search on boolean == False
Closes #43580
Fixes #9449

Adds field type conditions for boolean in search for Property model.

As False values are not stored in DB for boolean, the search() does
not return any value for non existent lines with:

* operator: '=' and value: False
* operator: '!=' and value: True

Uses the 'include_zero' and inverse operator mechanisms implemented
in Property model.

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-03 14:07:10 +00:00
Jorge Pinna Puissant 8d2f06750d [FIX] sale: automatic invoice not send
- In an e-commerce with automatic invoice set;
- Buy something as public user;
- Pay the order;

Before this commit, the client don't receive the invoice confirmation
email.

opw-2176506

closes odoo/odoo#44494

X-original-commit: 684e678e1240f444ccdcd31939456fe57177b5b2
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-02-03 13:34:46 +00:00
jdoutreloux 62baa8a214 [IMP] sale_timesheet : change default values of projects
If sale_timesheet is installed, the timer is activated
by default.

Task-2125111

closes odoo/odoo#44468

Related: odoo/enterprise#8109
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-03 12:59:17 +00:00
Yannick Tivisse 634dd65471 [IMP] web: Reload after company creation
Purpose
=======

At the second res.company creation, the multicompany mode is 'enabled'.
But to get the company selector dropdown, the user needs to reload the page.

Specification
=============

Force a reload at res.company creation, similarly to the forced reload when updating the language (lang) of the user.

closes odoo/odoo#44386

Taskid: 2127257
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-03 13:38:06 +00:00
Krunal Trivedi 86c95be9a0 [FIX] web: fix product, rating, channel etc. kanban view
Due to commit https://github.com/odoo/odoo/commit/7ecae3357117b1fd9889540556d5eba14ef8f237
which is introduces Next Activity icon on kanban cards at left bottom
of the card in contacts

however, this change effects other kanban cards making image and
details separated, such effected kanban views are ratings in project,
products and channels in live chat so fix the layout issue for all the
above kanban cards and it will not effect the contact kanban view.

taskID-2183676

closes odoo/odoo#44349

Closes: #44349
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-31 12:16:58 +00:00
Victor Feyens 7ae9b81186 [FIX] website_sale_comparison: archived (or deleted) products
Archived or deleted products shouldn't be counted in the comparison
widget count anymore.

The current behavior did only reset the cookie (and the count) when
products were added/removed from the comparison, but didn't consider
the case when the products currently in the cookie weren't all existing/valid.

Fixes #44049

closes odoo/odoo#44485

X-original-commit: 0b488842c0be2160c5ccd3b5b03b02a728f4eec5
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-02-03 12:43:03 +00:00