Commit Graph
139391 Commits
Author SHA1 Message Date
IEL 89e9ebdccf [FIX] pos_cash_rounding: fixup float_is_zero usage
WHY:

* float_is_zero doesn't work without second argument
  https://github.com/odoo/odoo/blob/c90427dfba26854cda5d54f813cccc4948685077/addons/web/static/src/js/core/utils.js#L59-L62
* the fixed line of code was introduced in #60642

closes odoo/odoo#61097

X-original-commit: 792ebaf8494a42f91e4251acf2f74f89ff9f5e6e
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-10-30 18:57:19 +00:00
Goffin Simonandsmetl 0e4642db8f [FIX] account: Auto-complete with analytic account
Steps to reproduce the bug:

- Create a vendor bill VB1 with one line L1
- Set an analytic account AA on L1
- Post VB1
- Create a new vendor bill VB2
- Set VB1 on the field Auto-complete

Bug:

The created line L2 on VB2 had no analytic account

PS: In 12.0, the analytic account was kept when using Auto-complete field

opw:2359432

closes odoo/odoo#60962

X-original-commit: 5f46c50442dbe42bc534718719a6b19ee087eab0
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Co-authored-by: smetl <las@odoo.com>
2020-10-29 10:54:47 +00:00
Jeremy Kersten 6e6ea2d428 [FIX] website_mail_channel: _send_confirmation_email with company email
Public user by default don't have email. So when you try to subscribe to a
channel in public user (portal don't receive an email), the email cannot be
send and the user see a message:
  "Unable to post message, please configure the sender's email address.

closes odoo/odoo#60867

X-original-commit: 7e40af524cc1b23abab3140377d993f3e93c5cf0
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-10-27 18:47:14 +00:00
Nicolas Galler a14a8e47fe [FIX] website_form: prevent double clicking send
Behavior prior to the commit:

A user can double click the "Send" button when submitting a form on the
website.  Because the event handler is removed on the first click, the
second submission uses the browser default behavior and posts the form
to an incorrect URL, resulting in a 404 error for the user.

Behavior after the commit:

The button is disabled after the first click.

Note:

Using `.attr('disabled')` is sufficient both to disable the button and
to give the disabled visual on all browsers since IE9, but we keep
`.addClass('disabled')` and `.off()` for cases where the clickable is not a
`button` but a link.

opw-2356402

closes odoo/odoo#61111

X-original-commit: 0eed92da709dba843a7f2f82aee772313e3d4630
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
2020-10-31 21:47:16 +00:00
Rémy Voet (ryv) c7192d98ae [FIX] base: fix populate.randint tool
The randint generator generated always `None`
because the `return` was forget in method of `populate.compute`.
- Add a test for the randint tool, and fix the issue.
- Change the documentation of `_populate_factories` to be more
explicit about the custom generator.

closes odoo/odoo#61076

X-original-commit: 09d2ddecaf4fc6474c96acf1f4a12de4789caef8
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-10-30 16:38:57 +00:00
Sébastien Theys 1bdb557520 [FIX] mail: fix height overflow of mentions
Due to mentions being positioned inside thread view and messaging list (when in
chat window) and those two elements having `overflow: auto`, it is necessary to
give mentions an appropriate max height to prevent overflow.

This makes it necessary to add a scrollbar to the mention list, which makes
scrolling into view of active item necessary when navigating with the keyboard.

Also removed activating item on mouse over to prevent activation of wrong items
when navigating with keyboard if the cursor is unfortunately over another item.

task-2275828

closes odoo/odoo#61084

X-original-commit: 85384dd0bb8de5e98e585cb8610d58b11e601520
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-30 17:27:46 +00:00
Sébastien Theys b45b4acab6 [FIX] mail: fix width overflow of mentions
task-2275828

X-original-commit: be56641d88fe25bb048a174a327a8b2890e7ae0f
2020-10-30 17:27:45 +00:00
Achraf (abz) 69e3f42bbc [FIX] hr_holidays: Refuse approved time off
Issue

    - Install "Time Off"
    - Create new time off and approve it

    We can no longer refuse it

Cause

    The refuse button is invisible if the status is not equal to 'validate', in this case it is equal to 'validate1'

Solution

    Change the attrs to display the refuse button when the status is 'validate1'

opw-2361929

closes odoo/odoo#61079

X-original-commit: 80926f582d88aae359a6b35ea521026a3804ce00
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-10-30 16:40:25 +00:00
Nasreddin (bon) 0edf1ce246 [FIX] web: add rtl management for resizable jquery-ui widget
Issue

	- Install "Project" modules
	- Set user language as "Hebrew"
	- Go to Project and open any project
	- Go to 'gantt' view
	- Try to resize a task

	Everything is reversed.

Cause

	Jquery-ui 'resizable' widget do not manage RTL feature.

Solution

	Update the the `position.left` props according to the language
	direction (LTR or RTL).

opw-2367692

closes odoo/odoo#61082

X-original-commit: 1f318d7c7aa66287c8756a89b49293b4e8c2217e
Related: odoo/enterprise#14507
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-10-30 16:47:13 +00:00
Romeo Fragomeli 930a1fedc5 [FIX] test_main_flows: fix main flow on Mobile (on changing month)
On mobile, when tours are run on changing month, the "Register Payment"
step often fails with the following error:
AssertionError: The test code "odoo.startTour('main_flow_tour')" failed
Tour main_flow_tour failed at step Register Payment (trigger:
.o_statusbar_buttons button:enabled:contains('Register Payment'))

Please note before going further:
* The main flow is a tour. The tour manager waits for the trigger and
  the extra trigger to be reachable before executing the step.
* On mobile the status bar buttons are wrapped in a dropdown.
  So the stepUtils.statusbarButtonsSteps is composed by two actions:
  1 - Open the dropdown if present.
  2 - Click on the button.

Before this commit, the extra trigger doesn't look like the best one:
when this tour is executed during month change, the account
module has to perform some heavier (and longer) processes.
When the "Validate" call button is made (previous step), a lot of RPC
are made and, usually, the previous extra trigger works fine.
But for some reasons, the _renderStatusbarButtons is called
between the two steps in the statusbarButtonsSteps.

So this is the flow:
- Running the tour until...
- Click "Validate" button (this generates a bunch of RPC).
- Open the dropdown.
- Some RPC respond, which refresh the "state" and call _renderStatusbarButtons
  (dropdown is not open anymore).
- Try to click on "Register Payment" => BUG
  (button is present but not visible, so unreachable).

After this commit, the extra trigger is changed to force waiting for
the RPC that change the "state" and call _renderStatusbarButtons
before executing the "Register Payment" step.

closes odoo/odoo#61085

X-original-commit: dacc1703c486c8affb44df679ab5e8e2ba724867
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
2020-10-30 17:28:09 +00:00
Xavier Dubuc e0d849ba7c [FIX] mail: make only composer as fixed in chatter
task-2282325

closes odoo/odoo#61077

X-original-commit: 9d90fd9a2a65ab1ff338bb109426ca93075937fa
Related: odoo/enterprise#14506
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-30 16:39:24 +00:00
Sébastien Theys 06ca3e8d0d [FIX] mail: remove chat window auto-focus on click
This causes more trouble than it's worth, especially with mobile keyboards.
It also prevents from selecting any text in chat window threads.

task-2372553
Part of task-2277543

closes odoo/odoo#61078

X-original-commit: 4ec26d985f33e1fa391c312b89fc611b8d688c96
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-30 16:40:03 +00:00
Sébastien Geelen (sge) 71b3fc7c17 [IMP] web_editor: update Jabberwock library to commit 43a10003
Changelog:
[FIX] List: Keep lonely containers in LI if they have attribute(s)
[ADD] Core: handle triple-click delete special case
[FIX] formattingSpace: properly ignore empty text and hidden inputs.
[FIX] should use the dev mode with mobile and multi devices in same time
[FIX] DomEditable: remove flickering in browsers without auto-completion
[FIX] DomLayout,KeyMap: remove flickering on delete, backspace, enter...
[REF] Core: merge .eslintignore inside .eslintrc.js
[REF] Core: remove odoo webpack build

closes odoo/odoo#61074

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-10-30 15:57:44 +00:00
Sébastien Geelen (sge) 1457b75aea [FIX] web_editor: Fix description toggle in pricelist snippet 2020-10-30 15:55:27 +00:00
Nicolas Martinelli 5a262f7b79 [FIX] sale_stock: prevent incorrect computation of kits
- Activate UoM
- Create 3 products: AB, A & B
- Create a kit BoM for AB
  - 1 units of A
  - 1 kg of B
- Sell 1 unit of AB, confirm

The error "The unit of measure Units defined on the order line
doesn't belong to the same category...".

This happens because `_compute_quantity` is called on `stock.moves`
related to different products.

As a first step, we simply keep only the moves of the same product,
meaning that the `qty_available_today` and `free_qty_today` are not
supported for kits.

opw-2372676

closes odoo/odoo#61071

X-original-commit: 15368c6d1316d43b1591b88e4d5786d86403f8a1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-30 15:54:51 +00:00
Laurent Smet 095fb9d6c4 [FIX] account: Check the exchange diff journal only when needed
When the exchange difference journal entry shouldn't be created, don't check its configuration in order to avoid an UserError in single-currency company.

closes odoo/odoo#61047

X-original-commit: 3ab451f3c4ce8dd42337f43628c1335d2caee011
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-30 13:20:27 +00:00
Christophe Monniez abf3a8afd2 [FIX] l10n_ch: use an absolute path for ch flag
When printing an invoice with an iban qrcode using l10n_ch module, a
little ch flag appears in the center of the qr code.

When odoo is started from elsewhere than the root of the odoo code, the
flag does not appear. The cause is that a relative path is used to find
the flag image.

With this commit, an absolute path is computed to find the flag.

closes odoo/odoo#61048

X-original-commit: d33785032b1ca2c6e1d4ade7e174d024fae9a151
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-10-30 13:20:49 +00:00
Achraf (abz) 716ea67582 [FIX] account: Reconcile payment from the manual reconciliation
Issue

    - Install "Accounting"
    - Go to "Configuration/Reconciliation Models"
    - Create new reconciliation model "Test" with "620000 Bank Fees" account
    - Go to "Customers/Payments" and try to reconcile a payment via "Manual Operations"
        by clicking on "Test" button
Cause

    This instruction "st_line.company_currency_id.is_zero(residual_balance)"
    needs at least one element in st_line

Solution

    Skip this instruction if "st_line" is empty

opw-2370034

closes odoo/odoo#61045

X-original-commit: 161a6c494a412097468fca214817c42f022d29e2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-10-30 12:33:27 +00:00
Nicolas (vin) ab16cf8845 [IMP] base: make res_company form similar to res_partner
The res company and res partner company forms are very similar, if not
for a few field placed differently.

This will make them both more similar by moving around a few fields in
the res company form view.

task id #2352554

closes odoo/odoo#59950

Related: odoo/upgrade#1884
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-29 14:41:49 +00:00
Andrius Laukavičius 7f01ea640f [FIX] sale: correct _get_to_invoice_qty depends
`product_id.invoice_policy` dependency was missing.
When changing the policy from "delivery" to "order" of a product, the
quantity of invoiceable products was not recomputed and remained 0

Closes odoo/odoo#60674

closes odoo/odoo#61026

X-original-commit: cfc9abe14689db82acf1872fa8d358662fc7e123
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-30 08:45:10 +00:00
Anh Thao Pham (pta) ae095de366 [FIX] website_sale: fix AccessError when checking fiscal position
An AccessError can be raised when checking Fiscal Position of user's last order
if connected user belongs to a different company than the company of the order.

opw-2370903

closes odoo/odoo#61022

X-original-commit: 1b602c1fef0f2d05c94a9547e203ae8ecd24e87b
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2020-10-30 08:08:03 +00:00
Antoine Vandevenne (anv) 0cbf2addfd [FIX] doc: fix link and rendering issues in email gateway page
closes odoo/odoo#60755

X-original-commit: f4d3a6b3cf3672a6fa7b67f8a0070b3db21ecb5d
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2020-10-26 15:03:47 +00:00
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Xavier Dubuc eac3c08ce2 [FIX] mail: fix handling of lastVisibleMessage in channel seen condition
also fix a problem with composer.hasFocus field not always correctly
updated (e.g. when switching from a channel to another in discuss)

task-2278915

closes odoo/odoo#61007

X-original-commit: ecb56a6893dd7b76402c2262fb93f8dea079fde0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-29 16:35:37 +00:00
Mihran Thalhath d296469ff4 [CLA] signature for MihranThalhath
closes odoo/odoo#61001

X-original-commit: b72055ea365fa39a0f815605a50d5ed3de13cbbc
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 15:40:26 +00:00
Andrea Grazioso (agr-odoo) f505444655 [FIX] stock: delivery date cause fail in production scheduling
Create 3 items:

* FP
 ** manufactured from SFP
 ** reordering rule
 ** manufacture lead time 2 days
* SFP
 ** manufactured from CP
 ** reordering rule
 ** manufacture lead time 2 days
* CP
 ** buy from vendor
 ** reordering rule
 ** manufacture lead time 2 days

Create a sales quotation:
 * Product: FP
 * Delivery Date: +7 days from now
Save and confirm
Run scheduler.

No Manufacturing process will be started.
This occur because the reordering rule (orderpoint) check the
quantity needed at the current date + lead days, while the move
are being planned for the delivery date specified by
the user in the SO.
Moreover the quantities that depends on datetime.now() are not recomputed
so each scheduler run is failing to schedule new orders

opw-2366925

closes odoo/odoo#60993

X-original-commit: 06eaf867ec7cac15a5cd9c972321f6f5d3c194bf
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-10-29 14:00:05 +00:00
Julien Castiaux 7da8e14669 [FIX] config: empty argument --foo= to disable
In the odoorc file, set a `logfile` path, but disable it via the command
line with `--logfile=`. The logs are output to the logfile configured in
the config file instead of stdout.

Parsing `--logile=` yield an empty string which was interpreted as
argument not set and skipped.

Closes #3852

closes odoo/odoo#60992

X-original-commit: bae0d99b8d654283be4d265e3b40a83247a2299c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2020-10-29 13:50:07 +00:00
Yannick Tivisse c5550eed5a [FIX] resource: Fix erroneous date/datetime comparison
closes odoo/odoo#60975

X-original-commit: febd3251aa970f6711f303d539eeeabebf16e818
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-29 11:42:31 +00:00
uso-odooandLucasLefevre 28a9e90dce [FIX] fleet: Fix access error on assign driver linked to internal user
Currently, Failing at base/models/res_partner.py#L535
We write on the partner because of the related `plan_to_change_car`

When Assign driver linked to internal user without admin rights
it gives an error in security rules due to write on partner.

So while creating the vehicle when driver is assigned pop the value
for related field plan_to_change_car and rewrite the same with sudo.

closes odoo/odoo#60358

Issue: #54199
Taskid: 2309192
X-original-commit: af21dba516de688743f75e6ffb3bc3341578e37a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: LucasLefevre <lul@odoo.com>
2020-10-20 10:43:36 +00:00
Samuel Degueldre b1654e5b2b [FIX] web_editor: fix issues related to loading image info
In order to allow modifying background images, we need information on
the image, this is done by creating a placeholder img and calling the
loadImageInfo function on it. However this function did not account for
the case where an image had not src attribute, which causes an
unnecessary rpc. Other problems could arise from this as an attachment
that doesn't have the correct mimetype but has a matching src could be
returned, causing its image_src field to be false, which we would then
attempt to load as a valid image, causing crashes.

This commit fixes that by not trying to load image infos when the src of
an image is empty, only looking for attachments of the supported
mimetypes, and also checking that we actually did receive an image_src
before setting it as the original src of the image, which will prevent
accidentally trying to load a falsy src as an actual image.

closes odoo/odoo#60982

X-original-commit: b0993370b6fcec1f966e4bf2994eee7f31da82d5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-29 12:27:13 +00:00
qsm-odoo 9e193cb898 [FIX] web_editor: properly allow to select a bg color for badges
Before this commit, the badges' background color was not possible to
edit: the previews were done correctly but the background color was
removed after final selection.

This was because the background color property is animated on badges,
messing with the related edition function.

Closes https://github.com/odoo/odoo/issues/59337

closes odoo/odoo#60820

X-original-commit: 34238b77ace7e6feeb1f9e693d7cd3b12786505d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-27 14:38:01 +00:00
Priyanka Kakadiya 028495491b [IMP] test_mail: add test for multi company chat
this commit add a test case for the multi company chat.

LINKS:
PR https://github.com/odoo/odoo/pull/47398
Task 2207147

closes odoo/odoo#60989

X-original-commit: cd02e4290a708f9141fcd19773b6f01b47507274
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-29 13:12:34 +00:00
Laurent Smet 364c3f1ff9 [FIX] l10n_et: Fix 3 invalid lines in account.account.template.csv
These lines have an additional column making reconcile=True instead of False
and chart_template_id=False.

closes odoo/odoo#60986

Note: For some reasons, chart_template_id is not required on account.account.template.
X-original-commit: c0fa380845f2ce7b08083136ebffcc80cf82ec47
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-29 12:58:10 +00:00
Nathan de Pryck 8a12247211 [FIX] account: use _for_xml_id to read action
Use of '_for_xml_id' instead of read in order to avoid
access right issue on 'ir.actions.act_window'.

closes odoo/odoo#60946

X-original-commit: 4e65fbf14491ea97415ede6d10385222c8d4d074
Signed-off-by: ndeodoo <ndeodoo@users.noreply.github.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 09:15:47 +00:00
Antoine Prieels 1a278f7b80 [FIX] pos_adyen: Traceback on negative amount
Show a nice error message when starting negative transactions on Adyen
terminals.

opw-2368978

closes odoo/odoo#60985

X-original-commit: 4dc790629e49c6e78a009fde3a22915944bb5583
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-10-29 12:39:09 +00:00
Yannick Tivisse f3c1a8fbd9 [FIX] resource: _get_resources_day_total is ensure_one
closes odoo/odoo#60974

Valueerror: Expected singleton: resource.calendar()
X-original-commit: af94ac4b4a25048adfd82f1de7fe2dc09755fd56
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-29 11:41:15 +00:00
Achraf (abz) 681d0f7ec2 [FIX] account: Show the customer name instead of journal name in kanban view
Issue

    - Install "Accounting"
    - Go to "Accounting Overview/Invoices"
    - Switch to kanban view

Cause

    The wrong field ("journal_id") was present instead of "partner_id"

Solution

    Change with "partner_id"

opw-2367738

closes odoo/odoo#60970

X-original-commit: e4ac9891450d96149551d19ac2d2f74f410f877c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-10-29 11:23:14 +00:00
oco-odoo 8b3f14087a [IMP] account: improve tests for taxes made on misc operations
- Some tax_base_amounts checks were missing
- The type of repartition used to generate tax lines was not tested; it made the test confusing (as in this case, sales taxes invert their tag, given here the impression the wrong repartition was used, and potentially shadowing a bug)

closes odoo/odoo#60966

X-original-commit: c703b3a2f5a2d4d8bfbf0bc14203dde1b1bdec23
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-29 11:06:08 +00:00
Swapnesh Shah 8e1fdb209c [FIX] mail: add missing context
context was lost while replacing field `email` during https://github.com/odoo/odoo/blob/d62d1e23c876b6154d1ef8d972a482e280430f34/addons/mail/views/res_partner_views.xml#L16

With this commit, we add the same context which is present at the original field at https://github.com/odoo/odoo/blob/12.0/odoo/addons/base/views/res_partner_views.xml#L260

closes odoo/odoo#60955

Fixes: #50978
X-original-commit: 3e9fe7fe3a0714bb7b0370bb941b0be3164db32a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-29 10:27:38 +00:00
Laurent Smet 325af9e412 [FIX] account,*: Manage 'in_payment' state correctly
closes odoo/odoo#60951

X-original-commit: 0a83aa2d6811c3638db151991938473a892c5452
Related: odoo/enterprise#14473
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-29 10:05:55 +00:00
Laurent Smet 516b80fc07 [FIX] account,payment: Fix payment token flow after payment refactoring
- The field 'invoice_ids' no longer exists on account.payment.
- When registering a payment using a payment token, the payment is not posted directly but the payment transaction is processed instead.
It means the payment is not posted until the CRON call. Since 14.0, the journal items can't be reconciled if not posted and then, we can't wait the CRON to update the payment state.
- The payment token is no longer available when registering a payment for invoices.

closes odoo/odoo#60918

Task: 2352628
X-original-commit: 0ad8979cb345805b7b1bdc330621b42e1d625593
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-29 09:25:19 +00:00
Paul Morelle 43dd5c70d1 [IMP] translate: add add/radd methods on _lt class
In order to ease the usage of lazy translation, add the possibility to
add the _lt objects together and with strings.

Adding two _lt objects together or to a string will execute their
translation, so these operations still must be done once the user's
language has been defined.

For example, this is now possible:

    MESSAGES = {
        1: _lt("Hello, world!"),
        2: _lt("Lorem ipsum"),
    }

    def get_text(code):
        return _("Text is: ") + MESSAGES[code]

closes odoo/odoo#60844

X-original-commit: c4596664e5514018c565eaf14b93e000d972bd30
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-10-27 15:18:38 +00:00
Nicolas Martinelli c4beae62dd [FIX] stock: incorrect search view
- Activate stock locations
- Go to Inventory > Configuration > Locations
- Click on the 'Products' stat button

The filters `real_stock_available` and `real_stock_negative` are not
applied although they are in `search_default_`.

This is due to c1f7987f49 which refactored the various search
views of products.

The solution is to add the `search_view_id` in the action. However:
- `<act_window>` doesn't support it
- `<act_window>` is deprecated in 14.0

Therefore, we convert the `act_window` element into a regular `record`
and add the appropriate `search_view_id`.

opw-2371962

closes odoo/odoo#60942

X-original-commit: 9677128c42761123e59fa8187a59864eb89f06e8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-29 08:20:08 +00:00
oco-odoo 2aef5cc5bd [FIX] point_of_sale: use compute_all properly for taxes computation
- Use the tax tags returned by the compute_all for the base lines instead of recomputing them separately

Splitting the computation caused inconsistent computation in some cases between the base and tax lines (one could select the refund distribution, while the other selected the invoice one).

- Pass the is_refund parameter to True if either the quantity or the price is negative (but not both)

Those negative lines should correspond to refund repartition (double-checked with the Belgian tax report in v12).

OPW 2351412

closes odoo/odoo#60925

X-original-commit: 7827581b208b464638a91044462d0bc497025326
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-28 17:01:03 +00:00
Thomas Dieuzeide ef5e1a914e [FIX] core: avoid ofxparse DeprecationWarning
In current Debian version (0.19) ofxparse gives the following warning:

ofxparse/ofxparse.py:40: DeprecationWarning: Using or importing the ABCs from 'collections'
instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
  return isinstance(candidate, collections.Iterable)

Since we can't do anything about it, we filter it for now.

ofxparse already fixed it https://github.com/jseutter/ofxparse/issues/155
A Debian bug report has been opened https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973055

closes odoo/odoo#60880

X-original-commit: 00497c03db080914fed81dc3fc66fa5d45f65a4e
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Thomas Dieuzeide <tdi-odoo@users.noreply.github.com>
2020-10-28 10:06:21 +00:00
yhu-odoo 6991ee3a91 [IMP] purchase: show delivery lead time on product form
In the purchase page of the product form, show Delivery Lead Time by
default.

Task 2357198

closes odoo/odoo#60923

X-original-commit: d107532fb65c9dd78a82c16646d0659a49495ec6
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-28 16:37:06 +00:00
yhu-odoo 5d1eaeb817 [FIX] purchase: Delivery Lead Time not working
Currently the delivery date on PO line will always be set to today if
there is no receipt date on PO, which makes the delivery lead time not
working. Fixed this issue in this commit.

Task 2357198

X-original-commit: 147aa4c67fb912a2e62dd8be1fc770db258e28d0
2020-10-28 16:37:05 +00:00
Romain Estievenart 9348cca0f2 [FIX] web: DropdownMenu autoclose behavior should match Bootstrap
Before this commit, with an opened DropdownMenu component, when the user
clicks on a Bootstrap's dropdown the DropdownMenu doesn't close.

This issue is due to a conflict between the global click listener
registered to close the DropdownMenu and the listener registered by the
Bootstrap dropdown:
the last one prevents the event from bubbling up to the `window` element
and be handled by the first one.

This commit fixes it by enabling the `capture` flag on the DropdownMenu
global click listener, giving it the opportunity to handling it properly
 and close the DropdownMenu.

Note: this commit also fixes an issue when a dialog is opened from a
DropdownMenu (like the favorite's delete action) and prevents it from
closing in the background (e.g. when the dialog is still opened).

opw-1879566

closes odoo/odoo#60928

X-original-commit: 7f1bcc8ceb78729725f65585e923b08f94bf75b5
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-10-28 17:22:48 +00:00
oco-odoo f1f3366bc0 [FIX] account, hr_expense: show correct sign for tax_base_amounts of misc operations' lines
Before this, misc operations always used the balance of the base line as the tax_base_amount of the tax line. This was inconsistent with the invoices, for which we invert its sign when making a sale invoice or a purchase refund (as for those operations, positive amounts are put in credit). This commit should make everything behave in the same way.

closes odoo/odoo#60912

X-original-commit: 2ca3158ce2de596526067dbd86da2ef7d4ae85bd
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-28 14:56:20 +00:00
yhu-odoo 5eee84a6b4 [IMP] stock: Add Check Availability button to picking list view
Add Check Availability button to the control panel of picking list view.

Task 2361283

closes odoo/odoo#60298

Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-28 06:59:00 +00:00