Commit Graph
126256 Commits
Author SHA1 Message Date
Hiral Bhavsar 983d098794 [IMP] mail: adapt activity qunit test suite
The activity view has been refactored and improved so the qunit test
suite needed to be adapted.

More tests have also been added to test new features (progressbar,
schedule an activity, etc.) and the method 'get_activity' has been
correctly mocked (the result was previously hardcoded).

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar ff6415b63c [IMP] mail: add a progress bar by column in activity view
At the top of each column of the activity view, a progress bar is now
displayed below the activity type name based on activities scheduled.

Note that the progress bar widget is an extension of the kanban progress
bar as both have a very similar behavior.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar a02d273ebc [IMP] base, mail: set CRUD on activity view as attributes
Just like other views (form, list, kanban, etc.) CRUD operations (create,
delete and edit) are now set as attributes on the activity node based on
the user access rights.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar 132c0ad9bf [IMP] mail: allow to create record from activity view
In the activity view footer, it's now possible to create a new record
(and an associated activity). When clicking on the link, a 'SelectCreate'
dialog is opened and the activity is created when selecting a record.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar fac99a901c [IMP] mail: display activity counter on cells
For a record and an activity type (cell in the activiy view), a counter
is now displayed at the bottom right, that shows the number of
activities if more than one are scheduled.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar 33c0017c0c [IMP] mail: visually show the activity creation on empty cells
An indication that the user can schedule new activities by clicking on
an empty cell is now displayed while hovering an empty cell.

When clicking on the empty cell, the activity form is opened in a modal
defaulted to the corresponding activity type (no dropdown menu anymore).

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar 1a76fc9d2b [IMP] mail: display all activity types in columns
In the activity view, all activity types are now displayed in columns,
even if no activity are scheduled yet for some types.

Note that they are ordered based on their sequence from left to right.

Task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar b5ed9a7e2e [REF] mail: correctly implement the deadline precision
In activity view, there was a dummy logic for the deadline precision
(the year was not displayed if it was the current year).

This has been fixed with a valid logic as per locale.

Related to task 1894990
2019-05-03 10:19:40 +00:00
Hiral Bhavsar b2de618f9f [IMP] base,mail: allow to customize the activity view
The activity view has been greatly improved to allow to customize it
more easily. It works quite similarly to the kanban view, defining
`<field>` tags at the top and using these fields in the `<template>`
section. The template name used to define the activity cards is
`activity-box`.

Note that these activity cards are rendered using `KanbanRecord` widget
(this has implied that ActivityView inherits from `BasicView`).

Also note that the view validation has been moved in base to include the
common grammar.

Task 1894990
2019-05-03 10:19:40 +00:00
Swapnesh Shah b29d4da037 [IMP] base: use correct string for search filter
Type is the label of the field state ('Custom Field' or 'Base Field') while
ttype is 'Field Type'

closes odoo/odoo#33124

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-03 09:06:26 +00:00
Yenthe666 527d70a602 [IMP] base: improve res.country.state views
Allow to group by country
Add default search filters
Improved help message

closes odoo/odoo#29926

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-03 09:32:12 +00:00
Hetal Dhanak 926bf780b9 [IMP] survey: hide retry button on print view
-Previously, The Retry button was visible on printable view of the
survey as well as on answers.
	-This commit fixes the issue by passing an extra parameter to
determine whether user is in printable view or simply in answer review.

Task: 1967500

closes odoo/odoo#32618

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-25 05:29:09 +00:00
Lucas Lefèvre 207c4cfb3b [FIX] base: Add missing parent_id in res.partner form
Steps to reproduce:
- Install hr and base_address_city
- Edit an employee
- In private info, set a private address
- Open private address form from the employee form

Traceback because parent_id is undefined.

The base_address_city module override a part of res.partner
view form to change the city readonly modifier.
This override adds a domain in which appears parent_id,
but the field is not present in the view.

Related commit 526bfca3af

closes odoo/odoo#32172

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-04-19 06:59:11 +00:00
Swapnesh Shah d909e8650a [FIX] mail: Fixed typo
closes odoo/odoo#33069

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-30 21:02:03 +00:00
Jairo Llopis 88e455b6e9 [FIX] event: Allow to override default method
Without this patch, you have to redefine the field to be able to override this field.

closes odoo/odoo#33049

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-02 08:19:20 +00:00
Géry Debongnie 578c99475d [IMP] web: various small improvements to form view
This commit is a few small improvement/fixes to the web framework:

- allow placeholder attribute on input tags in form view
- only bind click event handler to buttons managed by the framework, not
  custom ones
- _onExecuteAction method in action manager properly fails if event
  cannot be properly handled

closes odoo/odoo#32458

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-05-02 07:14:52 +00:00
Robot Odoo a25298e713 [MERGE] sale, account, _*: improve UTM definition and propagation
Purpose: improve UTM definition and propagation in sale and account
applications, as well as in event.

Specifications

  * inherit from utm mixin in sale for SO and invoice;
  * propagate UTMs from SO to invoice when invoicing;
  * add utm fields on registration model;
  * remove website_sale_link_tracker module and inline its content in sale
    and website_sale;

Merge linked to task ID 1929272

closes odoo/odoo#31260

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-02 10:38:14 +02:00
Julien Mougenot ede3317b68 [IMP] web: close dropdowns on scroll
Dropdown from many2xxx and datepicker widgets now close on scroll
to allow access of background information when scrolling.

Related to task #1929483

closes odoo/odoo#32836

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-04-30 07:30:56 +00:00
Kaushalya Mandaliyaandqsm-odoo 3f18d67f9e [IMP] website: improve customize dialog UI for font selection
Replace the font selection UI by a dropdown. Make the system generic
so that a dropdown can be used for any set of options.

task-1942241

closes odoo/odoo#32437

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>


Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-04-30 14:30:09 +00:00
Robot Odoo 97780e5b8b [MERGE] fields: relational fields automatically behave as mapped
In other words, `recs.foo_id == recs.mapped('foo_id')`.

closes odoo/odoo#32897

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-30 17:25:56 +02:00
Lucas Lefèvre 0d21735a92 [FIX] web: Send attachment ids on file loaded
This commit fixes a bug introduced when migrating
from jquery deferred to native JS Promises (ab56e63).

Steps to reproduce:
1. Go to the Expense app
2. Create a new expense
3. Click on "Attach Document" and upload a file
=> crash and infinite loading spinner

After loading files, the `attach_document` widget is
supposed to call a callback action with attachment ids
as argument.

Currently, attachement ids are not correclty retrieved.
They are retrieved via the `arguments` object but since ab56e63
`arguments` refers to the arguments of the Promise callback
function and no longer to the handler function `_onFileLoaded`
arguments.

closes odoo/odoo#33048

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-04-30 11:22:32 +00:00
Raphael Collet f44571f550 [IMP] base: remove mapped() where not necessary 2019-04-30 07:54:49 +00:00
Raphael Collet 63bc6013ab [IMP] fields: relational fields automatically behave as mapped
In other words, `recs.foo_id == recs.mapped('foo_id')`.
2019-04-30 07:54:49 +00:00
Rishabh Jadia c388505fbe [IMP] event_sale, mass_mailing_sale, pos_sale, sale(_crm): added utm parameters (utm_source, utm_campaign, utm_medium)
- added the campaign parameters on event_registration.
- added the campaign parameters on sale_order and move the same parameters to the invoice generated for that so.

Task-1929272
2019-04-30 05:00:30 +00:00
Rishabh Jadia 1e3310d923 [MOV] website_sale: removed the website_sale_link_tracker module and moved it to the website_sale.
Task Id #1929272
2019-04-30 04:55:20 +00:00
Jinal Patel 91fd1cf202 [IMP] payment : make s2s card validation transaction optional
Currently, when some add token for s2s payment, dummy transaction of
1 unit was performed and it was frautrating for customer.

So added option on acquirer's settings that check if you want's
to validate the transaction or not.
If 'verify Card validity' is ticked on payment acquirer then and then
it will verify with dummy transaction otherwise it will not going to verify
the card details.

Task-1903170

closes odoo/odoo#29595

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-04-24 08:48:01 +00:00
Robot Odoo df189fd6ab [MERGE] tools, base, *: improve image tools
Merge commit for PR: #31811

The main goal is to keep the image ratio on resize (instead of adding a white border).

The opportunity is taken to also clean up the image tools.

See individual commit messages for more information.

Functional:

- Remove the white border from all images (never resize to square, keep aspect ratio)
- Prevent some images from being 3px shorter than expected
- Resize the website favicons appropriately, always encode them as ICO, add a default favicon to new websites
- Secure images going through the tools by returning an error when non-image content is given
- Incrase the max image filesize from 42e6 to 45e6 to fit some of the biggest images we might get from Unsplash
- Always return the correct mimetype/Content-Type for images
- The avatar placeholder was white displayed on top of white, now it's grey so we can actually see it

Technical:

- make image tools more consistent by merging the tools and removing duplicate code
- add tests for the image tools
- remove uncessary parameters
- remove the "ghost border fix"

task-1958000

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-04-29 17:00:46 +02:00
Sébastien Theys 66cd46d202 [IMP] tools: move image process into chainable methods
This allows to more easily customize each method, and it gives more flexibility
regarding which operations to apply and in which order.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys f159ba8f31 [IMP] tools,website: correctly handle favicon and .ico files
Previously the image that we uploaded as a favicon of the website was not
resized, so it could be extremely excessive in size and resolution, and it also
was not guaranteed to be a square.

Now we always resize it appropriately and save it as an ICO file.

The default favicon is now applied to all websites instead of only the first.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys ec436c75e4 [IMP] website_sale: center images in cart popup and right panel
If the images are not all square, it looks better if they are centered.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys 0ab1940189 [IMP] base,web: adapt kanban image following image tools changes
Since the images are not guaranteed to be square anymore, the kanban image had
to be adapted to better handle the different image ratios.

Also the placeholder has been moved into the actual image div instead of
being a separate div that acted differently.

The avatar placeholder was white... displayed on top of white. Now it's grey
so we can actually see it.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys 7d3fe51100 [FIX] http,web,website_*: return the correct Content-Type for images
* = website_profile, website_slides

Before this commit, the returned Content-Type was not always correct, for
example if the image tool was changing the format, which happens when given
a BMP (converted to PNG), or other types being converted to JPEG.

The previous method `force_contenttype` was too specific and it wasn't available
in every controller. It didn't even need to be a controller method because it
didn't use self.

Now we create a generic helper to ease updating headers.
The Content-Type is only updated when it is safe to do. It is especially unsafe
for example for SVG files.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys 09ff05ba45 [IMP] base: clean up image tools tests
Since all the tools have been merged into one, the tests can be restructured and
the duplicate tests removed.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys 425f197f16 [IMP] tools,base,*: remove intermediary image functions
* = hr, im_livechat, mail, payment, purchase, web, web_editor, web_unsplash,
	website_profile, website_slides

Since the merge of all image tools into one function, the intermediary functions
are not needed anymore.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Sébastien Theys e479138558 [IMP] tools,base: merge all image tools
Make the image tools more consistent and easier to maintain by having a single
function handling all the cases, instead of several functions doing more or less
the same thing with obscure differences.

Also introduce a new function to guess the size based on a field name, to be
used in the following commit.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys 4c61ee7b7d [IMP] tools,base: remove ratio from image crop
Following commit: 6801baa662

Crop is always used when we know the target size. Therefore there is no point
to pass a ratio argument. However size is required now.

Also "center" is always used, so make it the default type.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys d870877967 [IMP] tools,base,web,website_*: keep image ratio on resize
* = website_partner, website_profile, website_sale, website_slides

Before
======

Since commit: 2e3848b394

The images that are resized have additional borders if the target ratio is
different than the image ratio. Those borders are transparent if the image
format supports it, and are white otherwise.

With that current solution, if the background where the image is displayed is
another color than white, it is looking really bad.

Moreover, most images are stored resized like this, so it is not even possible
to decide if it should have borders or not depending on the context, the
original image and ratio is forever lost.

It is also inconsistent because if the image is already smaller than the target
size then it doesn't include borders. In that case it keeps the original ratio
instead of the target ratio. So it isn't even guaranteed that the target
ratio is going to be respected.

After
=====

This commit will solve all of those problems by always keeping the ratio of the
original image.

This implies the views should be taking care of adding borders when necessary.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys b230114fcf [IMP] web,website_profile,website_slides: rename content and base64
There is a mix in the variable names: before this commit, what is called
`image_base64` is actually not base64 encoded, and what is called `content` is
actually base64 encoded.

The variables have been renamed to avoid further confusion.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys 2864f8a6cf [IMP] base: add tests for the image tools
task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys 433d007075 [IMP] tools,web_editor,web_unsplash: improve image optimize for web
This commit introduces the possibility to resize and to select the quality when
optimizing an image for web.

This will be used by the media dialog in a future commit.

The arbitrary resolution limit of 42e6 has been increased to 45e6 to fit some
of the biggest images we might get from Unsplash, and this value has been moved
into a variable so it can be customized.

The mimetype computation has been moved after the image processing because in a
next commit the operation could return the image in a different format than what
was originally given. Eg. BMP -> PNG, or unsupported format -> JPEG.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys 8269f85513 [IMP] tools: remove the "ghost border fix" from image tools
We can't reproduce the issue it was trying to solve.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys d61e9d940f [IMP] tools: rename the image filter ANTIALIAS to LANCZOS
This is the new name since Pillow 2.7.0.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
Sébastien Theys d303518841 [IMP] tools,base: remove image encoding parameter
The image tools were accepting an encoding parameter but it was never used.
Indeed the given images are always encoded in base64.

`image_colorize` was the only method not taking base64 directly, so it has been
modified for consistency. This allows to change the code in partner to not
base64 decode the image in some case just to be base64 encode it again after.

`crop_image` and `limited_image_resize` have been slightly refactored to account
for this change, but in this commit their behavior was kept.

task-1958000
PR: #31811
2019-04-29 13:45:03 +00:00
jbm-odoo b8dd1b2ac5 [FIX] web: path computation issues on non unix platforms
closes odoo/odoo#32845

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-04-29 10:03:56 +00:00
Yenthe666 58294b451a [IMP] website_event_track: add activity view type on event tracks
closes odoo/odoo#30171

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-01-14 13:33:35 +00:00
mreficent b605f6d981 [IMP] mail: remove create_date from blacklist form view
closes odoo/odoo#28200

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2018-11-06 16:16:17 +00:00
Swapnesh Shah 638ef219eb [IMP] calendar: make method private
closes odoo/odoo#32932

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-24 18:59:56 +00:00
Martin Trigaux 6d9862f860 [FIX] base: use correct code for Filipino
Master version of odoo/odoo#32867
Instead of fil - fil_PH, it should have been fil_PH - fil.

closes odoo/odoo#32868

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-23 09:48:59 +00:00
Yenthe666 1be517e9c4 [IMP] mass_mailing: improve sentences in help fields
closes odoo/odoo#32734

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-16 13:52:22 +00:00
Robot Odoo 73c5983917 [MERGE] mail: add tests for mail gateway (and clean bits of code)
Purpose: pre-merge of small code cleaning and tests improvements for
task 1853147.

Includes: fetchmail code cleaning, fix in mail and improved tests for
mail gateway.

closes odoo/odoo#32974

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-26 13:11:25 +02:00