Commit Graph
126133 Commits
Author SHA1 Message Date
Lucas Perais (lpe) 645d9dc037 [FIX] account: reconciliation widget partner domain all reconcile accounts
Have an account move which lines have all the same partner
Have a bank statement, without a partner
Enter the reconciliation widget for the bank statement
All the lines appear

Select one of the lines of the account move for the partner

Before this commit, all other lines disappeared from the proposition
including the ones for the partner selected
This cas because when having set a partner on the widget,
only receivables and payables accounts were searched for

After this commit, all account move lines for the partner are searched for

OPW 1942936

closes odoo/odoo#31488

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-02-28 08:57:45 +00:00
Moisés López 72e7976d1e [FIX] account: Faster read_group for account_abstract_payment._compute_payment_amount
Go to Menu / Accounting / Vendors / Bills
Search a partner with too many opened invoices
 - E.g. 713 opened invoices (709 local currency, 4 foreign currency)
Choose all them
Press Open Action -> Register Payment
Wait to open the view.

Before this patch line_profile result

Total time: 1141 s
Line #   Hits  Time            Per Hit    % Time   Line Contents
================================================================
   243   2922   1,139,417,018.0  389944.2     99.9    amount_total = sum([MAP_INVOICE_TYPE_PAYMENT_SIGN[i.type] * i.residual_signed for i in payment_invoices])

After this patch line_profile result
Total time: 12 s
Line #   Hits  Time            Per Hit    % Time   Line Contents
================================================================
   243  2862   11,733,108.0        4099.6     98.1    invoice_datas = invoices.read_group([('id', 'in', invoices.ids)], ['currency_id', 'type', 'residual_signed'], ['currency_id', 'type'], lazy=False)

It means 95x faster

closes odoo/odoo#31313

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-08 06:53:18 +00:00
Aurélien Warnon 92141334f8 [FIX] survey: fix survey statistics computation
Purpose
=======

This commit fixes the shared dict in the survey statistics computation that
causes surveys to incorrectly share the same stats when computed in batch.
2019-02-27 15:20:29 +00:00
Aurélien Warnon eb45f84128 [FIX] survey: fix invitation sending with no page_ids
Puprose
=======

This commit fixes the survey to allow sending invitation even if the survey
has no pages as long as the questions_layout is 'page_per_question'.
2019-02-27 15:20:28 +00:00
Jorge Pinna Puissant 4613d0a80b [FIX] event_sale: on change of events product in SO
Have a product that is an event, with the price of 1500.
Create a ticket for this product in an event, with the price of 600.
In a SO, add a line with this ticket.

Before this commit, when you change the product, to another product that
is also an event, the event, the ticket and the price stayed the ones of
the first product.

Now, the event, the ticket and the price are updated when the product is
modified.

opw-1940368
2019-02-27 12:54:53 +00:00
Xavier Morel 925385fde6 [FIX] base: properly check werkzeug version
Werkzeug version was being checked to avoid passing quote=True to
werkzeug.utils.escape (as that parameter was changed to `True` *and
deprecated* in 0.9).

However because DeprecationWarning was made silent by default in
Python 3.2 and the way the check is implemented worked for 0.9 it
looks like nobody really noticed it's broken in the usual manner of
half-assed version checks: works for 0.9.0, doesn't work for
0.12.3 (because lexically 0.12.3 < 0.9.0).

Fix by using proper version parsing and comparing the result of that.

See also: odoo/odoo#28116

closes odoo/odoo#31553

Signed-off-by: "Xavier Morel (xmo)" <xmo@openerp.com>
2019-02-27 12:46:02 +00:00
Odoo Translation Bot 5a3ac7dece [I18N] Update translation terms from Transifex 2019-03-01 02:45:39 +01:00
Nicolas Lempereur 15ea753a0f [FIX] stock: show product qty on searched location
The location_id and warehouse_id fields on product.template are just
dummy field intended to add something in the context that will be used
to compute the data being rendered (eg. for location, the quantity
displayed is the quantity of the product in the searched location).

But the feature was broken at a point, and has been solved in 11.0 with
7c7b099273.

This solution was not implemented in 10.0 up to saas-15 since this is
not acceptable for a stable version.

This changeset is only for 10.0 up to saas-15 to implement the fix
differently.

opw-1945417
closes #31475
2019-02-28 12:42:18 +00:00
Jorge Pinna Puissant ee184bcf58 [FIX] event_sale: unit price changes with the qty
Have a product that is an event, with the price of 1500.
Create a ticket for this product in an event, with the price of 600.
In a SO, add a line with this ticket.

Before this commit, when you change the tickets qty in the SO the price
change from 600 to 1500.

Now, the unit price stays the one of the ticket.

opw-1940368
2019-02-27 12:40:39 +00:00
Odoo Translation Bot f014204447 [I18N] Update translation terms from Transifex 2019-03-03 03:15:43 +01:00
Can Tecim 3eeb34318a [CLA] backport of 5028507ea2 to 11.0
Remove the corporate CLA (only cantecim has contributed in the past) and signs
an individual CLA file instead

closes odoo/odoo#31495
2019-03-01 14:13:50 +00:00
qsm-odoo 395c169db9 [FIX] web_editor: wait for animation end before covering snippets
Part of https://github.com/odoo/odoo/pull/31440
opw-1929133

closes odoo/odoo#31440
2019-03-01 13:52:14 +00:00
qsm-odoo 8405c7f5fa [FIX] web_editor: properly check snippet options
Commit https://github.com/odoo/odoo/commit/c2b8d2a3017256e4ea60a3710bdaab6d1f693d81
made the mistake of considering each dropdown-menu individually while
all are considered to be the same when enabling a class. From saas-11.x,
commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc
will group by dropdown menu but that will be another fix to make.

Part of https://github.com/odoo/odoo/pull/31440
opw-1929133
2019-03-01 13:52:14 +00:00
gustavovalverde c812cc4ebc [I18N] *: remove es_DO translations
Include commit 572d628 again, as it was lost with a forward port.

closes odoo/odoo#31479
2019-02-28 12:39:03 +00:00
Christophe Simonis 023dfaeb6b [FIX] core: correct ir.rule domain generation
Since 934c001680, fasly domains are
correctly OR'ed.
Models without group binded rules were then wrongly reduced to an
`AND FALSE` condition.
2019-02-27 12:27:24 +01:00
Raphael Collet 8a7dc813af [FIX] base: copied views are delete too early
Install Invoicing (account) and uninstall it. It results to a an error
because some views required by `payment.acquirer` are deleted before
the acquirers.

The problem is due to the way copied views are deleted, since 1388b7f
they are removed before the module uninstallation. The related commit
faced a similar problem where copied views were deleted too late
during a module uninstallation.

The two problems are revealing that the copied views have to be removed
as part of the module uninstallation, more precisely after all records
refering to them has been deleted but before the schemas has been
cleaned.

opw-1943286

closes odoo/odoo#31443

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-02-27 10:38:50 +00:00
Romain Derie 63ba2317f8 [FIX] website: get the error view without parsing the view tree
Before this commit:
The `if` condition doing a `View._views_get` was supposed to be a sort of
'hack' for when the error occured in a child view (as the template raised would
be the parent, not the broken child).
But since we refactored that part to use etree, it was actually going into that
condition for every error even if the error was in the called template.
Proof is, we only set `editable` in that if condition, meaning going in the
else would actually prevent to show reset template.

Indeed the following code would always be true:
   et = etree.fromstring(view.with_context(inherit_branding=False).read_combined(['arch'])['arch'])
   node = et.find(exception.path.replace('/templates/t/', './'))
as read_combined returns all the view hierarchy DOM

Note: We could not fix this by checking exception.path against `arch` as we
could have false positive (eg the child view replace the <p> element by another
<p> element which is broken, then the path would be found in the parent view
even if the error was in the child view).

closes odoo/odoo#31515

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-07 10:30:54 +00:00
Odoo Translation Bot 9d4aad2d67 [I18N] Update translation terms from Transifex 2019-03-10 01:36:03 +01:00
Christophe Simonis 6b2e519fbd [IMP] hr_holidays: unmute logger
Since 8da3750cee, logger does not need to
be muted anymore.

This reverts commit f5889303ef.

closes odoo/odoo#31720

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-08 16:49:41 +00:00
Nicolas Lempereur 228a5041bf [FIX] stock_landed_costs: service and landed cost
In saas-11.3 "Is a Landed Cost" (landed_cost_ok) was moved from the
product accounting tab, to the inventory tab.

The inventory tab is only shown for product not of type service, but the
field should be shown when product is of type service, consu or product.

With this changeset, "Is a Landed Cost" is displayed in the top and
"Split Method" is hidden: to specify the split method, this needs to be
done from products in Inventory > Configuration > Landed Cost Types, or
by the list view of cost lines when creating a landed cost.

opw-1949329
closes #31714

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-08 15:14:12 +00:00
Swapnesh Shah 805b75049b [FIX] survey: use correct icon for button
The button was referencing an image that no longer exists since 2015

closes odoo/odoo#29813

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-08 15:24:12 +00:00
Nicolas Lempereur b1a8a15c1a [FIX] project: double rating document name in search
The filter parent_res_name was already in the original search view so
the duplicated one was not needed and caused to have two times the
filter in the search view with possible different behavior.

opw-1949559
closes #31707

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-08 14:04:03 +00:00
Damon Liu df5ba89d5d [CLA] signature for DamonLiu0814
closes odoo/odoo#31694

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-08 14:48:58 +00:00
Luis González fa1210befd [I18N] sale: Remove duplicated term from pot
Commit 6af6da5c5 introduced a duplicated term to the file .pot, which
causes the following error when trying to re-load translations:

```
ON CONFLICT DO UPDATE command cannot affect row a second time
HINT:  Ensure that no rows proposed for insertion within the same
command have duplicate constrained values.
```

This commit removes on eof the duplicates, leaving only the valid one.
```
```

closes odoo/odoo#31683

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-07 21:55:12 +00:00
Martin Geubelle 8316c2d210 [FIX] web: correctly handle (no result) selection in search
In the recent control panel refactoring, selecting '(no result)' (when using the
autocomplete on a many2one for example) was no correctly handled and was leading
to a traceback.

It is now correctly handled and the search bar is correctly re-rendered.

Task 1936745

closes odoo/odoo#31438
2019-02-27 10:33:41 +00:00
Xavier Morel f9d3b5b7df [FIX] core: order of fields in onchange of SSF
When calling the initial (create / default_get) onchange, the SSF
would send the list of fields in whatever order was provided by the
fields map of fields_view_get.

The web client uses view ordering, and it turns out some uses / tests
have dependencies between onchanges (e.g. _create_payment in
test_account_reports) which break on some orderings of the fields.

Send the initial onchange using view-ordered fields in the SSF as
well.

closes odoo/odoo#31494
2019-02-28 10:58:33 +00:00
qsm-odoo 5149b3d916 [REF] *: definitely get rid of web_editor.base
* website_form_editor, website_sale_coupon

Part of https://github.com/odoo/enterprise/pull/3603
See https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-27 10:03:16 +00:00
Christophe Simonis 4c46dd4f9d [MERGE] forward port branch 10.0 up to 2f139632d6 2019-02-27 10:42:03 +01:00
Jigar Vaghela 373afe2498 [FIX] l10n_in: opening and closing tag mismatch in file l10n_in_chart_data.xml
when forword port https://github.com/odoo/odoo/commit/93d736e905e0d3b110c36ee93af341021eba42c4#diff-8dfc8ecf49a86f02478f1f0a6188f253

closes odoo/odoo#31449
2019-02-27 05:13:32 +00:00
Nicolas Lempereur f8b38f64d3 [FIX] web: keep col group by on 2nd reload
In 187c32c2 some improvements were made for conserving/restoring group
bys on the pivot view.

This introduced an issue on the column group by:

- before reload, if we set manually a column group by (+ icon in the
  header) it would be saved and not lost (unless a context or filter
  in the search view override it)

- after reload, the following manually set column group by are not saved
  anymore on subsequent reload (the column group by at the first reload
  are set back)

This behavior is not normal since the behavior (conserving or losing
column group bys) should be the same at first reload or second reload.

The issue was caused by the duplication of group bys that were not
synchronized (one on the column root header, one on the pivot model
instance).

Without the change, the added test failed with: "Column groupby not lost
after second reload" and product_id is hidding from the object
pivot_column_groupby dictionary (having only "customer").

Using _.clone on initialRowGroupBys was necessary change because without
duplication of "groupbys", the initialRowGroupBys would be changed on
expandHeader which is unexpected.

opw-1941095
closes #31407
2019-02-26 14:54:46 +00:00
RomainLibert 463601a384 [FIX] mail: set mail.activity.type related fields readonly
It does not make sense to be able to write on mail.activity.type using
the related fields defined on mail.activity.

closes odoo/odoo#31469
2019-02-27 14:44:06 +00:00
Martin Trigaux d855e3911f [FIX] orm: backport of 06d73eab62 to 11.0
[FIX] models: do not erase master version

For a translated field with a callable method (e.g. xml_translate), when
modifying the value of this field in another language than en_US, the master
version was lost.

Before this patch:

>>> record.arch = "<h1>Title</h1>"
>>> record.with_context(lang='fr_FR').arch = "<h1>Titre</h1>"
>>> record.with_context(lang='fr_FR').arch
"<h1>Titre</h1>"
>>> record.arch
"<h1>Titre</h1>"  # lost English version

After this patch:

>>> record.arch = "<h1>Title</h1>"
>>> record.with_context(lang='fr_FR').arch = "<h1>Titre</h1>"
>>> record.with_context(lang='fr_FR').arch
"<h1>Title</h1>"  # write had no effect
>>> record.arch
"<h1>Title</h1>"

When modifying a translated HTML field in English, a matching to detect the
difference and avoid losing the translations is done.
This is not supported for update in another language.
The main reason is the difficulty to detect changes in the architecture.

To update translations, the supported way is to go to the list of translations
and update them there.

Before this patch, the given value in another language was given to the SQL
query and made an update in database:
if single_lang or not (has_translation and field.translate is True)
-> True or not (True and False) -> True

If a field is callable, it should also be ignored, the same way than
translate=True fields

opw-1887162

closes odoo/odoo#31451
2019-02-28 07:33:03 +00:00
Adrian Torres 686e6e10ce Revert "[FIX] ir_model_fields: register selection options"
This reverts commit 5f5bb5e26b.

Not really a fix as this was never implemented, to be done in master...

Closes #31466
2019-02-27 18:00:28 +01:00
Martin Trigaux 2f139632d6 [CLA] add Dimitar Apostolov to Savoir-faire Linux CCLA
As signed at opw-1944366

closes odoo/odoo#31413
2019-02-26 14:42:08 +00:00
Adrian Torres 5f5bb5e26b [FIX] ir_model_fields: register selection options
Before this commit:
        -> Debug mode
        -> Settings
        -> Database structure
        -> Fields
        -> Any selection field
=> The field `selection` of the ir.model.fields form view does not
display the selection options of the field being viewed, this is because
the selection field is not registered at `_reflect_field_params` of
`ir.model.fields`.

After this commit:

The field is properly registered; for Selection fields with static
options, these are shown as-is, for fields with a lambda function as
options, the string 'function' is displayed, and for fields using a
function name as a string, the same string will be displayed.

Fixes #28360

closes odoo/odoo#31207
2019-02-26 13:12:05 +00:00
Laurent Mignon (ACSONE) 28f33dc150 [IMP] stock: performance on _compute_product_availability
Improve performance (*3) on _compute_product_availability
`mapped` makes use of orm prefetch, which is inefficient in this use
case when facing high volume.

closes odoo/odoo#30545
2019-02-26 08:32:50 +00:00
Nicolas Lempereur 1c5c762f3c [FIX] point_of_sale: no black bottomed receipt
On some devices and chromium with printing option "Background graphics",
a printed receipt on the point of sale could have a black bottom below
the receipt content.

This is caused by the point of sale black background and happen rarely
because most frequently browser printing remove backgrounds.

opw-1940434
Co-authored-by: Romeo Fragomeli <rfr@odoo.com>
closes #31472
2019-02-28 11:31:01 +00:00
Aaron Bohy 6a8e1b53e3 [FIX] web: search more in many2one: filter on ids
Let's assume a many2one field with a lot of possible values. The
user clicks on 'Search More...'. In the opened dialog, only 160
records are available (their ids have been obtained with a
name_search, with the optional text the user could have typed in
the many2one input).

Before 4cd379cf, that extra domain on ids was removed automatically
as soon as the user interacted with the search view in the dialog.
This was especially useful when there were more than 160 records.
However, this was rather an happy coincidence than a designed
feature.

From 4cd379cf, the ids selection was added to the initial domain
of the list, so they couldn't be removed from the domain
afterwards. The user was thus stucked with its preselected 160
records.

This rev. doesn't restore the former behavior, but rather improves
the current one, as follows:
 - when there is no text in the many2one input (i.e. no value to
   filter on), we bypass the name_search, s.t. all records are
   available in the dialog
 - when there is some text in the input, we perform a name_search (as
   before) to get a list of record ids, and we add a special filter
   to the search view in the dialog (the filter on those ids), s.t.
   the user can remove it if he wants to access the remaining records.
 - finally, the limit is now set to 320, to mitigate the problem

Issue reported on the saas-12.1 migration pad.

closes odoo/odoo#31232
2019-02-26 08:26:51 +00:00
Aaron Bohy a76a958ca8 [FIX] board: clicking on a pivot cell in dashboard
Before this rev., it crashed when the user clicked on a pivot cell
in the dashboard, whereas it should have performed a do_action to
open the records in a list view.

This was due to a leftover event handler (with the handler function
being actually removed) in commit 38dc5c18b.

Issue reported on the saas-12.1 migration pad.

closes odoo/odoo#31367
2019-02-26 08:28:17 +00:00
Toufik Ben Jaa 397f2e6c50 [FIX] account: Use the correct journal on accounting dashboard
- When selecting "Unpaid invoices" or "Invoices to validate" on the
  accounting dashboard, the list view opened doesn't filter with the
  journal selected.

closes odoo/odoo#31397
2019-02-25 09:46:42 +00:00
Lucas Perais (lpe) 74bd66e1b5 [FIX] website_crm_partner_assign: portal edit activity change activity type
On the portal, edit a Lead in order to make/edit the
next activity
Change the activity type

Before this commit, the modal closed when clicking on the selection field
This was because the wrong method was called

After this commit, the modal stays and the activity type is changed

OPW 1943428

closes odoo/odoo#31349
2019-02-25 09:38:39 +00:00
Pierre Masereel e21f185d3c [FIX] payment_payulatam: fix transaction reconsiliation
The reconsiliation code was looking for the aquirer_reference instead of
the reference to find out the corresponding transaction. Which leads to
not finding the corresponding transaction.

This behavior comes from the creation of the moule setting its own tests
in error in PR: https://github.com/odoo/odoo/pull/24802

closes odoo/odoo#31365
2019-02-22 13:37:10 +00:00
Pierre Paridans c0f8690d1b [FIX] lunch,web: display correctly list's cell with text overflow
Installing the 'lunch' module add css rules to the generic list view
styling, modifying the styling of all the list views by the simple fact
of being installed.

The goal of those rules is that in list view a table cell with the
o_text_overflow class should still be displayed as a table-cell (and not
a block/inline-block).

Without the lunch module a list view's cell with the o_text_overflow
class is narrower and break the alignment between this column and the
headers.

This commit moves the necessary rule (display property) to the web
module and apply them globally.

Remark: module's css rules shouldn't override globally the one from
'web'.

Original commit: https://github.com/odoo/odoo/commit/855c6dac25fccaf9312543022001ed0b360d6e13

closes odoo/odoo#31506
2019-02-28 15:08:15 +00:00
William Henrotin abb95e4608 [FIX] mrp: finished moves become raw moves
A workorder has a one2Many to stock.move to represent the production raw moves. Putting 'workorder_id' on the production finished move will set it as raw moves in the workorders

closes odoo/odoo#31132
2019-02-28 14:32:06 +00:00
William Henrotin a5342daf9d [FIX] mrp: missing move reference
A manufacturing order creates its raw move in an onchange when saving the form
view. As the MO has no name at this stage, the raw moves reference stay 'New'
even when marked as done
This commit change the moves reference once the MO is confirmed
2019-02-28 14:32:06 +00:00
William Henrotin f3f9dd8cd7 [FIX] mrp: recordset have not pop() method
The pop() method is not implemented for Odoo recordset. This commit replace it by a simple 'for' loop
2019-02-28 14:32:06 +00:00
William Henrotin d2951fadcd [FIX] mrp: remove unused code
Commit 5ef46664a2 change the workorder
model but some of the old fields was not removed. This clean all
the occurence of these unused part of code.
2019-02-28 14:32:06 +00:00
RomainLibert 86c66273cf [FIX]: hr_holidays: fix typo
closes odoo/odoo#31505
2019-02-28 13:47:09 +00:00
Christophe Simonis 06898fac3c [MERGE] forward port branch saas-12.1 up to f9d3b5b7df 2019-02-28 13:47:09 +01:00
Robot Odoo 012816f85f [MERGE] website_slides: review elearning widgets and templates
Main purpose of this merge is to lint and clean front-end templates and
widgets in eLearning.

Including
 * lint and clean JS and CSS for fullscreen widgets;
 * refactor reordering of slides and categories, handle void categories;
 * refactor category addition and slide archive widgets;
 * simplify progressbar;
 * lint slide like and crouse join widget;
 * improve course main page, restore review tab;
 * various fixes, improvements and lintings;

See sub commits for more details. Thanks to everyone involved in this
branch. So much people to tag, I have a bit la flemme.

Incoming in a near future: improved main slide page, cleaned fullscreen
widget, design-linted profile page, and probably more fixes.

Merge related to task ID 1941250 (basically, "fix eLearning post-merge").

closes odoo/odoo#31394
2019-02-27 17:47:45 +01:00