Commit Graph
109638 Commits
Author SHA1 Message Date
Aaron Bohy ac092e9ccd [FIX] web: List: force grouped lists to be non editable
Editable grouped list views isn't a supported feature. Before this
rev., grouped lists weren't automatically set as non editable, so
it could cause crashes when the user clicked on rows of grouped
lists with editable="top" or "bottom".

This was for example the case in Timesheets > All timesheets ->
go to list view.
2017-05-16 08:49:26 +02:00
Aaron Bohy 55de60db6e [FIX] web: BasicModel: missing fields in data for x2m
The 'data' attribute of exported datapoints (using 'get') must
contain a value for each field in the view, and the default value
is false when those fields are unset. The code manipulating those
datapoints supposes that this is the case and it makes it easier
and clean.

However, it wasn't the case for x2manys in new records for which
the default value contains CREATE commands with missing fields:
in that case, those missing fields weren't added in data.

This caused a crash in the Employee form view, in edit, if the user
clicked on 'Create and Edit' of the 'Working hours' field, because
some code in field_utils assumes that if the value of a date field
isn't false, it means that it is a moment instance (but in that
particular case it was undefined).
2017-05-16 08:49:26 +02:00
Christophe Matthieu 5f13b7f019 [IMP] web: update datepicker syntax with the new guidelines 2017-05-15 16:19:47 +02:00
Christophe Matthieu 932e887400 [FIX] web: datepicker did not select correct date after initial render 2017-05-15 16:19:37 +02:00
Martin Geubelle 2e6a1623ff [FIX] product_email_template: remove malformed XML
This was causing an error in the form rendering as a group does not
accept text as direct child (and displaying '/>' as text was probably
not the desired behaviour.
2017-05-15 14:55:22 +02:00
Martin Geubelle a7411165f3 [FIX] web: Kanban: update buttons after column creation
The buttons were not updated after column creation.
This was causing an issue in an empty kanban when you created a new column,
the 'Create' button was not highlighted.
2017-05-15 14:55:21 +02:00
Martin Geubelle a0217f4475 [FIX] web: BasicModel: update parent data after record deletion
After the record deletion, the parent should be updated to take the deletion
into account.

This was causing an issue in the Kanban view: after a column deletion, it appeared
again if you created a new one.
2017-05-15 14:55:21 +02:00
Martin Geubelle 2fb4cf46d2 [FIX] web: Kanban: correctly destroy old widget after update
The attribute `widgets` has been renamed in rev https://github.com/odoo/odoo/commit/7ff8aa73e17b281b3e2bc4c7275d020eab0204e7#commitcomment-22116249
However, KanbanRenderer still uses a `widgets` attribute, not for the fields
widgets but for its columns (or records if ungrouped).

These widgets weren't correctly destroyed since then.

This was causing an issue when you were trying to quick create a record after a
column creation (that generates an update): the quick create was added in the
first old column (which was not in the DOM anymore) so you couldn't see it.
2017-05-15 14:55:21 +02:00
Martin Geubelle feb4a8986d [FIX] web: Kanban: correctly add the created record in group
The kanban group expects to have local ids in its data and not the whole
datapoint.

This was causing a traceback when adding a new column after adding a record.
2017-05-15 14:55:21 +02:00
Christophe Matthieu ef35702cbc [FIX] web: remove some memory leak 2017-05-15 13:16:02 +02:00
Christophe Matthieu 1c5ea99b7b [FIX] web: display a translation alert when saving the form view
In the form view, when the user saves a record (with a multilang instance),
an alert is displayed to display all modified translatable fields.
2017-05-15 10:06:58 +02:00
David Monjoie b57283619c [FIX] web: display field node string in form dialog title
Previously, the string attribute of the field node was ignored
in the title of the form dialog and it always displayed the
string value of the python field definition instead, which is
a default value instead.

Additionally, I took this opportunity to add tests for other
similar dialog titles which actually worked already with the
string attribute of the field node but were not tested yet.
2017-05-12 14:53:48 +02:00
David Monjoie 42d95cbfc3 [FIX] web: keep focus on checkboxes after rerendering
Previously, when a checkbox was re-rendered, it was losing focus
since it was removed and re-created. Now, if the checkbox itself
is the origin point of the re-rendering, we give the focus to the
newly re-rendered checkbox, resulting in a seamless experience
just as if the checkbox was never removed and re-rendered.
2017-05-12 14:53:48 +02:00
Géry Debongnie 310588b813 [FIX] web: prevent duplicated footers in dialogs
In some cases, we had duplicated footers in form view dialogs.  It
actually happened when the view was reloaded, which is not particularly
frequent, but happens most of the time the user clicks on an action
button, which does not close the window.

To reproduce the issue, you can open the lunch module, click on the
'Feeling Lucky' button.  It will open a form view with a special button
in the footer: 'I'm feeling lucky'.  Clicking on that button will return
an error (no order matches the criterion), and will trigger a form
reload.  Then, you will see two footers: one in the modal footer, the
other one in the form renderer.

The solution to this issue is to make sure, when we update the view and
a footer tag is found in the form renderer, to replace the current
footer buttons by these new buttons.
2017-05-12 14:05:17 +02:00
Jérome Maes e7e8ecc77b [FIX] project_timesheet_holidays: fix tests
Handling datetime is not a good idea, mostly
when computing different in terms of days.
Forcing the hour (time) will set the tests correctly
regarding the working hours, and the datetime
difference, independently of the execution time
of the test.
2017-05-11 18:27:33 +02:00
Thibault Delavallée 0d4ed7abf5 [FIX] hr_timesheet: compute default employee at create instead of having a default value
This way existing analytic lines won't have to set the current user
as employee when installing hr_timesheet module.
2017-05-11 17:25:41 +02:00
Jérome Maes 0c9c530233 [IMP] sale_timesheet: add test for revenue computation 2017-05-11 16:58:58 +02:00
Jérome Maes dcd7b0f5c3 [FIX] sale_timesheet: correctly handle multi currency and rounding 2017-05-11 16:58:45 +02:00
Jérome Maes fa0769c41c [IMP] project_timesheet_holidays: add tests
Tests to check the timesheet generation
when validating leaves.
2017-05-11 16:58:37 +02:00
Jérome Maes 486fe737b6 [IMP] hr_timesheet: add test cases
Add some tests case  about logging timesheet
2017-05-11 16:58:30 +02:00
Jérome Maes 6820863c59 [FIX] project_timesheet_holidays: correctly set the employee for generated timesheet 2017-05-11 16:58:23 +02:00
qsm-odoo 40a026d5b2 [FIX] web: implement <newline/> form tag behavior
Before this commit, the new form view implementation was rendering
<newline/> tags as real <newline/> DOM element. The wanted behavior
is now restored:
- As outer group direct child, produce a <br/> tag, forcing the next
  group children to be on a new line
- As inner group direct child, produce nothing but forces the creation
  of a new <tr/> (for the next group children)
2017-05-11 15:09:25 +02:00
qsm-odoo 97517a1cc2 [REF] web: label creation on form view rendering
The original goal of the commit was to implement a missing behavior
for label tags in form view. This finally need some deeper refactoring
for it to work so this commit does not introduce any change in behavior,
only comments explaining the problem.
2017-05-11 15:09:25 +02:00
qsm-odoo 23beee818a [FIX] web: do not lose field/label pair on field rerendering
When a field widget switches between readonly and editable states, it is
fully rerendered. Labels have sometimes to get a specific class when
their associated field is (become) readonly and without any value. This
condition was evaluated on the initial widget and not on rerendered
ones.

Note that this commit only restores an already implemented behavior
broken by https://github.com/odoo-dev/odoo/commit/8f9362809e91ff7c2876ab464017abb13a4e0974
... but this time a test will prevent a new breaking
2017-05-11 15:09:25 +02:00
Martin Geubelle ef643783a5 [FIX] web: deal with malformed default_order
Even if the `default_order` attribute should be like 'name,id desc,coucou'
we want to support the syntax 'name, id desc, coucou' (i.e. with spaces after
the comma).

The commit also patches the mock server.
2017-05-11 14:48:35 +02:00
Christophe Matthieu 2e69c189b1 [IMP] web: calendar test: Error message when the screen is too small 2017-05-11 12:57:59 +02:00
Christophe Matthieu cc141dcce1 [FIX] barcode: Avoid making requests to onchange method on each scan
Usecase: A person scans various products in a warehouse or the network is slow.
Only one request per product must be made, the rest is changing the number locally
and all performed scans (products or actions) must not be lost.
The mutex ensures that the scan is performed in the correct order.
2017-05-11 12:57:44 +02:00
Christophe Matthieu eae62af904 [FIX] account: remove automatic reconciliation button for manual reconciliation
Functionality deprecated since v9
Add also some small rendering fixes for manual reconciliation:
* display congrats only once
* display journal_id as required
* use isValid to create a new proposition line
* Can erase all proposition lines in manual reconciliation
2017-05-11 12:57:32 +02:00
Martin Geubelle c8d063d357 [FIX] web: use o_tag_color outside of badges
Since rev https://github.com/odoo/odoo/commit/250e716c3a12e88acb4a199b427dc47d4ec55d5d
the colors have been mistakenly moved in a too restrictive rule and could only be
used in a badge.
2017-05-11 11:21:00 +02:00
Martin Geubelle 268397e880 [IMP] web: TestUtils: allow to smoothly intercept an event
A parameter has been added in the `intercept` function if one wants to
intercept an event without stopping its propagation.
2017-05-11 11:20:59 +02:00
qsm-odoo 69d572a015 [FIX] web: restore col(span) feature for form groups
Current new implementation of the form view ignored several properties
linked to <group/> elements:

- groups' col attributes were considered to always be 2
- groups' children colspan attributes were considered to always be 1
- elements different than <field/> and <label/> in groups were forced
  to their own row
- it was not possible to have a group hierarchy deeper than 2
- <td/> elements widths were not properly set
- ...
2017-05-11 10:39:06 +02:00
qsm-odoo c44578ee1a [IMP] web: improve qunit logging and config
When a qunit test fails, the log only contains the assertion message.
This is in fact useful to have the "actual" and "expected" values to
understand the bug.

Also, we recently updated the configuration so that the "hide passed
tests" option is enabled by default. This is in fact useful to have
it disabled if the user wants to run only one test (debugging).
2017-05-11 10:39:06 +02:00
qsm-odoo ac7da497a2 [REF] web: form_tests.js was wrongly indented 2017-05-11 10:39:06 +02:00
Géry Debongnie c31bf95e4e [FIX] pad: make it work with the new views
The pad widget was partially updated to the new views, but was no longer
working.  In this commit, we rewrite the widget to make it work.

Note that we did some functional changes:
- we do only one rpc to check if the server is configured. the result is
  stored on the prototype, so we do not need to do it again
- we do some rpcs with shadow: true, so we will not stop the rest of the
  ui if the server is slow to respond
- we display a loading message in readonly, when the content is not
  loaded yet.
2017-05-11 09:53:10 +02:00
Géry Debongnie 33710d540c [FIX] web: small fixes in test framework
We fix in this commit three small issues in the test framework.

1. throw an explicit error when we try to do a fieldviewget in the mock
server with a model that does not exist.  This will make it easier to
figure out what went wrong when copy pasting a test from one file into
another, and forgetting to change the model in the createView parameters

2. wrap the result of special methods in the mock server in a deferred,
so we can simply return a value when using that functionality.  Also, it
is more consistent with the rest of the mock server

3. for iframes, we no longer change the src attribute to #test:url.
This had the problem of actually loading the page.  Instead, we change
it into about:blank and we copy the old url into the data-src attribute for
reference.
2017-05-11 09:53:08 +02:00
David Monjoie e1edd62320 [FIX] web: toggle checkboxes when clicked in editable list view
Previously, the checkbox was not checked when it was clicked in
editable list view, it only opened the row but did not check the
checkbox.
2017-05-10 15:20:03 +02:00
Lucas Perais (lpe) ec3baa6027 [FIX] l10n_fr: fix description of taxes 2017-05-10 10:54:26 +02:00
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