Commit Graph
135686 Commits
Author SHA1 Message Date
Aaron Bohy a0c7284b66 [IMP] web: add 'label' attribute on AbstractField
If set, this value will be displayed as column name in list views.
This attribute could be used in the future in form view for the
same purpose.

Part of task 2195254
2020-05-05 10:05:12 +00:00
Aaron Bohy c54007f0e3 [REF] mail: lint activity.js 2020-05-05 10:05:12 +00:00
Aaron Bohy 22a66ae694 [IMP] hr: add Many2OneAvatarEmployee field widget
This widget is a variant of the Many2OneAvatarUser widget, designed
for many2one fields pointing to 'hr.employee'.

Part of task 2195254
2020-05-05 10:05:12 +00:00
Aaron Bohy 59641325c7 [IMP] mail: add Many2OneAvatarUser field widget
This widget is an extension of Many2OneAvatar, designed for
many2one fields pointing to the 'res.users' model, or a model having
itself a many2one field pointing to 'res.partner'.

With this widget, when the avatar is clicked, we open a DM chat
window with the corresponding partner. If the user clicked on itself,
we open a blank chat window for the sake of consistency.

In kanban views, this widget only displays the avatar.

Part of task 2195254
2020-05-05 10:05:12 +00:00
Aaron Bohy e63ffeab5a [REF] mail,hr: move openDMChatWindow to MailManager
It will be used by the Many2OneAvatarUser widget defined in the
next commit.
2020-05-05 10:05:12 +00:00
Aaron Bohy df4693e7ff [IMP] web: add Many2OneAvatar field widget
In readonly, this widget displays the image of the related record
next to its display_name. In edit, it behaves exactly like the
regular many2one.

Part of task 2195254
2020-05-05 10:05:12 +00:00
Aaron Bohy 4f8860e503 [IMP] web: add RemainingDays field widget
This widget can be used on date and datetime fields. In readonly,
it displays the delta (in days) between the value of the field and
today. In edit, it behaves like a regular date(time) widget.

Part of task 2195254
2020-05-05 08:48:34 +00:00
Aaron Bohy a3c0d6ee71 [FIX] web: list: prevent flickering
Have a list view with "badge" field component and 'decoration-xxx'
attributes (on that field). Before this commit, it flickered when
the user refreshed the list (for instance, by clicking on the list
icon in the view switcher). The badges were displayed with a grey
background (i.e. no decoration) for a brief moment, before their
style was applied.

Their style is applied in the mounted hook, which is called by
'on_attach_callback' (legacy version of mounted). However, the list
renderer computes its column widths in 'on_attach_callback', which
produces a repaint.

This commit moves this operation to the end of on_attach_callback,
such that other processing (like applying the badges style) is done
before the repaint.
2020-05-05 08:48:34 +00:00
Aaron Bohy 1d6e4948d2 [IMP] web: add BadgeField component
This new field component displays the field's value inside a
bootstrap pill badge. Supported field types are 'char', 'selection'
and 'many2one'. The background color of the badge can be customized
by using the decoration-xxx mechanism, e.g.
 <field name="state" decoration-danger="state == 'cancel'" widget="badge"/>

Part of task 2195254
2020-05-05 08:48:34 +00:00
Aaron Bohy 56787d5878 [REF] web: field decoration
This commit refactors the way the decoration-xxx attributes are
applied to field widgets/components, in a way that it can be
overridden in a given field or component to generate the approriate
className. By default, 'decoration-x' applies className 'text-x'.

This will be necessary for the new 'FieldBadge' component, which
needs to apply 'bg-x' classNames instead of 'text-x'.

Part of task 2195254
2020-05-05 08:48:34 +00:00
Aaron Bohy a1d3e224d8 [IMP] web: list: allow to add decorations on field nodes
In list views, one can specify decoration-XXX attributes on the
arch root node. Those decorations are evaluated for each record,
and the corresponding style is applied on rows for which the
condition is true.

This commit allows to specify those decoration-XXX attributes on
field nodes as well. In this case, when the condition is met by a
record, only the field on which the attribute is set will be
impacted.

Part of task 2195254
2020-05-05 08:48:34 +00:00
Aaron Bohy 47144b9ee4 [IMP] web: list: improve style of icon buttons
Buttons with icon and string attributes now have both their icon
and string displayed, whereas before only the icon was displayed
(the string was available as title).

We also force class btn-link to style buttons with icon, except if
another btn-xxx class is explicitely provided.

Part of task 2195254
2020-05-05 08:06:33 +00:00
jerome hanke (jhk) 03eea7c481 [FIX] payment: float consistency enforcement in access_token generation
Steps to reproduce:
- install sales, ecommerce and payment_authorize
- setup authorize.net (test mode)
- go to sales and select the quotation S00007 (demo data) or create a quotation
with multiple items that add up to a float
- select action > generate a payment link > go to the link > select pay with authorize
- you are redirected to authorize.net use 4111 1111 1111 1111 as card number and 1223
as expiration date > pay
- you are redirected to the odoo payment process page
- wait for the result

Previous behavior:
the user is returned to a 404 error page but the payment went trough

Current behavior:
access_token generation is consistent and will not fail because of
float representation
the user is returned to the "payment confirmed" page

WARNINGS:
- watching the values in vscode prevents bug reproduction
- when setting up authorize.net, do not forget to add your test url to
the account's allowed return urls
- use https for authorize.net connection

opw-2223135

closes odoo/odoo#50633

X-original-commit: 0fe7fa0f95b7393d8829ba4b216d6c41d0c0dc3d
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-05-05 09:55:15 +00:00
Nasreddin (bon) e8fb743f57 [FIX] crm: Fix compute method on day open
Step to reproduce : Import from Excel a list of Opportunities.

The problem is that in _compute_day_open, the abs of the extraction
date_open - create_date is set as the lead's day_open.
As the date_open has no milliseconds, all those records which
create date is the same second have a date_open that is before their create_date.

Fixed it by comparing the date_create and date_open without microsecond.

Task ID 2222251

closes odoo/odoo#50599

X-original-commit: f7d1277080a91903342bbb4be44ce3a6ca814a38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-04 15:31:09 +00:00
Andrea Grazioso (agr-odoo) 08ceeaf81b [FIX] point_of_sale,pos_cash_rounding: fix change error popup on checkout
Configure your POS with bank payment method only
Make a sale with rounding necessary (i.e. 1,29€)
The amount will be rounded. Go through the payment screen.

Error message will appear because no payment methods available is
capable of handling the change, but this is not necessary since we are
rounding.

Splitting the code to add a more specific condition in pos_cash_rounding
fix the issue

opw-2239946

closes odoo/odoo#50216

X-original-commit: 6131534da2d3a3bf75529b32f2061d58e925b365
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-27 10:49:05 +00:00
56e63ebae3 [IMP] web: ControlPanel: remove dropdown carets
Part of task 2234547

closes odoo/odoo#49793

Related: odoo/enterprise#10059
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-05-04 18:15:28 +00:00
067e8c88fe [IMP] web: hide export button when selected records
Part of task 2234547

Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-05-04 14:31:11 +00:00
c80fa71adb [IMP] web,*: search menus always visible
Part of task 2234547

Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-05-04 14:31:11 +00:00
470fa48686 [IMP] base_import,*: move Import button to Favorite menu
*account,crm_iap_lead,hr_expense

Part of task 2234547

Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-05-04 14:31:11 +00:00
93c01a231a [IMP] web: FavoriteMenu: move 'Save Current Search'
Move it above the separator.

Part of task 2234547

Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-05-04 12:05:38 +00:00
Julien Castiaux 47a1ae580f [REV] module: bring back openerp import hook
Use `warnings.warn` to log a warning entry on usage of deprecated
import hook instead of `logging.warning`. The `warnings` can be more
easily configured to show/hide class of warnings or to limit warning
emission, plus it is possible to log a single stack entry whereas
logging can just log the entire call stack.

Bring back the various openerp import hooks by reverting 9e1f13bac12

closes odoo/odoo#50604

Task: 2234749
X-original-commit: 5840202802c2ff6ca1ca8fd6f3892900481db5da
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Christophe Simonis <chs@odoo.com>
2020-05-04 16:05:26 +00:00
Odoo's Mergebot 4cff27d6ab [MERGE] *: create records in batch
Ensure main Odoo models supports batch record creation.

* `purchase.order.line` supports multi creation in `purchase`, but not anymore when `purchase_stock` is installed.
* `sale.order.line` supports multi creation in `sale`, but not anymore when `sale_purchase` is installed.
* `crm.lead` doesn't support batch creation atm, but it doesn't cost anything to support it.

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

closes odoo/odoo#50468

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-05-04 18:28:53 +02:00
Alen Uglik 7202b14ca9 [FIX] base: translate action name
closes odoo/odoo#50600

X-original-commit: f0d59564a3329affa18473d26295799ea2c431c8
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-05-04 15:42:09 +00:00
Alen Uglik 6247a5dba9 [CLA] Uglaos signs Odoo CLA
X-original-commit: 8de457e888545618b82925117efb070ac101201b
2020-05-04 15:42:08 +00:00
Andrea Grazioso (agr-odoo) 8a57e84a32 [FIX] sale_timesheet: fix user permission to set sale order
Create a service product [DEMO] with service tracking
'Create a task in a new project'
Create a sale order SO1 with User 1 with [DEMO] product
Create a sale order SO2 with User 2 with [DEMO] product
SO1 will create a task in a project, edit this task and
assign as parent task the one created by SO2

The action will be blocked by security rules, because user 1 cannnot
see the sale order data of user 2 but the action should be
allowed.

Fixing the error with a sudo call

opw-2243370

closes odoo/odoo#50585

X-original-commit: 8c7d0266cc6d7bd0569721e92128096e64d9c361
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-04 14:20:46 +00:00
Victor Feyens b310b3843d [IMP] crm: create leads in batch 2020-04-30 12:33:32 +00:00
Victor Feyens 06e483dd69 [IMP] sale_purchase: create sales order lines in batch 2020-04-30 12:33:32 +00:00
Victor Feyens cefb3a469c [IMP] purchase_stock: create purchase order lines in batch 2020-04-30 12:33:32 +00:00
Olivier Dony 4310ba3214 [FIX] doc/deploy: add recommendations for firewall rules
In some situations it is important to protect the Odoo service from
direct access from the internet, or to protect internal network
resources from the Odoo server itself.

This is heavily dependent on deployment requirements, and for standard
installations on a public cloud system, this may not be necessary.
Yet it seems useful to mention it in the deployment recommendations,
as it may not be obvious to our users.

Our thanks to Ameya Darshan for raising this concern!

closes odoo/odoo#50422

X-original-commit: da0d9ef4a6e20df765a20a6231b2fcc535d0d863
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-04-29 18:14:15 +00:00
alt-odoo a35d80258c [FIX] sale: wrong default sales team in eCommerce orders
Side effect of commit 6d7bbd3074e6b3771b582bf544624cef59e1c6a3. In case we are coming from public route /shop/address,
we are in superuser mode and method _get_default_team_id can return a sales team
from another company. We should force the domain to avoid creating inconsistent records.

closes odoo/odoo#50581

X-original-commit: 0396c04ce894df80fb7714edb06e9befebdb672e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-05-04 14:03:43 +00:00
Alexandre Fayolle 252c0b7392 [FIX] crash when a mode appears twice in view_mode
If an action has for instance twice "tree" in view_mode, you get a crash
when displaying the action.

This patch adds a python constraint on the model which will prevent such
change.

closes odoo/odoo#50189

Opw: #2241415
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-04 11:19:43 +00:00
Mathieu Duckerts-Antoine d57e500081 [FIX] web: keep server group order in pivot
In the pivot view, groups comming from many read_group are assemble
to create the header hierarchies and the table.

Groups returned by the read_group may be already sorted by the server
using the order set on the model for instance and that order should
be reflected in the header hierarchies (and in the table).
It is important to keep that order since it might not be possible
to recreate it in the interface. Even if possible it might not be a
good idea for performance reasons.

Before this commit:
The groups are added in a JS object, whose keys are the group ids
(when grouping on a many2one at least). Then, to generate the table,
we iterate over the keys of that object, but those keys are sorted
according to the numerical order (not the insertion order),
because keys are kind of numeric.
See https://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order.

After this commit:
Instead of a JS object, we use a Map for which the insertion order
is used (official spec).

Task ID: 2243416

closes odoo/odoo#50551

X-original-commit: 1a9a85c8b8d0f47c3c6f3878cd6d9401ddc3ad75
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-04 09:36:01 +00:00
Damien Bouvy 3b80166e6d [FIX] payment_stripe: iDEAL payments
closes odoo/odoo#50546

X-original-commit: 29b3b67a168b905a72be36ef14ff428c9771a40a
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-05-04 09:12:37 +00:00
Mathieu Duckerts-Antoine db1cabc7ee [FIX] base: validate disable_counters
An attribute 'disable_counters' on fields of the search panel is
supported in case performance issues would be encountered with counters.
The commit dd7022eccd
allowing to use the search panel in other views than the kanban views
has also introduced the search panel arch validation
and the attribute 'disable_counters' was forgotten, so that it was
impossible to use it in practice.
With the present commit, 'disable_counters' is now recognized
as a valide attribute.

closes odoo/odoo#50542

X-original-commit: 4c321d0bcb83286c473a6e6c2b622274fa764393
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-04 08:27:38 +00:00
jvm-odoo a7ee8bc79b [FIX] web: fix can't open date picker on graph views
Issue

	- Install CRM
	- CRM > Reports > Activities
	- Add a custom filter > Created on
	- Select the date

	You can't, the date picker is not shown

Cause

	Actually, the date picker is shown but
	very quickly and it is closed by a scroll
	event thrown by Chart.js.

Solution

	Close the date picker only if the user
	scrolls manually.

OPW-2245019

closes odoo/odoo#50482

X-original-commit: bda320052ac937f5bc17c7da81d84633d72a8370
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-30 14:35:08 +00:00
qho f1fcc80574 [FIX] base: fix "Original Bill" when file is image
1. Create an invoice and upload a picture file as the only attachment
2. Try to print "origin bill" for the invoice (From the invoice tree
view select one and click print > origin bill )

An error will raise "PIL.PdfParser.PdfFormatError: trailer end not found".
Fixing by using another BytesIO object as the output.

opw-2244625

closes odoo/odoo#50469

X-original-commit: 378551193d8199cfab13b06a48aa706f420a7823
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-30 12:53:04 +00:00
jbw 4566cf2e57 [FIX] account_analytic_default_hr_expense : fix _onchange_product_id
_onchange_product_id() used to always (re)set hr_expense analytic_account_id & analytic_tag_ids to default values.
Or set those to false if no default values are found.
Installing account_analytic_default_hr_expense made odoo/addons/hr_expense/tests/test_expenses.py tests fail

- changed function name (no need to be a _onchange_product_id override)
- removed super() & return
- only set default value to var if var is False

closes odoo/odoo#50456

Task: 2205544
X-original-commit: 1c41c90ba715ba4141fd0410af886fac2a2c245c
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: jbw-odoo <jbw-odoo@users.noreply.github.com>
2020-04-30 11:29:38 +00:00
Nicolas Lempereur 5f7de6226b [FIX] website: menu translation on website
Currently, the menu are only translated for installed language when we
create a new website.

When we create a new menu (eg. by installing a module) or install a new
language we will only translate menu without website_id set, so the menu
are not translated.

With this changeset, we try to match translation of menu without
website_id to menu with website_id when translations are updated:

- when a language is installed/updated
- when a module is installed/updated

Without the changeset, the added test would fail with:

- "Menu in english" != "Menu en français"
  Load translation add missing translation from template menu

- "Menu in french" != "Menu en français"
  Load translation with overwriting update existing menu from template

fixes #43365
opw-2209864
closes #48031

closes odoo/odoo#50498

X-original-commit: 998987f8ee148235f4025eb97a424e838ac6fc9f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-30 15:45:58 +00:00
Xavier Morel e72c609306 [FIX] base: translations when dev-mode is enabled
When computing the `arch` from the arch_db, the field gets translated
as a matter of course as `arch_db` is a stored field with a
translation method. This means `arch` is assumed to be in the proper
language in the cache.

However when reading from the filesystem (dev=xml) this is not the
case, and the view XML ends up untranslated.

Fix the issue by applying the translation function from arch_db onto
the stuff we got from the filesystem.

Note: under the assumption that we *do not* want to store translated
archs in arch_db, explicitly set the lang to None when resetting
views.

Task 2059557

closes odoo/odoo#50389

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-29 12:53:04 +00:00
DramixDw 9b9829416b [IMP] website: simplify website menu
Some apps, once installed, automatically create a menuitem in website.
What complexify the UI and create useless menu withtout plusvalue.

It is not because you install livechat to make support online, that you want
a link in your menu to show stats e.g.

Now we remove the default menu created, and help user to find it when he create
a link. The autocomplete suggest most of the main App's controllers

task-2189613

closes odoo/odoo#49081

Related: odoo/enterprise#9733
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-05-01 07:59:07 +00:00
DramixDw 52c23e01e3 [REM] website,*: remove About us page and references
Remove the default about us page because it could be easily recreated and
doesn't add a lot of value to the website.

task-2189613
2020-05-01 07:58:11 +00:00
Christophe Simonis 919185f9eb [FIX] base: view arch is language dependent
Cache should be invalidated when updating `arch_db` via `arch`.

closes odoo/odoo#50512

X-original-commit: 1a14ca163ee256eb26661c900227db49426ec3af
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-30 17:30:21 +00:00
Raphael ColletandChristophe Simonis c99873d149 [FIX] core: improve cache consistency of translated fields
X-original-commit: 7460d65387edd9d8578e048da6ee634ef6a2e71e
Co-authored-by: Christophe Simonis <chs@odoo.com>
2020-04-30 17:30:21 +00:00
william f71e4e167c [FIX] account: invoice filters
There is no way to select all the posted invoices; only the posted and
unpaid.

closes odoo/odoo#50509

X-original-commit: abd53fa8b3e7787b4d3c0ab02e29656f85bfe4a3
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-04-30 16:51:17 +00:00
std-odoo 3810866f69 [FIX] mass_mailing: escape the mailing list name
Task-2241443

closes odoo/odoo#50502

X-original-commit: afa2153a24d495b863cd85febca3f96551d8cd56
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-30 16:03:54 +00:00
Thibault Delavallée c5c7a02302 [FIX][IMP] sms: create failed notification when SMS-ing record without any phone number
When no valid phone number was found on a record, and when using _message_sms
directly, no SMS and no notification was created. You could therefore think
everything was ok while it was actually not.

Instead we now create failed notifications. It allows to be notified of it
and fix numbers through cancel / resend wizards.

Task ID 2244192

closes odoo/odoo#50486

X-original-commit: baecdfaa2d31714a20d1fb8af7799af1805cd939
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-30 14:47:49 +00:00
Thibault Delavallée 9a3581d925 [FIX] sms: fix crash when using composer on a record without valid phone number
When no valid phone number was found on a record, and when using the composer
in single recipient mode, you had a crash at sending as composer tried to
write on a field called False.

Instead we just take the first available phone field of the record. As they
are all void we can update them safely.

Task ID 2244192

X-original-commit: 2306d7d79d8e64597912f15365cede7473589731
2020-04-30 14:47:49 +00:00
william b2008ade4c [FIX] account: separation between amount and currency on printed invoice
Task 2222062
The currency could not be on the same line as the amount

closes odoo/odoo#50500

X-original-commit: f75b708f8ac3774d91e0e5221523b572b2ddeb5b
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-04-30 15:58:05 +00:00
Jorge Pinna Puissant ed5ab19065 [FIX] resource: week_type for new periods
In a calendar with 2 weeks mode (odd and even), before this commit, all
new created periods (placed in one of the two sections) don't have the
week_type field set. This generates a confusion, because a period that
should be applied only in odd weeks, for instance, it was applied also
in the even weeks.

Now, the new periods will have the week_type field set with the
week_type of the section where is it. Also, an error message is raised
if a period is not in one of the two sections.

opw-2239966

closes odoo/odoo#50478

X-original-commit: 33a62118818952872321591e85403b657380128a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-04-30 13:53:17 +00:00
Adrien Horgnies 3e81b810aa [FIX] l10n_fr: update tax report
closes odoo/odoo#50269

Task: 2221224
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-04-30 13:59:44 +00:00