Commit Graph
109258 Commits
Author SHA1 Message Date
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
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
Martin Trigaux 24d508f2f1 [FIX] point_of_sale: restore rescue field
Properly fix #15101
Unstable patch of fix made at #15862
2017-04-24 12:15:44 +02:00
Moisés López c132d4b33d [IMP] base_address_extended: Add new partner fields to company model
This module adds some extra fields to the partner model, in order to be able
to manage extended addresses. However, those extra fields were not present
into the company model, thus making partner's addresses and company's
addresses displaying somewhat inconsistent.

This change takes those fields that were already present into the partner
model, and adds corresponding fields into the company model and view, so
addresses from both models are now shown the same way.

Closes #16547
2017-04-24 11:44:35 +02:00
Xavier Morel e8013fb887 [FIX] raise statements
In Python 3, `raise` can take:
* nothing (reraises)
* an exception *instance*
* an exception instance `from` a traceback

The Python 2 forms `raise type, instance` and
`raise type, instance, traceback` are deprecated and should be replaced.

Fixers:
    libfuturize.fixes.fix_raise

#8530
2017-04-24 11:08:49 +02:00
Géry Debongnie 54a90ca919 [FIX] hr_holidays,web: proper use of toggle_boolean in list view
hr_holiday was the only module that used a widget=toggle_boolean on a
button in a list view.  That behaviour was implemented as a column
widget in the previous list view, and was not reimplemented in the new
views. The feature is useful, but this was not done properly: it is
better to use a widget on a field (that was the intent) instead of doing
a weird hack like it was done.

With this commit, we update hr_holidays to use the ToggleBoolean widget,
which is supposed to work on every views.

Also, we fix the toggleboolean widget (it was not properly rendering
tooltips, and changes were not saved in readonly list view).

Note that it as the side effect of being better from the point of rpcs:
before, the list view had to reload itself.  Also, another advantage is
that models do not need to implement custom methods (such as
toggle_payslip_status) just to toggle a boolean...
2017-04-24 11:02:12 +02:00
Géry Debongnie a765ff503d [FIX] web: reload list view after button action
Before this commit, the code that handled buttons in list view was kind
of simple, and did not reload the view after.

But clicking on action button is not only a problem for the list view,
the form view already had something in the controller doing exactly
that.  With this commit, we move that code to the basic controller, and
use the method in the list view.
2017-04-24 10:43:20 +02:00
sap e59c1b49c2 [IMP] web, various: apply kanban card color on header instead of whole card
Currently applying a color to a kanban item applies it to the whole
card. This creates usability issues as the content is not dynamically
updated to match the chosen color.

This commit proposes to apply the color only to the header and let the
card content standard. It helps designing cards that are always usable
and readable.
2017-04-24 10:36:29 +02:00
Géry Debongnie d658fe67db [FIX] web: debugmanager view metadata should not crash
In general, I think that we can safely consider that crashes are not the
intended behaviour.

In this case, viewing metadata crashed because we tried to format a date
which was not parsed (so, a string), instead of a moment object. We
simply just parse the date before, and it works as intended.
2017-04-24 10:28:52 +02:00
Géry Debongnie ae1a30e618 [FIX] web: use correct id when using form buttons
With new records, it could happen that clicking on a button in the
header was followed by actions using the wrong id.  This was caused by a
field name="id" in the view (see sale order view, in the
delivery.view_order_form_with_carrier inherited view).

In that case, the id was registered in the changes list, and caused
invalid data in the record: its data.id was set to null.
2017-04-24 10:20:34 +02:00
Géry Debongnie e4bf1f1ccc [FIX] web: form view should focus fields if possible
When a form view switches to edit mode, it is supposed to give the focus
to the first field, or, to a field tagged 'default_focus'.
2017-04-24 10:19:18 +02:00
Géry Debongnie d8261d1162 [FIX] web: fix issues when deleting records
This commit solves two issues with deletion:
- deleting the last record in a form view now triggers a history_back
  action, which means that the view will be changed back to the main
  view (a list view for example), instead of staying in form view
- deleting a record did reload the view twice in some cases.
2017-04-24 10:13:54 +02:00
Géry Debongnie 1561165fe2 [FIX] web: properly format dates in context
When evaluating a context, we need to use the server format for dates,
because the context will ultimately be sent do the server.  Also, moment
objects are not known by pyeval, so they simply cause a crash (for
example, see bank statements form view, edit it, click on 'add an item')

With this commit, we make sure that the evaluation context is correct,
with respect to dates (we use the toJSON method, because that is the way
we get the server compatible date)
2017-04-24 10:12:47 +02:00
Géry Debongnie 329c2ded24 [FIX] web: in x2manys, do not do onchange if invalid line
In general, with the new views, we execute immediately and recursively
all onchanges, even from a x2many in a form view.  It allows for nice
interactivity, for example, recomputing immediately a total or a tax in
a sale order when an order line changed.

However, we are used to treat x2manys in a slightly weird way: for
example, if you add a line in a one2many, then click elsewhere, most of
the time, it is validated.  But if the line is 'incomplete' (I mean, if
a required field is not set), the line will not be validated, but be
automatically discarded.  If it was dirty, a confirm dialog will open.

So, to keep in line with that semantic, we have decided that onchange
will just not be done until the line is 'valid'.  This will avoid
trouble when someone add a line, it triggers some onchange which changes
some values in the form, then click somewhere else, the line is
discarded, but the changed values persist.  Most of the time, it
probably won't be a problem, because another onchange will be triggered,
but it is some useless work anyway.
2017-04-24 10:09:30 +02:00
Joren Van Onder 272e2cb048 [FIX] point_of_sale,pos_*: correct arguments of rpc fail callbacks
The introduction of the new RPC framework (see
0df9968433,
e574027056 and
2106e3dd2e) replaced RPC calls made with
web.DataModel by web.rpc. The arguments in the fail callbacks for
these are different.

For web.DataModel an error object and a jQuery event are passed. The
jQuery event had to be DefaultPrevented to avoid web.session from
trying to show a traceback dialog.

For web.rpc an error type and an error object are passed. This caused
errors because the code was calling preventDefault on the error
object. Because it bypasses web.session entirely a traceback dialog is
never shown, so we don't have to worry about preventing it anymore.
2017-04-23 19:17:35 -07:00
dut-odoo 817fafb66f [IMP] sales_team: handle 'unassigned' in graphs
show not defined instead of false when groupby salesperson
2017-04-21 18:37:55 +02:00
dut-odoo 732306cf39 [IMP] sales_team: show graphs to own documents users
Now that users with restricted access can view the dashboard graphs,
access rules need to be applied upon fetching the data.

This commit also adds the missing access rules on sale reports.
2017-04-21 18:37:55 +02:00
Denis Vermylen ee4495228f [REF] crm,sale,*: dashboard_graph_model values
rename values of selection field to actual model names.

this prevents the need of a separate function to get the sql table
and allows to get direct access to the model.
(needed for the next commit)
2017-04-21 18:37:55 +02:00
dut-odoo 48e843aa8d [IMP] sales_team: improve sale channel settings
Current sales channel configuration for graphs is complicated for users.

This commit attempts to simplify the form view by renaming labels on
selections depending on the chosen graph model.

It also adds the option to group by stage for the pipeline graph and
hides the team members for the POS and eBay sales channel.

- swap `groupby` with `period`
- for `sale` and `invoice` graphs:
  - rename label: `period` -> `scale`
  - rename graph periods' selection items: `This Month/ This Week/ This Year` -> `Last Month/ Last Week/ Last Year`
- for `pipeline` graph:
  - rename label: `period` -> `expected to close`
  - rename graph periods' selection items: `This Month/ This Week/ This Year` -> `Within a Month/ Within a Week/ Within a Year`
  - rename graph groupbys: `Day/Week/Month` -> `Expected Closing Day/ Expected Closing Week/ Expected Closing Month`
  - add new graph groupby: `Stage`
- remove lead management fields for ebay and pos channels
  - hide `Assignation` page and `Domain`, `Assigned Leads Count` and `Minimum Score` fields
  - in dashboard page, make content field readonly
2017-04-21 18:37:55 +02:00
Mehul Patel 1face40a57 [IMP] website: Remove margins around the todo bar in dashboard
Purpose
=======

todo bar shouldn't have margins around. It makes it look unaligned with the blocks below.
2017-04-21 15:45:18 +02:00
Aslam Shaikh 8540e3c836 [IMP] mail: move Discuss search on top of channels
Indeed when having a lot of available channels searchbox is displayed
quite low in the screen. This is annoying. This commit improves that
behavior by putting the searchbox above channels.
2017-04-21 15:32:26 +02:00
Dhawal Limbuwala c9686df1d0 [IMP] base: Reorganise General Settings
Purpose
=======

Clean the menu on Settings as some the items are really advanced

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

- Keep Menu : Dashboard - Users & Company - Translations - General Settings

- Google drive is already on General Settings - no need to repeat Remove

- and add to debug menu + : Postal Printings - Database anonymization
2017-04-21 15:27:51 +02:00
Neha Patel bcf8c8c86e [IMP] mail: hide 'mark all read' button in inbox when small device
Zizisse someutch uzabiliti.
2017-04-21 14:49:56 +02:00
Géry Debongnie fb06850e49 [FIX] web: prevent onchanges with invalid values
Before this commit, when a field was changed, it always triggered a
field_change event, with the new value, even if that value is not valid.
As a result, it could happen that an onchange was sent to the server
with a string as the value of a float field.

What we do in this commit is making sure that invalid values do not
escape the confine of a field, by returning immediately after detecting
that a value is not valid.
2017-04-21 13:58:57 +02:00
David Monjoie a6c64399d2 [FIX] web: look for nolabel in attributes rather than options 2017-04-21 13:25:37 +02:00
David Monjoie 5401c15dd7 [FIX] website_event_track: fix state_selection widgets in views
Also add a deprecated fallback for similar widget calls in partner
code.
2017-04-21 13:25:36 +02:00
David Monjoie 25f5f556c8 [FIX] web: fix expand all button in pivot view
Also took this opportunity to refactor the code of pivot to adapt
the parts that were not up to date and remove the useless deferred
in sortRows, courtesy of aab.

The exportData function still needs reworking.
2017-04-21 13:25:36 +02:00
David Monjoie 2d251a6c28 [FIX] web: use momentjs for default filter value
The format methods of the date/datetime type expect a momentjs date
so it can call its 'format' method. Since we were not giving it a
momentjs date, the call to 'format' was crashing.
2017-04-21 13:25:35 +02:00
Haresh Shyara c9c05e54e5 [IMP] project: improve automatic following of projects
This commit proposes to improve the way people follow project with two
additions

 * project manager is now automatically follower of his project
 * customer is now automatically follower of customer projects. Those
   projects are meant to be used with external people and access rights
   are based on followers. Adding the customer in followers allow him
   to see and participate in the project tasks and/or issues.
2017-04-21 11:53:30 +02:00
Pratima Gupta 36c102694b [IMP] website_project(_issue): improve search on website page for tasks and issues
This commit improves the various way of searching tasks and issues in
website pages for tasks and issues. As for other website apps it is now
possible for the customer to search in name, description, stage or
discussion thread.
2017-04-21 11:41:18 +02:00
Chirag Vaghela 1eaf428069 [IMP] hr: improve labeling of public / private data
It is currently not clear what adresses and tabs in employee form view
are about, especially concerning public, work and private data. This task
improves the labeling of the home address (private one) and public and
personal tabs (work and private actually).
2017-04-21 11:38:04 +02:00
Christophe Matthieu 414eb53d01 [FIX] web: can open a record with a virtual id
Before this change, the switch view open a create form instead of open the
record.
eg: click to open a recurrent event in calendar list view
2017-04-20 17:07:37 +02:00
Christophe Matthieu 817873ad33 [FIX] web: fix various bugs with context
* should use the optional context when opening a formViewDialog
* calendar must send the context for writing or creating records
2017-04-20 17:07:37 +02:00
Christophe Matthieu 30bb41d588 [FIX] models.py, all: lang in context can be None
Different method use self._context.get('lang', 'en_US') to get the lang
value but, the lang in the context can be set to None (eg: copy method).
When the context is used with a lang=None, the method can have a
unexpected behavior or crashed (eg: if you try to format a datetime with a
locale=None)lang can be None
2017-04-20 17:07:37 +02:00
Christophe Matthieu 19eef5d658 [FIX] web: allow virtual ids for integer fields
Before this change, the redering throw an exception when we try to open
a form view with a virtual id.
eg: recurrent event in calendar
2017-04-20 17:07:37 +02:00