Commit Graph
140847 Commits
Author SHA1 Message Date
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
Lucas Lefèvre a9eed139b4 [IMP] hr_holidays: Find leave responsible
For each leave, a responsible is found to assign him activities.
For 'employee' leaves, a complex (and always changing) policy is
implemented.
This policy should not be applied for other types of leaves.
e.g. department, company, category.

For those type of leave, the current user should be responsible
for the approval.

Also, why was the default responsible the super user?
It was creating activities for an inactive user, hence no one
was notified to approve the leave.
Better to fallback on the current user.
2019-11-22 16:58:38 +01:00
Lucas Lefèvre 8f3a5068ca [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

Access rights based on task 1950998
2019-11-22 16:58:38 +01:00
Andrea Grazioso (agr-odoo) 5e9a4c39bd [FIX] mail: make attachment filtering selective on uid
Install Accounting, go to Configuration > Follow-up Levels. Create a new
Follow-Up Action with low due days just to make testing easier and "Join
open invoices" enabled. Go to Customers>"Follow-up Reports", select a
follow up report with action "test", click on "Send Email"

The email will be sent, without attachments. There should be a number of
attachments equal to the number of due invoices, but for security reason
the attachments are filtered in the message post processing phase.

Changing security check to avoid filtering legitimate material.

opw-2116803

closes odoo/odoo#40726

X-original-commit: 6258c7eba905ee0d9591573dc8b0c90e6dc7111e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-11-22 15:49:48 +00:00
fw-bot ba8ea74a4f [FIX] l10n_it_edi: remove 'Send' button from Customer Invoices
'Send' button meant to send Italian e-invoices are shown
for invoices belonging to non-Italian companies as well.

Since the invoices' are being sent on validating the
invoice itself, Send button means less business here.

Hence removed it.

opw-1945836
closes #31470

closes odoo/odoo#40736

X-original-commit: 633b931d4565b7e81ef69f6554a0a69b002b78e3
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-11-22 17:19:32 +00:00
Nicolas Martinelli c52f91a588 [FIX] l10n_be_edi: error at PDF generation
An UBL invoice can contain several `AdditionalDocumentReference`, some
of them without `Attachment`. For example:

```
  <cac:AdditionalDocumentReference>
    <cbc:ID>UBL.BE</cbc:ID>
    <cbc:DocumentDescription>BOB50  6.07.0</cbc:DocumentDescription>
  </cac:AdditionalDocumentReference>
  <cac:AdditionalDocumentReference>
    <cbc:ID>Facture N°19090118 - 30-09-2019.pdf</cbc:ID>
    <cbc:DocumentDescription>CommercialInvoice</cbc:DocumentDescription>
    <cac:Attachment>
      <cbc:EmbeddedDocumentBinaryObject filename="Facture.pdf" mimeCode="application/pdf">JVBERi0xLjMK...
...
```

In this case, a crash occurs since:

```
element.xpath('cac:Attachment//cbc:EmbeddedDocumentBinaryObject', namespaces=namespaces)
```

is an empty list.

To avoid this, we loop on all elements and generate all PDFs.

opw-2128083

closes odoo/odoo#40721

X-original-commit: 2174e4066c5c8f87ed45aa564c184d1ce7063758
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-22 14:58:35 +00:00
Yannick Tivisse 26e32dac34 [IMP] portal: Partial revert of #37312
Purpose
=======

This fix makes no sense because it exposes some private data to
portal users. Fortunately it was only introduced in the master branch.

closes odoo/odoo#40710

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-22 14:45:22 +00:00
Odoo's Mergebot 368fde4704 [MERGE] gamification, website_slides{_survey}: add certification badges section to ranks badge page
This merge adds a section to distinguish the certification badges from the
other badges users may obtain in eLearning. Certification badges are available
on the ranks page, linked to a running survey. Clicking on them directly
redirects into the linked course.

Other commits in this merge include

  * renaming a category field on challenge to challenge_category to ease
    its finding in code;
  * renaming some statistics fields on badge model to ease its understanding;
  * various usability improvements and fixes;

Task ID : 1961053
PR #32594

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-22 19:18:38 +01:00
David Beguin c11267d435 [IMP] survey: add certification badge demo data for MyCompany Vendor survey
Purpose is to have bioutifoul demo data.

Task ID : 1961053
PR #32594
2019-11-22 15:32:10 +00:00
David Beguin 5ac64d6e02 [IMP] website_slides_survey: add certification badges section to ranks badge page
This commit adds a section to distinguish the certification badges from the
other badges users may obtain in eLearning. Certification badges are available
on the ranks page, linked to a running survey. Clicking on them directly
redirects into the linked course.

Task ID : 1961053
PR #32594
2019-11-22 15:30:53 +00:00
David Beguin 1f52435966 [FIX] website_slides_survey: redirect to course on certification click in profile page
Back2basic-like: purpose is to allow people to go from a frontend certification
card on profile to its linked course page.

Task ID : 1961053
PR #32594
2019-11-22 15:13:41 +00:00
David Beguin 21cdbd82e9 [IMP] website_slides_survey: keep challenge category updated
Purpose of this commit is to ensure challenge linked to surveys linked to
slides have ``slides`` category, while challenge linked to surveys not
linked to slides (if changing survey_id for example) have ``certification``
category.

With this patch challenges are correctly categorized, allowing to accurately
filter them based on their category.

Task ID : 1961053
PR #32594
2019-11-22 14:46:00 +00:00
David Beguin be3f074a91 [REF] gamification, * : rename challenge.category into challenge.challenge_category
To ease grep in the code, especially that challenge is quite heavily used.

Task ID : 1961053
PR #32594
2019-11-22 14:45:39 +00:00
David Beguin 6f0d36fa67 [REF] gamification : rename stat_* fields into granted_* to ease understanding
In this commit we rename stat_count into granted_count, and stat_count_distinct
into granted_users_count to reflect more what are those variables, aka count
of granted badges.

Task ID: 1961053
PR #32594
2019-11-22 14:44:39 +00:00
William Henrotin d813873f6c [FIX] mrp: convert quantity in product UoM
If a component is used in a production with another unit of measure
than it's one, the created stock move line could not convert the quantity
correctly.
If there is enough quantity in stock, the created move line takes the
quant uom but the quantity in the production ones.
ex: consume 1 dozen, the quantity on the stock move line is 1 unit

This commit always uses the wo line's UoM and quantity to create the
stock move line.

closes odoo/odoo#39222

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-22 12:39:52 +00:00
William Henrotin 1efe2fc953 [FIX] mrp: load move_finished_ids in view
Issue: open a done production. Unlock it. Add a new raw stock move.
This action will called _compute_order_finished_lot_ids on the new
stock_move. This method uses
move.raw_material_production_id.move_finished_ids.
raw_material_production_id is available but not move_finished_ids. The
reason is move_finished_id is not loaded by the web client in the
production form view.

This commit added the one2many (invisible) in the view in order to
get all the information in the compute method.
2019-11-22 12:39:52 +00:00
William Henrotin 6b4f447de9 [FIX] mrp: consumption required 2019-11-22 12:39:52 +00:00
William Henrotin 043d706784 [IMP] mrp: beautify bom line form
This form is mostly used in the 'Cost Analisys report' (mrp_account_enterprise module)
and needed an update to better integrated with the report

Task : 2082448
2019-11-22 12:39:51 +00:00
William Henrotin 58df6c86e0 [FIX] mrp: new stock move line in traceability report
Before this commit, The addition of new stock move lines in a
finished production via the unlock button did not impact the
traceability report. This was due to the fact that the new sml
has not been linked to the finished_lot_id.
2019-11-22 12:39:51 +00:00
William Henrotin e1f518bb83 [IMP] mrp: add components in workorders
This commit extend the flexible consumption. On the workorder form view.
It's now possible to add directly new workorder line with any product
(even one not in any BoM line). For those new wo line. A confirmed stock
move is create in the record_production step.

Task : 2082448
2019-11-22 12:39:51 +00:00
Pierre MasereelandRaphael Collet e85faf3986 [IMP] base: add unique constraint on ir.property
There is no unique constraint on the properties to avoid having two
properties for the same field, company and res_id.

Having two properties for the same field, company and res_id, leads to
inconsistencies through the code, as reading a company-dependent field
nondeterministically returns one of the available property value.

So now, before creating a property, we have to check that there is not
already a value for the field, company and res_id and write or create
depending on if it is already exists.

The properties of specific records already satisfy the constraint thanks
to the implementation of company-dependent fields that use the method
`set_multi`.  We added a method `set_default` to set generic properties,
and its implementation does the right thing.  It also simplifies the
code to set such properties, by the way.

closes odoo/odoo#40473

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2019-11-22 12:34:43 +00:00
svs-odoo 8821f0e917 [FIX] stock: set serial count to generate SN
Before this commit, the field `next_serial_count` in stock.move, used to
know how many SN the user wants to generate, wasn't correctly set and
was always equals to 0.

closes odoo/odoo#40714

X-original-commit: 9a20896eddb6b98b569f4f83192ac876696baaa6
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-22 14:06:50 +00:00