Commit Graph
110261 Commits
Author SHA1 Message Date
Adrian Torres bca2926b01 [FIX] base: properly unlink child views
Before this commit:

* Install module A
* Edit a view from module A, add a custom field
* Uninstall module A
* Reinstall module A
* Try to access the module A's previously modified view
    -> Can't access the view, or even sometimes the app at all.

Cause:

When uninstalling module A, the custom field added to module A's is
properly unlinked, however the custom/studio view is not unlinked, therefore
the view references a field that no longer exists, when accessing the
view it will obviously crash (sometimes the traceback is not even
displayed to the user!).

Solution:

Emulate an ondelete cascade for child views only when in uninstall mode.
2018-07-03 11:11:25 +02:00
Goffin Simon 44bd29fc84 [FIX] mrp: quantity_done with tracked products
Steps to reproduce the bug:

- Create 3 stockable products P1, P2, P3
- P1 is tracked by serial numbers
- Create a BOM for P3 with one P1 and one P2 as components
- Set the quantity on hand to 5 for P1 and P2
- Create a MO for P3, produce it and mark the MO as done
- On the MO in the sheet "Consumed product", the quantity_done for
P1 and P2 are equal to 1.0
- Change the tracking of P1 to "No tracking"

Bug:

- Check the sheet "Consumed product" on the MO and the quantity_done
was equal to 0.0 instead of 1.0

opw:1856340
2018-07-02 14:38:28 +02:00
MOENS Alexandre 45117f0287 [FIX] Project : Changing data & views loading order
This changes the order in which the data and the views are loaded.

Caused a problem in some fringe cases.
Install then uninstall project, playing around with discuss, when reinstalling project ,
system is trying to notify a partner and the weird order
in which the data and the views are loaded makes it bite the dust

opw:1861157
2018-07-02 13:12:03 +02:00
Odoo Translation Bot cebab1eb7e [I18N] Update translation terms from Transifex 2018-07-01 00:24:24 +02:00
Christophe Simonis 58c70226b7 [MERGE] forward port branch 9.0 up to 4ca9ee2548 2018-06-29 13:50:31 +02:00
Martin Trigaux 13f02f2c0a Revert "[FIX] mail: Render mail in the template language"
This reverts commit 5a0dcd3c20.

Same as 6ad6df59b5
Was mistakly merged, should not be integrated into stable
2018-06-29 13:02:16 +02:00
Martin Trigaux 6ad6df59b5 Revert "[IMP] mail: Subject and body readonly if mass_x composition_mode"
This reverts commit 2774e3b4a8.

Wrong manipulation of the "merge button"
The fix was already merged at 5a0dcd3c2
2018-06-29 10:39:46 +02:00
Carlos Dauden 2774e3b4a8 [IMP] mail: Subject and body readonly if mass_x composition_mode 2018-06-28 21:06:32 +02:00
Nicolas Martinelli 5a0dcd3c20 [FIX] mail: Render mail in the template language
On an optimization done for not rendering each time the template, the possibility
of sending the template in the proper language when multiple recipients was lost.

This is being refactoring in master, but for this version, Odoo won't merge a
change in the behavior, although it's the correct one as in previous versions.

Extracted by pedrobaeza from https://gist.github.com/nim-odoo/8a9749037370343f05c7e6681324f576

(cherry picked from commit 386a936)
2018-06-28 21:06:32 +02:00
Nicolas Martinelli fa1f050218 [FIX] sale_stock: performance
In some undertermined circumstances, a `KeyError` might appear in:
https://github.com/odoo/odoo/blob/f9737d79e77e9abf634c8eaa4b6ea331e2aa814d/odoo/models.py#L4898-L4904

Despite the lack of reproducible use case, it seems that this was
introduced from 59b010ac36. In the meantime, other
optimizations were introduced in the prefetching of related fields, and
it seems that the fix is not necessary anymore.

Running the same script than described in
https://github.com/odoo/odoo/issues/19536#issuecomment-333118947 , we
observe the following performances:

Before the fix:
```
On change with 10 lines (10 new, 0 existing) took 0.306
On change with 20 lines (10 new, 10 existing) took 0.221
On change with 30 lines (10 new, 20 existing) took 0.208
On change with 40 lines (10 new, 30 existing) took 0.271
On change with 50 lines (10 new, 40 existing) took 0.306
On change with 60 lines (10 new, 50 existing) took 0.319
On change with 70 lines (10 new, 60 existing) took 0.354
On change with 80 lines (10 new, 70 existing) took 0.382
On change with 90 lines (10 new, 80 existing) took 0.506
On change with 100 lines (10 new, 90 existing) took 0.503
```

After the fix:
```
On change with 10 lines (10 new, 0 existing) took 0.238
On change with 20 lines (10 new, 10 existing) took 0.259
On change with 30 lines (10 new, 20 existing) took 0.250
On change with 40 lines (10 new, 30 existing) took 0.233
On change with 50 lines (10 new, 40 existing) took 0.287
On change with 60 lines (10 new, 50 existing) took 0.325
On change with 70 lines (10 new, 60 existing) took 0.345
On change with 80 lines (10 new, 70 existing) took 0.451
On change with 90 lines (10 new, 80 existing) took 0.496
On change with 100 lines (10 new, 90 existing) took 0.423
```

The fix doesn't seem to be necessary anymore, so we go back to the
previous implementation of the computed field.

Closes #25448
Fixes #19536
opw-1861468
2018-06-28 13:24:15 +02:00
Nicolas Martinelli 10253a735f [FIX] sale: invoice template
- Activate the Sale option 'Tax-Included Prices'
- Create and print an invoice
  => the total is displayed on each line
- Activate the Sale option 'Sections on Sales Orders'
- Create and print an invoice
  => the total is NOT displayed on each line

The option 'Tax Display' only applies to SO, not to invoices. Moreover,
we make consistent the wording.

opw-1856623
2018-06-27 16:17:27 +02:00
Martin Trigaux 7a768bba8f [I18N] mass_mailing: remove Croatian translations from German translation
There was some Croatian translations in the German translation by mistake.
Remove them.

opw-1859044
2018-06-27 12:16:51 +02:00
Adrien Dieudonne 47de788cbb [FIX] web: amount on bank.statement not displayed in mobile
Before this commit, it was not possible to add an amount to a new
bank statement. The input (.o_form_field_monetary) appeared as disabled.

This bug was due to this commit: @a1224f5ca
This rule should be only applied to .o_form_field_radio.

Closes #18887
Task ID: 35832
2018-06-26 13:35:18 +02:00
Lucas Perais (lpe) a2d3663cff [FIX] event, event_sale, website_event: allow portal access to own registrations
OPW 1859364
2018-06-26 13:23:56 +02:00
Christophe Simonis 58c92d9374 [MERGE] forward port branch 9.0 up to 22084bc52e 2018-06-26 12:27:30 +02:00
Nicolas Martinelli 2254b5cf1c [FIX] base: default value in set_multi
Make sure to test `None` instead of any falsy value. Indeed, when we
want to explicitly pass a `False` default value, `set_multi` might
select an incorrect default value.

This is for example the case of `_inverse_product_pricelist`, where
`default_for_country` might be `False` on purpose.

opw-1858271
2018-06-26 09:46:53 +02:00
Josse Colpaert 70ddff760f [FIX] stock: when creating a procurement from a stock move, pass the date_expected as date
Before, when we created a picking manually with MTO+buy products,
put a scheduled date in the future and did "mark as todo", the
date on the po was related to now instead of that schedule date.

The scheduled date of the picking was passed to the date_expected
of the move, but not to the date of the move, which was passed to
the date_planned of the created procurement.  By passing the
date_expected instead of the date of the stock_move to the
date_planned of the procurement, the po will have dates in function
of the scheduled date of the picking.

Courtesy of chienandalu.  Closes #25223
2018-06-25 15:38:23 +02:00
Josse Colpaert d4582cf020 [FIX] purchase: no mrp fields in purchase please
Fields of mrp should not be put in purchase like this,
as it can throw a traceback e.g. if you generate a purchase
based on a picking in MTO.
2018-06-25 15:38:23 +02:00
Nicolas Martinelli 752347cdef [FIX] website_sale_options: prevent double-click
- On the eCommerce, open a product
- Click twice on 'Add to Cart'

The modal is opened twice, with potentially multiple SO created.

opw-1858080
2018-06-25 14:50:33 +02:00
Lucas Perais (lpe) 786c044a39 [FIX] pos_restaurant: don't crash when printer have no url set
Have a printer in a pos.config that doesn't have a url set

Open the pos

Before this commit, there was a JS traceback, since we tried to call
string operation on undefined.

After this commit, we avoid the traceback with a behavior that *looks like* the v9.0's
i.e. we don't care if the url actually means something, we put a message in the console though

OPW 1858063

closes #25442
2018-06-25 09:15:12 +02:00
Christophe Matthieu 8e9936ba04 [FIX] sale: test depend of another module
It may crash when we install only the sale module

backport 513dca4726 from v11
closes #25437
2018-06-25 09:10:06 +02:00
Odoo Translation Bot 268357bf15 [I18N] Update translation terms from Transifex 2018-06-24 00:25:09 +02:00
Lucas Perais (lpe) 5de096dbf2 [FIX] account: aged balance shouldn't display fully reconciled on a period
Backport of 5f105d144d from v11.0

Commit 45c5a07d89 deals with displaying on the aged balance reports
the lines that zero out each other: an invoice and a payment of the same amount for the same partner
However, that commit overlooked that when there is a chain of reconciliation
that puts the report line to zero, it was displayed as well.

This present commit corrects this by making sure there are amls that detail the report lines

OPW 1857860

closes #25421
2018-06-22 13:23:59 +02:00
Goffin Simon 16fb8f0a75 [FIX] web_calendar: Calendar date format incorrect
Steps to reproduce the bug:
- Set a language on your user
- Change the date format in this language and set '%d/%m/%y' (two digit year)
- Open the calendar and select day or week view

Bug:
- The date displayed on the column headings has 'y' where it should have the year.

To check the right date format: http://fullcalendar.io/docs1/utilities/formatDate/

opw:185924
2018-06-21 16:50:51 +02:00
Denis Ledoux 5c70cc24b3 [FIX] point_of_sale: performance improvement to read one session
The fact the pos config name get was doing
`config.session_ids[0].state`
led to the prefetch of fields of all the session_ids of this config
on reading `config_id` for the session form

Therefore, if a pos config had 1000 sessions,
it was prefetching fields of 1000 sessions when you actually
wanted only one session to display in the form.
Among others, the `picking_count` field which is
not stored and quite heavy to compute

In term of time, it went from 1 minute to 1 second
to open the form view of one pos session.
2018-06-21 15:07:24 +02:00
Nicolas Martinelli c70db5d5df [FIX] stock_account: product on AML
When changing the standard price of of a product set in perpetual
valuation, the AML does not contain the corresponding product_id.

opw-1859777
2018-06-21 10:37:32 +02:00
Nicolas Martinelli f8fc006e1e [FIX] sale_mrp, sale_stock: sort moves
`sorted` returns a new sorted recordset, but doesn't modify the actual
one. Therefore, the current code doesn't work as expected.

opw-1824734
2018-06-21 10:32:39 +02:00
Agathe Mollé 76df986fd3 [FIX] l10n_multilang: translate country states name
Backport of bc84eb2035 to 10.0

Countries with several official languages often have multiple names for their
states. Allow to translate the state name for such countries.

Some monolingual countries but, yet, with a need of translation of the addresses
such as China or Germany can add the same flag in their respective l10n_* module

Closes #25340
2018-06-21 09:56:18 +02:00
Christophe Monniez 081259ef25 [FIX] payment_stripe: fix broken test
The direct rendering test assertions were not reached at all because the
conditions were never True.
2018-06-20 16:57:55 +02:00
Christophe Simonis 7dbc995bef [MERGE] forward port branch 9.0 up to 9cb37398f2 2018-06-20 16:48:15 +02:00
Arnold Moyaux 91714d4c46 [FIX] stock: inventory security with translation
Usecase to reproduce:
- Enable multiple languages and companies
- Set one language on the admin and another on the demo user.
- Create a product and a translation for its name (both languages)
- Create an inventory adjustement in a company A for this product
- Switch on demo user (inventory manager rights but in company B only)
- Create another inventory adjustement for company B
- Add the invenory line with the product and save

The Inventory Line multi-company rule raise an access error
because the system set product_name on the inventory_line that is
a related field. Since it changes the product name with its translation
it will update it on other inventory line that have this product. The
other inventory line is in company A and the user don't have access to
it thus the access error is raise.

This adds readonly on the product_name since it should not be update
with an inventory line.

opw-1855137
2018-06-20 14:06:25 +02:00
Olivier Colson b81b9f9ca1 [FIX] account: use today's date as due date for invoices if there is no payment term and no due date was given manually
The code was actually alreadt made in this spirit, there was just as wrong call to the date_invoice field of the model instead of the local variable with the same name, which contained the right value.
2018-06-20 12:32:33 +02:00
Pierre Masereel 9a810565b0 [FIX] purchase: Canceling the receipt of a receipt
Canceling the delivery order created for a "Make to order" product
cancels the related procurement.

But canceling the receipt order created for a "Buy" product" with reordering rule
didn't cancel the related procurement. In some cases, it can block the application
of the reordering rules.

Now the related procurement is canceled when the receipt order is canceled.

opw:1845345
2018-06-19 15:37:26 +02:00
Nicolas Martinelli 8b9b56bd73 [FIX] l10n_ch: default tax
As of 01-01-2018, the default taxes should be 3.7 and 7.7 %.

opw-1854312
2018-06-19 15:27:24 +02:00
Nicolas Martinelli 3e2f85e021 [FIX] purchase: duplicate procurement
The fields `purchase_line_id` on a procurement should not be copied.
Otherwise, issue arise in reordering rules.

opw-1859349
2018-06-19 15:24:47 +02:00
len-odoo dfc37d3407 [FIX] calendar: do not write end time before start time of an event
The end time of a calendar event is constrained to never be before the start
of te event.
However when updating events, one path would first update the start of the event
before updating the end of the event.
So in case where (s_1, e_1) is updated by (s_2, e_2),
with respectively s_i < e_i,
if s2 > e1 then the update would violate the constraint and thus crash
the calendar update.

opw 1854394
2018-06-19 14:12:35 +02:00
Odoo Translation Bot 74c567329a [I18N] Update translation terms from Transifex 2018-06-17 00:26:55 +02:00
Christophe Monniez 27e7d24256 [FIX] packaging: stop removing Odoo lib dir
When removing Odoo Debian package, the directory /var/lib/odoo is also
removed. This directory could contain important data like filestore or
custom modules.

With this commit, this directory is preserved on removal and deleted
when the purge command is issued with a Debian package manager.

Fixes #22138
2018-06-15 11:58:06 +02:00
Christophe Simonis 23a1bce2a9 [MERGE] forward port branch 9.0 up to 90165e2d96 2018-06-14 17:29:56 +02:00
Christophe Simonis 90165e2d96 [FIX] WorkerCron: keep registry alive after job processing 2018-06-14 17:17:13 +02:00
Christophe Simonis 5233dbdb54 [FIX] core: do not clear cache when removing registry from pool
No need to force other workers to reset their cache.
2018-06-14 17:17:13 +02:00
Christophe Simonis c13d67dd25 [FIX] website: valid time zone guessed from GeoIP
The timezone returned by GeoIP may be unknown by `pytz` due to
incompatibilities between GeoIP and pytz databases (which may be outdated).
2018-06-14 15:49:16 +02:00
RomainLibert 84acd427b8 [FIX] website_event: allow controller to read event.registration
The controller /event/<model("event.event"):event>/registration/confirm
was broken since the portal user cannot read event.registration objects.

In 9.0 this was not an issue as we browsed and sudoed the
event.registration, but since in 10.0 this line disapeared so did the
sudo which this commit reintroduces.
2018-06-14 14:14:50 +02:00
qsm-odoo 50418c4811 [FIX] web_editor: properly save media dialog without any image
When saving the media dialog without any selected image, a crash
occurred. Now, it properly closes the dialog.

opw-1858614
2018-06-14 10:47:38 +02:00
Nicolas Lempereur c4ddf55880 [FIX] web_editor: link don't duplicate child text
If we applied a link eg. on:

```
<span>hello <b>world</b></span>
```

The system actually gets the "label": hello worldworld because there is
3 nodes:

 text node: hello
 element node: `<b>world</b>`
 text node: world

Also since "hello worldworld" is different than "hello world",
instead of just keeping existing nodes and adding the link, the system
would replace the selected range by:

 `<span><a>hello worldworld</a></span>'

instead of:

 `<span><a>hello </a><b><a>world</a></b></span>`

This commit ignores element nodes when creating a new link, since when
getting the label of the link from the selection, only the text nodes
insides the element nodes have any interest.

There was a second issue because if we had:

```
<i><a href="hello">world</a></i>!
```

and tried to put a link over "world!", the code would decide: "world" is
inside a link so we will just update that link.

Thus we would get:

```
<i><a href="hello">world!</a></i>!
```

instead of:

```
<i><a href="hello">world</a></i><a href="hello">!</a>
```

opw-1848351
closes #25187
2018-06-13 16:20:40 +02:00
Aaron Bohy f03f2f7c8a [FIX] account: print move lines with no label
Field 'name' (Label) on account_move_line isn't required. When
following the usual flows, it is automatically set by the system.
However, one can manually create move lines without specifying it.

When this occurs, the Sale/Purchase Journal can't be printed
anymore because it causes a crash.

OPW~1857663
2018-06-13 15:51:35 +02:00
Miku Laitinen fd2b130428 [FIX] sale: Add missing import to 'account_config_settings_views.xml' in manifest
Coming from the migration of sale https://github.com/odoo/odoo/commit/f3d715ca94f24f86ce39a4bc6873fe7576ef1860#diff-7ca766af4bd53a0bc808dd3a4ead8317
2018-06-13 15:36:48 +02:00
Antonio Espinosa a8dd1de5c4 [IMP] doc: add i18n section to command line reference
Closes #14042
2018-06-13 15:13:52 +02:00
Josse Colpaert 232d5ca64b [FIX] stock: onchange like pr 25223 2018-06-13 15:07:34 +02:00
Xavier Brochard b10e34ed1a [FIX] web_editor: add <em> as inline tag and remove duplicate strong
This commit closes #24818
2018-06-13 14:56:16 +02:00