Commit Graph
117156 Commits
Author SHA1 Message Date
Olivier Laurent 8ee329c1dc [FIX] P3: add missing opcode
In Python 3, SETUP_FINALLY is used if the exception object is bound in
the except block — even if there is no finally block — in order to
unbind and cleanup the exception's binding as part of PEP 3110:
https://www.python.org/dev/peps/pep-3110/#semantic-changes

This allows both using exception objects in Python 3 and using
finally blocks in both version.

opw 1824211
2018-07-30 09:49:59 +02:00
Lucas Perais (lpe) dc253ff1c6 [FIX] web: kanban progress bar, auto width
Have ~50 records in a column,
Mark 49 of them as blocked (kanban_state field)
Mark 1 or 2 as done

Before this commit, the bar that showed the proportions of blocked objects was invisible
This was because the min-width of a bar was 10px, without max-width
Leaving the red bar to 95% or something, the green bar to 10px
All of this overflowing 100%

After this commit, we compute max-width and min-width to be able to fit everything
within the progress bar

OPW 1867464
closes #25962
2018-07-30 09:24:16 +02:00
Odoo Translation Bot ba61098cf3 [I18N] Update translation terms from Transifex 2018-07-29 04:03:32 +02:00
Martin Trigaux 4c3e9d411d [I18N] export 11.0 source terms
To reflect all the unstable changes made in translations
2018-07-27 14:02:35 +02:00
Richard Mathot adc97120c9 [FIX] hr_timesheet: missing compute_sudo
opw-1862271
2018-07-26 17:13:11 +02:00
Nicolas Lempereur 07023137cd [FIX] models.py: onchange creating m2m => no NewId
Since 2054b59 if we created a record in a many2many relationship of an
onchange, we would also possibly erreneously return the NewId.

The logic of convert_to_onchange of _RelationalMulti doesn't send back
the ID field (if the ID is needed, it is part of the command, not the
update/create dictionary values of a command) and this commit does the
same for the code changed in 2054b59.

This commit also adds a test for this fix, and a test for the regression
corrected with cd2ccc4110 reported in #25969

fix for https://github.com/odoo/odoo/commit/2054b5928#commitcomment-29837226
closes #25984
2018-07-26 15:26:27 +02:00
Cedric Snauwaert 82da221b1f [FIX] l10n_de: DATEV export compatiblity
When invoicing a line with an account that has a tax, ensure that line has the same tax of accounts. This is required by DATEV and is common usage in Germany

Was task 35289
Was PR #25202
2018-07-26 15:15:12 +02:00
Thorsten Vocks a3bc08d9d8 [IMP] 10.0 improvement of german account charts
I. modification and extension of SKR03 account chart
========================================

* improvment and mapping of Odoo standard account types (usage of all
available account types and fixing of wrong mapping)
* fixing of reconcile setting on several accounts
* update of account chart (to SKR03 2017)
* fixing of account chart by ascending order of accounts for easier
maintenance in the future and probably easier preparation of accounting reports
* backport of new account tags from V11 for better reporting
* shorter tags
* introduction of new taxes for all theoretically possible tax cases
needed to declare the VAT
* automatic mapping of taxes to accounts to auto detect the right tax
by selection of income / expense account on invoice lines
* assignation of tax groups to taxes
* introduction of reconcile templates (to allow booking of cash discount
cases)

II. modification and extension of SKR04 account chart
=========================================

* improved mapping of Odoo standard account types (usage of all
available account types and fixing of wrong mapping)
* fixed reconcile settings for all accounts
* update of account chart (to latest SKR04 2017)
* better source code by ascending order of accounts. Finally it will be
easier to maintain the chart in the future and also it will be easier
to identify and group records to to develop missing or new accounting
reports.
* backport of new account tags from V11 for better reporting
* shorter tags
* assignation of tax groups to taxes
* introduction of further taxes to cover most possible tax
cases needed to declare the german VAT
* automatic mapping of taxes to accounts to auto detect the right tax
by selection of income / expense account on invoice lines
* introduction of reconcile templates for cash discount deduction on
payments or low payment variances.
2018-07-26 15:14:17 +02:00
Lucas Perais (lpe) 2e5dc495bb [FIX] sale: portal SO view no image if public
Access a SO with the access token, without being logged

Before this commit, the images of the so lines were the no image placeholder
This was because the route of the image was so.line/product_image
Since the token applies on SO, and not on its lines, nothing simple would work

After this commit, we hide the image if the user is the public one

OPW 1868916
closes #25973
2018-07-26 14:20:15 +02:00
Christophe Simonis 1353abecbe [MERGE] forward port branch saas-15 up to ee09d11738 2018-07-26 12:40:54 +02:00
Goffin Simon 418e146054 [FIX] sale_timesheet: Leaves manager Access error
When validating a leaves request with a user which is
in group group_hr_holidays_manager(Leaves Manager) and
group_account_invoice (Accounting & Finance Billing), it raised an
access error because the function _validate_leave_request
tried to create an analytic line with a project_id.

Without the rule account_analytic_line_rule_billing_user added by this
commit: https://github.com/odoo/odoo/commit/81218a8, a user which was
in group group_hr_holidays_manager and group_account_invoice had the rights
to validate a leaves request.

opw:1866243
2018-07-26 10:34:06 +02:00
Thibaud Ducasse 8198fb6473 [IMP] doc: add logrotate warning in cmdline doc
Fixes #24542
2018-07-26 10:20:04 +02:00
Can Tecim 5e58ac16c3 [FIX] models.py: onchange in python2 with 2054b59
Without the call to `super`, with at least two level off expected
onchange return data (eg. `invoice_lines.name`) we have an error in
python2, python3 python implementation of OrderedDict and possibly other
python implementation.

So this worked most often (with python3 CPython C implementation of
OrderedDict) by chance.

closes #25960
2018-07-26 09:58:29 +02:00
Christophe Simonis 4b9d6387b8 [MERGE] forward port branch saas-15 up to e80a0d4aa9 2018-07-25 18:11:41 +02:00
Christophe Simonis cd2ccc4110 [FIX] models: correct onchange on one2many fields
The method `convert_to_onchange` on one2many fields [1] makes a `copy()`
of `subnames` before altering it. However during onchange management, we
pass it a `PrefixTree` object that can't be copied. As we knows the
object is empty, directly use a empty dict.

[1] https://github.com/odoo/odoo/blob/e6928a6c976cf0f0f7b7b3280205516ad677b413/odoo/fields.py#L2221

Oversight of 2054b59285
2018-07-25 16:11:39 +02:00
Lucas Perais (lpe) e6928a6c97 [FIX] project: proper access check on tasks
With the portal user, go on /my/task/1
(obviously provided that this task doesn't belong to portal user)

Before this commit, there is a 500 error

After this commit, the exceptions are handled and throws a 403

OPW 1867795
closes #25951
2018-07-25 09:48:03 +02:00
jbeficent a955aee429 [IMP] l10n_es: improves groups
add name + some missing groups

Was PR #23922. Courtesy of Jordi Ballester (Eficent)
2018-07-24 17:43:33 +02:00
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
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
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
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 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
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
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
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
Martin Trigaux 095e8bd7b1 [FIX] doc: remove duplicated section
Was already present in the Internationalisation section
2018-07-16 16:07:25 +02:00
rwfnf ef8f16feb2 [CLA] signature for rwfnf
Done at #25776
2018-07-16 13:45:36 +02:00