Commit Graph
140385 Commits
Author SHA1 Message Date
svs-odoo febab23203 [FIX] stock: missing company id on picking move
When creating a new picking, in case the user creates stock.move before
define the picking type, the move has no `company_id`.
Also, if they changes the picking type for an another company picking
type, the `company_id`of the move already created doesn't corresponding
anymore to the `company_id`of the picking anymore.

So, when create a new picking, we now insure the write the `company_id`
of new stock.move to be sure these cases was handle.

closes odoo/odoo#37130

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-20 08:45:09 +00:00
Odoo's Mergebot f1aa96b0a8 [MERGE] web: Re-implement the XLS grouped export
Purpose
=======

The commit 2849b5c introduces a new export mechanism of grouped
list views to xls files.

The issue with this development is mainly that the displayed records
are exported, instead of all the records that match the search
parameters.

To export all the records we cannot rely on the data from the web
client. This implies to revert 2849b5c, and implement it in a better
way.

Functional Spec
===============

Add the support of grouped exports.
Allow the user to export all records in one click from
the listview, without having to go through the export modal,
taking into account the domain, groupbys, and visible fields.

Technical Spec
==============

When exporting (whether it is from the modal or from the shortcut),
any groupby(s) set on the listview should be taken into account (all unfolded)
- UNLESS the export is import-compatible
- each subgroup header has an indentation compared to its parent
- the 'group headers' in the exported file should contain the
  same info (label, field aggregates) as it has in the listview.

New secondary button on the tree view with label 'EXPORT' (to be confirmed...)
- the export shortcut disregard the selected records, it exports all records
  according to the domain.
- the button is visible even if there is no selected records.
- essentially the export shortcut does the same thing as the following:
    - select all records
    - hit 'action' then 'export'
    - hit 'export'

Define a boolean attribute on <tree> to specify whether or not the export
shortcut should be displayed

Task 2072910

closes odoo/odoo#37087

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-20 17:13:47 +02:00
Lucas Lefèvre 5c4544fb29 [IMP] web: Export grouped list view in xls file
PURPOSE
=======

Add the support of grouped exports.
Allow the user to export all records in one click from
the listview, without having to go through the export modal,
taking into account the domain, groupbys, and visible fields.

SPECIFICATION
=============

When exporting (whether it is from the modal or from the shortcut),
any groupby(s) set on the listview should be taken into account (all unfolded)
- UNLESS the export is import-compatible
- each subgroup header has an indentation compared to its parent
- the 'group headers' in the exported file should contain the
  same info (label, field aggregates) as it has in the listview.

New secondary button on the tree view with label 'EXPORT' (to be confirmed...)
- the export shortcut disregard the selected records, it exports all records
  according to the domain.
- the button is visible even if there is no selected records.
- essentially the export shortcut does the same thing as the following:
    - select all records
    - hit 'action' then 'export'
    - hit 'export'

Define a boolean attribute on <tree> to specify whether or not the export shortcut should be displayed

Task 2072910
2019-09-20 16:18:35 +02:00
Lucas Lefèvre 2849b5cb39 Revert "[IMP] web: Export list view as XLS file"
This reverts commit ac00548b28.
2019-09-19 14:00:49 +02:00
RomainLibert 02599afd49 [FIX] hr: Rename Gilles Gravie
closes odoo/odoo#37122

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-19 09:38:49 +00:00
Josse Colpaert cfae528e53 [FIX] l10n_ro: states were moved to base
closes odoo/odoo#37115

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-09-19 08:37:22 +00:00
Samuel Degueldre 16f23e8246 [FIX] web: fix m2mtags widget to be able to use 'SAVE & NEW'
PURPOSE

Previously when the 'SAVE & NEW' button was pressed in the 'create and
edit...' menu of the many2many_tags widget was pressed, the modal window
would close and the button would act exactly like the 'SAVE & CLOSE'
button. This was due to the fact that whenever a new record was created
and added to the field, it would reset the many2one field it uses for
display, which would destroy the edit modal.

This commit fixes that by not notifying the underlying many2one field of
any change until the modal is closed by the user. This has the
disadvantage that tags display, if visible behind the modal 'shade',
will not be updated until the modal is closed, but restores the
functionality of the save&new button. It also adds a test for this
behaviour

task-2070454

closes odoo/odoo#37114

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-09-19 08:48:41 +00:00
Mathieu Duckerts-Antoine 3e21daaf45 [IMP] web: ctrlKey option in dragAndDrop
The gantt view allows the dragged pill to be copied when
the key ctrl (or command) is pressed. In order to be
able to test that feature, we had to modify
testUtils.dragAndDrop. This is done in the present
commit.

closes odoo/odoo#37074

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-19 08:20:50 +00:00
Martin TrigauxandRaphael Collet 948ce04649 [FIX] sql_db: retrieve correct environment
When creating a new database from the database manager, with no open
cursor, the wrong env was retrieved during the cr.commit() call.

2019-09-09 18:16:07,454 19886 ERROR None odoo.service.db: CREATE DATABASE failed:
Traceback (most recent call last):
  File "/home/odoo/odoo/service/db.py", line 60, in _initialize_db
    cr.commit()
  File "/home/odoo/odoo/sql_db.py", line 165, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/odoo/sql_db.py", line 389, in commit
    env = get_env(currentframe(), 2)
  File "/home/odoo/odoo/sql_db.py", line 72, in get_env
    env = getattr(frame.f_locals.get('self'), 'env', SENTINEL)
  File "/home/odoo/odoo/http.py", line 268, in env
    self._env = odoo.api.Environment(self.cr, self.uid, self.context)
  File "/home/odoo/odoo/http.py", line 238, in cr
    raise RuntimeError('request not bound to a database')

get_env method checks every frame to find a variable called 'env'

As none was found, it used the one of the WebRequest object.
In a WebRequest, env is a property that will try to create a new
Environment, which fails as no database is available (yet).

At eafdf1812d the iteration on Environment.envs was removed as envs
is a weakset and it introduced potential errors where the content was
garbage-collected during the iteration.

Go back to the simpler iteration but convert the set to list to avoid
garbage-collection issues.

Fixes odoo/odoo#36588

closes odoo/odoo#37005

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2019-09-20 12:25:06 +00:00
Julien Mougenot fd3c382186 [FIX] web: field color: adapted for views
The FieldColor widget had been designed exclusively for the document
layout configurator. Because of this, the widget would not display/behave
correctly in other views.

Before this commit:
- in list views, the widget had a "white-space" attribute adapted for char fields,
which gave it much more space than it needed
- there was no handling of the widget in readonly state: it was always editable
- its size in list views was a bit too large

Now:
- all styling problems have been adjusted for list views (unchanged for forms)
- the widget is disabled when in readonly mode

Task 2072466

closes odoo/odoo#36949

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-20 07:28:17 +00:00
Odoo's Mergebot 8901146b91 [IMP] web: multiple improvements on datepicker
* Changed the default value of datetime to "is between" with "today"
as the default value (same day 00:00:00 to 23:59:59).
* Changed the style of the "Close" button to match the one on the "primary buttons".
* added increments to the minutes in daterange
Minutes can now be chosen by increments of 5 instead of 10.

Task 2068164

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

closes odoo/odoo#36775

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-20 17:13:28 +02:00
Xavier ALT c5fa4771fc [FIX] fields: default to ondelete='cascade' for required m2o fields on transient
TransientModel (wizards) can be annoying because if they have required
many2one fields, those fields will default to `ondelete='restrict'`,
preventing user to delete the comodel records without deleting the
transient model records first.

To improve such case, we default to `ondelete='cascade'` for required
many2one field on a TransientModel (unless specified otherwise)

closes odoo/odoo#36738

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-20 12:23:09 +00:00
Gorash fa6dcc7332 [FIX] web_editor: fix add/remove columns in table
closes odoo/odoo#37079

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2019-09-19 07:40:47 +00:00
Gorash 42df7f84a4 [FIX] web_editor: checkbox without text change can now be checked 2019-09-19 07:40:47 +00:00
Gorash d1f25b178a [FIX] web_editor: recursive checkbox check
In multi-level checkboxes, if there is only one checkbox per level, the
expected behavior is that all checkbox will be checked if one of them is
checked. This was not the case before this commit.
2019-09-19 07:40:47 +00:00
Gorash f7c2cb088c [FIX] web_editor: fix link style being lost on edit 2019-09-19 07:40:46 +00:00
Gorash 175c75b9b5 [FIX] web_editor: min-width for custom colors in color picker
The custom colors were displayed as a single column while it actually
had enough space to expand itself.
2019-09-19 07:40:46 +00:00
Gorash 65d0809786 [FIX] web_editor: prevent popovers from overflowing the editable
When setting align right on a picture, the popover of the picture was
partially overflowing the editable zone, rendering it useless.

This commit mimicks the behavior of Odoo 12 by disabling the fact
that the popover follows the picture.
2019-09-19 07:40:46 +00:00
Xavier ALT 5c1c092265 [FIX] base: flatten if ir.model.field.selection selection ids
The `get_technical_translations()` method was returning wrong list of list
for field selection values; instead we flatten the results to get a correct
domain.

closes odoo/odoo#37101

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-18 16:41:17 +00:00
Cedric Snauwaert 335d9d1210 [FIX] account: fix outstanding credit/debit widget not shown
If the journal is set to post entries at bank reconciliation, payment entries that are validated have their associated account_move in draft.
Or we still want those to appear in the invoices/bills as outstanding credit/debit.
This commit fixes this problem by adapting the domain used to fetch the payment lines that should be displayed as outstanding debit/credit.

closes odoo/odoo#37091

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-09-18 15:05:51 +00:00
Nicolas Lempereur d2f01f7cc6 [FIX] web_editor: re set style of custom color in editor
The style for custom color in the editor color menu from 12.0 was
dropped in 12.3 (correctly because of the changed structure) but in 12.5
the HTML structure changed again and the CSS is once again necessary.

opw-2073734
closes #37090

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-09-18 15:37:42 +00:00
Pierre Masereel 11b23d3771 [FIX] pos_discount: don't show multiple prices
When you add a discount, the price is changed on the product, and so
when you have enabled options to display the discount, the product is
shown as discounted. So we are modifying the lst_price too (like for
tip) to avoid having differences between prices.

closes odoo/odoo#37089

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-18 14:20:25 +00:00
Pierre Masereel ae2c10ec99 [FIX] point_of_sale: avoid tip price modification
When a tip is added, the price of the product is changed, and so we
don't want to recompute the unit price if quantity is changed.
2019-09-18 14:17:01 +00:00
wan ebbc9accae [FIX] account_facturx: posting a pdf on draft move
When a draft move is created and saved, we cannot post a pdf on it
anymore because facturx expects a default journal entry type to be in
the context in _import_facturx_invoice.
In this case, it is not in the context anymore because it has already
been saved on the account.move on which we try to post the pdf.

closes odoo/odoo#37055

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-09-18 14:07:38 +00:00
Kevin Baptiste 5b3509daaa [FIX] hr_holidays: filter Time off Analysis on active ids
Prior to this commit, the Time Off Analysis report was showing the
leaves of all employees and not the ones selected.

closes odoo/odoo#37048

Taskid: 2073345
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-09-18 13:50:05 +00:00
Julien Mougenot c49bd8dcdb [IMP] web: today as default filter for datetime
Changed the default value of datetime to "is between" with "today"
as the default value (same day 00:00:00 to 23:59:59).

Task 2068164
2019-09-18 12:05:33 +00:00
svs-odoo 75fa619f7c [FIX] repair: warning if negative quantity
Before this commit, you can start a repair order with negative value
into its operations (who will cause a dead end when user will try to end
it). So, now a check is done when user tries to start it.

closes odoo/odoo#37045

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-18 08:06:05 +00:00
svs-odoo dd45b5123d [FIX] repair: don't warns quantity for consumable
When user confirms a repair order for a consumable product, they always
get a warning wizard about insufficient quantity.
But as we don't track quantity for consumables, this wizard is useless.
2019-09-18 07:50:59 +00:00
svs-odoo 36b1843b43 [FIX] repair: forbids add service as repair parts 2019-09-18 07:50:59 +00:00
wan 8b24456ecf [IMP] account: change order of column of account.move.line trees
Task 2072312

closes odoo/odoo#37017

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-09-18 12:45:59 +00:00
wan 754d2ef6aa [IMP] account: review the keyboard navigation for the reconciliation widget
Task 2072312

* Ensure that the css is from Odoo and not from the browser
* Only use up/down to navigate
* Use Enter to validate a line
* Remove the accesskeys
2019-09-18 12:45:59 +00:00
wan dbd867eb8e [IMP] account: usability changes
Task 2072312

* Change the label "/" by "Draft <document type>" for draft entries (change name_get() of account.move)
* New left-bar menu for a chart of account & general ledger view: Take into account the company (for multicompany, avoid having  the number 7 if the current company doesn't have 7xxxa accounts)
* New filter "Accounts With Entries" for the chart of accounts
  Show only account which has at least 1 journal entry on it
* Show the move_id on the move line tree view
2019-09-17 15:42:30 +00:00
Odoo's Mergebot c3f6f1f262 [IMP] point_of_sale: Small changes to the POS Config view
An "iface_payment_terminal" field was present but never used. We
remove it.

Add a class on the list of IoT Devices to override it easily in pos_iot
and increase the width of the labels.

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

closes odoo/odoo#36495

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-09-18 18:01:53 +02:00
Antoine Prieels 9e11adcf9a [FIX] point_of_sale: Black receipts
Some parts of the receipts had a black background, making them
unreadable. The origin of this problem was that the white background
was not applied correctly to the whole receipt. The rest of the receipt
had a transparent background which was then changed to black when
converting the receipt to an image. The parts of the receipt that had
no background were the followings:

- The parts that were out of the screen if the receipt was too long.
We fix this by explicitly specifying a height when generating the
canvas.

- `html2canvas` applies the background to a rectangle starting from
(0, 0) up to (width, height). In our case, `body` has a margin of 8px.
Our receipt was then placed in a rectangle from (8, 8) to
(width + 8, height + 8).

closes odoo/odoo#37072

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-18 12:13:36 +00:00
jbm-odoo a5af052d67 [IMP] stock_sms: Fix non admin flow and improve first confirm box
Fix: A simple user is allowed to confirm sending sms wizard.
Improve SMS wizard: remove things about policiy and creation of
iap account.

closes odoo/odoo#37016

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-18 13:08:53 +00:00
Aaron Bohy eafe7eae79 [FIX] web: list: optional fields icon above resize handle
Because of the z-index, the resize handle of the last column was
over the optional fields dropdown icon, making it impossible to
click on. The z-index seems unnecessary, so we remove it.

Task 2067477

closes odoo/odoo#36987

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-18 11:31:43 +00:00
Aaron Bohy 7cb8f26726 [IMP] web: list: add test case
Thought there was a bug, but it's actually working fine, so no fix
needed, but the test is written (and it doesn't exist yet), so we
keep it.

Also fixes a selector to make an assert relevant in an existing
test.
2019-09-18 11:31:43 +00:00
Aaron Bohy 45eb9fca28 [FIX] web: MockServer: handle whitespaces in archs
Before this rev., the mocked fieldsViewGet treated whitespaces in
inline subviews as TextNodes, and processed them as subviews. As
a consequence, it crashed later on when the View tried to parse it.
2019-09-18 11:31:43 +00:00
Aaron Bohy 6c15557a87 [FIX] web: editable list: re-compute widths on window resize
This rev. adds a (debounced) handler to react on window resize
events in editable list views, in order to recompute the (fixed)
column widths.

Task 2067477
2019-09-18 11:31:43 +00:00
Julien Mougenot 8b6f3580d8 [FIX] web: list selectors synchronisation
Changed the way the header selector behave when the selection changes.

Before this commit, the header selector was only checked when clicked and
was unchecked as soon as any other record was unchecked.

Now, the header selector reflects the current visible selection:
if all of the other visible selectors are checked, it will be checked.

Folded records are not considered visible, thus only records from active groups
and from the current pager will be taken into account.

Task 2068280
2019-09-18 11:31:43 +00:00
Julien Mougenot 62452aad41 [FIX] web: handling of invalid formats in list views
Added handling of invalid format types in multiple edition in list views.

Before this commit, in multiple edition, a field that was edited with an invalid value format
(e.g. a numeric field receiving a string value) didn't trigger a field_changed and no prompt
was shown; the record was simply idle with an dirty value.

Now, the list controller also listents for set_dirty events and automatically triggers
an error modal + discards all changes when receiving one.
2019-09-18 11:31:43 +00:00
Vincent Schippefilt cc9467b750 [FIX] snailmail: support write with multiple records 2019-09-18 11:31:43 +00:00
Julien Mougenot ff9a0b87e6 [FIX] web: list: m2o doesn't trigger fieldChange when empty
Gives time to the user to enter an actual value in m2o in list views.

Before this commit, emptying a many2one field (selecting all > BACKSPACE or DELETE)
triggered instantly a field_change. This was an issue in multi edition as a field
changed triggered instantly a save on selected records without giving time to the
user to enter a new value.

Now, many2ones only trigger a fieldChange when selecting a new valid value.

Task 2068280
2019-09-18 11:31:43 +00:00
Aaron Bohy 708a5b6566 [FIX] web: list: multi edit boolean with ENTER
This rev. solves the similar issue as 801c603218, but with boolean
fields.

Scenario: select several records, select a boolean cell, press
enter to change the boolean value.

Task 2068280
2019-09-18 11:31:43 +00:00
Aaron Bohy c7ec4bb39d [FIX] web: list: multi edition: disable onchanges
Onchanges make no sense in multi edition as they would be computed
on the 'reference' record (the one use to edit), but applied on all
selected records. This rev. simply disables them in that case.

Task 2068280
2019-09-18 11:31:43 +00:00
Julien Mougenot 4fba43c027 [FIX] web: lists: focus last edited cell
Gave back focus to the last edited cell to increase usability with key nav.

Before this commit, after saving several records with multi edition in a list,
focus was lost (given to the body).

Now, last edited cell is given back the focus after multi editing.
2019-09-18 11:31:43 +00:00
Aaron Bohy 34e5271d7b [FIX] web: list: multi edit input of date(time) fields
The Date(Time)Fields listen to 'input' and 'change' events (like
all InputFields) to keep track of changes. However, the datepicker
already listens to the 'change' event. As a consequence, in multi
edition in a list view, if the user changed the value of a
date(time) field by directly editing the input, the fieldChanged
event was triggered twice, and there were 2 dialogs asking the user
if he wanted to save the change.

This rev. makes the Date(Time)Fields stop listening themselves to
'input' and 'change' events, and instead completely rely on the
datepicker widget.

Task 2068280
2019-09-18 11:31:43 +00:00
Aaron Bohy 38e7f6f95b [FIX] web: date(time) fields: trigger fieldChanged once
Before this rev., the 'fieldChanged' event was triggered each time
the user selected a value (a day, an hour, a minute or a second) in
the datepicker. This means that if there was an onchange on the
field, a lot of RPCs could have been done when a user set a
datetime. In addition, in a list view with multi edition, the user
was asked to save the changes at each step of the datetime
selection, making the feature unusable.

Task 2068280
2019-09-18 11:31:43 +00:00
Aaron Bohy 3615fb3c7f [FIX] web: list: disable record selectors when editing
Having those inputs enabled can lead to weird situations where a
record has been modified but can't be saved anymore (because the
user clicked on one of those record selectors to focusout the edited
row). Also we don't want the user to start multi-editing a field,
then change the selection, and then validate the changes.

Task 2068280
2019-09-18 11:31:43 +00:00
Julien Mougenot 4a3315fa22 [FIX] web: list: multi edition only between selected records
Before this commit, if a record was selected and another one was edited,
it was considered as multi edition.

Now, the multi edition only works if the edited record is included in the
selection; else it will be the only edited record (single edition).

Task 2068280
2019-09-18 11:31:43 +00:00