Commit Graph
110194 Commits
Author SHA1 Message Date
David Monjoie 3cbfc40303 [FIX] web: fix m2o with show_address
When the show_address option is enabled, the display_name of a
partner becomes a newline concatenated version of his name and his
address, so the internal value of the widget is this conglomerate.

However, if one uses a keypress that does not change the value of
the input in edit mode, say ESC for example, the keyup handler of
this widget will compare the value in the input with its internal
value. If the internal value is still the conglomerate, which is
the case if the user hasn't changed the input content since
switching in edit mode, we need to trim it to compare it to the
actual input value, which is the "standard" display_name, ignoring
the magic show_address feature which is only used in readonly.
2017-06-23 09:58:43 +02:00
David Monjoie 1192ca1048 [FIX] web: fix searching on datetime fields
Previously, one could not create a custom filter on a datetime
field without encountering a crash.
2017-06-23 09:58:42 +02:00
Sanjay Jamod acfb54055a [FIX] web: upgrade boolean fields in Settings
Before this rev., there was a traceback when clicking on an
upgrade boolean field's checkbox.
2017-06-22 20:48:59 +02:00
Martin Geubelle c62a4edcb0 [FIX] web: set 0 as default value for numeric fields
When creating a new record, the numeric field default value should be 0 in order
to avoid manually setting mandatory fields to 0.

This behaviour has been removed with the new views but one wants to restore it.

The `mockRead` function has also been adapted in this commit because the server
returns 0 for unset numeric fields.
2017-06-22 10:52:26 +02:00
Martin Geubelle 3de0715f12 [FIX] web: basicController: stop translate event
Before this fix, a traceback occured when we clicked on the translate icon
in a form dialog.

The `translate` event wasn't stopped and was thus handled by the dialog's form
controller and by the main controller.
2017-06-21 16:42:56 +02:00
Adrien Dieudonne 5fa51c5201 [FIX] web: basic_controller: avoid multiple name_create
Before this fix, multiple records were created if you clicked
on the quick create of a many2one in a modal.

The 'mutexify' event wasn't stopped and was thus handled by
the dialog's form controller and by the main form controller.
2017-06-21 13:30:40 +02:00
Martin Geubelle e921f14d24 [FIX] web: disable phone test with voip
The module `crm.voip` alters the focusable behaviour of the phone
widget by overriding the `canCall` method.

We thus disable this test if the module is installed.
2017-06-21 11:44:53 +02:00
Martin Geubelle 28b67ee7dc [FIX] web: properly handle tab navigation with widgets in edit
Rev. https://github.com/odoo/odoo/commit/c5f8f35747b4ca9633c664d6be74614c5ce22fcd
introduced a regression: the input of widgets 'email' and 'url' was not correctly
focused anymore with tab navigation.

The method `getFocusableElement` on their common parent (`InputField`) has not been
correctly overriden because `_super``was not called in edit mode.
2017-06-20 11:17:35 +02:00
Adrien Dieudonne 98100b85dc [FIX] pad: not able to set pad widget
Before this fix, it was possible to set the widget 'pad'
on char fields but it only worked if the current model
inherited from 'pad.common'.
In the other cases, it crashed on closing Studio.

As there is two models only (project.task and
note.note), we decided to remove the possibility to set
this widget in Studio.

opw-745997
2017-06-20 09:56:23 +02:00
Jérome Maes 800d54e846 [FIX] phone_validation: bad code comparison
During the formating method, the country code
was compared to the country phone code. Indeed,
phonenumbers python lib return a `PhoneNumber`
object having a `country_code` attribute
refering to the country_phone_code, and not
the country_code (like odoo means).
Consequence: changing the country on a lead
did not make the phone validation work.

Thus, it was required to give both code (country
and country phone codes) to the phonenumbers API,
in order to make a correct verification.
2017-06-20 09:00:47 +02:00
Jérome Maes c124cb71c2 [FIX] phone_validation: type in field help message 2017-06-20 09:00:39 +02:00
Jérome Maes 5af4b36e2b [FIX] project_timesheet_holidays: refusing leaves delete timesheet
When refusing leave, we can not remove linked timesheet,
since they are attached to the leave.
We need to first detach it, then remove the timesheet
entries.

Also, add a test about the removal of linked timesheets.
2017-06-20 09:00:32 +02:00
Jérome Maes d36f8d478a [FIX] sale_timesheet: hide timesheet button on invoice if no timesheet related 2017-06-20 09:00:22 +02:00
Martin Geubelle c5f8f35747 [FIX] web: properly handle tab navigation in readonly
The tab navigation was only working in edit mode. Entering a readonly form
view with input fields was causing a traceback.

As the default browser behaviour has been overriden with custom navigation,
we need to specify which widget can be focused (e.g.: url, many2one, etc.).
2017-06-19 16:47:34 +02:00
Martin Geubelle 21fca784dc [FIX] web: Kanban: avoid ghost records when moving record
In an empty kanban view, when moving a freshly created record from
the second column to the first one, then moving it back again in to
the first one, the record was mysteriously duplicated.

When moving the record, it should be removed from the old column.
In this case, the second column was not found (and thus the record
not removed) because the iteration was on `parent.count` (which is
the count of records in this datapoint (1 in our case)) and not
parent.data.length (the number of columns).
2017-06-19 16:47:33 +02:00
qsm-odoo caa4cd2063 [FIX] web: use 'o_input' class on search view elements
Since the new views, the 'o_input' class has to be set explicitely on
<input/> and <select/> elements to have the proper styling.
2017-06-19 11:32:42 +02:00
David Monjoie b8c1571d94 [FIX] web: prevent crash when giving wrong id in url
The mock server had to be modified in order to test this behavior
since it used to throw an error for invalid ids, while the actual
server just ignores it and continues forth with the other ids.
2017-06-19 07:56:42 +02:00
David Monjoie 584c60f1ba [FIX] web: display buttons without icon in list view
Previously, the button was completely invisible when no icon
was given, which is a regression from saas-15 where the string
attribute is used to write the button label.
2017-06-19 07:56:41 +02:00
Aaron Bohy 8859d25bc5 [FIX] web: FieldWidgets: use correct format/parse functions
Field widgets must format and parse values according to the widget
type, not to the field type. For example, if a monetary field is
inserted in a form view with widget="float", the field's value must
be formatted with the float formatter, not the montetary one. This
wasn't the case before this rev.
2017-06-16 11:14:16 +02:00
Aaron Bohy 1fa67917ba [FIX] web: allow to move cursor in inputs with arrows
Commit 9966e4b added calls to preventDefault() on the keydown event
for left, right, up and down arrows, to prevent the page from
scrolling. However, it also prevents the cursor from moving inside
the inputs. Since the initial issue only concerned checkboxes, this
rev. moves the preventDefault() calls from AbstractField to
FieldBoolean.
2017-06-16 08:00:24 +02:00
Joren Van Onder f4200f376b [FIX] point_of_sale: avoid '414 Request-URI Too Large' on config form
Inspired by d7939282e9. Without this you
end up with a URI with a length of over 50000 characters. The default
template doesn't actually use any fields on pos.config so we could
theoretically get rid of everything. But because it's easy enough we
just get rid of relational fields and the customer_facing_display_html
field itself which make up the vast majority of the URI.
2017-06-15 21:33:57 -07:00
Joren Van Onder eb347e82f8 [FIX] web_editor: adapt web_editor to new views
set_value doesn't exist anymore. Instead use _setValue.
2017-06-15 21:29:31 -07:00
Joren Van Onder 83f1e28cc9 [FIX] web_editor,mass_mailing: adapt d7939282 to new views
Also adds body_html to the blacklisted fields. Because that tends to
be quite long as well.
2017-06-15 21:29:26 -07:00
Joren Van Onder b41a987767 [FIX] http: fix forward-port of eaa3682bb6
Forward-ported at
1b50c829ef. b4429c2a91
changed the import to allow for either urllib or urlparse.
2017-06-15 18:31:57 -07:00
Christophe Simonis acfebff880 [FIX] *: correct PY3 compatibility introduced by previous forward-ports 2017-06-15 19:24:03 +02:00
Christophe Simonis 2a008d5168 [MERGE] forward port branch saas-15 up to 2f6edfef49 2017-06-15 19:04:51 +02:00
Christophe Simonis 2f6edfef49 [FIX] resource: remove bad test introduced by previous forward-port 2017-06-15 19:00:54 +02:00
Christophe Simonis 1b50c829ef [MERGE] forward port branch saas-15 up to 9713dc2e1f 2017-06-15 18:44:16 +02:00
Christophe Simonis 9713dc2e1f [MERGE] forward port branch saas-14 up to 96595772e0 2017-06-15 18:39:59 +02:00
Christophe Simonis 96595772e0 [MERGE] forward port branch 10.0 up to dc8b473a03 2017-06-15 18:35:46 +02:00
Christophe Simonis dc8b473a03 [MERGE] forward port branch saas-11 up to dd7b2556c6 2017-06-15 17:52:49 +02:00
Christophe Simonis dd7b2556c6 [MERGE] forward port branch 9.0 up to 9e324c061c 2017-06-15 17:48:26 +02:00
Simon Lejeune cb73aaf71b [FIX] stock: inventory adjustment and negative quants
It is still possible to have negative and positive quants in the same
location because of returns: if you send something to the customer that
is not there and you return it, you will still be able to reserve the
returned goods to send to another client.

Before, if you would do an inventory adjustment, it would not take into
account these returned quants and their negative counterpart, which made
them difficult to get out of the system.

This fix takes them into account by creating two movements for one
inventory line: move the positive counterpart to the inventory location
before getting back from this location the same quantity.

This way, even if you have 0 as quantity on hand but you have those 2
quants, it will eliminate them. (if you are increasing the stock, part
of the process might have done it automatically already).

Test cases contributed by @jir-odoo

Cherry-pick of be9dce625c
2017-06-15 17:42:10 +02:00
Christophe Simonis 9e324c061c [MERGE] forward port branch saas-6 up to 88802b066c 2017-06-15 17:29:17 +02:00
Christophe Simonis 88802b066c [MERGE] forward port branch 8.0 up to 89eca96476 2017-06-15 17:26:15 +02:00
Olivier Dony 89eca96476 [FIX] anonymization: correct pickle protocol and import 2017-06-15 16:36:05 +02:00
Olivier Dony e40a4baf41 [FIX] anonymization: correct pickle protocol and import 2017-06-15 16:34:47 +02:00
Olivier Dony 625c0d5d8e [FIX] anonymization: correct pickle protocol and import 2017-06-15 16:25:25 +02:00
Olivier Dony 16714a7e71 [FIX] auth_oauth: correctly register token field 2017-06-15 16:23:44 +02:00
Olivier Dony eaa3682bb6 [FIX] http: force protocol when missing in URL 2017-06-15 16:23:35 +02:00
Olivier Dony 4acfe3577b [FIX] sql_db: port fix from psycopg/psycopg2#459
NUL characters must not be used in query parameters,
as they will be ignored by libpq, being end-of-string
characters.

Preventing NULs avoids unexpected results from
queries. It is only necessary with psycopg2
versions before 2.7, which includes the upstream
fix.
2017-06-15 16:23:35 +02:00
Olivier Dony 0527564463 [FIX] auth_oauth: correctly register token field 2017-06-15 16:21:32 +02:00
Olivier Dony 692f47da6e [FIX] http: force protocol when missing in URL 2017-06-15 16:21:22 +02:00
Olivier Dony e3a52a9966 [FIX] sql_db: port fix from psycopg/psycopg2#459
NUL characters must not be used in query parameters,
as they will be ignored by libpq, being end-of-string
characters.

Preventing NULs avoids unexpected results from
queries. It is only necessary with psycopg2
versions before 2.7, which includes the upstream
fix.
2017-06-15 16:21:22 +02:00
Olivier Dony 090d7a51be [FIX] auth_oauth: correctly register token field 2017-06-15 16:17:35 +02:00
Florent de Labarre acf7c1460a account: Backport of a5361605
[IMP] account: hide deprecated accounts

To be consistent with other domain added at ee97028

Closes #15432
2017-06-15 16:06:42 +02:00
Olivier Dony d655824028 [FIX] http: force protocol when missing in URL 2017-06-15 16:01:40 +02:00
Olivier Dony eb8d919015 [FIX] sql_db: port fix from psycopg/psycopg2#459
NUL characters must not be used in query parameters,
as they will be ignored by libpq, being end-of-string
characters.

Preventing NULs avoids unexpected results from
queries. It is only necessary with psycopg2
versions before 2.7, which includes the upstream
fix.
2017-06-15 16:01:40 +02:00
Martin Trigaux b144e09a10 [FIX] sale_margin: apply same logic than sale override
If some required fields are not present in the created values, they are computed
based on the onchange.
This was introduced at 5c4765130 to allow to import sale order lines without
specifying uom.

If sale_margin is installed, the same issue will occure as it assumes there is
a value for product_uom

Add test, courtesy of Mourad Elhadj Mimoune, Akretion

Closes #17613
2017-06-15 15:43:36 +02:00
Nicolas Martinelli 2bf6005e6a [FIX] point_of_sale: tax on line
Complement of commit f0f45c8fa2

The result of the onchange is incorrectly interpreted by the web client,
leading to taxes not saved.

opw-746827
2017-06-15 13:55:41 +02:00