Commit Graph
115219 Commits
Author SHA1 Message Date
Goffin Simon 381d7f2357 [FIX] crm: Button "Convert to opportunity" for an existing opportuniy
When opening an opportunity from a notification, it always opens the default view
which is the lead view and then the button "Button "Convert to opportunity" was visible.

opw:792931
2017-12-26 10:21:26 +01:00
Lucas Perais (lpe) 49cbeabe10 [FIX] point_of_sale: prevent taxes of another company to be loaded
As admin every tax is loaded, which is wrong anyway.
When the admin opens a session a change the cashier in the POS interface,
every order is made with every tax ever (on the product)
which could lead to major faulty records

See the case on OPW 786803 which is critical
2017-12-26 09:10:04 +01:00
Adrian Torres 14f80bfae6 [FIX] mail: delete leftover followers
[FIX] mail: delete leftover followers

Previous to this commit, if during the unlink of a model which inherits
from mail.thread an exception is raised before mail.thread's unlink() is
called, followers for such model won't be properly deleted from the
database.

This commit changes this by overriding ir_model's unlink and deleting any
followers whose res_model is not installed.

Partial back-port of 3614193
Fixes #21462
OPW 786790
2017-12-26 07:27:25 +00:00
Odoo Translation Bot 50e2941f65 [I18N] Update translation terms from Transifex 2017-12-24 07:10:06 +01:00
Odoo Translation Bot 9d9ca960ae [I18N] Update translation terms from Transifex 2017-12-24 04:16:18 +01:00
Odoo Translation Bot a19c462902 [I18N] Update translation terms from Transifex 2017-12-24 00:42:06 +01:00
Martin Trigaux 6cb12273e2 [FIX[ web_tour: simplify docstring
Changed at 08d48b0ff but was crashing when building the documentation as not
complient for sphinx

Temporary fix that should be restored when our doc engine will be smarter
2017-12-22 17:01:10 +01:00
Denis Ledoux 2946d78dd7 [FIX] mail: set user_id to an inactive user partner sends a mail to the object partner_id
Before this revision,
Assigning a user for which its partner is inactive
was sending the assignation notification email to the `partner_id`
of the object.

e.g. Assigning a task to a user for which its partner is disabled
sent the assignation notification email to the customer of the task.

opw-787659
2017-12-22 16:53:33 +01:00
Nicolas Lempereur 4843839b24 [FIX] web: upload file widget keep metadata fresh
When modifying files the a widget FieldMany2ManyBinaryMultiFiles would
not keep its metadata (currently associating attachment to [url,
allowUnlink]) up with current value.

So with an attachment added after init:

- clicking on it would error (because link is wrong)
- deleting it would unlink attachment originating from from onchange

The expected behavior is:

- being able to download attachments
- not unlinking attachment originating from onchange

and this is what this commit fixes.

opw-787746
closes #21813
2017-12-22 16:49:56 +01:00
Nicolas Lempereur 1ce4f15c39 [FIX] web: discarding a new record in a modal closes the modal
Discarding a new record triggers the 'history_back' action.  This makes
sense if the record was discarded from a normal form view, but not so
much when in a modal, where the expected behaviour is to close the
dialog.

This commit overrides the function in the action manager which handles
the switch to the previous view. It checks whether a dialog window is
open, in which case it simply closes it.

note: 10.0 backport from 11.0 33aa89ed
closes #20405
opw-786866
closes #21792
2017-12-22 16:34:06 +01:00
Yannick Tivisse db54e0df79 [FIX] l10n_be_hr_payroll: Count spouse deductions if revenue 2017-12-22 16:28:12 +01:00
Alexandre Kühn 262bec6af5 [FIX] l10n_fr_pos_cert: datetime.timedelta
When a user was closing a POS to go into the backend, and click on "Reprendre",
there was an error which prevent him to reopen the POS.

There was a confusion between object <datetime> and <datetime.datetime>, as
the previous code was trying to use the function timedelta() from datetime.datetime
instead of datetime. As a result, the error states that datetime.datetime has no
function timedelta.

opw-801523
2017-12-22 15:48:15 +01:00
Nicolas Martinelli fbaee8b267 [FIX] mrp: WO report
- Activate Work Orders
- Go in MRP > Reporting > Work Orders

The status filters ('Ready', 'Pending'...) do not work.

This is because the action forces the domain to `[('state','=','done')]`
instead of using one of the available filters.

opw-788043
2017-12-22 15:44:59 +01:00
Romain Derie 174cd2aeee [FIX] website: website had incomplete context
Before this commit, website had incomplete context.
It was causing website.menu to not be translated correctly because lang was
not set on website.

Now, since the website has the context correctly binded, menus are translated

opw-787012
2017-12-22 15:44:39 +01:00
Aaron Bohy 4f4e686fb2 [FIX] web: graph: don't lose initial groupby at reload
Before this rev., when a graph view was reloaded (e.g. by clicking
on the graph view switcher), the inital groupby was lost if it
didn't come from the searchview (i.e. if it came from the context
or from the arch). For instance, go to Sales > Reporting > Sales
(the view is grouped by 'date', and there are two groups), reload
by clicking on the graph view switcher: there is only one group
left.

The reload RPC was actually fine. What was wrong is the 'state'
object given to the renderer after the reload, as it didn't contain
the correct groupby, so the view wasn't correctly re-rendered.
2017-12-22 15:43:04 +01:00
Nicolas Martinelli c0769c753c [FIX] account: prevent traceback
When changing the date of an account move, the method
`_onchange_amount_currency` is called manually on a recordset. If the
recordset length is > 1, it crashes.
2017-12-22 13:38:30 +01:00
Nicolas Martinelli a1aed05f8d [FIX] account: change currency in move line
- In an account move, change the date
- All debits and credits of the lines are reset

This is because the recomputation of the credits and debits should only
occur in case of currency rate change.

opw-801030
2017-12-22 13:38:30 +01:00
Florent de Labarre 45015ea7b7 [FIX] stock: start a finished inventory
Avoids launching a canceled/done inventory.

Closes #21697
opw-800347
2017-12-22 12:54:10 +01:00
Nicolas Martinelli ed8fc8f52b [FIX] stock: planned transfer
- Create a product A tracked by lot
- From the Dashboard, create a 'Planned Transfer'
- Add product A, any quantity
- Click on "Mark as TODO"

It's now possible to edit the serial numbers, but it's impossible to set
any quantity in the move lines.

This is due to the remaining context key `planned_picking` which makes
`is_initial_demand_editable = True`. In this case, `qty_done` is
read-only in the view `view_stock_move_line_operation_tree`.

As a workaround, `action_confirm` returns an action and set the context
accordingly.

opw-785332
2017-12-22 11:03:13 +01:00
Florent de Labarre 8836ad5274 [IMP] stock: detail in product error
- Create an inventory 1 with "Product A - Variant 1"
- Start inventory
- Create an inventory 2 with "Product A - Variant 1", "product A -
  Variante 2"...
- Start inventory

An error pops-up because two inventories for the same product
"Product A - Variant 1". However, you don't know which variant is
impacted sincethe message error only shows the product name:
"Product A".

Closes #21687
opw-799583
2017-12-22 11:00:51 +01:00
Thibault Delavallée 81d98f32a5 [IMP] mail: improve activity types behavior and access rights
First purpose of this commit is to limit access on activity types.
Employees can now only read activity types. Indeed defining or modifying
activity types should not be done by employees as it impacts daily work
of all other employees. Specific app-based rights are added for project
and sale managers. Those have a specific menu to configure activity
types, meaning they should also have the access rights to do so.

Also including :

 * ease default computation for res_model_id of activity types: using
   default_res_model in context it is possible to specify a default
   res_model_id. It is useful for example to give a specific context
   in configuration menus;
 * add a domain on res_model_id field in order to limit it to models
   inheriting from mail.thread and not being transient;
 * various improvement in activity type form view to ease configuration
   notably the # days renamed to planned in;
2017-12-22 10:30:02 +01:00
Laurent Smet 186a19809c [IMP] doc: add guidelines to build localization modules 2017-12-21 18:16:48 +01:00
qdp-odoo 552f5a40ba [IMP] hr_expense: Add expenses shortcut on accounting dashboard.
Was PR #19108. Was task 36063
2017-12-21 17:28:14 +01:00
Nicolas Lempereur a6a6cf8005 [FIX] google_account: typo python3 from 01e35141
The typo caused a traceback instead of an error message.

opw-801237
closes #21790
2017-12-21 15:35:41 +01:00
Barad Mahendra b1402c6ad5 [FIX] resource: Allow 'Access Rights' users to create companies
Purpose
=======

A 'Access Rights' (group_erp_manager) user can create a company
A 'Settings' (group_system) user can create a resource.calendar

With the resource module, if a resource.calendar is not set on the new company values, a default one is create.

As the 'Access Rights' user can create a company, but can't create a resource calendar, this should be done with sudo.
2017-12-21 15:09:50 +01:00
Prakash Prajapati aed97f4042 [IMP] base: Add a newly created company to the user's allowed companies
Specification
=============

When user is creating a new company (in a multicompany environment), by default, he should have access to this company.

Also, do not allow to create new company from allowed companies dropdown
2017-12-21 15:06:36 +01:00
Denis Ledoux c2a5d6031c [FIX] pad_project: do not write on task description when using pad.
This revision is similar to
6e8faf40bd
but for the opposite case:
When the task is using the pad,
somehow the regular `description` pad
was written as well on save, making both field
being saved together,
and when description is saved
its content is written on the pad.
Therefore, whatever you written in the pad,
the pad was overriden with the current content of
the task regular description field

opw-787773
2017-12-21 14:45:40 +01:00
Kinjal Mehta 22a4ac1b30 [IMP] maintenance: Add archive/unarchive on teams and equipments
Purpose
=======

Right now user not able to archive maintenance equipments and maintenance teams which are no longer in use.

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

Add archive button in form view of Equipments and teams. Also add filter on list view.

Don't put a specific team by default on equipment, select the first unarchived one instead.
2017-12-21 13:54:40 +01:00
Nicolas Martinelli 2aa3132d09 [FIX] base: prevent App Switcher as home action
This reverts commit 1ffe85f1cb and replaces the domain with a
constrain.
2017-12-21 13:47:24 +01:00
Richard Mathot f9f4fa1cc8 [MERGE] Make the contacts deduplication wizard available to all apps 2017-12-21 13:05:06 +01:00
Richard Mathot dcad7b37cd [FIX] base: make the test pass
Since this test relies on the fact that no data exists yet, we are
forced to unlink them...
2017-12-21 12:59:23 +01:00
Richard Mathot eb61925344 [FIX] base_partner_merge: this wizard does not depend on mail anymore
We then extract the logging of the merge in a separate submethod, and
log in chatters only when available.
2017-12-21 12:59:23 +01:00
Richard Mathot e330567707 [MOV] base,crm: make contact deduplication wizard available for all apps 2017-12-21 12:59:23 +01:00
Jigar Patel b7eee16a58 [IMP] web_tour: Disable tours when Odoo installed with demo data 2017-12-21 12:58:41 +01:00
Raphael Collet 2511d77936 [FIX] base: module category exclusivity (#21729)
Suppose that modules M1 and M2 belong to a subcategory of some exclusive
category.  Then M1 and M2 may not be both installed, unless one of them
transitively depends on the other.

OPW 785434
2017-12-21 10:14:07 +01:00
Nicolas Lempereur f771a9d945 [FIX] stock_account: stock_history slow read_group
The stock_history view is generated from by grouping of move from
sources and move to destinations which depending on the request and
number of request can be rather slow.

This fix replace a possibly high number of request by a slower number.

On a production instance, doing an inventory at a choosen date:

- with 300 stock moves, went from 4 minutes to 4 seconds,
- with 130 000 stock moves, went from 66 minutes to 10 minutes

opw-765793
closes #19594
2017-12-21 09:59:51 +01:00
qsm-odoo 392c91cda3 [IMP] website, *: keep top menu on one line and review alignments
* portal

When there are too many items in the top menu, the menu is broken into
multiple lines (especially on medium screen resolution). This commit
implements a system like in the enterprise backend: the extra items are
placed in a "+" dropdown menu at the end of the top menu.

Also, review the direction used to open dropdown menus. The default is
now left-to-right (while it was right-to-left before) and JS has been
added to determine the safe direction:
- If last item: to the left instead
- If would overflow the window: to the other direction instead
2017-12-21 09:52:36 +01:00
qsm-odoo 76abdd4ace [REF] website: menu-related JS is supposed to grow, so rename "affix" file 2017-12-21 09:52:36 +01:00
qdp-odoo 5d8de48c65 [FIX] account: typo
When calling action_invoice_cancel, we want to cancel only the invoices that are NOT yet cancelled
2017-12-21 09:07:51 +01:00
Nicolas Lempereur 7a4cea96b2 [FIX] web_planner: use user language on frontend
The web planner specified no language for frontend.

This commit add a specialized fallback for this use case so the planner
on the website is in the language of the current user.

opw-781727
fixes #20829
closes #21006
2017-12-20 18:01:20 +01:00
Nicolas Lempereur be5950e429 [FIX] web_planner: use user language on frontend
The web planner specified no language for frontend so the website
planner on the frontend was never translated.

This commit add a specialized fallback for this use case so the planner
on the website is in the language of the current user.

The code is the same that get_context from web_editor.base but requiring
that would possibly adds delays (for dom_ready) that we don't want.

note: this is for 9.0 up to not including 11.0, in 11.0 another solution
is used and in master a bigger change is being worked on.

opw-781727
fixes #20829
closes #21004
2017-12-20 18:01:09 +01:00
qsm-odoo 1d74ed1c55 [IMP] web_editor: make colorpicker option 'bg-'-independent
Now the colorpicker option can be defined with a `data-color-prefix`
parameter which will allow toggling classes different than "bg-*".
(e.g. if the prefix is set to be "hello-", the colorpicker option will
allow to choose between "hello-primary", "hello-danger", ...).
2017-12-20 17:15:08 +01:00
qsm-odoo 8ca92330b3 [IMP] web_editor: allow to define multiple select-class groups
Before this commit, when defining two sets of classes to be chosen
independently on a same element you had to define two options:

```
<div data-selector=".myElement">
    <li class="dropdown-submenu">
        <a tabindex="-1" href="#">Classes set 1</a>
        <ul class="dropdown-menu">
            <li data-select-class="a"><a href="#">A</a></li>
            <li data-select-class="b"><a href="#">B</a></li>
            <li data-select-class="c"><a href="#">C</a></li>
        </ul>
    </li>
</div>
<div data-selector=".myElement">
    <li class="dropdown-submenu">
        <a tabindex="-1" href="#">Classes set 2</a>
        <ul class="dropdown-menu">
            <li data-select-class="x"><a href="#">X</a></li>
            <li data-select-class="y"><a href="#">Y</a></li>
            <li data-select-class="z"><a href="#">Z</a></li>
        </ul>
    </li>
</div>
```

Now, an unique option can be used for this, allowing to not duplicate
the `data-selector` and not creating two JS options:

```
<div data-selector=".myElement">
    <li class="dropdown-submenu">
        <a tabindex="-1" href="#">Classes set 1</a>
        <ul class="dropdown-menu">
            <li data-select-class="a"><a href="#">A</a></li>
            <li data-select-class="b"><a href="#">B</a></li>
            <li data-select-class="c"><a href="#">C</a></li>
        </ul>
    </li>
    <li class="dropdown-submenu">
        <a tabindex="-1" href="#">Classes set 2</a>
        <ul class="dropdown-menu">
            <li data-select-class="x"><a href="#">X</a></li>
            <li data-select-class="y"><a href="#">Y</a></li>
            <li data-select-class="z"><a href="#">Z</a></li>
        </ul>
    </li>
</div>
```
2017-12-20 17:15:08 +01:00
qsm-odoo 374fa10272 [IMP] web_editor: allow to define options' target in XML data
Before this commit, defining a snippet option began by choosing an XML
`data-selector` attribute to put on the option's <div/>. This selector
would then be used to find DOM elements on which to attach the option.

A recent refactoring added the `data-exclude` attribute, allowing to
define a selector that a DOM element must not match to receive the
option.

A new kind of need has arrived: allowing an option to be attached on a
DOMElement but making the option's effects be applied on a specific
child of this DOMElement. This can allow to regroup children options on
a main DOMElement.
To that effect, this commit introduces the optional `data-target`
attribute. If defined, its value is used as a selector to find the
option's `$target` inside the element found with previous rules. Note
that the system has been made smart enough to only add the option on
elements which indeed contain such a $target.

E.g. I want an option to appear in the customize menu of my custom
snippet's <section/> but will in fact control the toggling of a class
'super-row' on the `.row` (I don't want the option to be on the `.row`
otherwise it would not be in the main customize menu). All I have to
do is defining a
```
<div data-selector="section" data-target="> .container > .row">
    <li data-toggle-class="super-row"><a href="#">Super Row</a></li>
</div>
```
(no JS required)

Note: a similar behavior was already present on the JS side of the
"colorpicker" option.
2017-12-20 17:15:08 +01:00
Lucas Perais (lpe) 1ffe85f1cb [FIX] base: prevent App Switcher action to be selected as home action on user
Before this commit, one could choose the App Switcher as his Home action.
and arriving on /web would trigger an infinite loop at startup

After this commit it is not possible to choose the App Switcher as Home action anymore

OPW 800323
2017-12-20 15:08:53 +01:00
Nicolas Lempereur a1da9eec41 [FIX] payment: reload on kanban acquirer install
When installing a payment acquirer from the kanban view, this would by
luck display the form view correctly.

But if we go back to the listing then forward to the form view, things
go awry.

This is because the listing action views have not been updated after the
module installed, this worked at install because we loaded a new action.

This commit change the action so when installing a payment acquirer from
the kanban view, the view is simply reloaded.

opw-786454
closes #21757
2017-12-20 14:14:43 +01:00
Thibault Delavallée cc652c65ec [FIX] l10n_generic_coa: make invoice line demo real records
Otherwise you cannot reinit the module because you cannot remove lines
of confirmed invoices. The (5, 0) command crashes.
2017-12-20 13:54:10 +01:00
Thibault Delavallée dd47abdcc3 [FIX][IMP] stock: set picking_warn as non required
When reinitializing modules it is impossible to create partners if
stock is installed because picking_warn field has a required column
but no default value if the module does not depend from stock. Use
case is trying to run test_mail tests with stock installed.

As this field is not business critical it is now not required. As there
is a default value behavior should not change for users.
2017-12-20 13:53:45 +01:00
Thibault Delavallée 06a02ae4c2 [FIX][IMP] account: set invoice_warn as non required
When reinitializing modules it is impossible to create partners if
account is installed because invoice_warn field has a required column
but no default value if the module does not depend from account. Use
case is trying to run test_mail tests with account installed.

As this field is not business critical it is now not required. As there
is a default value behavior should not change for users.
2017-12-20 13:52:01 +01:00
Arnold Moyaux 0322f6e51f [FIX] stock: return with a different uom.
Usecase to reproduce:
- Create a new unit of measure "Pack of 6" of UoM Categ = units
- Create a new product: Coca cola can, sell in unit, purchase in packs
- Create a PO, buy 1 pack of this product
- Receive the pack from the delivery order
- On the picking you just received, click on return
-> If you validate the wizard by clicking on "return", you get 6 packs, so you multiply by 6 the amounts of what you send as the system changed the quantity but not the Uom

It happens because the system compute the quanity to returns in terms of quant uom but when creating the return move it copies the origin move uom.

This commit uses the quant uom on the return move and also adds the uom in the view in order to be less confusing for the end user.

opw-800566
2017-12-20 13:39:36 +01:00