Commit Graph
143436 Commits
Author SHA1 Message Date
Xavier BOL (xbo) 45fb9641b1 [FIX] sale_timesheet: not use demo data in unit test
Before this commit, we use the 'product.product_category_3'
external_xmlid to find the 'Services' category but this record is in
fact a demo data.

This commit removes this using to create a new category called
'Services' for the product created in this test.

Related PR: #65146

closes odoo/odoo#70869

X-original-commit: dd68808fd074ba776f4a9f6b3218df99b887ae9b
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-17 11:45:26 +00:00
Swapnesh Shah b6e1ad0f77 [IMP] mrp: add float_time widget on durations fields
closes odoo/odoo#59692

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-06 16:09:58 +00:00
Géry Debongnie dc0897ca29 [FIX] web: update owl from 1.2.5 to v1.2.6
This commit updates owl to the latest release. It only contains a small
fix to the router (route params handling)

Release on github: https://github.com/odoo/owl/releases/tag/v1.2.6

closes odoo/odoo#71039

X-original-commit: 65c1f4c0cb3659fe345ed1e63d3980835565a21a
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-05-19 13:49:33 +00:00
bbh-odoo 48230c4744 [FIX] l10n_in: fix the xpath
Currently, there is traceback while installing the l10n_in module
due to the wrong xpath.

So in this commit, fix the xpath and added the l10n_in_code inside
the uom_ids's tree view instead of uom category.

closes odoo/odoo#70157

Taskid: 2515007
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-05 07:18:17 +00:00
Demesmaeker 5fd86a5c9f [IMP] payment: add a sequence to the payment icons
The user can reorder the payment icon to put his favorite forth.

task-2512101

closes odoo/odoo#69972

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-19 14:09:14 +00:00
jbw d5e290b595 [FIX] account: fix reconcile rule percentage calculation
In https://github.com/odoo/odoo/pull/52529/commits/078a3a0f760ff24d02070a343f28d2249a8b5ba7#diff-c217a13a40a3cc27dc516b899793abecfac8cab9a42fed407d4776bcbc9de9a8R812
the way the percentage is calculated is changed.
This implies that a reconciliation rule allowing a 90% matching amount will not allow to reconcile
a 90$ bank statement with a 100$ invoice (as it will calculate the % as 88.89%, not meeting the required 90 %)

After cited commit:
invoice 200, bank statement 180:
(|-180| - |20|) / |-180| * 100 = 88.89%
invoice 200, bank statement 220:
(|-220| - |-20|) / |-220| * 100 = 90.91%
credit note 200, bank statement -180:
(|180| - |-20|) / |180| * 100 = 88.89%
credit note 200, bank statement -220:
(|220| - |20|) / |220| * 100 = 90.91%

Now:
invoice 200, bank statement 180:
100 - |20| / |(-180 - 20)| * 100 = 90%
invoice 200, bank statement 220:
100 - |-20| / |(-220 - -20)| * 100 = 90%
credit note 200, bank statement -180:
100 - |-20| / |(180 - -20)| * 100 = 90%
credit note 200, bank statement -220:
100 - |20| / |(220 - 20)| * 100 = 90%

closes odoo/odoo#71030

Task: 2427089
X-original-commit: 5800f20ccf63ef8482d1460f46c8c5fe30eac822
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: jbw-odoo <jbw-odoo@users.noreply.github.com>
2021-05-19 11:31:41 +00:00
Thibault Libioulle 64969cfccf [FIX] project: change default stage when changing project
Prior to this commit, the default stage didn't follow the value of the
display project id as the project_id was only updated after the write
call.

This commit makes the project_id to be updated after the display
project id changes.
This allows the default stage to be updated too once the onchange is
done.

Tests
---------------

This commit changes the behavior of a test making the use case more
smooth.
Previously, when a user removed both display project id and parent id
from a subtask, the project id was set to False. Now, if the display
project id is removed, the project id goes back to parent project, and
when the parent is set to False, it doesn't affect the display project.

PR: #50576

task-2522066

closes odoo/odoo#71029

X-original-commit: a908b9e8e6577bb7f8c8769db730c855fcad9504
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-19 11:31:18 +00:00
Thibault Libioulle bc86a101a8 [IMP] project: add tests for subtasks
This commit adds tests concerning PR #62577.

Tests also address errors in PR #68647 and #69170.

PR #70576

task-2388034
task-2522066

X-original-commit: b76e277f03c881ce6fd4d92fc8c8fb3e0ab704ea
2021-05-19 11:31:17 +00:00
Yannick Tivisse f2d4ae20f1 [FIX] hr_work_entry_contract: Avoid traceback
closes odoo/odoo#71018

X-original-commit: 6f6d98f0318dabba4171125c4acf38e49d67c11b
Related: odoo/enterprise#18393
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-19 09:36:47 +00:00
Mohammed Shekha ed77ecd87b [IMP] web: format float_time on field blur
Before this commit: when float_time field value changed and field is
blurred, it does not format value and it formats value only when saving
record, this looks awkward and buggy.

After this commit: when float_time field value changed and blurred, value
will be formatted.

task-2518730

closes odoo/odoo#70481

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-19 11:23:53 +00:00
Adrien Widart b93517b7eb [FIX] mrp: use MO's UoM on unbuild order creation
On unbuild order creation, when the user selects a manufacturing order,
the UoM of the quantity will be defined with the product's UoM instead
of MO's UoM.

To reproduce the error:
(Use demo data)
1. In Settings > General Settings, enable "Units of Measure"
2. Create two products P_finished and P_compo
    - Both are storable
    - Qty on Hand of P_compo = 12
3. Create a Bill of Material
    - Product: P_finished
    - Component: 1 x P_compo
4. Create a Manufacturing Order MO
    - Product: P_finished
    - Quantity To Produce: 1 Dozen(s)
5. Check Availability, Produce, Mark as Done
6. Create an Unbuild Order:
    - Manufacturing Order: MO

Error: The unit of measure of the quantity is incorrect, this is
Unit(s), it should be Dozen(s)

The method `onchange_mo_id` defines the product, therefore the method
`onchange_product_id` is also called and here is the issue:
`onchange_product_id` will override the UoM using the product's UoM.

OPW-2467017

closes odoo/odoo#71017

X-original-commit: 1ec10d89ed265e0fb30e98063e80a51a37773ec7
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-05-19 09:36:24 +00:00
Mohammed Shekha d9f2eafdf2 [FIX] web: disale autofill on input elements
with this commit we disables autofill of autocomplete by setting
autocomplete=off, this was previously done in commit: 64293fbdb0
but it was not working because we were setting autocomplete=none
it seems that none does not work all the time.

task-2462676

closes odoo/odoo#71016

X-original-commit: 9d6ef842902e9e192924fa0caba99514e1543352
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-19 08:31:15 +00:00
Romain DerieandArthur Detroux db12ed7cb1 [IMP] website_form: add a spinner and error message for file upload
If a visitor tries to send a file too large, they will get a message after a
while that an error occurred. The message isn't specific enough.

With this commit:
- when a visitor sends a form, a spinner will appear indicating that the file
is being uploaded.
- if the upload fails because the file is too large, the user will be notified.

task-2234699

closes odoo/odoo#70301

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Arthur Detroux <ard@odoo.com>
2021-05-18 11:18:22 +00:00
Tiffany Chang (tic) 3615a5974a [FIX] mrp: remove bom requirement for manufacture replenishment
This commit makes it so boms are no longer required for a replenishment
of a product via the manfuacture route. This change is related to the
v14 refactoring of the manfacturing app to make it more flexible and
user-friendly. In the refactoring, manufacturing orders no longer
require a BoM, therefore a MO created by a replenishment should also no
longer require a BoM.

closes odoo/odoo#64910

Task: 2422698
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-19 06:47:27 +00:00
Tiffany Chang (tic) bf5e1debf9 [FIX] mrp: allow confirming of MOs without components
Prior to this commit, MOs would throw a usererror if there were no
components in it. This restriction made it so MOs created by a
replenishment (i.e. `warehouse.orderpoint`) for a BoM with no components
were never confirmed and the `qty_to_order` would accumulate for each
replenishment's new draft MO.

Steps to reproduce:
1. create a bom for a new product (w/ manufacturing route) with no
   components
2. create and confirm a sales order for the new product
3. go to Replenishment and automate the product's replenishment
4. create a new sales order for the product

Expected result: 2 confirmed MOs where the quantity of the first MO
matches the first sale order's quantity and the 2nd MO matches the
second sale order's quantity

Actual result: 2 draft MOs where the first MO matches the quantity of
the first sale order and the second MO matches the quantity of the first
sale order + the quantity of the second sale order

This commit makes it so MOs can now be confirmed even when it has no
components. Note this requires changing the logic in a few locations to
ensure expected behavior still occurs including:
- backorders are automatically confirmed.
- `reservation_state` is recalculated when expected (will be blank when
  no components).

Task: 2422698
2021-05-19 06:47:22 +00:00
Swapnesh Shah 0454340853 [FIX] stock: use correct action name for inventory adjustments
User correct name for action on Inventory Adjustments view.

closes odoo/odoo#71007

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-18 18:25:09 +00:00
yhu-odoo ee2ded210e [IMP] mrp: no register number check after duplicate MO
To reproduce:
1. create and confirm a MO with register number checks on operations
2. duplicate the MO
The register number checks won't show up in the new MO

We didn't set copy=False for workorder_id on stock.move, when copy a
confirmed MO, the new moves are linked to old WOs on old MO. New WO
didn't link to any moves.
When create quality checks, we only create "register ..." checks for WOs
with move_id. As a result, new WOs without move_id won't have those
checks.
To fix, set copy=False on workorder_id of stock.move

Task 2484939

closes odoo/odoo#71000

X-original-commit: 6aaf337558e59474efcef937f0175ee531b4b477
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-18 16:52:34 +00:00
Jigar Vaghela 1108ad74c3 [FIX] account: bug fix and rewrite query of function _adapt_parent_account_group and _adapt_parent_account_group
before this commit:

_adapt_parent_account_group or _adapt_parent_account_group call with multi-company record then raise singleton error

after this commit:

singleton error is fixed

closes odoo/odoo#70977

X-original-commit: 40797b0705f3df210cbc7119944583addfc72684
Signed-off-by: William André (wan) <wan@odoo.com>
2021-05-18 12:34:45 +00:00
Nasreddin (bon) 8e0a75ba15 [FIX] payment: enable pay button when clicking back button
Issue

    Use Safari (or equivalent) browser

    - Install e-commerce
    - Go to Website -> Configuration -> Payment Acquirers
    - Activate Ingenico in test mode
        (write aaa in required fields)
    - Go to shop, and add product to card
    - Go to checkout
    - Select Ingenico payment mode
    - Click on Pay button
    - When on the ingenico page, press back

    The page is blocked and the button is disabled.

Cause

    When clicking on Pay button, the page is locked and
    the button is disabled.
    With Chrome, when coming back to previous page,
    this one is regenerated and therefore adapt the button.
    In Safari, it is not the case.

Solution

    On `pageshow` event, if event have `persisted` attribute set to
    to true, meaning using cache, then reload page.

Fixes https://github.com/odoo/odoo/issues/69453

opw-2510281

closes odoo/odoo#70906

X-original-commit: c89224940bcc59aab4bddefa95b2b0ef7713e02f
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-05-17 16:50:53 +00:00
Alvaro Fuentes 23afd3642e [FIX] base/ir_model: fix materialized views columns listing
When there is a materialized view that has not been populated any select
on it will fail.

Example of traceback:
```
Traceback (most recent call last):
  File "/home/odoo/src/odoo/12.0/odoo/service/server.py", line 1162, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/odoo/src/odoo/12.0/odoo/modules/loading.py", line 367, in load_modules
    registry.setup_models(cr)
  File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 262, in setup_models
    env['ir.model']._add_manual_models()
  File "/home/odoo/src/odoo/12.0/odoo/addons/base/models/ir_model.py", line 321, in _add_manual_models
    cr.execute('SELECT * FROM %s LIMIT 0' % Model._table)
  File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 148, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.ObjectNotInPrerequisiteState: materialized view "x_bi_sql_view_report_copy" has not been populated
HINT:  Use the REFRESH MATERIALIZED VIEW command.
```

Several upgrade requests have or had had this error which has been
solved with specific scripts.

Related to #40930

closes odoo/odoo#71008

X-original-commit: b208570ce8399bc6d3e4a8ba02eef6558e0a6ccc
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-05-18 18:51:19 +00:00
Hardik Prajapati 992de2223b [IMP] web: quicksearch on selection and boolean field
Currently, the selection field and boolean field values are displays
below the string 'search  for: '
like, Search status for: input value
      New
      Running
      Cancelled

so, this commit improves the quick search dropdown by displaying the
selection field and boolean field value and strings in the same line
like, Search Status: New
      Search Status: Running
      Search Status: Cancelled

TaskID-2462138

closes odoo/odoo#67575

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-03-10 09:59:32 +00:00
Sébastien Mottet (oms) b909911e15 [FIX] website: correctly set accordion ids
data-parent fields were set on tab link and not on the tabpanel
div. It prevented the accordion of having the right behavior:
closing all the other tabs when a tab is clicked to be opened.

closes odoo/odoo#71001

X-original-commit: 51c868bd9bfcd9a7e81f386b0c889befa5dd6e20
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
2021-05-18 16:59:04 +00:00
Aaron Bohy 369b814de2 [FIX] sale_timesheet: fix tour failing randomly
closes odoo/odoo#70989

X-original-commit: 04d582636f5b12a0619f28947e0b44fee0d29908
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-18 15:34:31 +00:00
std-odoo a757cab857 [IMP] mail: allow to force the FROM headers of the outgoing mail server
Purpose
=======
We want to be able to force the FROM headers when we sent email in
SMTP. So we can avoid the emails to be considered as spam.

Specifications
==============
This is done with 2 system parameters.

If the system parameter `mail.force.smtp.from` is set we encapsulate all
outgoing email from with the given value.

If the previous system parameter is not set and if both
`mail.dynamic.smtp.from` and `mail.catchall.domain` are set, we
encapsulate the FROM only if the domain of the email is not the same as
the domain of the catchall parameter.

Otherwise we do not encapsulate the email (same behavior as before this
commit).

Task 2367946
See odoo/odoo/pull/61853

closes odoo/odoo#70980

X-original-commit: 08a561505b92d23c4c4ec4094b0cee209ece8753
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-18 13:35:11 +00:00
Chong Wang (cwg) b31e11bba3 [IMP] snailmail_account: Incomplete address improvements
If 'send by post' is enabled and the address is incomplete when we send one invoice, display:
"The customer's address is incomplete:" followed by a link to the corresponding partner
If 'send by post' is enabled and some addresses are incomplete when we send invoices in batch, display:
"Some customer addresses are incomplete. [number of incompete addresses] Contacts"
and if we click the Contacts, we will be redirected to the corresponding Contacts

Purpose:
When the user tries to send an invoice by post, the system warns him that the customer's address is incomplete.
But then, it's a dead end. The user doesn't have any tool to rectify the situation.

closes odoo/odoo#69469

Taskid: 2502597
Related: odoo/upgrade#2445
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-05-18 06:39:52 +00:00
William Henrotin e43c424fd9 [FIX] mrp: split call to write on stock move
You can, in a production order, change the quantity done of a stock move
raw and change its initial demand ('To Consume' field) in the same
transaction. This can lead to some issue as changing the quantity done
will update the stock move line and changing the initial demand will
unreserve the stock move thus impacting the stock move lines too.

This commit will split the values to update of a stock in move in case
the two fields have to be updated. First the stock move lines, then the
initial demand.

This commit also remove the default_product_uom_qty in the move_raw_ids
fields. This ensure the onchanges do not create/edit any stock move lines
with some reserved quantity.

opw : 2451298

closes odoo/odoo#70975

X-original-commit: e8c1f6b1a3f58b68181bf4d2599bd37efb83b5c7
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-05-18 11:58:11 +00:00
Sébastien Mottet (oms) 7923ec5898 [FIX] website_forum: add data-parent to fix faq accordion
website_forum.faq_accordion is not rendered by a drag'n'drop
and data-parent is therefore not set on tabpanels by onBuilt.

closes odoo/odoo#70978

X-original-commit: d4e046209914a7be3aed976a1fc3a74020843309
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-05-18 12:42:30 +00:00
Sébastien Mottet (oms) 662b53f9b0 [FIX] website: ids in xml for accordion rendered by configurator
accordions in pages created by configurator have not been
added by a drag'n'drop. onBuilt is therefore not called and
attributes (data-parent and id for tabpanel and data-target
for tab) are not set. We set these attributes directly
in the xml to make accordions work also for configurator.

closes odoo/odoo#70974

X-original-commit: 887f6d539ebf4f3a6d95f44f2cdd4152b59d5910
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-05-18 11:57:52 +00:00
yhu-odoo e310d92958 [IMP] stock_picking_batch: cancel empty batch picking
As pickings can be moved from a batch into an another one, a batch can suddenly
be emptied or having no more active pickings.In such case, we cancel it.
This way, empty batches won't be displayed by default as there is a default
filter showing only draft or in progress batches.
If we manually remove all pickings from a batch or create a empty batch, we
consider it intentional, and won't cancel it automatically.

Task-2464457
PR #66600

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-18 12:59:25 +00:00
yhu-odoo d1448b666b [IMP] stock_picking_batch: allow create batch with picking in other
batch

We already allowed the stock.picking.to.batch wizard to create batch
with pickings already in other batches. This commit will also allow you
select pickings that are already in other batches on the batch form.

Task-2464457
PR #66600
2021-05-18 12:47:14 +00:00
Géry Debongnie d403a13a29 [FIX] web: update owl from 1.2.4 to v1.2.5
This commit update owl to the latest release. It only contains a small
fix on the order of lookup for the t-component directive.

Release on github: https://github.com/odoo/owl/releases/tag/v1.2.5

closes odoo/odoo#70972

X-original-commit: 67e706b76fefa7eaff12722a4bda6fa4ce497eaf
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-18 11:57:01 +00:00
Achraf (abz) 8289c291c7 [FIX] sale: Traceback when changing date order
When the user removes the readonly from the field date order and tries
to modify it it crashes in some cases, this commit fix this

opw-2523508

closes odoo/odoo#70969

X-original-commit: 3e4a541277828ec9cd0bd97587c6d87dc91ccf08
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2021-05-18 11:52:43 +00:00
Nicolas (vin) 4db958989e [IMP] account: Extract payment methods into their own file
The account payment file being quite big already,
and the payment methods being modified in another
task (2414749) we'll extract them into their own
file to make it easier to work with them

closes odoo/odoo#70937

Related: odoo/enterprise#18367
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-05-18 07:52:08 +00:00
Laurent Smet 41438824f7 [FIX] payment*: Make tests inheriting of AccountTestInvoicingCommon
This makes tests independant of any demo data and ensure the company configuration is always consistent.
2021-05-18 05:18:52 +00:00
Aaron Bohy 2e030a37aa [FIX] web: domain: (=)(i)like operators
Before this commit, evaluating a domain containing a like/ilike
operator with an evaluation context in which the value was false
crashed.

Moreover, those operators were wrong w.r.t. the case sensitivity:
like was case insensitive, whereas ilike was case sensitive, and
both =like and =ilike were case insensitive.

This commit fixes thoses issues.

The first issue was spotted on our prod, as we tried to add an
invisible attrs in a form view, using the ilike operator (it thus
crashed in create mode).

The second issue was spotted while writting the test cases.

To the best of our knowledge, those operators aren't used in attrs
(for now), explaining why those issues haven't been found before.

closes odoo/odoo#70951

X-original-commit: 44e185dbd6ddeda7cdcd76882fa0bd231e9d3f37
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-18 10:02:14 +00:00
William Henrotin 65fd6a5ef6 [FIX] stock_account: return correct empty value for consumable
Creating an account move from a valuation layer is bypassed in
case the product is consumable. Since 7fa9ec2638, the signature
of _account_entry_move() changed. It no longer return an account move
but a list of values to create everything in batch.
Testing the product type should now return `[]` instead of `False` in
order to be added to the existing list.

closes odoo/odoo#70945

X-original-commit: 5d76ce38a8551f430449b997a875ccc3b5a728cb
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-05-18 09:09:54 +00:00
Antoine Guenet 987fc1190a [FIX] website: prevent editing snippetless website and show message
When starting work on a blank website, it was possible to start writing
text in the blank page. However that was never the purpose and things
behaved improperly from there.

This commit addresses that problem by consistently applying
contenteditable=false to the #wrap element when it is empty, and true
when it isn't.

At the same time it fixes the fact that starting with a non-empty page
and making it empty failed to show the empty editor message.

closes odoo/odoo#70933

X-original-commit: c9ab6ae3e1e1859c36a4f6e68a7cae25cf92a7b3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-18 08:11:47 +00:00
Antoine Guenet 3e76664d49 [FIX] web_editor, website: properly record history on col count change
When changing the number of columns of a snippet, the history was
recorded too many times and at wrong moments, resulting in a mess of
undos to trigger before restoring the original column state.
The issue was due a combination of dead code and the fact that
`_updateColumnCount` triggered `remove_snippet` for each of its columns
while `remove_snippet` in turn triggered a history step at every
execution.
This fixes it by removing the dead code, replacing it where necessary
with a call to the editor's `historyStep` method, and adding an option
to `remove_snippet` so its triggering of a history step can be bypassed.

closes odoo/odoo#70932

X-original-commit: 877e5c807087afed880aeba3eab79def3a7b583c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-18 08:11:26 +00:00
Antoine Guenet 231871ef98 [FIX] website: prevent out-of-bounds url autocomplete in linktools
Since the link tools were moved from the modal to the sidebar, the url
autocomplete dropdown stretched out of the bounds of the window.
This fixes that problem while restyling the dropdown to look like the
url pickers we already have in the sidebar. In order to achieve that,
we apply to it the "o_website_ui_autocomplete", used by
UrlPickerUserValueWidget (to which we don't have access in the toolbar).

closes odoo/odoo#70931

X-original-commit: 704583aad98287adac9e13772cfb8ca0933b0a32
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-18 08:09:25 +00:00
Antoine Guenet e8a6fd31d5 [FIX] mass_mailing: keep the cursor in the promo code when emptying it
When selecting the contents of a promo code then typing a letter, that
letter was inserted before the promo code instead of in it. It was also
impossible to get back inside the promo code after that.

Given the nature of that snippet it seems reasonable to make the promo
code itself unremovable. This way we can benefit from the editor's
ability to keep the cursor in an empty unremovable inline.

Note: This fix requires a change in the editor:
https://github.com/odoo-dev/odoo-editor/commit/1c98f141458de297a4b819f3fb21f532986e9872.
Do not merge without it.

closes odoo/odoo#70930

X-original-commit: ffe0277613f73e046c4e343cfb0197c937063717
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-18 08:07:17 +00:00
Victor Feyens 0348b95aee [FIX] *: update documentation links
Following the recent reorganisation of the documentation in 12.0+,
the majority of the documents have been moved and their old links are no longer valid.
Some redirection rules will soon be deployed, but those rules might be dropped in some years
and we want the links to still work, which is why we still replace the links to the new ones.

FW-Port of odoo/odoo#70675 (13.0)

closes odoo/odoo#70920

X-original-commit: bc9c1eef538ba6095e74c19d5d9ed9e01625ec7c
Related: odoo/enterprise#18361
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-17 19:26:27 +00:00
Jérôme Vanhaudenard 699d676de5 [FIX] expression: Better Binaries logs
When building a domain `(=|!=)` with
a Binary field stored in attachment and
the right part of the domain is not null,
the full binary content is logged, giving
the logs a huge size.

Now, the content of the binary is cropped to
20 chars as it is useless to log more.

opw-2527629

closes odoo/odoo#70740

X-original-commit: 0ed46ae94b20b30c10025b2a458e1ecf92c2712d
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-05-12 11:59:04 +00:00
Nicolas Lempereur 00ce18f407 [FIX] point_of_sale: rounding down near 0
Before 03025520b rounding applied was eg. for these numbers and UP and
DOWN rounding methods to multiple of 10:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    | -2 | -8 | -2 | -8 | -2
UP      |  8 |  2 |  8 |  2 |  8
```

which is correct for positive numbers but UP and DOWN are inversed for
negatives numbers.

After 03025520b this became:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    |  8 |  2 |  8 | -8 | -2
UP      | -2 | -8 | -2 |  2 |  8
```

which is correct for all cases except for positive numbers that are
before HALF of the precision (eg. number 2) for which UP and DOWN are
inversed.

This is happening because 03025520b uses the sign of the rounded value
=> this does not work for 0 so number 2 is broken (and if fixed number
-2 would be broken).

With this commit, the adjustement of sign is done based on original
number, so we get the equivalent of python equivalent methods:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    |  8 |  2 | -2 | -8 | -2
UP      | -2 | -8 |  8 |  2 |  8
```

opw-2451841

closes odoo/odoo#70923

X-original-commit: 23dd2ea535bea0a57dcac773a81e202135cd2ed6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-05-17 20:24:26 +00:00
Olivier Dony 5b4187ba02 [FIX] ir.cron: restore INFO logging of job execution
The "Starting job X" and "Job X done" logs are very useful to monitor
cron executions over time, or to detect a cron job that has been running
for a long time.

Those logs were dropped by mistake in #62124 - this patch restores them.

closes odoo/odoo#70921

X-original-commit: 0db99a9fb00465266485c7f6c8d16760250152df
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-05-17 19:37:23 +00:00
Djamel (otd) 322ff1e2c6 [FIX]sale_timesheet : Convert the project overview values to the current currency
Steps to reproduce the bug:
- Go to Project app
- See the overview of any project
- Select at the top right another company with a different currency. But keep the company assigned to the current project selected

Problem:
The new currency is changed in the project overview, but the values are not converted to this currency.

opw-2479364

closes odoo/odoo#70902

X-original-commit: 7f9cacd40d185bb7c943bd2adb7de1ef8a39c367
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-05-18 08:10:46 +00:00
Nicolás Mac Rouillon 287e42ad72 [FIX] purchase_stock: Use the correct name of method recompute_state.
This bug is cause in this PR https://github.com/odoo/odoo/pull/70312

closes odoo/odoo#70815

X-original-commit: 09def1e550ba2ae67a8595fa561dc073e71cf4a2
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-05-18 06:26:35 +00:00
Valentin Chevalier 17653033b8 [IMP] payment_buckaroo : better handle status code response
Before this commit, status codes were partially handled and users may not had a proper feedback on the status of their payment.

Task #2517498

closes odoo/odoo#69948

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-05 08:23:47 +00:00
bbh-odoo f0c44897c9 [IMP] sale: change default invoicing policy to 'ordered'
Currently, the default invoicing policy is based in `delivered`
quantity since commit: https://github.com/odoo/odoo/commit/3ad4abe171e8e7e86ed0e7b7f000e734d8a2ad92
but due to that onboarding flow is often broken/very complex.
hopefully the statement 'in countries with anglosaxon accounting, that's mandatory' is exagerated.

So in this commit, Default invoice policy is set (back) to
'Ordered quantity'

closes odoo/odoo#69825

Taskid: 2443371
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-04-27 10:53:42 +00:00
Louis Baudoux 60b89987ec [IMP] iap: mock IAP jsonrpc to avoid errors/spam of the real servers
Before this commit, some requests could be sent to the actual IAP
servers during testing. These calls weren't always mocked as many
of these requests are sent in background while performing usual
tasks such as creating a bill.

Now, any call to the function iap_jsonrpc during testing will result
in an AccessError.

closes odoo/odoo#70925

X-original-commit: f31f1972ff0e35deb3005ce160930b70ddc8e531
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-05-18 06:50:16 +00:00
Laurent Smet 0c857ef7ac [REVERT] sale: Fix fiscal pos. mapping taxes to price included
This reverts commit d89562e8fe473692296cb209651beb2ce7a715e4.

Since this commit, the taxes mapped by fiscal position wasn't managed by the _fix_tax_included_price_company method anymore.
Otherwise, some customizations exist on this method that are no longer called.
The 2527940 issue is also due to a remaining bug: the total_excluded price should be divided by the quantity but:
- what if the quantity & price_unit are both signed?
- what if the number of digits for price_unit and the currency are different? Should we skip the rounding of taxes?
Since this commit is not perfect and has a lot of dependencies in others modules, we decided to revert it.

Original PR: https://github.com/odoo/odoo/pull/68997
Revert PR: https://github.com/odoo/odoo/pull/70858

closes odoo/odoo#70914

Issue: 2527940
X-original-commit: def7d7bb0231fef38e044803b245c9b990a90216
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-05-17 18:07:40 +00:00