Commit Graph
127612 Commits
Author SHA1 Message Date
Goffin Simon d1a5ce02dc [FIX] hr: Impossible to change job_id in hr.employee
The field job_id is displayed in the tree view but it was not available in the form view
like in 12.0. So it was not possible to change it.

opw:2006084

closes odoo/odoo#33933

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-06 08:16:12 +00:00
Olivier Colson bd38c693f1 [IMP] account: stronger constraint on repartition lines
We now force tax repartition lines to use the same percentages for invoices and credit notes. Thanks to that, we are able to simplify the way manual modifications made on vendor bills' account.invoice.tax entries must affect the ones of the refunds created for them. This also prepares the code for the incoming big accounting revamping.

closes odoo/odoo#33577

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-06-05 14:04:42 +00:00
Nathan de Pryck f435c65517 [FIX]account_asset: Increase performance to generate asset entries
For each asset depreciation lines we verify that there are not linked
to a move. This verification was done for each line separately.
Moreover, during the creation of the journal entries, we were writing
on the 'line_ids'. In this case, accessing the move of a line
was invalidating the cache. This fix ensure that this operation is
done out of the loop and the cache is then not invalidated at each
step.

See opw-2000305

closes odoo/odoo#33908

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-05 12:47:02 +00:00
Lucas Lefèvre 05ed9ebbe5 [FIX] hr_payroll: Generate work entry for full days
Currently, `generate_work_entry` has a different behavior
if the type of parameters is `date` or `datetime`:
If the type is `date`, it implicitely set hours and minutes
to 00:00.
It is particularly confusing when `date_stop` is a `date`:
work entries are not generated for this day because it's
actually outside of the range.

This commit makes it consistent in all cases:
-hours and minutes are set to 00:00 for start date
-hours and minutes are set to 23:59 for end date

closes odoo/odoo#33906

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-05 11:35:21 +00:00
RomainLibert 4783253ba3 [FIX] hr_holidays: add method to override selection of calendar
closes odoo/odoo#33905

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-05 11:29:17 +00:00
RomainLibert c081ee0462 [FIX] hr_holidays: fix multi company issue in onchange
If you are logged into a company that differs from the company of your
employee, you won't be able to read the informations on that employee,
and you will have a crash.
Instead of taking the employee linked to the current user, we use search
in order to first apply the ir.rules hence we ensure that we will be
able to read the needed informations.
2019-06-05 11:14:55 +00:00
Michele Zaccheddu 6a6471d727 [CLA] signature for MicheleZak
closes odoo/odoo#33880

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-05 06:45:00 +00:00
Christophe Monniez 7cc13e91b6 [FIX] test_lint, test_pylint: reintroduce an empty test_pylint module
Since test_pylint was moved into the test_lint module in commit
b27077bb, this could break Odoo instances where a module has test_pylint in its dependency.

With this commit, the test_pylint module is coming back as an empty
module.

closes odoo/odoo#33871

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-06-04 12:24:29 +00:00
luisiniguezh e88edfc5c5 [CLA] signature for luisiniguezh
closes odoo/odoo#33851

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-04 13:13:03 +00:00
Martin Trigaux ae48324aee [FIX] payment: use a better fallback when no partner language
In case the partner has no language (not a required field), the fallback on the
payment transaction was 'en_US'
en_US may however be an invalid choice for partner_lang field as it is
a selection field that only has the activated languages (result of the call to
self.env['res.lang'].get_installed())
A database created in a different language does not have en_US activated

Fallback on user language instead of False as the partner_lang is expected by
some payment providers and may produce an error is empty

Fixes odoo/odoo#33750

closes odoo/odoo#33870

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-04 12:00:10 +00:00
Martin Trigaux 51a535991f [FIX] mail: do not force changing mailing lists privacy
Changing the 'public' attribute of a mailing list to "Public" (e.g. to publish
it on /groups page), was triggering the _onchange_public which changed the
visibility of the mail.alias to public.

This was incorrect as a channel may be public but it does not means everybody
should be able to post in it. It is still possible to restrict the access to
specific members only (and it is probably a good reason to avoid spam).

The intention of 66bd7707f5 was to protect the private channels
by default but had the opposite effect if the visibility was changed.

Changed the onchange evaluation to only restrict the access when unpublishing
a channel but do not force it at public.

Context: unpublishing and republishing a mailing list had the effect to change
the alias privacy to 'everyone' and we received spam

closes odoo/odoo#34105

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-13 13:54:03 +00:00
Julien Castiaux 324634da3d [FIX] mail: automatically fetch new attachments
Create an invoice, validate it, print the invoice from the print menu,
as of the paperclip value in the chatter, an attachment has been added.
But if you click on the paperclip, there are no attachments. You need to
reload the page in order to access the attachments.

The problem is the internal flag indicating that all attachments are
fetched is wrong. This fix resets the flag when the paper clip value
changes.

opw-2008344

closes odoo/odoo#34171

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-06-17 11:42:55 +00:00
Goffin Simon 413c8c4d85 [FIX] mrp: Manufacturing routes all get reference 'New'
When creating a manufacturing route in 2 companies in a multi-company environment,
only the routing 's reference of 'My company' got a sequence but the routing 's reference
of the other company stayed 'New'. Now the default sequences for mrp.routing are shared
between companies like SO and PO.

opw:2008570

closes odoo/odoo#34169

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-17 08:14:18 +00:00
Lucas Perais (lpe) 805e382955 [FIX] hr_expense: a dependent field must be placed *after* its dependencies
Select 2 hr.expense then go to action > submit report

Before this commit, the company currency amount of the first expense line of the report
was equal to zero, always
This is because, when evaluating onchanges, a tree is constructed in the order of the model._fields
which is an orderedDict, filled up when the class is the read
So in python and in the Odoo ORM, the order of field declaration does matter
i.e. a @api.depend fields must come *after* the fields it depends on

After this commit, everything computes as expected

OPW 2008868

closes odoo/odoo#34110

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-06-13 15:57:06 +00:00
Julien Castiaux cfa1e101e2 [FIX] website_slides: get video id from youtube url
The regexp used to get the youtube video id from its url is broken in
multiple ways.

If the video ID starts with the letter 'v' in the short (youtu.be) url
then the url is considered invalid. i.e. https://youtu.be/vmhB-pt7EfA

If the query option `v=<video id>` is not the first option of the query
in the regular url (youtube.com/watch) then the url is also considered
invalid. i.e. https://www.youtube.com/watch?feature=youtu.be&v=vmhB-pt7EfA

The problem has been solved by replacing the over-engineered regexp by
the dedicated parsing tools of `urllib.parse`.

opw-2006330

closes odoo/odoo#34036

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-06-17 09:35:37 +00:00
Christophe Monniez 38cc295235 [FIX] core: catch error when removing chrome profile
For a not yet known reason, a race condition appeared during HttpCase
tests that use ChromeBrowser. When the test is finished, failed or not,
the Chrome broser instance is terminated and the temporary profile
directory is removed. Sometimes, a file is still written in the profile
dir during the shutil.rmtree processing, when it tries to remove
directories that should be empty, causing a traceback.

With this commit, the error is simply ignored.
As on the runbot, tests are run in Docker containers, it's not harmful
to keep a directory.

closes odoo/odoo#34168

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-06-17 08:33:10 +00:00
Swapnesh Shah 979b2de459 [FIX] stock : call to _get_locations_values inside loop
Method _get_locations_values is called outside loop which generates 'Expected singleton' when write on Warehouse is called in batch.

closes odoo/odoo#34164

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-06-16 15:29:30 +00:00
Julien Castiaux 7b0806b583 [FIX] mail: use email configured on template
Send an invoice by email but configure the sender email on the email
template. The `mail_template.email_from` field is ignored by the wizard
and the email is sent using the default `mail_message.email_from` field.

opw-2003562

closes odoo/odoo#34123

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-06-14 12:15:01 +00:00
Goffin Simon 4ea466863f [FIX] account: Duplicating posted journal entries
Steps to reproduce:

- Go into accounting> journal entries and
- Choose a posted entry
- Press the duplicate button

Bug:
No button Edit, Save or Discard for the duplicated record.

Fine tuning of this commit: d79007c

opw:2009050

closes odoo/odoo#34096

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-13 10:50:18 +00:00
Odoo Translation Bot 25eac59ffa [I18N] Update translation terms from Transifex 2019-06-16 01:18:49 +02:00
shreya thakrar 3e46eaca77 [FIX] l10n_{ca, do, ua}: stock interim accounts must be reconcilable
The input/output stock interim account in anglo-saxon localizations
should be reconciliable.

Related task id: 1970471

closes odoo/odoo#32824

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-14 15:22:59 +00:00
Nicolas Martinelli c53146b293 [FIX] sale: no company
Fine-tuning of b044a6be8d

closes odoo/odoo#34146

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-14 12:53:38 +00:00
Lucas Perais (lpe) 6a29dec93f [FIX] mail: message_attachment_count can be explicit in form view
Before this commit, it was not possible to have the field message_attachment_count
explicitly defined in the form view. It crashed inelegantly if it were the case

After this commit, it is possible to have that field in the form view

OPW 1998503

closes odoo/odoo#34143

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-14 13:38:09 +00:00
Varun Raval d663ab3345 [FIX] account: fix breadcrumbs, action panel which is not appearing in duplicating journal entry
Before this commit, when user duplicates the journal entry, the action panel and breadcrumbs are lost
due to 'inline' action given in it for opening form view in edit mode directly.

After this commit, when user duplicates the journal entry the action panel and breadcrumbs will be appear
and also the form view opens directly in the edit mode.

task-1999208

closes odoo/odoo#34127

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-06-14 08:55:10 +00:00
qsm-odoo 19896a5757 [FIX] website: stop support of BS3 'show' class
The BS3 'show' class cannot be supported as BS4 still defines a 'show'
class for other purposes which conflict with its former use (tab-pane,
fade effects, ...). Adding more complex rules won't solve the problem as
they would change css rules priorities.

closes odoo/odoo#34139

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-14 10:49:02 +00:00
qsm-odoo 62b89ea467 [FIX] website: allow different compatibility grays
Commit https://github.com/odoo/odoo/commit/4f9a0cb4fcdfa9fee66c042593f4d411dd0e192f
introduced a way for users to enable a compatibility template to provide
support for some old BS3 classes.

Some of these classes are the bg-gray-* classes. The problem is that
enabling the compatibility file forces them to the new BS4 gray values
while the user may have done a custo to generate them automatically
from other gray values. This commit allows to keep the compatibility
file enabled, without overriding compatibility grays the user may have
provided on its own.

closes odoo/odoo#34134

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-14 09:51:05 +00:00
Christophe Monniez 989590e9b1 [FIX] packaging: add missing odoo-mailgate.py
This script is missing in the different Odoo packages.

opw-2008670

closes odoo/odoo#34130

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-06-14 09:32:38 +00:00
Nicolas Martinelli b044a6be8d [FIX] sale: no company
- Activate multi-company
- In a SO, remove the company (the field is not mandatory)

The currency rate computation crashes.

The computation expects a company in order to compute the rate.

If there is no company set, we set the rate to 1.0. It is worth
stressing that if both multi-company and multi-currency are activated, a
company is necessary for reporting consistency.

Fixes #34066
opw-2009044

closes odoo/odoo#34120

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-14 08:33:04 +00:00
Gorash 5b41b5c563 [FIX] web_editor: escape html tag when copy paste code and text content
closes odoo/odoo#33859

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-04 08:15:48 +00:00
Julien Castiaux b2b639b693 [FIX] website_crm_partner_assign: use html5 input date over text
Create a lead, assign it to a partner who has portal access. Go to that
opportunity on the portal, edit any date to set 3-digit year (0-999) and
submit the form. Go to the opportunity using the web app, traceback.

Dates are only supported starting to 1900 thus many parsing function
assume the year to be a 4-digits year. The html form has been changed to
use an input type date with a minimum value instead of a plain text
input. This ensure a better support by browser (they use their built-in
calendar) and allow basic html5 form validation.

opw-2033276

closes odoo/odoo#34796

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-11 12:05:54 +00:00
Xavier-Do 8bab33c948 [FIX] core: avoid writting sources during tests
Future runbot improvement may share sources between build,
meaning that sources will be readonly to avoid any interaction.

_touch() was supposed to handle ro filesystem but
f7130556 introduced a new test that was not working
in this case.

Instead of trying to touch file and pseudomocking the result
if the filesystem is readonly, this commit add a real patch
on getmtime.

cherry pick of b295723c99

closes odoo/odoo#34822

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-07-12 10:01:48 +00:00
Julien Mougenot d7d7d92e92 [FIX] web: binary fields correctly resets
When uploading a file to a binary file, then clicking on the
"clear" button, then reuploading the same file...

Before this commit:

The actual input of the field was only changed on user input.
This means that the "clear" action didn't reset the actual value
of the input, and the browser's default behaviour when getting
the same path twice is not to change anything. In the use case,
you couldn't upload the same file until you uploaded another one.

After this commit:

The "clear" action now also clears the value, allowing reuploading
the same file over again.

closes odoo/odoo#33843

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-03 15:01:57 +00:00
Atul Patel 6028d91a26 [FIX] stock: clean m2m records for warehouses on routes.
when we select places warehouses where route can be applied, then unselect that warehouses, warehouses values on m2m tag are not deleted.
because of wrong value empty list on onchange. so remove all records of warehouses if warehouse option was not selected.

closes odoo/odoo#33883

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-04 16:55:13 +00:00
Romain Derie 9efc11c8da [FIX] website: redirect user
Before this commit, user would be redirect to / instead of /my after signup.
That error was detected with task-1829827 which has a tour ensuring user is
correctly redirected to /my after signup on the checkout summary after payment.

Since 0229ef4c4a, the `web_login()` super call order has been changed when
called from the `/web/signup` route.
See the commit for more details but basically, before the fix, it went only
through:
1. web.web_login
2. portal._login_redirect

Where now, it goes through:
1. website.web_login
2. auth_signup.web_login
3. web.web_login
4.portal._login_redirect

Thus, portal._login_redirect is not returning `/my` as redirect anymore.
Indeed, website.web_login will ignore its super() and force redirect to `/`

With this commit, website's user are redirected to /my as expected.
Side effect: website's user will also be redirected to /my on login instead of
`/`, which is also prefered.

closes odoo/odoo#33865

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-04 09:38:44 +00:00
Nicolas Lempereur 7c900568c5 [FIX] web_editor: modal open>save document keep it
When we add a document with the "Select a Media" modal, if we reopen the
modal then click on "Save" without modfiying anything, the element is
broken since we do not have the data saying it is a document and the
code try to display it as image.

With this changeset, we keep the information that the attachment is a
document and when saving it works as expected.

opw-2004064
closes #33844

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-03 13:54:45 +00:00
Nans Lefebvre ff4f3922a9 [FIX] purchase: fix reference update at onchange
Add two PO with references 'XY' and 'Z' to a vendor bill.
The reference is computed as 'XY, Z' (with ', ' as separator).
Add a PO with reference 'X', the reference becomes 'X' instead of 'XY, Z, X'.

There are two variables that may not be defined (vendor_ref and self.reference),
and specifically the case where a reference is the prefix of another one is not
correctly dealt with.

opw 2005825

closes odoo/odoo#33841

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-03 13:30:42 +00:00
Nicolas Martinelli 25155aa472 [FIX] payment_adyen: empty field
- Activate Adyen
- In the eCommerce, purchase an item
- Change the delivery address
- Pay with Adyen

A internal error is raised.

It is caused by `val.replace(...)` where `val` is `False` ( due to
`shopperEmail`).

We make the code more robust by fallbacking on the billing email, then
on an empty string.

opw-2002974

[1] https://docs.adyen.com/classic-integration/hosted-payment-pages/hpp-payment-response/payment-response-merchantsig-sha-256/

closes odoo/odoo#33840

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-03 13:23:15 +00:00
Rim BEN DHAOU 58d414ec1c [FIX] calendar: fix required conditions for subfields of recurrent events
For recurrent events, many fields are set to define the recurrency;
these fields are invisible unless (recurrency', '=', True).
However there are fields that depend on fields to define the recurrency,
which are required in some cases.
However in case where recurrency is later set to False, no onchange cleans up
the intermediary values (this is taken care of in the create),
but the 'required' on the non-relevant fields might prevent from saving.

We fix these cases by adding the recurrency in the list of requirements.

opw 2002181

closes odoo/odoo#32698

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-03 11:15:08 +00:00
Cedric Snauwaert 409679866b [FIX] l10n_hn: remove unused fields
fields account_id and refund_account_id on account_tax_template have been moved on the repartition line of the same model.

closes odoo/odoo#33829

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-06-03 10:53:09 +00:00
Kaushalya Mandaliya 7a3a1a43b3 [FIX] im_livechat: correctly display known partner name
When talking via the Live Chat to a known partner, should be able to see
his name in the chat window title, from the commit: c04b9c019e
the partner name wasn't showing in the title as sudo is being used.

After this commit, known partner name will be shown in the
Live Chat window title.

And improving a test case, in which we're checking for the known partner's
name in the chat window title.

task-1940407

closes odoo/odoo#33831

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-06 04:45:21 +00:00
Johan Demaret Rivarola 218d5ce6a8 [FIX] (website_)sale_coupon: avoid race condition on currency
Creating a new database with only website_sale_coupon installed will
make some (website_)sale_coupon tests fail. This is due to a race condition
messing with the value of the pricelist product.list0 currency.

The tests are failing due to amounts being compared after the USD
currency rate of 1.2834 has been applied.

Example on a 10% discount:

expected:
>>> 320 * 0.9
288.0

actual:
>>> 320 * 1.2834 * 0.9
369.62

This is due to
https://github.com/odoo/odoo/blob/3cf9cfc985950c30c6b76480f77f5ffe53650b24/addons/website_sale/data/demo.xml#L228
overriding the value to USD. The tests should not rely on this.

This commit aims to ensure the currency is enforced before each test run.

closes #4371

Signed-off-by: Christophe Simonis <chs@odoo.com>

X-port/Cherry-pick of odoo/enterprise@c1cc464c44
2019-06-05 18:18:52 +02:00
Christophe Simonis 0f9823e216 [FIX] lunch: correct forward-port of a5b56e5498
closes odoo/odoo#33878

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-05 14:58:20 +00:00
Christophe Simonis dad3043ccd [FIX] stock: reset return lines on picking change 2019-06-05 14:00:39 +00:00
Christophe Simonis ce4165780a [FIX] mail: avoid race condition in test 2019-06-05 09:08:31 +00:00
Christophe Simonis 76275c2c12 [FIX] web: correct forward-port of e9350993ca 2019-06-04 16:27:42 +00:00
Nicolas Lempereur 32f13fae14 [FIX] web: list editable test forward-port
Now in 12.3, when the a editable list view is grouped, the "Create"
button is no longer shown as was the case before (when it would open the
form view when clicked).
2019-06-04 16:16:41 +00:00
Nicolas Lempereur bbc8c9fc26 [FIX] web: fix form resequence test e61639723
In 12.3 when lines are resequenced, the position of the current line
does not take into account that it could have been changed (because of
drag and dropping a line before or after).

opw-1966589
closes #33878
2019-06-04 15:09:44 +00:00
Christophe Simonis a89a7b30a4 [FIX] web: correct forward-port of e9350993ca 2019-06-04 14:56:19 +00:00
Christophe Simonis 3a1bb663c7 [FIX] sale_product_configurator: remove duplicated method
Oversight of previous forward-port.
2019-06-04 14:56:19 +00:00
Christophe Simonis 2b0118b984 [FIX] sale: correctly adapt forward-port of 51ef8514ea 2019-06-04 14:56:19 +00:00