Commit Graph
107840 Commits
Author SHA1 Message Date
Nicolas Martinelli 514bdcb0f1 [FIX] tools: unnecessary error logging
The limit of 64 characters on the XMLID has been removed a long time
ago. This error is therefore not necessary anymore.
2017-05-04 16:48:31 +02:00
Damien Bouvy fc06646cf9 [MERGE] forward port branch saas-11 up to e460616 2017-05-04 09:35:37 +02:00
Damien Bouvy e460616428 [MERGE] forward port branch 9.0 up to fb25735 2017-05-04 09:25:50 +02:00
SodexisTeam 8797f53174 [FIX] mrp: Propagate cancel and split
The option "Propagate cancel and split" is not set properly on the
finished products' stock move.

opw-741475
2017-05-04 08:38:20 +02:00
Goffin Simon b2ab0a8d50 [FIX] mrp: MO with a serial numbers
Steps to reproduce:

1. Create two products A and B that require a serial number
2. Create a product C with no trcking
3. Create a BOM for a A with two components B an C
4. Create a MO for A with  qty > 1
5. Check availabiltity and produce the first A
6. Record the SN for the first assembly

Bug: When producing the second assembly, it was not possible to
record the SN for the components.

opw:741316
2017-05-03 15:58:32 +02:00
Raphael Collet 77e7799d5a [FIX] registry: use a weak dictionary for model_cache to avoid memory leaks
The class attribute `model_cache` refers to model classes, which refer to their
own registry.  This cache potentially keeps all past registries alive!
2017-05-03 15:57:27 +02:00
Nicolas Lempereur 8f1cc2fadb [FIX] web_kanban: double click double action
When multiple clicking fast (and with the server not too fast), we could
end up with an error (eg. "Cannot read property 'controller' of null").

Something has been done previously to improve this when switching
between views in: fc8a4b5e. This commit do something similar to limit
multiple click on kanban records (doing it as in 26f91c429).

opw-705329
closes #16698
2017-05-03 15:29:16 +02:00
amoyaux 85e21d1725 [FIX] stock : scheduler release lock too fast
Issue: 741582

This bug happens when you click multiple time quickly on 'run scheduler' button
or if you call 'run reordering rules' and then 'run scheduler' rapidly
It could create duplicate PO or MO.

This happens because the run_scheduler function free the lock while it should
not. ProcurementSudo was created with the old cursor that contains the lock and
the record set that search returns also contains this cursor. The run will call the record set with the bad cursor and commit the lock instead of the wanted
behavior.

This commit creates the ProcurementSudo with the new cursor that does not
contains the lock.
2017-05-03 13:43:21 +02:00
Nicolas Martinelli fb257353fa [FIX] account, purchase: performance when adding PO
- Create 5 PO with 40 lines each for Partner A
- Create an invoice
- Add each PO thanks to the field "Add Purchase Order"

The process takes more and more time for each PO.

Most of the time is spent in the recomputation of the secondary fields
(in the `onchange` method of "models.py"). The root cause is the cache
invalidation due to the relational fields recomputed as superuser by
default.

opw-740485
2017-05-03 12:57:23 +02:00
Lucas Perais (lpe) 4a0f9da2e1 [FIX] board: invalidate cache when board is modified
Before this commit, when the user modified the dashboard, it was not always visible without refreshing the web client
For example, display the current dashboard, then go to another view and add an extra view in the dashboard, then go back to the dashboard.
The reason is that the dashboard layout is actually stored in the arch of a form view, and that arch is cached by the data manager.

This is why each change to the dashboard arch requires that we clear the cache.

OPW 740739

Closes #16691
2017-05-03 09:24:00 +02:00
Christophe Simonis cc7ae17bd5 [MERGE] forward port branch saas-11 up to 73527d0fc6 2017-05-02 17:05:42 +02:00
Nicolas Martinelli 279b3a8ac1 [FIX] account_tax_cash_basis: raise if no account
Since the account is a mandatory field, we raise an clear error is no
account is defined.

This is necessary when running an automatic reconciliation on the POS.
The POS uses a try/except to avoid any error, but in the case of an SQL
error, the cursor is invalidated, so the transaction fails.

opw-741677
2017-05-02 16:20:50 +02:00
Christophe Simonis 73527d0fc6 [MERGE] forward port branch 9.0 up to c66e454f06 2017-05-02 16:17:35 +02:00
Nicolas Martinelli be1ca7b100 [FIX] web: min/max integer
In PostgreSQL, a field of type `integer` must be in the range
-2147483648 to +2147483647. If the user enters a lower or a larger
value, a traceback is thrown.

opw-740286
2017-05-02 16:11:01 +02:00
Goffin Simon e645d38ce1 [FIX] sale: Wrong access_name button in Sales Order - Send by Email
When the online SO was already confirmed and paid, the button "Accept and pay"
was displayed instead of "View".

opw:728306
2017-05-02 15:04:19 +02:00
Martin Trigaux ceeee8e6e2 [FIX] sale: avoid updating layout sequence at creation
When a invoice line is create a default layout_category_sequence was created
with a value of 0, updating the value of layout_category_id.sequence instead
of fetching it.

This operation was very slow on the invoice creation wizard

opw-741517
2017-05-02 14:25:29 +02:00
Christophe Simonis c66e454f06 [MERGE] forward port branch saas-6 up to 671864e72b 2017-05-02 12:07:05 +02:00
Christophe Simonis 671864e72b [MERGE] forward port branch 8.0 up to 0b4d01f1d3 2017-05-02 11:40:48 +02:00
Odoo Translation Bot 0b4d01f1d3 [I18N] Update translation terms from Transifex 2017-05-01 02:40:51 +02:00
Jeremy Kersten 76d0444fde [FIX] website_hr: fix access right to allow portal user to read employee website_published
opw-741077
This commit closes #16616
2017-04-30 11:57:46 +02:00
Odoo Translation Bot e0ff2840a5 [I18N] Update translation terms from Transifex 2017-04-30 04:31:05 +02:00
Odoo Translation Bot 32ea5ad690 [I18N] Update translation terms from Transifex 2017-04-30 00:29:03 +02:00
Dainius Kaniava 4f9ac6c093 [FIX] web: properly transfer javascript options
Fix options not being passed from view declaration to JS
frontend function. If passing option 'no_create': True,
"Create" button was still visible.
2017-04-28 21:13:28 +02:00
Dainius Kaniava 43cdec0517 [CLA] boolit.md
Signed corporate contributor license.
2017-04-28 21:13:09 +02:00
Nicolas Martinelli 89c2e50933 [FIX] account: invoiced amount with down payment
- Create a SO of 1000
- Create a down payment of 300, validate
- Create the final invoice

In the partner view, a total of 1600 is displayed as invoiced.

In the case of a down payment, the corresponding invoice line has an
amount with a negative sign. Since the report computes the absolute
value before multiplying by the sign, this information is lost.

The absolute value is not necessary since `price_subtotal_signed`
already includes the correct sign.

opw-741159
2017-04-28 16:27:19 +02:00
Jeremy Kersten ce947eece8 [FIX] stock: don't try to rename unexisting mto_pull_id.
This field is not required, in case it is empty, the rename will crash.

opw-741259
2017-04-28 14:52:46 +02:00
Nicolas Lempereur a9da6e9f3f [FIX] web_calendar: date start and record move
The calendar view display records with the start corresponding to the
record field set as `date_start`, and the stop to the record field set
as `date_stop`.

Since ef886aed2 there some issue when mingling calendar with
`date_start` or `date_stop` date fields and `all_day` unset:

- if user had timezone between UTC+8 and UTC+14, when moving as
  "All day", the record start would be saved on the previous day.

- if used had timezone between UTC-12 and UTC-5, when moving as
  "All day", the record end would get on the following day.

- if the event was moved onto a given time (in the "Day view"), the
  event start would be set to the previous day if it was before midnight
  in UTC time, and the end would be set on the following day if it was
  after UTC 23:59.

The source of the issue was that after ef886aed2 a datetime was always
sent to the server, so depending on the browser timezone the server
could for example receive '2017-04-27 23:00' instead of '2017-04-28'.

This fix go back to the previous behavior.

fixes #15540
opw-15540
closes #16698
2017-04-28 18:01:32 +08:00
Richard Mathot eefd0de541 [FIX] safer company name as email sender
In some email templates of Odoo, the From: field is generated from the
company name. If this name contains an "&" character, this will lead in
an escaping eg; &

Sender header will look like:
From: Machin &amp; Brol <machinbrol@toto.com>

This case is not well handled by email providers like Gmail, that
splits the line on the ";" and considers there are 2 senders, and then
discards the email.

We then fix the templates, waiting for a better fix in master.
2017-04-28 10:19:06 +02:00
Nicolas Martinelli 814d903109 [FIX] purchase: zero line
To reproduce, see issue #16611.

In the mentioned use case, a line with a quantity of zero is created,
which generates a traceback at invoice validation.

Fixes #16611
opw-741055
2017-04-28 09:28:14 +02:00
Nicolas Martinelli 7413b2624c [FIX] hr_expense: employee on expense
The employee of the expense report should be the same than the employee
on expense lines.

opw-740646
2017-04-27 14:32:22 +02:00
Goffin Simon c242526b7b [FIX] delivery: Delivery methods not translated
In function name_get on model "delivery.carrier", the field name
is taken from "product.template" and the translations were just
available on model "product.product".

The translations for the "product.template" records were not available
in the .pot file because there was no external identifiers created for
the "product.template".

Now when creating the external identifier of a record, all the external
identifiers of the inherits models of this record are also created.
In this way, all the translations will be created.

opw:728682
2017-04-27 12:11:18 +02:00
Nicolas Lempereur 1faa4a74aa Revert "[FIX] mass_mailing: revert typo forward port ed0233f"
This reverts commit 75d9674d4 and revert well 551719a81e which wass done
on mail.mass_mailing instead of mail.template (on which it should not be
done).
2017-04-27 08:34:33 +02:00
Nicolas Lempereur 75d9674d45 [FIX] mass_mailing: revert typo forward port ed0233f
This commit revert the change of 551719a8 forward ported in ed0233f.

The file and feature modified is not present after saas-11.
2017-04-27 08:15:37 +02:00
Christophe Simonis ed0233fb8a [MERGE] forward port branch saas-11 up to 3d35aef5b0 2017-04-26 20:07:32 +02:00
Christophe Simonis 3d35aef5b0 [MERGE] forward port branch 9.0 up to 283b648c18 2017-04-26 19:46:46 +02:00
Christophe Simonis 11f8a2157d [FIX] base: res.lang: do not redefine _ variable 2017-04-26 19:45:27 +02:00
Christophe Simonis 283b648c18 [MERGE] forward port branch saas-6 up to 5c05e39713 2017-04-26 19:41:00 +02:00
Christophe Simonis 5c05e39713 [MERGE] forward port branch 8.0 up to 2a65b8156d 2017-04-26 19:38:17 +02:00
Christophe Simonis 2a65b8156d [FIX] base: run defined modifiers tests 2017-04-26 19:36:10 +02:00
Nicolas Lempereur 551719a81e [FIX] mass_mailing: mail template not in english
Mass mailing `mail templates` when selected in a mass mailing are
always used in the english version.

But when another language is involved the edition of mass mailing
`templates` had a number of issue. For example saving the edited english
would only modify the user current language.

These issues are cause because the widget with snippets used for mass
mailing templates edition is not compatible.

Several fixes were proposed, what was choosen finally was to use the
correct widget with the following behavior changes:

- the snippets are not showed anymore in mass mailing templates,
- the current language can be edited and is saved rightly,

The shortcoming this give mass mailing templates can be partly
compensated by:

- editing the template back (if someone want the old behavior),
- duplicating mass mailings which keep the snippets and translations,
- doing a customization to improve the situation

closes #16255
fixes #16165
opw-726746 opw-727232

note: this fix is only needed for 9.0 and saas-11.
2017-04-26 18:37:53 +02:00
Nicolas Lempereur cd2b07ea44 [FIX] pad: remove wrong warning at pad creation
When creating a pad before this change these were the steps:

- modify pad URL for new pad URL
- end of record loading

This caused an issue because modifying the record at this point would
mark it as dirty before displaying it (which would result in a erroneous
warning "The record has been modified, your changes will be discarded.
Are you sure you want to leave this page ?").

With this fix:

- modifying the pad URL is done after the record is ready

- deferred have been unified (to remove possible race conditions)

closes #15239
opw-702797

forward port note: this change is needed up to saas-15, over saas-15
only a small part is needed (because x2many views are loaded with the
root view and there is one widget instance per record).

code note: it would be better to modify load_record of form view and
delay `record_loaded` upto after x2many views are loaded, but possible
impacts have been judged too risky so this is done only in pad widget.
2017-04-26 18:32:18 +02:00
Wolfgang Taferner fe70f0711f [FIX] point_of_sale: backport of a2319b4 + fix
When a PoS order is closed, the payment and the sales journal item are
not automatically reconciled. This potentially leaves a lot of
unreconciled entries for a customer, which will appear in his follow-up
report.

This introduces an auto-reconciliation process upon order closing. The
process restricts the reconciliation to an order individually, i.e. we
don't try to cross-reconcile several orders for a customer.

opw-697565

Add missing sudo to allow a user without accounting rights to close a session
and reconcile entries.

Closes #16517
2017-04-26 17:00:46 +02:00
Alexis de Lattre 7e1a523fbf [FIX] product: missing string on field
Closes #16640
2017-04-26 15:37:20 +02:00
Raphael Collet 482fec4838 [FIX] models: support removing an ir.model.fields that no longer appears on model 2017-04-26 15:23:06 +02:00
Raphael Collet 4287a70110 [FIX] models: remove ir.model.fields that no longer exist in registry
This fixes the following issue.  Assume a custom field F is created on
`res.partner`.  This field will appear on `res.users` as an inherited field,
and will be reflected in `ir.model.fields` as a 'base' field.  When F is
removed from the parent model, it no longer appears on the child model in
registry, but remains in `ir.model.fields`.

The patch allows the proper removal of the no-longer-inherited field from
`ir.model.fields`.
2017-04-26 15:11:07 +02:00
Nicolas Martinelli 831322bb92 [FIX] hr_expense: expense lines > and < 0
- Create an expense sheet
- Line 1 is 500
- Line 2 is -200
- The total is 300 => a payment of 300 is made

When the payment is validated, the expense is not set as paid.

In v10, one expense line = one account move. In order to know if the
expense is paid we check that each account move is completely
reconciled. The account move of 500 is never completely reconciled by
the payment of 300, so the expense stays opened.

This simply cannot be supported in v10, since each expense line is
handled in a separate account move.

opw-740492
2017-04-26 14:49:37 +02:00
Pierre Masereel e3cd54bb1d [FIX] pylint: using variable before assignment
Since last version (1.7) of pylint, new errors have been detected.

Related to rev: https://github.com/odoo/odoo/commit/ecac88dcc074b81ede4925a75080e8d2b4975924
2017-04-26 14:16:51 +02:00
Nicolas Martinelli 33630d8f42 [FIX] sale, sale_stock: inconsistent decorator
The decorator is inconsistent, and actually useless.

opw-740787
2017-04-26 11:26:46 +02:00
Xavier Morel 0550da4d88 [FIX] mrp: public/rpc methods not returning any value
XML-RPC can't serialize None, as a result methods callable over RPC
must return something (True, False, an actual value) otherwise an
error is generated when their result is serialized and sent back to
the client. It happens that JSON-RPC has different limitations and can
serialize None, so MRP had multiple button/action methods which could
be called over JSON-RPC but would break when called in XML-RPC for no
reason.

Fix them by returning `True` or result of `write`.

OPW-728844
2017-04-25 15:41:31 +02:00
Martin Trigaux 79519ce400 [FIX] registry: load inheritS models too
When adding a field on a model, only the _inherit were checked, not the _inherits.

This commit fixes the following bug:
1. install `sale` (adding the field `sale_order_count` on `res.partner`)
   - field `sale_order_count` is created on `res.partner`
   - the ir.model.field is tagged with module `sale`

2. install `point_of_sale` (adding another field on `res.users`)
   - field `sale_order_count` is created on `res.users`
   - the ir.model.field is tagged with module `point_of_sale`

When installing sale, the model res.partner is returned in the list of impacted
models, on which _create_fields method is called but not res.users.

A direct consequence of this bug is that, the fields translations are in the
wrong module. May fix some uninstallation bugs too.

Closes #16104
2017-04-25 14:20:34 +02:00