Commit Graph
136913 Commits
Author SHA1 Message Date
jvm-odoo e4235a8d16 [FIX] web: fix zoomodoo flyout width
Issue

	- Install eCommerce
	- Modify a product image with one which
	  has more than 1024px width/height to
	  enable zoom (I used: https://bit.ly/2VETQZS)
	- Go on the website preview & hover the image

	Depending on the screen size, a part of the
	flyout is hidden because of overflow-x
	if you want to see it, you should scroll
	right width right arrow key.

Cause

	The flyout has 100% width and is put
	right (position absolute, left: 100%)

Solution

	To avoid this error on all screen size,
	the solution is to compute the max-width
	of the flyout depending on the available
	space on the right.

OPW-2283648

closes odoo/odoo#54222

X-original-commit: c89b4c25ed92542f6fd0279cf3a9e4ef1bac9fa5
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-08 11:39:09 +00:00
jvm-odoo 0744c29d89 [FIX] web_editor: fix restored selection when closing link dialog
Issue

	- Runbot 13.0
	- Website > Contact Form
	- Double click on send button

	Link dialog opened, ok

	- Discard
	- Double click on send button
	- Click link button

	Traceback

Cause

	The next double click doesn't work
	because in rte.js RTEWidget._onMousedown
	we remove the target's contenteditable
	attribute and it's never added back.

	This is because we break if the element
	is not editable.

	The traceback is a side effect,
	since we can't select the button
	anymore, our selection is incorrect
	and getLinkInfo use range.create()
	try to use it.

Solution

	Break only if the target is not
	a '<a>' & non-editable element

OPW-2268595

closes odoo/odoo#54221

X-original-commit: 460bc102d0f7503207fb7bd11216c335795dd33b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-08 11:38:48 +00:00
Andrea Grazioso (agr-odoo) 0645b7efa9 [FIX] crm: prevent having portal user as salesman
1. set a Sales team and add an alias
2. create a contact (customer) with an email and grant them portal
access (under the action)
3. Odoo creates a portal user
4. use the email of the contact to send an email to the alias set under
the sales team

An opportunity is created but the sales person assign to that
opportunity is the customer.

This will revert user if the user has no access to crm.lead

opw-2288442

closes odoo/odoo#54217

X-original-commit: a3fdff3dd9cc38b432b93a7cd4387cb7c38b8d06
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-08 11:06:42 +00:00
Yannick Tivisse a5874da269 [IMP] purchase,stock_account: Improve account properties display
Purpose
=======

https://github.com/odoo/odoo/pull/52351 already improved the display
by hiding some account properties if it wasn't really neeeded on manual
inventory valuation.

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

Keep the Account Properties section visible in any cases. The price
difference account is the only field of the section which is only
used in automated valuation.

closes odoo/odoo#54210

Taskid: 2232026
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-08 11:04:09 +00:00
snd cb26f1aabd [FIX] project - send rating mail by project
opws: 2269230, 2248760
When a database has a lot of projects with many tasks, and needs
to send a lot of feedback mails, the cron tries to send mails to
all tasks at the same time, thus it times out.

This fix will allow to treat projects one at a time so that when
the cron times out, it will not restart from the beginning.

closes odoo/odoo#53922

X-original-commit: 07c828b48741500573b4286480b23752a28163c7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-01 15:36:56 +00:00
jvm-odoo 5e3d73bdeb [FIX] website_slides: fix video not loaded in fullscreen web content
Issue

	- Create a content in a course with type "web page"
	- Access it frontend and add a "text - image" block, edit the image as a video - save
	- The video is displayed correctly
	- Go into full-screen

	The video is not displayed at all.

Cause

	The content is added after the page and page widgets are started

Solution

	Trigger the widgets start method

OPW-2290233

closes odoo/odoo#54190

X-original-commit: 0f93240e4979479ab281ca49e8703b325c4b83f0
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-07 13:20:03 +00:00
Loan (lse) c13c020d87 [FIX] website_sale: Improve shop item search performances
The idea is to avoid useless SQL request as the searching process is heavy (have to look the word in several field and can be in translation tables).
As we at some point fetch all the searched product we do it at the beginning and use its information to gain performance on other queries.

Execution time in e-shop for "test" on client database (160 000 product with 4500 published):
 - Before: ~ 7 sec
 - After:  ~ 2 sec

OPW-2256662

closes odoo/odoo#54202

X-original-commit: ec743deb23f22a823cd0ea56eb4719209a9c4d09
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-07-07 20:07:35 +00:00
Xavier Dubuc 7091ad53e9 [FIX] mail: save scroll position of chat window when folded
- Remove no more used ThreadViewer prop : messageListInitialScrollTop
- Remove no more used ChatWindow prop : threadInitialScrollTop
- Rename ThreadViewer field threadCacheInitialPosition to
  threadCacheInitialScrollPosition
- Use the scroll position to set message list scroll on mounted
- Fix old test which was not simulating correctly home menu show
- Add tests to check that scroll position is correctly saved even if
  ChatWindow is folded
- Fix traceback when showing/hiding home menu with a folded chat window

task-2285691

closes odoo/odoo#54198

X-original-commit: 31123a94c156424b3962fe4aebc3cc60a7a89223
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-07 15:57:46 +00:00
qsm-odoo ecefd51b63 [IMP] web_editor, *: add visibility check for editor sub-widgets
*: website

Update the visibility (from dependencies and _computeWidgetVisibility
function) for all widgets, including the ones which are children of main
widgets (e.g. new ability to hide some choices from a select depending
on other options).

closes odoo/odoo#54162

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-07 15:56:55 +00:00
Aaron Bohy e55ee0bb1b [FIX] web: kanban: drag column with sample data
Before this commit, in a grouped kanban view with sample data (e.g.
crm.lead), one could toggle the 'settings' dropdown menu of a
group, and then drag&drop the group by clicking on the muted "Fold"
item in the dropdown.

After this commit, dragging a column is only possible by clicking
on the column title (but not on the 'config' or '+' icons, nor the
config dropdown).

Task 2290197

closes odoo/odoo#54179

X-original-commit: 58c38a024c96eba3469c142a8422b7bd0ab54ea4
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-07 10:14:54 +00:00
jvm-odoo 5a60dbccd4 [FIX] base_import: fix re-importing same file
Issue

	Chrome

	- Sales > Product
	- Select a file
	- Change something in the file
	- Re-select it

	Nothing changed

Cause

	Chrome doesn't trigger change on
	input if the file is the same

Solution

	Clear the input value after the
	parse_preview so we can load a new
	file even if the preview failed.

OPW-2288191

closes odoo/odoo#54175

X-original-commit: f7d2bdf65901e3ee78e1055cab7cf8d60f798621
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-07 09:40:11 +00:00
qsm-odoo 7a74119d1b [FIX] website: hide strange checkbox in shadow option
The 'inset' checkbox of the shadow option was still displayed for no
reason. A "display: none" inline style was added on it but as inline
style is not considered for editor widgets I don't know how it could
have ever worked.

closes odoo/odoo#54168

X-original-commit: b0de225c721e54b76dcbe49f9769ac371db39c05
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-07 09:01:30 +00:00
Julien Mougenot cd1d339763 [FIX] web: Make sample server tests deterministic
Before this commit, there were a few tests in the "sample server" suite
that asserted that every group resulting of a "read_group" would contain
at least one record, while there was actually a slight chance of it not
happening.

Now, the sample server used in the tests has been rendered deterministic
and these kind of issues are completely avoided.

closes odoo/odoo#54164

X-original-commit: a6d32ff46558b68ce3f19458f29c311ee5c658fd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-07-07 08:33:28 +00:00
Olivier Dony e93b9aa271 [FIX] website: restore CDN for lazy assets
The CDN implementation for resources works by matching well-know attributes
(`href`, `src`, `action`) that hold URLs matching the CDN filters and injects
the CDN prefix. However 13.0 introduced lazy loading for assets in #32181,
so the attributes are now prefixed with `data-` and replaced at runtime.

This PR updates the tag matching in order to cover both variants of
attribute names.

closes odoo/odoo#54156

X-original-commit: 6d4b5fcd11e96fd170d8df1ed27be2a8cea26e8b
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-07-06 16:02:04 +00:00
Jeremy Kersten c387ec19b4 [IMP] website: allow to have custom slug Ux
Now, slug uses seo_name if field exists before to fallback on display_name.

It allow to have a custom url without change the product name already used in
backend e.g. or just because you want add some keywords for seo.

task-2291676

closes odoo/odoo#54152

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-07-07 13:11:57 +00:00
Jeremy Kersten 30e4873a2f [IMP] website: allow to have custom slug
Now, slug uses seo_name if field exists before to fallback on display_name.

It allow to have a custom url without change the product name already used in
backend e.g. or just because you want add some keywords for seo.

task-2291676
2020-07-07 13:11:57 +00:00
qsm-odoo 89af38d917 [FIX] web_editor: prevent o-apply-colors to force important rules
The mixin was inconsistent: depending on the color, the created rules
were `!important` or not. This causes bugs with new master features.

closes odoo/odoo#54151

X-original-commit: 83d8c8b66bd9e58b08fe0aa66d2be7bab691ce3e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-06 15:04:05 +00:00
Hardik Prajapati 8e91b0ad3b [FIX] web: properly display boolean fields in kanban
Before this commit, boolean fields (without widget="boolean") in
kanban views were displayed as [Object object], because when no
widget is specified, we display the (textual) formatted value of
the field. However, the boolean formatter returns by default a
string encoding an html checkbox.

This commit passes the correct option to force a string formatting,
so it now displays "True" or "False". Moreover, this commit
uniformizes formatter options for that purpose, as another option
had been recently introduced for monetary field.

Note that those options should not be necessary, as formatters
should always return text values (no html). But this is a larger
change, that we might do in the future.

Task 2280394

closes odoo/odoo#53937

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-07 09:17:37 +00:00
Denis Ledoux d5d79805d2 [FIX] models: prevent fields inherited from delegate=True to be deleted
Use case:
 - `./odoo-bin -d mydb -i website`
 - `./odoo-bin -d mydb -i base_automation`
 - `./odoo-bin -d mydb -u website,base_automation`
 ```
 odoo.addons.base.models.ir_model: Deleting 2652@ir.model.fields (base_automation.field_base_automation__website_published)
 odoo.addons.base.models.ir_model: Deleting 2651@ir.model.fields (base_automation.field_base_automation__website_url)
 odoo.addons.base.models.ir_model: Deleting 2650@ir.model.fields (base_automation.field_base_automation__website_path)
 ```

The issue comes from the fact:
- `website` adds multiple website related fields on `ir.actions.server`
  https://github.com/odoo/odoo/blob/30e94d305f9cffa816ddc213e0b9329c0263c145/addons/website/models/ir_actions.py#L16-L18
- `base.automation` inherits by delegation of the `ir.actions.server` fields
  thanks to `delegate=True` on its field `action_server_id`
  https://github.com/odoo/odoo/blob/30e94d305f9cffa816ddc213e0b9329c0263c145/addons/base_automation/models/base_automation.py#L37
- when `base_automation` is installed after `website`
  when `_reflect_model` is called,
  the website related fields on `ir.actions.server` are well in the `_fields` of the `base.automation` model,
  and there an xmlid for these fields is created
  e.g. `field_base_automation__website_published`
  https://github.com/odoo/odoo/blob/30e94d305f9cffa816ddc213e0b9329c0263c145/odoo/addons/base/models/ir_model.py#L881-L882
- during the `-u website,base_automation`, `_reflect_model` on `base.automation` is called before
  the website related fields coming from its inherits on `ir.actions.server` are added in its `_fields`,
  and is not recalled after they are added, when the `website` module is loaded and these website related fields
  are added on `ir.actions.server`.

Because of this, at the end of the upgrade, in the `ir.model.data` `_process_end`,
as the xmlids of these fields have not been loaded,
they are being deleted, because the ORM considers these fields were dropped
from the source code because their xmlids have not been loaded during the upgrade.

Adding the model `base.automation` in the `inherits_children` of `ir.actions.server`
when the delegate field `action_server_id` is added make sure
`_reflect_model` is called on `base.automation`
after the website related field are loaded on the model `ir.actions.server`,
and therefore ensure the xmlids are properly loaded,
therefore preventing the fields deletion.

Additionaly, `delegate` and `inherits` are supposed to be equivalent,
it's just two ways to do the same thing.

Before this revision,
when using `delegate`, `base.automation` is not in the `inherits_children` of `ir.actions.server`:
```
In [1]: env['ir.actions.server']._inherits_children
Out[1]: set()
```

while, by converting the `delegate` to an `inherits`:
```diff
diff --git a/addons/base_automation/models/base_automation.py b/addons/base_automation/models/base_automation.py
index 196ebe9965f..c073150386a 100644
--- a/addons/base_automation/models/base_automation.py
+++ b/addons/base_automation/models/base_automation.py
@@ -30,11 +30,12 @@ class BaseAutomation(models.Model):
     _name = 'base.automation'
     _description = 'Automated Action'
     _order = 'sequence'
+    _inherits = {'ir.actions.server': 'action_server_id'}

     action_server_id = fields.Many2one(
         'ir.actions.server', 'Server Actions',
         domain="[('model_id', '=', model_id)]",
-        delegate=True, required=True, ondelete='restrict')
+        required=True, ondelete='restrict')
     active = fields.Boolean(default=True, help="When unchecked, the rule is hidden and will not be executed.")
     trigger = fields.Selection([
         ('on_create', 'On Creation'),
```
it is:
```
In [1]: env['ir.actions.server']._inherits_children
Out[1]: {'base.automation'}
```

closes odoo/odoo#54171

X-original-commit: 3fd162db3ab51cc473d99bd90fce6c135f3b4ff3
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2020-07-07 09:12:27 +00:00
Xavier Dubuc 36b1adb413 [FIX] mail: make composer use same subtype as message replied to
Before this commit, when clicking on reply in inbox would send a message
whatever the subtype of message the reply is linked to.
This commit makes sure that if the message which we want to reply to
is a note (resp. comment), then the reply will be a note (resp. comment)

task-2282363

closes odoo/odoo#54158

X-original-commit: 27956951eebc7c068a7d57e8bd21c29522f3ff9e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-07-06 16:56:51 +00:00
Xavier Dubuc cdcb4638d9 [FIX] mail: do not let chatter to be rendered if form view is in dialog
task-2280151

closes odoo/odoo#54157

X-original-commit: 83f2a0605ad80cb8b544651b47b7d27e11b332cb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-07-06 16:26:38 +00:00
qsm-odoo 94b59b1972 [FIX] web, web_editor, *: review chess-like bg for transparency preview
*: website

The style to achieve the chess-like bg result was duplicated at many
places. The 'web' app was also actually using an image from the
'web_editor' app (we can live with it in stable as web_editor always
comes with web in auto_install but this was still a mistake).

closes odoo/odoo#54154

Also: fix some layout issue in the colorpicker widget.
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-06 15:47:06 +00:00
lejeune quentin d6a23e49e2 [FIX] hw_posbox_homepage: Remove format condition for refresh after uograde IoT Box
When we upgrade the IoT we wait that the version of box match with
the last version of IoT Box before to refresh.
We make a request to '/hw_proxy/get_version' to get the actual version.
In Jinja this response give a float.
We compare this value with a string using '===' who want that the format match.
So we doesn't compare the format of values but only the value by putting only '=='.

closes odoo/odoo#54149

X-original-commit: 06f9baae968674547cb2592b1c22147bfb2e8ba9
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-07-06 14:59:11 +00:00
Xavier Dubuc 5afc70faef [FIX] mail: fix open thread in discuss
See also odoo/enterprise#11684
task-2282273

closes odoo/odoo#54141

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-06 14:23:17 +00:00
Xavier ALT 2479da0176 [FIX] web: do no try to render filters referencing access restricted fields
In case a field is limited to specific groups on the model, those fields
are discarded from `fields_view_get()` but can still be referenced by some
filters on the search view causing a traceback (see #53797)

Model:

```python

class MyModel(models.Model):

  my_field = fields.Char(groups='base.group_system')
```

Search views:

```xml
<search string="My Model">
    <filter name="group_myfield" context="{'group_by': 'my_field'}"/>
</search>
```

This commit ensure those filter are correctly discarded.

OPW-2284621

closes odoo/odoo#54112

X-original-commit: b3452a1863c36290b13e16161e2703d9a3737f0e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-06 09:40:09 +00:00
Victor Feyens 37f5424593 [IMP] core: simplified error message
-> 1 less translation
-> the first part of the message didn't add anything useful

closes odoo/odoo#54118

Related: odoo/enterprise#11676
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-07-06 10:30:29 +00:00
Victor Feyens 8a8d482b43 [IMP] *: do not split translations to insert values
* Less translations
* Translations more precise and adapted to the context
2020-07-06 10:29:39 +00:00
Victor Feyens 8363a10f6b [IMP] stock: lazy translation of route names
Do not translate all route types when only one route type translation is needed.
2020-07-06 10:28:48 +00:00
jvm-odoo 87aa189158 [FIX] payment: fix portal can click pay when js not loaded
Issue

	- Go to Accounting / Customers / Invoices
	- Pick any invoice not paid
	- Action: Generate a Payment Link
	- Open the link
	- Refresh the page having Javascript disabled
	- Click the Pay Now button

	Traceback

Cause

	If JS is not loaded, the values in the form fields are
	not bound as expected.

	It can also happen with slow connections and fast click
	on the button at the loading. Before the JS is entirely
	loaded (as it is lazy-loaded).

Solution

	Button disabled by default, wait the page to be loaded
	and then activate the button

OPW-2255760

closes odoo/odoo#54128

X-original-commit: 0e7071f249e69c5cca519ec66120530eb0f97153
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-06 11:30:29 +00:00
Christophe Simonis 85c3fd8b73 [FIX] core: do not mark ir.model* unique fields as modified
These field combinations [1] are actually secondary keys. They are
unique and represent the record identity.

Marking them as modified had a nasty side-effect: on some models, there
is a m2o to an ir.model and a stored related to ir.model/model that will
be recomputed at each model reflection. This can take some time on big
tables.
Moreover, some other stored fields may depend on those ir.model/model
related store, which adds useless time lost at recomputing unchanged
values.

[1] ir.model/model, ir.model.fields/{model,name} and
    ir.model.selection/{field_id,name}

closes odoo/odoo#54126

X-original-commit: db013a01ca4e10640ac33a59466c9cb5746e3698
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Christophe Simonis <chs@odoo.com>
2020-07-06 11:11:05 +00:00
Daniel Dico 59463f8bb9 [IMP] l10n_ca: remove unused tax template
HST 14% tax was replaced with 15% tax in October 2016 as per GST/HST
provincial rates table [1].

[1] https://www.canada.ca/en/revenue-agency/services/tax/businesses/topics/gst-hst-businesses/charge-collect-which-rate/calculator.html#rt)

opw-2290216

closes odoo/odoo#54110

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-06 09:17:05 +00:00
Laurent Smet 20a9cbfda8 [FIX] l10n_it_edi: Remove useless test that is testing only one computed field
closes odoo/odoo#54067

X-original-commit: 07b07c7c359a31203fc2e4e4e09b909ad315453a
Related: odoo/enterprise#11653
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2020-07-03 15:53:30 +00:00
bfr-o 52949a1a83 [FIX] l10n_ch: Fix broken 'test_l10n_ch_isr
'

X-original-commit: 10c14c63094870346143a42f5df39e1db3f0dc5c
2020-07-03 15:53:29 +00:00
bfr-o d935f9b77e [FIX] account_check_printing: Fix xml_id not found in '_compute_check_amount_in_words'
When the model is loaded, the value of 'check_amount_in_words' is computed for each existing payment.
It could lead to a traceback if the second condition is reached referencing an xml_id that is not yet loaded.
Indeed, data are loaded after the models.

X-original-commit: a9234e7581f267c64c4bf19d93e7b6844fe4d0b4
2020-07-03 15:53:29 +00:00
Laurent Smet d4030f2386 [FIX] account: Fix 'test_account_journal_dashboard' in l10n runbot builds
X-original-commit: 7d6e4917b7871628c7a385be61b73a01c5e79f3a
2020-07-03 15:53:29 +00:00
Laurent Smet b9fa00b4a9 [FIX] account: Fix 'test_account_bank_statement' in l10n runbot builds
X-original-commit: bbf8f9c6b30cb5c0978057efe5f78b5c1492435e
2020-07-03 15:53:29 +00:00
Aaron Bohy 2e6ec66022 [FIX] web: editable list: correctly edit in readonly
Some widgets allow the edition in readonly (e.g. boolean_toggle,
priority...). In this case, the changed value is saved directly.
Before this commit, this didn't work in (main) list views: the
widget was updated with the new value, but it wasn't saved in db,
so the change was lost at reload.

This was due to the list controller not being correctly aware of
its mode ('edit' or 'readonly'), on which the basic controller
relies to determine whether a change must be saved directly or
not.

With this commit, a list is always in 'readonly', except when a
row is being edited, in which case it is in 'edit'.

Issue reported on task 2288963

closes odoo/odoo#54075

X-original-commit: 64e55cb42163643386740fbd23d710f64033b2ae
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-03 16:41:56 +00:00
oco-odoo 5aa9765131 [FIX] account: fix bad forward port of https://github.com/odoo/odoo/commit/bbbb11f3fd10bbb0f1086920f291aa9c7c2052be
closes odoo/odoo#54083

X-original-commit: 253dd0eef7f4ae64b6311d72fe41a08897370d89
Related: odoo/enterprise#11659
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-07-04 10:39:09 +00:00
oco-odoo 718f2aede4 [FIX] account: cash basis taxes: Make cash basis taxes work with the new tax report in any case.
Before that, since https://github.com/odoo/odoo/commit/71ee252dc43fd0e2b86ba8079c31915544e528eb , negative invoice lines were not supported by thoses taxes. Nor were miscellaneous entries. To make them work, we change the way tags are assigned to cash basis taxes : instead of copying them from the invoice, sign included, we now change their sign when appropriate, so that the resulting cash basis move can be treated like any regular miscellaneous operation by the tax report (so, always applying a factor of 1 to its lines' balance).

Doing that also allows us to re-simplify the code used in the tax report and tax audit computation to manage cash basis entries, and makes the cash basis entry more standard. This is also a usability improvement: now the user does not have to search for the original invoice to understand how the CABA entries are going to impact the report: it's always managed like a misc. operation, so he can just trust the signs of the tags.

v13 version of https://github.com/odoo/odoo/pull/53085

closes odoo/odoo#54058

X-original-commit: 20850301f5025ffd1a05e0594f6d26d2a61759ef
Related: odoo/enterprise#11652
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-07-03 14:41:53 +00:00
Laurent Smet 187dc351bb [FIX] account_facturx: Fix facturx xml with discount, group of taxes and multi-currency
- Fix discount indicator with 100.0% discount.
- Fix reported tax amount with group of taxes.
- Fix reported tax_base_amount with foreign currency.
- Fix invoice summary according the facturx xsd.

closes odoo/odoo#54080

X-original-commit: e97333f6d80eaa5807467a863a9c8f5850e1d644
Related: odoo/enterprise#11657
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-07-03 17:29:42 +00:00
Laurent Smet aa7dd77a67 [IMP] account: Allow mocking a datetime in mocked_today
X-original-commit: a9a1d8e5348010eca7de15199faae1f2469d96ff
2020-07-03 17:29:42 +00:00
Laurent Smet ddf9f0f4cb [IMP] account: Add a new setupclass to test the result of e-invoice xml
X-original-commit: 955db1203599516bdbefeedee37de6b8ad69bf12
2020-07-03 17:29:42 +00:00
Odoo's Mergebot 8117907b53 [FW][FIX] web: unsafe access to config property & extract lib's input setter
During TempusDominus autobinding to fields matching its default classes
(like `.datetimepicker-input` used by our DatePicker widget) and no
config was previously provided to the library (like when we disable it
on mobile), an unsafe access to the config's `_options` property results
into an error as the config is `undefined`.

This PR fixes it by first checking for config existence before
attempting to access its property.

It also extracts the DatePicker widget's input setter to allow
overriding it and preventing from calling the `datetimepicker` lib when
not initialized (like on mobile).

opw-2242880

closes odoo/odoo#54068

Forward-port-of: odoo/odoo#54039
Forward-port-of: odoo/odoo#54005
Related: odoo/enterprise#11654
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-07-03 20:50:15 +02:00
Martin Trigaux 88786d6123 [FIX] hr_attendance: format hour according to locale
The time to display the check in/check out time was hardcoded to
HH:mm:ss while other locales may use different formats.
Use the appropriate time utils to retrieve the right format that uses
the time format from the res.lang record.

Fixes odoo/odoo#50527

closes odoo/odoo#54079

X-original-commit: 47707e1b099195487fd3d3e0ae012e4aed5a9bc5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-07-03 17:12:14 +00:00
Pierre Paridans c9ba9dc94b [FIX] web: TempusDominus unsafe access to config
During TempusDominus autobinding to fields matching its default classes
(like `.datetimepicker-input` used by our DatePicker widget) and no
config was previously provided to the library (like when we disable it
on mobile), an unsafe access to the config's `_options` property results
into an error as the config is `undefined`.

This commit fixes it by first checking for config existence before
attempting to access its property.

Note: as this is a fix inside a library, a comment is added to make
clear. Also similar fixes where already done in the same file.

opw-2242880

X-original-commit: fe1f7c3e361bbd249b4025a464c546f478b6e989
2020-07-03 15:54:08 +00:00
Pierre Paridans eba83eddd4 [FIX] web: extract date picker's input setter
This commit extracts the DatePicker widget's input setter to allow
overriding it and preventing from calling the `datetimepicker` lib when
not initialized (like on mobile).

Note: this change will be used on enterprise.

opw-2242880

X-original-commit: c0413868a8728500c52b7e1dd9a0035f90b654fd
2020-07-03 15:54:08 +00:00
Julien Mougenot ff6263dd3f [FIX] web: Support widgets in search view
Since the refactor of the control panel, support of "widgets" attributes
in the search view archs has been inadvertently dropped.

Now, they are once again supported.

Task 2061795

closes odoo/odoo#54066

X-original-commit: f33b0bc7a93e60bd0ed00b40d7459225ec0b749a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-07-03 15:48:42 +00:00
Antoine Prieels 6c97a9eb60 [FIX] hw_drivers, pos: Move IoTBox version file
We move the IoT Box version file from /home/pi to /var/odoo
so its not overriden after an auto-flash of the IoT Box.

closes odoo/odoo#54063

X-original-commit: ce0700ce401523267b5a8bd5665a368cfea24912
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2020-07-03 15:18:03 +00:00
Nasreddin (bon) cc0713dc5a [FIX] stock: Display translated picking description in delivery slip
Issue

	- Install English and French languages
	- Create a customer contact and assign french as his language
	- Create a product with correct names in both languages.
	  For example 'French product name' and 'English product name' for easy reference.
	- Create an inventory transfer with the french customer as contact
	- Add the product that you created
	- Print > Delivery Slip

	The report will show in the lines:
	"""
	French product name
	English product name
	"""

Cause

	Getting product description without checking partner language.

Solution

	If partner is set, get product description with partner language in context.

opw-2280490

closes odoo/odoo#54061

X-original-commit: cebe2cf57e68e2d1d54cd442aff6ba7d9554d043
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-07-03 15:12:56 +00:00
Odoo's Mergebot 9d7f3be8b3 [IMP] delivery, product_expiry, stock: improve delivery slip
Improve delivery slip with following features:

1. Group Kit components on the delivery slip
- Split kit components by kit "sections"

2. Print one line per product whatever the tracking
- Combine duplicate product move lines when "Display Lots & Serial Numbers on Delivery Slips" is not activated or no lots/serial numbers are assigned in the picking

3. Group packages on the delivery slip
- Split products up by package "sections"
- Print package info such as "weight"

4. Expiration Dates
- Give option to print lot/serial number expiration dates on delivery slip

Task: 2008609

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#49832

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-07-03 17:34:51 +02:00