Commit Graph
137189 Commits
Author SHA1 Message Date
Hardik Prajapati 7aafa20509 [FIX] web: list: hide export button when list empty
Before this commit, at first rendering, the export button was
displayed in the list view even if the list was empty.

The issue occurred because at first rendering, the buttons aren't
moved inside the control panel yet (this is done in the 'mounted'
hook of the control panel). As we render in a fragment, the hook
is called later on, when everything is ready and inserted into the
DOM.

We'll get rid of these painful manipulations as soon as everything
will be converted to OWL.

Task 2294306

closes odoo/odoo#54307

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-27 12:54:57 +00:00
Jorge Pinna Puissant 97425653af [FIX] hr_timesheet: timesheet button in employees view
Fine tuning of c839ecda6c696ac54ceaf24b2ee1816cb358052a

opw-2285695

closes odoo/odoo#54973

X-original-commit: 15ce41cd1ec8a9e80ec59fa4a0d26329fc1225f9
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-07-27 11:09:12 +00:00
Pierre Masereel 056246665f [IMP] pos_sale: speciify table for qty field in request
In the sale_report sql request for pos orders, the field qty of order
lines is used without specifying the table it comes from.

To avoid ambiguity if a field with same name is declared in another
table of the join, we prefix it by its table.

ISSUE-54933

closes odoo/odoo#54960

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-07-27 09:48:33 +00:00
Antoine Prieels a4d6b0d286 [FIX] point_of_sale: Open Cashdrawer when no printer is selected
- In the POS config, check "Receipt Printer"
- The "Cashdrawer" checkbox will show, check it
- Uncheck "Receipt Printer"
--> Cashdrawer is still checked, so if you open the POS and validate
an order paid in cash, it will try to open the cashdrawer, but there's
no receipt printer so the command fails with a traceback.

opw-2303986

closes odoo/odoo#54963

X-original-commit: 9bd5d6d5b19c7bf44c5ba9ee544812bdfa558217
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-07-27 10:15:09 +00:00
Xavier Morel 92903e22f8 [IMP] core: reporting after tests
Currently there are a few issues with testing reporting (at the
command-line):

1. there is a global report after at_install tests, but it gets
   "scrolled off" by long post_install tests, and is thus easy to
   miss
2. with test tags, it's easy to fat finger a typo and run 0 tests,
   which look like everything's running fine (no failure)

To improve this, print a global report at shutdown (in
`--stop-after-init` mode if tests are enabled) which recapitulates the
test results *and prints a warning if no tests were run at all*.

Also update the reporting collection to make this more reliable:

* have `run_unit_tests` return `None` if it has run no tests, the
  assertion reporting machinery counts this as neither success nor
  failure which is exactly what we want
* have load_test only report a success *if files were actually
  loaded* (by having `load_data` return that information)

Task 2301268

closes odoo/odoo#54812

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-07-27 09:30:51 +00:00
Dharmraj Jhala 297c3d8378 [IMP] mass_mailing_sms: improve shortened URL detection in tests
Before this commit, in gateway tools, we used to consider URL as a
shortened which was having `/r` in it. However this is not true in
all cases. Any random URL can have `/r` in it but it might not be
a shortened one. It caused random failures on runbot time to time.

This commit makes a bit precise search (`/r/`) to consider URL as
a shortened one and thus avoiding those random test failures on the
runbot.

TaskID - 2276386

closes odoo/odoo#54944

X-original-commit: b8045b49d0693292e6240dfb3acd7c9a6450ad77
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-27 08:04:10 +00:00
Lavish Chhatwani c5d98aeccb [FIX] crm: set 'info' alias to default data salesteam
This commit sets 'info' alias on the default sales team and sets 'admin' as a
default user for the same. After a long debate on default alias configuration
"it will work on SaaS and other people will be careful when deploying" won.

Task ID-2284840

closes odoo/odoo#54943

X-original-commit: 46d616643ba684596b709cd7e65536781dfa5d51
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-27 08:03:42 +00:00
Lavish Chhatwani 29c39dab3b [FIX] crm : prevent a false positive warning ribbon for phone on lead
In the lead, we compute the phone number to make it formatted to match
with the international phone number format.

Before this commit, this formatted number was used for comparison with
partner's phone (which is not formatted), and so, even if both the
numbers are same, the warning ribbon appears due to different formats
which is not correct behavior.

This commit fixes the issue by comparing both the formatted number to
remove the false positive warning ribbon and thus making sure that it
appears only when there actually is a difference between lead's phone
and the phone number set on partner.

Task Id-2274752

closes odoo/odoo#54942

X-original-commit: d29862c1de6208f7fdb7c8104afe0d35241d130b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-27 08:03:19 +00:00
vha-odoo 89d5628c9d [FIX] mail: remove unnecessary gap between fields
prior to this commit :
there was a big gap between subject and recipients in mass mailing

with this commit:
the gap has been removed by improving css related to  mail emoji
drop-down (resopnsible for this gap).

task - 2291575

closes odoo/odoo#54940

X-original-commit: ae4c9be4419604affd980ae80b48f738a70b0b2c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-27 07:47:12 +00:00
Dharmraj Jhala 0e57bfd453 [FIX] sms, test_mail_full: make contextual action work for sms templates
While creating contextual action for an sms template, the composition mode
may be decided on the fly, based on number of records and on context the key
`default_composition_mode`, which is set to 'guess'.

It used to work before a recent refactoring[1], because the composition
mode was changed in the default_get, and was being set to appropriate
value instead of 'guess'.

After this refactoring, the composition mode is not being set in the
default_get but is being computed, so the key `default_composition_mode`
tries to set the composition_mode selection field to 'guess', which is not
available in the selection values, resulting into traceback.

This commit fixes the issue by renaming the context key(removing 'default'
prefix) to avoid setting the mode directly and instead let the compute method
decide the composition mode based on context key and number of records.

[1] - https://github.com/odoo/odoo/commit/e02137c48562d824e3e01054e31dae383e5843e2

TaskID - 2286959

closes odoo/odoo#54938

X-original-commit: 2b9ea3d93445e05cb0440aab33f2bf9e066b0fa5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-27 07:27:18 +00:00
Nicolas Martinelli dafe96b3da [FIX] website_links: prevent display of huge list
- Create 80k UTM sources
- Go to the Website
- Promote a page (e.g. an event)
- Select a source

The web browser freezes.

It happens because Select2 tries to display all sources at once.

To prevent this, we force at least 3 characters before searching and
hence displaying the results. Note that a such high number of UTM
sources is reached because of automatic generation of random values in
mass mailing. Therefore, the combination of 3 characters narrows down
the search result drastically.

opw-2289249

closes odoo/odoo#54947

X-original-commit: 7c7986361704d7b82b115499e64c47eb74ab655f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-27 08:24:30 +00:00
Julien Mougenot eab8795c4e [REF] *: Remove widget attributes from search views
Widget attributes have been removed from all search view archs since
they are no longer supported.

closes odoo/odoo#54107

Related: odoo/enterprise#11665
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-27 08:03:21 +00:00
Julien Mougenot a7657fbf84 [IMP] web: Drop widget support in search view
Until now the "widget" attribute used in the search view was meant to
force the type of a field regardless of its definition. This system was
implemented quite a long time ago and is now useful in only one case:
searching for "reference" fields (we want them considered as char fields
else it is impossible to search on them).

This is why this commit completely removes the "widget" attribute
support in search views while consistently casting the "reference"
fields as "char" fields in the search bar.

Task 2061795
2020-07-27 08:03:18 +00:00
Andrea Grazioso (agr-odoo) 2442892ec1 [FIX] point_of_sale,pos_cash_rounding: return payment with rounding
In the PoS, activate the cash rounding.
Open a PoS session and make a sale.
Close the session (without validating the entries yet),
Go to the just made order to return the items.

Upon making return payment, it gets stuck, because Odoo offers
to refund the unrounded amount and it doesn't match what the customer
paid.

opw-2289751

closes odoo/odoo#54870

X-original-commit: 0811db53c728c2e159c50c2c9f096a06d3ac3be2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-07-23 18:54:23 +00:00
Andrea Grazioso (agr-odoo) cf741bb7fc [FIX] website_sale_coupon: display product image for rewards
Go to web shop as guest
Add 10 office chair black
Go to checkout
Add coupon code 10pc
Image for the reward prod will be displayed correctly
Proceed in checkout flow

Image is not displayed anymore

opw-2289771

closes odoo/odoo#54684

X-original-commit: 913ed0460b68537f9653c175996e3f58d3c81a40
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-07-17 14:23:30 +00:00
Xavier Morel ef709fd92b [IMP] core, base: avoid multiple xids when importing records w/ inherits
Before this change, we create an xid for every parent of a record
being imported, regardless of whether it already has an xid, or if
it's being created implicitly through the child.

This generates unnecessary extra xids on pre-existing objects
e.g. update 5 product variants -> the product gets 5 new xids despite
already having one.

We should *only* set a xid on parent records which are being
implicitly created by the creation of a child with a specified
xid. That is, we should never set a xid on the parent if it exists
before the child is created.

Update _process_end to try and see if "non-loaded" xids correspond to
an automatically generated "parent" xid: we're still setting a xid on
implicitly created records (if the child is created with a xid) so
they're properly removed if e.g. the module is uninstalled, but
because we're only doing so at creation these xids will not be visited
during update and _process_end will try to delete them.

A special case can be added to check that "unknown" parent xids don't
have children which _inherit them, in which case we want to protect them.

Task 2251039

closes odoo/odoo#53283

Related: odoo/enterprise#12023
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-07-27 06:32:59 +00:00
Goffin Simonandodoo-crm dfda8b010b [FIX] sale_stock: Printing an invoice
When printing an invoice with one of its line without write_date,
a traceback was raised.

opw:2301363

closes odoo/odoo#54856

X-original-commit: 765e3d526890f1babd85ec3a68aa322f61ab9d10
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: odoo-crm <crm@odoo.com>
2020-07-23 15:02:08 +00:00
jvm-odoo 40861fc1ef [FIX] website_event: prevent foreign key violation when deleting menu
Issue

	- Install Events
	- Any Event > Edit
	- Toggle website menu
	- Go to website > Edit
	- Add anything > Save
	- Edit in backend
	- Toggle off website menu > Save
	- Toggle on website menu > Save

	Traceback foreign key violation

Cause

	We unlink the website menu view
	but not its childs.

Solution

	Use `_force_unlink` context key to delete all inherited views too.

OPW-2291645

closes odoo/odoo#54918

X-original-commit: a21401f84a0baebe33ca7adc11f85d538afd51ec
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-24 14:40:13 +00:00
Aaron Bohy 3d3348c2d2 [FIX] web_tour: do not reposition hidden tips
The tour system is made such that we always have at most one tip
displayed on every screen. Since commit [1], "inactive tips" (i.e.
tips that aren't displayed because there's already an higher
priority tip displayed), are rendered, but turned invisible (s.t.
their action is still consumed when their anchor is clicked on),
whereas before [1], those inactive tips weren't rendered.

As a consequence, in the enterprise Home Menu with **a lot** of
apps installed (e.g. on runbot), it lags when the user scrolls,
because all those invisible tips still do a lot of computation to
reposition themselves.

This commit skips these positionning computation for invisible
tips.

[1] 3bf1d8418f41bcaa0ba4b153620def11aaea0a2b

Issue spotted while testing task 2263600

closes odoo/odoo#54920

X-original-commit: cac1689718299fcf509de8228ed6cf2bfdb7c57c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-24 14:46:10 +00:00
Julien Castiaux e9859a0979 [FIX] module.py: Remove useless path initialization
The `initialize_sys_path` is the function responsible of getting the
custom Odoo import hooks to work, i.e. addons import via
`import odoo.addons`. This function is called by some other module
related functions to ensure the paths are correctly setup. We are
confident it is useless to re-initialize the path in many places.

The `load_openerp_module` function is called during server bootup by
both `odoo-bin server` and `odoo-bin shell`, both command parse the
configuration before starting the server which initialize the paths
already.

Most call to `get_module`, `get_module_path` and `get_resource_path` are
done in models or controllers where a registry is setup already. There
is one notable exception which is the subcommand discovery done during
the bootup, for that specific case, we initialize the paths with a
partially loaded configuration.

closes odoo/odoo#49715

Task: 2200956
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-17 13:23:04 +00:00
Florian Gilbert ba373bc912 [IMP] account: Change color of setup button.
This button has now a "btn-secondary" class.

Task ID: #2288963

closes odoo/odoo#54910

X-original-commit: 1ee9077a1fa111130e4ad88209688221717266ad
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2020-07-24 12:50:33 +00:00
Nicolas Martinelli 3a2623ac2a [FIX] stock: set package after validation
- Activate the packaging
- Show detailed operation of receipts
- Create a receipt for some products
- Validate
- Unlock the picking
- Set a Destination Package, save

The product doesn't appear in the package.

The trigger was incorrectly removed in 8750d6a97954e59259d and
507101434f9221f2cfa6d.

opw-2299529

closes odoo/odoo#54908

X-original-commit: aeb969a0f0b1786a2303906352931229b2f63bb9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-24 12:28:43 +00:00
Rémi Rahir 4cddc49760 [FIX] website_sale: Fetch pricelist with proper rights
When a user with access to company A tried to make a purchase on the
website of company B, he would face a traceback upon calling `_get_pricelist_available`.
This happens because we eventually try to access to the current company
(B) while forcing environment of the user (in company A), thus
forfeiting the superuser privileges, which triggers
an access error.

closes odoo/odoo#54891

X-original-commit: 0c38d7f55a48175938803012907a66d394f6c5b3
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2020-07-24 10:29:18 +00:00
Michael Mattiello (mcm) 27d47d1435 [IMP] web: change list view's groups style
This commit changes a bit the style of groups in list view
* reduced padding-top/bottom of group headers to 5px
* increased the padding-left by 2px of carets to align
  them with selection checkboxes (in enterprise)

Task 2301397
ENT PR: https://github.com/odoo/enterprise/pull/11955

closes odoo/odoo#54736

Related: odoo/enterprise#11955
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-24 09:55:08 +00:00
Nicolas Martinelli fcaa793a7c [FIX] l10n_id_efaktur: NPWP
- Create a partner, set a VAT number
- Create an invoice
- Download the E-Faktur

The NPWP (VAT number) remains zero.

opw-2296971

closes odoo/odoo#54900

X-original-commit: 96119d71a132e13a1fb4e6e3ebdb04c24c7430fe
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-24 11:17:31 +00:00
Nicolas Lempereur e8951481b6 [FIX] l10n_ch: add padding on QR-BILL header
QR-BILL report has no margin so we can position things exactly where
they needs to be according to standard.

For example the form must stick at the bottom and have 100% width, so we
can't use paperformat margin that would not allow to have 100% width.

With this change, we set default padding on header so it match
better "European A4" paperformat (that has 5mm top margin and 7mm right
and left margin) for stylistic purpose.

This is currently not configurable so for custom header size still need
view editing to change current values, but this at least make the
edition easy.

opw-2267041
closes #54717

closes odoo/odoo#54725

X-original-commit: b758a02ae50fa13f090190accce1fa6d1dbde7d2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-07-20 19:30:02 +00:00
Raphael Collet 4147f1d313 [FIX] core: make check_company's error message clearer
Make the error message more comprehensible for users, using the record's
display name, the company's name, the field's label and value.

    Incompatible companies on records:
     - 'Foo' belongs to company 'X' and 'Contact' (partner_id: 'Bar')
       belongs to another company.

closes odoo/odoo#54883

X-original-commit: e410c90bbddb581100d170bf8180e790bb7af5fd
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-07-24 08:37:45 +00:00
Raphael Collet e1f514f100 [FIX] website: adapt query count
closes odoo/odoo#54878

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-07-24 08:30:00 +00:00
Raphael Collet 9b7a4e1815 [IMP] core: smaller and faster field cache
Consider a context-dependent field and two possible cache structures for
storing the data of that field for N records and K context keys.  The
common use-case is to assume that N is much larger than K.  We look at
how many dicts are used in each cache structure, where we label dicts
with N entries as "large", and dicts with K entries as "small".

     Structure                 | Number of dicts
    ---------------------------+-------------------
     cache[field][id][key]     | 1 large + N small
     cache[field][key][id]     | 1 small + K large

It is known that "small" dicts have a large relative overhead when
compared to "large" dicts.  Given this fact, the second cache structure
will generate less memory overhead.  Here are numbers for N=16, showing
the size in bytes taken by the cache structure.  Larger values of N lead
to larger size differences, always in favor of the second structure.

     Structure             |  K=1 |  K=2 |  K=3 |  K=4 |  K=5 |  K=6
    -----------------------+------+------+------+------+------+------
     cache[field][id][key] | 4488 | 4488 | 4488 | 4488 | 4488 | 6536
     cache[field][key][id] |  888 | 1536 | 2184 | 2832 | 3480 | 4256

Moreover, some memory operations are performed on many records and a
single context key.  Those operations are clearly simpler and faster
with the second cache structure.
2020-07-24 08:30:00 +00:00
6c29ed3d42 [MERGE] *: rewrite search panel with OWL
The first aim of the present work consists in the conversion of the SearchPanel widget to a OWL component.
Along the way we have introduced many changes/novelties in the js framework, most notably in the class Model (module addons/web/static/src/js/model.js).

Here is a more detailed account of what has been done:

- Model (and ModelExtension): refactoring of the Model class to support multiple extensions.
  The purpose is to build a model having the appropriate extensions (or plugins) for a
  given situation. The control panel model has now become an 'extension' (ModelExtension instance)
  of a 'search model' (Model instance). That extension manages the filters/groubys/favorites statuses
  and is added only when a control panel is used by a view/action. The search model itself generates the domain,
  contexts, groupbys,... using the different parts coming from the added extensions. That model is meant to
  replace the view model in the long term. It might however need some improvements to hold such a role
  (partial interface rendering, etc.).

- SearchPanel: the previous search panel widget has been divided in 2 parts:

  1.  a SearchPanel part: a component whose responsibilities are now to render the
  search panel data given by its corresponding model extension, display some rendering logic
  (expanded categories, checked groups) and dispatch the events triggered on it.

  2. a SearchPanelModelExtension part: a model extension that holds all the search logic of the
  search panel. Its responsibilities are calling the server to update its
  data and to provide them to the search panel component and the other search extensions via the
  search model.

- LunchModelExtension: conversion of the LunchModel to a proper model extension.
  The lunch "location" logic (locationId and userId) has been transferred to a new model extension
  (LunchModelExtension) which provides an additional domain part to the global query.

- Registry: before this commit, any value could be added to a registry and the class
  needed to be overridden to assert that an added value would have some properties.
  Now, a registry can be instantiated with a given predicate function that all added values
  must "pass" to be registered (default: all values are accepted). This has been introduced here
  in order to be able to control the type of extensions added to a given model.

Task ID: 2228968

closes odoo/odoo#49899

Related: odoo/enterprise#10096
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-24 10:50:04 +02:00
Odoo's Mergebot fb3cd348c8 [FW][MERGE] event_*: prepare EventOnline with fixes and bugprovements
RATIONALE

Even will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff.

PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATIONS

Prepare some cleaning in sales_team / event common test files in order
to ease new tests writing.

Provide fixes for event after some testing in 13.3

Update demo data, notably to prepare future Event Online support.

See sub commits for more details.

LINKS

Task ID 2289148 (Event Bugprovements)
Prepares Task ID 2283796 (Event B2Basics)
Prepares Task ID 2252655 (master Online Event task)

closes odoo/odoo#54794

Forward-port-of: odoo/odoo#53956
Forward-port-of: odoo/odoo#53944
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-24 09:39:58 +02:00
382b8f5e1a [IMP] (website)_event_(track): improve and add demo data
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATIONS

As new Online Event feature is about to land new and improved demo data
is necessary to showcase it.

Add a new event for demo data that will be used to showcase the "online"
features to be added soon. Add some interesting demo on it: tags, tracks,
sponsors, ...

LINKS

Task ID 2289148 (Event Bugprovements)
Prepares Task ID 2252655 (master Online Event task)
Prepares Task ID 2283796 (Event B2Basics)
PR #53944

X-original-commit: 553e835eb87a750312bed8e188b3ba82e811f7cc
Co-authored-by: Aurélien Warnon <awa@odoo.com>
Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-07-24 06:54:35 +00:00
Thibault Delavallée 54f5c14a3f [REF] website_event(_track): improve customize menu widget to ease inheritance
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATIONS

Rewrite customize menu widget in website_event to ease inheritance and adding
new menu option in a near future. We plan to add an exhibitor menu for sponsors
that should be configurable like other event menu entries.

LINKS

Task ID 2289148 (Event Bugprovements)
Prepares Task ID 2252655 (master Online Event task)
Prepares Task ID 2283796 (Event B2Basics)
PR #53944

X-original-commit: ad0cbc86769ec0ab56e4af6ee4058bc4289412b3
2020-07-24 06:54:35 +00:00
Thibault Delavallée 785d98bfbe [FIX] event: fix event creation with demo tickets
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATION

Currently tickets demo data are not correctly created as they mess up with
automatic ticket computation from event_type configuration.

Solution is to flush event creation. It means tickets default configuration
is computed. Afterwards tickets are created in demo and avoid clashing with
the compute in cache.

LINKS

Task ID 2289148 (Event Bugprovements)
Prepares Task ID 2252655 (master Online Event task)
Prepares Task ID 2283796 (Event B2Basics)
PR #53944

X-original-commit: 6b5ec74b3d9bc008c95a92e7fa954675ae506d1a
2020-07-24 06:54:35 +00:00
Thibault Delavallée 460fd55097 [FIX] event: fix tags not correctly defined in xml
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATIONS

Currently no tags are set on demo data due to strange construct of eval
and ref. This commit fixes those strange demo definitions.

LINKS

Task ID 2289148 (Event Bugprovements)
Prepares Task ID 2252655 (master Online Event task)
Prepares Task ID 2283796 (Event B2Basics)
PR #53944

X-original-commit: b2b53a6ca02e3e9f51b665bd24cc1d2fee0dc3b9
2020-07-24 06:54:35 +00:00
Thibault Delavallée 2af57b8bb9 [FIX] event: do not erase existing tags when changing category
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATIONS

If an event has tags, changing its category resets them. We consider that
a category should update an event but not force or reset event tags, only
give default values.

LINKS

Task ID 2289148 (Event Bugprovements)
Prepares Task ID 2252655 (master Online Event task)
Prepares Task ID 2283796 (Event B2Basics)
PR #53944

X-original-commit: 408bad96de293dc10a3aa78fcee6159d8012fadc
2020-07-24 06:54:34 +00:00
Thibault Delavallée ea7a8f2747 [FIX] website_event_track: do not reset url when changing partner
When changing customer on a sponsor, update website only if defined on the
partner. Otherwise you may reset valid website value with a void value which
is not what people expect. Partner gives a default value but fields are not
completely synchronized.

Follow up of 532c2b44ff

closes odoo/odoo#54867

X-original-commit: 2a47d91703e379d905f457e56482e6e152b4da15
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-23 18:10:46 +00:00
root 98b0f01fc5 [FIX] payment: mask payment method keys in onboarding dialog
Before this commit the tokens from payment providers (PayPal, Stripe) are shown in plain text in the onboarding wizard.
This means that anyone with accounting rights can grab & copy tokens for PayPal & Stripe.
After this commit they're shielded off with a password=True option so they're not directly readable and copyable.

Steps to reproduce: Open an Odoo instance, go to Accounting > Invoices and click on the 'Set Payments' option for the onboarding wizard.
Next choose Paypal or Credit card in the dialog and see how tokens are shown in plain-text.

closes odoo/odoo#54861

X-original-commit: 65e201ecee3bc145c2ae76d59b6d2fd31c737872
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-07-23 15:41:13 +00:00
Victor Feyens 07bafcb792 [IMP] stock: correct default_get behavior
Leave the management of default_* context keys to the orm level.

closes odoo/odoo#54246

Related: odoo/enterprise#11754
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-07-23 16:38:17 +00:00
Victor Feyens 468f86e0c1 [IMP] snailmail: correct default_get behavior
1) Use a default_<fname> context key to give a default value and leave 
the management of the default to the orm level when possible.

2) Do not return unwanted default values in default_get override.
2020-07-23 16:38:17 +00:00
Victor Feyens addffca423 [IMP] delivery: correct default_get behavior
When a fields default value depends on another default, this value 
should be computed in a default_get override, not in a default method 
specified on the field itself.

Furthermore, the management of default_ context keys() should be left to 
the orm level (better code understanding, localizing a behavior in one 
place instead of multiple places).
2020-07-23 16:38:17 +00:00
Victor Feyens 5dc8b7bdd8 [IMP] *: replace default_get overrides by default attribute on fields.
Leave the generic management of fields default to the orm as much as
possible.

* Default method is not called unless necessary.
* Default values are correctly post-processed by the orm when necessary.
2020-07-23 16:38:17 +00:00
Victor Feyens 71ab12840b [IMP] *: do not specify unwanted defaults in default_get
When default_get is called, the wanted fields are specified through the
fields_list arg.  It is useless to fill the values for unwanted fields.

As default_get is called for nearly all records creation, simplifying
the default_get overrides:
* remove potential wrong side-effects of the values
* remove some useless or wrong  defaults computations (searches, refs,
...)
2020-07-23 16:38:17 +00:00
Victor Feyens c69a092b98 [IMP] doc: _inherits usage warnings
The delegation inheritance is very useful in some cases,
but its usage shouldn't be encouraged.

Furthermore, chained _inherits may result in unexpected
behavior/results,
and really shouldn't be used.

closes odoo/odoo#54864

X-original-commit: 4a06a4c79e962906832f98147fe87a2c19efaa75
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-07-23 16:18:11 +00:00
Alexandre Kühn 8528f45997 [FIX] mail: no crash on search partner from new message chat window
closes odoo/odoo#54852

X-original-commit: 64824c3a07908f601390646701bef7605f053455
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-23 14:48:08 +00:00
Victor Feyens e8893f84ab [IMP] *: translations improvements
Avoid concatenation of translated strings & raw values and/or other 
translated values, and use the new _ API (by providing the formatting 
values to ensure the fallback on the english terms in case of wrong 
translation).

By including the expected values inside the string to translate, we 
ensure that the formatted values are included at the right place in the 
resulting translated text.

This also provides more information on the string to translate to 
the translators, s.t. the chosen terms for the translations can be more 
adapted to the translation context.

closes odoo/odoo#54635

Related: odoo/enterprise#11925
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-07-23 12:13:19 +00:00
Julien MougenotandMathieu Duckerts-Antoine d3dd7b24b0 [IMP] *: adapt tests to Owl search panel
Adaptation of the tests to the changes regarding the refactored search
panel and model.

Part of task 2228968

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-23 08:21:10 +00:00
Julien MougenotandMathieu Duckerts-Antoine bb3bc7c9e4 [IMP] *: adapt modules to Owl search panel
Adaptation of the rest of the environment to the changes regarding the
refactored search panel and model.

This commit includes the following changes:

- Since the control panel model is now part of the search model, the
view widget is responsible of its instantiation with the appropriate
API; creating an ActionModel holding the required model extensions.

- The controller is now importing/exporting the state of the entire
search model as well as the current state of the search panel (given
throught its props). Changes have been made to adapt to this behaviour.

- The multiple components linked to the control panel model have been
adapted to reflect the changes brought to it (they will now listen to
the "searchModel" instead of the "controlPanelModel").

- The `test_utils_create` methods have also been adapted to properly
instantiate a searchModel

Part of task 2228968

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-23 08:21:10 +00:00
Julien MougenotandMathieu Duckerts-Antoine 3162141e4d [IMP] lunch: Conversion of model to extension
Conversion of the lunch kanban model to a proper search extension.

Now that the view search model supports model extensions, it has become
more convenient to provide additional domain informations by appending
new extensions.

This is why the lunch "location" logic (locationId and userId) has been
shifted to a new model extension ("Lunch Model Extension") which
provides an additional domain part to the other search extensions.

Part of task 2228968

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-23 08:21:10 +00:00
Julien MougenotandMathieu Duckerts-Antoine 7ff2e5822f [IMP] web: Search panel Owl
Refactoring of the search panel and its inner logic to Owl.

The previous search panel widget has been divided in 2 parts:

1. Component
The "Search Panel" component's responsibilities are now to render the
search panel data given by its model, display some rendering logic
(expanded categories, checked groups) and dispatch the events triggered
on it.

2. Model Extension
The "Search Panel Model Extension" holds all the search logic of the
search panel. Its responsibilities are calling the server to update its
data and to provide them to its component and other search extensions.

Part of task 2228968

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-07-23 08:21:10 +00:00