Commit Graph
133189 Commits
Author SHA1 Message Date
Thanh Dodeur e2a8ee3aa1 [FIX] mail: restores the documentViewer modal
Revision on
https://github.com/odoo/odoo/commit/34bbdd88c0bc354b76b254bb78c4eb786f3d08c0#diff-9da02f8f30ea349fbc4b9884c2b77b78

The document viewer did not work properly because, by default, dialogs are non-active,
so most interactions were not possible (just pressing ESC to close the dialog worked).

The correct fix consists of using OwlDialog for DocumentViewer,
but that's basically close to a re-writing, so in the meantime marking it as always active is fine.

closes odoo/odoo#43446

Task: 2177011
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-01-17 10:11:27 +00:00
Mitali Patel 2d2b65ae8a [IMP] mail: do not send email on join/leave mailing channel
Before this commit, when a user joined, left, or was invited to a
channel with "Send by email", it sent an email notification to every
member.

This commit disables email notification on subscribe/unsubscribe on
a channel, while still showing messages on join/leave.

Task-Id 2003281

closes odoo/odoo#35142

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-01-17 10:29:08 +00:00
Priyanka Kakadiya 0b11ed87b6 [IMP] mail: keep old subtype subscription on change on parent record
With this commit, when changing subtype subscription from a parent
record (e.g. project of task), then it does not update subtype
subscription of existing records. Changes on parent record should
only affect new record afterwards.

Task-Id 1974055

Closes #34150

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-01-17 10:05:08 +00:00
Priyanka Kakadiya 16dd3da7a9 [IMP] mail: auto follow subtypes based parent record at creation
With this commit, when the user subscribes to internal subtypes
(i.e. activities and notes) on a parent record (e.g. project of
tasks), then the user follows them by default on every record
creation (e.g. all new tasks of this project).

Task-Id 1974055

Closes #34150
2020-01-17 10:04:54 +00:00
Jason Van Malder 6afb7074e4 [FIX] sale: fix ecommerce quantity width
Issue

    - Install eCommerce, use Graphene
    - Shop > Any product

    The add to cart button is shifted.

Cause

    Quantity field take full-width & max-width is too large.

Solution

    Remove width: 100% and reduce the max-width.
    Screenshots on OPW

OPW-2166060

closes odoo/odoo#43459

X-original-commit: 48ce80f0678510b9a5ccc2da19b51b5c39c410b0
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
2020-01-17 10:10:04 +00:00
Nicolas Martinelli e3f1802d4c [FIX] account: account with single character code
The creation of an account with a single character code crashes.

opw-2176764

closes odoo/odoo#43455

X-original-commit: 7b1e881e60d6424f7b3a676c06a4b5b8a222d025
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-17 09:07:04 +00:00
Prakash Prajapati 4bb5ba65a6 [IMP] account: Rename customer/vendor filters on a partner
PURPOSE
=======

When the customer and supplier boolean fields were dropped
from res.partner in 13.0, the 'customers' and 'vendors' filters
were removed as well.

Two new 'customers' and 'vendors' filters have since been added
in the account module.

They might look identical to the former ones at first, but those
are instead based on two brand new 'rank' integer fields:
customer_rank and supplier_rank.

Those fields start off at zero and are increased by one each
time an in_invoice/out_invoice line is posted for the res.partner.

This means that, to be considered as a customer, a res.partner
has to have at least one invoice line posted.

This has stem confusion in both former and new users of Odoo:
- users do not have a clear idea of how this filter actually
  works. (I personally had to go through xml and python code to
  understand how to turn a res.partner into a 'customer')
- to the users that were used to the 'customer/supplier' boolean
  fields, it simply looks like the old filters stayed while the
  boolean fields were removed
- one of the reason why we got rid of the 'is a customer' field,
  is that there is no unanimous definition of what a customer
  actually is
    - is it when the lead is won? when the quotation is
      created/sent/confirmed? when the invoice is
      created/sent/confirmed?
    - here, we decided that is it when the invoice is posted,
      but whether the user agrees or not with this definition,
      there is no way for him to know this is where we decided
      to draw the line

A simple way to clarify all this is to rename the 'Customers' and
'Vendors' filters to make it obvious that they are based on the
customer invoices and vendor bills.

closes odoo/odoo#43349

Taskid: 2166410
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-17 08:51:49 +00:00
oco-odoo 8e4158af81 [IMP] account: add 'partial' and 'reversed' payment states to invoices
- 'partial' payment state corresponds to invoices whose payable/receivable move line has been partially reconciled with some other line.

- 'reversed' payment state corresponds to entries that have been cancelled by the creation of a single reverse entry (using the dedicated button on the form view). This state can be set on invoice as well as on regular entries.

=> To stay consistent with the naming conventions, this commit also renames invoice_payment_state field to payment_state, since it's no longer only applicable on invoices.

closes odoo/odoo#41723

Related: odoo/enterprise#7202
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-16 18:04:26 +00:00
Pierre Masereel 1a7c21328f [FIX] delivery: return label compute field incomplete
Since new ORM in Odoo, the compute methods should always return values.

In the case of return label in delivery, nothing was returned when there
was no carrier on picking.

So we are now setting the field to False when there are no carrier on
picking.

ISSUE-43270

closes odoo/odoo#43452

X-original-commit: 9bf52959a5afad01970f1ef39a64d6b3694abcc8
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-01-17 08:36:08 +00:00
Nicolas Martinelli 33bb316577 [FIX] account_analytic_default_purchase: access error
- Activate Analytic Accounting
- Set the demo user with only the Purchase User access rights (no
  accounting access rights)
- Create a PO with demo

An AccessError is raised because the user has no access to
`account.analytic.default`.

We can use `sudo` to retrieve the default account. There is no access
rights error on `account_analytic_id` or `analytic_tag_ids` later on.

Fix the `company_id` at the same time.

opw-2171813

closes odoo/odoo#43431

X-original-commit: ef5cc35b50e54ea3d161897bbb089dedb68e36a1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-16 15:51:15 +00:00
Nicolas Martinelli 206b197cc9 [FIX] website_form: remove evaluated domains
- Install helpdesk_stock
- Publish the team Customer Care on the website
- Edit the ticket submission form
- Add the field 'Lot/Serial Number'

A crash occurs because of a malformed domain.

It happens because the domain is a string, and therefore should be
evaluated.

We remove the string domains since it won't be possible to evaluated
them in the website form anyway.

opw-2176144

closes odoo/odoo#43427

X-original-commit: abc85e176e337f61926d92cdf33680037af1dd96
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-16 15:12:21 +00:00
Jorge Pinna Puissant 6977f85d2f [FIX] website_sale_digital: limit attachment search
Before this commit, in a sales order preview, a search is performed to
search all the attachments in invoiced products or free products.

Now, the search is only performed if the product is a digital product.

opw-2172563

closes odoo/odoo#43434

X-original-commit: 2c9e7832a02d2e4e2f219e979dd8ae3cbaa77bd9
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-01-16 16:15:08 +00:00
alt-odoo 0bea630c98 [FIX] website_sale_digital: access rights error in preview order page
In preview order page, we are looking for product attachments, but if we are
using public user, we get an access rights error leading to a 403 page.

opw-2172563

X-original-commit: d07800eadf49e75c249f9a28aca2412b6b106793
2020-01-16 16:15:07 +00:00
Jorge Pinna Puissant dd9f893d67 [FIX] website_sale_digital: search domain for attachment count
Before this commit, the search domain returns no results.

Fine-tuning of 62c9dedafd

opw-2172563

X-original-commit: f3d178c329eeb4d840c24801247fc5da39df998c
2020-01-16 16:15:07 +00:00
Simon Lejeune 50cbaef2dd [REF] stock_landed_costs: domain on transfers
The previous domain was too naive: a receipt is not always valued
(inter-warehouse transfer) and even a receipt that should be valued
isn't always (receive goods you do not own, change your config from
manual to automated and then apply the lc on an old receipt, etc.)

Enforce a domain making sure the transfer is valued.

related opw-2165697
task-2169844

closes odoo/odoo#43410

X-original-commit: c6aa61b22a18c3f110baa7ed3c97e275b21e5329
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-16 12:07:42 +00:00
fja-odooandqsm-odoo 218e1cad61 [IMP] web_editor, *: allow saving of snippets
* website, mass_mailing, website_event, website_form,
  website_mass_mailing, website_sale

Now the user can save snippets to use them on other pages.

task-2120409

closes odoo/odoo#40408

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-01-16 14:29:04 +00:00
Sapan Zaveri 4946739c17 [IMP] base_import: improve preview table UI
Task 1919628

closes odoo/odoo#30430

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-01-16 13:38:02 +00:00
Goffin Simon 4734315aad [FIX] product: Searching prodcut on internal ref when archived
Steps to reproduce the bug:

- Let's consider a product template P with an internal reference = I
- Archive P
- In the list view of product template select the Archived filter and
search for I with the Product filter

Bug:

P was not found.

opw:2169441

closes odoo/odoo#43414

X-original-commit: 051e8581ba05ed0e5762b6e7e18a78179822146d
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-01-16 12:52:32 +00:00
fja-odoo a8d1a9a782 [IMP] web_tour: add new "text_blur" action for tours' run method
The 'text' helper does not focus out of the inputs after adding the
text. The new 'text_blur' one will.

It will be needed for future tasks of the website editor since the
inputs in the left panel are only considered on blur or on ENTER.
See https://github.com/odoo/odoo/pull/42189 for example.

closes odoo/odoo#43337

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-01-15 12:17:04 +00:00
Yannick Tivisse daaf5f00d2 [FIX] sale_timesheet: Ignore cancelled invoices to compute qty_to_invoice
closes odoo/odoo#43359

Related: odoo/enterprise#7747
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-15 15:36:21 +00:00
Yannick Tivisse 0392e4e62d [FIX] sale_project: Link generated task to SO 2020-01-15 15:36:21 +00:00
jbm-odoo 79cdcd13c8 [IMP] sale_timesheet: Move not invoiced time sheet to new SOL
Description of the issue/feature this PR addresses:
There is no easy way to re-assign the time sheets to the correct SOL (changing
the task's SOL does not change the non-invoiced time sheets automatically)

Current behavior before PR:
On a project, if a user put a wrong sale order line, and after that he changes
this SOL, the timesheet line will not be moved.

Desired behavior after PR is merged:
On a project, if a user put a wrong sale order line, and after that he change
this SOL, all non invoiced timesheet line will be moved to new line.

TaskId: 2144703
2020-01-15 15:36:21 +00:00
Odoo's Mergebot 5f65d9c9fc [FW][MERGE] project, hr_expense: Fix several multi-company issues + tests
Purpose
=======

Fix multi-company access issues following the big changes that happened
(the 13.0). Make the usability better in order to avoid potential
multi-company issues for the user.

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

Check the related commits to see the different fixes that have been
made. For more information about the technical/functional considerations,
check the related task.

closes odoo/odoo#43321

Taskid: 2088891
Forward-port-of: odoo/odoo#43230
Forward-port-of: odoo/odoo#42418
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-16 14:20:37 +01:00
Nicolas Martinelli 4775192027 [FIX] mrp: UOM on unbuild order
Keep the same UOM than the MO.

opw-2169377

closes odoo/odoo#43407

X-original-commit: 942154b3140cb3fc92e8aeff0241149e701581a7
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-16 11:48:22 +00:00
Barad Mahendra d16aa4cd39 [IMP] (hr, sale)_timesheet, pad(_project): improve project general UX
Purpose fo the task is to improve the UX of timesheet, project and task.

Done the chages for below point:
  - improve the stage demo data to unified the project stage
  - on the task timesheet 'sub-tasks hours spent' should be clickable
and on click, it will display the list of subtask timesheet.
  - display in warning tasks for which Remaining Hours < 0 if Planned Hours > 0 in task list view
  - improve the settings of collabrative pad and planning and project form view

Task-2129052

closes odoo/odoo#41092

Closes: #41092
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-16 10:56:05 +00:00
Benjamin Vray de4d7e14f8 [IMP] website: review snippet rating
Adding more control on the rating snippet. Choose the color, select
other icons in media dialog, no limit to add active or inactive icons,
display the rating inline or below the title.

task-2146209

closes odoo/odoo#41169

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-01-16 10:37:35 +00:00
fja-odoo 47441a9228 [FIX] web_editor: save all child text nodes of oe_structure elements
When saving the content of an oe_structure, the starting text nodes
were lost because only the internal *elements* were considered. Ending
text nodes were kept since they are considered as the last element's
tail by the etree library.

task-2040764

closes odoo/odoo#43375

X-original-commit: eb71d25ce965ecdb20c26517627aed5b43f8b990
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-01-15 17:46:02 +00:00
Goffin Simon d595337889 [FIX] point_of_sale: Print invoice in POS
Steps to reproduce the bug:

- Let's consider two sales taxes T1, T2
- Create Fiscal Position FP which maps T1 to T2
- Create Product P (Customer Tax: T1)
- Configure FP as default fiscal position and Invoicing to print invoice in POS.
- Create POS order with any customer, with P and FP
- Select Print Invoice in the payment window
- Process the payment
- Order Preview displays T2 as expected

Bug:

The printed invoice displayed T1 instead of T2 on the invoice line

opw:2171599

closes odoo/odoo#43356

X-original-commit: b26a8d1b8f5c8b700a4a48f3698ac2d109628db4
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-01-15 14:51:12 +00:00
Goffin Simon ffde4c8f89 [FIX] website_sale: Creating an account on the eCommerce
Steps to reproduce the bug:

- Go to Settings > General Settings
- Set "Customer Account" on "Free sign up"
- Go to Website > configuration
- Activate "Digital Content"
- Create a fiscal position FP with a coutry group CG and applied automatically
- Create a service product P with digital content DC at sales price = 0
- Publish P on the website
_ Log out and go to the shop with public user
- Add P in your cart
- Process the your Order in the shop
- When the order is confirmed, click on "Downloads"
- You will be redirected to the login page
- Click on "Don't have an account?"
- Fill in the form and sign up

Bug:

Nothing happened because in function sale_get_order in model 'website'
the partner on the confirmed SO was not the same as the new one and so
update_pricelist was set to True and a call to function _cart_update was
done on a confirmed SO. Inspired from function _cart_update in model
'sale.order'.

opw:2146902

closes odoo/odoo#43362

X-original-commit: 1f6a4e56442ba5531f87269ab032f99218fc45a2
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-01-15 15:26:59 +00:00
Luc De Meyer f08204c69c [FIX] account: don't overwrite statement_line_id when reconciling transfer account
Description of the issue:

Transfer between Bank1 (550001) and Bank 2 (550002) of the same company via the intercompany bank account (580000) :

Bank 1: minus 1000 EUR, we create the following accounting entry via the reconcile widget

account 550001 credit 1000
account 580000 debit 1000

Bank 2 : Plus 1000 EUR

When we select the counterparty 580000 entry of the Bank 1 statement via the reconcile widget
than the statement_line_id of the entry from Bank 1 statement is replaced by the one of the Bank 2 statement.
Hence this account.move.line is linked to the wrong statement line.

closes odoo/odoo#43371

X-original-commit: 3d74e7397e15311f1e9189589a435d9683376317
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-01-15 16:36:27 +00:00
Nicolas Lempereur b239201190 [FIX] *: avoid muting res.users().context_get return
Some code modify return of res.users().context_get, but this is a
cached method so this will unexpectedly affects totally unrelated code.

For example, changing the company with the company switcher could add
`allowed_company_ids` inside the cache, then it will be cached until the
server is restarted, even if we change company again inbetween.

Added test failed with:

"NotImplementedError: '__setitem__' not supported on frozendict"

on the line with `User = User.with_context(context)` where User already
contained `allowed_company_ids` in its context.

note:

in this forward-port, context_get is also changed to return frozendict
and prevent being able to have an unexpected issue by code that modify
context_get returns.

opw-2158340
closes #42465

closes odoo/odoo#42723

X-original-commit: 5d69885c1cd6921b3de00aae7e0ed6fff243ff95
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-01-15 16:19:03 +00:00
fw-bot fccaa703c4 [MERGE] project, hr_expense: Fix several multi-company issues + tests
Purpose
Fix multi-company access issues following the big changes that happened
(the 13.0). Make the usability better in order to avoid potential
multi-company issues for the user.

Specification
Check the related commits to see the different fixes that have been
made. For more information about the technical/functional considerations,
check the related task.

Taskid: 2088891
X-original-commit: 5c8df3a5e5f7960e5eab6439e0a32a06224ba826
2020-01-15 15:11:50 +01:00
yhu-odoo 4a1dfb50b7 [REF] stock_account: valuation layer and not admin user
missing bit from rev[0], [1], and [2]

[0] 7ef11e3
[1] d6c8c34
[2] 5096e72

closes odoo/odoo#43186

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-15 09:02:42 +00:00
yhu-odoo c87275a69f [FIX]stock_account: stock manager group not inherit account bill group
The inheritance of account billing group gives stock managers the access
to account module.
This commit is to remove this inheritance. When we need to access
account.move model, check if the user is a stock manager. If so, use
sudo() to get the access.

PR #43186
Task 2062611
2020-01-15 09:01:45 +00:00
Benjamin Vray 76afbf9321 [IMP] website: show internal drag&drop zones of dropped snippets
- Apply the style of drag&drop zones (.oe_structure.oe_empty) even when
  it is a descendant of the editable element, not the editable element
  itself. This change allows to add a visible drag&drop zone in any
  snippet.

- Add the editor messages (data-editor-message) on drag&drop zones when
  a snippet is dropped (not only on editor start as before).

In preparation of task-2152185

closes odoo/odoo#43358

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-01-15 15:21:20 +00:00
oco-odoo aea045d446 [FIX] l10n_ch: don't assume the bank account of the company always has a currency_id
Since this field is not required on res.partner.bank (which is fine: we want it to be synchronized with the journal's currency, which is None if the journal uses company currency), the parameter received by validate_swiss_code_arguments ended out being an empty recordset in case the company was directly in CHF. This caused the QR code to never be displayed in this situation.

closes odoo/odoo#43351

X-original-commit: 60a55834b5ae0a8ac10914a243f97029d9921ae6
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-15 14:01:34 +00:00
fja-odoo 1aaf095a1a [FIX] website_sale: allow updates after product custom text edition
Custom text on product pages was part of the main template thus
preventing who modifies it to receive updates on the view.

task-2040764

closes odoo/odoo#37288

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-01-15 14:33:43 +00:00
Nicolas Martinelli d8d86b3438 [FIX] website_sale_delivery: correct price tag
Complement of 6a6a7e6e64a7e3727a6de1ca8d35361112d99de8

Display the price tag correctly on the eCommerce.

opw-2159838

closes odoo/odoo#43352

X-original-commit: 463d79a0f8f894f4481e59680eff7ea75a25fb46
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-15 14:20:04 +00:00
Nicolas Lempereur 1dc3301332 [FIX] mass_mailing: can unsubscribe in multidomain
The `unsubscribe` feature of mass mailings repose on having a link with
HREF attribute `/unsubscribe_from_list` inside the mail message.

When the mass mailing is sent:

- relative URL are replaced by absolute URL (`/unsubscribe_from_list` is
  replaced by `{system parameter web.base.url}/unsubscribe_from_list`)

- `{system parameter web.base.url}/unsubscribe_from_list` is replaced by
  the real mass mailing link containing info that will be used to
  unsubscribe the user.

But there was an issue in the case of multiple domain, if this scenario
happened:

- system parameter web.base.url is http://domain1
- a user use "Test" button on a mass mailing
- system parameter web.base.url becomes http://domain2
- the mass mailing is sent

The unsubscribe link is broken, this is because the implementation of
"Test Mailing" feature would update the mass mailing with absolute
links, so if the domain change, we the `unsubscribe` link will no longer
be found and replaced into the source.

opw-2124890
closes #42373

closes odoo/odoo#43308

X-original-commit: c5036bcb11fef8081f005fe4bd0025aea41401a8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-01-14 17:48:26 +00:00
Adrian Torres ee29cb9147 [FIX] tests: make --test-file great again
Sort of but not really, this commit fixes a special case in which
launching a --test-file of a file with at least two SavepointCases would
create a postgresql deadlock and it would be impossible to terminate the
Odoo process without sending a SIGKILL or waiting for the lock to
timeout.

This was introduced at #39368 and happens because of the way that
unittests unwraps suites, to keep it short, when it unwraps the custom
OdooSuite class internally, it ends up with a vanilla TestSuite with
which to run the different test cases, and since #39368 depends on the
overrides added to OdooSuite to function, the class cleanups are not
triggered at the end of a test class (rollback, cache cleanups, env
reset, registry reset, etc.).

The fix is to manually unwrap the suite of tests to keep OdooSuite as
the suite with which to call the tests, which was already done for
--test-enable (although for different reasons, --test-tags?) which is
why --test-enable didn't have any problems.

This commit also fixes a typo I found on the backport, which meant
classCleanups were not being executed if the setUpClass failed, but it
had no effect on classCleanups during tearDownClass.

Task-ID 2160398
Depends on #43135

closes odoo/odoo#43296

X-original-commit: 7a5ded7d40afc29043d356b5dece0dbe1fbd5ab3
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-01-14 16:26:50 +00:00
Xavier Morel 80896a0bf3 [FIX] core: chrome doesn't abide by --http-port anymore
An http-port provided on the command line (may also have been an issue
for config files, didn't check) would not be taken in account anymore,
because `odoo.tests.common` would be imported during the import of
`odoo` itself (when loading odoo.service.server), itself importing
`odoo.tools.config` leading to a default configuration being set up.

* remove `odoo.tests.common.PORT`, `config['http_port']` should be
  used always
* defer the import of odoo.tests.common by moving it inside
  load_test_file
* stop generating default configs

closes odoo/odoo#43283

X-original-commit: 45871f498ea4cf3ada719692e69cd413883ab442
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-01-14 13:15:04 +00:00
Victor Feyens 2e2e877ae5 [IMP] product: product_variant_count shouldn't be editable.
closes odoo/odoo#43305

Related: odoo/enterprise#7718
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-01-14 17:16:20 +00:00
Victor Feyens 26779271e6 [FIX] mail: env.company_id has been replaced by env.company
closes odoo/odoo#43307

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-01-14 17:36:45 +00:00
Katherine Zaoral cb97a92e42 [FIX] l10n_ar: Fix responsibility of Foreign partner
The Foreign partner used in demo data was wrognly configure, it was set as "IVA Responsable Inscripto" when actually should be "Cliente / Provedor del Exterior".

After fix this in demo we updated the demo data of the vendor bills of this partner to match with the new responsibility.

Also apply and imporve in the way we are setting the fiscal position in the demo invoices, now qw use the onchange instead of setting the fiscal position explicitly in the demo invoices (and removed commented demo data that is not used)

closes odoo/odoo#43301

X-original-commit: 23e2824794b64624c8dbb1b8132d443657781830
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-01-14 17:01:09 +00:00
Lucas Lefèvre 7059b177ee [IMP] project: Following a private project no longer required
=======
Purpose
=======

Currently for a user to be allowed to see a private project they must follow the
project. This means that they will be added as a follower of all new tasks in the
project which causes them to receive 1000000 notifications, especially if there are a
lot of tasks in a project.

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

1) Add an Employee m2m field on project next to 'Invited Employees'
    - only visible if the 'Invited Employees' option is selected
    - the project should only be visible to employees selected there (regardless if they
      are followers or not)
2) Add an Employee m2m field on tasks below the 'Email cc' one in debug mode
    - only visible if the 'Invited Employees' option is selected on the related project
    - should be pre-filled with what is set on the project
    - the task should be visible to employees selected there (regardless if they are
      followers or not)
3) Add a Portal users m2m field on project next to 'Portal users and all employees'
    - only visible if the 'Portal users and all employees' option is selected
    - the project should only be visible to portal users selected there (regardless if
      they are followers or not)
    - rename the option into 'Invited portal users and all employees'
4) Add a Portal users m2m field on tasks below the 'Email cc' one in debug mode
    - only visible if the 'Portal users and all employees' option is selected
    - should be pre-filled with what is set on the project
    - the task should be visible to portal users selected there (regardless if they are
      followers or not)
5) Following a project/task should not grant the user/employee the ability to see the
   project/task

Task 2031527

closes odoo/odoo#40505

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-14 16:26:32 +00:00
Nicolas Martinelli 1227e40776 [FIX] stock_landed_costs: prevent crash
Prevent crash if `stock_valuation_layer_ids` is an empty recordset. Note
that the original issue is solved with #43017, but requires an upgrade
of the module.

opw-2172049

closes odoo/odoo#43289

X-original-commit: 8a1ce12aee326b59f33f48804a4cfca61dab7506
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-14 14:41:57 +00:00
Nicolas Lempereur b048a6fc27 [FIX] web: widget noreset if rerendered for modifier
If we have a many2many_tags widget that is writable then becomes
readonly, we can have in the code this chain of event:

- get list of widgets we need to reset some data for
- apply modifiers
- reset the widgets

but applying modifiers can delete a widget (eg. an editable field that
becomes readonly), so when resetting we could call code on a deleted
widget which caused an error.

For example, if we have an attribute:

 `<field widget="many2many_tags" attrs="{'readonly': 'condition'}"/>`

if the field goes from editable to readonly and is affected by an
onchange, we will call `setIDForLabel` on the deleted instance of the
widget which will cause an error.

Added test without fix fails with error:

  TypeError: Cannot read property 'attr' of undefined
    at Class.setIDForLabel (/web/static/src/js/fields/abstract_field.js:324:35)

because as said, the function is called on the editable widget that is
removed and replaced with readonly widget at that point.

opw-2154471
closes #43137

closes odoo/odoo#43244

X-original-commit: 6f5ca16524be7c5bb45b03e7421154a20edc4cf6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-01-13 17:59:30 +00:00
fja-odoo ac930249ba [IMP] web_editor: update left panel UI *after* onFocus method call
Call the `onFocus` method before the `updateUI` one so that we can
make changes before we update/render the UI (so that `updateUI` may
be influenced by something done in `onFocus`).

Needed for upcoming task: https://github.com/odoo/odoo/pull/42189

closes odoo/odoo#43334

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-01-15 12:02:50 +00:00
Julien Mougenot dc716ea42b [ADD] web: add getCookie in test_env
Allow components to access a default empty function when calling getCookie.

closes odoo/odoo#43125

Related: odoo/enterprise#7643
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-01-15 11:31:17 +00:00
Julien Mougenot c146af8a6d [REF] web: home menu template event names to kebab
Changed the event names to comply to Owl standards.
2020-01-15 11:31:17 +00:00