Commit Graph
116531 Commits
Author SHA1 Message Date
Jeremy Kersten d24675f76a [IMP] website_sale: confirmation page fix margin
Move right column after the title to keep same logic than previous
steps where wizard in not into the left column but has his own row.
2018-03-27 17:31:45 +02:00
Thibault Delavallée 5cbd9ae0ab [MERGE][IMP] mail, various: add automatic activities generation to ease business flows
This merge make several application automatically generate activities based
on business requirements in order to ease the daily job of people using it.

In this merge

 * methods allowing to create, reschedule, mark as done or unlink activites
   are added in mail.activity.mixin;
 * automated activities are flagged using the newly-added automated field
   to distinguish them from other activities;
 * mail.activity.mixin is added to some models to ensure activities are
   activated;
 * several main applications use this API to integrate activities automation
   in their flow: hr_holidays (leave and allocation), hr_expense (expense
   report), fleet (vehicle contract), maintenance (maintenance request),
   sale (sale order);

Please see sub-commits for more details about the mixin update as well as
the integration in the various applications.

This merge is linked to task ID 39578. Closes #20799 .
2018-03-27 16:39:14 +02:00
Thibault Delavallée d0e2caee4e [IMP] maintenance: improve activity management on maintenance request model
This commit improves maintenance requests management through a better
integration of activities and addition of automated activities. Several
things are done in this commit :

 * automatic activities generation is added for maintenance requests.
   Activities are generated to remind assigned users about maintenance to
   perform. They are also automatically removed or updated if the scheduled
   date is changed or if the request is done to avoid bloating users with
   unnecessary activities;
 * a menu to configure activity types is added. Indeed equipment managers
   should be able to see and configure activity types related to their job;
2018-03-27 16:31:05 +02:00
Thibault Delavallée 77c7b68a9b [IMP] fleet: improve activity management on fleet contract model
This commit improves fleet contracts management through a better integration
of activities and addition of automated activities. Several things are done
in this commit :

 * fleet vehicle log contract does not inherit from mail.activity.mixin.
   This commit adds the inherit so that fleet users and managers can now
   schedule and manage activities on vehicle contracts. This will help them
   in their daily job;
 * automatic activities generation is added when contracts are nearly expired
   and renewal is required;
 * a menu to configure activity types is added. Indeed fleet managers should
   be able to see and configure activity types related to their job;
 * filters are added to be able to use the systray and to filter the kanban
   view based on activities

Having automated activities allow to replace some messages posted on the
contract. Indeed currently there are messages posted on vehicles about
contracts to renew. As we now have automated activities on contracts to
remind assigned people to renew it the log can be safely removed. It will
lessen noise generated on chatter.
2018-03-27 16:31:01 +02:00
Thibault Delavallée fce33767af [IMP] fleet: add responsible on fleet vehicle log contract model
Currently there is no place to indicate who is responsible of managing
fleet contracts. As we plan to integrate activities to fleet app having
responsible to push notifications is necessary.

This commit adds a responsible field following Odoo convention, aka a
user_id field linking res.users records. It is also added on the view.
2018-03-27 16:31:00 +02:00
Thibault Delavallée 17c9b7afee [IMP] sale: improve activity management on sale order model
This commit improves sale management through a better integration of
activities and addition of automated activities. Several things are done
in this commit :

 * automatic activities generation is added for sale order upselling.
   They are also automatically removed or updated when the sale order state
   changes from or to upselling to avoid bloating users with unnecessary
   activities;
 * a menu to configure activity types is added. Indeed HR managers should be
   able to see and configure activity types related to their job;

Technically we choose to override _write in order to catch the invoice_status
computed field update and try to have a lightweight implementation. Indeed
sale.order is a complex model and we tried to have a low-level override
that do not mess with business overrides.
2018-03-27 16:31:00 +02:00
Thibault Delavallée 133fd0a21e [IMP] hr_expense: improve activity management on expense sheet model
This commit improves expense flow management through a better integration
of activities and addition of automated activities. Several things are done
in this commit :

 * expense sheet (report) model do not inherit from mail.activity.mixin.
   This commit adds the inherit so that expense users and managers can now
   schedule and manage activities on expense reports. This will help them
   in their daily job;
 * automatic activities generation is added for expense reports. Activities
   are generated for approval. They are also automatically set as done when
   validating or unlinked when refusing or resetting to avoid bloating users
   with unnecessary activities;
 * a menu to configure activity types is added. Indeed HR managers should be
   able to see and configure activity types related to their job;
 * filters are added to be able to use the systray and to filter the kanban
   view based on activities

Having automated activities allow to replace some messages and tracking
that were implemented to warn people of expense reports to approve.
This commit therefore

 * simplifies the tracking as tracking to confirm reports is not necessary
   anymore;
 * removes to approve subtype on report model as well as its parent subtype
   on the department. This allows to simplify chatter in hr_expense app;
2018-03-27 15:19:34 +02:00
Thibault Delavallée 238c20ffff [IMP] hr_holidays: correctly set description of allocation to leaves allocation
Seeing allocation word notably in the activity widget is not easy to
understand. Leaves allocation is a better naming.
2018-03-27 15:19:26 +02:00
Thibault Delavallée 1d71c06233 [IMP] hr_holidays: improve activity management on leave model
This commit improves leave request and allocation management through a
better integration of activities and addition of automated activities.
Several things are done in this commit :

 * leave and allocation models do not inherit from mail.activity.mixin.
   This commit adds the inherit so that HR users and managers can now
   schedule and manage activities on leave and allocation requests. This
   will help them in their daily job;
 * automatic activities generation is added for leave and allocation.
   Activities are generated for approval and second approval. They are also
   automatically set as done when validating or unlinked when refusing or
   resetting to avoid bloating users with unnecessary activities;
 * a menu to configure activity types is added. Indeed HR managers should be
   able to see and configure activity types related to their job;
 * filters are added to be able to use the systray and to filter the kanban
   view based on activities

Having automated activities allow to replace some messages and tracking
that were implemented to warn people of leave and allocation to approve
or validate. This commit therefore

 * simplifies the tracking as only approved or refused state now trigger
   a subtype;
 * removes to approve and to validate subtypes on leave and allocation
   model as well as their parent subtypes on the department. This allows
   to simplify chatter a lot in hr_holidays app;
2018-03-27 15:19:10 +02:00
Thibault Delavallée 78c4d936e5 [MOV] hr_holidays: reorder a bit views and menus to avoid circular issues
Commit a0f4f6548b splitted hr_holidays models and moved them
to different files according to guidelines. However some bits of code related
to views were not correctly put in separate files. This commit finishes to
order views and moves some of them in the right file. Other views or actions
are moved because of dependency between them.
2018-03-27 15:19:08 +02:00
Thibault Delavallée 60b81e00b2 [IMP] mail: add tool methods to manage activities directly from the mixin
This commit adds tools methods related to activities in the mail.activity
mixin. It gives to models inheriting from the activity mixin an easy-to-use
API to schedule, unlink or mark activities as done. Purpose of those methods
is to avoid having people manually managing activities in the code to hide
the technical details of the activities model, notably access rights
or activity types.

A field is added on activity model to indicate they have been generated
automatically. This way when rescheduling or unlinking based on some
specific activity types we do not change user-created activities.

Those methods include scheduling activities, changing their dates, marking
them as done or unlinking them. Future commits will use those methods
in various addons to automatically generate activities based on workflow
we want to implement.

This commit also adds tests for the newly added code. Future commits should
probably have a look at activity security and add some tests cases to check
it is correctly taken into account. It is considered a bit out of scope for
this task.

Thanks to @jem-odoo for its in-depth review of this commit. Well thanks for
other commits also.
2018-03-27 15:00:46 +02:00
Thibault Delavallée 093dd9b512 [IMP] test_mail: clean reminder-related activity tests
It has not been done completely at f488dc58c3.
2018-03-27 15:00:36 +02:00
Thibault Delavallée 1905b8a5d5 [IMP] mail: take first found reminder activity type as default when creating reminders
If people define several reminders, take first found one based on sequence
as default activity type when creating reminders. This commit is linked to
the recent merge of reminders done at f488dc58c3.
2018-03-27 14:59:51 +02:00
Thibault Delavallée 60e5a887c5 [IMP] mail: set a sequence on activity data in order to at least have one 2018-03-27 13:26:41 +02:00
f488dc58c3 [IMP] mail: allow to use stand alone activities as reminders
This commit allows to create personal reminders and to manage them using
activities. It is done using activities not necessarily linked to a record
but only to a user. Reminders can be used for example as a personal todo
list.

Technically we choose to model a reminder as an activity related to no
record. This means having a void res_id and model. An activity type is
added to classify reminders in it.

Settings reminder as done is not done like classic activities. Indeed classic
activities are unlinked and a message is logged on the related document.
As there is no document for reminders those are archived instead. It means
an active field is added as well as an override of toggle_archive to update
systray counter.

Activities systray widget is improved to display reminders in activities
list. This entry leads to a kanban view of activities allowing their
management. It is also possible to create them directly from the systray
allowing a quick creation of reminders.

This commit is related to task ID 41745. Closes #22143 .

Co-authored-by: Dharmang Soni <dpr@odoo.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2018-03-27 13:26:41 +02:00
Adrian Torres 4265026ee2 [FIX] ir_model: cascade delete custom o2m and related fields
Before this revision:

* Install a module, for this example we'll use `project`
* Create a o2m field or a related field whose inverse is a field from
the `project` module.
* Uninstall the `project` module.

Result -> BOOM! The registry can't be reloaded because it can't find the
inverse field of our custom field, ayayay!!

After this revision, this shouldn't break the registry anymore because
we create two m2o fields which will trigger cascade deletes for both o2m
and related fields upon the deletion of the inverse field, these fields
are both computed stored fields and they're not shown to the end user,
this is all done "under the rug".

Task-ID: 58808
2018-03-26 14:58:08 +02:00
Christophe Simonis a7530a376c [MERGE] forward port branch saas-11.2 up to 07843bd4c9 2018-03-26 13:55:44 +02:00
Arnold Moyaux 07843bd4c9 [FIX] mrp: consider timezone in test 2018-03-26 13:46:32 +02:00
Martin Trigaux e7fd1eebae [FIX] base: correct id to Belgium 2018-03-26 13:36:33 +02:00
Thibault Delavallée f2e4ef741b [FIX] test_mail: update counter due to random additional query sometimes appearing 2018-03-23 17:33:48 +01:00
Romain Derie 1f5c61477f [IMP] website_sale: make it more clear when a product is unpublished
This commit attempts to make it more obvious when a product is not published.

task-44005
Closes #23741
2018-03-23 17:03:56 +01:00
Romain Derie b98b5e4d8b [FIX] sale: dead code (order state) from v8
Commit 94716a3 refactored 'sale.order' state selection in Odoo 9.0 but
the portal still used some deleted state values.

Closes #11164
2018-03-23 16:11:47 +01:00
Romain Derie f8b05f52f5 [FIX] website_portal(_sale), base: prevent VAT edition if user has SO/invoices
This commit prevent VAT and company name edition if an user has already at
least one document (SO or invoice) for his partner or his related company
partner.
Any module can override this feature to add their own condition to prevent
campany name/VAT edition.

task-33088
Closes #23420
2018-03-23 14:47:16 +01:00
David Arnold 26dafadf77 [REF] base: remove localhost mailserver data
localhost mailserver effectively blocks the server wide smtp setting and
almost never is a sensible default in any kind of deployment.

If you just deploy an instance with smtp setting, so that you can start
inviting users without caring about mail integration so far, then this
setting does produce unexpected and awkward results.

Closes #22790 and task ID 1830779.
2018-03-23 11:26:50 +01:00
dip-odoo 82d5bb4504 [FIX] point_of_sale: fix the problem when download the invoice.
- In pos payment page when we select invoice download option and validate payment that moment traceback occured.
     because in _match_payment_to_invoice method when we find account_precision do not find pricelist recored.
2018-03-23 10:41:10 +01:00
Christophe Simonis 845f4ef7d3 [MERGE] forward port branch saas-11.2 up to 8a7b845353 2018-03-23 10:31:00 +01:00
Christophe Simonis 8a7b845353 [FIX] web: correct forward-port of ef540eb006
Adapt tests and classes
2018-03-23 09:46:46 +01:00
Aaron Bohy 2a6ff8f8e4 [IMP] web: ActionManager: load window actions without id
Actions can be loaded from the state of the url (e.g. when pressing
F5). For window actions, it was working properly if the action id
or a record id (i.e. for form views) was given. In other words,
states like 'model=res.partner&view_type=kanban' couldn't be
loaded.

This can be explained by the fact that without an action id, the
context and domain of the action couldn't be obtained.

This rev. solves this problem by storing the current action into
the sessionStorage, so that important information like context,
domain and name can be retrieved if this action has to be restored
(i.e. if the user refreshes the page).
2018-03-23 09:02:49 +01:00
Aaron Bohy ee0605f405 [IMP] web: add sessionStorage service
This rev. adds the 'sessionStorage' service, allowing to write and
read stuff in/from the sessionStorage (with a compatibility layer
to handle the case where the sessionStorage can't be used, e.g.
private browsing in Safari, like it is already done for the
localStorage).

This new service is necessary for the ActionManager to store the
current action, so that it can be fully restored on F5 (this comes
with the next commit).
2018-03-23 09:02:03 +01:00
Christophe Simonis cdbee48888 [MERGE] forward port branch 11.0 up to 39d9c362c5 2018-03-22 20:05:14 +01:00
Toufik Benjaa 2a53338649 [FIX] test_mail: Update query count 2018-03-22 18:46:34 +01:00
Toufik Benjaa aeeb21128a [FIX] test_mail: Update query count 2018-03-22 17:52:39 +01:00
jem-odoo 39d9c362c5 [FIX] hr_timesheet: usability issue
To correctly fill timesheet from a list
view, an onchange was missing. Indeed, we
want the task to be in the project of the
timesheet, so adding a domain definitely
help the user selecting the task when
setting project first.
2018-03-22 16:46:04 +01:00
Romain Derie f5912cbcb3 [IMP] website: make it more noticeable when a page is unpublished
Before this commit, 2 usability issues were reported:
1. Some people would get stuck with unpublished content without even knowing it
   since they would not understand the page is unpublished.
2. People would have a hard time finding the publish button (small toggle on
   the navbar).

Now:
1. We now display a red ribbon on the top right corner specifying the page is
   unpublished. Hopefully it can't be missed.
2. This publish button will be more visible for unpublished content since it
   will be red (danger) color. Hopefully people will notice it at first look.
   Note: It is implemented in a generic way so any 'o_switch' can be turned
   into this version by simply adding the 'o_switch_danger' class to it.

task-44005
Closes #23282
2018-03-22 16:32:51 +01:00
Toufik Benjaa 4787bc7553 [FIX] reports: Remove dead code for non qweb reports 2018-03-22 15:33:18 +01:00
Martin Trigaux 7d86bdca21 [I18N] *: export source terms of saas-11.2 2018-03-22 15:19:07 +01:00
Christophe Simonis 2a9d3812a6 [MERGE] forward port branch saas-15 up to 3fce2b769e 2018-03-22 15:02:58 +01:00
Romain Derie 744af2db60 [FIX] web_editor: correctly set image on double click
Commit 321486851a fixed double click on media dialog when multiple selection is
allowed.
Still, it needs a deeper fix to ensure that the image is/remains selected when
double clicking no matter it's state (selected or not) before the clicks.
Double click should always force the image to be selected before saving.

Step to reproduce:
  - Drop the Image Gallery snippet
  - Open new images manager (Customize > Add images or Add Images directly if no
    images set yet
  - Select an image (simple click)
  - Now double click on it

It won't set the image since when double clicking, it:
1. Unselected the image on the first click (click event)
2. Selected the image on the second click (click event)
3. Unselected the image and saved (dblclick event)
2018-03-22 14:38:17 +01:00
Jaykishan Solanki 55a7ac412b [FIX] purchase_requisition: multicurrency
When creating the supplier info record from a blanket order, do pass
the `currency_id` field.

task 1814507
2018-03-22 14:21:31 +01:00
Christophe Simonis 3fce2b769e [MERGE] forward port branch saas-14 up to d8c6e56975 2018-03-22 14:13:59 +01:00
Christophe Simonis d8c6e56975 [MERGE] forward port branch 10.0 up to fb2df13ea8 2018-03-22 14:01:07 +01:00
Toufik Benjaa 3c2876f689 [FIX] website_quote: Fix '/my/orders' route inheritance
- The module 'website_quote' inherit the CustomerPortal class defined in 'portal/controllers/portal.py'.
It does this to override a single method, namely 'portal_order_page'.
The issue here is that 'portal_order_page' is not defined in the module portal, but in sale.
This causes random issues where the inheritance was not done in the correct order.
Which means the original portal_order_page was sometimes called before its child.
Calling the original portal_order_page first means the child is never called.

This commit change the imported CustomerPortal class to the one defined in the module sale.
2018-03-22 13:51:53 +01:00
Lucas Perais (lpe) 8df055b584 [FIX] web: don't loose focus when editing cell in list
Have a list with readonly modifiers on at least one column.
Have the first record of the list be readonly as computed by the modifier
Create and edit a second record
Enter a value in the cell and hit TAB

Before this commit:
The focus on the targetted cell was lost and the rendering of the cell was in mode readonly
This was because the baseMode of the modifier dict was applied to one and only one node (== one column) and hence to *all* the records

After this commit:
The rendering and keyboard TAB navigation works as expected in the list editable
The baseMode concept has been sharpened and each cell now has one

OPW-1816569
OPW-1824979
closes #23809
closes #22859
closes #23436
2018-03-22 22:51:57 -08:00
Hetashree Chauhan fb2df13ea8 [FIX] stock: picking button in valuation report
When hitting the picking button in the valuation report, there was a
"form view could not be loaded" error. This is because we try to
open a picking with a stock move id.

master bug 1817491
Fixes #17226
2018-03-22 13:36:52 +01:00
Olivier Colson 13899ca39d [FIX] account: correct signature of reconciliation method
This bug had been introduced by the last refactoring of the reconciliation widget, it's just a renaming error.
2018-03-22 13:03:43 +01:00
Nicolas Martinelli 048539732d [FIX] stock_account: compute price if no product
- Activate anglo-saxon accounting
- Create an invoice with a line without product but a UOM
- Validate

A traceback arises since `_compute_price` is called on an empty
recorset.

opw-1830042
2018-03-22 12:39:16 +01:00
Luis González ef540eb006 [FIX] web: Make accessible with keyboard the delete button on o2m fields (#23719)
* [FIX] web: Make accessible with keyboard the delete button on o2m fields

Currently, the delete button in one2many fields (trash icon) is not
reachable when using the keyboard, because it's neither a link, nor a
button or any other interactable HTML element, but a `<span>`.

This change causes that button to be an actual HTML button keeping the
same appearance, so it may be reached when using the keyboard.

* [FIX] web: Modify test to expect button instead of span as o2m trash icon

Since buttons to delete records in o2m fields (the trash icon) were
changed from `<span>` to `<button>` to be able to access them with the
keyboard, the test need to be modified so it expect the new element
type and doesn't break.
2018-03-22 12:18:35 +01:00
Martin Trigaux ac76a6b40c [FIX] stock: translate stock traceability report
Missing user language in the context

Fixes #21332
2018-03-22 11:48:49 +01:00
Christophe Simonis f16a6c90d3 [MERGE] forward port branch 10.0 up to 9aa1b7ba12 2018-03-22 11:41:27 +01:00
Toufik Benjaa 9aa1b7ba12 [FIX] web: Access issue for non qweb reports
- With the removal of the password field on the sessions (https://github.com/odoo/odoo/commit/da1f153d61d747d9357694382fe04f96c0ca886a) the non qweb reports going through the route '/web/report' were not able to be generated.
We address this issue by avoiding to call dispatch_rpc and by using the functions to generate the report directly.
This doesn't cause any security issue because the route '/web/report' is callable only by logged in user.
Meaning that the session is already validated.
2018-03-22 11:29:01 +01:00