Commit Graph
126133 Commits
Author SHA1 Message Date
qsm-odoo f74ab64df7 [FIX] web: do not show BS deprecation warnings
Part of https://github.com/odoo/odoo/pull/31401
task-1944790
2019-02-27 10:28:30 +00:00
qsm-odoo 9a7858efe1 [FIX] web: remove bootstrap sourceMappingURL
Same as https://github.com/odoo/odoo/commit/8e17223c260add842d83b2549d7bdaa4c3cc4d6c

Part of https://github.com/odoo/odoo/pull/31401
task-1944790
2019-02-27 10:28:30 +00:00
qsm-odoo 4697d74480 [IMP] web: update bootstrap 4.2.1 -> 4.3.1
See https://blog.getbootstrap.com/2019/02/11/bootstrap-4-3-0/
and https://blog.getbootstrap.com/2019/02/13/bootstrap-4-3-1-and-3-4-1/

Again, some fixes were added in this version and not in a 4.2.x version
so there is no clean way to backport them in 12.0 / saas-12.2.
If needed, the file bootstrap_review.scss is there for that.

Among the new features, two notable ones:
- The '.modal-dialog-scrollable' class which does what odoo already
  implemented for all its modals. So we could remove our custom code in
  a next update.
- Responsive font sizes ! Plan was to develop something similar for the
  website, so this comes at the right time. The behavior is opt-in, we
  will enable it in a next update.

Part of https://github.com/odoo/odoo/pull/31401
task-1944790
2019-02-27 10:28:30 +00:00
qsm-odoo da1899af48 [REF] *: definitely get rid of web_editor.base
* portal, sale, website, website_blog, website_crm, website_event,
  website_event_sale, website_forum, website_hr_recruitment,
  website_sale, website_sale_wishlist

At last, that ugly JS module can be removed. Before this current PR, it
was still used to wait for "page ready", to initialize widgets on page
loading. Now, all can be done thanks to public root and public widgets.

web_editor.base was also still used in tours, which should not be
necessary anymore for the same reason, especially since the tour manager
waits for the public root naturally.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-27 10:02:46 +00:00
qsm-odoo a80775ce3c [REF] website, *: stop using 'animation' confusing name
* web, website_blog, website_sale, website_twitter

Before this PR, all website widgets were named 'Animation'. Now that
they are 'Public Widgets', we can at last stop using the confusing
'animation' name.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:09:23 +00:00
qsm-odoo d946b7a85d [REF] website, *: use public widgets instead of website animations
* website_blog, website_crm_partner_assign, website_event,
  website_event_track, website_form, website_forum, website_links,
  website_mail, website_mail_channel, website_mass_mailing,
  website_sale, website_sale_comparison, website_sale_delivery,
  website_sale_stock, website_sale_wishlist, website_slides,
  website_twitter

While using the 'Animation' class of website instead of the frontend
'Widget' class leads to the same behaviors, this refactoring is done for
two reasons:
- Stop using the confusing 'Animation' name for non-animated behaviors
- Instantiation of 'Widget' is slightly faster than 'Animation'

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:09:23 +00:00
qsm-odoo 335a505d1f [REF] website, *: move and review the notion of edit mode
* portal, sale, web, website_blog, website_crm_partner_assign,
  website_forum, website_event_track, website_links, website_mail,
  website_slides, website_mail_channel, website_mass_mailing,
  website_sale, website_sale_comparison, website_sale_delivery,
  website_sale_wishlist

The `editableMode` option and its related options in public widget
should only be part of website, this commit moves them there. This is
also the occasion to implement something that is long overdue: stop
creating 'animations' / public widgets in edit mode by default. Indeed,
lots of 'animations' were defined by beginning with 'if not edit mode'.
Now, if a public widget should be considered in edit mode, it must be
defined explicitely through a property at *definition* of the widget.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:09:22 +00:00
qsm-odoo 27fca749af [REF] *: use 'frontend' system in non-website apps
* account, auth_signup, payment, portal, project, sale, sale_management,
  web_unsplash, website, website_mail, website_rating, website_sale

This commit does probably not do what is stated for all non-website apps
but it is a first step. It also uses the system in apps which could have
already used it but did not.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:09:22 +00:00
qsm-odoo c3da83b40a [REF] website: make the lazy renderer a public widget
Not sure this one is still useful but best to integrate it as a
public widget.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:02:59 +00:00
qsm-odoo 3eb9269308 [FIX] web: consider the body when there is no wrapwrap
Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:02:59 +00:00
qsm-odoo 7b960c66bb [REF] website, web, *: move part of website into web
* im_livechat, survey, website_forum

When website is installed, the JavaScript code has access to utilities
to define improved widgets which are automatically attached to existing
DOM elements on page load. Those mechanics are more and more needed in
portal which does not depend on website (as it is website which depends
on portal). This commit moves part of website JS to web, so that it can
be used by all 'frontend' apps whose only common dependency is web
(portal, survey, auth_signup, ...).

This PR also questioned several other similar issues which will be
handled later like:

- website should maybe not depends on portal but only on http_routing

- part of portal should be moved to http_routing and http_routing
  should be renamed (especially for frontend layouts, etc) so that apps
  like survey can reuse some common code

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:02:59 +00:00
qsm-odoo dd2ba3c4f3 [REF] website: split WebsiteRoot definition / instantiation
In preparation to future commits, the WebsiteRoot instantiation is moved
in an other file than its definition.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:02:59 +00:00
qsm-odoo 3f4e760f34 [MOV] web, *: simple moves of JS files to 'public' folder
* web_editor, website, survey, im_livechat

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
2019-02-26 17:02:58 +00:00
Christophe Simonis ff9c9341d6 [MERGE] forward port branch saas-12.2 up to fcb972db9d 2019-02-26 16:39:30 +01:00
Nicolas Martinelli bc84fdf71b [IMP] product: minimal quantity
User might be confused by the help: they think the vendor cannot sell
the product below this quantity, which is not what the field depicts.

Improve the label and the help of the `min_qty` field to avoid
confusion.

opw-1943511

closes odoo/odoo#31414
2019-02-26 08:22:33 +00:00
Raphael Collet ebdea483b0 [IMP] base: allow creation of record linked to an x2many
Use a command to add the created record, otherwise it simply does not work.

closes odoo/odoo#30148
2019-02-15 13:08:54 +00:00
Nans Lefebvre ee775c7548 [IMP] base: add to automated actions the fields to watch during update
When users create an automated action to trigger when a record is updated,
they assume each update is 'atomic' in some sense.
It is not the case, as one write may trigger many write, some in recompute.
As a result, any update may trigger a dozen actions (or more).
We add a field wich allows us to specify which field we want to watch.
For instance, you could select the field 'state on quotation',
and thus only action would be triggered on confirming the quotation.

The link_field_id is a field that allows to link a record of the source model
to a new record of the target model, through a many2one.
However many target records can be created, so every one of them
(except the last) ends up orphan.
We allow for one2many and many2many fields to be used,
and in these cases we add the newly created record to the list.

opw 1910671
2019-02-15 12:37:25 +00:00
b3b29f3b86 [IMP] web: graph view legend and tooltips improvements
This commit ameliorates the tooltips and the legend
of the graph view in its different modes (bar, line, and pie).

Related task id: 1917940

Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>

closes odoo/odoo#29747
2019-02-25 08:26:10 +00:00
Siddarth Gajjar 23dcaf4836 [FIX] mass_mailing: fix send email issue.
- while clicking on send now button in mass mailing app it throws error due to wysiwyg undefined.

closes odoo/odoo#30533
2019-02-25 12:22:34 +00:00
svs-odoo bad6db2483 [IMP] stock: improvement of putaway usability
PutAwayStrategy model was deleted and FixedPutAwayStrategy model was
renamed into PutAwayRule.
Now, each location can contain multiple putaway rules, each rule
applying either on product or on product category.

The purpose is to:
-   Add more visibility on putaway settings (with a stat
    button on product, product category and location views, and a
    submenu item in Product configuration menu).

-   Change putaway model to avoid redundancy.

Task #1935169

closes odoo/odoo#30889
2019-02-25 09:55:32 +00:00
svs-odoo 0fa2f87c1c [IMP] product: display UoM for product cost
Before this commit, when UoM was displayed, it wasn't specify if cost
referred to 'Unit of Measure' or 'Purchase Unit of Measure'.
To avoid ambiguity, it's now specified.

This apply when 'Units of Measure' is ticked in settings.

Task #1937177

closes odoo/odoo#31070
2019-02-13 15:40:10 +00:00
Nans Lefebvre 9607f4e801 [FIX] base: synchronize (non-false) company_id to child contacts
Let the database be in multi-company with unshared contact catalog.
Let F be a filter "('partner_id', 'not ilike', 'string')" on invoices.
If there is a contact which parent belongs to another company,
then this parent cannot be read.
Thus the name_get on partner can create an access error.
As a result applying the filter F would fail and return no results.

It generally doesn't make much sense to have a contact company X, which belongs
to the Odoo Company OC1, while its child contacts are in another Odoo company,
since many fields are directly computed from the parent.
However it is useful to have X belongs to no company, while it has child
contacts X>Yi belonging to company OCi.
In the first case it can create access errors interrupting the normal flow of
operations, while the latter should not.

To forbid the first case while allowing the second, we synchronize company_id,
but add a special case to ignore it if it set to False.

Note that PR#30997 should be used in case the name_get causes an error for
another reason that is deemed a legitimate use-case.

opw 1933862

closes odoo/odoo#31364
2019-02-22 12:55:28 +00:00
Priyanka Kakadiya f1da58c718 [IMP] base: better onboarding bars on small devices
In small devices, onboarding bars are displayed vertial, which
takes too much screen space, and user has to scroll down
a lot to view actual content.

This commit improves the behavior by showing onboarding bars
horizontally (with scrolling) in small devices also, and thus
occupying minimal screen space.

task: 1929048

closes odoo/odoo#30823
2019-02-22 13:19:56 +00:00
Can Tecim 5028507ea2 [CLA] Can Tecim signs individual instead of corporate CLA
Remove the corporate CLA (only cantecim has contributed in the past) and signs
an individual CLA file instead

closes odoo/odoo#31177
2019-02-21 13:21:56 +00:00
Fabrice Henrion 20e48b84f8 [IMP] website_profile: improve wording and fix typos
closes odoo/odoo#31172
2019-02-20 13:16:22 +00:00
Nicolas Martinelli 18eb437279 [FIX] {website}_sale: transaction access
Payment providers can be used without eCommerce. Therefore, we should be
able to access the payment transactions with only `sale` installed.

opw-1941591

closes odoo/odoo#31270
2019-02-20 09:59:11 +00:00
jpr-odoo 3461637b7a [IMP] web: group by more than two fields in graph view
Before this commit: select more than two groupbys
in a graph view would have no impact at all if mode
'bar' or 'line' is selected.

This commit allows to correctly handle more than
two groupbys in all modes.

Task ID: 1917948

closes odoo/odoo#29673
2019-02-20 09:28:07 +00:00
Kishan Gajjar 726aeefe36 [REF] web: small refactoring for export wizard
- add missing docstrings
- correctly order functions
- move functions in correct sections
- follow JS guidelines

closes #31261
2019-02-20 06:32:31 +00:00
Lucas Perais (lpe) f9a80a6e84 [FIX] web: calendar: take locale to format dates
Backport of d9fed5381a78c19ce14ddc8b9233f60d53c65453

Before this commit, when opening the calendar view with a specific locale
in the "week" view
the days were translated but the date format was wrong and fell back to english
This was because the translated terms were passed explicitly, but the locale did not
get passed

After this commit, we do what it takes to pass the locale to fullcalendar
and the dates are formatted with the right pattern

Also, there may be a bug in fullcalendar, because just passing the locale in the options
won't work, it should be instanciated first in fullcalendar's "locales cache"

OPW 1922092
OPW 1934127

closes odoo/odoo#30909
2019-02-07 09:57:32 +00:00
William Henrotin 8cc62b1a6d [FIX] stock: warning in case of duplicate serial numbers
The onchange on serial number aims to track any duplicates. The issue
comes from the fact that `.mapped()` removes the duplicates when it
returns a recordset. We use a list comprehension instead.

Opw : 1910963

closes odoo/odoo#30913
2019-02-07 09:57:08 +00:00
Arnold Moyaux c47dc928f6 [FIX] stock: warehouse_selectable skip warehouse_ids
Usecase to reproduce:
- Create a route with a warehouse_ids
- Uncheck warehouse_selectable on route
- Create a picking that use the route
It should fail since the route is not applicable.

It happens because _search_rule only check for route with warehouse_ids
but it do not check for warehouse_selectable. We can't fix _search_rule
since stock_warehouse.py creates multi step delivery and reception
routes without warehouse_selectable thus it would break existing configuration.

Instead create an onchange on warehouse_selectable that remove
warehouse_ids on route.

partial backport of commit a35df8d371

closes odoo/odoo#30844
2019-02-07 09:05:19 +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
Jorge Pinna Puissant 37220d02a4 [FIX] payment_authorize: add new card verification
In the e-comerce, when the user try to add a new card in this payment
methods.

Before this commit, to validate the card, besides of the creation of the
payment token, an amount of $1.5 id charged and refunded.
During the refunded an error was raised. This error arrives because:
payments made via Authorize.net are settled and allowed to be refunded
only on the next day.

https://account.authorize.net/help/Miscellaneous/FAQ/Frequently_Asked_Questions.htm#Refund
<quote>The original transaction that you wish to refund must have a status of Settled Successfully.
You cannot issue refunds against unsettled, voided, declined or errored transactions.</quote>

This means, we can't refund directly after the payment.

Now, we only create the payment token. As Authorize.net verify the card
during the creation of the token, a new verification is not needed.

OPW-1927754

closes odoo/odoo#30905
2019-02-07 07:40:40 +00:00
Carel 2a881865e8 [CLA] signature for Carel van Dam
closes odoo/odoo#30876
2019-02-07 04:27:37 +00:00
Lucas Perais (lpe) a46138cb01 [FIX] mail: create partner from template in right company
Before this commit, when creating a partner automatically when creating
a message with a template, the company on the partner was wrongly set

After this commit, we try to retrieve the company from the model on the template

OPW 1934392

closes odoo/odoo#30893
2019-02-06 16:48:23 +00:00
Lucas Perais (lpe) 314088a5ec [FIX] point_of_sale: resuscitate onchange amount all
Make a return on a pos_order. A new pos_order is created.
On the latter, remove a pos_orde_line.

Before this commit, there was a traceback, due to a KeyError
It was introduced by 5f6a491265
which intended to optimize migration process

We keep the logic of that commit here, in a new helper method
while restoring the original onchange,
since it wasn't compliant with onchange specs

OPW 1934129

closes odoo/odoo#30897
2019-02-06 15:11:48 +00:00
qsm-odoo 1a299e8833 [FIX] auth_signup: properly disable sign up button on click
The feature introduced with https://github.com/odoo/odoo/commit/67d1173bf381befc136d840e232514c2c9ef7e1b
was broken by https://github.com/odoo/odoo/commit/b78b9c87c95acdf6fcf4f4eb3a80efa0e90eae09#diff-2d8ecbf95567bb339109e9552cbc68a3
because a class was removed by mistake.

This commit does not reintroduce the class so that no view is modified
in stable versions but rather review the JS to target the same button
another way.

Bug revealed while working on https://github.com/odoo/odoo/pull/29442

closes odoo/odoo#30896
2019-02-06 15:03:04 +00:00
Toufik Ben Jaa fe03f7b6b8 [FIX] crm: avoid crash when merging leads
- When merging leads that creates a partner, an error could be thrown
  due to the `res.partner` `default_get` method that reads values from the
  lead that creates the partner.
  The issue is due to the fact that the `crm.lead` record is merged (and
  unlinked), trying to read it will cause an error since the records
  doesn't exists anymore.

  This fix checks that the `crm.lead` we are trying to read from exists.

closes odoo/odoo#30895
2019-02-06 14:54:25 +00:00
Nans Lefebvre 98d0424848 [FIX] survey: support custom server date format in (frontend) surveys
The library moment.js does not support custom date formats anymore.
The following warning is given:
Deprecation warning: value provided is not in a recognized ISO format.
As a result, the moment contains 'Invalid Date',
which would remove possibility to complete a survey containing a date
in any format different than the default.

opw 1930152

closes odoo/odoo#30894
2019-02-06 14:39:04 +00:00
Nicolas Martinelli fa97d6ab15 [FIX] purchase: supplier on parent company
- Create a product and set a contact as the vendor (for instance, Arthur
  Gomez from Asustek in the runbot)
- Set a specific name and code for the supplier
- Create a RFQ for this vendor (Arthur Gomez - the contact person)
- Add the product, confirm the RFQ

On the product, the company (Asustek) is automatically added as vendor,
but there is no vendor name and code.

opw-1929745

closes odoo/odoo#30891
2019-02-06 14:17:45 +00:00
Aaron Bohy 495d475d1d [FIX] web: only call name_get when necessary
For many2one fields, 'default_get' only returns the id, whereas
'onchange' (like 'read') returns an array with id and display_name.

Before this rev., when creating a new record, we always called
'name_get' for all many2ones, whether or not their value was
obtained by 'default_get' or 'onchange', i.e. even if their
display_name was already known.

It may just look like unnecessary RPCs, but those RPCs could
actually cause a crash when the user has access to the main model
(and thus can access the display_name of the many2one thanks to
related sudo), but doesn't have access to the many2one comodel.

closes odoo/odoo#30892
2019-02-06 14:03:25 +00:00
RomainLibert 5fcf891e07 [IMP] various: optimize _name_search
In the overrides of _name_search we should avoid creating domains with
huge lists of ids as it is inefficient.
We can also make sure that we optimize the empty search as in this case
the custom domain doesn't make sense, we can simply search on an empty
domain and, thanks to the limit argument, still keep a fast query.

Linked to task 1918906

Thanks to @odony and @nseinlet

closes odoo/odoo#30155

closes odoo/odoo#30887
2019-02-06 13:26:33 +00:00
Nans Lefebvre c0ffeeb417 [FIX] website_sale: select cart recovery mail template in action
Fine-tuning of commit 50217184d2
The selection of the cart recovery mail template would fail if there was more
than one sale order selected.

opw 1921714

closes odoo/odoo#30885
2019-02-06 14:51:44 +00:00
Vincent Schippefilt 7d1957da8f [FIX] web: hang when saving then discarding
When editing a record, if it cannot be saved (b.e. due to required
fields) and the user clicks on save, then on discard

Before this fix, the window did nothing (seems like it is unresponsive)

After this fix, the user is able to discard the form.

task-id: 1937142

closes odoo/odoo#30871
2019-02-06 11:57:58 +00:00
Lucas Perais (lpe) 80460c40d9 [FIX] account, purchase, sale: notification with right lang
Have a partner in French while you operate in English
Click on 'send by email' on a invoice/sale order/purchase order

Before this commit:
- The body of the mail is translated in the partner's language
- but the notification header/footer surrounding the body was not

This is because:
- mail templates apply to a model
- in the case of the notification header/footer, this model is 'mail.message'
- mail.message doesn't have a lang field
- at the notification rendering time, we don't have easy (and generic) access
to the "real" model or to the lang (let alone to which lang to apply) that we need

After this commit, the notification is translated but:
the lang to get is hardcoded, and is the one on the partner of the inv/so/po
and is un-coupled from the dynamic lang on the proper inv/so/po template

This patch is hackish at several levels, I suggest that a generic solution is found in master
If no other solution is found until then, then the patch may be forward-ported

OPW 1935091

closes odoo/odoo#30873
2019-02-06 11:07:33 +00:00
qsm-odoo 930839c76b [FIX] website: remove data-editor-message attributes on save
When the edit mode is entered, some elements receive
data-editor-message attributes. These were not removed on save which
could in some cases make the attributes be saved in the database. For
this to happen it would require an `.oe_structure.oe_empty` element to
be put *inside* an editable element (instead of being the one which is
editable). In that case the `.oe_structure` content would be saved in an
inheriting view but the parent view would also be COW'd for no reason
because of that attribute.

Difficult to say if such a case exist in the current views but as it
technically possible and that some of our tests use that configuration,
it is worth fixing.
Note: this fix was in fact done in the new editor in master and allowed
to detect that one of our test was not testing a feature correctly
because of that. This will be adapted in a different commit of this PR.

closes odoo/odoo#30834
2019-02-06 09:49:11 +00:00
Romain Derie aef6a5aaed [FIX] website: specific view ID might also change on save
Commit https://github.com/odoo/odoo/commit/29075a8e2c734624cec4f6009185616634f70dea
was written while there was an incorrect behavior related to
multi-website, oe_structure_ID and edit mode in a rare specific case
(see the second commit from this PR for detailed explanation
https://github.com/odoo/odoo/pull/30834).

That rare case was detected in 12.0 since the tour did not work on
master with the new editor (that fixed the incorrect behavior).
Basically, it was COWing the edited view even if only an oe_structure_ID
was touched.

Indeed, when saving a specific view in the HTML editor, we should also
search for its possible new ID as it could change if we also edited its
generic parent. In that case, the view will be copied and then unlinked
to preserve inherit order on the new specific tree.
2019-02-06 09:49:11 +00:00
Christophe Simonis 530f364547 [MERGE] forward port branch saas-11.3 up to 0c42a607ec 2019-02-06 11:59:44 +01:00