Commit Graph
117156 Commits
Author SHA1 Message Date
Géry Debongnie 5e913677a5 [FIX] web: prevent crash when downloading pivot view
The download feature in the pivot view was broken since we introduced
the new views.  Simply clicking on the download button caused a
traceback.
2017-05-22 09:34:49 +02:00
Géry Debongnie af021f223b [FIX] web: apply onchange when m2o or m2m is edited
Before this commit, when editing a many2one (with an onchange) by
clicking on the small form button on the right, then changing something,
then saving the modal dialog, no onchange was triggered, because,
technically, the value of the many2one was not changed, only the values
from the record pointed by the many2one were.

The same remarks applies to many2manys.

To see this issue in odoo, you can open a product (technically, a
product.template) from the 'Catalog' menu in sales, then edit it, then
click on the small form view icon next to Internal Category.  This is a
many2one (categ_id) with an onchange.  In the form view dialog, change
something, for example costing method, then save.  The res_id of the
internal category was not changed, but an onchange should still be
triggered.
2017-05-22 09:31:15 +02:00
Laurent Smet 915aa9e4db [IMP] account: improve usability on journals.
This commit add computed fields that allow to easily change the next number that will be given by the journal's sequence.
Was PR #15163
2017-05-22 09:29:17 +02:00
Jerther e1cd0dc821 [FIX] project: view_mode of open_view_project_all_config
"list,form" should be "tree,form"

Closes #17118
2017-05-22 09:23:55 +02:00
Lucas Perais (lpe) 02ce25ba01 [FIX] purchase: prevent rounding during currency conversion
With the settings:
- Anglo saxon accounting
- real price on product, perpetual accounting,
- multicurrency
- a product with a very small uom (like gram or kilograms and you want to sell many of them, like 500kg)

Flow: purchasing something in another currency

Before this commit, the rounding of the unit price took place right at the conversion level
which led the rounding errors to be amplified by the quantities when the total price was computed

After this commit, the conversion is done on the unit price but is not rounded yet
Only the prices are rounded, as late as possible

OPW 742293

Closes #17015
2017-05-22 09:01:39 +02:00
Odoo Translation Bot c0d9ddb4d4 [I18N] Update translation terms from Transifex 2017-05-21 07:11:01 +02:00
Odoo Translation Bot 7eda91ce58 [I18N] Update translation terms from Transifex 2017-05-21 04:33:07 +02:00
Odoo Translation Bot 3d904cf694 [I18N] Update translation terms from Transifex 2017-05-21 00:28:50 +02:00
Jerther 3d59d3d613 [DOC] doc: remove kanban_text_ellipsis description
views.rst: replace the description of js function kanban_text_ellipsis() with a warning telling it's gone and what to use instead.
2017-05-19 17:18:34 +02:00
Xavier Morel ee894b1384 [FIX] provide items method on lru so shim works 2017-05-19 16:46:42 +02:00
xmo-odoo 05abc1faed [FIX] test_pylint: pylint error output to failure
Sometimes PyLint itself blows up which fails the test but does not
provide any indication as to why, which is inconvenient.
2017-05-19 16:46:42 +02:00
Bima d364dddfbb [CLA] signature for bimajatiwijaya
Done at #17087
2017-05-19 16:38:37 +02:00
Martin Trigaux 77aaba1c05 [FIX] point_of_sale: do not recompute the past
The cash_control flag on a session will be true if at least one payment method
is cash and the config has cache control.
However, the prevents to enable the flag on the config if one session in the
past had no cash method. As the field is not stored, it will be recomputed if
displayed (or prefetched) and raise an error, on a past session.

If the session is already closed, never raise an error

opw-744314
2017-05-19 16:24:09 +02:00
Aaron Bohy da152cfdbf [FIX] web: SelectCreateDialog: don't erase domain
When a SelectCreateDialog was opened with a given domain, this
domain was completely lost if the user wrote a new domain (or
groupby) in the searchview, whereas they should be concatenated.
2017-05-19 15:51:57 +02:00
Aaron Bohy 702835682e [FIX] web: fetch specialData of fields in x2many form
Suppose that there is a one2many list in a form view containing
a field F, displayed with no widget, and that F is also displayed
in the one2many form view (opened when clicking on a record of the
list), but that in this form view, F is displayed with a widget
requiring specialData (additional data to fetch alongside the
record), e.g. widget="domain".

Before this rev., it crashed when this happened because those
specialData weren't loaded when opening the related record.

Credit goes to @pga-odoo for reporting the bug and reproducing it
in a test.
2017-05-19 15:51:57 +02:00
Aaron Bohy c929a81e8f [FIX] web: DebounceField: do nothing after widget destruction
DebounceFields debounce the function that notify field changes to
their environment (using _.debounce). It may happen that this
function is called once the field widget is destroyed (e.g.
type something in a char field and quickly click on Save, the
function is called directly by _commitChanges, but the debounced
call is still pending). It may be a problem if the subsequent
code does something like this.getSession().some_key, as if the
widget is destroyed, it has no parent that can provide it the
session, and thus it crashes.

Also rename attribute _debouncedStarted into _isDirty as it makes
much more sense.
2017-05-19 15:51:57 +02:00
Aaron Bohy a845ecffa1 [FIX] web_editor: field html: save changes done in code mode
Summernote doesn't call the onChange callback when changes are
done in the code mode, so the html field isn't aware of those
changes. It means that if the user does some changes in code mode
and then save directly (without coming back to normal mode), those
changes are lost.

This rev. ensures to save every changes by manually come back to
the normal mode before saving, as this will correctly trigger the
changes. Actually, it simply restores some code of the previous
implementation (before new views) of this widget.
2017-05-19 15:51:57 +02:00
Deep Patel b6660433c6 [IMP] mail : Display Log instead of Send in full mail composer
Purpose
=======

Improve label in full mail composer.

Specification
=============

In full mail composer if it's log than send button string should be "Log".
2017-05-19 15:50:00 +02:00
Martin Geubelle 7524b8ef92 [FIX] web: allow passing multiple ids in call_button
Passing multiple ids wasn't correctly handled as the argument `record_id`
was wrapped in a list of list, which is not hashable.

The wrapping is now handled by the caller.
2017-05-19 15:04:16 +02:00
Martin Geubelle ea7ff8f6fa [FIX] web: Form: handle attributes and modifiers on notebook
Before this commit, the renderer interpreted the special tag, but ignored
modifiers and attributes.

Most nodes are rendered by the `_renderGenericElement` method, so this behaviour
is automatic. However, special tags need to do it explicitely.
2017-05-19 15:02:21 +02:00
Martin Trigaux 0280354045 [FIX] point_of_sale: recompute for current session only
The previous trigger would recompute all sessions of a config when modifying
the cash_control flag on the config.
It was not possible to enable cash_control if a previous session wasn't in
cash control mode.

Recompute only when changing the config.
2017-05-19 14:32:56 +02:00
Géry Debongnie 92409cdfe5 [FIX] web: apply onchanges for sub fields for new records
Before this commit, when creating a new record, we only looked at the
main fields to determine if a call to onchange was needed.  This was not
enough, since sub fields (fields in a one2many for example) can have an
onchange.

This was an issue only for new records with onchanges in sub fields, but
no onchange on main fields.  For example, the merge contact wizard.

To solve this issue, we had to propagate the current view type from the
field to the basic model, because otherwise, the main viewtype was used
to compute the onchangeSpec, and that is not always correct.
2017-05-19 12:14:49 +02:00
Nicolas Martinelli 53b5c48bc6 [FIX] website_sale: potential crash
`_cart_find_product_line` can return more than 1 order line . Since it
might be necessary in `website_sale_options`, just prevent the crash.

opw-743805
2017-05-19 10:38:52 +02:00
qsm-odoo 965d0c50ec [FIX] maintenance: use of "active" instead of "archive"
The maintenance.request "active" field was renamed to "archive" for some
strange reason by commit 9a20c6556f.
The value was also inverted.

Unfortunately, "active" was not replaced in a search filter.

opw-744168
2017-05-19 10:24:42 +02:00
ged-odoo ccb550a599 [DOC] doc: improve install documentation
With this commit, we try to explain a little bit better what the enterprise version is (just a collection of extra add-ons, not a full-blown server).
2017-05-19 10:19:48 +02:00
Joren Van Onder 27b0c14326 [FIX] point_of_sale: fix forward-port of 7836a83b
Introduced at 0570033ae7. Normally not a
huge issue (you just end up with a '>' character). But unfortunately
in this case it crashes the hw_escpos driver since it tries to parse
the content of that element as a float.

opw-744222
2017-05-18 17:29:48 -07:00
Goffin Simon c0a71bf26a [FIX] crm: default vale for date_open
The default value for the date_open must be up to date.

opw:741748
2017-05-19 00:39:28 +02:00
Joren Van Onder 3f4e30403d [FIX] point_of_sale: put pos back in XmlReceipt render context
7836a83b3b was implemented for 9.0 and
uses the pos property. It was forward-ported to saas-11 and up. This
particular property was removed in saas-11 at
467ba386f4 because it was unused.

opw-744222
2017-05-18 10:27:37 -07:00
maitaoriana b753265ad3 [CLA] update Vauxoo's CLA
add maitaoriana

Done at #17078
2017-05-18 17:58:05 +02:00
Nicolas Martinelli 46bb7921e7 [FIX] account: avoid with_context in loop
Because it uses a different cache for each iteration, which slows down
the process.
2017-05-18 17:10:42 +02:00
Nicolas Martinelli 2c86366610 [FIX] crm: convert lead to opportunity
- Create a contact
- Create a lead
- Convert lead to opportunity w/ link to existing customer option

Salesperson on the lead to opportunity merge overrides the salesperson
in the contact record.

Link with existing customer should not override salesperson on contact
record. The two fields should be independent of each other unless you
are creating a new contact.

opw-659028
opw-740526
2017-05-18 17:06:42 +02:00
Nicolas Martinelli f57f133047 [IMP] account, l10n_*: remove dependency on base_vat
Localizations depend on the module "base_vat". It is therefore
impossible to remove base_vat without the localization. This causes
issues for users who simply want to deactivate the VAT check.

opw-743260
2017-05-18 17:05:22 +02:00
Yannick Tivisse 707e5ea861 [FIX] sale: Don't hide CRM menuitem when installing ecommerce 2017-05-18 16:51:53 +02:00
Goffin Simon 9553355660 [FIX] crm: quick create in crm.lead
When making a quick create for a crm.lead record, the field user_id is set
with its default value (introduced by aa44700dcc)
But the date_open('Assigned') was not set.

When creating a challenge with goal="New opportunities", the new opportinities
are counted with date_open. But when creating an opportunity with the quick create,
it was not counted as date_open was empty.

opw:742751
2017-05-18 16:32:52 +02:00
Nicolas Seinlet 12808c512d [FIX] point_of_sale: speedup order creation
When creating orders from the interface, all the orders of the current session
are in the cache and slow compute methods are recomputed.
Clear the cache before evaluating to execute _compute_amount_all on the current
order only.

The cache mechanism has changed in v10 and no longer contrains all orders.

opw-741442
2017-05-18 16:17:50 +02:00
Goffin Simon fa87b0d6ff [FIX] purchase: _anglo_saxon_purchase_move_lines
Let's consider a stockable product P with a product category PC with costing method = real price,
valuation = perpetual, stock valuation account = SVA and price diff account = PDA.
The cost defined for P in product.template is equal to 1$.

Steps

-Create a PO for P with a price unit = 5$
-Confirm PO and generate the invoice
-Update the qty for P in the invoice and validate it(price unit is still 5$)

Bug:

In the general ledger: a move with a debit of 1$ is created for SVA and a debit of 4$
is created for PDA which is wrong. The expected result is: just a move of 5$ created
for SVA and nothing for PDA because the difference between the purchase price and the
invoiced price is 0.

This commit fixes this problem.

NB: in real price and average price, the considered cost must be the purchase price
and not the cost defined in the product template.

opw:740879
2017-05-18 15:15:01 +02:00
Yannick Tivisse 5dfd342d08 [ADD] sale_management: Separate sales menu items from sale app
Purpose
=======

Don't display sales app icon in Odoo homepage when installing ecommerce (only website should be visible)
it's confusing to have sales icon  -> where do I manage my sales? In sales or in website? -> in website

Specfication
============

We need one new modules to add Sales menus to the homepage. Currently they come with "sale". So when installing "website_sale", we get them (because sale and account are dependencies of website_sale). We don't want that anymore. Along with that you need to replace modules in Apps menu:
sales menu items must be in the new sale_management module, no longer in sale

- create new app "sale_management"
- Currently 3 app icons when installing ecommerce (Sales, Invoicing, Website) -> too many icons, where to start? -> GOAL: Only 2 icons > Website, Invoicing
- new module to display Sales Icon (like account_accountant): "sale_management"
- move menu items to sale_management
- sale, sale_management: move app description, rewrite the manifest file
- sale, sale_management: move tour from sale > sale_management
- Changes in some dependency module "sale" > "sale_management" modules: event_sale, mrp_repair, pos_sale, report_intrastat, sale_crm, sale_expense, sale_stock, sale_timesheet, website_quote

Menu items to move 'sale' --> 'sale_management'
===============================================

Sales
	Quotations
        Sales Orders
Invoicing
	Orders to invoice
        Orders to Upsell
Catalog
	Products
        Product Variants
        Pricelists
Reporting
	sales
Configuration
	Settings
        Products -Attributes, Attribute Values, Internal Categories
2017-05-18 14:41:48 +02:00
Yannick Tivisse 0f92eed8a0 Revert "[ADD] sale_management: Separate sales menu items from sale app"
This reverts commit 9ab421d99a.

We should use the active field on the ir.ui.menu with the root menuitem instead of moving all the menuitems into a new module
2017-05-18 14:41:48 +02:00
Martin Trigaux f4ce2c7c2a [FIX] point_of_sale: restore removed method
Was removed at 173b76c7bb but was used in pos_blackbox_be (and maybe other
custom modules)
Restore the previous method that will call a read on the computed fields
2017-05-18 14:34:52 +02:00
Raphael Collet afef71d6b9 [FIX] Always round monetary values in database (#17010)
Let `create` and `write` round monetary field values before sending them to the
database. Pass the values to be written to `field.convert_to_column`, so that
the currency can be retrieved from the values, and the value be rounded.
2017-05-18 14:15:07 +02:00
Nicolas Lempereur 41c75ad0c3 [FIX] report: blank page on Background template
The `Background` template report (added in 3d04e4488) has been reported
in some instance to have CSS which could cause an empty page at the end
of the report.

This is caused by the following CSS rule which allow to have the
background at the bottom of the content:

.o_report_layout_background {
	min-height: 1000px;
}

this is probably caused by a difference in header/footer height, font or
version of wkhtmltopdf (this has been reproduced on wkhtml 0.12.1).

A fix is hard to do for this and keeping the background at the bottom of
the report content because of how wkhtml behave. So to mitigate (and
hopefully it doesn't come back) the issue, this commit just change the
CSS min-height.

opw-726546
opw-743315
closes #17072
2017-05-18 14:02:40 +02:00
Aaron Bohy 8af3d452f4 [FIX] web: BasicModel: read_group on selection field
When grouping on a selection field, the read_group may return a
group for value false (containing records with the selection field
unset, typically). When this happened, there was a crash because
the BasicModel didn't handle that case (it assumed that the value
of the groups was always a valid key of the selection).
2017-05-18 13:55:46 +02:00
Aaron Bohy f77e86b67b [FIX] mass_mailing: read_group: grouped on selection field
The model MassMailing overrides read_group to handle the case when
it is grouped by field state, which is of type selection. However,
it sets as value for each group the array [key, name] of the
selection option, which is incorrect (it should set key as value,
like the default read_group does, and as the name is known client
side anyway).

This case was handled by the old views, but it isn't by the new
ones, which are less permissive. We choose to fix the read_group
override instead of allowing both cases in JS, as it is always
better to have a clear and single API.
2017-05-18 13:55:46 +02:00
Aaron Bohy abacdd9776 [FIX] web: FieldRadio with numerical keys encoded as strings
Before this rev., the FieldRadio didn't work on selection fields
with keys like "0", "1"... i.e. strings that can be converted to
numerical values. This was due to an automatic conversion of those
keys to their numerical value by JQuery, so when the user changed
the value, an unknow key was sent to the server (e.g. 1 instead of
"1"), causing a crash.

This rev. changes the logic a bit so that the keys are no more
written in the DOM, but their index in the selection are.
2017-05-18 13:55:46 +02:00
Aaron Bohy 787daee41f [FIX] stock_account: inventory valuation: default value
... for 'compute_at_date' field (default 0, 'Current Inventory').

Before the new views, this value was selected by default by the
FieldRadio, but it was a mere coincidence. Indeed, as the field
had no default value, no value was specified in the default_get,
and for no reason, the widget selected 0 as value.

Anyway, as this behavior was wanted, we simply specify a default
value in the action.
2017-05-18 13:55:46 +02:00
Aaron Bohy 94c91374e3 [FIX] web: selection field with value 0
The server doesn't make a distinction between an unset selection
field, and a value 0 (integer). So when 0 is a valid key for the
field, the server returns false as value if the field is unset, or
if its value is 0, which is not really convenient.

As a consequence, when the value is 0, it appears as unset in the
interface. To circumvent this, we automatically converts false
value of selection fields to 0, if 0 is a key of the selection.
2017-05-18 13:55:46 +02:00
Géry Debongnie 3dd97db07f [FIX] web: properly loads default values for many2manys
Many2many default value can be a list of ids, and in that case, we did
not properly load data.

It could be seen by selecting a few contacts (in list view), then
opening the 'Merge contact' wizard in the sidebar (action menu).  Before
this commit, the wizard did show a list with some empty rows (for the
field partner_ids).
2017-05-18 11:33:32 +02:00
Nicolas Martinelli 4cbbbaddd5 [FIX] account: Sales team on refund
When doing a refund of an invoice, the sales team is not kept. At the
same time, remove fields which don't exist anymore.

opw-743093
2017-05-18 11:11:37 +02:00
Jérome Maes c5555a439e [FIX] calendar: use the correct model
Getting the recurrent event in an order that make
sense for this model.
`self` is mail.message model, so this order can cause
crashes, since calendar.event and mail.message have
many different fields.

opw-743265
2017-05-18 09:30:11 +02:00
Goffin Simon 64eb5ce48e [FIX] account_bank_statement_import: journal without default credit/debit account
A traceback was raised when importing a statement for a journal without default credit/debit account.

opw:742196
2017-05-18 09:21:26 +02:00