Commit Graph
109601 Commits
Author SHA1 Message Date
Lucas Perais (lpe) 189b2b5ce2 [FIX] l10n_fr: remove exclusion of account_cancel
l10n_fr is compatible per se with account_cancel, although cancelling account moves is not the right or best practice in accounting anyway.
2017-05-10 10:45:26 +02:00
Géry Debongnie 84187f972a [FIX] web: prevent view_dialogs from changing env
With this commit, we prevent view dialogs from changing the 'global'
environment in the view manager.  Here is how it could cause a problem:

* open a form view for a bill of material
* click on one of the component, it will open a form view in a dialog
  (and will change the environment with a wrong res_id)
* click on the many2one product -> it will open a new action in the
  background, and change the environment again
* click on the breadcrumb to come back to the bill of material: the view
  manager will try to restore the correct res_id (which is the wrong id
  from the component form view), the form view will do a read (when
  reloading the data), will get an empty result, will update its
  information with no data, then will be in a wrong state which means
  that the basicmodel will fetch a x2many with a wrong res_ids list
* boom
2017-05-09 17:03:30 +02:00
Martin Geubelle 136a119311 [FIX] web_editor: use new rpc system
Directly use `ajax.jsonRPC` makes it untestable as the RPCs can't
be mocked.
2017-05-09 15:19:00 +02:00
Martin Geubelle 0ac2d8f015 [FIX] web: add o_input class on m2o dialog input
Since the rev https://github.com/odoo/odoo/commit/250e716c3a12e88acb4a199b427dc47d4ec55d5d
the class `o_input` needs to be set on an input to correctly style it.
2017-05-09 15:19:00 +02:00
Yannick Tivisse 4f0544ad7c [FIX] hr_contract: Show kanban by default from contract stat button on employee form 2017-05-09 12:11:43 +02:00
qsm-odoo 111465c318 [FIX] web: numbers in list views should be right-aligned
Before this commit, numbers in list views were right-aligned
depending on the widget they were using (float/monetary). Now, the
input text alignment is inherited from the parent which should
solve the problem.
2017-05-08 17:12:11 +02:00
Martin Trigaux 7afe6d28b6 [FIX] account: do not display unused field
The field move_line_ids was present in the view and used only for display
purposes. However modifying another field triggering an onchange (e.g. a payment
line) was recreating the move lines.
Recreating the accounting entries may trigger an error if the entries are
already posted.

The entries are recreated because:
1. the move_line_ids is loaded with the default tree & form view for
   account.move.line records, displaying several fields
2. some of the fields (e.g. reconciled) are computed
3. the initial onchange recomputes all the computed field, including the one
   on the one2many (e.g. recomputing move_line_ids.reconciled)
4. the field being dirty, the onchange returns the value of move_line_ids with
   [(5,),(1,id,{...}),...]
5. trying to save the modified lines may fail

Replace the field by a simple readonly integer field.

opw-741205
2017-05-08 16:56:36 +02:00
Yannick Tivisse 47dab7d3b4 [FIX] hr_payroll: Allow a HR user to create a contract if not a payroll user 2017-05-08 16:55:51 +02:00
Yannick Tivisse 12dd3f3e99 [FIX] l10n_be_hr_payroll: Clean new_car display to avoid confusion between existing and new cars 2017-05-08 16:55:51 +02:00
Yannick Tivisse 3a2e4c1d7d [FIX] hr_contract,hr_payroll,...: Update tooltips on contract and job fields 2017-05-08 16:55:51 +02:00
Yannick Tivisse 62c2d0c3aa [FIX] hr,hr_recruitment: Display information correctly on job form 2017-05-08 16:55:51 +02:00
Yannick Tivisse dbeff8cce1 [FIX] hr, hr_contract: Rename 'Job Title' into 'Job Position' 2017-05-08 16:55:51 +02:00
Yannick Tivisse 967f92a539 [FIX] l10n_be_hr_payroll_fleet,fleet: Correct total costs computation on model + layout improvement 2017-05-08 16:55:51 +02:00
Jérome Maes a4b136377a FIX im_livechat bundle due to new views yeay 2017-05-08 15:57:18 +02:00
qsm-odoo 0764bc41aa [FIX] web: list rendering was not properly updated after discard
Before this commit, when hitting the "Discard" button in an editable
list view, the line switched to readonly mode but with the undiscarded
data (even though the data was properly discarded and not saved).

Fortunately, the fix is in fact making the save/discard/update system
more consistent. Here are some reasons why:
- the `_confirmSave` method is now used after a save or a discard
    (while it was before only called on readonly views where a change
    was made by a special field widget).
- Abandonning a record (discarding a new unsaved one), is now the
    responsability of `discardChanges` (and not `_setMode`).
- The renderer `updateState` method is used when its state is updated.
- ...

Note that setting the renderer mode is now taking care of deferreds
properly (the widgets deferred are now considered when switching
a row to readonly/edit mode).
2017-05-08 14:02:40 +02:00
Géry Debongnie c8d77f93e5 [FIX] web: display empty input fields properly
Before this commit, it was not possible to see the difference between an
unset float field (with a 'false' value) and a set field (for ex, with
value 0)

This was due to the fact that the formatFloat/formatMonetary functions
format false values as the number 0, unlike many other formatting
functions.
2017-05-08 13:56:18 +02:00
Yannick Tivisse aeae2fb64f [FIX] l10n_be_hr_payroll: Prevent 'Child Allowance' to exceed 'Withholding Taxes'
Note: Small fix, long diff. Read the specifcation section to understand why.

PURPOSE
=======

The child allowance is an amount to decrease the withholding taxes due to family charges.

SPECIFICATION
=============

Instead of having a salary rule with a fixed amount for the child allowance, we should have a salary rule on which the amount is computed with a python code, that take the minimum between the original fixed amount and the remaining withholding taxes to pay.

As the field 'amount_python_compute' isn't in the field declaration on the csv file, we have to add it and modify all the lines. The result is a quite long diff for a small fix.
2017-05-08 12:45:14 +02:00
Yannick Tivisse ac8800f0e0 [FIX] hr_contract,hr_payroll: Forms, menuitems and layout reorganization
New view for contract templates with a dedicated menuitem and less displayed information
2017-05-08 11:25:11 +02:00
qsm-odoo c1377f5972 [FIX] web: properly handle field navigation for all fields
Before this commit, only fields which were specializations of the
`InputField` were handling up/right/down/left navigation in editable
list view. As m2o field is not an `InputField` (yet?), it was not
possible to navigate from one of those for example.

Now, navigation events are handled by the `AbstractField` class. If a
given field has to handle navigation a different way, it is its
responsability to stop the associated navigation event. For example,
`InputField` instances are stopping the left/right event if the cursor
is not at the start/end of the <input/> element.

Also, before this commit, there were many events ("move_down",
"move_left", "move_next", ...). Now there is only one event for
navigation: "navigation_move". This event is given a "direction" data
("left", "next", ...). It also comes with a "target" data which is a
reference to the last `AbstractField` instance the navigation event
has crossed.
2017-05-08 10:38:05 +02:00
Aaron Bohy c04b840a45 [FIX] web: FieldMonetary: don't loose focus after edition
... in x2many editable list views.

Field widgets can detect that they are at the origin of a
field_changed event, so that they don't re-render themselves when
they are being edited.

This didn't work for fields inside x2many list views. This wasn't
a big problem for most of the fields, because the cursor position
was automatically reset after a re-rendering, but it wasn't
working for monetary fields that empty their $el before each
re-rendering.

This rev. fixes the issue by making the field widgets inside
x2many list able to detect that they are the origin of a change,
and thus removes the now useless code that restore the cursor
position.
2017-05-08 08:10:00 +02:00
Géry Debongnie c75680c527 [REF] web: optimize basic model (improve perfs for most views)
The 'get' method in the basic model is called very often (too often, but
that is another issue).  For a large list with many columns, it can be
quickly be called more than 10k times.

In that function, we had to protect our integrity by performing a deep
clone with $.extend, so noone else can be allowed to change something in
our internal structure.  This is good in theory, but not so good in
practice, as $.extend is a really expensive operation.

Also, we try to have the smallest external API by deleting useless keys.
But instead of keeping a blacklist of private keys, it is simpler to
have a whitelist of public keys.

So, what we do is to explicitely construct the object returned by key,
since we know the types of every values involved.  This is more
explicit, and at the same time, much faster.

Also, we propagate the options for elements of type list.  This is why I
had to change the isFieldSet method.

In a benchmark I just ran, loading and rendering a large list (200 rows,
7 columns) went from about 2.7s to 0.7s.

We still do way too much work, but at least it is much faster...
2017-05-07 22:38:27 +02:00
Simon Lejeune 9d7b421b8c [REL] 10.saas~16 2017-05-05 18:08:51 +02:00
Christophe Simonis 9898b125ad [MERGE] forward port branch saas-15 up to c0e4ab8080 2017-05-05 17:23:23 +02:00
Christophe Simonis c0e4ab8080 [MERGE] forward port branch saas-14 up to bac4d13d47 2017-05-05 17:17:02 +02:00
Martin Geubelle 4d6aff97b6 [FIX] web: List: display invisible cells
An invisible cell should be visible in the list renderer otherwise
the cells are not correctly aligned anymore.
2017-05-05 17:05:53 +02:00
Raphael Collet 580e78ad37 [IMP] models: enable field.group_expand on all types of fields (#16833)
The attribute `group_expand` allows to reorder and add empty groups to the
result of `read_group`.  Enable this feature for other fields than many2one
fields.
2017-05-05 16:37:11 +02:00
Denis Vermylen cd90e83897 [IMP] website_hr_recruitment: add url widget to url field
This also allows the selection of the url which was previously bugged.
2017-05-05 16:21:46 +02:00
Christophe Simonis bac4d13d47 [MERGE] forward port branch 10.0 up to d5cdb77717 2017-05-05 16:19:28 +02:00
Christophe Simonis d5cdb77717 [MERGE] forward port branch saas-11 up to b7e4ce93c4 2017-05-05 16:01:38 +02:00
qsm-odoo 79bf627610 [IMP] web: do not wait to select value of activated fields
Before this commit, fields were selected on activation (focus) but only
after a setTimeout. This setTimeout is in fact not necessary. Removing
it allows to test the selection in unit tests.
2017-05-05 15:58:43 +02:00
qsm-odoo ac490b1b3e [FIX] web: better factorize debounced/input fields code
`DebouncedField` and `InputField` classes were not properly factorized,
some of the DebouncedField code had to be part of the `InputField`
class (which is a specialization of `DebouncedField`). Indeed the
`FieldText` class, specialization of `DebouncedField` class, was missing
properties which were part of `InputField` and was duplicating code
which was already defined in `InputField`.

For example, it was not possible to navigate out of text fields in
editable list views with the right/left keys as this was part of the
`InputField` class.

Note: the FieldTextHtmlSimple class was implementing the `commitChanges`
function differently than `DebouncedField` but this was in fact not
necessary. This is why documentation update has also been done for this
by this commit.
2017-05-05 15:58:43 +02:00
Christophe Simonis b7e4ce93c4 [MERGE] forward port branch 9.0 up to c65db01eb7 2017-05-05 15:43:56 +02:00
Christophe Simonis c65db01eb7 [MERGE] forward port branch saas-6 up to 96650373f8 2017-05-05 15:34:30 +02:00
Christophe Simonis 96650373f8 [MERGE] forward port branch 8.0 up to e3081dbb7e 2017-05-05 15:31:08 +02:00
Fabien Pinckaers 3118c837e3 [MERGE] phone_validation: add phone validation and formatting into crm and contact form
Please refer to individual commits for more details. This commit merges
remote-tracking branch 'dev/master-crm-phone-fp-tde'. Closes #16412 .
2017-05-05 15:30:50 +02:00
amoyaux d193350c6f [REF] mrp: ir.attachment handling
Rev[0] and [1] introduced a versioning on product's attachments through an
ECO creation or through a stat button on the product form view. These revisions
added some fields on the ir attachment model: a many2one and a boolean field
with a default value, and due to concerns over the migration of databases with a
lot of ir.attachment records (like ours), we adapted the implentation in rev[2][3].

We deemed reasonnable to remove the "active" field, as adding an active field not
in the “base” module of the model could impact other modules that did not took into
consideration this field. Also, this field only had a meaning when mrp_plm is
installed, and ir.attachment is used in various places in contexts across Odoo.

So, rev [2] and [3] changed the implementation of the versioning to only link
ir.attachment to an ECO record, forgetting the functionality of archiving directly
through the product form view stat button (without an ECO).

To introduce back this behavior, we chose to create a model to handle the mrp
attachments (named “mrp.document”) which inheritS ir.attachment. This way, we keep
the behavior of ir.attachment and we do not alter the original table.

This commit moved the priority field already set on ir.attachment to mrp.document
and adds the active field that will be used in mrp_plm to archive/versioning purposes.

linked commit:
[0] https://github.com/odoo/enterprise/commit/99138b6711760a7562cb9559663aef6a4208a48f
[1] https://github.com/odoo/enterprise/commit/4f88eb409776c1c4bc8f8d71d845b913c3604a54

[2] https://github.com/odoo/enterprise/commit/7e1c73cfc84cd23b6ba87dab713c3078de16568d
[3] https://github.com/odoo/enterprise/commit/ee1c4b29b8872dac9c525fcc6acdf80b5ef73131
2017-05-05 14:05:49 +02:00
Jérome Maes e3081dbb7e [FIX] ir_cron: log message in the right place
Log message in except clause to force displaying
traceback in logger exception.

Courtesy of chs
2017-05-05 13:57:32 +02:00
Aaron Bohy 18c3dbc2e9 [FIX] web: FieldMany2Many with editable lists: save changes
This rev. fixes 2 issues about many2many fields displayed with
an editable list view, occuring when the user edited some values
in the list.

First, the many2many field was re-rendered each time one of its
sub-widgets triggered a 'field_changed' event, and thus the row
the user was editing was no more in edition and the focused field
was no more focused. This was quite annoying.

Second, when the user saved changes made in the editable list view,
only a command 6 (REPLACE_ALL) was sent, so updates of subrecords
were never saved.
2017-05-05 13:31:48 +02:00
Aaron Bohy e8f9bb683d [FIX] web: DebouncedField: notify changes only when changed
Before this rev., if you opened a form view with, e.g. a float
field, that is unset, and then click on edit, then save, it
actually saved the new value for the float field (being 0),
whereas it shouldn't do any RPC as nothing changed.

This is because the former code couldn't detect if the value "0"
in the input is there because the field is still unset or if the
user simply set it to 0.
2017-05-05 13:31:46 +02:00
Nicolas Lempereur 89ad23bc2d [FIX] web: auto_search false and search view
By default auto_search is set to `True` on window actions, this mean
that for example on a list or kanban view the records will be searched
on the view opening without any user action needed.

Setting it to `False` disable this.

Doing this had two drawbacks:

- depending on race condition, the view could be displayed before the
  search view was loaded,

- the code expected `active_search` to be present which was not the case
  in this instance.

Before 151c9074 the second issue would not happen (active_search was set
directly resolved if a search was not to be done) and this commit also
wait for the search view being ready before showing the view.

opw-741186
opw-741546
closes #16805
2017-05-05 13:31:11 +02:00
Mehul Patel 47305199a8 [FIX] base_import: fix broken rpc calls
PR #16762
2017-05-05 12:55:55 +02:00
Fabien Pinckaers 4388505cc9 [ADD] website_crm_phone_validation: add phone validation in contact form
This way if phone validation is activated users will have to enter correct
phone numbers. This will greatly help having correct data in customer
tables and improve efficiency of CRM-based flow.
2017-05-05 12:27:07 +02:00
Fabien Pinckaers 2c61be1609 [FIX] website_form: improve field error management in contact form
This commit proposes to ease field error management by having a
structured json response having field name as keys and error message
as value. Controllers can return a specific error message for some
fields that is displayed in a popover.
2017-05-05 12:27:07 +02:00
Fabien Pinckaers 9074811771 [IMP] crm_phone_validation,crm: add config settings for phone validation in crm 2017-05-05 12:27:06 +02:00
Fabien Pinckaers 45fdd0b0bb [ADD] crm_phone_validation: implement phone validation in crm
This bridge module adds phone / fax / mobile number validation for lead
and partner models, using the recently-introduced phone validation tool
module.

This is done at onchange level and is therefore not blocking or
computationally heavy. Its main use is to help salesmen correctly
entering or checking phone numbers when using Odoo.
2017-05-05 12:27:06 +02:00
Fabien Pinckaers 96a004710c [ADD] phone_validation: tool module allowing phone number validation
Using phonenumbers library this module adds tools methods as well as a
small mixin for models that want to activate phone number validation
and formatting.

Formatting can be done always using an international format or having
both national and international format. This is configured on the
company.

Note that phonenumbers library is optional. Installing this module without
having the lib installed just skip its use but should not crash.
2017-05-05 12:27:06 +02:00
Yannick Tivisse 26b851e541 [IMP] sale_timesheet: Move timesheet_revenue computation in a separate method
Will be used in migration scripts to saas~16 to compute this value for all the invoices that have been validated
2017-05-05 11:05:39 +02:00
Géry Debongnie 2febb8778f [FIX] web: use action context in evaluation contexts
The process of evaluating a domain is not really difficult, but the hard
part is getting the evaluation context right.  The evaluation context is
supposed to contain informations coming from various sources (active id/ids,
session context, ...).  Before this commit, we just ignored the context coming
from the action.

This could cause many problems. For example, in the Inventory
application: create a picking, add 10 ice cream in initial demand, force
assign, click on scrap.  A form view should be opened (with the context
coming back from the button_scrap method).  In that formview, there is a
many2one Product.  Clicking on it should perform a name_search with a
domain looking like ['id', 'in', [64]].  This domain is the result of
the evaluation of "[('id', 'in', context.get('product_ids', []))]".
Before this commit, product_ids was ignored, so the domain was always
['id', 'in', []].

In this commit, we simply add the element context in the list of sources
when computing the evaluation context (the element context is the
context given to the view, which is the way an action give a context to
a view)

In short, handling context is hard...
2017-05-05 10:45:50 +02:00
Pierre Masereel 2c666af5d1 [FIX] mass_mailing: send mail to partner without email
When you send a mass mailing to muiltiple partner, if some of them have
no email adresse, it can lead to errors because of the variable 'recips'
is not set if the first occurence in the 'for loop' has no email.

To fix this, we always set the variable 'recips' by replacing the 'elif'
close by a 'else' one

introduced in rev: https://github.com/odoo/odoo/commit/65ed4553a50fdbefc986b7d21f87a81c42b743c7
2017-05-04 18:16:46 +02:00
Pierre Masereel 2c84ecc92f [IMP] delivery: put in pack wizard
If the picking has no carrier set, do not open the put in pack wizard
and keep the behavior of a classic picking. Also, filter the delivery
packages according to the carrier (note: this doesn't work at the moment
because of a bug in the new views, but it'll be fixed very soon, so we
merge anyway).

Also, remove an harmless typo in `manage_package_type` method.
2017-05-04 18:06:20 +02:00