Commit Graph
135383 Commits
Author SHA1 Message Date
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
Florent LejolyandDavid Beguin 24033e4aaf [IMP] website_slides,_survey: allow certification creation at frontend
Purpose
=======

Before this commit, in the front end, you had to create a certification before
adding it to a course. This commit 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.

Task id: 1981399
PR #43577

Co-Authored-By: Florent Lejoly <fle@odoo.com>
Co-Authored-By: David Beguin <dbe@odoo.com>
2020-04-16 10:26:32 +00:00
David Beguin dd53c515c8 [IMP] website_slides: force duration to be positive in upload slide widget
To avoid user to set a negative duration on slide they upload using the
upload widget, a min=0 has been added to the duration input of that widget.

Task ID 1981399
PR #43577
2020-04-16 10:26:32 +00:00
David Beguin e52489bf99 [IMP] website_slides: lint and clean slide upload widget and controller code
This commit prepares the next ones from same PR and only clean the code of
slide upload widget + website_slides controller.

Task ID 1981399
PR #43577
2020-04-16 10:26:32 +00:00
David Beguin 45f7463e7a [IMP] website_(profile, slides): use badge level image as default badge image
Before this commit, if no image was set on the badge, no image was shown when
displaying the badge.

After this commit, if a badge level is set on the badge and no image is set,
the badge level image will be used for the badge.

This fix / improvement is applied twice

  * when displaying an user profile, its received badges;
  * when displaying current user achievements in eLearning;

Task ID 1981399
PR #43577
2020-04-16 10:26:32 +00:00
Thibault Delavallée 16e492860b [FIX] website_slides_survey: fix ACLs for eLearning officers reading surveys
Commit 90bf317c01 added read rights on survey for eLearning officers.
Reason is that they should be able to link surveys to slides, notably to create
certifications in eLearning.

However in backend eLearning officers cannot access any survey form view as
rights on sub models are not granted. We fix that by correctly giving a read
access on survey sub models to eLearning officers.

They are therefore able to read survey results and statistics. It makes sense
as they are linked to marketing teams. They have no modification rights as
those are limited to survey users / officers.
2020-04-16 10:26:32 +00:00
Thibault Delavallée d998c29ae8 [FIX] website_slides: fix upload without category
This commits fixes 6d9b367a79d09d3d7a9dde890ca651aa09b93987 that fixed 0a980d4be6300fbc888dcc9daf760a48c1b0ec32 that fixed dc9fa6e2166ad803c91ca4f3e3e17b8065eeee82 .
Amazing.
2020-04-16 10:26:32 +00:00
Victor Feyens afa193c02b [FIX] sale_management: consider timezones for quotation validity days
The validity_date and/or remaining_validity_days fields on the sale
order
could be wrong due to different timezones.

Furthermore, using datetime.now to create a date is unnecessary.

closes odoo/odoo#49639

X-original-commit: 40e0c39fb410d018d007f2c70c12daf4289d2370
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-16 09:54:44 +00:00
Kevin Baptiste b83e783700 [IMP] snailmail: confirm sending first letter
Show a confirmation dialog when a user is sending the very first letter.

=========
 Purpose
=========

It happens from time to time that a letter gets sent by accident to a
final customer. This situation is always a bit problematic and is
usually only uncovered when it is too late.  Having an additional
warning when sending the very first letter should help avoid that kind
of issue.

================
 Specifications
================

Display the following warning when the user tries to send a snailmail
letter for the first time (from an invoice or from a follow-up report):
'You are about to send this invoice/follow-up report by post. Are you
sure you want to continue?' Confirm/Cancel

closes odoo/odoo#47861

Taskid: 2215091
Related: odoo/enterprise#9326
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-16 09:36:04 +00:00
Samuel Degueldre 0b0690a393 [IMP] website, web: add fullscreen mode and frontend keyboard shortcuts
While the edit mode interface is full of useful things, it also adds a
lot of clutter, and alters the page's width and thus, its layout. This
commit adds keyboard shortcut for website editors to use, and allows
them to enter a "fullscreen" mode that hides the editor interface while
remaining in edit mode, allowing the user to have fewer distractions
while editing text content, and a closer rendition of the page's final
layout while editing.

For this, keyboard shortcuts were required, and a few other useful
shortcuts have been added, such as alt-1,2,3 for the navbar, just like
in the backed.

task-2126915

closes odoo/odoo#46953

Related: odoo/enterprise#9295
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-16 09:45:58 +00:00
Victor Feyens d6893ae727 [FIX] product,sale: When multi-currency is enabled, pricelists should also be enabled
Since https://github.com/odoo/odoo/commit/7d8df4bec192e5a2ff3341dcf43d59e06a57f9a9, the groups
managing pricelists features have been updated.

But the onchange feature enabling pricelist on multi-currency activation was wrongly
adapted, it was only activating advanced pricelists, iff basic pricelists were enabled.

The wanted feature is to activate pricelist (basic pricelist features: group_product_pricelist)
when multi-currency is enabled.

Also add an implied_group on multi_currency group to enforce this behavior.

closes odoo/odoo#49633

X-original-commit: f862f9650395b02f6a43c57cdf232a309fa6948e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-16 08:36:03 +00:00
Romeo Fragomeli f83ba90e90 [FIX] web: avoid "False-Positive"
For testing, we use helpers functions like testUtils.dragAndDrop().

Due to the commit odoo/odoo@de924f41ee
these methods were wrapped by a deprecated function to add a deprecation
warning in the console when these methods are used.

After this commit, the deprecated method will properly propagate the
returned value of the original function. And so if the returned value
is a Promise now we can await this Promise.

This should fix some false positives on runbot in saas-13.3 (e.g. FullCalendar).

closes odoo/odoo#49611

X-original-commit: 33bfe175bf1ba7824a1bef27fd7fa0898dbe8cb3
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-04-16 07:06:24 +00:00
Laurent Smet 47e6afc3e3 [FIX] account: Fix rounding error when saving invoice
- Activate multi-currency
  Company currency: USD
  EUR rate: 0.14
- Set the decimal accuracy of Product Price to 5
- Create the following invoice in EUR:
  Name   Qty    Price Unit     Subtotal
  A     38.0      38.73553      1471.95
  B    222.0    4083.19000    906468.18
  C     35.0      49.45257      1730.84
  D      1.0      17.99000        17.99
- Save the invoice
- Edit the invoice and set a payment term, e.g. 30 days
- Save

There is a difference in debit and credit of 0.01 coming from the
following:
  1471.95   / 0.14 =   10513.93
  906468.18 / 0.14 = 6474772.71
  1730.84   / 0.14 =   12363.14
  17.99     / 0.14 =     128.50
              SUM  = 6497778.28

But the receivable account:
  909688.96 / 0.14 = 6497778.285714286 => 6497778.29

When changing the payment term, all invoice lines are recomputed.
`price_unit` and `tax_ids` are in the list of the updated fields, which
triggers the synchronization of accounting and business fields. During
this synchronization, `_get_fields_onchange_subtotal_model` is called
and recomputes the debit amount, leading to the difference.

We only synchronize if the value of the business fields have changed.

opw-2209543

closes odoo/odoo#49605

X-original-commit: 70bd2c9c7a7c8ec832edd2c158f4f61b78cdeb37
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-16 07:11:07 +00:00
Laurent Smet 5a99ddf88b [IMP] account: Improve testing class for account_reports
closes odoo/odoo#44493

Related: odoo/enterprise#8114
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-15 17:25:39 +00:00
jvm-odoo 65b798b461 [FIX] web_editor: fix video widget allow fullscreen
Issue

	- Install Website
	- Go on your website
	- Add Media & Text
	- Replace media by video
	- Add youtube URL
	- Save
	- Play the video

	The fullscreen button is disabled

Cause

	We do not allow fullscreen on the iframe

Solution

	Allow fullscreen, it is already done for the preview

OPW-2224696

closes odoo/odoo#49616

X-original-commit: e608a3feed35801c51c8ce7e251ccffa2ca9dc46
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-15 17:18:18 +00:00
Benjamin Vray 6cd8ef2024 [FIX] website: fix wrong z-index on the header
Remove the z-index = 1 for the header because it introduces visuals
bugs where certain elements are displayed at the top of the header when
should be displayed under. Example:  search button in events page.

task-2229057

closes odoo/odoo#49612

X-original-commit: e5a5b7f454befd9059f88dbd4f31a76e43e0eb77
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-15 16:34:13 +00:00
william 387ee3e05a [FIX] account: account type selection in list view
The custom selection widget was only used in the form.
A small rework had to be done to make it work in list views because the
values were not pre loaded.

closes odoo/odoo#49604

X-original-commit: cf942e6df3bf065e299d8ad0dcfd8ed2cc66b29c
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-04-15 15:14:02 +00:00
Csaba Tóth dff06e82b3 [FIX] account.invoice: leftovers of the state / invoice_payment_state
refactoring

this fixes bugs introduced by
https://github.com/odoo/odoo/commit/beaa30a3d1843de43a45f419bfbc1bfa7613a920

in saas-13.2, the field invoice_payment_state was renamed into payment_state by
https://github.com/odoo/odoo/commit/8e4158af810bcf475214946fa64d3b0ce4d3b26d

in saas-13.4, the feature post_at of journal have been removed by
https://github.com/odoo/odoo/commit/caeb782841fc5a7ad71a196e2c9ee67644ef9074

closes odoo/odoo#49569

X-original-commit: 2001c413ee142c50ca6549cd5dff9fc0f9f1637b
Signed-off-by: Csaba Tóth <csaba.toth@i3rendszerhaz.hu>
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-15 13:35:16 +00:00
william a6026eb71d [FIX] account: default account in form
The default account was never set when adding a new line because the key
was missing from overriden context

closes odoo/odoo#49583

X-original-commit: a0f0b5e4f3e569e6bb217c1243a705e180970219
Signed-off-by: wan <william-andre@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-04-15 11:13:49 +00:00
Adrien Horgnies 729fb763c7 [FIX] l10n_fr: fix intra com, extra com taxes and fiscal positions
1. merge intra community taxes (one taxe with two report lines instead of two taxes with one report line each)
2. fix "tva à l'encaissement" fiscal position mapping (two rates were using the same xml_id)
3. add outside EU import taxes

closes odoo/odoo#49552

X-original-commit: a5ddba34cc336e380f98c36ac4737ab97043eb76
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: Adrien Horgnies <AdrienHorgnies@users.noreply.github.com>
2020-04-14 14:31:21 +00:00
Odoo's Mergebot 5b4ebd63a8 [IMP] partner_autocomplete,crm_*: unify displayed "clearbit" information
PURPOSE

We make multiple calls to the clearbit API and the returned information are
shown in various different templates, although they contain the same
information.

The purpose of this commit is to unify the templates into a single one to
reduce code size and improve coherence.

SPECIFICATIONS

Currently, we have 3 ways of reaching out to the IAP clearbit api:
- When creating a partner (autocomplete service)
- When enriching an existing lead based on its email address
- When generating leads using the "Geneate Leads" button or using the website
  visitors

Every time we use the service, we log a note in the model's chatter containing
all the information returned by the cleabit service (estimated annual revenue,
media links, sector, ...).

Though using different endpoints and methods, all the calls essentially return
the same data, and the templates could be unified for consistency.

This is the goal of this commit.

We merge the 3 separate templates of each modules into a unique template that
always renders the same information to the end user.

To do that, we had to find a common module to store the template, we chose
"partner_autocomplete" as it's installed anyway as soon as "crm_iap_lead_*" is
installed.

LINKS

PR #40349
Task 2081471

Related: odoo/upgrade#775
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-15 09:59:36 +02:00
Aurélien Warnon 66cd5dc3c5 [IMP] crm_iap_lead: use first email from lead mining instead of all
When a lead is generated from the lead mining request, we use all the returned
email addresses to populate the 'email_from' of the lead (joined with ',').

This is inconvenient because it adds a lot of noise on a lead that is supposed
to be nicely enriched and also prevents from sending emails through the chatter
easily.

This commit changes the behavior to only use the first returned email to
populate the 'email_from' field.
All other emails will still be available on the chatter post that contains the
detailed lead information.

This is the case for leads generated through the "Generate Leads" button but
also for leads generated through the website (using rules).

PR #40349
Task 2081471
2020-04-15 07:37:51 +00:00
Aurélien Warnon 342ab37835 [IMP] crm_iap_lead_enrich: ease testing for the enrich service
Testing the enrich service was not possible since the endpoint was hardcoded.
This commit introduces a config parameter that allows overriding it.

Done in preparation of task 2081471.

PR #40349
Task 2081471
2020-04-15 07:37:48 +00:00
Aurélien Warnon 9620721884 [IMP] partner_autocomplete,crm_*: unify displayed "clearbit" information
PURPOSE

We make multiple calls to the clearbit API and the returned information are
shown in various different templates, although they contain the same
information.

The purpose of this commit is to unify the templates into a single one to
reduce code size and improve coherence.

SPECIFICATIONS

Currently, we have 3 ways of reaching out to the IAP clearbit api:
- When creating a partner (autocomplete service)
- When enriching an existing lead based on its email address
- When generating leads using the "Geneate Leads" button or using the website
  visitors

Every time we use the service, we log a note in the model's chatter containing
all the information returned by the cleabit service (estimated annual revenue,
media links, sector, ...).

Though using different endpoints and methods, all the calls essentially return
the same data, and the templates could be unified for consistency.

This is the goal of this commit.

We merge the 3 separate templates of each modules into a unique template that
always renders the same information to the end user.

To do that, we had to find a common module to store the template, we chose
"partner_autocomplete" as it's installed anyway as soon as "crm_iap_lead_*" is
installed.

LINKS

PR #40349
Upgrade PR odoo/upgrade#775
Task 2081471
2020-04-15 07:37:43 +00:00
Nicolas Martinelli 15b5b5f518 [FIX] mrp: decoration precision
1. Set Decimal Accuracy of "Product Unit of Measure" to 6
2. Create new Unit of measure: "Thousand(s) of units", with ratio 1000.0
3. Set accuracy for Unit(s), Thousand(s) of units, kg to 0.000001
4. Create two products: "parent" (UoM: Thousand(s)) and "child" (UoM: kg)
5. Create Bill of material: parent needs 0.12 of child
6. Add 10000 of child product to stock
7. Create manufacturing order for 100.123456 of parent product.
8. Click "Produce".

The decoration of the lines is incorrect.

This happens because of Float representation at the JavaScript level,
leading to comparison such as:

`12.014999...8 < 12.015000`

It's not possible to use some kind of rounded comparison. As a
workaround, we change the way the float are compared.

opw-2234824

closes odoo/odoo#49559

X-original-commit: f62c2b33fe834defb2c39988f3c9e90047a56d2c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-14 15:54:17 +00:00
Nicolas Martinelli e3a171e34f [FIX] base: default signature
Set a default email signature to an empty string to avoid `False` when
evaluating `${user.signature | safe}` in email templates.

opw-2229846

closes odoo/odoo#49558

X-original-commit: 96f46fba2635d8050aef03c7d4744a87ac8a597e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-14 15:43:10 +00:00
Andrea Grazioso (agr-odoo) 3101feb494 [FIX] stock: bypass permission check after settings change
Install Accounting(account_accountant), Inventory (stock)
1. Create a new user [DEMO] with the next access:
- Accounting: Advisor
- Administration: Settings
2. With the user [DEMO] , go to Accounting>Configuration>Settings
and change any value.
3. Try to save the settings.

Access error will occur "Sorry, you are not allowed to modify documents
of type 'Picking Type' (stock.picking.type)..."
This occur because when stock is installed an override in 'execute' make
the backend check for multi locations, packaging or tracking settings
and activate show_operation on stock.picking.type causing the access
error for unprivileged users
Calling the write with sudo solve the issue

opw-2233193

closes odoo/odoo#49555

X-original-commit: f560a9966dfbbacb259f0de74437743d1385d8a6
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-14 15:12:44 +00:00
Laurent Smet 7076b4f4d0 [REF] account: Split big files account.py & account_view.xml
closes odoo/odoo#49422

Related: odoo/upgrade#1068
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-14 06:54:14 +00:00
alt-odoo c3379312d9 [FIX] base_vat: no vat check if multiple countries
We should only check the consistency between the vat number and country code in
case we have one country involved in the recordset.

closes odoo/odoo#49530

X-original-commit: 23771ef7fcadfc0022d278c2e3436a7befc9e5b8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-14 12:17:20 +00:00
Lucas Perais (lpe) 2ff76674d2 [FIX] web: style attachment company specific always in bytes
Following https://github.com/odoo/odoo/pull/44393

Delete the qweb template `web.styles_company_report`
Recompute company specific style by going into
Settings > Configure Document Layout > change stuff and save
Print a report, in HTML to get an human readable error
(PDF rendering would just ignore the error)

Before this commit, there was an error "could not get asset content"
This was because the css asset created in db had a value of type string
whereas it should have been the same type as b64encode (which is byte-like)

After this commit, there is no error at rendering time

closes #49456

closes odoo/odoo#49529

X-original-commit: 2a7e06663c1281f0cf75f72fc491bc2cc39ef81c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-04-14 12:17:00 +00:00
Goffin Simon f5ece86e53 [FIX] l10n_fr: Wrong account on TVA à l'encaissement (achat)
For all the purchase cash basis taxes:

The account 445800 must be used as cash_basis_transition_account_id

The account 445660 must be used in distribution of the tax

Wrong minus_report_line_ids and plus_report_line_ids were set for these taxes

opw:2230288

closes odoo/odoo#49527

X-original-commit: 12d98b3ed80ea57831a4aca5089adac0ad5b9408
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-04-14 12:13:39 +00:00
Nicolas Martinelli 414a0bac5a [FIX] mrp: partial production using all components
- Create a product P using one component C
- The BOM is flexible
- Create a MO for 10 units
- Product 9 units, but use all components
- Post the inventory

The MO is considered as done, while it should remain in progress.

This happens because the MO state is computed based on the move raw
state. In this case, it should compare the quantity produced and the
quantity to produce.

The material availability is set to `False`.

opw-2220855

closes odoo/odoo#49247

closes odoo/odoo#49526

X-original-commit: dd7ef482a1c41f271b133fbfcc3d389d16677da1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-14 12:00:59 +00:00
Nicolas Martinelli 9640003b5c [FIX] stock: avoid crash of _get_relevant_state_among_moves
Avoid crashing if no relevant move is found.

X-original-commit: fee99ff5d3db559081240dfca4b0809dde331ce0
2020-04-14 12:00:58 +00:00
Michael Mattiello (mcm) 71f2f06c61 [FIX] web: render component in kanban
This commit fixes the kanban view to render components.
Before this commit, when rendering a component an error was thrown.

closes odoo/odoo#49525

X-original-commit: 29c18b53af26752079a49e4ece2419f62f680b5d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-14 11:58:53 +00:00
Odoo's Mergebot b3fe907be8 [MERGE] crm, sales_team: lint modules and clean tests to prepare sales team enhancements
PURPOSE

Prepare enhancements of sales team membership.

SPECIFICATIONS

Lint crm data and demo, notably about sales team and file organization.
Also move crm menu entries declaration in a single file and remove some
menu entries not imported anymore.

Lint sales_team module. Linting containing

  * reorder fields according to their use;
  * order methods according to guidelines (compute, CRUD, actions, tools);
  * fix some docstrings and typos;
  * remove unused imports and dead code;
  * rename files according to guidelines;
  * move views in their own file for mail.activity and assets;
  * correctly name data and demo files;
  * rename some inner methods to ease understanding;

Clean sales team tests and extract common test data from crm

LINKS

Task ID 2086889 (sales team enhancements)
Task ID 2234698 (preparation lint)
Community PR #49520

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-14 14:33:22 +02:00
Thibault Delavallée 2d0db1a0bf [IMP] sales_team, crm: clean sales team tests and extract common test data from crm
PURPOSE

Prepare enhancements of sales team membership.

SPECIFICATIONS

Purpose of this commit is to prepare modifications in sales team management
notably by cleaning sales team tests. We also move some data preparation in
sales team. It allows to rely on some common data while doing sales team
then crm tests.

LINKS

Task ID 2086889 (sales team enhancements)
Task ID 2234698 (preparation lint)
Community PR odoo/odoo#49520
2020-04-14 11:53:16 +00:00
Thibault Delavallée 150095ebc7 [IMP] sales_team: lint module
PURPOSE

Prepare enhancements of sales team membership.

SPECIFICATIONS

Linting containing

  * reorder fields according to their use;
  * order methods according to guidelines (compute, CRUD, actions, tools);
  * fix some docstrings and typos;
  * remove unused imports and dead code;
  * rename files according to guidelines;
  * move views in their own file for mail.activity and assets;
  * correctly name data and demo files;
  * rename some inner methods to ease understanding;

LINKS

Task ID 2086889 (sales team enhancements)
Task ID 2234698 (preparation lint)
Community PR odoo/odoo#49520
2020-04-14 11:53:08 +00:00
Thibault Delavallée bc86d8c57d [IMP] crm: lint data and menu entries
PURPOSE

Prepare enhancements of sales team membership.

SPECIFICATIONS

Lint crm data and demo, notably about sales team and file organization.
Also move crm menu entries declaration in a single file and remove some
menu entries not imported anymore.

LINKS

Task ID 2086889 (sales team enhancements)
Task ID 2234698 (preparation lint)
Community PR odoo/odoo#49520
2020-04-14 11:52:46 +00:00
Nicolas Martinelli c54126aee5 [FIX] stock: compute quantity_done in onchange
When computing `quantity_done` in an onchange, `move.id` is a `NewId`,
not an `int`. However, the `read_group` call returns regular integers
for `move_id`.

Consequently, `rec.get(move.id, [])` is an empty list.

closes odoo/odoo#49495

X-original-commit: 2ce1ed31a9c1ec7a7467983a040e4a056f8f4e69
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-14 09:20:33 +00:00
Damien Bouvy 256c75baf7 [IMP] web: add a <Popover> component
Using bootstrap popover with owl is possible, but with a lot of
friction.

This commit adds a Popover element to ease developments that require
a popover. This component takes 2 props:
  - position='bottom' (optional): 'top', 'bottom', 'left', 'right'
  - title (optional)

Its usage requires setting an `opened` slot for the content of the
popover, whilst the 'trigger' of the popover uses the default slot.

E.g.
```xml
<Parent>
 <Popover>
  <t t-set="opened">
   <p>You have opened the popover, congratulations!</p>
   <button t-on-click='_handlerOnParent'>Dispatch cake</button>
  </t>
  <button class="btn btn-primary">Click me!</button>
 </Popover>
</Parent>
```

Note that:
- only one popover can be opened at a time (opening a popover will
close any previously opened popover)
- `Popover` uses `Portal` under the hood, so events are propagated
correctly even though the popover is teleported elsewhere in the dom
(see example in this commit message with `_handlerOnParent`)
- `<Popover>` is registed as a global component in QWeb and does not
need to be added to a Component's subcomponents list

closes odoo/odoo#47710

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-04-14 11:59:04 +00:00