Commit Graph
127612 Commits
Author SHA1 Message Date
Odoo Translation Bot 47aae6faba [I18N] Update translation terms from Transifex 2018-12-23 01:29:13 +01:00
Romain Derie 88242d6a15 [FIX] website: simplify filter_duplicate
The `filter_duplicate()` method was introduced with b0b6b9afb5 for
website_version.
The module was removed on Odoo 12.0 with https://github.com/odoo/enterprise/commit/51c1bb3cca9ae02fc55cb49ba98cec2901a8e273

`filter_duplicate()` can now fit the multi-website behavior more simply.

Closes #29347
2018-12-19 18:24:50 +00:00
Romain Derie e0c67651db [FIX] website: prevent customize options to be reordered
With multi-website, activating a customize option (customize_show view) will
actually duplicate the customize view to make it specific.
By doing so, the duplicated view will have a higher ID than the original, and
the original's siblings customize options.

Before this fix, two issues could be seen:
1. When toggling a customize option, it would appear last in the dropdown
   afterward. This is because of the views being sorted by (priority, id)
   (if the views have the same priority).
2. When toggling, sometimes the views header would be duplicated. This comes
   from the JS code that loop through the returned views and create the DOM
   by adding a header when the view inherit_id is different than the previous.
   Obviously, as 2 views with the same inherit_id could not be grouped together
   now that the specific one has a bigger ID, it will create twice the DOM.

=> Check tests in this commit, they have schemas that will explain it clearly

Note: We don't take priority into account for customize menu view order as it
      would create the same problem as (2.)
      We could have sorted by (inherit_id, priority, name) to avoid the issue
      and give the user possibility to order options in header but it was
      decided we dont.

Closes #29347
2018-12-19 18:24:50 +00:00
Romain Derie ae8232136d [FIX] website: get only specific view children on _views_get()
Before this comit:
The `_views_get()` method would be called recursively for every
`inherit_children_ids`.
At the end of the method, we would get the complete view hierarchy, including
duplicate hierarchies for website specific copies (COW).

Then, the `get_related_views` that is calling `_views_get()` would be overriden
in website module to keep only most specific views.

But this would not be enough as it would leave orphans from other trees:
  - Have a base view 'B'
  - That has an inherited view 'I'
  - That has itself an inherited view 'II'
  - Now make the hierarchy specific on a website from 'I'
  - And add another inherited view to 'I' on the generic tree
This become:
              B
             / \
            /   \
           I     I'
          / \     |
        II  II2   II'

As explained, filtering duplicates would not be enough as it would correctly
remove 'I' and 'II' from the generic tree but would not remove 'II2'.

At the end, it would return "B", "II2", "I'" and "II'".

Now, we correctly return only "B", "I'" and "II'" by ignoring generic trees
when there is a specific one.

Closes #29347
2018-12-19 18:24:53 +00:00
Romain Derie 9411ac0acd [FIX] website_*: get specific view over generic one
Before this commit, self.env.ref would always find the generic view loaded from
the assets.
Disabling a customize_show view on a website would not hide completely the
feature as the self.env.ref would retrieve the active generic one and not the
inactive specific one.

Step to reproduce (on one of the module):
  - Install website_sale_wishlist
  - Disable "Wishlist" on the Customize menu of /shop
  - Go to a product page, the wishlist hearth icon is still there

opw-1914576
Closes #29347
2018-12-19 18:24:50 +00:00
Romain Derie f7df35540b [FIX] web_editor, website(_theme_install): avoid theme.ir.ui.view crash
In a particular case, `_views_get` was mixing apples and oranges, ir.ui.view
and theme.ir.ui.view.

This was the case if a theme has a theme.ir.ui.view t-calling another
theme.ir.ui.view.
(Only theme's sale bridge cause this issue, eg theme_kea_sale.products)
Then, having that theme installed on a website would make all other website
without that theme to crash when opening the /shop customize menu.

Indeed, the theme.ir.ui.view would have the xml_id theme_kea_sale.search.
The generic view `website_sale.products` would have `theme_kea_sale.products`
as inherit child which is website specific and t-call `theme_kea_sale.search`.

Then, on a website witout theme_kea installed, opening the customize menu would
call `get_related_views` that would call `_views_get` that would loop through
inherit children calling `_view_obj` that would not find a view with that key
and would fallback on self.env.ref, finding the theme.ir.ui.view.

Note: `_views_get` might return specific view for another website but that will
      be filtered on `get_related_views` override in website.

Step to reproduce:
  - Have at least 2 websites and website_sale installed
  - Install theme_kea on a website, it will also install theme_kea_sale
  - Go on the website that has not theme_kea installed
  - Go to /shop
  - Open Customize menu, it won't load because of python crash

opw-1914576
Closes #29347
2018-12-19 18:23:36 +00:00
Olivier Dony eb19016ba3 [REV] Revert "[FIX] modules: load demo data fallback"
This reverts commit 5f4a945182.
The cure is worse than the original disease.

The main installation cursor often holds exclusive locks (due to DDL
changes) on vital tables such as res_users. As a result, using
another cursor to perform changes while the main cursor is waiting
is extremely deadlock-prone. And these deadlocks can't be detected by
PostgreSQL as they mix Python-SQL locking, which leads to deadlocked
HTTP workers.

Related to:
- opw-1916918
- #29528
2018-12-21 16:01:31 +01:00
Martin Trigaux f4e7e06a1f [IMP] l10n_{be,ca}: translate the CoA in both base languages too
Same as ea747d23e4 for Belgium and Canada

If somebody chose nl instead of nl_BE as the language (e.g. on the SaaS on
odoo.com, only nl is proposed on startup), the chart of account was not
translated.
Now it will be in both languages.

Rename the translation file so it is loaded by any nl_* language
Add multiple spoken_languages to be sure to load each one via the
process_translation mechanism.

Apply same logic for fr_CA

closes odoo/odoo#29682
2018-12-20 14:35:30 +00:00
Xavier Morel 9dcca1aced [IMP] doc: convert xmlrpc python examples to P3
closes odoo/odoo#29485
2018-12-20 16:35:04 +00:00
Jorge Pinna Puissant 149e04b10d [IMP] website: Explain scope of language in keywords in seo
When there is a website with traduction (for exemple, Spanish and
French). In the Spanish website, at the SEO menu, you can add keywords
using any of the languages (Spanish or French), but these keywords are
only added to the Spanish website.

To avoid misunderstanding between the website language and the keyword
language a tooltip is added.

closes odoo/odoo#29683
2018-12-20 14:05:01 +00:00
Lucas Perais (lpe) f32cdb5ccf [FIX] web: exclude orderedBy when changing action
When activating a filter on a list view,
the environment of the action contained a context with an orderedBy key
which was then used by every controller and model in the various
parallel flows, i.e. changing actions

After this commit, we prevent it by excluding the key when executing an action

OPW 1913190, 1914019

closes #29190
2018-12-05 14:21:44 +01:00
Laurent Smet 379fc6b125 [FIX] account_accountant: Make transfer_account not required without chart template
required: [('chart_template_id','!=',False)] doesn't work because you need to fill the chart_template_id
to install a chart of accounts for your company. Then, the transfer_account becomes required before its installation
and then, you are not able to install a chart of accounts for your company.
2018-12-05 11:13:19 +01:00
RomainLibert 37212fe655 [FIX] lunch: fix lunch_supplier test
In https://github.com/odoo/odoo/commit/e8ac4d79964b852f21e272bc804d151b5b356791 we introduced an
error in the test_search_available_today which broke the test before 10
am everyday

closes odoo/odoo#29265
2018-12-05 10:10:09 +00:00
Jeremy Kersten 1c5ffe1737 [REF] website_forum: mass moderation, modern UI bs4 and clean type
Now forum only allow to post message of type 'question'.
New 'modern' UI with Bootstrap 4
New moderation modal for bulk spam

Co-authored-by: qha <qha@odoo.com>
Co-authored-by: qsm <qsm@odoo.com>
Co-authored-by: jke <jke@odoo.com>

Thanks to @qha-odoo for UI
Thanks to @qsm-odoo for reviewSsss

closes odoo/odoo#29235
2018-12-06 20:49:42 +00:00
qsm-odoo 08807fcba9 [IMP] website: keep social media popover on one row
Before this commit, the social media popover (used in forum but
available everywhere) may break over multiple rows if used on a relative
positioned small button. This however never occurred in standard <= 12.0
so we will consider this not a bug fix. This will however occur with
the upcoming forum refactoring, so we needed a fix for master.

This commit forces the social icons on one row and take the opportunity
to refactor the template to make a simpler and more beautiful popover
by using conventional icons and social media own colors.

closes odoo/odoo#29327
2018-12-06 18:09:54 +00:00
Christophe Simonis d4c65a7ede [MERGE] forward port branch 11.0 up to 2156af480f 2018-12-04 17:11:57 +01:00
Christophe Simonis 2156af480f [MERGE] forward port branch saas-15 up to 9bfc12cb3f 2018-12-04 16:17:49 +01:00
Christophe Simonis 9bfc12cb3f [MERGE] forward port branch saas-14 up to 69d342f54c 2018-12-04 14:59:04 +01:00
Christophe Simonis 69d342f54c [MERGE] forward port branch 10.0 up to 4629a4fb0e 2018-12-04 14:29:52 +01:00
Jairo Llopis 81c26383b0 [FIX] auth_ldap: Avoid sending email for newly created user
If installed along with `auth_signup`, it sends an email when creating a missing user authenticated through LDAP.

It is a confusing message that makes no sense, because the user is, from his POV, not actually creating a new user, but just authenticating with a new app with his known company-wide credentials.

Besides, that invitation leads the user to change his password in Odoo, although he probably doesn't want to do that and have a password for Odoo and another in the LDAP server.

The best option is to disable that email completely, which is what this commit does.

closes odoo/odoo#29243
2018-12-04 12:13:39 +00:00
Nicolas Martinelli d160454226 [FIX] base_vat: Albania
The module `vatnumber` (which is not maintained anymore) uses an
incorrect validation method for Albanian VAT numbers. Therefore, we use
the library `stdnum`, on which `vatnumber` relies for most cases.

opw-1912680

closes odoo/odoo#29280
2018-12-05 13:56:52 +00:00
Julien (juc) Castiaux 3b39c31adc [FIX] website_forum_doc: Not possible to change ToC order
opw-1913300

closes odoo/odoo#29263
2018-12-05 09:41:48 +00:00
Julien (juc) Castiaux fb1ef15a5a [FIX] l10n_be: Account 451200 must be reconciliable
opw-1913108

closes odoo/odoo#29251
2018-12-05 08:48:20 +00:00
Nicolas Seinlet 71af1a710a [IMP] mail: message route speed
When using limit=1, PostgreSQL sometimes use sub-optimal plan like
"Index Scan Backward using xxx". To avoid this, adding a fake sort
will make PostgreSQL to use the same plan as without limit, and in
this particular case, the index on message_id

closes odoo/odoo#29278

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2018-12-04 11:30:14 +00:00
Goffin Simon 16e7a4b4c7 [FIX] mrp: Work Order planned date filed not calculated
The field "date_planned_finished" was not computed when changing the fields
"date_planned_start" or "duration_expected".

opw:2048416

closes odoo/odoo#35537

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-08-08 08:40:49 +00:00
Nicolas MartinelliandMohammed Shekha 868bad0259 [FIX] web: quick create in RTL
- Set a language using RTL (e.g. Arabic)
- Activate mobile mode (through debug mode or on a mobile device)
- Go to the CRM kanban view (make sure no record exist so the no_content
message is displayed)
- Add a new record
- Fill in the name, click outside of the field

The no_content message is displayed over the form view and it is impossible
to save the record.

The root cause is the incorrect structure of the kanban view page in RTL,
leading the user to the wrong element and triggering the wrong event.

We make the structure of the view aware of the RTL configuration.

opw-2046231

closes odoo/odoo#35509

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>


Co-authored-by: Mohammed Shekha <msh@openerp.com>
2019-08-08 07:09:57 +00:00
Nicolas Martinelli 625e2f06be [FIX] web: kanban swipe in RTL
- Set a language using RTL (e.g. Arabic)
- Activate mobile mode (through debug mode or on a mobile device)
- Go to a grouped kanban view (e.g. CRM pipeline)
- Swipe to the left

The column to the left if shown instead of the column to the right.

In RTL, the kanban groups order are inverted. Therefore, we also need to
invert the swipe direction.
2019-08-08 07:09:57 +00:00
Jorge Pinna Puissant 32c2666d18 [FIX] base_import: import with user date parsing pattern
Before this commit, when a user imports an Excel file, with date as
strings. The _try_match_date_time function will try to find the best
date parsing to use in the import without taking into account the
language of the user.

Now, the function will take into account the language of the user when
trying to find the best date parsing pattern for the import.

opw-2046217

closes odoo/odoo#35540

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-08-08 06:22:18 +00:00
Alexis de Lattre 3f634f29bd [FIX] sale_management: remove double menu entry
Sales > Configuration > Products
was present twice

Move to sale.prod_config_main and remove menu_product_settings in master

closes odoo/odoo#35159

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 14:45:33 +00:00
Swapnesh Shah b972cc64a6 [FIX] account: use correct module label
Introduced at db4f62bd11
This was causing issue with upgrade_boolean widget, cf odoo/odoo#20030

closes odoo/odoo#35469

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 12:53:19 +00:00
Gert Pellin cb70c80781 [FIX] pos_mercury: save button
Before this fix the save button in settings was not replaced when
pos_mercury is installed.
Caused by 2 views with the same id.

closes odoo/odoo#35517

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-07 07:33:22 +00:00
Jorge Pinna Puissant 461effb9fc [FIX] l10n_it_edi: checking for Codice Ficale/VAT on invoice for non Italians
Before this commit, when validating an e-invoice there are blocking
errors if VAT or Codice fiscale fields are empty for non Italians
buyers.

After this commit, if VAT or Codice Fiscale fields are empty for non
Italians buyers, the system will allow invoice validation.

opw-2045244

closes odoo/odoo#35515

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-07 06:41:16 +00:00
Nicolas Martinelli dd0e3fee02 [FIX] stock: do not raise error
Although this makes sense to warn the user, a `UserError` stops the
execution of onchanges but do not prevent saving incorrect settings. A
non-blocking warning would be another solution, but one issue remains:
a pop-up is raised when the user opens the settings, even if they are
unrelated (e.g.: open Website settings, an error message implying
Inventory appears).

This reverts commit c7beb9994f.

closes odoo/odoo#35511

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-07 05:59:45 +00:00
Jigar Vaghela 066722b2f6 [FIX] base_vat: validation for Chile and Colombia
Add validation using stdnum library since vatnumber is deprecated.

closes odoo/odoo#35433

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-07 06:19:35 +00:00
Swapnesh Shah 48b3893b84 [FIX] pos_mercury: Fix duplicate xml id
Follow up on https://github.com/odoo/odoo/commit/63f052a40072e3a5487a8fe61c29f29d48807334#r34578119
Due to this https://github.com/odoo/odoo/blob/12.0/addons/pos_mercury/views/pos_config_setting_views.xml#L3 was being replaced by this view (See manifest for info)

closes odoo/odoo#35471

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-06 17:35:10 +00:00
Nathan de Pryck 7386292bce [FIX] account: access to aged receivable report leads to MemoryError
When analysing the code thanks to Pyflame it cames that the 'prefetch_fields()'
function was runing most of the time. In order to improve the global performance,
I change the context of the move_lines : 'prefetch_fields = False'. It permit to reduce the
time of computation of the prefetch_fields and to avoid the MemoryError.

N.B.: The database of the customer (on saas) contains 1.3 millions of entry and to reproduce the issue
I have to set the HardMemlimit to 0.9 Go and the SoftMemLimit to 0.5Go.

OPW-1910422

closes odoo/odoo#29231
2018-12-04 09:54:00 +00:00
Sébastien Theys dc4a9d3db7 [FIX] account,purchase,repair,sale,web: fix report layouts
Following BS4 migration and adding sections and notes.

=====

Document templates:

- Remove margin from <p> in "informations" to allow them to be
	correctly centered vertically on their container.

- Also add a mt- and mb- on their <div> to better handle them going to a new
	line when there are too many of them.

- Add class for section and note to be able to customize them in layouts.

- Add class for price_total to be able to customize it in layouts instead
	of relying on :last-child.

- Add "page-break-inside: avoid;" on the "total" table to not split it
	between pages when it can be avoided.

- Fix sale report template "Informations" to use col-auto just like invoice
	See 6b8d7bb6d6

=====

Boxed layout:
	- fix section & note style
	- fix borders in general
	- fix the total table

Background layout:
	- fix section style
	- fix the total table

Clean layout:
	- fix page number vertical align

task-1889346

closes odoo/odoo#27782
2018-12-03 13:16:52 +00:00
Laurent Smet 869f99b704 [FIX] account: Copy invoice reference to the move
The reference is not copied to the invoice move because the invoice needs the move to get the
right number and then, we need the invoice number to compute the reference.

So, this commit is required to copy the reference to the move after the invoice validation.

/!\ DO NOT FORWARD-PORT!
This behavior has been already fixed in 12.1 but with too much refactoring for a stable branch.

closes odoo/odoo#29391
2018-12-10 10:59:34 +00:00
Nicolas Lempereur b1dbe432f9 [FIX] web_editor: ace have line number+resize
After 11.0, in a code editor (ace editor) on the frontend we could not
resize the editor or see line numbers.

This happen since:

- in 64d47c0bc5 ace editor (used when editing code) was updated.
- in ajaxorg/ace@5bf78e09 the line number bar was set aria-hidden
- in 9de1bc0ee aria-hidden element were forcibly hidden

Thus the column of line number (and used for resizeing) in the code
editor was unwillingly hidden.

Since we don't want to make change in library, we fix this in our
custom CSS for the code editor.

opw-1912824
closes #29399
2018-12-10 16:39:44 +00:00
Christophe Monniez d9b49c8870 [FIX] web: allow string attribute on non stored fields in pivot view
Support for string attribute on fields in pivot view was added in 24f7c7ce7f
In some cases, the field is not stored and read_group method is
overridden to allow its use in a pivot view. Such a field does not
appear in the measures dict trying to set the string attribute, leading
to a client crash.

With this commit, the string attribute is set after the non stored
fields were added to the dict.

closes odoo/odoo#29393
2018-12-10 15:03:47 +00:00
Goffin Simon 0b12ad1260 [FIX] website_sale: Missing fields in the product form
Fine tuning of this commit: 7b20604f2e

Co-authored-by @atp-odoo

opw:1911612

closes odoo/odoo#29373
2018-12-10 08:23:49 +00:00
Juhil Somaiya 689cc4935c [FIX] mrp: fixed product inventory uom issue
Before this commit, we are getting error that product_uom must be
matched because when we're adding line to inventory after updating the
quantity, product_uom changes to Units.

After this commit, error will not be generated as the default value of
product_uom_id is removed.

Fixes #29305

closes odoo/odoo#29371
2018-12-10 09:14:14 +00:00
Lucas Perais (lpe) 17547c1717 [FIX] lunch: write function is multi
OPW 1912897

closes odoo/odoo#29281
2018-12-10 08:13:44 +00:00
Goffin Simon 6035112043 [FIX] hr_holidays: Wrong computation of leave duration
When all days in a calendar don't have the same schedule, it's wrong
to compute the leave duration with the average working time hour per day.

opw:1909145

closes odoo/odoo#29313
2018-12-06 14:45:18 +00:00
Odoo Translation Bot ec4ee14c89 [I18N] Update translation terms from Transifex 2018-12-09 01:16:26 +01:00
William Henrotin 33a6649aa4 [FIX] purchase_requisition: incorrect field
Before the fix we were requiring for product.supplierinfo.requisition_id
which is a non existing field of the model 'product.supplierinfo'. I
just change it then to purchase_requisition_id which is the required
field.

This triggered an error when you add a product selled by the defined
vendor for an aggreement type defined as 'Blanket order'.

opw-1914712

closes odoo/odoo#29342
2018-12-07 16:38:28 +00:00
len-odoo aed0a828e4 [FIX] barcodes: allow special keys input on firefox
Install stock_barcode.
It adds a barcode to the product quantity of the inventory adjustment view.
On firefox special characters are ignored (CTRL, BACKSPACE, Fn...)

closes odoo/odoo#29245
2018-12-07 13:48:57 +00:00
Lucas Perais (lpe) d40956c790 [FIX] account: install a chart of account on another company
1. Create odoo instance with "--without-demo=ALL" option.
2. Install Accounting module.
3. Add Chart of Accounts manually (e.g. code 111111 Bank and Cash and 222222 Other Income)
4. Create Journal.
5. Create Journal Entries.
6. Activate multi-company.
7. Set new company to current user and set the new company as current company.
8. Install accounting localization: Accounting >> Configuration >> Settings >> Install More Packages >> (install any localization module)

Before this commit, there was an error because when installing any module,
the environment in which it happens is in uid = 1 and doesn't have a context anymore
Thus, when arriving in the charts of accounts code, the env's user is still 1
Which doesn't mean anything in V12, since it is the system user

After this commit, the user is retrieved from the request

OPW 1911677

closes odoo/odoo#29310
2018-12-06 16:21:09 +00:00
Géry Debongnie 6d3ada178f [FIX] web: prevent crash when searching for escaped strings
Recent works in the search view (in 12.0) on dynamic filters had an
unfortunate effect: when the user tries to input escaped strings (for
example "test" in custom filters, there was a crash.

The reason is that the JS python parser (or more specifically, the
tokenizer) was unable to parse that as a string.  It worked before
because the web client sent the raw string to the server.  However, with
dynamic filters, this is no longer the case, and we need to parse
domains to be able to combine them.

In this commit, we modify the tokenizer to be able to work with escaped
strings.

closes odoo/odoo#29324
2018-12-06 15:16:32 +00:00
Toufik Ben Jaa 84b976fb7c [FIX] payment: process payments older than 10 minutes
- The payment transaction processing cron retrieves all the transactions
  that need to be processed.

  In some cases, it can causes issues when trying to process payments
  that are being process by the payment polling page after returning
  from the payment acquirer.

  To avoid this concurrency issues, the cron will only process payments
  that have been validated for at least 10 minutes.

closes odoo/odoo#29317
2018-12-06 14:09:24 +00:00