Commit Graph

89921 Commits

Author SHA1 Message Date
Olivier Dony 57f79f9fa1 [REM] fields: remove fields.Any, temporary artifact for ill-typed fields
This was added in master-apiculture at f1f16a8 to
permit special function fields that return
structured JSON-like data.
This is unnecessary and caused typing problems, for
example for the type field of ir.model.fields, or
when you decide to store them.

It is simpler to explicitly declare these fields
as fields.Char and have them serialize their results
to JSON strings, or to declate them as fields.Binary
and return any opaque data they want.
2014-07-30 13:24:39 +02:00
Christophe Combelles b64bd885b0 [FIX] base: ir.qweb: ensure element.tail is correctly encoded
element.{text,tail} are either ascii-compatible `str`, or `unicode`
when non-ascii-compatible. This could force the implicit decoding
of utf-8 encoded contents when joining template bits, breaking
the rendering.

Fixes #1085, and related to #1130
2014-07-30 11:41:15 +02:00
Denis Ledoux 64ed698a58 [FIX] web: return _super deferred in start method
Forget to include the _super method in the deferred returned by the start function of the search view
See previous rev. 70605240a9
2014-07-29 19:43:56 +02:00
Denis Ledoux 70605240a9 [FIX] web: headless search views are ready from start
function start, line 783, filters_ready waits for fields_view_get deferred to be resolved before calling prepare_filters, which prepare the view filters.

The thing is that, at line 416, if this.headless boolean is true, the searchview is marked as ready (by resolving the this.ready deferred), and the fields_view_get deferred will never be resolved, as it is resolved in the else case, where the this.headless boolean is false.

Therefore, in this.headless true case, this prevents the deferred $.when(this._super(), filters_ready) to be resolved, as the deferred filters_ready will never be resolved. Therefore, the deferred returned by the start function is never resolved, and the searchview will never be regarded as ready neither.

In views.js, the ViewManager is marked as ready when the deferred manager_ready = $.when(searchview_loaded, main_view_loaded, this.view_completely_inited) is resolved. In the this.headless true case, as the searchview is never marked as ready, the manager isn't neither.

This leaded to some issues, like the action buttons in form views being disabled on click, and never re-enabled once the action/wizard executed. See opw-610723
2014-07-29 19:38:28 +02:00
Jeremy Kersten a052a72c8a [REF] crm analytics: refactor - lint 2014-07-29 17:10:03 +02:00
Jeremy Kersten 053d32d817 [IMP] crm: Add Campaign source and medium in group by + fix a bug when name_search return a tuple and not only the id. 2014-07-29 14:46:45 +02:00
Jeremy Kersten db20a45186 [IMP] website_blog: group the get_discussion in one request(get_discussionS), that will avoid to make one request by paragraph in blog. 2014-07-29 12:05:50 +02:00
Olivier Dony 7b4846afd7 [FIX] wek_kanban_gauge: use field raw_value to avoid thousands separator etc. 2014-07-28 18:50:55 +02:00
Christophe Simonis 120a2c1ec1 [FIX] {base_action_rule,calendar,hr,mail,project_issue}: decorate the method `message_post` to specify signature 2014-07-28 18:07:17 +02:00
Martin Trigaux 6dc94f0c4e Forward port of branch saas-5 up to eda2f06 2014-07-28 16:37:56 +02:00
Martin Trigaux eda2f064cf [FIX] stock: backport of rev 0a6d63b 2014-07-28 09:35:25 +02:00
Olivier Dony f90b29b938 [FIX] res.users: safer read() when computing default company value
The goal is to avoid any kind of prefetching
of other fields when copmuting the default
company, as this will sometimes happen in the
middle of a database update, when the default
company is used for setting the default value
of new columns. In that case the db schema
may not fully match the in-memory model, leading
to an SQL error.
2014-07-25 16:33:48 +02:00
Olivier Dony 48140f113a [IMP] account.invoice: add extra @id on `smart button` to make inheritance easier 2014-07-25 14:18:03 +02:00
Martin Trigaux f138aa2608 [FIX] models: display_name and name_get mismatch
- display_name uses name_get and not the other way around:
name_get should not call _compute_display_name, _compute_display_name should call name_get.
The previous behaviour was not backward-compatible with the old api.
All the models redefining name_get would have 2 different behaviors between name_get and display_name.

- Do not set an inverse function to display_name:
In most cases, writing on display_name writes on _rec_name (if any, not mandatory).
If the display_name computation is redefined, we need to redefine as well the inverse method to avoid unexpected behaviour
This required to also modify tests in base_import as readonly fields are avoided.

- Remove search method on display_name:
For the same reason as for the first point, it could be good that searching on display_name use name_search (and not the other way around).
However doing this would be very inefficiant (need to do the search, without limit, extract the ids of the name_get result just to generate
a subdomain ('id', 'in', [...]). As in most cases it would anyway mean to search on the _rec_name it's better to directly do so.

- Changing label to avoid mismatch:
In view displaying the list of fields or when a match is made on the label of a field (e.g. when importing csv file,
matching is made on both label and technical name), the fact that display_name field has '
Calling it 'Display Name' will avoid most errors.

- remove display_name definition from website_forum_doc,ir_model:
These fields are doing the same thing as the display_name of the new api, we can remove them.
We need to keep the one for res.partner as it's a stored field.
2014-07-25 13:58:59 +02:00
Olivier Dony bcd9456db5 [REVERT] 8b41906: disabled all on_change on new record form
This reverts commit 8b41906bf8.
2014-07-25 12:45:21 +02:00
Olivier Dony 13fb4f2e62 [FIX] website: more robust inherit between footer_custom and footer_default 2014-07-25 10:59:49 +02:00
Olivier Dony 6be6a5a801 [IMP] ir.logging: add index on dbname/type, important with high number of log lines 2014-07-25 10:46:12 +02:00
Richard Mathot ee7a9c7621 [REF] Odooification 2014-07-24 16:22:52 +02:00
Olivier Dony 6d2fb3e3ae [FIX] models: check harder that default value is not NULL before setting it
When computing defaults we may end up with
a falsy value that is not None (e.g. '' or False)
That value will be cast to None when being
saved in the database, depending on the column type
(e.g. saving False on a many2one actually stores NULL).

Improve the test to consider the value being written
*after* that conversion, to *really* avoid nonsensical
and expensive queries such as:

    UPDATE table set col = NULL WHERE col IS NULL;
2014-07-24 15:47:34 +02:00
Vidhin Mehta eb08c12b09 [FIX] web: wrong tooltip display for long menus
Due to the switch to Bootstrap 3.2 in this version, tooltip auto placement works erroneously (see https://github.com/twbs/bootstrap/issues/13897).
This is a workaround, waiting for a fix in Bootstrap assets.

(Closes #1341)
2014-07-24 15:21:32 +02:00
Martin Trigaux 8b41906bf8 [FIX] web: avoid trying to access to deleted record message when change password
The onchange call can be made with empty ids list (which would fail). opw 610810
2014-07-24 12:12:33 +02:00
Denis Ledoux b4ef87f1ec [FIX] ir_attachment: _filestore cache ignore uid
replace ormcache_context by ormcache: use the context in the cache key is useless
set skiparg=3 (default skiparg=2) so the uid is not used in the cache key: the filestore path is the same for all database users
2014-07-24 11:53:57 +02:00
Jeremy Kersten 451d2de355 [FIX] website_sale: fix error in tracking_last_order which was using the field is_delivery from module delivery 2014-07-24 11:07:46 +02:00
Christophe Matthieu d0f259ee02 Merge pull request #1338 from odoo-dev/8.0-fix-website-snippet-button-css-chm
[FIX] website.snippet: display snippet editor button inline insead of 2 lines for the small boxes
2014-07-24 09:32:41 +02:00
Olivier Dony a09dadd253 [FIX] share: reduce risk of slowdowns during res.groups changes
Databases with thousands of users would experience
poor performance during any change to a group during
an update/install, caused by the prefetching of
all database users when the browse cache contains
most of the groups in the system.
2014-07-23 23:32:13 +02:00
Olivier Dony ef53a831c6 [MERGE] Forward-port saas-5 up to a5f7891 2014-07-23 16:58:00 +02:00
Christophe Matthieu 7d15bcbc24 Merge pull request #1337 from odoo-dev/saas-5-fix-product-taxes-view-chm
[FIX] account:  the 'Customer taxes' field on the product is readonly when my product doesn't have any variant
2014-07-23 16:25:39 +02:00
Christophe Matthieu 0a13d8f1db [FIX] website.snippet: display snippet editor button inline insead of 2 lines for the small boxes 2014-07-23 16:21:53 +02:00
Christophe Matthieu f478e0557b [FIX] account: the 'Customer taxes' field on the product is readonly when my product doesn't have any variant 2014-07-23 15:37:15 +02:00
Olivier Dony a23994e0ed [FIX] ir.module.module: create module xml id also when auto-discovered
It was only being created during database initialization
2014-07-23 14:42:04 +02:00
Denis Ledoux a5f7891b68 [MERGE] forward port of branch saas-4 up to 5739aebfb1 2014-07-23 13:18:30 +02:00
Olivier Dony 8974e928fa [FIX] fields: do not revalidate field values unless they are being modified
In the previous implementation of the new API fields,
both fields.Selection and fields.Reference were performing
early validation of their `value` as soon as it entered
the cache, either by being read, written, or computed.
This is a source of trouble and performance problems,
and is unnecessary, as we should consider that the database
always contains valid values. If that is not the case it
means it was modified externally and is an exception that
should be handled externally as well.

Revalidating selection/reference values can be expensive
when the domain of values is dynamic and requires extra
database queries, with extra access rights control, etc.

This patch adds a `validate` parameter to `convert_to_cache`,
allowing to turn off the re-validation on demand. The ORM
will turn off validation whenever the value being converted
is supposed to be already validated, such as when reading it
from the database.
The parameter is currently ignored by all other fields,
and defaults to True so validation is performed in all other
caes.
2014-07-23 12:30:24 +02:00
Denis Ledoux 5739aebfb1 [MERGE] forward port of branch saas-3 up to 474eae9a43 2014-07-23 12:14:14 +02:00
Denis Ledoux 474eae9a43 [FIX] website_sale: translated terms payment status
Payment status (website_sale confirmation page) inject a status message, which was not set to be translatable. It should be the case.
2014-07-23 12:00:09 +02:00
Daniel Dico 42f3575bb3 [FIX] account: Bank Statement reconcilation with different currency
When generating reconciled moves in bank statement, use the amount_currency field instead of amount for currency conversion.
Otherwise we would endup with moves with an amount of 0.
2014-07-23 11:19:41 +02:00
Jeremy Kersten a0ebd2c88e [IMP] website_crm: allow creation of the lead to be overrided. That avoid people to rewrite all the routine of the form if they want to change the default behavior at lead creation when form is submitted. 2014-07-23 11:15:07 +02:00
qdp-odoo e7780ac97a [FIX] stock: wrong target table and function for lot_ids in stock.move 2014-07-23 10:28:26 +02:00
qdp-odoo e9c92b57b9 [FIX] account: fixed the copy of a bank statement 2014-07-23 10:15:29 +02:00
qdp-odoo 09b77ca11d [FIX] stock: wrong target table and function for lot_ids in stock.move 2014-07-23 09:48:05 +02:00
Denis Ledoux 586b0e2f5d [FIX] website_sale: _rec_name product.attribute.line
Set the _rec_name for product.attribute.line model, as its column name wasn't defined, and therefore search on it wasn't possible (For instance, do an advanced search on product.product with "Product Attributes" "Contains" "Something" wasn't possible).
2014-07-23 08:56:36 +02:00
Christophe Combelles 299246e2ae [FIX] account: using wizard methods instead of invoice methods
Typo during port of account.invoice to new API.

(Rebase of 02a36b6 for #1052)
2014-07-22 22:23:54 +02:00
Denis Ledoux d9339e1e2d [FIX] sale, crm_claim, crm_helpdesk: report menus
crm claims and helpdesk reports should be in Sales Report menu, not in project
The sales report menu is now defined in sales_team, which is a common dependance between crm and sales, instead of redefining this menu in each modules
2014-07-22 19:13:13 +02:00
Lionel Sausin (Numérigraphe) 57ad75b08d [IMP] sale_stock Show the button 'view delivery order' as soon as a picking exists
The button should appear no matter the state of the sale order, to be consistent with the rest of the application.
This makes it much faster for the sales person to find out about orders in shipping exceptions or already processed.
Fixes #256
2014-07-22 17:46:46 +02:00
Martin Trigaux 36fcfc66c4 [FIX] website_sale_delivery: avoid selecting unavailable delivery method
If somebody selects a delivery method not matching any criteria, the server would crash (500 for the user). This is due to error raised in get_price_from_picking which is triggered by the function field 'price' on the 'delivery.carrier' object.
To avoid this, add field 'available' on the carrier that will be False when no delivery gird is found or when the error is raised. In this case, the delivery choice is disabled. opw 610210
2014-07-22 17:03:02 +02:00
Martin Trigaux 1f878f152a [MERGE] forward port of branch 7.0 up to 680f955 2014-07-22 13:39:15 +02:00
Anaël Closson 680f9554b4 [FIX] web: reload after wizard when record has been removed cause exception
If an action unlink the current records (e.g. unreconcile on account.move.reconcile), trigger history_back to avoid errors when trying to reload inexistant record (opw 607883)
This is a partial backport of saas-4 code (rev c0db6ae, 162ad1c) and should not be forward ported.
2014-07-22 13:18:00 +02:00
Dhs-odoo 8320f01fef [FIX] project : do not show canceled projects in task
fixes #938, opw 610318
2014-07-22 11:29:33 +02:00
Richard Mathot 005282014a [FIX] hr_attendance: typo introduced at rev 1c9e8ba077 2014-07-22 10:03:16 +02:00
Denis Ledoux ae678d9e05 [FIX] sale: only propose services for pay advances
When creating an invoice from a sale order, if the user choose to invoice a fixed price (deposit), he has the possibility to choose an advance product. As described in the help message, this product should be a service product. Therefore, we add a domain so only services are displayed in the dropdown list
2014-07-18 17:26:48 +02:00
Martin Trigaux c58bf1e3bc [FIX] account: better error message when regenarating opening entries (opw 606923)
If we try to generate twice entries on the same fiscal year, we can get completly unrelated errors ("You can only reconcile journal items with the same partner").
With this, we make sure people will first cancel the entries before regeneraing the entries.
2014-07-18 16:53:01 +02:00