Commit Graph
126256 Commits
Author SHA1 Message Date
Christophe Simonis 984a99611e [FIX] l10n_be_intrastat_2019: Python3 compatibility
Oversight of previous forward-port
2019-01-23 16:40:41 +01:00
Christophe Simonis 51a76880f2 [MERGE] forward port branch saas-15 up to 3cba1862d4 2019-01-23 16:05:02 +01:00
Christophe Simonis 3cba1862d4 [MERGE] forward port branch saas-14 up to 81c9e28eab 2019-01-23 15:23:00 +01:00
Christophe Simonis 81c9e28eab [MERGE] forward port branch 10.0 up to f3de712d76 2019-01-23 15:21:30 +01:00
Christophe Simonis d870fd555e [MERGE] forward port branch 10.0 up to 90c1af1151 2019-01-23 14:08:50 +01:00
Nicolas Seinlet f22fef1776 [IMP] fleet: search on name of auto joined driver
Instead of searching for the driver name and return thousands of partner 
ids in the vehicule search, use a database join and a search on the 
driver name.

closes odoo/odoo#29288
2019-01-23 09:41:50 +00:00
Nicolas Martinelli c8ac1b40f2 [FIX] account: dashboard performance
When thousands of invoices are in a different currency than their
corresponding journals, a large number of calls are performed to
`_get_conversion_rate`, and therefore `_select_companies_rates`.

Despite the fact that the query itself is optimized, the impact of
performances on the dashboard loading time is not negligible.

In order to avoid unnecessary queries, we create a cache dictionary to
store the rate values. This way, we avoid any unnecessary query.

opw-1920188

closes odoo/odoo#30552
2019-01-28 12:51:50 +00:00
Lucas Perais (lpe) e7bbdf884f [FIX] web: calendar: take locale to format dates
Before this commit, when opening the calendar view with a specific locale
in the "week" view
the days were translated but the date format was wrong and fell back to english
This was because the translated terms were passed explicitly, but the locale did not
get passed

After this commit, we do what it takes to pass the locale to fullcalendar
and the dates are formatted with the right pattern

Also, there may be a bug in fullcalendar, because just passing the locale in the options
won't work, it should be instanciated first in fullcalendar's "locales cache"

OPW 1922092

closes odoo/odoo#30530
2019-01-29 08:52:28 +00:00
Nicolas Seinlet 3f4d1e1fbe [IMP] mrp,stock_account: faster computation
Use read_group is faster than the python equivalent,
and then don't push ids in ORM cache, which makes
the ORM faster later in the process.
Also unlink in batch.
2019-01-23 10:30:49 +01:00
Waleed Mohsen 4c5de1c37c [CLA] signature for MohsenWaleed
closes odoo/odoo#30441
2019-01-23 08:23:38 +00:00
Nicolas Lempereur 90c1af1151 [FIX] web: no chrome autocompete on many2one widget
For editing many2one fields (and partially many2many) most widget show
an autocompleting list of targeted records.

They thus have `autocomplete="off"` to prevent browser completion.

But chromium has an history of breaking `autocomplete="off"`, see:

- https://caniuse.com/#search=autocomplete
- https://crbug.com/468153
- https://crbug.com/587466
- https://crbug.com/914451
- https://crbug.com/923895

It seems that since chromium 71, the heuristic to ignore
`autocomplete="off"` has become more aggressive and for example if there
is at least 3 fields like an address in a page, chromium will ignore
`autocomplete="off"` for the fields like an address.

So for example the eidting the many2One field with placeholder "Country"
in a contact page now has a browser autocomplete menu that is:

- hidding the many2one autocomplete
- going to save empty country it appeared visually filled if the
  autocomplete result was selected.

With this changeset, the placeholder in the many2one instance is
interspersed with U+FEFF charcters (ZERO WIDTH NO-BREAK SPACE) so the
browser does enable the autocomplete feature by force.

This should thus remove the issue (until it is fixed by chromium) in the
case of field named "Country" or matching other regexes in this file:

https://github.com/chromium/chromium/blob/cdb1b2073f12/components/autofill/core/common/autofill_regex_constants.cc

U+FEFF has been chosen instead of more recommended characters because
other have been shown erroneous for printing in some windows
configuration (see cb2a3afa7).

10.0 version of #30439
opw-1930588
closes #30439
closes #30449
2019-01-23 01:09:22 +00:00
Florent de Labarre d3affc5798 [FIX] sale: don't send duplicate email
closes odoo/odoo#30455
2019-01-23 07:31:50 +00:00
Nicolas Martinelli b95affa3ee [FIX] sale: taxes and untaxed amount
- Create a SO, do not set a partner
- Add a product with a tax

The untaxes amount as well as the taxes remain 0.0.

This is because there is no pricelist, therefore no currency.

There is actually no need of rounding explicitly since these are
monetary fields which will be rounded automatically.

opw-1931796

closes odoo/odoo#30450
2019-01-22 16:34:31 +00:00
wan 6a8ab26688 [FIX] account: allow to reconcile companies with parent
OPW 1929160
A filter prevented from selecting a partner in the reconciliation widget if it had a parent company but a company with a parent company should be selectable

closes odoo/odoo#30270
2019-01-22 08:34:43 +00:00
Carlos Dauden f6c4afe8c3 [FIX] stock_account: avco and unlock
`product_price_update_before_done` may be called with a `forced_qty`
argument in the case of unlock: unlock a picking, edit a received/sent
move and increase/decrease the quantities. In this case, the formula of
the AVCO was wrongly applied.

Closes #30513
opw-30513

closes odoo/odoo#30730
2019-01-31 13:11:12 +00:00
Florent de Labarre e9e7f7d483 [FIX] base: partner of bank account
Add the `partner_id` field in the view, otherwise such a basic
modification is not possible.

opw-1932182

closes odoo/odoo#30457
2019-01-31 13:32:44 +00:00
Jorge Pinna Puissant 5ce38b7025 [FIX] base_address_city: lost information when creating Partner from Lead
Cherry pick of 0edd3ea5b4 in version 12.0

Have a Lead with the contact informations (Customer Name, Street,
Street 2, City, State, ZIP, Country) completed in the 'Followup' page.

Before this commit, when the base_adress_city module was installed, the
informations of the City, State and ZIP where lost when we try to create
a new Partner from the Lead.

Now, the informations are present in the Partner form; furthermore if
the country allows enforce cities, the information is also present in
the enforce city form.

OPW-1932018

closes #30644

closes odoo/odoo#30713
2019-01-31 07:43:33 +00:00
Nans Lefebvre b7983443b6 [FIX] web: make value_from of Datefield work without calling complete before
Commit 9af941428880af8e1810dfd9feef494d7a745e98
made it so that the value_from function depends on a variable defined after
the function complete has been called, without any guarantee that this function
would be called after. Apparently this is the right OOP thing to do.

opw 1930523

closes odoo/odoo#30712
2019-01-31 07:35:46 +00:00
Xavier Morel 6ce2d6efb5 [FIX] core: allow signal handlers in multiprocess workers
Because Python only runs signal handlers on the main thread, native
calls (IO or accept(2)) can delay these handlers running. This is
especially problematic when one such call is completely stuck and
we're trying to dump the stack to diagnose the issue.

By running the actual worker's processing in a sub-thread and leaving
the main thread sleeping, worker processes should always be able to
handle signals.

closes odoo/odoo#30688
2019-01-30 11:22:05 +00:00
Aurélien Warnon 5a6c523cc7 [FIX] website_slides: prevent slide download for public users
Task #1930691

Purpose
=======

If the download security is set to 'Authenticated users', the route should prevent public users
from downloading the slides.

closes #30281

closes odoo/odoo#30399
2019-01-21 07:02:58 +00:00
Martin Trigaux f63569beef [I18N] base: export source terms
Fixes odoo/odoo#30483

closes odoo/odoo#30488
2019-01-23 16:37:22 +00:00
qsm-odoo caacd95a87 [FIX] web: allow to open community website menu on iOS
Before this commit, the menu to go into the backend from the website was
not possible to open on iOS without opening the right menu first. This
was because position: fixed is not able to counter overflow: hidden in
iOS. This is the fix for stable versions, the proper solution will be
done in master.

Closes https://github.com/odoo/odoo/issues/29390
task-1923151

closes odoo/odoo#30507
2019-01-24 10:55:18 +00:00
Nicolas Martinelli 10d558ef2b [FIX] mail: failure notification
- Debug mode,
- Add multi-company to admin (user id 2),
- Create new company (company 2)
- Activate res.partner multi-company record rule
- Create invoice
  - with first company (the default one)
  - with a customer having an email address that doesn't exist
  - Send a message in the thread, making sure the customer is in the
    follower
- Wait for the message to bounce (red mail icon in the thread on the
  given message).
- Change user to company 2 (in the dropdown menu next to the user
  dropdown menu in the upper right corner)
- Refresh, access error, even in the app switcher.

This is because Odoo tries to display in the notifications the email
that failed, and crashes because the user doesn't have access to the
partner of the email.

We filter out the notifications related to objects that the user doesn't
have access to.

opw-1924359

closes odoo/odoo#30348
2019-01-18 11:41:43 +00:00
Thanh Dodeur 3c9cf1e753 [IMP] mail: adds delete and upload to chatter
backport of 73d9b9588f

This commit adds the ability to upload and delete
attachments from the chatter.

closes odoo/odoo#30636
2019-01-28 11:24:48 +00:00
Nans Lefebvre e27f0ee7ef [FIX] web: reset the dynamic domain when discarding changes
Create record A on form view, on which a dynamic domain is added by an onchange.
Switch to kanban view. Quick create a record B. Click edit.
This sends you to the complete form view to edit the record.
The dynamic domain of A is still applied.

When discarding the changes, the _domains attribute was not reset.

Example of a model on which this flow can be reproduced is helpdesk.ticket,
with _onchange_partner_project providing the new _domain.

test courtesy of @aab-odoo

opw 1920874

closes odoo/odoo#30308
2019-01-28 14:57:46 +00:00
Lucas Perais (lpe) 6a24660f7e [FIX] account: aged partner: partner can be unknown
Have one move with
- one debit in receivable with a partner which has a partner.category on it
- one other debit in receivable, without a partner
- one credit wherever

Open the aged partner balance report, filter partners on the relevant tag (partner.category)

Do the same with a move with an earlier date that will put the amounts in a different column

Before this commit, it crashed because some result variable did not contain
the key "False"

After this commit, it doesn't crash

OPW 1933749

closes odoo/odoo#30603
2019-01-28 12:03:03 +00:00
Pierre Masereel a1bb59e54d [FIX] stock: select seller date
When the function '_select_seller' in stock warehouse is called, a
datetime is passed to it. But the method needs a date, so we modify it.

OPW-1930264

closes odoo/odoo#30563
2019-01-28 09:07:14 +00:00
Nicolas Martinelli d259b5b8a6 [FIX] mrp: filter pending by default
Pending WO should not be displayed by default since they are not
expected to be launched yet.

opw-1934087

closes odoo/odoo#30586
2019-01-28 08:44:18 +00:00
Florent de Labarre 37f7f7b29a [FIX] account: speedup the creation of the chart of accounts
closes odoo/odoo#30493
2019-01-23 22:17:21 +00:00
Lucas Perais (lpe) e5cc3d5ab9 [FIX] account: journal dashboard amounts
Have a journal with 1 unpaid invoice and 1 refund to be paid too

Before this commit, the data on the journal's dashboard for unpaid invoice
was the sum of the refund and the invoice

After this commit, the amount of the refunds are substracted while
the amount of invoices are added
Also, the behavior is harmonized across other amounts
that display on the dashboard and tested

OPW 1924388

closes odoo/odoo#30395
2019-01-28 08:58:13 +00:00
Christophe Monniez 03a8819652 [FIX] tests: avoid check document.readyState of about:blank
In an HttpCase test, when the browser_js method is used, an optional
javascript code can be used to check that the page is ready to execute
the test.

When no 'ready' code is given it defaults to check the
'document.readyState' status.

In some rare cases (discovered by @Xavier-Do) this status is checked on
the 'about:blank' page. As the page seems ready, the test code is
evaluated and fails.

With this commit, when no specific ready code is provided, the test will
wait for a chrome devtools event that ensure the page is fully loaded
before starting the test.

closes odoo/odoo#30584
2019-01-26 15:09:37 +00:00
Robot Odoo 529069996c [FIX] base ir.actions.report order pdfs when attachment_use option selected
Description of the issue/feature this PR addresses:
Order of merged pdf reports when attachment_use = True

Current behaviour before PR:
When in a report the "Reload from Attachment" option was selected
(attachment_use = True), and multiple pdfs were printed, the singular pdfs
were stored in a dictionary and appended to a list and thus merged in a random order.

Desired behaviour after PR is merged:
By mapping the pdf with their source record, and sorting the list with the table _order of
the source records of the pdfs, we seek to have an ordered output pdf.

opw 1915685

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

closes odoo/odoo#30402
2019-01-28 10:15:48 +01:00
sbbaro c4d2c2cf13 [FIX] base ir.actions.report order pdfs when attachment_use option selected
A couple of small changes:
- only run the search if streams is not empty
- change streams for stream_list in the if for the final merging
2019-01-23 14:20:33 +01:00
sbbaro 6db1b8343b [FIX] base ir.actions.report order pdfs when save_in_attachment option selected
When in a report the "Reload from Attachment" option was selected
(attachment_use = True), and multiple pdfs were printed, the singular pdfs
were stored in a dictionary and thus merged in a random order.

Now, we make a list before merging them and sort it with the table _order of
the source records of the pdfs to have an ordered output.

opw 1915685
2019-01-21 11:07:03 +01:00
Nicolas Martinelli 0fa969a4a7 [FIX] sale: attachment name
- Create a SO, keep it as draft
- Click on 'Send by Email'

The name of the attached PDF file contains `_draft`.

This doesn't really make sense anymore, since the SO will be set to
'Sent' right after sending. Therefore, if sending a second time,
`_draft` won't be added to the filename.

opw-1930282

closes odoo/odoo#30367
2019-01-18 15:35:08 +00:00
Nicolas Martinelli c15551a3f2 [FIX] crm: default CRM team
Keep the default value for the default CRM team (False) since leads are
not activated by default.

opw-1929489

closes odoo/odoo#30360
2019-01-18 14:08:22 +00:00
Christophe Simonis d657d6457f [FIX] website: update *all* views, not only website ones
closes odoo/odoo#30369
2019-01-18 16:34:08 +00:00
Nicolas Martinelli 5291b8c1a4 [FIX] account: Journal Items link
- Activate debug mode
- Go to the Accounting Dashboard
- In Vendor Bills, click on 'Journal Items'

A crash occurs because of the concatenation of a `bool` and `str`.

In this case, the `action['help']` is `False`.

closes odoo/odoo#30351
2019-01-18 12:02:28 +00:00
Lucas Perais (lpe) 897834f406 [FIX] base: res_users form message partner active correct condition
Before this commit, the condition and the field on which it applied were wrong
That is, when both the user and the partner were inactive, the message saying that
the partner was still active displayed anyway

After this commit, we show the message only when the user is inactive but its
directly related partner is still active

OPW 1928247

closes odoo/odoo#30337
2019-01-18 10:07:26 +00:00
Christophe Simonis 4aa153e65c [MERGE] forward port branch 11.0 up to 19558129f0 2019-01-17 20:49:36 +01:00
Christophe Simonis 19558129f0 [MERGE] forward port branch saas-15 up to c0471dd857 2019-01-17 19:07:34 +01:00
Christophe Simonis c0471dd857 [MERGE] forward port branch saas-14 up to 17adccd95c 2019-01-17 18:07:26 +01:00
XavierDo 76e085cbb7 [FIX] base: avoid to escape image when src contains @
The content id of an attachement can contains a @, therefore
image contained in emails where sometimes escaped by html_sanitize
as if they were emails adresses.

Task: 1915251

closes odoo/odoo#30326
2019-01-17 16:21:08 +00:00
Nicolas Martinelli 8781e2e4f8 [FIX] payment: multiple companies
- Activate multi-company
- Create 2 S2S payment methods (Payment Flow: Payment from Odoo), one
  for each company
- Connect as a regular user to `/my/payment_method`

The user has access to both payment methods, while he should only have
access to the method of his company.

opw-1920483

closes odoo/odoo#30558
2019-01-25 13:34:32 +00:00
Nicolas MartinelliandNicolas Lempereur b2266fae87 [FIX] website_sale: terms & conditions
- Install website_sale and website_sale_delivery
- Activate 'Terms & Condition' on the payment page
- Process a shopping cart

On the payment page, the 'Terms & Condition' checkbox is unchecked, but
the 'Payment' button is enabled.

Both `$checkbox.change` and `_onCarrierUpdateAnswer` set the `disabled`
property, and conflict.

We keep on the HTML node an object with the list of disabled reasons.

opw-1923459

Co-authored-by: Nicolas Lempereur <nle@odoo.com>

closes odoo/odoo#30504
2019-01-25 10:19:12 +00:00
Odoo Translation Bot fe36bff420 [I18N] Update translation terms from Transifex 2019-01-27 01:37:55 +01:00
Nicolas Lempereur c7a281d880 [FIX] website: affix menu no close frontend mobile menu
On mobile the frontend menu navbar is an hamburger menu that open on
click.

If the option "Customize > Main layout | Affix Top Menu" is
enabled, there is two menu:

- one at the full top of the page
- one affixed to the top of the viewport (only shown if we are at least
  scrolling 300px away from the top of the page)

But there is a side effect: when scrolling if the menu at the top of the
page is opened, it will be automatically closed => this makes sense to
avoid having two menu shown on the same page but is an odd behavior.

With this commit, the behavior is changed and when the menu is opened in
the top, the affixed menu is not shown (it only works if the top page
menu has no opened dropdown).

opw-1920310
closes #30564
2019-01-25 15:56:15 +00:00
Yenthe666 146e0692e5 [FIX] l10n_nl: don't set VAT accounts on grouped tax + follow official Dutch tag names
closes odoo/odoo#30539
2019-01-25 09:34:53 +00:00
qdp-odoo 19ece69850 [FIX] account: manual reconciliation from journal items
use cases fixed:
  1) go in the journal items, filter on unreconciled lines, pick just one and click on 'Action > reconcile', the manual reconciliation widget opens but you directly get the rainbowman and you can't do anything. It's not possible to reconcile the selected entry with a writeoff (to clear a customer account, for example).
  2) go in the journal items, select 2 receivable lines for the same amount but that don't have any partner set then click on 'Action > reconcile', the rainbowman directly shows without processing the reconciliation.

    To fix those issues, we now clearly bypass the regular methods in case we have active_ids and active_model == 'account.move.line', since they weren't adapted anyway.

    also implement real error message when selected lines don't have the same company or account (currently it's displaying a rainbowman): see error messages in 'reconcile()' in account_move.py

  OPW #1919727 and #1930957

  Co-authored by wan-odoo

closes odoo/odoo#29771
2019-01-25 12:21:16 +00:00
Christophe Simonis c8ace043e5 [MERGE] forward port branch saas-11.3 up to 387d5cff90
closes odoo/odoo#30566
2019-01-25 17:29:34 +00:00