Commit Graph
135422 Commits
Author SHA1 Message Date
jerome hanke (jhk) fcc07467a2 [FIX] website: theme color palette based on primary or alpha
Steps to reproduce:
- install website
- install the theme "clean"
- go to website > customize > customize theme
- select the first "extra color" (alpha) and change it

Previous behavior:
All extra color that have not been set previously have changed
automatically without notice

Current behavior:
the theme is either showing primary/secondary colors or only "extra" colors
Good themes are supposed to enforce primary = alpha and secondary = beta
All extra color that have not been set previously change automatically but
an information tooltip shows up when you hover alpha to avoid confusion

opw-2180611

Forward-Port-Of: #46099
closes #49730

closes odoo/odoo#49789

X-original-commit: c9aada53b1e6b24da4e1fe9ac4d44db3ff8cacda
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-20 12:07:24 +00:00
Andrea Grazioso (agr-odoo) 4faf329def [FIX] mail: Fallback to default company logo instead of odoobot
For some specific report (i.e account followup report) the mail_message
sent will contains no company informations because it will be sent on
the partner context, so when generating the template the logo will be
retrieved from the route /logo.png?company=False which yield back the
odoo company logo.

Adding a default 0 allow to retrieve the company logo for the current
user

opw-2232184

closes odoo/odoo#49787

X-original-commit: eea99fe1e00eb2dbd2bbeaca3e2f09845b426267
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-20 11:35:08 +00:00
Anh Thao Pham (pta) 3bd345597f [REF] hr*: convert onchange methods to stored-editable computed fields
Impacted modules:
hr, hr_contract, hr_recruitment, hr_payroll, fleet, hr_skills, hr_appraisal, ....

Several onchanges have been converted to computed fields in the following modules :
    Community :
        - hr
        - hr_contract
        - hr_recruitment
        - hr_work_entry
        - hr_maintenance
        - hr_expense
        - hr_expense_check
        - hr_holidays
        - sale_expense
        - account_analytic_default_hr_expense

    Enterprise:
        - hr_contract_salary
        - hr_referral
        - hr_payroll
        - hr_payroll_expense
        - test_l10n_be_hr_payroll_account

There are still 2 onchanges with complex behavior that couldn't be converted easily:
- an onchange that updates "tz" (timezone) that is defined as a related field
  to "resource_id.tz". Apparently it is useless except to initialize the default
  value of "tz".
- an onchange that updates "name" that is defined as a related field to
  "resource_id.name".
  the applicant.

closes odoo/odoo#45414

Taskid: 2169099
Related: odoo/enterprise#8572
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-20 10:32:45 +00:00
Julien Mougenot f50c3298bb [FIX] web: set selection fields' default value in custom filters
Before this commit, the 'selection' fields were treated like 'char' fields in the
"Add Custom Filter" menu of the control panel's filter menu. This meant that their
value was defaulted to "".

Now, the default value of a selection field is its first selection value.

closes odoo/odoo#49772

X-original-commit: 62b62570725bc8eb3d3fa77fd1e8efd7a4fb5d2b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-04-20 09:28:21 +00:00
Kevin Baptiste b8a8ad27de [FIX] hr_holidays: "Everyone" view on calendar_event
Purpose
=======

Avoid to show to much information to leave responsibles.

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

- Dynamically add/remove the leave_manager_ids on the group
  group_hr_holidays_responsible, on employee creation/modification
- Retrict the available employees when creating a leave. For
  manager/users : Everyone. For responsibles: The employee for
  who the user is responsible. Otherwise: Only me.
- Don't obfuscate the leave name on employees for who I'm the
  responsible.
- Add a new SQL view for "Everyone" report. To select only the
  information we want to share instead of showing the hr.leave
  model directly.

closes odoo/odoo#47659

closes odoo/odoo#49765

Taskid: 2206862
Related: odoo/enterprise#9239
Related: odoo/enterprise#10021
X-original-commit: 781147dcaf1552b8f2ab687ed73034b8fd1f7352
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-20 09:19:48 +00:00
David Beguin 755e00bdcd [FIX] crm: reset auto probability if auto probability could not be computed
Or, in other words, set auto probability to 0 if no statistics yet.

Before this commit, if the automated probability could not be computed,
the automated_probability field on crm.lead was not modified.
That led to having leads stuck at 100% once won, even if going back to another
stage.
This happened only :
  - in an empty DB (no demo data) or
  - in a DB where the PLS cron had never ran and the PLS threshold was
    inactivated (=0).
Because, if the frequency table has never been built, we cannot compute the
automated probability.

After this commit, if the automated probability cannot be computed, we set
it by default to 0. If the probability and the automated probability was
aligned, probability is also set to 0.

Note: this could be an issue if both probabilities were aligned, then
someone deactivate the PLS cron and set the threshold to 0 (if not yet the
case), and clear the frequency table. (unlikely to happen but still..)
When updating updating a lead, we would lose the probability
-> auto proba set to 0 + proba set to 0 as they were aligned.

Task ID: 2232036

closes odoo/odoo#49766

X-original-commit: b43ecf73958273a126135966422112b90f9f12cc
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-20 08:49:26 +00:00
Thibault Delavallée fa55c0e963 [FIX] survey: fix quick access test
Purpose of this commit is to clean test that broke nightly recently.

Task ID

closes odoo/odoo#49759

X-original-commit: 61f9b05ccc61a7e00dc5cc43cb1f8196195bee60
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-20 08:17:50 +00:00
Nicolas Martinelli c4b3d5b814 [FIX] sale: quotation viewed email
According to some PO, the email is useless to salespersons.
According to salespersons, the email is very useful.

This reverts a26a010324

opw-2215123

closes odoo/odoo#49756

X-original-commit: 0709890357005e4c1b205816061c3ec1582ad16d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-20 07:20:32 +00:00
Goffin Simon 71f1b34490 [FIX] account: Invoice line account updated incorrectly
Steps to reproduce the bug:

- Let's consider the customer invoice journal J with the default credit account A1
- Let's consider a customer invoice I with one line L1
- On L1 is set account A2 and product P1
- Import on I a new line L2 with account A3 and product P2

Bug:

The account of L1 was changed by A1 instead of keeping A2

opw:2230808

closes odoo/odoo#49582

X-original-commit: 115a18a1cdecdc6d76920efdf323fb91f2f408ee
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-15 10:22:36 +00:00
Simon Lejeune 6c3ddc3ad0 [REF] mrp: bom not required on production order
task-2226404

closes odoo/odoo#49494

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-04-10 13:02:28 +00:00
jvm-odoo 0028cf7174 [FIX] board: fix creating wrong controllers
Issue

	- Install Dashboard & Sales
	- Add a graph & a list to the dashboard
	- Go in the dashboard

	Rendering ok

	- Click on a list item
	- Go back with the breadcrumb

	Traceback

Cause

	When going back with the breadcrumb
	we retrieve the previous view controller.

	https://github.com/odoo/odoo/blob/9400059073d7401789eb1a60d6a0ec6f58dfc66b/addons/web/static/src/js/chrome/action_manager_act_window.js#L457

	By restoring the board controller, we
	restore all the subcontrollers too.

	But the actual board renderer is re-creating
	controllers. This creates inconsistencies
	with the view.

Solution

	Remove the restored controllers

OPW-2232713

closes odoo/odoo#49728

X-original-commit: 4f3d818052d689da762d8afbf1789daaa3d39821
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-17 16:24:38 +00:00
Raphael Collet e7b98b811c [FIX] fields: screwing up cache when rounding monetary value
Consider a sales order with a single line.  Edit the sales order: remove
the line, and add another line with the same subtotal.  When saving, the
total of the sales order is 0.0.

Here is the explanation: the form view performs a `write` on the sales
order, and modifies the lines with a command `2` (remove line) and a
command `0` (create line).

After deleting the first order line, the cache is emptied, and a call to
`flush()` forces the recomputation of the total.  The value is computed
to be 0, and assigned to the field.  The assignment converts the value
for the cache, without prefetching the currency field (optimization),
and puts 0.0 in cache.  The assignment then converts the value for the
database, which prefetches most fields on the sales order: the cache is
now inconsistent and contains the old value V, while the database is
then updated with 0.0.

After creating the new order line, the total is once again recomputed.
Its value is V, and because the cache also contains that value, no
update is performed to the database, which remains at 0.0!

The fix consists in avoiding the prefetching of fields when accessing
the currency field to round a monetary value.

opw-2223134

closes odoo/odoo#49741

X-original-commit: 048ea2f20a0a2fa6d629cbe262cbbe765248d36f
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-18 09:46:33 +00:00
william 72c48efc99 [IMP] account: do not block user creation without CoA
During the onboarding, if Invoicing is installed but no chart of account
is set the field property_account_receivable_id and
property_account_payable_id prevent from validating a new partner
because they are required but not auto-filled, and the fields are not
visible if Invoicing is not installed.

closes odoo/odoo#49732

X-original-commit: 29c362b7c3353c2be11ab117f454d04ed9853f75
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-04-17 16:58:26 +00:00
Adrien Horgnies 5844d57a48 [IMP] l10n_fr: new CoA
closes odoo/odoo#49727

X-original-commit: 69e0a073968d07ed4e49f94190a30485f5369059
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-04-17 16:23:04 +00:00
Lucas Perais (lpe) 9edff7ebfa [IMP] *: don't format integers in the relevant cases
It is now possible not to format integers according to locale
This is particularly interesting and relevant when a number holds
some sort of code rather than a number

Task 2050119

*: base, fetchmail, l10n_cl

closes odoo/odoo#39767

Related: odoo/enterprise#6964
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-17 13:56:08 +00:00
Lucas Perais (lpe) 4c1feefd13 [IMP] web: Numeric fields can be non-formatted
This commit introduces a new option in fields inheriting from type Numeric
which is `format`.

By default, Numeric fields are formatted according to their subtypes and locale
Adding, in a view, the option format set to a falsy value
will prevent the field's value from being formatted.

```
<field name="int_field" options="{\'format\': false}"/>
```

Task 2050119
2020-04-17 13:56:08 +00:00
Julien Mougenot 7ace5a986a [FIX] web,lunch: separate search panel domain
Before this commit, the SearchPanel widget was given a single unified domain coming
from the view/controller. The issue was that some modules injected additional leaves
in this domain and there was no way to remove them/separate them from the original
view/controller domain.

Now, another paramater (the `viewDomain`) is given to the SearchPanel, containing
the distinct domain related to the view. The Lunch module has been adapted to give
the `location` domain through this new key.

Note that some tests steps had to be inverted since the method retreiving the
domain of the view/controller is asynchronous (needed by Lunch to give time to the
model to be loaded). It mainly concerns the RPC order which does not matter in this
case.

Task 2239706

closes odoo/odoo#49720

X-original-commit: e895e553899933be14c8abfd8c676b44a7f534d8
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-17 14:21:02 +00:00
Arnaud Joset b3149d84a0 [IMP] product: pricelist convert boundary dates to datetime
Before this commit, pricelist boundaries were dates. It was not possible to get a modified price at a precise time: e.g. modify the formula at 12h00.

closes odoo/odoo#49030

Taskid: 2221094
Related: odoo/upgrade#1055
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-09 14:52:31 +00:00
Sébastien Theys dea52493b8 [IMP] mail, sms, snailmail, test_mail_full: adapt mail.notification
The purpose is to have more common code for failure and notifications, with less
override in `sms` and `snailmail`.

task-2176017

closes odoo/odoo#44170

Related: odoo/enterprise#9140
Related: odoo/upgrade#918
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-04-17 12:17:57 +00:00
Lucas Perais (lpe) 69b51ce05e [FIX] translate: do not export OWL directive's attribute
Have a static template of the form:

```xml
<div t-name="ComponentA">
 <ComponentB title="no export" />
</div>
```
To be used by OWL (github.com/odoo/owl)
In this context, the title in the attributes of ComponentB
should not be considered as *the* title attribute of HTML
but as a sort of variable declaration

Before this commit, the string contained in the value of this
title attribute was exported. It was not translated at runtime,
but we want to export as less stuff as possible in PO files

So, after this commit, none of the attributes held by a OWL directive
are exported

This commit relies on OWL Syntax, which makes mandatory
for a component directive's first letter to be capitalized
https://github.com/odoo/owl/blob/master/doc/reference/component.md#composition

Also, it relies on the good practice and widespread convention to have
every HTML node lower cased
https://www.w3schools.com/html/html5_syntax.asp

closes odoo/odoo#46191

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-17 12:55:32 +00:00
Thanh Dodeur bf97152ce9 [REF] mail: removes signature from route params
This commit removes the unnecessary usage of `signature` instead of
`unique` in the route params for `web/image`.

closes odoo/odoo#48437

Related: odoo/enterprise#9501
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-04-17 11:09:41 +00:00
Thanh Dodeur a6e96c256d [FIX] mail: fetches the attachments checksum for cache control.
This commit makes so that we also fetch the checksum of the attachments
of mail.messages to use it for cache control.

Before this commit, the urls of message attachments had
`undefined` for the signature parameter.
2020-04-17 11:09:41 +00:00
Swapnesh Shah 6688f45470 [FIX] account: disable creation of account.payment from kanban view
Creating New records for account.payment from Grouped kanban should not be allowed as they are not consistent and Leads to error. (Eg, Try to create New Payment when grouped by State, Add new Column when grouped by Journal)

With this commit, We disable the creation of new Payment/Relational records from this view.

closes odoo/odoo#49619

X-original-commit: 6774f9cfe768e5cffce4cfd458910af450ef7616
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-04-15 18:39:02 +00:00
jerome hanke (jhk) 5eccc6a7df [FIX] board: calendar view height is not zero
Steps to reproduce:
- install calendar and dashboard
- go to calendar > favorites > add to my dashboard
- go to dashboard

Previous behavior:
the calendar view in the dashboard does not show the main widget
because height is 0px (because the structure is different that normal
calendar view where view height is restricted based on viewport).

Current behavior:
calendar views are properly displayed in dashboard

opw-2226565

closes odoo/odoo#49709

X-original-commit: d1218004aa0b4a1840c99346baef73bc5fbb90a1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-04-17 10:14:57 +00:00
Nicolas Martinelli a834a1b235 [FIX] stock: correct qty comparison
Use `float_compare` to avoid the usual float representation comparison
errors.

opw-2215497

closes odoo/odoo#49702

X-original-commit: 500240874cd21c6950210968c8c7e8d84c1c4bee
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-17 09:27:03 +00:00
Stéphane Debauche 4d843de26b [FIX] web: fix nested o2m edition traceback
There's a traceback when we edit an activity on a campaign

  * Create a child activity
  * Save the activity (not the campaign)
  * Edit again the activity
  * -> Traceback

Introduced in a9cebd5

Task ID 2220930

closes odoo/odoo#49698

X-original-commit: efa8952c39b0bcb0969013dc22e05b5d61ff1c66
Related: odoo/enterprise#9964
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-17 08:09:11 +00:00
Nicolas Martinelli 7c430846a8 [FIX] calendar: all day event
- Go to the calendar list view
- Click on 'Create'
- Tick 'All Day'
- Set a start date

The end date is set to the day before.

This happens because in this case, the default duration is zero.

opw-2236766

closes odoo/odoo#49682

X-original-commit: 0b6ae3ed4ff20898cd88b97a644190b20f11cf8f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-17 07:55:34 +00:00
Florian Gilbert 25f157efc0 [IMP] account: Verify if res_partner_bank exists in set_bank_account.
When creating or writing on a account.journal model,
it is possible to pass a char representing the bank account number
into bank_acc_number instead of passing directly a res.partner.bank.
In case we pass bank_acc_number the system will try to create automatically
a new res.partner.bank for us, however if a res.partner.bank already exists
with the same account number it will result in an error as we have a unicity
constraint for that. Therefore it is best to first seach for such an existing
res.partner.bank before trying to create it. The search is done on the
sanitized_account_number field as the unicity constraint is on that field.

closes odoo/odoo#49637

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2020-04-17 06:45:27 +00:00
Odoo's Mergebot 7e2971d080 [MERGE] mail, various: clean mail alias mixin usage
PURPOSE

Clean mail alias mixin use through addons and clean its code

SPECIFICATIONS

Remove unnecessary code overlap: duplicate of model computation
or alias definitions.

Remove alias creation relying on context and instead give a single
method to override giving alias creation values.

Go through all addons using aliases to clean its usage code.

Remove remaining alias fields on res.users, linked to a now removed
feature.

Finally make alias creation work in batch mode in mail_alias_mixin.

LINKS

Task ID 1919277
Community odoo/odoo#41160
Enterprise odoo/enterprise#6983
Upgrade odoo/upgrade#872

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-17 09:43:56 +02:00
ryv-odooandThibault Delavallée 186cfb5ebd [REF] mail: make alias mixin multi-enabled
Purpose of this commit is to allow multi-create in alias mixin by correctly
creating / updating aliases in batch.

Task ID 1919277
Community PR odoo/odoo#41160
Enterprise PR odoo/enterprise#6983
Upgrade PR odoo/upgrade#872

Co-Authored-By: Rémy Voet <ryv@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-04-17 06:52:09 +00:00
Thibault DelavalléeandRémy Voet 7cfd364db5 [REF] mail, various: clean usage of mail alias
Clean the usage of mail aliases and more specifically its associated mixin
`mail.alias.mixin` .

Stop using context for model of aliases, and correctly give model_id and
parent_model_id to the call chain through a cleaned code easier to override.

We also merge methods get_alias_model_name and get_alias_values in single one
called before record creation (alias first values) and right after (to have
values depending on actual record).

LINKS

Task ID 1919277
Community PR odoo/odoo#41160
Enterprise PR odoo/enterprise#6983
Upgrade PR odoo/upgrade#872

Co-Authored-By: Rémy Voet <ryv@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-04-17 06:51:46 +00:00
Thibault DelavalléeandRémy Voet 4b3589359b [FIX] crm, hr_recruitment: clean manual alias creation
Purpose of this commit is to clean manual alias creation by correctly giving
field values instead of relying on magic from model_name to model_id. Code
is more understandable now.

Task ID 1919277
Community PR odoo/odoo#41160
Enterprise PR odoo/enterprise#6983
Upgrade PR odoo/upgrade#872

Co-Authored-By: Rémy Voet <ryv@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-04-17 06:51:39 +00:00
ryv-odooandThibault Delavallée 4385ed024e [REM] mail: remove leftover mail alias fields from res.users
A mail alias is still linked with the res.users model with 2 fields, alias_id
and alias_contact (related). It is not used anymore. We can therefore remove
those fields.

Aliases were added at 052f2ace57 . Purpose was to be able to discuss with
users directly using Odoo as a mailbox. However it was not usable and was
quickly deactivated. Aliases on res.users was removed at 029d1baf35 . It was
decided at that time to not support alias on users anymore as it was creating
more issues than adding communication facility.

This commit finally removes the unused fields. If necessary in some custom
flow they can always be added through studio.

LINKS

Task ID 1919277
Community PR odoo/odoo#41160
Enterprise PR odoo/enterprise#6983
Upgrade PR odoo/upgrade#872

Co-Authored-By: Rémy Voet <ryv@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-04-17 06:51:06 +00:00
Kevin Baptiste e3189298cb [IMP] hr_contract: remove unused medic_exam field
The field `medic_exam` is not used anywhere and can thus be removed.

closes odoo/odoo#49631

Taskid: 2239321
Related: odoo/upgrade#1075
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-16 08:16:31 +00:00
Nicolas Martinelli 4f76f3526a [FIX] maintenance: Top Priorities
Use correct filter since it was renamed in 9a0fedfc65

opw-2238922

closes odoo/odoo#49687

X-original-commit: e427a1f097791900b79f08f1f7b8431b6d58d9fd
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-16 17:57:05 +00:00
Ravi Gohil 99447e28e7 [FIX] l10n_xx: fix bad default accounts for journals
l10n_hn:
Default Income Account set for product's category
is actually an "Expense" account, which is wrong.

l10n_sa:
Default Debit/Credit accounts for exchange journal
should not be same as of sales/purchase journal.
This is forbiden in future version by commit caeb7828.

Currently, this is the case here and this commit aims
fixing it.

closes odoo/odoo#49667

X-original-commit: 370f2d9ebda7eb3e52af8f55f466f4e66ab8140c
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-04-16 13:40:41 +00:00
Benjamin Frantzen (bfr) 63d0fea176 [FIX] account: reference field appear on account.move form
- Specifically, it did not appear for misc operations & credit notes
- Currency only appear if group_multi_currency
- Fix label for journal_id appearing based on group

closes odoo/odoo#49671

X-original-commit: 62e54cb8960cd84484d462dc8c7d7c1e89a9eacd
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-16 14:53:27 +00:00
Julien Mougenot f7a8f42113 [FIX] web: export/import form state with pure JS
Before this commit, restoring the previously active tab on a form view was done
through programatically clicking on the tab and letting Bootstrap handle the switch
itself. This caused some cases of race condition since the click handler is asynchronous.

Now, classes are applied manually and should not cause any concurrency issue.

closes odoo/odoo#49668

X-original-commit: 214b842cba030f451430ff0d8c3fc1868be515e9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-04-16 14:08:27 +00:00
jbm-odoo 14b9347343 [IMP] hr_timesheet: Move not yet invoiced timesheets when project changes
When we change the project on task, we change it also on
timesheet line if this line is not yet invoiced and if it
has no sale order line or the sale order line is the same
as sol of task.

closes odoo/odoo#45154

Taskid: 2169290
Related: odoo/enterprise#9471
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-16 14:07:30 +00:00
Ravi Gohil 691bd3c8a8 [FIX] l10n_no: set correct default purchase tax
25% rate is the default VAT rate and not 0%.

Encountered this bug when a test case failed for
Norway SAF-T PR, see odoo/enterprise#9724

closes odoo/odoo#49662

X-original-commit: 0d4fe47745d241b99a690c16554383a4e3c7c86b
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-04-16 13:09:42 +00:00
Michael Mattiello (mcm) f0aa343fe2 [REF] web,mail: use patchMixin and patch instead of utils.patch
This commit replaces the use of utils.patch by the new class patcher and
makes the renderers that are converted to owl patchable.

closes odoo/odoo#47700

Related: odoo/enterprise#9551
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-04-16 07:19:55 +00:00
Michael Mattiello (mcm) dcf9a4c38d [IMP] web: add es6 class patcher
This commit implements a new way to monkey-patch ES6
classes (for instance, Owl Components).

Usage
-----

odoo.module('module.BaseClass', function (require) {
    const patchMixin = require('web.patchMixin');

    // Define your class as usual
    class BaseClass {
        constructor() {
            this.foo = 'foo';
        }
        bar() {
            console.log(this.foo);
        }
    }

    // but export it like this to have a "patchable" version
    return patchMixin(BaseClass);
});

odoo.module('module.Patch', function (require) {
    // imports the "patchable" version
    const BaseClass = require('module.BaseClass');

    BaseClass.patch('key', T =>
        class extends T {
            constructor() {
                super();
                this.foo = 'patched foo';
            }
            bar() {
                super.bar();
                console.log('patched bar()');
            }
        }
    );
});

odoo.module('module.instance', function (require) {
    // imports the "patchable" version
    const BaseClass = require('module.BaseClass');

    const obj = new BaseClass();
    obj.bar();
    // if module.patch is loaded before this module the patch
    // will be apply and calling obj.bar() will log:
    // patched foo
    // patched bar()

    // You can unpatch a patchable class
    BaseClass.unpatch('key');
});
2020-04-16 07:19:25 +00:00
nia-odoo 5cc42022fc [IMP] hr_holidays: Allow to select start date for accruals for allocation
Currently it was not possible select start date for accruals
leave allocation. it was default taken as today's date.

So purpose of this task is to make start date field of accrual
time off visible so user do not have to wait until day to add a day off

In this commit, we make start date field of accrual time off visible with
default value as today and also check for the start date in cron method.

closes odoo/odoo#46811

Taskid: 2199326
Closes: #46811
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-27 10:12:23 +00:00
Romeo Fragomeli fbd1d7584a [FIX] tests,tools: remove unused code
Due to this commit: odoo/odoo@0ea67467b1 ( https://github.com/odoo/odoo/blob/0ea67467b1301b39a263a386a622e931784eb0de/odoo/tools/config.py#L521 )

the screencasts value is not a string anymore but a valid PATH.

So now you can't set '1', 'true' or 't' to force to have the
same directory as the screenshot dir.

Steps to reproduce:
odoo-bin ... --screencasts 1 (with a failed JS test to produce a screencast)

closes odoo/odoo#49665

X-original-commit: ab1bf59a3b78f3c0857755cb2439636b6df297c3
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
2020-04-16 13:28:07 +00:00
Romeo Fragomeli f91665ac66 [FIX] tests: ffmpeg don't use the right path for screencast
Screencasts were saved in the right directory (screencasts_frames_dir)
but the given path for ffmpeg was wrong (screencasts_dir) and it wasn't
possible to read theses files to make the video.
After this commit, we use the screencast_frames folder to read files.

Steps to reproduce:
Execute Odoo with these additional command:
--screencasts "folder_of_destination" --test-enable (with a failed JS test to produce a screencast)

X-original-commit: 0c0b7a656388d65de15796f07a3f4cc93028f1d7
2020-04-16 13:28:06 +00:00
Lucas Lefèvre 7e09f71ae4 [FIX] calendar: Aggregate field when grouped
Commit b0f1086 forgot that `read_group` supports
aggregation functions (e.g. "start:month") and that
`groupby` could be a single field or a list of fields.

+ add some tests

Task 2238100

closes odoo/odoo#49550

Related: odoo/enterprise#9878
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-15 11:14:52 +00:00
Victor Feyens 61267f3760 [FIX] repair: ensure the pricelist is in the right company
Default and onchange fallbacks don't consider the current company
when searching for a pricelist.

Forward-port of #46429

closes odoo/odoo#49650

X-original-commit: 812af92080648bdb7f7bb0e4e6aef55c6dc4b9d4
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-16 11:48:57 +00:00
Victor Feyens 6fd2d9b898 [FIX] product,website_sale: partner pricelist fallback
When no pricelist property is defined for a customer, we use a search as
fallback, without considering the current companies.

This means you can see the pricelist of company B as pricelist for a
partner, even with company A as main current company (if both company
are enabled in the multi-company widget).

Forward-Port of #46429

X-original-commit: 68040c92c8e09218641d823d690e0ce36dcdef30
2020-04-16 11:48:56 +00:00
Odoo's Mergebot f5a047955c [MERGE] website_slides(_survey): ease certification creation in eLearning
Purpose
=======

In eLearning you currently have to create a certification before adding it to
a course in front-end. This PR allows creation of certification in front-end
with pre-filled settings.

Functional Spec
===============

1. On a course, add content, type certification, you can choose an existing one
   (normal flow) or create a new one in the dropdown by typing a new survey
   name (new flow).
3. When submitting (Publish or save as draft), a certification survey, with
   pre-filled settings is created and linked to the slide.
   Pre-filled settings:
        * One page per question
        * Attempts limit : 1
        * Time limit : no limit
        * Scoring without answers
        * Passing score : 70%
        * Is Certification : True
        * Email Template : Certification: Send by email
        * Give Badge : False
4. After submit, the user stays on the Course Content.
5. A toaster is displayed in the top right saying:
    Toaster's Title: Certification created
    Content: Follow this link to add questions to your certification.
    <a>Edit certification</a>

A website editor can select a certification (if available) for the creation of
a slide.

This PR also includes various IMP for a better user experience as well as
some code cleaning

  * use badge level image as default badge image
  * force duration to be positive in upload slide widget
  * clean slide upload widget and controller code

See sub commits for more details.

Link
====

Task ID 1981399
PR odoo/odoo#43577

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-16 13:14:48 +02:00
Thibault Delavallée b72b29f990 [IMP] website_slides_survey: merge slides controller files
Two files holding slides-related controllers exist. Let us merge them in
a single one to simplify organization.

Task ID 1981399
2020-04-16 10:26:32 +00:00