Commit Graph
109328 Commits
Author SHA1 Message Date
Yannick Tivisse 7964b81ac8 [IMP] hr: Add some default values and fields
- Default gender is male
- Default marital status is single
- Move some fields from the contract to the employee (permit number, visa number, visa expiration date)
2017-04-26 15:08:09 +02:00
Yannick Tivisse c63e869fb2 [MOV] fleet: Split models and views into separate files
It's a PITA to have a huge files with all the models into it. We took this opportunity to stick to the guideline.
2017-04-26 15:08:09 +02:00
Yannick Tivisse 2e7cdc1c90 [IMP] fleet: Clean some views and add useful piece of information
PURPOSE
=======

During the Salary Package Configurator implementation, some improvement have been made to improve the fleet management module

- When duplicating a fleet vehicle cost (for example when duplication a vehicle contract), duplicate the included costs too.
- Add a field Cost Description on the list view
- Rename 'Acquisition Date' into 'Immatriculation Date'
- Rename 'Car Value' into 'Catalog Value (VAT incl.)'
- Add a information field 'Residual Value on a vehicle'
- Prevent an employee to have several cars
- Only display opened contract on the vehicle form view
- Add the driver on the odometer list view
- Rename 'Odometer value' into 'Odometer at creation' on a vehicle contract
- Restructure to vehicle model form view to be bearable by a human eye
- Show the handle widget on the fleet vehicle state list view
- Show configuration menuitems to fleet managers, not only debug mode
2017-04-26 15:08:09 +02:00
Adrien Dieudonne f6f342e50b [FIX] web: FormController: prevent opening multiple form dialogs
Before this commit, the form dialog was open twice when you tried to
add a new record on a one2many if you were already in a modal.

The event wasn't stopped, so the first form dialog was correcly rendered
but the second one tried to load the same form view on a wrong model.
2017-04-26 14:44:52 +02:00
Parth Gajjar 18971b3e3a [FIX] web: properly transfer field options to fields data
The basic model did not transfer field options to special data methods
from fields.  This was mostly not an issue, except for the widgets that
actually need them, such as the status bar and the domain editor.

This was only visible when opening views with different view types,
but this is a problem in general.  We should have a better mechanism to
help widgets fetching data, but for now, this is the best we can do.
2017-04-26 14:43:16 +02:00
Aaron Bohy e950f60fef [FIX] web: increase timeout of test_01_js
This test executes the QUnit js test suite. Since the new views,
this suite keeps growing, which is good. The default timeout
for phantomjs tests is 60 seconds, which starts to be tight for
test_01_js when the runbot is overloaded.

So this commit increases the timeout of this test to 120 seconds.
2017-04-26 12:25:35 +02:00
Fabien Pinckaers f9644d3698 [IMP] sale_timesheet: better labels 2017-04-26 12:12:04 +02:00
Fabien Pinckaers a5255bc875 [IMP] sale_timesheet: placeholder on project_id 2017-04-26 12:03:06 +02:00
Martin Trigaux 0245228969 [IMP] point_of_sale: add ensure_one
instead of old assert
add doctstring to clarify the method structure
2017-04-26 11:27:15 +02:00
Aaron Bohy 8dfb32aa90 [IMP] web: qunit_config: hide passed tests by default
Tests are executed a bit faster in the browser when passed tests
are hidden.
2017-04-26 11:19:20 +02:00
Aaron Bohy bead8452c2 [FIX] web: Views: sequential lazy loading of libs
The views can specify js (and css) libraries to lazy load when
they are instantiated for the first time. The previous
implementation was too naive as it always loaded the specified
libraries in parallel. However, it may happen (e.g. gantt view)
that some of those libraries depend on other ones.

This commit implements a mechanism to handle libs dependencies
between each other. For instance, specifying:
    js_libs: [
        ['a', 'b'],
        ['c'],
    ],
will load 'a' and 'b' in parallel, but wait for them to be
loaded before loading 'c'.

The new implementation still supports the old syntax. So,
    js_libs: ['a', 'b', 'c'],
will load 'a', 'b' and 'c' in parallel.
2017-04-26 11:19:20 +02:00
Aaron Bohy 8f9362809e [FIX] web: FormView: notebook: activate first visible tab
In a notebook, tabs may have an invisible attrs. The first visible
tab should be active in any case. This wasn't working at the first
rendering of the view, because the invisible attrs was evaluated
for each tab, before processing the next ones, so the it couldn't
find a next tab to activate.

This fix ensures to process all tabs (i.e. generate their DOM
element) before evaluating their invisible attrs, and trying to
find which tab to activate.
2017-04-26 11:19:20 +02:00
Aaron Bohy 6fe55c370d [FIX] web: view_manager: reload views with correct params
Mode 'readonly' is a concept of list and form views. When
switching from a graph view to another view, then switching back
to graph, there was a crash because 'readonly' is not a known mode
of graph (in graph, mode is used to determine the type of graph to
display (pie, chart or bar)).

This is due to commit odoo/odoo@ef6b330 which aims to reset the
mode to readonly when coming back to a form view using the
breadbrumbs.
2017-04-26 11:19:20 +02:00
Géry Debongnie 2679fdd9b9 [FIX] web: add mutex in basic controller
Before this commit, concurrency issues were mostly handled by the mutex
in the basic model.  That mutex makes sure that save and change
operations are properly serialized.  However, this is not enough. Here
is an example:

1. we have a required field with an onchange and a current value
2. the user changes the value to an empty value. This triggers an
   onchange
3. the user clicks on save, before the return of the onchange
4. the controller checks with the renderer if it can be saved.  At that
   point, the onchange is not yet complete, so the values stored in the
   fields are still the initial ones, which are valid (non empty value
   for required fields)
5. so, the controller request a save operation
6. the model add the save operation in the mutex, wait for the onchange
   to complete, then apply the save operation
7. we end up with a required field with an empty value

The issue here is that the model properly saves and apply onchanges, but
the responsability to check if a record is valid (which depends on the
modifiers AND the field widgets) is the renderer's responsability (it
has to ask the question to all its sub field widgets).

So, we need to serialize 3 operations: applying the onchange, checking
if the save is valid, and saving the record.  This cannot be only in the
model, so we need to add a concurrency control mechanism somewhere else.
What we do in this commit is to add a mutex on the basic controller (it
will most likely be used by the list controller as well).  In this
mutex, we currently serialize the field change operation and the save
operation, but I assume some other operations will need to be handled by
the mutex.

In addition to this, we also change some asynchronous methods to return
a deferred, so we are ready for other kind of asynchronous behaviour in
the future.
2017-04-26 10:32:03 +02:00
Dhaval Panchal 71f3abccab [IMP] generic: default view should be graph view insted of pivot view in reporting menu 2017-04-25 18:30:36 +02:00
xmo-odoo 2479c6bc21 [FIX] patch hunk broken by 09731b78 2017-04-25 16:42:37 +02:00
Christophe Matthieu 6979f267b3 [REF] account: adapt the payment field to the new framework
The account payment widget did not work at all, since we pushed the new
views. With this commit, we adapt the code to the new views (note: the
file account_payment_widget was renamed in account_payment_field).
2017-04-25 16:36:27 +02:00
Christophe Matthieu 0c4e69e803 [IMP] barcode: add some javascript docstring 2017-04-25 16:36:20 +02:00
Thibault Delavallée 9ab9da235f [IMP] lunch: display latest orders first in previous orders widget and menuitem
Ozeurouïze zizisse madnesse !
2017-04-25 14:11:48 +02:00
Thibault Delavallée a4c76239fd [IMP] account: fix link and redirection in invoice email
Currently the link is always the website link once website_portal is
installed. However it is better to use the generic /mail/view controller
that chooses the right redirection depending on the user trying to access
the document.
2017-04-25 14:10:54 +02:00
Thibault Delavallée b49da62365 [IMP] sale: improve link in quotations email
Currently the link is always the website link once website_portal or
website_quote is installed. However it is better to use the generic
/mail/view controller that chooses the right redirection depending on
the user trying to access the document.

This commit also fixes redirection in website_quote that is always
redirecting to the front-end. Classic users should land on the backend.
Indeed seeing the front-end page is rarely interesting for them.
2017-04-25 14:10:54 +02:00
Thibault Delavallée bf2f6f9264 [IMP] models: sudo get_formview_action but add access rights uid
get_formview_action is now called as sudo to avoid access rights issues
when browsing it and trying to determine the ID of the form view to
display.

However in some cases it can be interesting to know the real user trying
to access the form view. The original uid is therefore added as parameter
of the method to have the best of two worlds.
2017-04-25 14:10:54 +02:00
Thibault Delavallée 3c2c166fa6 [FIX] mail: do not sudo access action fetch in /mail/view
Otherwise it is impossible to know the user trying to access the record.
This leads to some incoherent redirection.
2017-04-25 14:10:54 +02:00
xmo-odoo 6b9268bd15 [FIX] print statement -> function
In Python 3, ``print`` becomes a builtin function. This is available
in Python 2 by importing the ``print_function`` feature from
``__future__``, the feature is conveniently still available in Python
3 (it just does nothing).

Fixers:
    libfuturize.fixes.fix_print_with_import

#8530
2017-04-25 13:27:54 +02:00
xmo-odoo 3cbca4b734 [FIX] iterator definition & stepping
* in P3, the iterator stepping method has become a dunder method (next
  -> __next__), the protocol has not changed, add a __next__ alias to
  the iterator-next definition (nota: ir.config also has a next method
  but it's not part of an iterator, so don't alias it and don't
  convert calls to it)
* since ~2.6, a builtin (next()) has been added to step an iterator &
  allow for a default (in case of iterator end), convert all manual
  stepping to the builtin

Fixers:
    libfuturize.fixes.fix_next_call

#8530
2017-04-25 13:04:54 +02:00
Christophe Simonis 4441237b0a [MERGE] forward port branch saas-15 up to ab68a1c674 2017-04-25 12:36:02 +02:00
Pierre Masereel 38bb4f07d0 [IMP] stock_account: rename 'to refund' -> 'to refund (update SO/PO)' 2017-04-25 11:12:39 +02:00
Srushti Patel 49c159a906 [IMP] purchase, sale_stock, stock_account: to refund purchase
When we have purchase orders and we return some products to the
supplier, we now have the possibilty to set those moves as 'to refund'
and so the quantity received is decreased.

Because the feature 'to refund' already exists on the sale orders, we
will generalize it in the module 'stock_account' which is a dependency
of both 'sale_stock' and 'purchase' which are the both module that use
the feature 'to refund'.
2017-04-25 11:08:14 +02:00
Christophe Matthieu f47775b039 [FIX] account: don't display alert in some cases
Before this commit, in the reconciliation widget, the reconciliation alert (exclamation mark) was displayed, even for amounts less than the total. It does not make sense, so we just hide it in that case.
2017-04-25 10:00:48 +02:00
Aaron Bohy b25ba51e6f [FIX] mail: client action: listen to search view changes
When the user changes the filters in the search view, this one
triggers up an event to notify its environment that its state
changed. This came with the new views, as before the search view
triggered an event on itself (i.e. used 'trigger' instead of
'trigger_up'). At some point, 'trigger' will be deprecated and
'trigger_up' will be used instead, everywhere.

The code in mail hasn't been updated accordingly, so the thread
wasn't updated when the user changed the filters.
2017-04-25 08:58:34 +02:00
Aaron Bohy 764127357c [FIX] mail: re-bind handlers on chatter buttons
When a user opens a record in a form view, the chatter is
displayed. Then, if he clicks on 'Create', the chatter is removed
from the DOM (there is no chatter in create mode). After saving
the newly created record, the chatter is displayed again, but the
same widget's instance is kept.

However, when being removed from the DOM, the event handlers bound
on elements of the chatter (e.g. 'New Message', 'Log a Note'...
buttons) are automatically unbound.

So before this rev., the buttons didn't work anymore once the form
view had switched to create mode. In this commit, we detach the
chatter's $el before updating the view, so that its handlers aren't
unbound when the old content is replaced by the new one.
2017-04-25 08:07:17 +02:00
Aaron Bohy f5bfa3d3b6 [FIX] web: FormView: don't modify record's context
Before this rev., some keys were added to the context of a record
if there were x2many fields in the form view with a context
defined on their node (containing *_view_ref keys, specifying the
fields_view to load to display the relational data). Those keys
should not be added to the main record's context, and it may cause
errors (e.g. click on the 'Procurements' stat button in the Product
form view).
2017-04-25 08:07:17 +02:00
Aaron Bohy 6e85008504 [FIX] web: BasicModel: send context when fetching data
when calling 'read' to fetch a record and 'search_read' to fetch a
list of records.

I don't know where (or if) it is used, but it seems more correct
like this (and mostly, it was the case in the old views, so we
re-introduce the same behavior).
2017-04-25 08:07:17 +02:00
Adrien Dieudonne fcc5ce9d46 [FIX] web: BasicModel: handle many2many default values
Before this fix, default values for many2many fields (i.e. 'replace' commands)
weren't correctly handled by the model, so the default values weren't set for
those fields.
2017-04-24 17:29:52 +02:00
Christophe Matthieu 6d4e223c18 [FIX] barcode: various javascript fixes
* Avoid unnecessary reload
* send option to saveRecord
* Display error warning to set the quantity as option
2017-04-24 17:05:20 +02:00
dip-odoo 72ed9702f1 [IMP] mail: rename the date_deadline string 'Deadline' to 'Due Date'
Zizisse uzabiliti improuvementhe.
2017-04-24 16:21:38 +02:00
Sagar Ahirrao 00e277fc4f [IMP] sale_team: add favorite mechanism on sales team
Currently default displayed sales team in dashboard are the one current
user is member of. However as an user can be member of only one sales team
it is not very easy to manipulate.

This commit improves that behavior by adding a favorite mechanism. Users
can favorite several sales team. Those are displayed in the dashboard
allowing users to decide which sales team to display independently of
being a member of the team or not.

Dashboard now also display a search bar in order to be able to change the
default behavior and choose other filters if necessary.

A security rule is updated as salesmen should be able to read several
sales team from now on.
2017-04-24 16:17:02 +02:00
Sanjay Jamod 33401e891b [TYPO] Hr org chart : Missing 'to'
This commit correct the sentence 'In order get an organigram,
assign a manager to the related employees.'

This commit add a 'to' before the get.
2017-04-24 15:59:12 +02:00
Martin Geubelle e5a99430fa [FIX] web: Calendar: dialog title in event edition
The title 'Create: Meetings' wasn't displayed correctly.
2017-04-24 15:28:57 +02:00
Martin Geubelle 9def2009ee [FIX] web: reintroduce many2many_binary field widget
The field has been adapated to the new views.
This commit also introduces some tests.
2017-04-24 15:28:57 +02:00
Martin Geubelle eafa14d3bc [REF] web: data_manager: define fields to fetch on a widget
This commit modifies the way field widgets can specify the fields to fetch.

Before this commit, a key `fetchSubFields` was used to fetch the `display_name`
and the `color` in the many2manytag, but this behavior wasn't generic.

A new key `fieldsToFetch` has now been introduced ; it should contain the
definition of all fields to fetch.
2017-04-24 15:28:56 +02:00
xmo-odoo 90645ad392 [FIX] function introspection attributes
Introspection attributes on function and methods were originally
prefixed with func_ or im_ e.g. im_class or func_name. For coherence with the
rest of the data model, Python 3 added dunder attributes (__func__,
__code__) and removed the old style, the dunder attributes were
backported to Python 2.6.

Use dunder attributes everywhere we're currently using func_* or im_*
attributes.

Fixers:
    lib2to3.fixes.fix_funcattrs
    lib2to3.fixes.fix_methodattrs

#8530
2017-04-24 15:19:55 +02:00
xmo-odoo 95702929b1 [FIX] types module usage
Most of the type aliases in the types modules are remnants from when
the corresponding builtins were just conversion functions and not
proper types (before type and class unification).

Python 3 removes them, and thus `types` essentially can't be used in
P3, it now only contains "interpreter" types which can't trivially be
obtained elsewhere (e.g. GeneratorType, CodeType, TracebackType) and
tooling to dynamically create new types (added in 3.3).

Convert a bunch of types usages in yaml_import to use the
corresponding builtin types.

fixers:
    lib2to3.fixes.fix_types

#8530
2017-04-24 15:19:30 +02:00
Géry Debongnie 06db778cfd [FIX] web: pressing enter in list editable create new line
The editable list view (and the x2manys) have been reimplemented, but
the user experience was not totally (this is an understatement)
polished.  With this commit, we reintroduce a good functionality:
pressing enter on the last line of the list creates a new line.

Also, this commit removes a 'debug: true', leftover by someone with a
trigram starting by F and ending by WI.
2017-04-24 14:57:48 +02:00
fwi-odoo 7a65af306c [FIX] web: fields with many2many_tags widget have "default" as view type
When we load a field data with many2many_tags widget, there is no views in the
field info but instead we need to fetch the default fields,
e.g. color, display name and id.
2017-04-24 13:36:12 +02:00
fwi-odoo 7ed25e2922 [FIX] web: don't delete the fields with value false on record creation
Before this commit, all the fields with value `false` on record creation
were deleted from the given parameters for the `create` rpc.
e.g. it was impossible to untick a checkbox in the settings, the `false`
value was not saved in the created record.
2017-04-24 13:36:06 +02:00
fwi-odoo 24f802504e [REF] base: remove deprecated function
Remove dead code since this function is replaced by field_utils.format.monetary
2017-04-24 13:35:38 +02:00
Christophe Simonis ab68a1c674 [MERGE] forward port branch saas-14 up to 64b7d4e8a8 2017-04-24 13:24:13 +02:00
Christophe Simonis 64b7d4e8a8 [MERGE] forward port branch 10.0 up to 3f6e573c67 2017-04-24 12:53:34 +02:00
Siddharth Gajjar bd5709c1d5 [ADD] mail: re-introduce recommended next activity
Activities now have recommended next activities. Based on next activities
configured on activity types, it allows to implement light workflows
using next activities feature.

This feature was removed when refactoring crm activities to generic
activities. People asking to remove it were visibly wrong and it is
now implemented back as it was in v10.
2017-04-24 12:31:43 +02:00