Commit Graph
109623 Commits
Author SHA1 Message Date
Arnold Moyaux aab2ceefec [FIX] stock: prevent to create the reception route over and over when deleted once
When the reception route of a warehouse company is deleted by the user
e.g. My company, Chicago Receipt in 1 step is deleted,
and then changing the given warehouse `Incoming Shipments`
multiple times
e.g. from `one_step` to `two_steps` multiple time,
the reception route is created again and again and again.

This is because the reception route which is created for the
warehouse is not being assigned to the warehouse
as the `reception_route_id` once newly created.

_update_routes should work the same way than _create_routes,
it should return new value to write on the warehouse.

based on preliminary by Denis Ledoux

opw-1836544
2018-05-04 14:20:37 +02:00
Christophe Simonis 4b7f4f32ea [MERGE] forward port branch 9.0 up to f12daec1a1 2018-05-03 16:25:17 +02:00
Olivier Dony 78ce64a6a7 [FIX] account: do not block reconciliation on different partners
This constraint was added during the Great Accounting Reform of v9, in
an attempt to help users avoid reconciliation mistakes.

It turns out that such mistakes are difficult to make in normal
situations, since the system only offers matching entries to reconcile,
so the constraint is largely redundant.

On the other hand, it does block legit cases of reconciliation,
such as those where a large number of lines with different partners are
reconciled together. This often happens when reversing a Journal Entry
that encompasses multiple customers, such as a POS closing entry, or a
manual entry.

To make the system more flexible, let's consider that when a manual
reconciliation breaks the "single partner" rule explicitly, it's for a
good reason, so we should allow it.

OPW: 1840437

Backport of 8e73023f68
2018-05-03 12:17:55 +02:00
Goffin Simon 7353405aa4 [FIX] stock: Scheduled date purchase order wrong
When running the scheduler for a reordering rule, the delivery lead time
of the seller was not taken into account.

opw:1837550
2018-05-03 10:29:14 +02:00
Nicolas Lempereur f12daec1a1 [FIX] web: don't change page before saving
When we edit a list view and change page before the change has been
savec, the saving and page changing will be done concurrently thus
possibly causing an error if the page is changed before the saved is
finished: the save will try to modify the page that is no more
displayed.

In this change, the list view editable wait for the saving to be
finished before reloading its content.

note: for 9.0 up to saas-15

opw-1839149
closes #24471
2018-05-03 09:11:44 +02:00
Nicolas Martinelli 79bbd1dcb8 [FIX] product: name search not ilike
- Create a product named 'toto'
- Perform a call to `name_search`:
  `self.env['product.product'].name_search('pouet', [], 'not ilike')`

Product 'toto' doesn't show up in the result list.

The domain should take into account that `default_code` can be `False`.

Note: the bug also occurs if the product is called 'trululu'.

opw-1837957
2018-05-02 12:58:52 +02:00
Christophe Simonis a33362bb51 [MERGE] forward port branch 9.0 up to 532b11ce41 2018-05-02 11:01:38 +02:00
Lucas Perais (lpe) 472c5a4f9f [FIX] web_editor: disable button when html field loading
Commit bed33e1ca2 forgot to include the case
where the html field is in a modal

This commit accounts for that case

closes #24500
2018-05-02 09:58:04 +02:00
Odoo Translation Bot 532b11ce41 [I18N] Update translation terms from Transifex 2018-05-01 02:39:26 +02:00
Odoo Translation Bot 5ff3c03410 [I18N] Update translation terms from Transifex 2018-04-29 00:28:03 +02:00
Nicolas Lempereur 416d07f0bb [FIX] account_check_printing: multi payment has amount in words
In the wizard for payment several invoices with one payment, there was a
error when making the previous fix: 29c6c06de7.

The patch still worked because of a particularity of readonly and
related on account.payment but the check_amount_in_words would possibly
not be set when it should have.

opw-1839720
closes #24476
2018-04-27 15:11:24 +02:00
qsm-odoo ce6f8632cc [FIX] web_editor: update summernote copy-paste feature
The copy-paste feature of summernote was messy and led most of the time
to breaking the template you were trying to edit. While it is difficult
to solve as it mostly comes from the lib itself and that the lib is in
a complicated state as Odoo had to overridde part of its internal code
for its own purposes, this commit hopes to solve the problem by updating
only the copy-paste feature to the latest summernote version.

Of course, as summernote changed a lot meanwhile, it was not possible to
just take the up-to-date summernote file. This commit refactores the
up-to-date summernote clipboard code so that it fits the old summernote
version Odoo is using.

Note: the main problems occurred while using Windows/Mac and not Linux.

opw-1837818
2018-04-27 12:28:57 +02:00
Olivier Colson edc955d28d [FIX] base: currency: add missing dependance to compute function of 'rate' field 2018-04-27 10:47:52 +02:00
Nicolas Martinelli 517fb99926 [FIX] mail: emoji substitution
- Create a message with 100k+ smileys
- Send it to a colleague you hate
- His (and your) web browser starts eating up all the memory
- Go cry to the technical guy because you can't use Odoo anymore.

On some browsers, like Chrome, the image rendering consumes a lot of
memory up to the point it makes it unusable.

opw-1831610
2018-04-27 08:08:36 +02:00
Nicolas Lempereur b6a1389b8c [FIX] web_editor: firefox remember CTRL+A selection
In firefox the range when doing CTRL+A is the first level content of the
contenteditable element, but this was not taken into account when
"remembering" the range after clicking on buttons or features of the
editor.

In chrome the selection begin with the first displayed element (so it
may not be a direct child of the editable and is taken into account in
the code).

opw-1824017
closes #24424
2018-04-26 17:06:05 +02:00
Goffin Simon feba353c65 [FIX] purchase: Wrong Fiscal position in multicompany
Steps to reproduce:

 -Create company A
 -Create company B
 -Admin user with both companies but currently in company B
 -Create Demo user only with company B
 -Create fiscal position A to company A
 -Create fiscal position B to company B
 -Create vendor with fiscal position A with company A and the same vendor with fiscal position B in company B
 -Create product and add the vendor created before
 -Set like Create a draft purchase order
 -Logging with Demo user
 -Create sale order with one sale order line with route make to order
 -Validate sale order

Bug:

 The purchase order created by sale order had the fiscal position company A.

Backport of this commit: 5bb6517072
Closes #23561
opw:1825098
2018-04-26 16:29:34 +02:00
Nicolas Martinelli bcd4c90a71 [FIX] web: get_file and CPU time exceeded
- Create a binary field which takes some time for computation. For
example:
```
ding_dong = fields.Binary(compute='_compute_ding_dong')

def _compute_ding_dong(self):
    if not self.env.context.get('bin_size'):
        while True:
            3*3
    for x in self:
        x.ding_dong = x.product_id.image_medium
```
- Run the server with a limited CPU time, for example:
  `--workers=2 --limit-time-cpu=10`
- Download the file

A JS traceback occurs, without any information about the real crash.

The error management is simply not working: `JSON.parse` is called on a
string which is not JSON-parseable.

opw-1838832
2018-04-26 15:14:47 +02:00
Goffin Simon 409970c188 [FIX] payment: Error to get the default country for a partner
When there was no company_id in the context and the company with id=1
didn't exist it generated an error.

opw:1838932
2018-04-26 15:14:26 +02:00
Nicolas Martinelli da27836f45 [FIX] account: unreconcile payment
- Company currency in EUR
- Create 2 rates for USD:
  1.0 on 2018-01-01
  0.5 on 2018-02-01
- Create an invoice on 2018-01-02 of 111 USD
- Register a payment on 2018-02-02 of 111 USD
- Unreconcile the payment

An error occurs: 'You are trying to reconcile some entries that are
already reconciled!'

In this specific case where the rate decreases, the exchange rate entry
is reconciled with the payment, so we need to keep the payment entries.
2018-04-26 08:37:33 +02:00
Toufik Benjaa 76c17ab3f5 [FIX] stripe: Fix float representation error
- Stripe needs to have the amount in integer, so we have to multiply by 100 the amount.
  Which sometimes create float representation errors and remove/add ~1 cent on some transactions (i.e 72.60€)
2018-04-23 16:25:49 +02:00
Nicolas Lempereur 29c6c06de7 [FIX] account_check_writing: write multi payment
When you pay multiple invoice with one payment, you need the write
permission on account.journal, this had been solved when registering a
payment for one invoice in 91ca84644

In this commit, the same logic is applied on account.register.payments

opw-1835888
opw-1834343
closes #24369
2018-04-23 16:23:19 +02:00
Goffin Simon e4731d0327 [FIX] base: Traceback when creating a partner with an ascii character
Steps to reproduce:

- Go to the Contact
- Create a new contact with an email address with an ascii character

Bug:

A traceback was raised.

Closes #19852
opw:1837714
2018-04-23 16:18:03 +02:00
Christophe Simonis 2d12ae3202 [MERGE] forward port branch 9.0 up to c9e7433c23 2018-04-23 14:07:12 +02:00
goliveirab 6157750a66 [FIX] l10n_mx: account 802.02
Changing account nature D > A, 802.02 Contra Cuenta CUFIN

Closes #24331
2018-04-23 13:53:24 +02:00
qsm-odoo c9e7433c23 [FIX] web_editor: prevent crash on outside-iframe click
The editor is performing text selection check when clicking on the
window. However, when clicking outside the iframe an editor is running
in, a crash may occur as the editor was trying to check a range outside
of its environment (the iframe).

Related to opw-1837818
2018-04-23 12:56:34 +02:00
Stefan Rijnhart 04b0d761e4 [FIX] core: Validate custom views without an XML ID
Regression of fc91feda30

Closes #23646
Closes #23626
2018-04-23 10:27:40 +02:00
Christophe Simonis 3bee6ebb0a [FIX] core: effectively warn on invalid custom views
Since new-api migration of `ir.ui.view`, the method that check views
raises exceptions instead of returning a boolean. Show them as warning.

Related to #14521
2018-04-23 10:12:16 +02:00
Lucas Perais (lpe) cd6150fe9e [FIX] web: NFD UTF-8 for safari in upload file
Before this commit, when uploading a file as attachment in Safari,
The file icon kept on showing 'downloading' whereas the request was successful

This was because the return from the server had a different UTF-8 norm than Safari

After this commit, it works well

OPW 1836545
closes #24307
2018-04-23 09:00:11 +02:00
Aaron Bohy e43b9ab9c6 [FIX] web: ListView: no infinite loop on empty nameget
Assume a list view with a many2many field, and a record for which
that many2many contains a single value, whose nameget returns the
empty string (which is a falsy value in JS). Before this rev., it
triggered an infinite number of namegets, and the browser crashed.

It was because the cell was re-rendered when the nameget returned,
and in the rendering of the cell, it re-performed a nameget if
the value was falsy.

opw 1838255d
2018-04-23 08:20:23 +02:00
Odoo Translation Bot 851356bf23 [I18N] Update translation terms from Transifex 2018-04-22 00:28:35 +02:00
Jeremy Kersten b16c4f50d4 [FIX] website_sale: avoid traceback when category don't exists
In case the category is given in GET, ?category_id=xx, we cannot guarantee that
the category exists

This commit closes #24235
2018-04-20 16:00:30 +02:00
Akim Juillerat 4d88e8e822 [FIX] hr_holidays: update _check_holidays constrains
It was possible to edit a leave request in order to use a leave type
which had no more days left. This was due to a missing field in the
constrains call.

Closes #24320
2018-04-20 14:13:51 +02:00
Nicolas Martinelli 0dd08bd148 [FIX] mrp: change BOM
- Create a MO for Product A with quantity to produce of 2
- Produce 1
- Open the associated BOM, and add a line to the bom
- Go back to the MO and try to update the qty to produce to 1

Traceback: division by 0

opw-1838006
2018-04-20 10:11:11 +02:00
Olivier Dony b61aad2f6b [FIX] hr*: restrict personal employee fields at model level
Fixes #12077
Closes #12160
2018-04-19 18:51:01 +02:00
Raphael Collet 23431389c3 [FIX] models: bad setup of inherited custom fields
Assume a custom field F is defined on model 'res.partner'.  The setup of F may
silently fail because of missing stuff.  In that situation, setting up the
field inherited from F on model 'res.users' should also silently fail.

To reproduce the bug, install Invoicing, create a related custom field F on
'res.partner' with 'property_account_position_id.active', and install another
module.  Setting up F after loading module 'base' will fail because the field
'property_account_position_id' does not exist yet.  The error is not caught by
the inheritance of F on model 'res.users', and the installation crashes.

OPW 1835872
2018-04-18 17:26:05 +02:00
Raphael Collet 87b42ad9a8 [FIX] models: make group by date and order by date work together
The issue occurs when `read_group` is called with a date/datetime field to
group and order on, and the group_by is qualified, such as:

    model.read_group(..., groupby=['date:week'], orderby='date')

The ORDER BY clause in the query should use the same term as the GROUP BY
clause for the corresponding field.

OPW 1834148
2018-04-18 15:47:30 +02:00
Christophe Simonis 2f037a13ca [MERGE] forward port branch 9.0 up to cf163d19ee 2018-04-18 11:32:27 +02:00
Alexandre Kühn cf163d19ee [FIX] board,web: edit custom views in place
Before this commit, whenever we do an operation on any of these custom views,
such as folding it, the custom view was saved by creating a new one.

This behaviour comes from a lost feature to undo operations on custom views.
Since we do not have this feature anymore, it makes no sense to create new
custom views on save, instead of applying the changes in place.

With this commit, custom views are edited in place.

Fixes #23712
2018-04-17 17:32:27 +02:00
Nicolas Lempereur 91ca846447 [FIX] account_check_printing: write payment not journal
When we make a payment, we need the write access on account.journal
because check_manual_sequencing on account.payment is a related field
of account.journal and was used to decide on numbering the check or not.

With this change, the write access is not required.

opw-1834343
opw-1835888
closes #24281
2018-04-17 17:26:19 +02:00
Aaron Bohy 74e208eabf [FIX] base: export translations for added terms
in commit f27e86b
2018-04-17 15:36:05 +02:00
tgroutars f27e86bdde [FIX] base: no crash when setting wrong relation to m2m
Before this rev., in the ir.model.fields form view, it crashed
when the user specified an invalid model name as a relation for
fields of type many2many (the onchange crashed). This rev. displays
a warning instead.

opw 1837401
2018-04-17 14:46:54 +02:00
qsm-odoo 5d13a2f431 [FIX] web: properly right-align numbers in grouped list views' rows
The 'oe_number' class was replaced by 'o_list_number' but this was not
properly done for grouped list views. As a fix, the new class is added
on top of the old one to not break potential customizations.

Proper fix will be done in master.
See https://github.com/odoo/enterprise/commit/a2ce226a2a085b26174cdfd32922517dff39658c

Closes https://github.com/odoo/odoo/pull/23966
2018-04-17 13:37:24 +02:00
len-odoo 1777646d1e [FIX]mail: fix help command in livechat with unlogged user
When an unlogged user creates a livechat, typing the /help command in the
backend would result in the help command sending a traceback.
The function processing the command would assume the existence of a channel
partner name, which is not the case when the user starting the chat is unlogged.

opw:1835484
2018-04-17 13:23:50 +02:00
Nicolas Martinelli 866b48a267 [FIX] mass_mailing: sanitize test email
When sending the test email of a mass mailing campaign, it might be
observed that the result is different from the final email sent to
customers.

This is because the `body` field of the final mail message is an `Html`
field with options `sanitize_style=True` and `strip_classes=True`. On
the other hand, the `body_html` field the test mail is a simple `Text`
field which is not sanitized.

We sanitize the `body_html` field with similar options.

opw-1820064
2018-04-17 09:16:26 +02:00
Edilianny Sanchez - https://www.vauxoo.com/ 57808c4482 [CLA] add edy1192 to Vauxoo's CCLA
Closes #24264
2018-04-17 08:56:19 +02:00
chirag 941ddaee74 [FIX] purchase: pickings stat button visibility
When you create a purchase order for a product of service type, the
picking stat button is displayed but there's no linked pickings. When
clicking on the stat button, all pickings were displayed, which is
wrong.

Issue:#9181
Task:#1817421
2018-04-16 14:23:49 +02:00
Christophe Simonis c92d43c04b [MERGE] forward port branch 9.0 up to 752dcc761c 2018-04-16 12:05:35 +02:00
Kirti Choudhary aaadfd7d76 [FIX] sale: income account in invoice with down payments
When creating an invoice with 'Down payment' option for an SO, it should
first consider income account of the 'Deposit Product'. if it does not
have one then it should consider that product category's income account.

Fixes #23100
Task# 1819531
2018-04-16 11:35:29 +02:00
Christophe Simonis 752dcc761c [IMP] core: load geoip2 database by default 2018-04-16 11:20:39 +02:00
Christophe Simonis 264398de3e [IMP] website: handle geoip2 databases
Since April 1, 2018, free versions of GeoLite Legac y databases are no
longer updated and free downloads not available [1].

[1] https://support.maxmind.com/geolite-legacy-discontinuation-notice/
2018-04-16 11:20:39 +02:00