Commit Graph
127730 Commits
Author SHA1 Message Date
Damien Bouvy 7807bc854e [FIX] payment_stripe_sca: on-the-fly customer conversion
Payment tokens created before the installation of this module and that
used the Charge API did not need to keep the card reference on Odoo's
side - since we were allowed by the API to simply specify a customer
reference when creating a charge and it would take the default one for
that customer. Odoo creates one customer per payment token (even if it's
the same partner), so there was no uncertainty there.

Now, with the PaymentIntent API, the payment method reference is
mandatory. We have a field to keep it in db, but this info needs to be
retrieved for tokens created before the module's installation. This fix
introduces that remote call.

closes odoo/odoo#37206

X-original-commit: 1b760a988fdf7bbc08b92e0705929d5620356a2f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-20 12:42:09 +00:00
William Henrotin 1067f3bda2 [IMP] mrp: compute quantities speedup
The computation of kit quantities was not efficient. A loop on each product
of the recordset to consider performed. Each time a product was seen as 'not a kit',
a new computation on the complete recordset was done. This leads to a N^2 complexity

This commit only compute stock quantities for non kit product in one batch

opw-2070768

closes odoo/odoo#37205

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-20 12:39:04 +00:00
Andrea Grazioso (agr-odoo) 5e2ae036cf [FIX] account: broken filter in reconciliation widget
From Accounting app under the kanban card "Bank" click on
"Reconcilile items". Select a line to reconcile with a selected partner
or counterpart (or input one) and then filter the underlying lines using
for example the name of the record

No filtering will occur, this is due to commit 900d89c997.
The domain used by the filtering function is matching all lines
from the current partner instead of restricting the search to
the filtered elements.

Reverting that commit and providing a fix for the original issue:
removing a check on the partner id make a logical separation between the
domain involving the partner_id and the one related to the search string,
so that they do not interfere with each other (at most they will overlap).

Preserving tests from the reverted commit and adding some more as well

opw-2070458

closes odoo/odoo#37179

X-original-commit: d434251f3350e033843d941b48cf84f7de28d20f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-20 08:45:33 +00:00
Andrea Grazioso (agr-odoo) 3ee3f7d497 [FIX] web: digits option not applied in list view
From the settings activate:

- Multiple Sales Prices per Product
-- Prices computed from formulas
- Discounts

Create a pricelist with discount policy "Show public price & discount to
the customer", set the price calculation formula:
- Rounding: 10
- Price discount: 10%

Modify the sale order xml list view adding 'digits="[3, 2]"' to the
discount shown in the sale order line.

Create a sale order with such pricelist and on the so line put a
product with quantity 1 and sale price 4190 (VAT 19% included in the price).

The discount will not display the requested number of decimal digits (2)
in list view, but it will when editing the field.

The cell formatting is done calling the appropriate function (formatFloat),
which search the digits option from the 'options' parameter or from the field
definition. The latter stores the default digits coming from
the DecimalAccuracy settings, which, as side effect, alter the behavior
of the discount calculation.
https://www.odoo.com/web#view_type=form&model=project.task&id=2069939&active_id=2069939

When passing into edit mode the field is created as widget, parsing its options
which have 'digits', instead when coming back in list mode it is "just a
float field" rendered directly from the list_renderer which no options,
so the formatFloat will look at the field definition
https://github.com/odoo/odoo/blob/12.0/addons/web/static/src/js/fields/field_utils.js#L172

Adding the correct parameter to the dictionary passed to formatFloat
during the list rendering is a possible solution, because it is the
"closest" point in which parsing the parameter is possible without
touching higher level code or forcing the creation of a widget (adding
widget='float' as xml parameter).

closes odoo/odoo#37167

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-20 05:37:56 +00:00
Nans Lefebvre 151666b79d [FIX] service: clear environments between transaction retries
Initial bug report, full of red herrings:
receive two support requests by email while on Odoo.sh, the first creates a
ticket, while the second replies to the server with the error:
550 Requested action not taken: mailbox unavailable

When a request is done, the service check function tries each request multiple
times when getting Operational errors.
When two email are received within a 'short' amount of time (e.g .1 second)
the two requests are initiated with a new cursor.
When both mails generate the creation of a new record of the same model,
the second cursor is going to fail because of an:
ERROR: could not serialize access due to concurrent update
However, the record we used in the computations needed in the creation of the
second record have been added to the environment.
When that second creation is retried, it will operate on the same records,
and find them in the todo, with the environment that was obtained for the first
trial. Since the cursor is closed, this crashes.

To explain the bug report, Odoo.sh transfers the mail through an xmlrpc
to process the mail.
Because of this crash, the server interprets the lack of well-formed response
by a generic 'mailbox unavailable'.

opw 2060476

closes odoo/odoo#37165

X-original-commit: 845eecdfa7b27d84862e94f4b63d40a851e0c410
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-19 15:44:59 +00:00
Nicolas Martinelliandjev-odoo f00d6aaeaf [IMP] account: better logging of unbalanced entry
Display the difference when an unbalanced journal entry is created to
help pointing out the source of the issue.

opw-2069673

closes odoo/odoo#37145

X-original-commit: d00e3158cd30067f7cc8d524eff81ccd6e620342
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Co-authored-by: jev-odoo <jev@odoo.com>
2019-09-19 13:06:26 +00:00
Hugo Adan 7592d609b8 [FIX] web: incompatible blockquote css
- Add the following in a PDF report:
```html
<p>
    <blockquote>
        <ol class="loweralpha simple">
            <li>Item that explain terms</li>
            <li>Another item that explain something else</li>
        </ol>
    </blockquote>
</p>
```
- Print the report

Wkhtmltopdf crashes with the error:

Wkhtmltopdf failed (error code: -11). Memory limit too low or maximum
file number of subprocess reached. Message : b''.

This is a known issue:
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/4115

Actually, since this CSS is only used for Wkhtmltopdf reports, we can
simply remove the CSS rule causing the problem.

Closes #37034
Fixes #37033

opw-2073195

closes odoo/odoo#37155

X-original-commit: 8d08893172ae8c0f3ad1f1af6ab9514aa30bf843
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-19 14:08:07 +00:00
Nans Lefebvre c92fb90e7b [FIX] product: always use UTC to compare pricelist dates
In case where no argument is given to _compute_price_rule, it would default to
context_today().
This gives "today" in function of the context, depending on the user timezone.
In contrast, an explicitly given date would always be UTC.
Furthermore, on the webshop an unlogged user would get the Public User timezone,
and once logged would get its portal user's timezone.

To make everything coherent, we always use UTC.

opw 2054881

closes odoo/odoo#37154

X-original-commit: 35d4a8ccce8f3a34701d231e17a324cbbf5abfab
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-19 14:05:23 +00:00
Nans Lefebvre eb2885bc79 [FIX] sale: get correct account to create corresponding invoice
Sibling commit of 427280d9760a71e6ca2961bcf4a2f9f157e6dddd, same use case.

Be in company C1. Create the invoice I for a SO in company C2.
The invoice line is with an account created of C1.
This is because property_account_income_id or property_account_income_categ_id
are company dependent properties that need to be accessed with a force_company.
This happens when e.g. C2 is a child company of C1.
However, accounts are not readable across companies, so the resulting invoice
cannot be validated in either company, since there is a mix of accounts.

Note that in case force_company is False, it defaults to the user's company,
which is already the default.

opw 2068291

forwardport of 79714bafe4b

closes odoo/odoo#37146

X-original-commit: ae84e7fd416c38404c20607b5b04fc1c9b790cde
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-19 12:50:03 +00:00
Nans Lefebvre 7571b086bd [FIX] base: fix portal rights update
Commit c3717f3018 added a (5, 0, 0) command when modifying groups_id of any
non-internal user, to avoid the situation where the various implications would
end up giving the portal user group_user rights.
This risk is avoided by commit f206714af0, which added a constraint
check_one_user_type, which would raise in that specific case.
The last missing piece was 9badedcd98f; when groups are added through settings,
they are added through the implied_groups of the group model.

The (5,) command has the unfortunate side-effect to remove the portal group
from a user if a write is triggered programmatically.
If that happens, then the 'signing up' process end-destination is a 500 error.

Now we simplify the logic that keeping the same behaviour for implied_ids for
internal (group_user) and non-internal users.
We keep the (5,) command in one case: if a user is demoted to portal or public,
he may have groups should be reserved to internal users, but that do not imply
group_user (which would raise).
To avoid that, we remove all its groups, since there is no clear distinction
between technical display groups and actual privilege-granting groups.

opw 2041606

closes odoo/odoo#37144

X-original-commit: 29723e351d5dc5e5ea055c80da86f4e871909de9
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-19 12:49:11 +00:00
Goffin Simon ce7090001d [FIX] product: Field display_name in product template form view
Steps to reproduce the bug:
- Go to Sales app and open the form view of a product P
- With studio add the field display_name in the view
- Try to create a new product

Bug:

A access error was raised because a read was made on a record in cache

opw:2070074

closes odoo/odoo#37133

X-original-commit: 90143c18f50ff31ded5aba7d7ba3beb66423ff06
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-19 10:33:02 +00:00
Goffin Simon 88889b6aa8 [FIX] mrp: operation type defined on a BOM not chosen
Steps to reproduce the bug:
- Create two operation types OP1, OP2 with code = mrp_manufacture
- Create a BOM B with operation type = OP2
- Create a MO with B

Bug:

The operation type set on the MO was OP1 instead of OP2

Technically:

The default value was always taken from function _get_default_picking_type

opw:2070370

closes odoo/odoo#37029

X-original-commit: 3c5338dce8db7606ac2ac0101473bcafe3bd4f76
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-18 10:03:14 +00:00
jev-odoo 5dc389db6b [FIX] point_of_sale: use currency precision to test if orders are paid
The test was made with an epsilon of 0.00001, which is precise enough to avoid
false positives, but allowing false negatives.
As a results, some orders can be incorrectly determined unpaid.
No (non-digital) currency has a precision higher than 0.00001,
but many currencies have a precision much lower (e.g the unit for ¥).
Also, we prepare for the future where all orders will be paid in Bitcoin.

opw 2059997

closes odoo/odoo#37112

X-original-commit: 73c2d46f4a443885fbf67879141ac892efebe3c7
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-19 08:16:19 +00:00
Sebastien LANGE ebda1101e3 [FIX] stock: slow downs in stock move line creation
— Create a new product, it's tracking must be set to 'By Unique Serial
    Number';
— Create a new purchase order, with 500 lines. Each line with 10 units
    of quantity of the previously created product;
— Confirm the purchase.

Before this commit, the creation of the stock piking take a quite some
time, and becomes difficult to use this functionality.

Now, the creation of the stock piking time was significantly improved.

opw-2070738

closes odoo/odoo#37107

X-original-commit: a434b087c86888903e320532b5e75856fa32bd13
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-09-19 07:09:04 +00:00
Jorge Pinna Puissant f629cd9672 [FIX] web: write date without separator
Since fbbfa6d it's not longer possible
to write a date without separator (e.g., 0102 for 01/02/2019; 121298 for
12/12/1998;  02042018 for 02/04/2018), or a date without year (e.g.,
01/02 for 01/02/2019) in the datepicker widget.

In this commit we have decided to be as permissive as tempus dominus
that call moment.js with strict false. This allows moment.js to deduct a
date from a string in a more versatile way. This also allows a more
versatile autocomplete in the search views.

opw-2070464
opw-2070931

closes odoo/odoo#37095

Forward-port-of: odoo/odoo#36821
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-19 07:07:03 +00:00
Lucas Perais (lpe) d786d7d250 [FIX] account: cash basis base account not required
Before this commit, the field cash_basis_base_account_id, used
to keep track of the base on which a tax a computed for cash basis entries
was required in the tax form view

Since this account can be absent, and will be most of the time, and that
an account is retrieved anyway in the move creation process it is safe
to remove the required attribute in the view

After this commit, the field is not required in view anymore

OPW 2072750

closes odoo/odoo#37060

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-19 07:19:21 +00:00
Victor Feyens 0a76e75b96 [DOC] cmdline/odoo-bin : add --without-demo, shell + reorganize
closes odoo/odoo#36809

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-18 08:55:01 +00:00
Victor Feyens ffc69127f8 [DOC] Data files : noupdate information + examples
Solves #26818
2019-09-18 08:54:51 +00:00
Victor Feyens ef5251c0d7 [DOC] cmdline scaffold example 2019-09-18 08:54:40 +00:00
Victor Feyens 65093459e9 [DOC] ir actions report minor fixes 2019-09-18 08:54:29 +00:00
Victor Feyens 29ce2cab28 [DOC] Base : ir.actions.server : fix wrong docstrings.
Wrong since 8fa9f7d6d4 refactoring 
ir.actions.server.
2019-09-18 08:54:18 +00:00
Victor Feyens 96e208c191 [DOC] Ir Actions Server documentation
Since commit 8fa9f7d6d4 refactoring the
actions server, the documentation was outdated.

This commit removes and fixes the documentation on ir.actions.server.
Also adds the display of the docstring of the IrActionsServer class from
odoo.addons.base.models.ir_actions.

Solves #31044
2019-09-18 08:54:07 +00:00
Victor Feyens 240e2d51ea [REM] unused odoo/doc/reference/test-report.txt 2019-09-18 08:53:57 +00:00
Victor Feyens b94b08e579 [DOC] ir.actions.act_window.view 2019-09-18 08:53:48 +00:00
Victor Feyens dc350c503a [DOC] sphinx warning removal 2019-09-18 08:53:38 +00:00
Victor Feyens da01e44bb7 [DOC] fix module.rst 2019-09-18 08:53:27 +00:00
Victor Feyens 004f9e09da [DOC] https links for sites supporting https 2019-09-18 08:52:50 +00:00
Victor Feyens 87003e214e [DOC] batch of UI, Https, linter corrections 2019-09-18 08:52:34 +00:00
Victor Feyens 0ddeb22095 [DOC] actions : add ir.cron documentation 2019-09-18 08:48:28 +00:00
Christophe Simonis 5c89830885 [FIX] digest: do not reset config parameters on update
The `forcecreate=0` is required because the ICP will be deleted when set
to `False` (which is quite frequent for a boolean).

closes odoo/odoo#37103

X-original-commit: 255a12931d2a22dfadb1455a5dfc0a5e2f37b730
Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-18 18:41:01 +00:00
Nicolas Lempereur af163d5a9e [FIX] website: boxed title style for splitting
When a title with boxed style (border arround title) is split (by doing
normal ENTER (and not shift ENTER which work as expected)) the title
being in inline-block for styling purpose, this give odd results (of
several title boxes on the same line).

With this commit style is changed so split title are on different lines.

opw-2070611
closes #37084

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-09-18 13:17:18 +00:00
Jigar Vaghela 1ad8c88eb3 [IMP] l10n_in: use a tax group insted of repartition line for SGST and CGST
need seperate lines with different labels(SGST and CGST) on the invoice report and pos receipt
so use a tax group instead of repartition line

closes odoo/odoo#37080

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-09-18 12:46:16 +00:00
Alexandre Kühn 9a66619db3 [FIX] mail: no wait init_messaging before loading webclient
Before this commit, discuss widgets had to wait for the route
`mail/init_messaging`. This behaviour slowed down the loading of the
web client.

This commit solves the issue by rendering discuss widgets even when
`mail/init_messaging` hasn't been resolved. For instance, the
messaging menu displays a spinner until messaging becomes ready.

Task-Id 2072835

closes odoo/odoo#37031

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-18 10:07:20 +00:00
Lucas Perais (lpe) 3dd2e7c2ef [FIX] website_event_questions: filter hiding cancelled registration
Before this commit, there was no way in the event question report
to filter out cancelled registration

After this commit, we introduce a filter for it

OPW 2072973

closes odoo/odoo#37032

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-18 07:10:48 +00:00
Julien Mougenot 31ec900bb0 [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.

closes odoo/odoo#36522

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-18 08:24:32 +00:00
Julien Mougenot ca4e158a8e [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 08:24:32 +00:00
Vincent Schippefilt 28e52c605d [FIX] snailmail: support write with multiple records 2019-09-18 08:24:32 +00:00
Julien Mougenot d261d42d9b [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.
2019-09-18 08:24:28 +00:00
Aaron Bohy bb85f963b5 [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 08:24:13 +00:00
Aaron Bohy 3b4cc84c1c [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 08:24:13 +00:00
Julien Mougenot a7782cadbe [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 08:24:13 +00:00
Aaron Bohy af65475a4c [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 08:24:13 +00:00
Aaron Bohy ac85176ce8 [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 08:24:13 +00:00
Aaron Bohy 90fe1bbe33 [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 08:24:13 +00:00
Julien Mougenot 9371721fcb [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 08:24:13 +00:00
Aaron Bohy 3c68347c15 [FIX] web: list: multi edit: do not create new row
...when validating last row by pressing ENTER.

In single edition, we automatically add a new row when the user
edits the last one and presses ENTER. This is something we don't
want in multi edition.

Task 2068280
2019-09-18 08:24:13 +00:00
Julien Mougenot 01d7077bdd [FIX] web: readonly many2one in list views
Fixes the way many2one fields are rendered in editable list views.

Before this commit, many2ones in readonly mode would render as links
and their widget would be considered as active even though you couldn't
edit it.

Now, they are rendered as plain text and act the same way as readonly char fields.
2019-09-18 08:24:02 +00:00
Julien Mougenot 8c6de8c452 [FIX] web: list: clicking discard doesn't trigger an onFieldChange
Fixes the way records are discarded in list views

Before this commit, clicking the "Discard changes" button in a list view
after editing a record triggered both the "field changed" and the "discard changes"
methods (resulting in 2 modals opening).

Now, all fieldChanges are prevented when trying to click "Discard changes",
and are re-applied if the click was unsuccessful (lifted left mouse button somewhere else).

Task 2068280
2019-09-18 06:11:03 +00:00
Aaron Bohy fc52cae034 [FIX] web: list: multi edition: force write same value
Let's assume an editable list view with a many2one field and 2
records: the first one has value 1, the second value 2. The user
selects all records and wants to set their many2one to value 1. It
edits the first one, sets 1 and validates the confirm dialog.

Before this rev., it didn't save anything because the 'reference'
record (the one used to edit), didn't actually changed, as we reset
the same value.

This rev. forces the write the new value on all selected records in
that case.

Task 2068280
2019-09-18 06:11:03 +00:00
Julien Mougenot c3ac181665 [FIX] web: no selected records after multi edition
Backport of 4b7ba864d0

After editing multiple record, we want don't want any
record selected. This commit ensures that.
2019-09-18 06:11:03 +00:00