Commit Graph
117975 Commits
Author SHA1 Message Date
Wolfgang Taferner ec520b871c [FIX] account: bank statement line order should be by natural date first 2017-12-27 10:18:57 +01:00
Nicolas Martinelli 8aa1a493a0 [FIX] account: exchange rate of price_subtotal_signed
The field `price_subtotal_signed` contains the price converted in the
company currency. However, we should make sure to use the exchange rate
of the invoice date for its computation.

An use problematic use case is the creation of a deferred revenue from
an invoice (commit 7fe89d08b3).

opw-702352
2017-12-27 10:00:46 +01:00
Yannick Tivisse 0fdcf2e5c3 [FIX] website_portal_purchase: Fix access right error when loading my/home/
Purpose
=======

Tested on test.odoo.com and wrongly reproduced in saas-16 at b25ce0a3d8b8c3b5294f47b2d6a11fede479a622
2017-12-26 13:05:31 +01:00
Yannick Tivisse 7cc14b15f8 [FIX] website_portal_purchase: Fix access right error when loading my/home/
Purpose
=======

Currently, loading my/home without purchase manager access rights returns a 403

Traceback (most recent call last):
  File "/home/accounts/src/odoo/saas-16/addons/website/models/ir_http.py", line 273, in _handle_exception
    response = super(Http, cls)._handle_exception(exception)
  File "/home/accounts/src/odoo/saas-16/odoo/addons/base/ir/ir_http.py", line 168, in _handle_exception
    return request._handle_exception(exception)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 763, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/home/accounts/src/odoo/saas-16/odoo/addons/base/ir/ir_http.py", line 194, in _dispatch
    result = request.dispatch()
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 822, in dispatch
    r = self._call_function(**self.params)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 341, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/accounts/src/odoo/saas-16/odoo/service/model.py", line 102, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 334, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 930, in __call__
    return self.method(*args, **kw)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 514, in response_wrap
    response = f(*args, **kw)
  File "/home/accounts/src/custom/private/openerp_enterprise/controllers/main.py", line 1673, in account
    response = super(website_account, self).account(**kw)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 514, in response_wrap
    response = f(*args, **kw)
  File "/home/accounts/src/odoo/saas-16/addons/website_portal/controllers/main.py", line 67, in account
    values = self._prepare_portal_layout_values()
  File "/home/accounts/src/enterprise/saas-16/website_contract/controllers/main.py", line 24, in _prepare_portal_layout_values
    values = super(website_account, self)._prepare_portal_layout_values()
  File "/home/accounts/src/odoo/saas-16/addons/website_portal_purchase/controllers/website_portal.py", line 23, in _prepare_portal_layout_values
    ('state', 'in', ['purchase', 'done', 'cancel'])
  File "/home/accounts/src/odoo/saas-16/odoo/models.py", line 1390, in search_count
    res = self.search(args, count=True)
  File "/home/accounts/src/odoo/saas-16/odoo/models.py", line 1413, in search
    res = self._search(args, offset=offset, limit=limit, order=order, count=count)
  File "/home/accounts/src/odoo/saas-16/odoo/models.py", line 3676, in _search
    self.sudo(access_rights_uid or self._uid).check_access_rights('read')
  File "/home/accounts/src/odoo/saas-16/odoo/models.py", line 2793, in check_access_rights
    return self.env['ir.model.access'].check(self._name, operation, raise_exception)
  File "<string>", line 2, in check
  File "/home/accounts/src/odoo/saas-16/odoo/tools/cache.py", line 87, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/home/accounts/src/odoo/saas-16/odoo/addons/base/ir/ir_model.py", line 1175, in check
    raise AccessError(msg % msg_params)
AccessError: (u'Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:\n- Purchases/User\n\t- Purchases/Manager\n\t- Inventory/User\n\t- Accounting & Finance/Billing\n\t- Technical Settings/Billing Read-Only\n\t- Other Extra Rights/Portal\n\n(Document model: purchase.order)', None)

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

Count the number of purchase orders as a superuser.
2017-12-26 12:59:11 +01:00
Lucas Perais (lpe) ab65a02f5a [FIX] crm: allow a user assigned to activity to see lead
Before this commit, when the sales person (user A) of a lead assigned another user (user B) to an activity
user B couldn't see the lead in his pipeline

After this commit, he can

OPW 787935
2017-12-26 10:43:15 +01:00
Lucas Perais (lpe) 6216e6e25b [FIX] crm: A closed lead doesn't mean there is nothing more to do
Before this commit, because of 9d2f48d and abea8d3 and 4ebb5efac4
closed crm.lead with late activities wouldn't show.

Aware that this is essentially a choice of non-crucial behavior, there are some precautionary arguments.
- The three commits above make the choice of having a "clean" backlog:
late activities are not polluted by crm leads that are already won
- The choice of this commit is to count activities as late regardless of the state of the lead:
The use case: Close a deal with a partner > lead is won and closed
But it doesn't mean you don't have to call the partner back in a few days to actually sign a paper, organize some sort of meeting

The argument: it is better to not miss deadlines eventhough they might accumulate, rather than forgetting about them altogether
(but you don't script something to put all your emails as read when they arrive, do you ?)

OPW 744940
2017-12-26 10:41:08 +01:00
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