Commit Graph
143436 Commits
Author SHA1 Message Date
Jorge Pinna PuissantandLucas Perais (lpe) 36e03d1b98 [FIX] web: take into account the view flags
Co-authored-by: "Lucas Perais (lpe)" <lpe@odoo.com>
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) ce4e6bd4b1 [REF] web: date-picker design revamp 2021-06-18 21:31:28 +02:00
stefanorigano (SRI) 8c55713dcc [FIX] web: tempusdominus lib assets order
Allow to customize tempusdominus's default variables moving its assets
at the end of the bundle.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) abab4685dd [REF] web, base: settings page, design adaptations
Use predefined variables rather than arbitrary values, fix minor
alignment issues.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) 09dbf43a63 [FIX] base, web: settings page, use breadcrumb for title
Use .breadcrumb class to ensure that the page title design will match
all the other pages.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) 3798dd0ccd [REF] hr_holidays: minor design adaptations 2021-06-18 21:31:28 +02:00
stefanorigano (SRI) 8b00422ab8 [REF] web: pivot_view, design adaptations 2021-06-18 21:31:28 +02:00
stefanorigano (SRI) f720585557 [REF] web: calendar_view, design adaptations 2021-06-18 21:31:28 +02:00
stefanorigano (SRI) bc26f6c5ec [REF] web: 'o_status' dropdown design
Design using native classes and increase size if rendered into a
form_view.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) e59f6dbbd9 [REF] web: list_view design adaptations
Adjust border and text colors, improve the 'selection box' using native
classes.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) b66ccbd341 [FIX] web: control_panel, design minors
Use $border-color rather than an arbitrary value.
Decrease navigation buttons horizontal gap and adjust margins.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) 298d8bbfbd [FIX] web: form view, hide empty statistics data
Hide empty statistic fields to avoid forcing a "two lines layout" when
it's not necessary.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) dca874b2bf [REF] web: form_view design adaptations
Style using as much as possible predefined variables rather than
arbitrary values. Review status arrow buttons design and increase
overall text's contrast.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) 23f26c240e [REF] web: kanban_view design adaptations
Style using as much as possible predefined variables rather than
arbitrary values. Adjust cards ':focus' state to match other
components and avoid misleading shadows.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) 50f22a2b24 [REF] web: review custom backgrounds and custom 'btn-link' design
Drop custom 'bg-X-full' classes since we can now achieve the same visual
result using default 'bg-X' classes (it was not the case with prev.
bootstrap versions).

Ensure text readability for both 'bg-X-light' and 'btn-link' classes.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) d9a0877096 [REF] web, mrp: drop custom text decoration classes
Drop custom text decoration classes in favor of default bootstrap ones.
2021-06-18 21:31:28 +02:00
stefanorigano (SRI) 1971bf3981 [REF] web, website: refine and simplify dropdown design
Prior to this commit, Bootstrap dropdowns, jQueryUI dropdowns and Odoo
dropdowns where styled independently leading to visual inconsistencies
and code repetition.

This commit will customize and improve the Bootstrap design using as
much as possible predefined variables. Then it will simply '@extend'
owl/jQueryUI classes in order to visually match the bootstrap ones.

Since dropdown classes are used in the top-menu (and its design is
partially shared with frontend apps), this commit provides the necessary
adaptations for this component as well.
2021-06-18 21:31:27 +02:00
stefanorigano (SRI) b389d38a36 [REF] web: optimize scss variables declaration
Mirror web_enterprise variables declaration to ease enterprise's
overrides. Reorganize variables in order to keep a consistent assignment
structure across versions.

This commit will also add '!default' flags in boostrap_overidden.scss,
allowing enterprise to reuse customization already defined in community.
2021-06-18 21:31:27 +02:00
+1 14bffd983e [REF] *: adapt code to new owl webclient
This commit adapts the community codebase to the rewriting of the
/web application in owl.

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2021-06-18 21:31:27 +02:00
Samuel Degueldre 2587a16835 [FIX] hr_timesheet: convert include on AbstractWebclient to service
In timesheets, which widget should be used to display durations depends
on the company's unit of measurements.

Previously, this was done by overriding the webclient's init method,
where we could check the company's UOM and insert the appropriate field
widget in the field widget registry.

In wowl, the extension mechanism that was used (include on webclient) no
longer exists, as such, this is now done in a service that is started by
the webclient during it's initialization, and as such, happens
essentially in the same part of the webclient lifecycle, but no longer
needs to patch the webclients internals.
2021-06-18 21:31:27 +02:00
Samuel Degueldre a3c69db9ef [FIX] board: replace include on ActionManager with override on view
When opening the dashboard in form view, some of the view options should
always have a certain value (in particular, the target should be inline,
and the form view should not have action menus or a control panel).

Previously, this was done through an override on the action manager when
executing a window action. In wowl, the action manager has been replaced
with an action service and its methods cannot be overriden.

This commit solves the same problem with a different approach, by
overwriting these options before trying to extract the view params from
the action.
2021-06-18 21:31:27 +02:00
Bruno BoiandFrancois 3a4f1c31de [IMP] web: add hotkey and command services
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
2021-06-18 21:31:27 +02:00
+1 0573acae23 [REF] web: rewrite the webclient in OWL (phase 1)
This commit is the first phase of the conversion of the web/ JS
codebase to the owl framework. The impact of this commit is two-fold.

First, it rewrites the framework part of web with a new system of
services and registries. Services allow to execute code (e.g. do rpcs,
setup things) before launching the application. They can also expose
an API to be used by other parts of the application (e.g. a notification
service would expose a function to display notifications). Services are
often a good extension point for external modules that want to execute
code at webclient startup. Registries offer another way to extend the
application. They provide well designed extension points to add
elements/behaviors from the outside (for instance, to add a systray item,
an error handler...).

Second, this commit initiates the conversion of the webclient to owl
with a top-down approach, around those notions of services and registries.
The root of the web application is now an owl application. Among others,
the WebClient, ActionManager, Navbar, UserMenu, DebugManager, Dialogs,
services (e.g. notification, ajax...) have been converted to the new
framework/architecture.

Legacy views and client actions are still supported (and used). They
will be converted in the next months, and at some point, the support
will be dropped.

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2021-06-18 21:31:27 +02:00
Simon Genin (ges) 8d57a5cde9 [ADD] web: prettier and eslint tooling
Provide an opt in js tooling system by adding a node env with prettier and eslint configured.
3 bash scripts are provided: enable.sh, disable.sh and reload.sh.

Enable.sh: add to the community root (and optionaly to the enterprise root) the env.
Disable.sh: remove the env.
Reload.sh: disable then enable.
2021-06-18 21:31:27 +02:00
Aaron Bohy 84a4859570 [REF] web,*: move legacy files
To prepare the rewriting of the webclient in owl, we move all
current js files of web in a legacy/ folder. This folder will
eventually be removed, as soon as each file it contains will be
converted to owl and moved to the proper place in the new file
structure.
2021-06-18 21:31:27 +02:00
Aaron Bohy 2e30e4237a [REF] web: manifest: simplify assets_backend 2021-06-18 21:31:26 +02:00
oco-odoo 69b0b55342 [FIX] account: cash basis taxes: fix the case where an invoice has the same taxes on a negative line
To reproduce:

- Create a cash basis tax
- Make an invoice with two lines, a positive and a negative one (the positive having a higher value), both using this tax
- Post the invoice and register a payment for it

===> It crashes when registering the payment. The SQL constraint ensuring debit/credit consistency fails when creating the cash basis entry.

This is because we were not grouping debit and credit values together on the lines sharing the same taxes; we were summing them separately. The cash basis entry then received line values with both credit and debit set, which is forbidden by the SQL constraint. We now compute the balance first, and set either debit or credit depending on its sign.

closes odoo/odoo#72383

X-original-commit: 896496d84413e7bb5e5df582e2b67eae2583671b
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-06-18 18:15:38 +00:00
Anh Thao Pham (pta) c047c85208 [FIX] base,web: fix display of images of contact's children upon change
Scenario:
- Go to Contacts
- Open a contact
- In "Contacts & Addresses" tab, add a child and configure its image
- Once child form is saved, image of the child is not displayed in the
kanban view used for children
It will only appear once the main contact form is saved.
The same issue occurs when editing a child image.
The new image will only be shown once the main contact form is saved.

The issue at the creation is due to the fact the function retrieving
the URL of the image tries to generate the URL from record id, which
is not set.  It should use raw data of image in this case.

For the edition, it is due to the fact that the child form is changing
image_1920 field while the kanban view used for children is displaying
image_128 field.  image_128 is a related field to image_1920, but it
does not appear in the child form.  It is therefore not recomputed (by
onchange) when image_1920 is modified.  Adding it in the child form view
solves the issue.

opw-2516188

closes odoo/odoo#72375

X-original-commit: 7eac23573c77415c84cb9c234c8063d4c68be425
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-06-18 16:38:08 +00:00
Géry Debongnie fa623399ad [IMP] web: update owl from 1.3.1 to 1.3.2
This update contains a fix about owl error handling.

Release notes: https://github.com/odoo/owl/releases/tag/v1.3.2

closes odoo/odoo#72374

X-original-commit: ea063e58030a5fbaf5c4779a58f07b5eab426099
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 16:31:57 +00:00
Nicolas Lempereur 4aa89f146e [FIX] website_slides: can edit frontend enroll message
The frontend enroll message was display as a `<small/>` tag, but it
seems that lxml HTMLParser parse it wrongly, for example:

  html.tostring(html.fromstring('<small data-oe-model="test"><p></p></small>'))

returns:

  '<div><small data-oe-model="test"></small><p></p></div>'

So branding attributes like data-oe-model that are on small tag are not
found on root node that has become a `div` tag after parsing => this causes
a traceback error when saving a change in this part.

Fix: use small as wrapper for `<div/>` tag that is treated correctly by
HTMLParser (span is also treated correctly but div makes more sense
here).

opw-2573955

closes odoo/odoo#72315

X-original-commit: 6334c7282c19362ca8bc79dbaefe3d38c055e746
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-06-17 18:37:44 +00:00
Arthur Detroux (ard) f3d840d1a6 [FIX] mass_mailing: make editor perform cleanForSave on save
Before this commit, when editing a mass_mailing template, on save,
the editor would not tell the snippet menu to perform a cleanForSave
which it should normally do for the option to properly prepare to save.

Bug discovered while working on task-2327045
Ideally, would need to be backported but requires a different fix in the
old editor.

closes odoo/odoo#72346

X-original-commit: 639b6a55586107bd3d855d322c1102df101eb079
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-18 12:08:45 +00:00
Aurélien (avd) 54e06aa28d [FIX] account: Fix reconciliation with multi-currencies but balance = 0
This commit fixes the case when the reconciliation never ends due to an infinite loop.
This happens when we attempt to reconcile two journal items having differents foreign currencies but an amount_residual = 0.0.
In that case, partials are created everytime with zero amount, zero debit_amount_currency and zero credit_amount_currency.
We don't need to handle such reconciliation because exchange difference journal items are always created using the same foreign currency as the originator line.

The way the reconciliation is made for reversal moves is also edited by this commit to avoid reconciling lines on the same moves but with different currencies.

closes odoo/odoo#72266

X-original-commit: 1231d54b8c2084db6ffb9551af7ed4ee9e31a95a
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-06-18 12:22:05 +00:00
Anh Thao Pham (pta) 9ea04fa4b2 [FIX] account: fix taxes set on invoice sections & notes at creation
When adding a section or a note on an invoice, default taxes are set on
the account move line, making the corresponding Tax Group to appear on
the invoice.

opw-2541722

closes odoo/odoo#72337

X-original-commit: a8d3f466dfffca08214acecf08ec298e3ace6272
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-06-18 10:40:07 +00:00
xO-Tx 79685b5bdf [FIX] tools: keep image option related attributes
- Change an image option in mass mailing editor (e.g. Quality)
- save
- edit -> The option can't get the new applied value.

The body_arch's field used in mass mailing editor is
sanitizing attributes and as a consequence, option related data
attrs are removed on save.

task-2327045

closes odoo/odoo#72311

X-original-commit: 7c5666611363a73bc6fef070565039cf065a0176
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-17 16:26:16 +00:00
Oussama MESSAOUDI 0f7fda60d0 [IMP] website: improve items snippet
- New and multiples pictures
- Empty URL instead of odoo.com by default

task-2471323

closes odoo/odoo#70528

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-17 14:39:43 +00:00
Antoine Vandevenne (anv) 1f0a6167d6 [FIX] payment_{ogone,payulatam}: use the document name in the reference
Before this commit, the implementation of Ogone and PayU Latam's
requirements regarding the transaction reference was preventing the
computation of the reference prefix from being based on the related
document (invoice, SO).

This commit attempts to compute the reference based on the document if
no reference prefix is provided, before applying the said requirements.

task-2494916

closes odoo/odoo#72291

X-original-commit: f18a1d67b769ea69a07fb3c0343e092038df5c93
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-06-17 13:32:07 +00:00
Stéphane Debauche 5813242fe0 [FW][FIX] crm: dot not sync the phone / email from False to an empty string
Bug
===

1. Create a new database from the database selector
2. Do not select a country for your company
3. Install CRM
4. Create a new opportunity and select your company
5. The sync "warning" will be displayed, and it should not

The reason for that is the phone of the company is an empty string and the
phone of the lead is False. So we try to sync them and we show the warning
message even if for the user, nothing will happen.

This commit fixes that behavior by correctly checking that False / empty
strings are considered as equal.

UPDATE

In this commit we also display warnings about update only in edit mode to
avoid displaying irrelevant information to the user. Indeed email and phone
will be propagated at save, aka in edit mode.

TaskID-2499659

closes odoo/odoo#72286

X-original-commit: efea8fce6c7cb6e40b590cd827fe22e134cc3d13
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-17 12:38:34 +00:00
Victor Feyens 2e3dac8da0 [IMP] *: do not filter the taxes twice for nothing
Since _filter_included_tax_company filters the taxes of other companies,
there is no need to give taxes from other companies if the filtering was
already done.

closes odoo/odoo#71591

Related: odoo/enterprise#18670
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-06-17 12:14:36 +00:00
Victor Feyens 7ab7bd92ea [FIX] point_of_sale: onchange call order
_onchange_qty should be called after the price_unit change to compute 
the amounts correctly.
2021-06-17 12:14:36 +00:00
Victor Feyens 9df95cb554 [FIX] pos,repair,sale(_*): multi-company taxes management
Since product can be shared between multiple companies, their taxes m2m
fields may hold taxes from multiple companies.  When working in sudoed
or multi-company environments, those taxes were incorrectly filtered and
taxes from other companies may erroneously impact records from other
companies.

This commit ensures that the product taxes are properly filtered to only
consider the ones from the current/record company.
2021-06-17 12:14:36 +00:00
Victor Feyens 2d43dc2afd [IMP] account,*: clean map_tax definition
product and partner parameters are leftovers of an older definition of
map_tax, and can now be safely removed.
2021-06-17 12:14:36 +00:00
Romain Derie 4a1c516b01 [FIX] *: search_view_id expects an id/name pair
Passing an id directly to `search_view_id` is not working. It is silently
ignored.
The framework js code expects an id/name pair, as described in the ORM doc.

Most of the time, this will be unoticed as the specified search view being
ignored, the default one will be used instead, which is often the same one as
there is only one search view.

Only 3 occurences are real misbehavior.

Note that the `name` of the pair is useless, you can just pass the ID in an
array.

Working:
'search_view_id': [123, 'search'],
'search_view_id': [123],

Not working:
'search_view_id': 123,

closes odoo/odoo#72247

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-06-17 10:38:18 +00:00
Jeremy Kersten 1dccc0bc81 [FIX] base: avoid crash due to generation of key with model
Until now, when you create a view of type qweb with a model, we use the model
as first part to generate the key. Since this model can contains dot, it is
wrong and we got some key like ir.ui.view.gen_key_xyz

This bug has been seen with commit ee8756b311
which make the installation of website & sale_timesheet impossible in dev mode.

  File /home/odoo/addons/base/models/ir_ui_view.py, line 294, in _compute_arch
    arch_fs = get_view_arch_from_file(fullpath, xml_id)
  File /home/odoo/addons/base/models/ir_ui_view.py, line 166, in get_view_arch_from_file
    module, view_id = xmlid.split('.')

  Too many values to unpack

Now we never try to make key beautiful. At first view it doesn't bring any
advantage, but only bug.

closes odoo/odoo#72238

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-06-16 14:08:08 +00:00
Goffin Simon c31b688f66 [FIX] mrp: Unbuild serial number
When a serial number SN is trying to be consumed and has been unbuilt in the past,
an evaluation is used to check that the # of times SN was unbuilt is equal to
the # of times SN was consumed. However, when counting the unbuild SN it did not take into account if
it was from an unbuild order.

opw:2510294

closes odoo/odoo#72272

X-original-commit: 47d6ff49b19e68d84a68d8c4b999cb6115398805
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-06-17 10:36:18 +00:00
Patrick Hoste afd250d825 [IMP] website_event_exhibitor: display only published sponsors in sponsor footer
Purpose is to have sponsors always behaving like other website records, aka
not published are not displayed. It allows manager to create sponsors without
having them displayed on frontend while not completely ready to do so.

Add field in search as well as in form view, allowing to better distinguish
sponsors ("display in footer") from exhibitors (classic website published
button with redirection to frontend page).

Task ID-2558875
PR odoo/odoo#71787

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-17 11:06:49 +00:00
Thibault Delavallée 9a479f5ef6 [IMP] website_event_exhibitor: improve sponsor type management
Choose lowest sponsor type as default when creating a new sponsor. Purpose
is to avoid being blocked by required fields. Choosing the lowest available
sponsor type allows to ease discovering the feature without breaking any
feature.

Also set a default sequence when creating a sponsor type to avoid jump
effect on list view: always send new sponsor types at the end.

Also set default ribbon as no ribbon to avoid a "void" entry in ribbon style
when creating new sponsor types.

Task ID-2558875
PR odoo/odoo#71787
2021-06-17 11:07:09 +00:00
Patrick Hoste 54e8a81809 [FIX] event_sale: correctly use event_ok instead of event_id for event-based SO lines
When confirming a sale.order that includes a product that is either an
event registration or an event stand it shows the event edit registration
wizard which has no sense for the event stand part.
Fix the event_configurator_tour since the autocomplete showed the wrong
product at the first place.

The test was based on the event_id field of the sale.order.line but should
be based on the event_ok field instead.

Also add more text to the tour so the autocomplete shows the right product
at first place.

LINKS

Task ID-2318655
Task ID-2558875
PR odoo/odoo#71787
2021-06-17 11:06:49 +00:00
Romain Derie 819725c725 [FIX] sale_coupon: align stat button with act_window results
Before this commit, the number you saw on the stat button was not always
the same as the number of sale order you would see when you clicked on it.
Indeed, there was a domain force on the action to only show confirmed orders,
while the stat button was counting quotations too.

Fixed #70911

closes odoo/odoo#72249

X-original-commit: 79afc80e5b4f45c6bc716f55a21f8a2b478e49f6
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-06-16 18:13:04 +00:00
Djamel (otd) ff29ec7064 [FIX] website_slides: hide the "Go to website" button if the slide is not saved
Steps to reproduce the bug:
- Go to Elearning > choose any course or create a new one
- Click on “add content” :
    - Add a title to slide
    - Click on "Go to Website"

Problem:
An error is triggered because we call the "create" method to save the slide, which tries to access the “channel_id”, the course ID in which the slide will be added. However, the field is not set in values.
The "create" or "write" function in "slide_channel" must first be called to save the course, which will then call the create function in "slide_slide"

Solution :
Hide the "Go to website" button as long as the course is not created and therefore has no id

opw-2526541

closes odoo/odoo#72199

X-original-commit: e412ba4898e35c8519adafb05407bdb78f311c09
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-06-15 18:31:14 +00:00
Romain Derie 3a05934cb9 [IMP] website: hide link preview when typing on mega menu
The link preview is a bit messy inside a mega menu.
Hiding it during typing clears the UI.

task-2566651

closes odoo/odoo#72009

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-16 13:46:47 +00:00