Commit Graph
132168 Commits
Author SHA1 Message Date
Aurélien Warnon 34b1ceb942 [FIX] website_slides: fix slide.slide statistics compute method triggers
The slide.slide "_compute_slides_statistics" method is missing the 'slide_ids.sequence' trigger.
It should be specified for cases when one of the slide_ids changes category (determined by the
sequence).

This can cause some CacheMiss and seem related to nondeterministic errors on the runbot.

PR #40705
Task#2123711
Runbot build error ID 247

closes odoo/odoo#40867

X-original-commit: 1994f544694051a767ecda88a12dee5c5579add2
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2019-11-25 08:38:03 +00:00
fw-bot a561e4cb56 [FIX] web_unsplash: traceback on saving the product
before this commit:
when creating a product from frontend and editing the product and
delete image, it doesn't get any url thus generating the traceback.

after this commit: if url is not defined then return None from
ir.qweb.field.image field converter

task-2063293

closes odoo/odoo#40866

X-original-commit: 2efad751e66931fd25a41c1b7d46865bccbc774a
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-22 09:19:35 +00:00
Barad Mahendra 525ed1125f [FIX] digest: force recompute of all kpis each time-based run
Before this commit, the computation of kpi for last week, last 30 days and
previous period comparison was wrong due to cache. Indeed as first value
was in cache, other values were taken directly from cache itself instead
of recomputing each value based on start_date and end_date of the computation
timeframe.

As digest fields are computed fields used a bit off-side, let us manually
invalidate the cache before computing a kpi so that it correctly computes
the timeframe values.

Task ID 1883428

closes odoo/odoo#40861

Closes: #40834
X-original-commit: 2966ee59cabc2bbae91e4ac4701fc393bc3770ae
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-26 09:32:09 +00:00
mightyjol (jhk) 74111d1fbf [FIX]product:change pricelist fixed_price field from float to monetary
steps to reproduce:
-change decimal accuracy for "Product Price"
-create a price list with fixed price
-the fixed price field does not takes the decimal accuracy into account

this was working in V11 and V12
fixed_price was a float field like other price fields

previous behavior:
fixed_price is a monetary field
when setting up a fixed price for a pricelist, it takes into account
the precision from the current currency

current behavior:
fixed_price is a float field
when setting up a fixed price for a pricelist, it takes into account
the proper decimal accuracy setting ("Product Price")

opw-2121964

closes odoo/odoo#40807

X-original-commit: 27b90fc7389cfc7fe4a9f4f17dea74283a45af44
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-11-25 12:44:05 +00:00
Mohammed Shekha 7291021152 [FIX] web_editor: traceback on saving the product
before this commit: when creating a product from frontend and editing
the product and delete image and save edition, it throws traceback,
because ir.qweb.field.image doesn't get any url and due to which it
throws traceback.

after this commit: if url is not defined in ir.qweb.field.image field
converter then return None

task-2063293

closes odoo/odoo#40638

X-original-commit: 896127a6528fa59f7f385019e296acd5db585321
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-26 05:11:50 +00:00
Nicolas Martinelli b15b6e30e1 [FIX] sale_timesheet: remove group_by
- Group the SO list view by Analytic Account
- Go to a SO
- Click on the stat button 'Timesheets'

Traceback because the field `analytic_account_id` is not on Timesheets.

opw-2124539

closes odoo/odoo#40840

X-original-commit: 3f17dd36e8369c21e55009e5492438cb9f9ea53d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-26 07:11:27 +00:00
Julien Castiaux 3460b3ca15 [IMP] base_import: support multiple xlsx sheets
Excel can store data in multiple tables, each is called a sheet. Odoo
was only importing the first sheet making the process to import a file
containing multiple sheets cumbersome.

It is now possible to select the sheet in the import options. By default
the first sheet is selected.

closes odoo/odoo#40728

Task: 2043768
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-26 09:26:01 +00:00
Pierre Masereel 1bfcbe4b3c [FIX] point_of_sale: duplicate orders
When you create a pos order, it is possible that the request timeout or
the client loose the connection with the server, that will lead to not
have the server_id of the order sent to the server. So when the client
will try to synchronize the order again, it'll not send the server_id to
the server, and the server will create a new order which is a duplicate
of the one created when the client lost the connection.

To avoid this duplication, we are using the pos_reference to find if
there is an existing order like in 12.0 to avoid duplication.

closes odoo/odoo#40837

Task-id: 2127656
X-original-commit: cddf29e70008dc1fcb6ec41b4dfc739d4d06cf6d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-21 13:40:18 +00:00
Goffin Simon 5a72faf721 [FIX] hr_holidays: Impossible to allocate future leave type
Steps to reproduce the bug:

- Let's consider Today = 21/11/2019 and Employee E
- Create a new hr.leave.type LT and set a validity from 01/01/2020 to 31/12/2020
- Set mode = Free Allocation Request and Validation = No Validation
- Try to create leave allocations for LT

Bug:

It was impossible to create a leave allocation for LT because Today < 01/01/2020
So it was impossible to allocate future leave.
We had to wait the 01/01/2020 to make the allocation of LT leaves

opw:2126300

closes odoo/odoo#40815

X-original-commit: 2b1810daeb13bba8405b663cf401ffab6eba5e24
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-11-25 12:18:17 +00:00
Haresh Shyara a0e8135449 [IMP] l10n_nz: added GST101A tax return report
closes odoo/odoo#35373

Task: 2129257
Closes: 35373
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-11-26 06:38:07 +00:00
oco-odoo 382fe942dd [IMP] account: tax audit string: remove useless dependency to journal_id
closes odoo/odoo#40805

X-original-commit: c0f261fd241db628da2760423c08777393abfad7
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-11-19 14:07:12 +00:00
shivam shah 92cf2474a2 [IMP] base_automation,sms: Improve the interface of automated action
Below points are improved in automated action
- Set no_create on model_id, crud_model_id, partner_ids, and channel_ids
- Set widget many2many tags and change string for trigger_field_ids
- Rename 'Trigger Condition' to 'Trigger'
- Change on_change_fields into a many2many to ir.model.fields
- Set 'Hours' as default of field trg_date_range_time
- Rename label of crud_model_id to 'Target Model'
- Rename label of sms_mass_keep_log to 'Log as Note'
- On creation of template set the default model
- Hide the 'Security' tab
- Set no_create on fields resource_ref and col1
- Make 'value' readonly when col1 is not set
- Rename 'Link using field' to 'Link Field'

Task-2082503

closes odoo/odoo#39622

Closes: #39622
Related: odoo/enterprise#6515
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-11-26 07:35:34 +00:00
Nicolas Martinelli 22c7dc99f8 [FIX] stock: create lot in tree view
- Create a product tracked by lot
- Create a delivery picking

You are allowed to create a new lot for the product although the picking
type doesn't allow it.

This is because of the missing context key `active_picking_id` on which
`_check_create` relies:

https://github.com/odoo/odoo/blob/e5ee5e5b65f85d66c8d59594ead9eece172c4282/addons/stock/models/stock_production_lot.py#L50

opw-2128497

closes odoo/odoo#40813

X-original-commit: 6dd176cc585def93760bead364e23fa09cac72e1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-26 07:15:29 +00:00
jvm-odoo ee0199cac4 [FIX] website_sale: removing invalid product from the cart
Reproduce the issue:
- Install eCommerce app
- Publish a product to your website
- Add the product in your cart
- Unpublish/make unsellable/archive the product

The product is still in the cart and the checkout process can be done.

Cause: There is no check for invalid products before displaying the cart

This commit remove the invalid products while loading the cart.

OPW-2092541

closes odoo/odoo#40241

X-original-commit: ab9290e39c2d2b9eb6d6f9972c1c8b546263edfd
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-14 09:11:26 +00:00
67044d64cd [FIX] web_tour: consume tip with drag and drop
After the rainbowMan issue was fixed here: e5bc2e7, steps were consumed
on 'click' events. This caused an issue with the drag and drop event
(which breaks tour, because it is expecting a click event). If the user
dragged an element, thetip was not getting consumed as no click event
was triggered.

closes odoo/odoo#40819

X-original-commit: 3f458fe06e6a629edc72428eab749068c2eba1ba
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Priyanka Kakadiya <pka@odoo.com>
2019-11-25 13:58:22 +00:00
fw-bot 441c8b0e0d [FIX] website_blog: fix link addable on blog cover
A customer reported an issue when he tried to add a link on the
blog covers of his blog. The link is displayed as text and it's added
to all the covers.

![links on all covers](i.imgur.com/fuFu6op.jpg)

According to SBU, the user should not do this.

This commit prevents the user from editing a blog cover.

OPW-2119924

closes odoo/odoo#40816

X-original-commit: 576fe145941add48481ebbb066cd9715dc83fb55
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-25 14:31:41 +00:00
helly kapatel 355f99069a [FIX] mail: do not mention on archive users
Archived users are inactive, so we shouldn't be able to ping them.

Task-2046885

closes odoo/odoo#40814

X-original-commit: 8169e34a2230b9a2aff359dc6a69b59c04fc9908
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-11-25 13:02:10 +00:00
Nicolas Lempereur 7dcab8a08c [FIX] point_of_sale: pos order -> count of order
In the pivot view of report.pos.order that is a view mainly over
pos.order, the "Count" measure is a little rubish giving more or less
the number of different products in the grouped order lines.

With this changeset, we have the field "Order" as measure that allow us
to know the number of orders a grouping is corresponding to.

opw-2127275
closes #40723

closes odoo/odoo#40804

X-original-commit: 431114d4f574d0fe9df745a7696f73f941c42ad3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-22 15:42:02 +00:00
Victor Feyens 600d0707ae [IMP] *: use get_fiscal_position and not property_account_position_id.
And adapt to get_fiscal_position changes

closes odoo/odoo#40336

Related: odoo/enterprise#6840
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-11-20 14:42:07 +00:00
Victor Feyens 81245528d1 [IMP] account: get_fiscal_position returns a recordset 2019-11-20 14:42:07 +00:00
Victor Feyens 1197821583 [IMP] account: fiscal position little cleanup
* No api model for methods using self
* Use new orm abilities to cleanup map_tax method
2019-11-20 11:40:28 +00:00
Barad Mahendra 802817c925 [FIX] hr_holidays: consecutive leave date on out of office message
Before this commit, when a user was on leave, the out of office
message displayed the current leave-in-progress date-to.
This information was misleading when the user on leave used different
types of leaves, because other users would expect their colleague to
come back from vacation sooner.

For instance, suppose that user is on vacation on October from 18-22
(included), and from 25-28 (incl.), with a week-end from 23-24:

    +--------------------------------------+
    |          OCTOBER calendar            |
    +--------------------------------------+
    |   Mo.  Tu.  We.  Th.  Fr.  Sa.  Su.  |
    |                                      |
    |                                      |
    |          on-leave          week-end  |
    |   <-------------------->   <------>  |
    |   18   19   20   21   22   23   24   |
    |                                      |
    |        on-leave                      |
    |   <--------------->                  |
    |   25   26   27   28   29   30   31   |
    +--------------------------------------+

On November 20, other users would see "On leave until _November
22_ included", instead of _November 28_.

This commit fixes the issue by taking into account consecutive
holidays to compute the actual end date of vacation.

Task-2002525

closes odoo/odoo#38388

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-11-25 15:59:03 +00:00
Haresh Shyara fec56ce888 [ADD] l10n_id: introducing Indonesian localization
Added Chart of Accounts, taxes and other related data

closes odoo/odoo#40806

Task: 42243
Courtesy: www.vitraining.com
X-original-commit: 046f7039618d00a1b5d4a08e11b67e9788620bc6
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-11-25 11:59:11 +00:00
Xavier Morel 2ba8e1d3b1 [FIX] base: test_console_log_object broken if log level > info
If odoo is started with a log-level of "warn" of higher, the logging
record is not emitted at all and thus the handler added by assertLogs
has nothing to process at all. As a result the test will fail.

closes odoo/odoo#40802

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-25 15:19:08 +00:00
Victor FeyensandMichaël Mattiello 0eadc0aa5e [IMP] mail: better prevent activity type removal and add a fallback mechanism
Current activity types master data cannot be unlinked through a quite harsh
override of unlink using xml id existence, introduced at 2602642a78.
Some of them are real master data, other could be unlinked if users want it.
Finally custom activity types may cause errors when removed if used in some
side models like server actions or automated actions.

To allow more flexibility we remove the removal constraint and implement
a fallback mechanism. It is implemented in mail.activity.mixin when calling
activity_schedule(xmlid, ...). If the given xmlid is not found
_default_activity_type() specifies the default activity to use. It can
be overridden in modules if some specific behavior is wanted.

e.g.

def _default_activity_type(self):
    """Define a default fallback activity type when xml id not found
    only used in in activity_schedule() for now.
    """
    try:
        return self.env.ref('mail.mail_activity_data_todo')
    except Exception:
        return False

In this commit we also

  * restrict deletion of activity type (hr.plan and ir.actions.server);
  * fallback on default activity type if xmlid ref not found in
    activity_schedule;
  * correct calls to activity_schedule and replace some manual creation calls
    by activity_schedule;

Task ID 1961156
PR #39013

Related: odoo/enterprise#6238
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2019-11-25 14:17:31 +00:00
Mohammed Shekha b7983df87a [IMP] web: do not pass default_name in calendar create if false
`name` field can be required and falsy `data.name` should not be
added as default in context or it warns for missing required field.

Task-2052536

closes odoo/odoo#35880

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-11-25 15:09:58 +00:00
Hardik Prajapati c349e306df [IMP] mrp: disable quick create in calendar view for mrp.production
This commit disables quick create in calendar view for
`mrp.production`, because it uses name field for storing
`ir.sequence` and calendar quick create also uses `name` field to
create quick create record.

So in this case, even if user enters summary field, it will be replaced by
`ir.sequence`, thus quick create doesn't make sense here.

Task-2052536
2019-11-25 15:06:22 +00:00
Moisés López b7752b7794 [FIX] phone_validation: Switch phonenumbers from logger.warning to logger.info
It was discussed previously from:
 - https://github.com/odoo/odoo/commit/b79d05fff0cacb4d99ebc1b60f44d8dab757b806

I quote Olivier Dony commit message:

"""
Having it in INFO should be sufficient for its purpose, and will avoid
impacting all CI builds done on a system that does not have the lib
installed.

For the record, this is not a hard requirement because the lib was not
available in Debian stable packages at the time of release. It is only
enabled on demand for those who want the feature and can install it
manually.

Fixes #22426
Closes #22459
"""

closes odoo/odoo#40788

X-original-commit: 0394f5e95702087b38357070aad43f2b477c374e
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-11-22 19:41:28 +00:00
Aurélien Pillevesse 161ceea324 [IMP] account: unify the terms
Use the same "Refunds" term as in the other menus

closes odoo/odoo#40704

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-25 14:08:05 +00:00
Aurélien Pillevesse faee632ff7 [CLA] signature for AurelienPillevesse 2019-11-25 14:08:05 +00:00
Hardik Prajapati 7d3970447b [IMP] l10n_fr: Add account tags in CoA for Cash Flow
==================
Before this commit
==================

No tags in account templates in CoA for Cash Flow Statement

=================
After this commit
=================

Tags Operating Activities, Financing Activities, Investing &
Extraordinary Activities Link to respected accounts

Related to task: #1973937

Closes #33256

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-11-25 13:22:50 +00:00
Swapnesh Shah df175f7716 [IMP] product_margin: remove create and edit from views
Create and Edit Buttons are not needed on views being opened from
the Product Margin report

Fixes odoo/odoo#39069

closes odoo/odoo#39072

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-25 13:16:38 +00:00
d49e6b91a7 [FIX] fields: do not prefetch fields translated with a callable
This is a performance fix.  It avoids the cost of XML/HTML translations
for fields that may not be necessary when prefetching fields on records.
This patch marks such fields as non-prefetchable by default.

The code that changes the attribute `translate` on HTML fields (from
`translate=True` to `translate=html_translate`) has been adapted to
allow the setup of textual fields to mark the field as non-prefetchable.

Jairo Llopis made a comparative benchmark: evaluating `name_get` on
`event.event` records.  The method needs the field `name` and without
the patch, the prefetching mechanism reads the translated HTML field
`description` as well.  This patch speeds up the benchmark from 5800ms
to 800ms (see https://github.com/odoo/odoo/pull/37967#issuecomment-538364011).

closes odoo/odoo#40771

X-original-commit: e5ee5e5b65f85d66c8d59594ead9eece172c4282
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Pedro Baeza <pedro.baeza@tecnativa.com>
Co-authored-by: Jairo Llopis <jairo.llopis@tecnativa.com>
2019-11-25 09:04:19 +00:00
Odoo's Mergebot 305c06470e [MERGE] survey: reorganize module to prepare future improvements
PURPOSE

Purpose is to perform some cleaning in survey models: naming, ordering,
dead code [0]. As new features are about to land in survey, notably live
interactions [1] and new survey building [2] performing a pre cleaning
is necessary [3].

SPECIFICATIONS

This merge contains three commits doing

  * code move;
  * dead code removal;
  * templates split to ease understanding and reading;

See sub commits for more details.

LINKS

[0] Related to Task ID 2144393 (surveys split / cleaning)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)
[3] Task ID 2061901 (survey models cleaning and preparation)

PR #40623

Related: odoo/enterprise#6853
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-25 14:00:19 +01:00
fw-bot d79457a998 [FIX] sale: do not validate quotes on tx amount mismatch
The title says it all -_-

closes odoo/odoo#40257

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-11-25 10:54:12 +00:00
Nikunj Ladava ff9efe7039 [IMP] l10n_no: change report format to rf-0002
Integration with new financial reports rf-002 in Norwegian localization

task- 1969011

closes odoo/odoo#37357

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-11-25 11:14:26 +00:00
Robin Heinz daf6db970d [IMP] point_of_sale: cash closing difference visible
When a pos session is closed, the difference and transactions of cash
control are not good anymore, because it is based on the statement
linked to the cash payment method, and it is modified during the
validation of the session to create a balanced account move.

So we are now storing the values in fields, to keep history of the
closing control

closes odoo/odoo#35286

Task-id: 2032173
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-11-25 11:00:04 +00:00
Thibault Delavallée ca1c975d78 [REF] survey: split templates into main files and rename templates
PURPOSE

Purpose is to perform some cleaning in survey models: naming, ordering,
dead code [0]. As new features are about to land in survey, notably live
interactions [1] and new survey building [2] performing a pre cleaning
is necessary [3].

SPECIFICATIONS

Remove dead code :

  * split templates into 3 main files

   * survey_templates: holding main templates when taking a survey;
   * survey_templates_statistics: graph and statistics (results) of a survey;
   * survey_templates_management: templates linked to corner cases and
     error management (403, closed survey, ...) as well as tools and utility
     templates;

  * rename template ids to ease code understanding;

No functional changes should occur with this commit. It contains only
code move, not any change at all.

LINKS

[0] Related to Task ID 2144393 (surveys split / cleaning)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)
[3] Task ID 2061901 (survey models cleaning and preparation)

PR #40623
2019-11-25 09:48:23 +00:00
Thibault Delavallée b6bbe5171c [REF] survey: remove dead or duplicated code
PURPOSE

Purpose is to perform some cleaning in survey models: naming, ordering,
dead code [0]. As new features are about to land in survey, notably live
interactions [1] and new survey building [2] performing a pre cleaning
is necessary [3].

SPECIFICATIONS

Remove dead code :

  * old code bits not used anymore since several code cleanings have
    already been performed;
  * use tools when possible instead of manually checking stuff like
    email validation;
  * clean unused imports;

No functional changes should occur with this commit. It contains only
code move, not any change at all.

LINKS

[0] Related to Task ID 2144393 (surveys split / cleaning)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)
[3] Task ID 2061901 (survey models cleaning and preparation)

PR #40623
2019-11-25 09:48:16 +00:00
Thibault Delavallée 1a8c1fd8ce [MOV] survey: reorganize a bit code and files
PURPOSE

Purpose is to perform some cleaning in survey models: naming, ordering,
dead code [0]. As new features are about to land in survey, notably live
interactions [1] and new survey building [2] performing a pre cleaning
is necessary [3].

SPECIFICATIONS

Code move main points

  * move fields to have them grouped by main use;
  * move methods to have them grouped by main purpose;
  * reorganize some line breaks to ease reading files;

Globally this code move is done according to our famous guidelines.

No functional changes should occur with this commit. It contains only
code move, not any change at all.

LINKS

[0] Related to Task ID 2144393 (surveys split / cleaning)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)
[3] Task ID 2061901 (survey models cleaning and preparation)

PR #40623
2019-11-25 09:47:36 +00:00
Holger Brunn 67848457d0 [FIX] auth_ldap: encode python ldap's output as utf8
Non-ascii characters in LDAP don't cause a python unicode string in
returned ldap entries, this commit fixes this.

Before this commit, further string operations on ldap values with
non-ascii characters fail.

closes odoo/odoo#40761

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-25 08:50:09 +00:00
715c136cd2 [IMP] web: add column creation support for kanban view on mobile
On mobile, there was no way to create a new column in the kanban view. This
was specifically annoying in the Project app (the user was able to
create the project but couldn't set its stages).

This commit enables this feature by adding a `+` icon at the end of the
tabs. This button opens a quick-create column widget.

If there is no existing column (for example in a newly created project),
this quick-create column widget is opened by default.

Finally, this commit improves the processing needed for the swipe
animation between the columns.

Task ID: 1893137

closes odoo/odoo#40722

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Co-authored-by: Ankit Sathvara <asa@odoo.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Romain Estievenart <res@odoo.com>
2019-11-25 09:29:39 +00:00
fw-bot 40e8834b00 [FIX] project: invalid date format in kanban view
Reproduce the issue

    - Install Projects
    - Create a project
    - Create a task with a deadline

    The deadline format is correct in the form view but not in the
    kanban view.

Cause

    In the kanban view, there is some code applied on the `date_deadline`
    field to add a class when the deadline is near.

    As it uses a `span` with a `t-esc`, the only way to get the date
    is to do `record.date_deadline.raw_value` which return the raw
    value of the datetime object (a big string with all the infos).

This commit creates a char field for the formatted date and uses it
only for the display.

OPW-2122928

closes odoo/odoo#40707

Related: odoo/enterprise#6832
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-25 08:07:43 +00:00
Carlos Dauden 74d1d7cf36 [IMP] sale: Improve performance with personal order lines rule
closes odoo/odoo#40592

X-original-commit: d8bc17d5f79a96c3f5ad928075387751e96cb7e4
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-11-20 20:13:04 +00:00
Denis Ledoux c03e4cb229 [FIX] models: validate standard views set to noupdate in database
On the registry, the set `loaded_xmlids` maintains the list
of the xml ids loaded during a module upgrade.
(The <record/> nodes in XML data file)

According to the `noupdate` attribute on the node in the XML file,
an XML ID is added to the listn either:
 - If noupdate is set on the <data/> node, through `_load_xmlid`:
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/tools/convert.py#L505-L510
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1802
 - If noupdate is not set on the <data/> node, through `_load_records` and `_update_xmlids`:
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/tools/convert.py#L578
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/models.py#L4048-L4050
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1793
   For this second case, `_update_xmlids` was called only when the condition
   `to_create or to_update` was met.

For records not set as `noupdate="1" in the XML data file,
but set to noupdate in the database
(e.g. manually set by a user),
the code goes trough the second path explained above (noupdate not set on the <data/> node)
and the condition `to_create or to_update` was not met
(See https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/models.py#L4005-L4012)
and they were therefore not added in the set `loaded_xmlids`

Besides, the method in charge to validate standard views `_validate_module_views`,
only validates views that are in this list `loaded_xmlids`:
https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_ui_view.py#L1194-L1210

And the method in charge to validate custom views `_validate_custom_views`
only validates views with no XML ID or the module of the XML ID is not within the list of modules.

Therefore, standard views set to noupdate in database were not validated at all
(or indirectly, if they had a view inheriting on them that was not set to noupdate)

This is not a recent regression, this is the case even in Odoo 8.0.
Standard views set to `noupdate` in database but not in the XML files
were not validated (or indirectly, through one of their inherited views if they had any)

This revision just skips the test `to_create or to_update` so it goes through
`_update_xmlids` anyway and add the xml id to the `loaded_xmlids` set,
so standard views set to noupdate in database finally gets validated.
Besides, `_update_xmlids` won't do anything more than add the xml id to the set,
the SQL query executed in this method has a `WHERE` condition filtering out xml ids set to noupdate
https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1784

closes odoo/odoo#40207

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2019-11-13 13:58:19 +00:00
Odoo's Mergebot 16891269ed [IMP] hr_holidays: Add specific approval for allocations
Purpose
=======

We want to allow different approvals for allocations and leaves of a same type.

e.g. In case of compensation days, a manager would approve the
allocation request, but would later not approve leave requests.

Specification
=============

Allocation modes
----------------
No change here except renames.
1. No limit (employee doesn't need an allocation to request a leave)
2. Allow employee requests
3. Fixed by Time Off Officer

Allocation approval
-------------------
A radio field to choose the approval mechanism
appears if the employee is allowed to request an allocation.
The following approval modes are possible:
1. Time Off Officer
2. Employee's Time Off Manager (leave_responsible_id)
3. Employee's Time Off Manager and Time Off Officer

These options are the same as leave approval options
(except the missing "No Validation").

If option 1 or 2 is selected, a o2m field should
allow to select which Time Off Officer is responsible
for approving those allocations.

Allocation approval policy is the same as the leave approval policy.

Task id: 1936742

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#35446

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-25 11:56:25 +01:00
alt-odoo ab60da1269 [FIX] gamification: prevent division by zero in percentage completeness computation
We are initializing over the limit to make sure we will compute it at least once.
If the target goal is set to 0, we are facing a division by zero error when
displaying the gamification goal just after initialization.

closes odoo/odoo#40735

X-original-commit: 24546e7c4cac61efea8d3f9e558518a55ef9acd2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-22 16:57:21 +00:00
Victor Feyens c8e6362e60 [FIX] purchase: section and notes
Do not update the date_planned of section/note purchase lines when
writing on the order date_planned.  Otherwise the SQL constraint
ensuring display lines have no other data blocks the changes.

Fixes #40741

closes odoo/odoo#40747

X-original-commit: f3ebab6eb52e3dc8be1f030aecfff348a22f7e09
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-11-23 15:30:34 +00:00
jbm-odoo 77e4c64fd7 [FIX] mail: Limit emojis quantity
If the user put more than 200 emojis, we didn't replace emoji with
image. But due to a typo in the code, this mechanism broke the
discuss application.

closes odoo/odoo#40734

X-original-commit: 0877cb6c84c768bd9fad46fa6f959635bb2353a5
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-11-22 16:46:10 +00:00
Lucas Lefèvre c2eef0cace [IMP] hr_holidays: Unifies leave and allocation name
Some changes were made at leave names in eb02e9b.
This commit applies the same behavior for allocations.
2019-11-22 16:58:38 +01:00