Commit Graph
116555 Commits
Author SHA1 Message Date
Raphael Collet 2054b59285 [FIX] models: make onchange return a smaller diff
Large diffs (specifically in x2many fields) cause performance issues.  They
overload the web client, which considers all returned fields as dirty.
2018-07-24 17:12:04 +02:00
Thibaud Ducasse c51488c2f4 [CLA] signature for tducasse
Closes #25895
2018-07-24 15:29:31 +02:00
Goffin Simon 41bea4125c [FIX] stock: Delivery slip with quantity = 0 until validation
Partial backport of https://github.com/odoo/odoo/commit/ccafe50500a803fe8c8345ab0318128a92bce3b5

Now the initial demand is used when the state is not done.

opw:1867906
2018-07-24 13:00:06 +02:00
Alexandre Kühn b67b89c315 [FIX] web: correctly align value/text in stat button
Before this commit, the style of the value and text in some stat buttons were
broken.

The design of the stat button is to have a single value and a single text which
are stacked as follow:

  [CSS]                       [Visually]           [Example]

  .o_stat_info                +---------+          +------------+
     .o_stat_value            |         |          |            |
     .o_stat_text             |  value  |          | 10         |
                              |  text   |          | Forecasted |
                              |         |          |            |
                              +---------+          +------------+

However, some stat buttons use multiple values or texts. For example:

  [CSS]                       [Visually]           [Example]

  .o_stat_info                +-------------+      +------------+
     .o_stat_value            |             |      |            |
        .o_stat_info          |  value text |      | 3 Hour(s)  |
          .o_stat_value       |  text       |      | Lost       |
          .o_stat_text        |             |      |            |
     .o_stat_text             +-------------+      +------------+

  [CSS]                       [Visually]           [Example]

  .o_stat_info                +---------------+    +---------------+
     .o_stat_text             |               |    |               |
     .o_stat_text             |  text  value  |    |  Min:  10.00  |
  .o_stat_info                |  text  value  |    |  Max:  20.00  |
     .o_stat_value            |               |    |               |
     .o_stat_value            +---------------+    +---------------+

The latter is works fine with block, which guarantees vertical alignment.
However, the former case has some alignment issues like this:

    [Visually]

    +------------+
    |            |
    | 3          |
    |   Hour(s)  |
    | Lost       |
    |            |
    +------------+

This is due to the use of `display:block` for any `.o_stat_text` and `.o_stat_text`.

This commit fixes this issue, without affecting the other cases.

Task-ID 1841523
2018-07-24 12:51:14 +02:00
Martin Trigaux a425695e92 [I18N] remove es_AR translations
Courtesy of Juan José Scarafía, ADHOC
The quality of the Spanish (Argentina) translations is very poor.
Remove them all and will start from scratch, translating only when needed.
2018-07-24 10:45:46 +02:00
Goffin Simon ca14f232e0 [FIX] base_vat_autocomplete: Create contact using VAT number
Let's install base_vat_autocomplete and  base_address_extended
When creating a contact with a VAT number, the street was not
formated by the autocomplete in a correct way because the function checkVat all the time
returns the street with the following format: '%(street_name)s, %(street_number)s/%(street_number2)s'
and this function doesn't take the street format of the country into account.

So the function _split_street tried to split the street into street_name, street_number, street_number2 with the
street_format of the partner but the street was  not well formated by checkVat.

opw:1867491
2018-07-24 09:54:29 +02:00
Christophe Simonis 219d2296d6 [MERGE] forward port branch saas-15 up to c4ee29345a 2018-07-23 15:45:08 +02:00
Christophe Simonis c4ee29345a [MERGE] forward port branch saas-14 up to 9ee882564f 2018-07-23 14:57:03 +02:00
Christophe Simonis 9ee882564f [MERGE] forward port branch 10.0 up to 6e71cf8a71 2018-07-23 14:21:06 +02:00
Christophe Simonis 6e71cf8a71 [MERGE] forward port branch 9.0 up to af2e480e41 2018-07-23 13:41:04 +02:00
Christophe Simonis af2e480e41 [FIX] http: refresh request environment after authentication
This allow the `/web/session/authenticate` route to return correct
partner and company.

Closes #25652
2018-07-23 13:25:42 +02:00
Ivan Yelizariev 1e1d3ed9e6 [FIX] base: suggested default ACL should be safer
When there is no ACL for a model, the system emits a log with a sample
ACL entry that developers should consider adding. This proposed ACL
should be safe: a default read-only access for internal users
seems appropriate.

Closes #25919
2018-07-23 13:18:04 +02:00
Florent de Labarre 3528e804de [FIX] stock: Error message don't contain the name of product
The message don't show the name of product.

Before the fix:

The message was: "It is not possible to reserve more products of than you have in stock."

After the fix:

The message is: "It is not possible to reserve more products of [0221] Product A than you have in stock."

opw:1868449
2018-07-23 12:09:12 +02:00
Pedro M. Baeza e91f10f14d [FIX] stock: Warehouse sequences with proper company
On a multi-company environment, as sequences are created with sudo,
if admin's company is different from the user creating the warehouse
one, then warehouse sequences are incorrectly assigned to the admin's
company
2018-07-23 10:47:07 +02:00
Goffin Simon 88ff6beb01 [FIX] base_address_extended: Changing country on a partner
Steps to reproduce the bug:

1. Create a Vendor with these address settings

- Name: Vendor123
- Streer" Street:
- Housnumber: 123

>> DO NOT ADD A COUNTRY => by default street_format = street_number street_number2 street_name

2. Create a purchase order for Vendor123
3. print the RFQ

>> ADDRESS FORMAT "123 Street" => OK

4. Go to vendor123 and set "Netherlands" as a country
5. Print RFQ again

Bug:

>> The address was still in format "123 Street"  => NOT OK

When changing the country on a partner, the field street must be recomputed
because the street_format depends on the country.

opw:1865677
2018-07-23 09:27:05 +02:00
Adrian Torres cb4266787b [FIX] ir_model_fields: properly unlink manual fields
Before this commit:

* Install module A that implements model M and field X.

* Create a new custom field Y whose reference model is not M, implemented in
any module other than A.

* Make this field either a one2many, related or compute field depending
on field X.

* Uninstall module A.

=> The registry crashes fatally, the only way to recover from this is to
log directly into the postgres database and manually eliminate the
infringing ir.model.fields record.

The reasons are multiple:

* When creating custom fields that are relational, char fields are used
to hold data like model name, field name, instead of properly storing
the related field, which would let postgres handle the unlinking
properly.

* Despite this, the ir.model.fields method _prepare_update tries to make
up for this by verifying that the ir.model.fields being unlinked during
an uninstallation are not needed elsewhere and drops them, however it
does so naively: It assumes that the "problematic" field will be defined
within the module's scope, i.e. its model reference will be a model
defined by the module being uninstalled, this isn't always the case.

This is solved by getting the dependants of each field by accessing the
model's field_triggers, if there are any triggers (i.e. dependants) then
we add them to a `failed_dependencies` list for later processing. The same
is done for field inverses (only in the case of a many2one).

After finding the failed_dependencies, a check is performed to see if the unlink is
being performed in the context of an uninstallation, in which case the failed
dependencies will be unlinked, otherwise an error will be shown to the user.

This commit is a "backport" + generalization of commit 4265026ee2

Task-ID: 1856263
2018-07-23 07:42:57 +02:00
Odoo Translation Bot e6b570c898 [I18N] Update translation terms from Transifex 2018-07-22 04:09:21 +02:00
Odoo Translation Bot 402aac89a7 [I18N] Update translation terms from Transifex 2018-07-22 00:27:21 +02:00
Martin Trigaux 85423d20b2 [FIX] account: partially revert 3754280a
The changes should not have been merged in stable.
Users installing the account module before 3754280a had a not null constraint
on the field company_id.

After updating the code, the field is still required but has no default value.

If a chart of account is installed after updating the code, it would fail.

opw-1867358
2018-07-20 16:43:42 +02:00
Ivan Yelizariev 592ee660a5 [FIX] doc: remove incorrect statement 2018-07-20 12:27:10 +02:00
Akim Juillerat 3869cdf7d8 [FIX] purchase: Restore push rules behavior in 2 steps reception
Due to this commit: https://github.com/odoo/odoo/commit/ab5fcb29650349fa641c6130bf6dcbdc1ec28a07
When confirming a PO with two lines having the same product,
the stock moves were not merged anymore in the putaway
(input to stock) picking.

Reason:
When confirming the PO, odoo creates first a receipt
(vendor to input) picking and its stock moves matching the PO line.
Then it applies the push rule on each move. Both putaway
(input to stock) moves are created by copying the receipt
(vendor to input) moves, but when the second is created,
odoo check if there's another move to merge sharing same
properties to merge into it. As purchase_line_id is now copied
in both cases, both putaway moves include a different
purchase_line_id and won't be merged together, since this field
is in _prepare_merge_moves_distinct_fields() on stock.move.

opw:1854387
2018-07-19 15:03:11 +02:00
Simon Lejeune 22062d9efc [FIX] stock_landed_costs: wrong price_unitupdate when multiple landed costs
`new_landed_cost_value` was added to `value` to recompute the
`price_unit` field. The issue is that when applying multiple landed
costs, `value` and `new_landed_cost_value` already contains the previous
landed costs, resulting in an erroneous `price_unit`.

This patch only adds `cost_to_add`, which is the current landed cost, to
`value`, which contains all the previous one.

To reproduce:
- Create a product FIFO / AUTOMATED
- Purchase 50 units@$2 and receive them (total value=$100)
- Add a landed cost of $100 on those 50 units and a landed cost of $50 on those 50 units
  (total value = $100+$100+$50)
- Sell 15 units (the value on move out =$75 > $75/15 = $5 unit cost)

The standard_price on the product = $7 while I expect to have $5

opw-1867002
2018-07-19 14:29:34 +02:00
Xavier Morel 9f8eae34d1 [FIX] undefined variables (potential nameerror)
Backport 9ec0455abc and
6a601fe6dc as they fixed various
possible NameError but did so in later sub-releases.
2018-07-19 13:37:10 +02:00
len-odoo bc12428e17 [FIX] web: format value of statinfo widget
The value of the statinfo widget is rendered by the qweb after a t-esc.
Say if the python rounding returned 14.0000000001
(supposed to be a two digits precision number through the magic of floats)
then the statinfo widget would print it as-is.

We now format the value at assignation.

opw 1865426
2018-07-19 13:19:09 +02:00
Goffin Simon 67449ced66 [FIX] purchase: State 'bid' on PO doesn't exist
Since this commit: https://github.com/odoo/odoo/commit/cb01be235e73cf948418e41642d4906ff84906a6
the state 'bid' doesn't exist on model 'purchase.order'

With courtesy of @rim-odoo

opw:1867594
2018-07-19 11:28:32 +02:00
Goffin Simon 487873f170 [FIX] purchase: Error when updating dropship order
Steps to reproduce the issue:

- change the demo user settings -> use Sales: User: All Documents only
- create a stockable product with dropship feature on and a supplier
- connect as the demo user
- create a sales order with this product
- confirm the order
- as the admin user, confirm the purchase order generated through dropship
- connect as the demo user
- open the confirmed SO
- add a line with this product
- save the SO

Bug:

An access rights error was raised.

opw:1866015
2018-07-19 11:12:09 +02:00
Lucas Perais (lpe) ee746b52cd [FIX] product: fallback onto name for product.partner_ref
Have a product with a partner A as a seller, without any description whatsoever

Do a vendor bill with partner A as the partner.

Add the product onto the lines

Before this commit, the description on the line was "False"

After this commit, we fallback onto the product name if no other reference is set

OPW 1865969
closes #25857
2018-07-19 09:25:33 +02:00
Lucas Perais (lpe) 1409421b26 [FIX] account: payment cashbasis' move posted once
Make an invoice with a line having a cashbasis tax
Make a payment at a future date compared to the invoice's date

Before this commit, the cashbasis move attempted to post many times
which could lead to errors when posting is forbidden
(in the case of the french localization)

After this commit, the cashbasis move is posted only once

OPW 1865179
closes #25832
2018-07-19 09:19:47 +02:00
len-odoo 79ee0e2584 [FIX] web_editor: display a dialog if posting a translation fails
When editing a translation on the website, if the user copy/pastes directly in
the web editor, then the html formatting is also copied.
Since the translation matching takes the html code into account when matching
the translations, this breaks the pairing.
When trying to save, the backend function validating the new translation thus
fails and return a server error.
However nothing was done with this error, and the user just witnesses that
saving doesn't work (unless he opens the console to notice the rpc failure).

We now display an alert dialog that notifies which tranlation causes the error.

opw 1862784
2018-07-18 16:35:38 +02:00
Moises Lopez 27c017ad98 [FIX] requirements: improve python3.7 compatibility
Since af9d6b86a1 and
5a57c29ff2 , python3.7 can be used to run
Odoo. This commit ensures that python3.7 compatibles versions of gevent,
greenlet and lxml will be installed without breaking compatibility with
Debian Stretch packages versions when using the Debian packaged Python.

Closes #25841
2018-07-18 15:07:42 +02:00
qsm-odoo 2b470288f2 [FIX] portal, *: missing mobile menu toggler
* website

The mobile menu toggler only appeared when the 'website' app was
installed. This was a mistake which was made with portal split at
https://github.com/odoo/odoo/commit/c3c42658c529967f26c39f51b39059bf47078b57
2018-07-18 12:57:17 +02:00
Lucas Perais (lpe) 92fed4a51e [FIX] account: reconciliation widget: partial reconcile 2 inv 1 pay
Have two invoices
Make a bank statement with one line, which amount is:
Amount[Bank] < Amount[Inv1] + Amount[Inv2]
AND
Amount[Bank] > Amount[Inv1]

Click on on the reconcile button on the form view of the bank statement

On the reconciliation widget:
Click on the first invoice to fully reconcile it with the payment
Click on the second to partially reconcile it with the payment

Before this commit, there was no way to let the second invoice open
and partially reconciled.
The only possibility was to make a write-off

V10.0 allowed to to do such a flow

After this commit, this use case is dealt with again

OPW 1864689
closes #25721
2018-07-18 09:31:26 +02:00
Christophe Simonis 44b77d3702 [MERGE] forward port branch saas-15 up to 1de78253ff 2018-07-17 17:08:50 +02:00
Christophe Simonis 1de78253ff [MERGE] forward port branch saas-14 up to 7f7b705236 2018-07-17 16:37:07 +02:00
Christophe Simonis 7f7b705236 [MERGE] forward port branch 10.0 up to 633a65d231 2018-07-17 16:36:29 +02:00
Goffin Simon ae5c0b04c6 [FIX] l10n_in_hr_payroll: Printing Yearly Salary by Employee
Coding error.

opw:1866546
2018-07-17 16:13:51 +02:00
Christophe Simonis 633a65d231 [MERGE] forward port branch 9.0 up to e62e17d078 2018-07-17 16:11:20 +02:00
len-odoo d5baec40ab [FIX] web_forum: disallow tag editing of questions if karma is unsufficient
When editing his post, a user can modify the tags even if he doesn't have
sufficient karma to do so.
Since the backend raises an error, it sends the user to a 403 forbidden page.

opw 1866019
2018-07-17 16:02:01 +02:00
Christophe Simonis e62e17d078 [MERGE] forward port branch 8.0 up to 9e8f70e484 2018-07-17 15:45:25 +02:00
len-odoo a3fd6a2072 [FIX] web_forum: fix the comparison of tags ids
When checking if tags had changed, a missing .ids made it that a recordset was
compared to a set of ids (integers).
As a result, to make an edit the forum would always check that the user had
sufficent karma to retag, even if it was not needed.

opw 1866019
2018-07-17 15:27:35 +02:00
Sébastien Theys b6ed005e0a [IMP] doc: remove duplicate line
The same content is already there 2 lines above.

cherry-pick of 57676dc7d1
2018-07-17 15:14:28 +02:00
Christophe Simonis 4bd58029f4 [FIX] base: avoid duplicated translation entries
For records having multiple translated terms per field (like html fields),
it was possible to have duplicated entries when synchronizing existing
entries with new ones.
2018-07-17 14:39:32 +02:00
Martin Trigaux af9d6b86a1 [ADD] tools: add new 3.7 opcodes
Python 3.7 introduced two new opcodes LOAD_METHOD and CALL_METHOD.
https://docs.python.org/3/whatsnew/3.7.html#cpython-bytecode-changes
https://bugs.python.org/issue26110

Basic QWeb rendering was failing on operations like
      request.csrf_token()
ValueError: forbidden opcode(s) in 'request.csrf_token()': LOAD_METHOD, CALL_METHOD

Closes #25783
2018-07-17 13:42:50 +02:00
Martin Trigaux 5a57c29ff2 [FIX] base: do not use async reserved keyword
In python 3.7, async is a reserved keyword.
Using it in a method signature produces a syntax error.
Replace by an argument async_load and catch the previous calls in a kw for
backward compatibility.
Log a warning on public methods.

The **kw can be removed in v12 and officially deprecate the 'async' parameter.

Fixes #25578
Closes #25783
2018-07-17 13:25:33 +02:00
Akim Juillerat 5705e3e5d2 [FIX] website_event: correct inverse method
To work on multiple records at the same time.
Worked on a recordset but left some `self` calls.

Closes #25788
2018-07-17 11:56:39 +02:00
Wolfgang Taferner e239cd810f [FIX] stock: comparing apples and oranges it is for category_id
We need to split this magical one-liner in order to not compare apples
and oranges.

opw:1865614
2018-07-17 11:28:13 +02:00
Joren Van Onder 32f5b8c034 [FIX] point_of_sale: support non-company currencies
Multiple currencies in the same POS have never been
supported. However, before ac89783d2f it
was possible to load a POS with a currency different from the
company's currency through the sales journal.

This re-introduces that option by manually converting to the default
pricelist currency if it's different from the company currency.

The currency conversion implemented here is based on (and should be
identical to) _convert on res.currency.

opw-1863047
2018-07-17 11:01:12 +02:00
Goffin Simon eb2f104e44 [FIX] stock_account: Automated FIFO error on MO
When trying to click on "Mark as Done" on a MO with raw materials in a category
with automated fifo valuation, it raised in some a case (in function called
"_prepare_account_move_line")  a user error saying:

"The cost of the product P is currently equal to 0. Change the cost or the
configuration of your product to avoid an incorrect valuation"

This problem coming from the fact that in some cases, self.price_unit was
equal to 1.04166666666667e-06 instead of 0

opw:1862153, 1866692
2018-07-17 10:20:12 +02:00
Christophe Simonis 3656999f5e [MERGE] forward port branch saas-15 up to f0e280e5eb 2018-07-16 17:53:02 +02:00
Christophe Simonis f0e280e5eb [MERGE] forward port branch saas-14 up to ed99894ac6 2018-07-16 16:40:46 +02:00