Commit Graph
135151 Commits
Author SHA1 Message Date
Thibault Delavallée cee2b11da2 [FIX] event_*: remove now unnecessary copy=True
Commit 397872a07f remove most onchange in event related modules to replace
them by computed r+w stored fields. At that time copy was by default set to
False for computed fields as resulting of standard behavior.

Since 4b274d3b4101fbae154a572cdf40d23838899773 this is not True anymore as we consider those fields are
duplicable. We can therefore remove unnecessary copy=True on fields to clean
their definitions.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: c6b378987bd3351deba7770b51c2a5755f7ff341
2020-04-03 11:07:56 +00:00
Thibault Delavallée bc1b5e134b [FIX] website_event: better sold out computation
Purpose of this commit is to remove some complex check embedded in templates
and replace them by a computed unstored field. It eases definition and
understanding.

Its computation has been cleaned, so that sold out appears only when tickets
are really sold out, not if their end sales date is reached. Sold out label
is displayed in both event list and event specific page views in frontend.

Small spacing issues in frontend registration form are also fixed.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: c36cf90e7b83d2424b2f52ad8a2fec0bf367e8d8
2020-04-03 11:07:56 +00:00
Thibault Delavallée b29b4bcbfc [FIX] event: ensure event_registrations_open can always be computed
Using a compute_sudo ensure this field is correctly computed (aka without
crash) if someone is allowed to read the event but not all its sub models.
For example event_registrations_open reads the active flag of a product
linked to a ticker which may not be readable by public users. This field
is used in frontend templates and therefore usable by external people.

Also remove unnecessary registrable rendering parameter in website_event
as it has been replaced by computed fields.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: b2b334a65f3a1379f25717ec39f0a52f3305b19c
2020-04-03 11:07:56 +00:00
Thibault Delavallée d2840a0519 [FIX] event: include timezoned event date_end in registration open computation
Purpose of this commit is to try to lessen random conditions being concatenated
in templates by correctly computing event_registrations_open field that is
now correctly based on

  * event.date_end -> if event is done, registrations are not open anymore;
  * event.start_sale_date -> lowest start date of tickets (if any; start_sale_date
    is False if no ticket are defined, see _compute_start_sale_date);
  * any ticket is available for sale (seats available) if any;
  * seats are unlimited or seats are available;

Some better timezone computation is included even if it could be done better.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: a11af9074499465b6dd8ad1400e60c7af96e21c7
2020-04-03 11:07:55 +00:00
Thibault Delavallée 55c8367ce7 [IMP] event: add some test for is_ongoing with timezones
Rumors were heard of is_ongoing not working well. First try with playing
with timezones.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: d54faa336da29ff3167edb2331edd3e2508bc64f
2020-04-03 11:07:55 +00:00
Thibault Delavallée 844909b0f1 [IMP] event: improve backend views and help strings
Embedded tickets view: improve labels, start and end dates are now labeled
Sales Start and Sales End when having sale installed.

Help are added on event_registrations_open and start_sale_date to clearly
define what they mean.

Some linting is also performed to ease readability, notably some computed
fields reorganization to have them ordered by group like fields.

Task ID 2228189
Community PR odoo/odoo#48652

X-original-commit: e2deabc451aa2d62365b1e1b43ea3947907d2648
2020-04-03 11:07:55 +00:00
Nicolas Martinelli bc129637bb [FIX] mrp: False barcode
- Create a MO for a product tracked by S/N
- Perform the MO
- Print the 'Finished Product Label (PDF)'

The barcode printed is `False`.

If the S/N is not set on the `move_line`, we should fall back on
`lot_id.name`.

opw-2228337

closes odoo/odoo#48949

X-original-commit: fb69b5a99becd92ee0ee7698709da05a0b33850f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-03 09:41:23 +00:00
Xavier Morel 6c4e4981bc [IMP] core: remove odoo.tools.safe_eval._get_opcodes
It's not necessary anymore as all supported Python versions implement
get_instructions, and inlining the usage of that is as readable as
calling _get_opcodes.

Also use the subset/superset predicate for validity testing instead of
difference as it's a fair bit faster:

    ❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5))' 's2 - s1'
    5000000 loops, best of 5: 88.3 nsec per loop
    ❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5, 15))' 's2 - s1'
    2000000 loops, best of 5: 159 nsec per loop
    ❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5))' 's1 >= s2'
    5000000 loops, best of 5: 71.1 nsec per loop
    ❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5, 15))' 's1 >= s2'
    5000000 loops, best of 5: 53.6 nsec per loop

we're paying double in the failure case but that doesn't super duper matter
because we're raising an exception and bailing out, the 24% gain on the
happy path seems more relevant.

closes odoo/odoo#48948

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-03 09:35:08 +00:00
Andrea Grazioso (agr-odoo) 366a7d6115 [FIX] sale_project: be able to create fsm projects from sale order
Install project,sale_management,industry_fsm
Create a new product with:
- Product type: service
- Service Invoicing Policy: Timesheets on tasks
- Service Tracking: Create a task in sales order's project
- Project Template: Field Service
Save, then edit also Field Service chaning Bill from Tasks to the new
product
Create a sale order with such product, save and confirm

Error Message "An FSM project must be billed at task rate"
will popup blocking the action. This is due to changes introduced in
071711bf1db82ae7fc65dcc1292da6ef82278168 (enterprise commit), new fsm
projects should not have a sale order line, instead rates are derived
from the tasks.

This commit refactor the code of '_timesheet_create_project' to make
possible to override project creation values. In the counterpart commit,
in enterprise, the sale order line id will be removed to match the behavior
of 071711bf1db82ae7fc65dcc1292da6ef82278168

opw-2220184

closes odoo/odoo#48936

X-original-commit: 4094cb12a617df99fdc7d6d8796568217c34c175
Related: odoo/enterprise#9645
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-03 08:35:21 +00:00
Nicolas Lempereur 28f99db1e8 [FIX] web: no false positive "drag and drop on month mode with all_day mapping"
The "Views > CalendarView > drag and drop on month mode with all_day
mapping" test would fail regulary with "Found 2 elements to click on,
instead of 1" because the drag and drop would be ongoing and the event
would sometimes appear two times in the DOM when we try to click on the
drag and dropped event.
closes #48928

closes odoo/odoo#48937

X-original-commit: 9bc0b11b2e255852c1376fe6fa87722186681a73
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-03 08:35:55 +00:00
jvm-odoo 8c888caeab [FIX] sale: fix quantity input in SO template
This commit is a fine tuning of 348a5d0a6.
It fixes the same issue but for larger screens
with some themes (e.g. Orchid).

When there are big button to chose the quantity,
this padding is hiding the input's text.

Another solution would be to remove `width: 50%`
but I found that removing the padding is prettier.

OPW-2220893

closes odoo/odoo#48934

X-original-commit: 105a34accc6123cfb6be9738858499737df95613
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-03 07:41:15 +00:00
Samuel Degueldre 0c9eb9e5c7 [FIX] web_editor: fix dialogs (link, media, alt, crop) not opening
In 3f4092d837d50d25d6c9630d84f67545cf586c7a, the SummernoteManager that
was previously owned by RTE was removed, this was because the wysiwyg
already has one. One problem with this however is that when an editor is
created in an iframe, the wysiwyg is instanciated outside, while the
editor is instanciated inside. This means that they don't have the same
core.bus to listen for and trigger events, such as those used to open
the various editor dialogs. This commit fixes that by always using the
top-level core.bus when opening dialogs. This also has the advantage
that the dialogs are no longer confined to the iframe and can take up
the whole screen, making them more comfortable to use.

closes odoo/odoo#48932

X-original-commit: 68ac735aa7e17e66910f51706829035697dfcc1e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-03 07:21:20 +00:00
Benjamin Vray 98161fc61a [FIX] web_editor: fix updateui method
replace the "return" with "continue". What should have been done when
the loop that was originally a "foreach" became a "for" loop.

closes odoo/odoo#48919

X-original-commit: 8af8e6ddb2be9a0c57356d075e092b8da42662f0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-02 23:54:12 +00:00
Adrian Torres 0cb6f111b8 [FIX] payment_*: reset payment acquirers to default on uninstall
The `payment` module introduces a certain amount of payment acquirers,
each one corresponding to a `payment_` module.

When a `payment_` module is installed, this data is updated so that
payments done with the corresponding acquirer change in behaviour using
the provider installed by the `payment_` module.

When a `payment_` module is uninstalled, this data should be reset to
default, more especifically the `view_template_id` and the `provider`
fields of `payment.acquirer`.

This was not possible before this commit, and more importantly it would
make the uninstallation of such `payment_` module impossible as the
`view_template_id` is a required m2o ondelete='set null', which will
make the registry crash. Even if the former wasn't a problem, the
provider field would remain set to a non-existing selection option,
which would make the registry crash (eventually, when checking a record
with such a selection option).

With this commit, we reset these fields to their default value upon
module uninstall.

In 13, the issue with `view_template_id` should be fixed, as required
m2o that are ondelete='set null' are no longer possible. As for the
provider Selection field, a fix should arrive in master soon.

opw-2225333

closes odoo/odoo#48916

X-original-commit: 4f0c1c1bfd71dd1ff6793d0a91b49984c54d1351
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-04-02 21:47:21 +00:00
Samuel Degueldre bf9d864fb0 [FIX] website: fix logo not supporting new image url format
In a recent commit, we decided to change the image url format generated
by the media-dialog to leverage browser caching using unique.
Unfortunately, when saving an img tag to a binary field, the url parsing
did not support this new url format, causing a traceback when changing
the website logo and attempting to save.

closes odoo/odoo#48914

X-original-commit: 9c618c7f903f1a0b32e067cfd713cd39762250f9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-02 18:49:03 +00:00
Andrea Grazioso (agr-odoo) 9ae9e7e0a6 [FIX] mrp: fix bom products quantity calculation in list view
Go to inventory>product variants (list view), search for
'FURN_78236'.
Set quantity on hand (qty_available) 50
Now, back in list view, adjust your search to FURN_7

QTY on hand for FURN_78236 is 0.

This occur because during the computation of qty_available, the bom
kits (FURN_78236) are calculated first, but the qty_available depends
on the bom lines products, which are calculated only at the end.
Since qty_available became protected by the global environment, it
cannot be recomputed recursively and it is not in cache, thus is 0.

Making the simple products compute first in the _compute_quantity fix
the issue

opw-2226417

closes odoo/odoo#48924

X-original-commit: f41c650f162021bb6c76736c7dcbe4eee059cec1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-03 06:25:37 +00:00
Benjamin Frantzen (bfr) d1bbf11af2 [IMP] account: usability of account.move form view
- moved company_id in other info tab
- currency_id is shown near journal_id
- invoice:
-- ref renamed to 'customer reference' and move to other info tab
-- payment_reference hidden if state is draft
-- Fixed bug in l10n_in where xpath did not find removed element
- vendor bill: auto-complete only shown in edit mode

was task:2209497

closes odoo/odoo#48913

X-original-commit: 170635c901914cfe8f33fdbe8d498cbd5f54054e
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-02 18:48:39 +00:00
Nicolas Martinelli 56a8ea9422 [FIX] sale_stock: UoM of forecast stock
- Activate Multi UoM
- Create a product P with 120 Units in stock
- Create a SO for 1 Dozen

120 Dozens are expected in the forecast widget instead of 10 Dozens.

This happens because the various product quantities are always expressed
in the product UoM:

https://github.com/odoo/odoo/blob/c95fad77ea5b4663130e256f76031560171f09e6/addons/stock/models/product.py#L190

We add a conversion when necessary.

opw-2224335

closes odoo/odoo#48885

X-original-commit: 39eab482c765ce0404c2c689aa522a023cac284e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-02 13:30:30 +00:00
Lucas Lefèvreandaab-odoo 1248292630 [FIX] web,*: Remove undefined domain in action menu context
*google_drive

Go to a user form view and click on "Change Password" in the action
menus.
=> traceback `Cannot read property 'constructor' of undefined`

This error is raised because `active_domain: undefined` is in the context
and py_eval can't handle an undefined value.

closes odoo/odoo#48915

X-original-commit: 69694c627be42e3d068e48be14026493628a3a8d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
Co-authored-by: aab-odoo <aab@odoo.com>
2020-04-02 21:06:25 +00:00
Paul Morelle a768937a39 [FIX] website_form: adapt to Bootstrap new API
Since Bootstrap 4, a popover object does not have an `option` attribute,
as it has been renamed to `config` instead.
This occurrence must have been missed out when we migrated.

closes odoo/odoo#48911

X-original-commit: 662dd304d5a46a028ce74864076361865d759080
Signed-off-by: fja-odoo <fja-odoo@users.noreply.github.com>
2020-04-02 16:06:12 +00:00
Laurent Smet 4ba265a328 [FIX] account: Recompute the account set on payment terms when changing the partner.
- Create an invoice without partner.
- Set a custom receivable account.
- Set a partner => the account used as payment terms is not recomputed that is wrong.

closes odoo/odoo#48898

X-original-commit: 33de1c8f5e459eb26194736c17c053dce3a1c206
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-04-02 14:33:34 +00:00
Raphael Collet 962412c309 [FIX] test_website: upgrading inside a test is really not a good idea
Because: (1) the upgrade starts by committing the current cursor; then
(2) the upgrade instanciates a new registry to use for the database; and
(3) the test cleanup involves setting up the old registry, which creates
a new environment referring to the new registry!

The points (2) and (3) makes the field setup crash when it relies on
data stored on the registry itself: the field in the old registry tries
to set up with data stored on the old registry.

closes odoo/odoo#48920

X-original-commit: f5e5aba9e203b42b661cc3b503fd37051ec20f93
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-04-02 23:54:32 +00:00
Raphael Collet 46b7fb5984 [FIX] core: do not register classes when _module is falsy
The goal is to avoid a class from being added in the dictionary
`MetaModel.module_to_models`.

We use this feature in tests to prevent classes extending models from
triggering bugs when reloading the registry (for whatever reason).

X-original-commit: 12db61b787b2035bf0c1f2a68a24449d484744c8
2020-04-02 23:54:32 +00:00
Christophe Monniez 0f7d670434 [FIX] web: skip calendar timezone qunit test until fixed
closes odoo/odoo#48909

X-original-commit: 889dd9245eea4a06faf5aae81a47971f9db4b93f
Related: odoo/enterprise#9634
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-04-02 15:50:51 +00:00
Florent de LabarreandNicolas Lempereur a72bf31d0b FIX] web: allow section and subsection in report
In 10.0 having a `section`, `subsection` or `subsubsection` on a footer
element would replace the content with the page top three level of
headings.

This was removed in 11.0 with b446930dc after which only `page` (current
page number) and `pages` (total number of page) classes would work.

This commit reintroduces the above-mentionned classes.

opw-2226700

closes odoo/odoo#48888

X-original-commit: 14c6b947ecf222524a577ec6a40d4a6e283aa2ad
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
2020-04-02 13:43:07 +00:00
Martin Trigaux ad54273e9c [FIX] mail: sanitize activity notes
The note content was not sanitized against HTML content.
This is not considered as a security issue as an activity can only be
created by trusted employees, however there is no reason not to
sanitize it.

Courtesy of Lauri Vakkala, silverskin

closes odoo/odoo#48889

X-original-commit: 970b460295c3d33dbb089ef6b7224b472e6b568d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-02 13:49:26 +00:00
Odoo's Mergebot 1fe591e755 [FW][IMP] *: keep batch records creation for better performance.
`Products` and `Stock Move Lines` are main models, for which the creation is batch happens frequently.  Their creation in batch shouldn't be split because of one "create single" override.

closes odoo/odoo#48874

Forward-port-of: odoo/odoo#48838
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-02 16:50:34 +02:00
Victor Feyens 1977f6618b [IMP] mrp_subcontracting: create stock move lines in batch
X-original-commit: e721dc6c25c52ae18aa74b3ffc4cc366b45b16f5
2020-04-02 13:53:04 +02:00
Victor Feyens 475abff87b [IMP] hr_expense: create products in batch
Products are created in batch, unless hr_expense is installed, because its create
override isn't defined and implemented for batch creation.

Because products creation in batch can be up to 10 times faster than creation record
by record, it is important to ensure the creation of products is always done in batch.

X-original-commit: e8e34ed5b66274264c27e9a379a7857e086e5264
2020-04-02 13:53:04 +02:00
Nicolas Martinelli c7f3d25adf [FIX] website_partner: translate short description
Similar to 186b599246321465eae937b875b6c970656b145a

opw-2229306

closes odoo/odoo#48873

X-original-commit: ac5f269fc514a041f51b5ad2039ac80b37f25abd
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-02 11:44:08 +00:00
Florent de Labarre 857aaef011 [FIX] doc : missing state on ir.actions.server examples
closes odoo/odoo#48871

X-original-commit: 7f806fd661f373201396861b77b64a71decf52a9
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-02 11:29:04 +00:00
Goffin Simon 14ca304aed [FIX] purchase: Supplier currency in Vendor bill
Steps to reproduce the bug:

- Let's consider a vendor V with a supplier currency €
- Let's consider the current company's user C in $
- Let's consider two vendor bills journals J1 in € and J2 in $ from C
- Create a vendor bill for V

Bug:

The default currency was $ instead of € and the default journal was J2 instead
of J1. This fix keeps the same behavior as implemented in 82794c8662

opw:2226115

closes odoo/odoo#48857

X-original-commit: 801182f6222521c2961560b3b67743a143a22eff
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-02 10:34:54 +00:00
Florent de Labarre fa896ff452 [FIX] stock: search on complete name
Using the `complete_name` allows searching more easily in case several
sub-locations have the same name.

Closes #38733

closes odoo/odoo#48846

X-original-commit: 764433669b8b9d675bd9e3ec6668c4b166901534
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-02 09:36:39 +00:00
oco-odoo 70da147e9b [IMP] account: bank account journals form: hide related fields when bank_account_id isn't set
Showing these fields does not actually make sense when bank_account_id isn't set as well, since setting them and saving will result in them losing their value (as they're actually related on an empty field). We need to hide them while bank_account_id is not set.

closes odoo/odoo#48842

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-04-02 09:07:50 +00:00
Goffin Simon c4636fe71b [FIX] webiste: No company in website Settings
Steps to reproduce the bug:

- Module website is installed
- Multi companies is set
- Go to Website > Settings
- Remove the company for the current website and save

Bug:

A traceback was raised

opw:2228183

closes odoo/odoo#48839

X-original-commit: 2c27b9d100c1f3759bfe864f8ac78bc5c0436ecd
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-02 09:03:09 +00:00
alt-odoo f72c5feccc [FIX] account: wrong journal for cash basis entry
In some situations, the context can contain a default journal id. When creating the cash
basis entry, we are correctly retrieving the Cash Basis Journal for the account.move, but
as we do not explicitly set the journal on the account.move.line also, it is using the
context default value for journal_id (usually the customer invoices journal). As journal_id
on account.move.line is a related field to journal_id of account.move, we are wrongly
updating it. We should populate journal_id on account.move.line explicitly to avoid this.

closes odoo/odoo#48837

X-original-commit: 73bcbdfddf0751d9aba27c9d101f60e6e844edb2
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-04-02 09:01:21 +00:00
Pierre Masereel c121a22756 [FIX] product, point_of_sale: remove error when no logo and layout
Since the wizard to set a logo and chose a layout has been removed, we
don't need anymore to throw an error if they are not set because the
report can be generated.

closes odoo/odoo#48831

X-original-commit: b7c7039667d9ec816e647a0dd30570a4a690cca2
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-04-02 08:28:24 +00:00
alt-odoo a7e09fb05b [FIX] account: allow sending of paid invoice if no Accounting rights
If a user with Sales rights but no Accounting rights is trying to send an already
paid invoice, it will raise an access rights error before this commit while we
should allow him to send it without error.

closes odoo/odoo#48820

X-original-commit: 27cb9197c6b64fb9cb8fe46a20d9557914045e59
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-04-02 07:45:20 +00:00
Goffin Simon 2a184ae62c [FIX] crm_iap_lead, crm_iap_lead_enrich: Uninstalling CRM
Steps to reproduce the bug:

- Let's consider an instance with crm_iap_lead and crm_iap_lead_enrich installed
- Uninstall crm

Bug:

An error was raised: ('Record does not exist or has been deleted.\n(Record: ir.model.fields(15085,), User: 1)', None)
because the field reveal_id is shared on model crm.lead and modules crm_iap_lead and crm_iap_lead_enrich are independent
from each other.

Inspired from https://github.com/odoo/odoo/commit/ff7efbb1e81cd6987601c03f0b75a37d2df8e331

opw:2224952

closes odoo/odoo#48813

X-original-commit: 80879be5d7ab863a097439df1cd61aa236edaca4
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-02 06:37:06 +00:00
jvm-odoo 7e2504ec0c [FIX] web_editor: fix makeLayoutInfo
Issue

        - Install Website
        - Edit your website

        Do this 8 times:
        - Add the block "Image - Text" under each product
        - Make image on left smaller and text longer
        - Edit the size/color of the title and the description

        There is some case where it will crash

Cause

        We override the method who gets the editor:
        `x = $('[data-note-id="' + list.last($target.attr('id')) + '"]');`
        When there is more than 9 editors in the page
        (because we edited 10 different HTML fields), we reach the
        editor with ID 10 but the code erroneously will not find the
        editor with ID 0

Solution

        Use this instead:
        ```
        x = $('[data-note-id="' + list.last($target.attr('id').split('-')) + '"]');
        ```

OPW-2218467

closes odoo/odoo#48810

X-original-commit: c95fad77ea5b4663130e256f76031560171f09e6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-02 06:12:04 +00:00
qho 4496ce31aa [FIX] base_geolocalize: access blocked by OpenStreetMap
The geolocation service from OpenStreetMap will not be unblocked until a
'meaningful' and identical user-agent added in the request.

opw-2221857

closes odoo/odoo#48805

X-original-commit: 9018039b835547ea4adbc32a23901214613a033a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-01 21:22:04 +00:00
jvm-odoo 9664c69825 [FIX] account: fix report invoice edit with Studio
Issue

	- Install Accounting & Studio
	- Accounting > Open studio
	- Reports > Invoices
	- Add a Field Column in the table
	  and drag it after "Description"

	Some elements are shifted, which
	causes inconsistency in the table

Cause

	In 924ca78068 we added
	a th "source document" with
	a td containing the value.

	In bc131c0cfb we removed
	the td but not the th.

	Studio adds hook after each th & td.
	Since there is th but no td, there is an
	inconsistency in the hooks.

Solution

	Remove the th from the view to avoid having
	a useless hook.

OPW-2226726

closes odoo/odoo#48798

X-original-commit: 351355c8cb8c64927b5f82d4c1e1deca74353305
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-02 11:52:12 +00:00
jvm-odoo aafee08bc6 [FIX] website: fix duplicating a snippet remove its id
Issue

	- Install website
	- Create a carousel
	- Duplicate it

	The second one doesn't work

Cause

	Because of this override:
	https://github.com/odoo/odoo/blob/13.0/addons/website/static/src/js/editor/snippets.options.js#L1635:L1637

	All duplicate IDs are removed but
	it should only remove the ID of a duplicated
	anchor

Solution

	Check if the target has `data-anchor` attribute

OPW-2222074

closes odoo/odoo#48790

X-original-commit: 6f0a4f1aea6ca78413d868f49b9ce105ce14e784
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-01 20:40:16 +00:00
Andrea Grazioso (agr-odoo) 222aa42512 [FIX] point_of_sale: do not reconcile 0 sum lines
- Have a clean V13 db with point_of_sale and account_accountant
- General Settings => Accounting => Check "Anglo-Saxon Accounting"
(debug mode)
- Choose or create a storable product P with category C
- Go to category C and set 'inventory valuation' to 'automated'
- Open a new POS session PS
- Sell product P with qty 1
- Pay
- New order
- Sell product P with qty -1 (refund)
- Pay
- Close session PS
- Validate session PS

Error "You are trying to reconcile some entries that are already
reconciled." will popup because the 0 sum AML is already marked as
reconciled. This can be fixed by avoiding asking reconciliation when the
amount_residual is 0.

opw-2177881

closes odoo/odoo#48799

X-original-commit: 2c5ef4ed7ea98f890f95f8892c8a0df64b88db98
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-01 20:55:36 +00:00
william a97a1d838e [FIX] account_analytic_default: defaults on invoice when coming from SO
opw-2226421

The analytic accounts are not set on creation of a new invoice from a
Sale Order, and when they are set, the default should not override the
values selected on the SO.

This commit reverts what was done in be7d1d7510bc94f949a4fc55a6038a83fb026147
which basically reverted what was done in 69bf61bbc991eee96e673316ae8c37e98e1b8a1d

closes odoo/odoo#48793

X-original-commit: 02c75a70458b45f213a2f26fb16d47e9470fecfe
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-01 20:43:00 +00:00
jvm-odoo 4cc5a1282e [FIX] website_forum: force image size in css to handle gifs
Issue

	- Preferences > Change your avatar with a big .gif
	- Install Forum
	- Go on a question

	The gif is not resized in the nav and in the post
	answer box

Cause

	In fact, all gifs are not really resized. They just
	look fine because there is CSS to handle the case
	where the server resize does not work.

Solution

	Do as it is done everywhere else, add CSS rules

OPW-2223260

closes odoo/odoo#48792

X-original-commit: 35137cea7fd0eef067749721ef808acd298e0aae
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-01 20:42:06 +00:00
Kevin Baptiste 6576aedc0d [FIX] sale_timesheet: add filters on Project Overview
This commit bring back the filters on Project Overview.

closes odoo/odoo#48780

Taskid: 2223820
X-original-commit: 047bf7f2c23157db1c6db3eaa650a43ca8404f63
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba-odoo@users.noreply.github.com>
2020-04-01 20:25:08 +00:00
Lucas Lefèvre cd52000113 [FIX] hr_timesheet: Fetch server time before render
1) Add a hidden optional field to the timesheet tree view.
2) Try to display that field by checking the checkbox.
=> the column appears then directly disappears.

Asynchronous calls (here: fetching the server time) should
always be in the `willStart` method.

Task 2204084

closes odoo/odoo#48775

X-original-commit: 39fa08c4d6a1b467b520bdd0f75950d2c33f4a2e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-04-01 20:17:30 +00:00
wan af2272ac56 [FIX] account: invoice analysis multicurrency + various imp
Task 2206699

* All the amounts are now expressed in the company currency
  - The amounts are taken from debit/credit on the aml
  - When opening the report for multiple companies, convert in the
    current company's currency
* New default view:
  - Group by month instead of category
  - Line chart instead of bar chart
  - Filter on customers
* Remove useless fields:
  - name
  - invoice_partner_bank_id
  - invoice_payment_term_id
  - residual (including taxes)
  - amount_total (including taxes)
  - nbr_lines as it is a generic feature
* Rename currency_id to the more correct company_currency_id
* Remove useless group_by clause from the SQL query

closes odoo/odoo#47066

Related: odoo/upgrade#1021
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-04-01 14:13:16 +00:00
hpr-odoo 5398aca0f9 [FIX] web: Fix the bug while zoom on image
Currently when zoom slowly from right to left on employee image it
will not zoom the image.

currently to hide the zoom image we used target.width() and the method width
gives the width of the selected element (excluding padding, border
and margin) so due to border excluded it will hide the zooming image.
Aslo the offsetHeight property returns the viewable height of an
element in pixels, including padding, border and scrollbar, but not
the margin.

The reason why the 'viewable' word is specified, is because if the
element's content is taller than the actual height of the element,
this property will only return the height that is visible.

so instead of method width we used method outerWidth which gives
width of the selected element (including padding and border, excluding
margin).

closes odoo/odoo#46619

Co-authered-by: Mahendra Barad <mba@odoo.com>
Task: 2199218
Closes: #46619
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-26 09:53:09 +00:00