Commit Graph
117975 Commits
Author SHA1 Message Date
Thibault Delavallée 1e040c8713 [FIX] test_mail: update one counter because of runbot crashing sometimes
Due to unknown reasons sometimes a performance test takes one query more to
run than expected. Let us therefore avoid red runbots by increasing the
query count by 1.
2018-03-15 14:18:18 +01:00
Raphael Collet f31516566e [FIX] base: validate domain of field used in view
When a field has a domain like `"[('foo', '=', bar)]"` and is in a view, check
that `bar` is in the view as well.  Note that the check should only occurs in
editable views (form or editable list) and when the field itself is editable.

OPW 1820269
2018-03-15 14:16:38 +01:00
Nicolas Martinelli 65214c01b5 [FIX] mrp: BOM count on product
- Create a Product A with attribute color and attribute values white and
  black.
- Create 3 products (Components 1, 2 and 3)
- Create a BOM for A like:
  Component 1, Variant column is empty
  Component 2, Variant white
  Component 3, Variant black
- Go to Inventory > Master Data > Product Variants, and open one of the
  2 variants of Product A

The BOM count is zero, while it should be 1.

The current implementation of `bom_count` doesn't take into account
attributes that can be set on the BOM line.

opw-1814973
2018-03-15 13:35:54 +01:00
Nicolas Martinelli 8f9770f076 [FIX] product_extended: "Compute from BOM"
Display the 'Compute from BOM' button on the simplified view of
`product.product`, alongside the 'Cost' price.

opw-1814973
2018-03-15 13:35:54 +01:00
Nicolas Martinelli 7e724f96c5 [FIX] product: display Cost price of product
The 'Cost' price should be displayed in the main form view of
`product.product`, not only the simplified view.

The reason is that the field `product_variant_count` has the same value
for the product and the template, therefore it cannot be used to make
the distinction between the two models.

To do so, we need to reintroduce the `is_product_variant` field to make
the distinction between `product.product` and `product.template`.

opw-1814973
2018-03-15 13:35:54 +01:00
Nicolas Martinelli 56749cf098 [FIX] product_extended: compute price
Remove the limitation introduced in 6feefe4d10, since the
`standard_price` field is now available on `product.product`.

opw-1814973
2018-03-15 13:35:54 +01:00
Nicolas Martinelli e03a06b3e9 [FIX] crm: favorite filters
- Go to CRM > Reports > Pipeline
- Click on one of the Favorites filters (e.g. 'Opportunities Won Per
  Team')

A JS error arises.

The filters are not correct. `__count` should be `__count__` and
`expected revenue` should be `expected_revenue`.

opw-1825759
2018-03-15 13:26:48 +01:00
Thibault Delavallée b90e046299 [MERGE][IMP] mass_mailing: allow to choose outgoing server for mailings
This merge improves mass mailing application by allowing to choose
specific outgoing mail servers on mailings. It is used notably if
you want to separate mass mailings from classic emails and/or to perform
some load balancing. A settings to add a default server used for mailings
is also added.

As a read access on outgoing mail servers is added for mass mailing
users the credentials are now restriected to admins for security
reasons.

This merge is related to task ID 31737. Closes #21699 .
2018-03-15 13:24:38 +01:00
Sanjay Jamod fe5c8602b0 [IMP] base: protect ir_mail_server credentials by base.group_system group
Purpose of this commit is to prevent unauthenticated access on user name
and password of the mail server. Indeed as mass mailing users notably gain
access to mail servers let us protect its credentials.

This commit is related to task ID 31737
2018-03-15 13:01:58 +01:00
Sanjay Jamod 7169a72869 [REF] base: remove ir_mail_server name_get method and use default one
Purpose of this commit is to not set parentheses around mail server name.
Indeed it does not add any value to have its ID in the name_get.

This commit is related to task ID 31737
2018-03-15 13:00:54 +01:00
Sanjay Jamod 507c1e03a7 [IMP] mass_mailing: allow users to choose a specific outgoing mail server
Purpose of this commit is to allow mass mailing users to select an outgoing
mail sever when performing mass mailing. It includes

* add a field in mass_mailing to select specific outgoing mail server;
  it is put in debug mode because it sounds people would not understand
  what is its purpose;
* add an option in settings to set a default outgoing mail server;
* give read access to ir.mail_server to mass_mailing users;

This commit is related to task ID 31737.
2018-03-15 12:56:26 +01:00
Jeremy Kersten 1cd63d8190 [FIX] website_sale: dont show variant option when not active
Before this commit, a user that ccick 'Customize' on th eproduct page
see the 'List View of Variants' aven if option 'Variants' in settings
was disabled.

Now we hide this view if the group for variants is not enabled in the settings.

This commit closes #23398

That means that a user that enable the view while the variants was enable,
need to disable the view before disable the variants.
2018-03-15 12:35:24 +01:00
Raphael Collet 07a73ce27f [FIX] stock_account: standard price on average
Avoid the division by zero when the available quantity becomes zero.

OPW 1826912
2018-03-15 12:15:20 +01:00
Rohan Patel 7cee389e78 [IMP] auth_signup,portal: create portal user using template user
Purpose of this commit is to standardize portal user creation when
creating new portal users (when 'Free sign up (B2C)' option activated). It
copies the portal user template. The same behavior now applies when
converting a partner into portal user using the portal wizard.

This commit is related to task ID 31399 .
2018-03-15 11:34:41 +01:00
Rohan Patel e3afd5508c [MOV] auth_signup, base: move portal user template to base module
Purpose of this commit is to standardize portal user behavior and creation.
As all portal required features (user, group, support) have moved to
base let us move the template user used to create portal users to base.

'Portal User Template' is therefore moved from auth_signup to base module.
Various config parameters are updated due to the change in xml id.

This commit is related to task ID 31399 .
2018-03-15 11:34:41 +01:00
Sagar Ahirrao 05e02059f0 [IMP] base: resize partner image with actual aspect ratio
Purpose of this commit is to finally stop adding extra padding to
website logo. Indeed not giving square logos lead to padding added
to images, leading to not so beautiful logo that makes people sad.

Before this commit
 * partner's image was resized to square 1024x1024. Extra padding was added
   if user provided rectangle image;
 * due to this website logo resized to square when rectangle logo provided;

After this commit,
 * sizes dict can be passed in image resizer of tools;
 * e.g. tools.image_resize_images(vals, sizes={'image': (512, 512),
   'image_small': (128, 128)})
 * image field in partner will resize with max width 1024 and height based
   on given image ratio (still image_medium, image_small will be default
   square images);
 * now website logo will respect actual aspect ratio

This commit is related to task ID 31994 . Future commits should probably
clean all that mess, but at least it seems we have something that works.
2018-03-15 11:31:06 +01:00
Parth Gajjar 964e16a7f5 [IMP] web: support famous 'avoid_if_small' parameter in image controller and qweb field options
Before this commit there was no option to avoid resizing images when it
was smaller than expected size. This leads to several image being displayed
with extra and unnecessary padding due to resize. This option will allow
to avoid that behavior by allowing to propagate the parameter directly
to image_resize_image.

This commit is related to task ID 31994 .
2018-03-15 11:30:53 +01:00
Yannick Tivisse 0eb58775c9 [IMP] hr: Add a specific marital status 'Legal Cohabitant'
Purpose
=======

Currently both 'Married' and 'Legal Cohabitant' are considered as the same thing.

We should separate these 2 marital status to have a more accurate information.
2018-03-15 11:18:19 +01:00
Nicolas Martinelli 642466fa20 [FIX] stock: picking in mobile view
- Switch to mobile view
- Go to Inventory > Delivery Orders > Create
- Add an item, save & close
- Save the picking

Error: impossible to save because a mandatory field is not set.

The kanban view used in mobile should not contain the `date` field,
which is not included in the view `view_move_picking_form`. Otherwise, a
`date: false` value is sent to the server.

opw-1816837
2018-03-15 11:15:30 +01:00
Jeremy Kersten 1227c8de28 [FIX] website_sale_comparison: fix comparison when 'list view variant' is enabled
Before this commit, when the user enable 'List View Variant' from the
customize menu, the add to compare failed.

This commit closes #23397
2018-03-15 11:13:11 +01:00
Jeremy Kersten 076b87134d [FIX] website_sale_wishlist: fix wishlist when 'List view of variants' is activated
When the view 'List view of variants' is enabled from the customize menu,
wishlist was broken and return traceback because product_id was null

This commit closes #23395
2018-03-15 11:13:11 +01:00
Jeremy Kersten 45c270ddd2 [FIX] website_sale_comparison: remove from compare queue when delete from list view
Before this commit, when you was comparing several products (/shop/compare?products=x,y,z)
when you had clicked on 'delete product y' from the top, that was comparing x and z; but
your compare queue continue to be x,y,z.

Now we delete from the compare queue the product y.

This commit closes #23532
2018-03-15 11:13:11 +01:00
Jeremy Kersten df13de780f [FIX] sale: fa coherence in portal
Done label was a copy/past from cancel tag (bad icon, bad color)

This commit closes #23594
2018-03-15 11:13:11 +01:00
Thibault Delavallée f2f2dfaf36 [DOC] test_mail: update some left query counters after 0f57bdba72
test_mail only counters have not all been updated. Those may be different from runbot as
some tests depend on installed modules. Let us update it.
2018-03-15 10:43:40 +01:00
Nicolas Lempereur 87c09b8ebc [FIX] account: false complete_tax_set tax default
When setting a chart of account on a company, we have default taxes from
the default chart of account different from chosen one.

But if a chart of account is chosen, it should override them in the
onchange_chart_template_id function. This works as expected for a
truthy complete_tax_set chart of account template, but not for a falsy
complete_tax_set chart of account template.

The complete_tax_set indicates that we don't want to set default taxes
and the user should do it or modify the given tax rates himself.

opw-1824751
closes #23655
2018-03-15 09:52:13 +01:00
Nicolas Martinelli 7d52d6e89b [FIX] crm: create opportunity from kanban
- Create a customer, set an address
- Create an opportunity from the kanban view

The address fields are not filled in in the opportunity.

We add all fields filled in by `_onchange_partner_id_values`

Complement of commit e2bbee6df5

opw-1816438
2018-03-15 09:14:52 +01:00
ougc27 935b6d6aab [FIX] base_address_city: add missing placeholder
for city and city_id fields
To be consistent with the other fields

Closes #23662
2018-03-15 08:59:06 +01:00
Yenthe V.G 101e0a7ef7 [ADD] l10n_nl: add Dutch states
Closes #23663
2018-03-15 08:50:38 +01:00
Jigar PatelandAaron Bohy 89050f61b7 [IMP] web_settings_dashboard,*: improve UX
*crm,project: css selector adapted in tours

This rev. improves the UX of the 'Invite users' and 'Pending
invitations' part of the Settings dashboard.

Task 32804
Closes #19531

Co-authored-by: Aaron Bohy <aab@odoo.com>
2018-03-15 08:32:43 +01:00
Goffin Simon b669c71aa3 [FIX] calendar: in multicompany user cannot access own calendar
Let's consider user1 and user2 allowed to access company1 and company2
In multicompany with shared partners unchecked in general settings,
if one of two users sharing the same event tried to access the event
when they are not in the same current company at this moment, an access error
was raised.

opw:1817475
2018-03-14 17:17:32 +01:00
Géry Debongnie 7287c672f5 [FIX] web: x2m: properly reset limit/offset to initial value
When we discard an element, we want to make sure that the new state is
not corrupted by previous user operations.  In our case, we possibly had
a limit and an offset values modified by the user.

This could lead to unpleasant situations, with incorrect data displayed
on the form view.

Note that this actually fixes a new bug introduced by commit
https://github.com/odoo/odoo/commit/e7fab234201e357da52c3576ad2e8fc9ceee9359
(this is the commit that introduces the tempLimitIncrement attribute)
2018-03-14 17:03:23 +01:00
Géry Debongnie 4586b876f2 [FIX] web: unselect current row before changing page
The issue here is quite simple.  If we are editing a multipage one2many
field, then we click on the pager, we need to properly unselect the
current row.

If we do not do that, then we can enter invalid data.  For example,
assume that there is a readonly field. We click on add, it creates a
(virtual) record with no value for that field.  When we click on the
pager, we select the next page, and bypass all validation.
2018-03-14 17:03:18 +01:00
Géry Debongnie 4fd9db52a2 [FIX] web: prevent issues with pager and x2m and limit
When we are in the process of adding a record, we do not want to update
the pager count.  The reason is that if the user is at the limit (so,
1-40/40, no pager visible), then click on add, there will be a pager
shown with 1-40/41.  Now, imagine that the record currently being added
as a required field, and the user clicks on the pager. In that case, we
need to discard the newly added record (bringing the total back to 40),
then move to next page, which does not exist anymore.

So, to fix this issue, we simply consider that a record being added
does not count, from the point of view of the pager.
2018-03-14 17:03:11 +01:00
Yannick Tivisse 1663133873 [FIX] purchase: Don't auto subscribe recipients on mail composers
Purpose
=======

During the refactoring of the purchase module something went wrong when overriding the 'send_mail' method.

The 'mail_post_autofollow' key should have been set into the context only for the purchase orders model.

See: https://github.com/odoo/odoo/commit/cb01be2#diff-fe8587929089e5fdb6c75687011b1c7eR822
2018-03-14 16:09:57 +01:00
Philipp BorgersandYenthe V.G 7dc30bf735 [ADD] l10n_de: add states of germany
Closes #18443
Closes #23656

Co-authored-by: Yenthe V.G <yenthevg@gmail.com>
2018-03-14 16:05:09 +01:00
Philipp Borgers def0f8b894 [CLA] signature for booo
Done at #18443
2018-03-14 16:05:01 +01:00
Goffin Simon 8df915da05 [FIX] payment: Payment integration with Authorized.net making double transactions
When making a payment with authorize.net by clicking on "Pay Now" in the shop, it was
possible to send several transactions for the same SO because the button "Pay Now"
was enabled before being redirected.

opw:1819588
2018-03-14 14:50:14 +01:00
Simone Orsi d9235a8f14 [FIX] base: update docstring
set_* methods are deprecated (cf warning in code below)
should use set_values instead

Closes #21171
2018-03-14 14:27:58 +01:00
Sergio Teruel Albert 76fbbe3af4 [IMP] base: propagate user_id when a contact is created
To keep the same saleman and improve consistency

Closes #21496
2018-03-14 14:20:38 +01:00
Christophe Simonis 69ebbeea06 [MERGE] forward port branch 9.0 up to f1608829a1 2018-03-14 13:48:57 +01:00
Nicolas Martinelli 19255ee260 [FIX] website_sale: image in carousel
- Create a product with 3 variants
- Put a picture on the template, then on all variants but the first one
  (the one with computed for field `product_variant_id`)
- Check "Multi image" setting in website config

In the product page of the eCommerce, the carousel is not displayed.

This is because the template only checks if the first variant has an
image in order to display the carousel. It should check all variants.

opw-1823242
2018-03-14 13:17:12 +01:00
Thibault Delavallée d7a7a01c82 [MERGE][REM] mail, various: remove mail-related dead or unnecessary code
Purpose of this merge is to remove
 * dead code related to mail features, like unnecessary overrides;
 * unnecessary subscription or message post that adds no value to the app
   while creating noise;
 * some deprecated code bits in mail;

Please see subcommits for more details. This merge is related to task
ID 61132. Closes #23624 .
2018-03-14 11:33:19 +01:00
Ivan Yelizariev 9fc44bef83 [IMP] web_tour: specify timeout per step
RUNNING_TOUR_TIMEOUT is equal to 10 seconds, which sometimes is not enough on
travis and we need a way to increase timeout per step.

Note: Exact same commit was already merged for version 11.0 here: 67e2372
Note 2: this is technically a IMP, not a fix, but I (GED) will accept this, since this should only impact the testing functionality.  Also, this was done in 11.0, so in some sense, it was proved to work.

(PR: #21750)
2018-03-14 11:31:55 +01:00
Thibault Delavallée e27e36cb63 [REF] mail: support only model / res_id in mail/view redirection controller
Currently mail/view controller supports either a message_id, either a
model/res_id . Using a message_id is just a shortcut to find its model and
res_id before redirecting to the record view. If the message has been
removed the controller does not work anymore although with model and
res_id it still works while the record exists.

Same functional behavior can be achieved with only model and res_id. Let
us drop support of message_id to lessen code size.
2018-03-14 11:13:28 +01:00
Thibault Delavallée 3003482a40 [REM] mail: remove unnecessary post on partner at user creation
Currently a message 'XX joined the Company network' is logged on the
user's partner profile when creating an user. This message is not sent
to anyone as it is a note. Moreover it does not add any value to the
discussion thread on partner profile.

Let us remove that code as it has no use.
2018-03-14 11:09:55 +01:00
Thibault Delavallée b4ecbcfaa3 [REM] mail: remove o_mail_note class in chatter
Purpose of this commit is to clean a bit various classes and conditions.

First clean is the removal of o_mail_note class in activities less. It comes
from first implementation of activity widget and is not used anymore in
activity widgets rendering.

Second clean is the removal of o_mail_note class when displaying messages.
Only o_mail_discussion is used currently in chatter to make a different
background depending on whether the message is a discussion or not. All
we have to know to differentiate message display is whether it is a
discussion done by an user or not.

Tests have been updated to use o_mail_discussion class triggered by
the message being a discussion, aka a comment posted by an user.
2018-03-14 11:06:32 +01:00
Thibault Delavallée 8de00fee31 [IMP] fleet: log standard creation message instead of unnecessary custom one
Currently a note is posted on the fleet with 'name has been added to
the fleet'. It is not really interesting as it is no notified to
anyone and it makes some noise. Let us therefore fall back on the
standard behavior.
2018-03-14 11:05:59 +01:00
Thibault Delavallée 2c6ea3cf45 [REM] mail: remove deprecated controllers follow, unfollow and new
Mail holds some controllers used notably in notification emails to allow
some action directly from email buttons. It is used for example to redirect
people to the right view when clicking on 'view document' button.

Some deprecated controllers still exist in codebase but are not used
anymore. The 'new' controller notably has been removed at df01742fc0 .
The '(un)follow' controllers have been removed recently at 11d2d30e91 .
Let us remove that dead code.
2018-03-14 11:05:11 +01:00
Thibault Delavallée a1870d9688 [REM] hr: remove user auto subscription on its employee and kanban follow CTA
HR employee model automatically adds the employee's user as follower of
its own employee profile. It has been done at 8ab3e5d2a1 probably
when working on gamification and twitter-like employee profile. In that
use case adding the employee's user as follower was required to be able
to discuss on the employee form view. It is also a requirement to be sure
he receives news about received badges.

Since then however employee profile has been set as private and internal.
It is used only for HR purpose which is coherent with the model and the
business flow of various HR modules. Moreover it has never been really used
as intended in gamification or as a twitter-like profile. It seems therefore
not necessary to automatically add followers to this record.

If required, any message_post can add the employee's user in the recipients
if its attention is required on some message. It required only to set the
target users's partner in the partner_ids parameter of message_post that
is propagated to the message creation and notification.

An override of notification process can also be removed. It seems people
wanted to add the user to its profile but without notifying him. Let
us remove all that crap.

Finally the CTA button to (un)follow employees directly from the kanban
view is also removed for the same reasons as state hereunder.
2018-03-14 10:58:05 +01:00
Thibault Delavallée 9581eb9c63 [REM] maintenance: remove dead code about responsible auto subscription
An override related to mail.thread auto subscription has been added in
maintenance application at 23a2bac3fa in 9.0. Since that version
however the field has been renamed to avoid confusion with user_id that is
generally a responsible with access rights to handle the document.

This code is therefore not necessary anymore and can be safely removed
without impacting any functional flow.
2018-03-14 10:57:28 +01:00