Commit Graph
109304 Commits
Author SHA1 Message Date
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
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
BizzAppDev 3f6e573c67 [FIX] marketing_campaign: typo in search function
Courtesy of BizzAppDev

Closes #16588
2017-04-24 11:29:30 +02:00
Christophe Simonis eb672d81e6 [MERGE] forward port branch saas-11 up to b5b8239870 2017-04-24 11:09:52 +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
Christophe Simonis b5b8239870 [MERGE] forward port branch 9.0 up to 9e6860a228 2017-04-24 11:07:55 +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
Xavier Morel aab90cc5bd [FIX] crm: recompute mail.alias defaults when *unsetting* use_leads on teams
Default mail.alias for crm.team are currently recomputed/modified
when *setting* use_leads on the team (type changes from opportunity to
leads), but not the other way around (*unsetting* use_leads doesn't
rollback type to opportunity).

Fix this issue.

Leaves over the issue that *disabling* the global setting doesn't
recompute aliases, which it probably should.

OPW-728690
2017-04-24 10:10:33 +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
amoyaux 834b38a84d [FIX] stock : traceback pivot view for stock moves
Use case when it can happens (non deterministic):
- Enable product variant
- Have different stock moves with the product variant
- Click on the stock moves in the section reports
- Switch to pivot view
-> Traceback : can't find path of null

This happens in the js in the function find_path_in_tree,
this function try to find path for children object. There is
a condition root.children[i].path[l] === path[l] (2 strings
comparaison).

With product variant this condition can be overpass when it should
have been triggered. The product path string is represented as follow
[Ref]Name(variants) -> Sometime the variants in the string do not have
the same order and thus the condition is never true and the function
return null instead of the correct root.

This commit corrects the name_get function for product product
in order to always return the variants in the same order.
2017-04-24 09:26:54 +02:00
Nicolas Martinelli 9e6860a228 [FIX] web: make DB name more flexible 2017-04-24 08:02:22 +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
Odoo Translation Bot 7350a50a2e [I18N] Update translation terms from Transifex 2017-04-23 07:13:47 +02:00
Odoo Translation Bot 07c563e075 [I18N] Update translation terms from Transifex 2017-04-23 04:30:51 +02:00
Odoo Translation Bot 91c00bc011 [I18N] Update translation terms from Transifex 2017-04-23 00:31:08 +02: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