Commit Graph
140847 Commits
Author SHA1 Message Date
jvm-odoo 382d6d9a78 [FIX] portal: fix address over icon
Reproduce this bug

    - Log in as portal user

    The top right address detail is over the icon.

Cause

    The others fields are using a `span` who have a style who push them
    right.

This commits add the `span` style for the div.

Fine-tuning of 9e302765

OPW-2092345

closes odoo/odoo#40225

X-original-commit: af0fd50b14f32032f0870812dd615ac988183174
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-13 17:16:19 +00:00
Laurent Smet 3d1c192da9 [FIX] account: Fix checking about the reconciliation
There is a constrains preventing writing debit/credit on an already
reconciled journal item. However, this constraint isn't aware about
monetary fields and then, was raising an error when writing amount
like 1.000001 on a debit of 1.0.

closes odoo/odoo#40214

X-original-commit: 7599758494198e64b5b391dbecdfe30baa01e50b
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-11-13 15:24:39 +00:00
Samuel Degueldre 5796441784 [FIX] website: fix crash when adding item to top menu
In 4d5c3b9fc1c5 the arguments of the MenuEntryDialog widget were
altered, and one instantiation of this widget was not adapted, resulting
in the last parameter being undefined and causing a crash. This commit
adapts that call.

closes odoo/odoo#40187

X-original-commit: ab7f501ff401cc1a85a95dd3cc65d80ecfeec2cc
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-13 12:19:31 +00:00
Alejandro Avilés a23153a3d2 [IMP] web: correct typos in comments
closes odoo/odoo#39658

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-14 07:05:33 +00:00
Alejandro Avilés 6cd14dd033 [CLA] add signature for omegak 2019-11-14 07:05:33 +00:00
Nicolas Martinelli 85715462da [FIX] point_of_sale: partner with empty name
- Create a contact
- Create a child contact without name

Opening POS causes an error as the Name Field is not a string.

opw-2121499

closes odoo/odoo#40218

X-original-commit: 0171ed4c8ae9ed208d3896a97d1ae0bd0196c9ab
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-13 16:02:15 +00:00
Nicolas Martinelli 3bc330a323 [FIX] sale_stock: canceled invoice
- Create a Sale Order with a product
- Confirm and deliver the product, create an invoice.
- Cancel that invoice, go back to the SO.
- Recreate the invoice, you have 2 of them (one cancelled).
- Post the second, and try 'Send and print' and 'Preview'.

A traceback is raised.

The traceback arises because we sort on the `invoice_date`, which is
`False` for a canceled invoice.

Actually, we should not take into account canceled invoices.

opw-2119870

closes odoo/odoo#40215

X-original-commit: 6f304973785669f1c3b297c96eb8be7de7242ebe
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-13 15:24:56 +00:00
Nicolas Martinelli 82a24aa1df [FIX] l10n_it_edi: split name
Fields `Nome` and `Cognome` cannot be identical. However, Odoo has only
a single field for name. Therefore, we split the name based on the
assumption that the name is written as 'Name Surname'.

opw-2093035

closes odoo/odoo#40209

X-original-commit: 9e8b33d61430bd834ac2970919c3df2a0bb76fa4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-13 14:49:02 +00:00
William Henrotin 643c91aba6 [FIX] mrp: fix workcenter capacity
Planning the workorders depends on the quantity to produce of those workorder
This will create as much as production batch needed regarding the workcenter
capacity.

This method is good except in case of product tracked by serial number. In that
case the quantity to produce on the workorders is force to 1 regardless of
the quantity to produce on the production

closes odoo/odoo#40226

X-original-commit: 3c4133ddac256c63802a99461db49cc9bd9fa1d6
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2019-11-13 17:45:51 +00:00
Simon Lejeune eea62c09c9 [FIX] stock_account: standard price update upon delivery
Make sure to update the standard price with the computed unit cost of
the candidate and not its `unit_cost` field, as the computed could
contain an extra value from a landed cost.

closes odoo/odoo#40208

X-original-commit: 9234ea1e32609ee7b5c22b836c33eefa20220d37
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-13 14:38:02 +00:00
qsm-odoo 877e3c6bfa [FIX] website_form: add missing call to _super in snippet options
closes odoo/odoo#40200

X-original-commit: 424dfc913b2259862e6e6d7838844dfefd72a15c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-13 13:50:37 +00:00
fw-bot 8b7afc9d4d [FIX] account: pass tree_view_ref in a one2many analytic lines view
Without this commit, if you have the hr_timesheet installed, the one2many analytic lines view (in the Journal Items form) shows the hr_timesheet_line_tree view instead, which is not desired.

closes odoo/odoo#40196

X-original-commit: 0b92bde84afac4a78512c475de3c8c822a1fa4b2
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-11-13 13:17:07 +00:00
jdoutreloux d6812b90b8 [IMP] project: Display 'project' on quick create for All Tasks action
Purpose
=======

Do it only when the project is not set

closes odoo/odoo#37420

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-13 09:43:27 +00:00
jdoutreloux 5b7c3805a0 [FIX] base: Fix LTR display of base.contact qweb template
The icon is not displayed properly + doesn't handle the LTR
mechanism.
2019-11-13 09:43:21 +00:00
jdoutreloux d34939a521 [IMP] project: Display commercial partner on tasks kanban card
TaskID: 2075174
2019-11-13 09:43:15 +00:00
jdoutreloux 06d5103c38 [IMP] project: Improve layout and wording on task form
Change some wording and layout things to be more in line with what
already exists, and add a tooltip to the deadline for clarity.
Additionally, much like the date whose data and format are controlled by
template variables so that the industry_fsm module can modify them, so
is the tooltip so that it can be modified by that module to reflect that
it represents the starting date or hour instead of the deadline.

TaskID: 2075174
2019-11-13 09:43:06 +00:00
Xavier-Do 8bb0530017 [IMP] base: improve error context for view validation errors
closes odoo/odoo#36373

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-11-13 16:12:24 +00:00
Xavier-Do aae1d57829 [REF] base: refactor check_xml and read_combined
View creation/edition represent a important part of an install and a lot
of possible view errors are not detected, like fields used in domain
filters. Some part of the code a difficult to maintain, and view checks
are splitted in multiple places.

This commit aims at refactoring view validation by regrouping most part
of the logic in ir_ui_view and trying to optimize the overall process.

Since most of the lines were touched, this task was also an opportunity
to modernize the API.

Main changes on method `check_xml`:
 - extract node processign and validation to individual postprocessor
 - add validation for filter node, buttons, ...
 - fix accessibility checks (and improve their performance)
 - move xpath check to specific Python node validator
 - clarify error messages (wip to continue)

Main changes on method `read_combined`:
 - optimize the search for inheriting views in a single query doing the
   whole recursive search

Indeed, after removing xpath validations, `get_inheriting_views_arch`
was the most expensive method in `check_xml`, spending most of the time
in `search` because of recursive calls to retrieve children views.

The view Backend Assets is a good example of the latter point, since a
line is added in the view for almost every module.  70 views (community)
are added at first level, `get_inheriting_views_arch` is efficient and
returns all 70 views.  Then at the second level, the method
`get_inheriting_views_arch` is called 70 times for nothing. 70 calls to
`search` (squared/2 since each view is checked independently) are almost
useless. The same case applies to the settings view.

As a result, the average module installation time is 25% faster, and the
average time spent in `read_combined` is almost divided by 2.
2019-11-13 16:11:46 +00:00
Xavier-Do b63e82bebd [REF] base: remove deprecated translate_qweb 2019-11-13 14:08:52 +00:00
Xavier-Do fd9278613a [IMP] base: remove useless model check
Model presence in env is already done by postprocess_and_fields,
and model shouldn't change in postprocess exept for a subview,
in which case post_process_and_field will be called again.
2019-11-13 14:08:52 +00:00
Xavier-Do 3064f06223 [IMP] base: add global test for ir.filters and views 2019-11-13 14:08:52 +00:00
Xavier-Do 6042545c33 [WIP] base: avoid useless view update on group write.
Writting a view arch will trigger check_xml, which is
quite expensive.

Avoiding to write user_groups_view when arch didn't changed
will slightly improve performance by avoiding to check
already validated views.
2019-11-13 11:05:14 +00:00
Xavier-Do c403aec2aa [IMP] core,test_access_rights: improve exept_orm stringification
In most case, except_orm.value is empty, leading to a str
representation of the args, which is a repr of each element
of the tuple in the case of exept_orm:
(repr(name), repr(value)) -> ('name', None)

In this case, the None value is just noise and the name will be repr
causing "'" to be escaped and replacing carriage return
by "\n" making it difficult to read and to compare.
2019-11-13 11:05:14 +00:00
Xavier-Do eb2f0aabcf [FIX] *: various fixes in xml views 2019-11-13 11:05:14 +00:00
Xavier-Do 33086d7795 [FIX] crm: remove deprecated default_groups_ref ctx key 2019-11-13 08:54:38 +00:00
Xavier-Do 123d101335 [FIX] hr_skills, membership: remove invalid filters
- resume_line_view_search was not used and line_type
  isn't a valid field (should be line_type_id)
- there is no field customer or supplier on res.partner
2019-11-13 08:54:37 +00:00
Laurent Smet 940733ec18 [FIX] account: Fix the 'state' live-cycle of account.payment
Introduced by https://github.com/odoo/odoo/commit/ab483a3a6610a09391ec00e9c1c49489ca4a4f12
There was no way to exit the 'cancelled' state of an account.payment.
The new live-cycle is:
- draft -> posted -> sent -> reconciled -> cancelled
- action_draft to move the account.payment from ('cancelled', 'posted', 'sent', 'reconciled') -> 'draft'
- cancel to move the account.payment from 'draft' -> 'cancel'

closes odoo/odoo#40193

X-original-commit: 53e83ae9e68d418bf7322374815b942309bf7fef
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-11-13 13:09:11 +00:00
Fabien Pinckaers edb11ee684 Update README.md
closes odoo/odoo#40018

X-original-commit: 21ea9d4cc753e31c2f8355e7d6b9306e903196b2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-08 11:24:04 +00:00
Kevin Baptiste eb02e9b3e0 [IMP] hr_holidays: compute leave description based on user group
The leave description is now replaced with a compute method in order to
obfuscate the description based on the user's group.

closes odoo/odoo#38995

Taskid: 2088559
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-13 10:55:43 +00:00
qsm-odoo db8904b03d [FIX] website, theme_default: restore website creation UI
Commit https://github.com/odoo/odoo/commit/88e910e187346c095a6f0eeb8be647da1e391035
merged the inheritance of a view into the base view while the inherit
was in fact a primary mode inherit. The modal buttons of website
creation modal thus appeared in all website forms by mistake.

This commit also takes advantage of the fix to fix the design of that
creation modal (wrong classes on buttons).

Also fixes https://github.com/odoo/odoo/commit/986415cf050efbd38a5834f9bbd3a37db1fd7933
which added a data file & folder in demo data by mistake.

closes odoo/odoo#40175

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-13 10:30:04 +00:00
fw-bot 8d792001c6 [FIX] base: call context_get with the right user
self.env.user returns the current user but browsed with the superuser:
- self.env.user == current user
- self.env.user.env.user == administrator

get_context uses self.env.user to retrieve the context of the user.
Before this patch, the name of the filters was translated in the
language of the administrator instead of the current user.

Closes odoo/odoo#40086

closes odoo/odoo#40170

X-original-commit: b39c8da2a49e43cc1bd7c837bf0e99ad437992ff
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-13 09:35:16 +00:00
Nicolas Lempereur 062735847c [FIX] web: guardedCatch on IE Edge async return
In IE Edge async and await are supported, but guardedCatch is added to
polyfilled MyPromise object and async methods return original Promise so
depending of chain guardedCatch can cause en error or not.

It seems that historically, the MyPromise patching has also had issue in
firefox with it sometimes working or not.

In this changeset we completely remove it (which will have the drawback
of more error shown in console in firefox).

opw-1964486
opw-2116839
closes #39953

closes odoo/odoo#40154

X-original-commit: 5ca38da66de00ca6efef307bcb39fc5037903221
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-12 17:13:56 +00:00
Gert Pellin a1839fb305 [FIX] pos_restaurant: sync empty orders
* In a pos-session with table management create a new order with products
and go back to the floor-plan.
* The order is sinced to the back-end.
* Open the table again, remove all products but keep the order.
* Go back to floorplan to trigger syncing again.
* Open the table again.

behaviour before fix:
* The empty order is not loaded in the frontend anymore.
* To close the session the order has to be manually removed in the backend.

After fix:
* The order is still visible in the frontend and can be removed or finalysed as expected.

closes odoo/odoo#40165

X-original-commit: 3add8dd226f39d5166873a575b858694eeb2e6ee
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-13 08:50:57 +00:00
Jorge Pinna Puissant 72fd12e4ae [IMP] base: current company id to evaluation context
Add the id of the current company to the evaluation context for ir.rule
domains

closes odoo/odoo#40162

X-original-commit: 8bf4b8e015fa61f3929dbb8f1d81e1127272cfbb
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-11-13 08:08:05 +00:00
Goffin Simon fd81920f1f [FIX] stock_dropshipping: Creating a quotation without purchase permission
Fine tuning of this commit: f93fcaffb5

Steps to reproduce the bug:

- Open runbot v11
- Restrict Demo's access to Sales Manager for sales and employee for Employee
- Try to create a new quotation

Bug:
- You got Odoo server Error
Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:
- Inventory/User
- Accounting & Finance/Billing
- Purchases/User
- Purchases/Manager
- Other Extra Rights/Portal
(Document model: purchase.order.line) - (Operation: read, User: 5)

opw:2120692

closes odoo/odoo#40153

X-original-commit: 1b14af28fec3cae0efc4438e77e6e0925e487b89
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-11-12 16:57:57 +00:00
Laurent Smet 2a875a404a [FIX] account: Fix lost constraint during the account-pocalypse
A journal entry must always have the same currency as the account when
a secondary currency is set on this one.

closes odoo/odoo#39844

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-11-12 14:33:52 +00:00
Laurent Smet afee07cb91 [IMP] account: Remove dead code
This field has been introduced by https://github.com/odoo/odoo/commit/2d1b8e9f3445ab0e1c1ac4683b7b5a25c867b2de
but is no longer used anywhere and is not a valid field on account.move.line.
2019-11-06 12:59:34 +00:00
fw-bot 828c251056 [FIX] test_lint: force absolute path to compute odoo path
When using the flamegraph module from a parent directory of odoo, the
dirname method returns a relative path, leading to a traceback.

With this commit, the odoo_path is enforced to be an absolute path.

closes odoo/odoo#40147

X-original-commit: 75efe4b4ca6c0ccef6ec592b317e7c2b572f28fc
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-11-12 15:39:57 +00:00
Victor FeyensandRaphael Collet 20edf21fda [FIX] orm: do not try to convert zero amount for monetary fields.
When assigning a default value to a computed monetary field, if self
contains records with different currencies, the assignation will fail
when trying to round the value (because self[currency_field] is a
recordset of multiple currencies).

Globally, assigning a monetary value to records in different currencies
should never happen.  The only case we want to support is defaulting a
computed monetary to 0.0.

Add clear error when trying to set monetaries in multi-currency.

closes odoo/odoo#40155

X-original-commit: 3a58dfa1e51702a659e9113271f19d087e3ec349
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2019-11-12 17:03:58 +00:00
Jeremy Kersten 96daa295c7 [IMP] website: improve install theme layout
task-2086939

closes odoo/odoo#40059

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-12 16:07:58 +00:00
qsm-odoo 986415cf05 [REF] website: install theme_default on first website by default
The original goal was to not have any pre-installed theme by default
and to force the user to consider installing one through the customize
dialog.

Now that we have a system to allow switching theme, it is better to have
one installed by default and allow the user to switch theme from the
customize dialog (note that last part was made in the parent commit with
the merge of website_theme_install into website).

Note: theme_default is purely empty, it is only installed by default for
clarity in the theme selection screen, for the default website.
2019-11-12 15:53:21 +00:00
qsm-odoo 88e910e187 [REF] website, *: merge website_theme_install into website
* theme_bootswatch, theme_default, website_theme_install
2019-11-12 15:53:13 +00:00
Manuel Vázquez Acosta d57cd2d3ce [FIX] base: Correct optimization of name_search
Commit 5fcf891e07 introduced optimizations for
name_search in several models.  However, that produces some counter-intuitive
searches.

In a DB with project and custom data:

    >>> Project = self.env['project.task']
    >>> Project.search([('user_id', 'ilike', 'demo')]).mapped('user_id.name')
    ['Marc Demo']

    >>> Project.search([('user_id', 'not ilike', 'demo')]).mapped('user_id.name')
    ['Marc Demo']

The projects returned with 'not ilike' are a super-set of those returned with
'ilike':

    >>> Project.search([('user_id', 'ilike', 'demo')])
    project.task(22, 21, 20, 16, 14, 13)

    >>> Project.search([('user_id', 'not ilike', 'demo')])
    project.task(22, 21, 29, 28, 27, 26, 25, 20, 16, 14, 13, 31, 30)

This commit fix this behaviour by choosing '!=' instead of '=' whenever the
operator is a negation operator.

The 'res.users' is more exposed than the other models touched by
5fcf891e07, because user may search for 'Created
by' in the web client.

closes odoo/odoo#40140

X-original-commit: b3c539b09a0bd462309a10c565cb91375a7011b9
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-12 14:49:52 +00:00
lejeune quentin 3942308bc4 [FIX] iot: Fix support of device with protocol 0
The self don't contain 'interface_protocol'.
The 'interface_protocol' is in self.dev because we add this in 'supported' function.

closes odoo/odoo#40132

X-original-commit: 6963a016385c4310dd547ae2d0d7e1d5cb4fab67
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-11-12 14:09:07 +00:00
Arnold Moyaux e83e24b40d [FIX] mrp: thumbnail removed
commit 89f20d2c29 removed thumbnail but didn't adapt the views that used it.

Adapt the view and directly use the datas and not the thumbnail.

Close #38747

closes odoo/odoo#40126

X-original-commit: e73b468135d27ce8c1e84c3ecf2d0b3af176d760
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-12 13:33:01 +00:00
Nicolas Lempereur 614666257f [FIX] web_editor: reintroduce source mode in debug
In 12.3 there was a number of changes in source mode. This was reverted
before 13.0 and somehow it seems the source mode was lost between the
12.3 editor changes and its revert.

With this changeset, we introduce back source mode as it was in 12.

opw-2091649
opw-2116960
closes #40026

closes odoo/odoo#40120

X-original-commit: e29c08969f6e7ad981e9b7b79027d84dc89fbca2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-12 12:32:02 +00:00
Swapnesh Shah c44f7a0369 [FIX] calendar: Allow any user to set calendar_last_notif_ack
Fixes https://github.com/odoo/odoo/issues/39358
Before this commit Internal user (With no other Rights) cannot perform any activity on Reminder Popup due to missing rights to set calendar_last_notif_ack field.
With this fix, we are now using sudo to write calendar_last_notif_ack

closes odoo/odoo#40104

X-original-commit: 91560fae56f1cba09141eefa1d0da03f4a7b3f72
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-12 10:17:10 +00:00
jvm-odoo 8f0e3be257 [FIX] sale: fix sales team goal not updated in CRM pipelines
Reproduce this issue

    - Install CRM & Sales
    - Create 2 sales team in CRM settings
    - Create some invoices and register payments for the 2 teams
    - Go in CRM > Sales > Team pipelines

    The invoicing amount is still 0 for both teams.

Cause

    - The `_compute_invoiced` method in `CrmTeam` models use a SQL
    query to retrieve the invoices lines but it returns an empty
    recordset because the dates are not right ordered.

    - The line balance are negatives values, doing a SUM() will always
      returns 0

This commit re-order the dates and invert the sign of line.balance.

OPW-2119819

closes odoo/odoo#40115

X-original-commit: 578dacc3af04996754d1ec67108106379a9c3c38
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-12 11:50:26 +00:00
Ravi Gohil 1270eaad66 [FIX] l10n_lu: correctly compute few tax report sections
- fixed some tax report lines by showing correct amounts
- corrected account types
- set default receivable/payable/advance tax accounts for tax groups

closes odoo/odoo#40114

Task: 1917932
Closes: 39191
X-original-commit: 0677d4749350645b6b9dd34f6ac37c278596353a
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-11-12 11:50:05 +00:00
Yannick Tivisse b70a6cdf5c [IMP] hr_recruitment: Avoid multi-executed tests
closes odoo/odoo#40020

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-12 11:34:36 +00:00