Commit Graph
132737 Commits
Author SHA1 Message Date
Xavier Bol (xbo) d7d980b58b [FIX] hr_timesheet: unit_amount not editable when timer is running
TaskID: 2088586
2019-12-19 10:20:28 +01:00
Xavier Bol (xbo) b673e3aee4 [MOV] sale_timesheet: move 'create sales order' button on tasks
TaskID: 2088586

Move this button from sale_timesheet_enterprise to sale_timesheet
2019-12-19 10:20:27 +01:00
Xavier Bol (xbo) 2d3a44e6bd [FIX] hr_timesheet: problem desynchronization time between server and client
TaskID: 2088586

When we launch the timer, if the clock of the client isn't correctly synchronize
with internet, we can't correctly display the timer,
because the clock of the server can be in advance.

The solution is to call the server to have this time and use the timer
only with the time of the server.
2019-12-19 10:20:27 +01:00
Xavier Bol (xbo) 15e41f59c7 [MOV] hr_timesheet: move timer from timesheet_grid to hr_timesheet
TaskID: 2088586

The timer use in project > task can be usable in community and not only in enterprise.

move timer constraint from sale_timesheet_enterprise to hr_timesheet
2019-12-19 10:20:27 +01:00
Xavier Bol (xbo) 2ace7893f0 [IMP] hr_timesheet: add by default "See own timesheets" group to user demo
TaskID: 2088586
2019-12-19 10:20:27 +01:00
Xavier Bol (xbo) 68851c0530 [IMP] sale_timesheet: improve project overview to match with the access rights of hr_timesheet module
TaskID: 2088586

Some changement in project overview to match with the access rights
in Timesheet.

When the user has the lowest access right, the user may not see the
timesheets of other users in the project overview. The total of hours
spent must be equal to the number of recorded hours. But the
remaining hour of the sale order must be corresponded to the reality
and not only depending of the record that the user may see.

Move the _domain_employee_id method from timesheet_grid into this
module. Because this method is used for project overview into
sale_timesheet module.
2019-12-19 10:20:27 +01:00
Xavier Bol (xbo) 46d70e30ef [IMP] sale_timesheet: improve invoicing sale order with timesheets
TaskID: 2088586

Add an 'Invoice timesheets up to mm/dd/yyyy' field on the Invoice
Creation modal. This field is only visible when we want to create an
invoice for a Service whose Service Policy is set on 'Timesheets on
tasks'.
This field allows to invoice the timesheets of a service up to the date
set on this field.

Before this commit, when we create the account.moves.line records, we
link timesheets of a service to an invoice. Now, we need to check which
timesheets are invoiced, because with the adding of the date for the
creation of invoices, we cannot invoice the timesheets after to this
date. Then, the process is done at the end of '_create_invoices' in
'sale.order' model when the invoices are created.

Override an ir.rule in accout module, because this rule accept all
account.analytic.line in its domain and we don't want to accept all
timesheets when the user has the access right : "See own timesheets".
Therefore, we need to override this rule to apply the others rules in
this model for the timesheets.
2019-12-19 10:20:27 +01:00
Xavier Bol (xbo) 3cff5808f9 [FIX] account: remove the override _order in account.analytic.line
TaskID: 2088586

Beside this override, the records in timesheets often change order
because the date field is a date type and then, many timesheets can
have the same date, thus the order isn't the same every time.
When we remove this override in account module, the default order is
restore for account.analytic.line model and it's 'date desc, id desc',
with this order, we keep the same order every time in the different
views of timesheet.
2019-12-19 10:20:27 +01:00
Xavier Bol (xbo) c9da157149 [IMP] hr_timesheet: add timer into list and kanban views for timesheets
TaskID: 2088586

Timer in the list and kanban views :
----------------------------------
In kanban and list views, It's possible to update the 'unit_amount'
field with a timer. The user can easily launch the timer in these views
for one of his timesheets.
One timesheet can be launched at the same time, when the user start a
timer for a timesheet and start another timer for another timesheet, the
first timer stop and the new timer start.

The timer is usable only if the encoding unit is 'Hours' and the
timesheet is not validated. To do this : a new computed field 'display_timer'
is created in account.analytic.line, this field is set to True is the
encoding unit is 'Hours'. With this field, we can easily hide and display
the timer in different views.

The user can only use the timer for his timesheets. Because the user
with the access rights to see all timesheets might launch and/or stop a timer of a
timesheet of other user. That is the timer must be accessed only in 'My Timesheets' menu.

Add pivot view for 'All timesheets' menu.

Creation a timer_mixin :
----------------------
With this timer mixin, we can have a generic timer to use in other
models that they need to use a timer like account.analytic.line and
project.task models
The timer in account.analytic.line model has changed to use the timer
mixin.

Specific behaviour of the timer :
-------------------------------
When the user use the timer and the minutes spent with the timer is less
than 1 minute, we don't add in unit_amount of timesheet. If the
unit_amount is equals to 0 and minutes spent of timer is less than 0.
Then the timesheet created by the timer is deleted because it is useless to
have a timesheet with unit_amount set on 0.

Misc :
----
Add some styles for the timer button and for the 'unit_amount' field when the
timer is running.

remove duplicated fields in tree view (record
id='timesheet_view_tree_user')
2019-12-19 10:20:27 +01:00
Xavier Bol (xbo) 2f20b9437a [IMP] hr_timesheet: Improve access rights
TaskID: 2088586

The low level access right is now "See my timesheets".
This access disallow to a user to view and manage the timesheets of others users.

When the visibility of a project is set on "Invited employees",
the users with the access rules : 'See my timesheet' and
'See all timesheets' can show the timesheets, if these users
follow the project.
2019-12-19 10:20:27 +01:00
Jason Van Malder 073839c6ce [FIX] website: fix background video widget on mobile
Issue

    - Download the customer db: stargue-inc
    - Go on the website in mobile mode

    Traceback & the second item in the carousel is not displayed.

Cause

    Traceback: we use `this.$iframe` without checking if it's defined
    Second item not displayed: the first video promise is overriden
    by the second video promise.

Solution

    Check if this.$iframe is defined and resolve the old promise
    instead of overriding it.

OPW-2152690

closes odoo/odoo#42139

X-original-commit: f5f569b4705f37865cb976a4df10a0d9f388fae2
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
2019-12-18 10:20:44 +00:00
Arnold Moyaux cdaf785ef7 [FIX] stock: same package in different location
- Create a move line from stock to shelf1 with PACK1
- Create a move line from stock to shelf2 with PACK1
- Validate

It should be be blocked. The contents of a package should all
be in the same location since the pack itself is in a location.

It's due to commit 78d6f46 that fix a rounding error.
However it should check for quants that have quantity since they
represents the package content.

closes odoo/odoo#42134

X-original-commit: 78fba949790f2b1ecd3ba1bf60fb34c30d17769e
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-12-18 13:32:22 +00:00
qsm-odoo 04bd016116 [FIX] website, *: fix tabs breaking when increasing number of columns
* web_editor

Previously, increasing the number of columns on the tabs snippet would
cause the newly created tabs to toggle the original tabs instead of its
own, this was caused by an oversight where the columns were clone
directly using jQuery, and the snippets' the onClone method was not
called on the newly created columns (here, tabs). This commit move the
responsibility to clone onto the SnippetsMenu so that it can create the
appropriate snippetEditor if needed and call its onClone method.

task-2070643

closes odoo/odoo#42130

X-original-commit: 77ebadfe6ada8ad1fa4d6e476b9534f252499d92
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-18 13:16:31 +00:00
Mathieu Duckerts-Antoine 9d539cd8c5 [FIX] web: take care of "groups" attribute in search view arch
The attribute "groups" on filters and fields in a search view arch was not taken
into account anymore.
Now items that should be invisible are not anymore available for selection
in the interface (as expected) but are still activable as search defaults
(and the corresponding facets appear if needed).

Task ID: 2081450

closes odoo/odoo#42125

X-original-commit: ca2514a9fbcd693752367cb566d5c11165b40bd4
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-12-18 13:13:10 +00:00
Olivier Dony e63fd04b51 [FIX] ir.attachment: make filestore GC yield to other transactions
If a long-running transaction holds a write-lock on any row in
ir.attachment, the GC job can wait an indefinite amount of time to
acquire its table-wise SHARE LOCK.

While sitting in the queue for this lock, it will conflict with any
future transaction that tries to acquire a write-lock on any row [1].
So the GC transaction, which would normally execute very fast and
immediately release its lock, will start to block other transactions and
cause severe delays in response time. It basically depends on how long
the tx holding the lock takes to complete... which is unknown.

As a workaround, we force an arbitrary (but short) lock_timeout in the
GC tx before attempting the lock. If it fails to acquire it, it will
fail and raise, causing the whole operation to abort. The cron job will
be rescheduled quickly because it failed to complete, giving the GC
another chance to complete.

10 seconds seems a reasonable compromise, as it gives the blocking
transaction(s) some time to complete before bailing out, yet should
not be long enough to bring the system to a halt due to other
transactions blocked by the GC one. I have no hard data to back this
claim, though.

[1] See the LOCK conflict table in the documentation:
      https://www.postgresql.org/docs/10/explicit-locking.html

closes odoo/odoo#42128

X-original-commit: 8a093c74c209d492f066c927cc4ac61325aee3ae
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-12-12 18:44:32 +00:00
Ivan Yelizariev d807e07949 [FIX] website: use localized date format
If getLangDateFormat is called right in loading the js file, it returns
default format. We now call it when translations are ready.

closes odoo/odoo#42126

X-original-commit: e7a58430a382ca1161131e562d53bef3ea0e6ce0
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-11-18 15:31:46 +00:00
Ankita Raval 1a364b4eeb [IMP] Product: Improve demo data
In this commit,
-Change the price of the three-seat sofa 60.000 to 1.500
-Change invoicing policy based on ordered qty

closes odoo/odoo#41980

Task-id: 2153140
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-12-17 10:25:49 +00:00
Samuel Degueldre ed5aa6be63 [FIX] web_editor: fix background postion option on columns
The background position snippet option makes a copy of the snippet to
use in the overlay, such that it is over all content and the user can
easily see the end result of dragging the background. However, an
oversight in the CSS didn't account for the possibility of the copied
element to have a relative max-width (% of its container), because of
this, the overlay for those items was incorrect. This commit fixes that
issue by overriding the max-width and max-height properties of the
copied item.

closes odoo/odoo#42106

X-original-commit: 3b8cadd579f3309640a938bcce39ac83ac7a6942
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-17 13:05:06 +00:00
Nicolas Martinelli 5661b48cfb [FIX] account: loop correctly
opw-2157568

closes odoo/odoo#42108

X-original-commit: 0d6a370f08b981737e7796055628955e82fdb19c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-18 09:16:14 +00:00
Xavier Morel a3371a467b [FIX] core: ask OS to pick CDT port
When running multiple odoo on the same machine (in order to test
multiple things concurrently, etc...) it's easily enough to start them
on 8069, 8070, 8071, ... and that *seems* to work, but then they start
walking on one another and *losing* chromes entirely, so you end up
with hundreds of chrome processes: right now with 2 Odoo running tests
my machine is at 365 Chrome processes, 550 process and 3180 threads
total (should be ~160 and ~700 with 2 chrome processes at most).

Instead, ask the OS to ask for a devtools port, then close the socket
and pass that to the child process. There's a race of sort for the
instant between closing the socket and Chrome reopening it, but:

* the window is very short
* we got a random port from the ephemeral range, it's possible
  somebody else gets it inbetween but unlikely (the 50% on a birthday
  attack is 200 for Linux's ephemeral range, it's a somewhat lower 150
  for the IANA range used by BSDs and Windows)

Sadly chrome doesn't stop if it can't bind to the port it's given.

closes odoo/odoo#42102

X-original-commit: 897ded1cb8b675024d75c6975ca171dbefdfc333
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-12-18 06:56:24 +00:00
jeffery 陈帆 f26760e2f4 [CLA] add new signature for jeffery9
closes odoo/odoo#42093

X-original-commit: 6e30f036d1105a0a8724428839e6ab692ef01cb1
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-18 08:38:20 +00:00
jev-odoo b308a173a6 [FIX] payment_paypal: Less confusing transaction logs
Before this commit, the log displayed "set as done"
before actually trying to put the transaction in done.
If an error then occurred in the'_set_transaction_done'
function and the transaction could not be processed,
this could lead to a misinterpretation of these logs.

This log is therefore moved after the transaction is
processed and is only displayed if it is actually successful.

This is valid for'done','pending' and'cancel'.

closes odoo/odoo#42089

X-original-commit: dd7552b1a48020f3f48cd40a5fc1cbc4c38a7f90
Signed-off-by: jev <jev-odoo@users.noreply.github.com>
2019-12-18 07:06:31 +00:00
Christophe Simonis 1f8706edd4 [FIX] test_main_flows: auto expand buttons in "More" dropdown
We are looking for the "Bom Count" stat-button, which can be hidden
behind the "More" dropdown, depending on the number of installed modules
and views inheritance order loading.

closes odoo/odoo#42085

X-original-commit: dc4a40cc130175a60aa77a0660613b23c4bb916f
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-12-17 18:58:30 +00:00
Nicolas Martinelli 55d82393dd [FIX] stock: prevent crash on availability
opw-2157386

closes odoo/odoo#42081

X-original-commit: bd6631f0dff3433d70d4279c336f132d4c46441c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-18 06:59:21 +00:00
Alexandre Díaz 37138a8977 [FIX] web: Changed mobile message html element in multi-company dropdown
Without this commit the multi-company dropdown breaks the page on mobile

closes odoo/odoo#42080

X-original-commit: e074dca861bedb89952d3788e711e261ce903295
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-12-18 02:17:04 +00:00
Martin Trigaux da66138f58 [IMP] doc: restore canonical URL
Was added at 958f9106dd but lost during design change

closes odoo/odoo#42061

X-original-commit: 560dba5313c5ca5265190dacc3bce7cbe509d30a
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-12 14:06:34 +00:00
Odoo's Mergebot 91f5fd0df3 [MERGE] website: reorganize website folder
Reorganize the website folder to gather the large amount of snippets
that will become standard. Also prepare for a new system of snippet
versioning.

Note: this merge contains a lot of commits because the files were
split in such a way the history is not lost. A better way could
exist to achieve this with less commits but in the end all the
commits are gathered in an unique merge commit anyway.

task-2158361

closes odoo/odoo#42067

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-18 04:15:12 +01:00
qsm-odoo 5a8c2c7a4a [FIX] website: remove css bundle for s_facebook_page added by mistake 2019-12-18 03:44:42 +01:00
qsm-odoo d63beb924b [FIX] website: s_title scss should have been moved in a dedicated file 2019-12-18 03:35:22 +01:00
qsm-odoo 38bf4eb10f [REF] fake move of website.scss 2019-12-18 03:33:25 +01:00
qsm-odoo f1af91584c [REF] move history of website.scss to s_title 2019-12-18 03:33:24 +01:00
qsm-odoo 95747d8da5 [REF] website: move s_mega_menu_menu_image_menu snippet to dedicated file 2019-12-18 03:27:50 +01:00
qsm-odoo 2e76b8a5a6 [REF] fake move of snippets.xml 2019-12-18 03:26:41 +01:00
qsm-odoo dedcd695ce [REF] move history of snippets.xml to s_mega_menu_menu_image_menu.xml 2019-12-18 03:26:41 +01:00
qsm-odoo 799142fe1b [REF] website: move s_mega_menu_multi_menus snippet to dedicated file 2019-12-18 03:25:59 +01:00
qsm-odoo 9b8cba09c8 [REF] fake move of snippets.xml 2019-12-18 03:24:59 +01:00
qsm-odoo 93ba0f4b74 [REF] move history of snippets.xml to s_mega_menu_multi_menus.xml 2019-12-18 03:24:58 +01:00
qsm-odoo 7e8396e6fe [REF] website: move s_quotes_carousel snippet to dedicated files 2019-12-18 03:23:07 +01:00
qsm-odoo c85a5d9b8f [REF] fake move of snippets.xml and website.scss 2019-12-18 03:20:37 +01:00
qsm-odoo 514c358dee [REF] move history of xml/scss to s_quotes_carousel files 2019-12-18 03:20:03 +01:00
qsm-odoo 254e691c47 [REF] website: move s_parallax snippet to dedicated file 2019-12-18 03:16:54 +01:00
qsm-odoo 6a3e76a1ab [REF] fake move of snippets.xml 2019-12-18 03:15:23 +01:00
qsm-odoo 9a6c1fe318 [REF] move history of snippets.xml to s_parallax.xml 2019-12-18 03:15:23 +01:00
qsm-odoo e714accfd6 [REF] website: move s_chart snippet to dedicated files 2019-12-18 03:12:23 +01:00
qsm-odoo 30aa2ee339 [REF] fake move of snippets.xml and options/animations.js 2019-12-18 03:05:35 +01:00
qsm-odoo a8305af1b3 [REF] move history of xml/js to s_chart files 2019-12-18 03:04:42 +01:00
qsm-odoo e0b97cdb87 [REF] website: move s_tabs snippet to dedicated file 2019-12-18 03:02:10 +01:00
qsm-odoo 7584e3012d [REF] fake move of snippets.xml 2019-12-18 03:00:58 +01:00
qsm-odoo b8167a8c03 [REF] move history of snippets.xml to s_tabs.xml 2019-12-18 03:00:58 +01:00
qsm-odoo 05d70bd6d4 [REF] website: move s_features_grid snippet to dedicated files 2019-12-18 02:59:33 +01:00