Commit Graph
123868 Commits
Author SHA1 Message Date
XavierDo 5c3aaacd2e [IMP] mail: correctly patch mail status manager timers
We want to avoid that a `setTimeout` started in one test has an impact on other
tests. This is especially true with the status update loop. Since mail_service
is used in multiple tests, the safest solution is to patch timeouts everytime
we make a call to getMailServices.
There is no need for an unpatch, the patch become the default behaviour until
the page is refresh at the end of tests.

It is possible to manually add the patch after calling `getMailServices`
```
this.services = mailTestUtils.getMailServices(this);
this.timeoutMock = mailTestUtils.patchMailTimeouts();
```
This can be usefull if we want to get the timeoutMock to simulate time changes.

Task: 1856205
2019-02-07 12:53:14 +00:00
XavierDo 2d45df1081 [IMP] mail, web: Add indication abouts it's own status in user_menu.
Task: 1856205
2019-02-07 12:53:10 +00:00
XavierDo 062f748efb [IMP] mail: add a Read More on out of office message
Task: 1856205
2019-02-07 12:53:07 +00:00
XavierDo 086405344e [IMP] mail, hr_holidays: use leaves to compute im_status
When on leave, the im_status can be either leave_online or leave_offline.
This will allow to display a specific icon and a default message when the user
is not at the office.
The leave can have an out of office message. This message will be displayed
in the chat window instead of the user ooo message, and the end date of the leave will be displayed too.

Technical details.
Right now the im_status access leaves directly to know if a user is on leave or not.
An index has been added to optimise this request (thanks to rco).
A solution to optimise this would be to compute part of the information in a cron.

Task: 1856205
2019-02-07 12:53:03 +00:00
XavierDo c21d200285 [IMP] mail: add ooo status in chats windows.
In a chat window with a single usert (dm_chat) the ooo status of the
other user is displayed on the top when set.

Task: 1856205
2019-02-07 08:54:33 +00:00
XavierDo b60224c41c [IMP] mail, base: add out of office status to user.
This status can be edited by user in preferences, indicates if user
is available or not.
2019-02-07 08:54:33 +00:00
XavierDo 07a261db71 [IMP] bus, mail, mail_bot: add im_status service
This commit is a refactoring of im_status management.
This commit also add im_status in two places, near the author in a mail thread and on each suggestion when using mentions.

A service to manage im_status will have multiple benefits here:
-centralise information, avoid to call the server multiple time for the same im_status
-update all im_status at once and keep consistency in display.

With this commit, the im_status updates are now done by rpc call.
Updates where previously made with the bus but this has some drawback,
since the bus will only give the information 50 seconds after the beginning of
the request, in the worst case, we van wait 2*50 seconds to get an update.

More than that, the im_status where only updates for pinned dm_chat. Dm chat
are synchronized cross tabs, making the use of the bus possible for this purpose.
Since we will need to display im_status not linked to dm_chat, the list to update
will be different from tab to tab making the use of bus difficult for this purpose.

Technical notes:
-im_search has been moved from bus to mail addons since it concerns mail.channel
-Update of an im_status should be reflected everywhere in the page.
Since im_status is a rendered template used in multiple widget, we should add
the correct logic to all concerened widget. The current solution is simple:
use a jquery selector to find every place where im_status is rendered.
-we add a new im_status: im_partner. This will indicate that that
the partner has no user linked to him, making it possible to avoid to ask
for status updates for this partner.
-The update will only be done when the tab is focused. (and will be done
asap once the tab get focus back)
2019-02-07 08:54:33 +00:00
Robot Odoo 768844040f [MERGE][IMP] sale: improve usability of down payments
Task #1908673

Purpose
=======

The "invoice" modal is too complex to use for new users and has a lot of useless options for
the most simple use cases.

The goal here is to remove 2 options of the 'advance_payment_method' field:
* Invoiceable lines
* Invoiceable lines (deduct down payments)

And combine them into a new one: "Standard invoice".

If there are any down payments to deduct, another checkbox field appears under this
one: "Deduct down payments".

This keeps all the invoicing features while simplifying the modal.

Spec
=======
* Remove "invoiceable lines, deduct down payment" and replace by a checkbox
  (checked by default, only visible if down payments to deduct)
* Rename "Invoiceable lines" into "Standard invoice"
* tooltip on radio buttons: A standard invoice is issued with all the order lines ready for invoicing,
  according to their invoicing policy (based on ordered quantity or on delivered quantity).

closes odoo/odoo#29978
2019-02-11 11:41:50 +01:00
Aurélien Warnon 5cec9cf223 [IMP] sale: improve usability of down payments
Task #1908673

Purpose
=======

The "invoice" modal is too complex to use for new users and has a lot of useless options for
the most simple use cases.

The goal here is to remove 2 options of the 'advance_payment_method' field:
* Invoiceable lines
* Invoiceable lines (deduct down payments)

And combine them into a new one: "Standard invoice".

If there are any down payments to deduct, another checkbox field appears under this
one: "Deduct down payments".

This keeps all the invoicing features while simplifying the modal.

Spec
=======
* Remove "invoiceable lines, deduct down payment" and replace by a checkbox
  (checked by default, only visible if down payments to deduct)
* Rename "Invoiceable lines" into "Standard invoice"
* tooltip on radio buttons: A standard invoice is issued with all the order lines ready for invoicing,
  according to their invoicing policy (based on ordered quantity or on delivered quantity).
2019-02-11 08:04:29 +00:00
Aurélien Warnon f808f36f38 [REF] sale, repair: rename invoices creation method
Purpose
=======

The method named "action_invoice_create" in the sale_order model did not make sense:
  - this method is not an action (it returns the ids of created invoices)
  - it is not used as an action on any xml buttons
  - it has no reason to be private

This was probably a "real" action somewhere in the past but now it's just too confusing.

(The method in repair.order was also renamed for the same reasons).
2019-02-11 08:04:29 +00:00
Robot Odoo 50a41c9f87 [IMP] web: mobile calendar today button alignment
Improve the User Interface of the Calendar mobile view.

- The "today" button should be aligned (both size and position) with the
view switcher icon.
- Extract mobile calendar styling into dedicated SCSS file.

Task ID: 1891955

closes odoo/odoo#30592
2019-02-11 08:35:21 +01:00
David Beguin b9902d961e [IMP] gamification : rename rank.karma_required into karma_min for grep convenience
Rename rank.karma_required into karma_min to avoid confusion
with karma_required from website_forum

Linked to Task ID : 1922159
Closes PR #30965
2019-02-08 18:03:29 +00:00
Thibault DelavalléeandAurélien Warnon a20408e995 [FIX] website_slides: reflect ACLs on fields for channel members
Just reflect access rights: publishers should be able to manage channel
members.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>

closes odoo/odoo#30960
2019-02-08 16:26:44 +00:00
Thibault DelavalléeandAurélien Warnon 8d310d1a88 [FIX] website_slides: improve methods to add members on channel
To avoid security issues or exploits, public method to add a member on a
channel allows to add only itself, under given restrictions, like being
a channel maintainer to add self on a private channel.

A private method allow to subscribe other people. It will be used notably
to allow publishers to invite other people.

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2019-02-08 16:26:39 +00:00
Thibault Delavallée 6b46422a6b [REF] website_slides: update slide members relationship
This commit changes decorated many2many between slides and participants
recently introduced [1]. It was done between slide and users as people have to
login to have slide information.

Another many2many between channel and partners to store notably completion
and soon add statistics has been added [2]. It has been done between
channels and partners.

In this commit we choose to have the same relationship for slides, aka a link
between slides and partners. It allows to easily compute statistics and find
information based on partner_id.

Co-Authored-By: Quentin Mourrier <qmo@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>

[1] See c273e89d55
[2] See 748b9072d6
2019-02-08 16:26:28 +00:00
Romain Estievenart 41b8a6a563 [IMP] web: mobile calendar today button alignment
The "today" button should be aligned (both size and position) with the
view switcher icon.

Task ID: 1891955
2019-02-08 15:41:51 +00:00
Romain Estievenart 4dfd14ed00 [REF] web: extract calendar mobile styling
Extract mobile calendar styling into dedicated SCSS file.

Task ID: 1891955
2019-02-08 15:39:58 +00:00
Romain Estievenart a5ab43ebe6 [IMP] web: Remove CTA should be hidden on creation
- Hide the "Remove" button on the create modal's footer.
- Update title when click on "Save & new" button

Task ID: 1924887

closes odoo/odoo#30209
2019-02-08 14:30:57 +00:00
Robot Odoo f4dc2af71a [MERGE] website, *: improve customize dialog + add logo sizing
* portal, web, web_editor

See sub-commits for details.

- Many improvements to the customize dialog 'framework'
  (toggle switches, new widgets, ...)
- Optimization of RPCs (including ace editor which shares the same code)
- Move navbar options of the customize menu to the customize dialog
- Add the possibility to control the header logo size
- Add the possibility to control the header font size

task-1904244

closes odoo/odoo#29624
2019-02-08 20:16:33 +01:00
qsm-odoo 52b27c4c6b [IMP] website, *: allow to control the header font-size
* portal

The user can now choose the font-size of its header menu items through
the customize dialog.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:39:16 +00:00
qsm-odoo 56ba62231d [IMP] website: allow negative dependencies in theme customize dialog
Options and option sets can declare a data-depends attribute to specify
which options need to be enabled for them to be displayed. With this
commit, we allow specifying which options need to be *disabled* for the
same purpose (we can now do that by prefixing the options IDs with '!').

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:39:06 +00:00
qsm-odoo 10384c689a [IMP] website, *: optimize scss customizations
* web_editor

This commit's goal is to optimize the delay to make a scss customization
thanks to the website customize dialog. Before this commit, the JS code
took advantage of existing web_editor routes but this was far from
efficient as this was done:

1) PY: Load all scss files used in the page
2) JS: Find the one we want to customize and adapt the scss content
3) PY: Create the scss customization with the new content

(So two RPC (including one very slow) and content building in
javascript)

After this commit, this is done:

1) PY: Load the scss file being customized, adapt its content according
   to the new values and save the customization

(So the whole logic is in python, requiring only one small RPC)

This commit also take the opportunity to review the web_editor ace
editor loading code (the logic is shared with website customizations).

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:38:51 +00:00
qsm-odoo ff55736c4f [REF] website: simple move of a python file
Next commit will change that file to make it extend a web_editor model
instead of a web_editor controller. This commit only moves the file.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:38:41 +00:00
qsm-odoo 905d18e044 [IMP] website, *: add new logo sizing option
* portal, web

This commit introduces the first of many-to-come non-color website user
values: the logo height. Now, the user can choose it in the customize
dialog.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:38:31 +00:00
qsm-odoo 9f21427cdf [IMP] website: improve affix menu to work with all headers
Now that the logo can be resized, the affix menu had to be adapted to
handle tall headers.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:38:23 +00:00
qsm-odoo 2d934aee71 [IMP] website: allow customize option to be conditionally visible
Before this commit, in the theme customize modal, only lists were able
to be visible under the condition of a subset of options being enabled.
Now options can too.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:38:14 +00:00
qsm-odoo 4eb53e63e9 [IMP] website: review customize loading
Before this commit, the loading was shown during colorpicker choice or
body image choice too, which makes no sense. This commit also make a new
loading visual which is less intrusive and flicker less.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:38:05 +00:00
qsm-odoo 45a54104bf [REF] website: unify the theme customize dialog color options
Before this commit, color options in the theme customize were treated
as big exception in the system. The whole color panel XML was defined
client-side and used custom design. Now, all colors are defined as
options in the "server-side" template, allowing for more customizations
and better maintenance.

This commit also makes the color saving system generic to allow for more
new options in the future (like customizing the logo height or the font
size, which is the next task).

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:37:52 +00:00
qsm-odoo 065957b981 [IMP] website: move navbar options to customize theme dialog
Move the 'Show Logo', 'Show Sign In' and 'Fixed Top Menu' options from
the customize menu to the customize theme dialog using new features
introduced with https://github.com/odoo/odoo/pull/29624

The customize menu divider is also only added if there are toggable
options in there (which is not the case anymore for all pages since
this commit).

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:37:43 +00:00
qsm-odoo 4edb9c4f60 [IMP] website: improve theme customize dialog
- Make the controller part more readable and more efficient (O(1) ORM
  operations instead of O(n)) and remove deprecated code.

- Add the possibility to have a toggle standalone option. This is
  used as soon as an `<opt/>` is alone in its container (note that now,
  the container can be any tag and will be ignored during rendering).

- If an option has no specified 'string' to attach to it, the name of
  the first view it toggles will be used.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:36:43 +00:00
Romeo Fragomeli e6e206b14e [IMP] web: control panel add on_detach_callback
Adding event listener in on_attach_callback need to be removed
in on_detach_callback.

Before this commit on_detach_callback was not implemented in control panel.
After this commit we can use on_detach_callback.

Needed for task ID: 1934261

closes odoo/odoo#30758
2019-02-01 09:55:31 +00:00
wan 969705fa2a [ADD] account: suspense account management
Task 1930403
Purpose:
A suspense account is an account in the general ledger that temporarily stores any transactions for which there is uncertainty about the account in which they should be recorded. Once the accounting staff investigates and clarifies the purpose of this type of transaction, it shifts the transaction out of the suspense account and into the correct account(s). An entry into a suspense account may be a debit or a credit.

The Chosen Odoo approach (macro) for this case is
1) from bank statement -> reconciliation widget -> reconciliation model
2) create move that have a dedicated checkbox
3) be able to reopen the bank statement line "like if there is no linked account move" and finally reconcile the transaction with the good invoice/bill (we can reprocess account move "to check")
4) when we reprocess, Instead of creating an account move : Check if there is an "to check" existing linked account move and remove all the account move lines then replace  them by the good ones --> we want to keep the sequence

closes odoo/odoo#30486
2019-02-08 10:11:41 +00:00
David Beguin 723789b6b1 [FIX] website_slides: Fix clean ACLs and refactor access options commit
Fixes related to commit 748b9072d6

 * fix template still having an unnecessary t-else whereas the t-if has
   been removed;
 * move order by strategy on right class;
 * fix access rights on intermediate model between channels and partners. It
   should be accessible to website publisher as they will have so manage
   channel members;
 * fix some typos;

closes odoo/odoo#30949
2019-02-08 12:01:12 +00:00
Aurélien Warnon c4c067509e [REM] website_slides: remove the 'state' field of slide.channel.partner
Purpose
=======

The 'state' field for a member of a channel did not imply anything functionally
so we decided to remove it. It allows to remove an unnecessary computed fields.
ACLs are updated accordingly.

If needed, we will soon be able to check partner_ids that have ordered but
not paid a channel / course product by searching the related 'sale.order' model
for such products.
2019-02-08 11:33:09 +00:00
Antoine Guenet eea58a3cf8 [FIX] web_editor: on anchor split, rerange and clean data on getValue
Due to a wrong order of operations, after splitting an anchor (press
ENTER), the range was setting on the first anchor. Now it sets on the
second one (as the code - but not the tests - suggests was supposed to
happen). Tests were adapted to reflect that change.

In tests, after splitting the anchor, `Wysiwyg.getValue` didn't always
properly clean up `data-original-title`. Targetting empty
`data-original-title` attribute instead of `aria-describedby` attribute
should fix that issue.

closes odoo/odoo#30923
2019-02-07 10:20:57 +00:00
William Henrotin b1fadbc6c6 [IMP] mrp: Work Order Form View
Small changes in the form view of WO

TaskID: 1903181

closes odoo/odoo#30654
2019-02-08 08:53:00 +00:00
wan 6dd25994bf [FIX] account: remove useless TOFIX lines
There is nothing preventint to remove this line
The second FIXME is preserved to keep the tests running, as the account functionality of the function may be removed

closes odoo/odoo#30323
2019-02-07 08:50:17 +00:00
Juhil Somaiya 5c13831dc5 [IMP] sale, base: partner form view improvement
Improved partner form consistency and clarity via following changes:
- Renamed string and tooltip from Shipping address to Delivery address
- Changed description of the customer address
- Re-organised contact partner form and added image of partner
- Changed default avatar to a simpler one that is not Stephane Bern
- Test case improvement

Task ID: 192044

closes odoo/odoo#29917
2019-02-08 06:37:35 +00:00
Cedric Snauwaert e67b22946d [FIX] base_vat: belgian vat number correct display
Odoo Accept the following mask for vat encoding :
BE0477472701
BE.0.477.472.701
BE.477.472.701
BE477.472.701
BE477472701

But, in certain cases we have to add the zero to be compliance (i.e. belgian official reports...). -> http://www.tvaintracommunautaire.eu/belgique.html

This commit make use of the compact method defined in stdnum.be.vat (which is used by vatnumber in order to validate the vat). The compact method return a 10 digits vat number starting with a 0 which is compliant with the official reports.

closes odoo/odoo#28523
2019-02-07 15:11:51 +00:00
Thibault Delavallée 29219b9c93 [IMP] website_slides: remove duplicated code
Code probably coming form a rebase conflict. Duplicated and therefore removed.

closes odoo/odoo#30921
2019-02-07 13:58:57 +00:00
Raphael Collet 4bc02d104e [FIX] stock: missing dependency of move_ids_without_package
closes odoo/odoo#30910
2019-02-07 13:13:15 +00:00
Raphael Collet d27e689056 [IMP] fields: dummy updates of one2many fields should not trigger recomputations 2019-02-07 13:13:15 +00:00
Robot Odoo 71bf0c1207 [MERGE][REF] website_slides: clean access and add membership on channels
Purpose of this merge is to clean access rights on slide models and give
less access to public / portal / internal users. Website publishers and
editors have rights to edit slides content and manage channels.

Another purpose is to clean and refactor access options on channels and slides.
Access to a given slide depends on the current user being a member of the
slide channel. A channel can be either public (joined easily) or on invitation
only (manual addition of members).

Slide can be flagged as preview, meaning they are accessible without any
concern about channel membership. It is used as teasing or free promotion
of a channel.

Publish flag is orthogonal. Non published slides are not visible to everyone
except website content editor. It allows to work and improve slides without
displaying them to members or public people.

Slide upload access is a bit cleaned. A can_publish field is added controlling
who can publish slides. Currently website publishers are allowed to publish
content. Not publishers people allowed to upload cannot publish their own
content. It stays in a submitted non published state.

Base for tests are also added. More of them will be added in future commits.

This merge is related to task ID 1937411 and closes PR #30847. More
generally this merge is linked to ongoing tasks

* task ID 1902304 (main eLearning task) PR #29876;
* task ID 1922159 (new user profile and gamification) PR #30514;
* task ID 1936153 (new homepage for slides) PR #30770;
* task ID 1937160 (payment flow and integration with ecommerce) PR #30914;

This merge is therefore not functionally complete itself and serves as a
preparation for other incoming commits. See sub commits for more details
on what has been done here.
2019-02-07 17:03:40 +01:00
Thibault Delavallée 797daba163 [IMP] website_slides: add widget to join a channel
Purpose is to add a new widget and its route allowing to join a channel.
As visibility is now mainly based on membership a widget to join channels
is required.

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:44:39 +00:00
Thibault Delavallée ddccd33bae [IMP] website_slides: improve upload slide screen
Slide upload access is a bit cleaned. A can_publish field is added controlling
who can publish slides. Currently website publishers are allowed to publish
content. Not publishers people allowed to upload cannot publish their own
content. It stays in a submitted non published state.

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:44:39 +00:00
Thibault Delavallée b91add891c [IMP] website_slides: add tests
Currently website_slides module lacks tests. This commit adds base for tests
and add some tests related to recently cleaned access rules and rights.

Future commits will gradually add more tests to the module as it evolves
towards a more broad and up-to-date application.

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:45:57 +00:00
Thibault Delavallée 748b9072d6 [IMP] website_slides: clean ACLs and refactor access options
Purpose of this commit is to clean access rights on slide models and give
less access to public / portal / internal users. Website publishers and
editors have rights to edit slides content and manage channels.

Another purpose is to clean and refactor access options on channels and slides.
Access to a given slide depends on the current user being a member of the
slide channel. A channel can be either public (joined easily) or on invitation
only (manual addition of members).

Slide can be flagged as preview, meaning they are accessible without any
concern about channel membership. It is used as teasing or free promotion
of a channel.

Publish flag is orthogonal. Non published slides are not visible to everyone
except website content editor. It allows to work and improve slides without
displaying them to members or public people.

Technically a new model is added to model membership on channels. It is
a decorated m2m between channels and partners; on this m2m the state of
membership is added. In a near future additional information will be stored
on this model, like completion of channel or certification information.

Other technical changes implied by this commit
 * visibility is simplified to either public or invite;
 * can_see and can_see_full are removed, as well as concept of 'partial'
   display of slides;
 * group_ids related to private access is removed;
 * a computed / searchable field is added to be able to efficiently find
   and search active members of a channel;

This commit is linked to task ID 1937411 and PR #30847.
2019-02-07 13:44:39 +00:00
Nimesh Jethva e9ac626c65 [IMP] account: Add chatter on bnk statements form view
This commit is related to task ID : 1871356

odoo/closes #26127
2019-02-07 13:27:04 +00:00
Robot Odoo 91ee6ba5a7 [MERGE] gamification: prepare use of gamification in slides and user profile
Purpose of this merge is to prepare addition of gamification in slides /
eLearning platform. In order to be able to use karma and the badges in other
modules we move those models in gamification.

A website_profile module is added to hold code, data and all necessary stuff
to display a user profile, including its gamification-related details. It
is a bridge between gamification and website. It will soon hold a revamped
user profile, used in both forum and slides.

More generally this merge is linked to ongoing tasks
 * task ID 1902304 (main eLearning task) PR #29876;
 * task ID 1922159 (new user profile and gamification) PR #30514;
 * task ID 1936153 (new homepage for slides) PR #30770;
 * task ID 1937160 (payment flow and integration with ecommerce) PR #30914;

This merge is therefore not functionally complete itself and serves as a
preparation for other incoming commits. See sub commits for more details
on what has been done here.

closes odoo/odoo#30908
2019-02-07 15:38:27 +01:00
mgh-odoo ca25a692bd [IMP] account, sale: Move terms and conditions to account
Purpose
=======

Be able to define terms and conditions if sales is not installed.

If sales is not installed, the user cannot define default terms and conditions
for his customer invoices since the setting in the sales section.

If sales is installed and default terms & conditions are defined, a customer
invoice created from scratch (not from an SO) will have them.

This is not consistent.

Task: 1917663

closes odoo/odoo#30140
2019-02-07 13:11:19 +00:00