Commit Graph
120174 Commits
Author SHA1 Message Date
jem-odoo aee642939c [FIX] sale_timesheet: hide 'create SO' on project
This button requires the rights to handle SO (create and update), so we now
only display this button if current user can do such action. Otherwise, when
submitting the wizard, the user gets an access error.
2018-09-07 14:06:49 +02:00
jem-odoo c31cebfe27 [FIX] sale: wording for SOL on analytic line
Let's stay consistent with other modules ...
2018-09-07 14:06:49 +02:00
jem-odoo 602e0528cd [FIX] hr_timesheet: generate AA when allowing timesheet
During the super of write, a check constraint is done
in python. So, if writing allow_timesheet=True the constraint
will raise is no AA is set on the project.
This commit restore the exepected behavior.
2018-09-07 14:06:48 +02:00
qsm-odoo 3444e0a0da [FIX] web_editor, *: use explicit string keys for color maps
* website

```
$map: (
    test: 1,
    black: 2,
);
@​debug map-get($map, 'test');
@​debug map-get($map, test);
@​debug map-get($map, 'black');
@​debug map-get($map, black);
```

The above code leads to a:
1
1
null
2

This is because maps' keys can be *anything* in sass (even other maps).
In the example, the map is defined with unquoted `test` and `black` as
keys which are understood as the string 'test' and the *color* black.
When asking for the value for the 'black' string key... there isn't any.

This commit forces the use of quoted string as color maps' keys.
2018-09-07 13:57:14 +02:00
XavierDoandChristophe Monniez c44fe91232 [IMP] http,server: add query count and request times in logs
When there is a performance issue, it's sometimes difficult to discover
which request increased the query count or its duration.

With this commit, the query count, the query time and "python and io" time are displayed
in the logs at the end of each werkzeug request line.

Co-authored-by: Christophe Monniez <moc@odoo.com>
2018-09-07 10:27:46 +02:00
Rémi Rahir 2f033d7184 [FIX] account_facturx: fix condition on _post_pdf
The override on _post_pdf should only be triggered when there is only
one record. The if statement was faulty.
2018-09-07 09:17:28 +02:00
Rémi Rahir fb7500c050 [IMP] account: close modal after printing report
Benefit from the improvement introduced in
94f8db9d18a722404f0c861ee698d9d96443833d and drop
the 'printed' status which becomes useless.
2018-09-07 09:17:28 +02:00
Rémi Rahir 241efab999 [IMP] web: Close window when printing a report
Up until now, the execution of a report action could not be followed by
any action which prevented, for example, to automaticcaly close a modal
after printing a report from it. This has become an issue when working
on customer's invoices using the new modal introduced in 4cb9194275

This commit allows to close a modal after the download of a report.
2018-09-07 09:17:28 +02:00
Rémi Rahir ab0f5f7135 [REM] web: legacy code on action_report
Removing the code that allows to generate multiple reports with a single
action introduced in 410d6a703b as it was
only used for l10n_ch and that this was abandoned in
5169b50efe.
2018-09-07 09:17:28 +02:00
qsm-odoo a7a89f3174 [FIX] portal: use flex for #wrapwrap layout
(Needed for themes migration)

The #wrapwrap element always featured a hack to make the inner <footer/>
stick to the bottom of small-height pages (typically, empty pages). As
advertised, this was a *hack*: forcing the element to "table" display
and its children to "table-row" display. This prevented some themes
to do some stuff.

With the migration to BS4, we now use flex at various places and so
only support the browsers which support flex (every last version of
major ones). The footer feature can be solved using flex, so there is
no point in keeping the hack.

This also allows to make the #wrapwrap element scroll instead of the
<body/> and to always have a screen-shaped #wrapwrap element, making the
element the user's <body/> it was always meant to be.
2018-09-06 18:04:09 +02:00
Arnold Moyaux 6b550b8721 [FIX] sale_stock, purchase_stock: lot po/so count
Usecase to reproduce:
- Create a PO or SO with 10 lines
- Process the DO/Receipt to done
PO or SO count on lot is equal to 10 instead of 1

It happens because multiple stock_move could be linked to 1 order.
2018-09-06 13:27:56 +02:00
Alexandre Kühn d5715f482f [FIX] web: no padding/border twice in dom.autoresize
Before this commit, the `dom.autoresize` function may apply the
padding and border width twice when computing the height of the
textarea. This issue occurs when the fixed textarea had the same
CSS style as the textarea.

This commit fixes the issue by enforcing zero padding and border
width in the fixed textarea.

Task-ID 1882736
2018-09-06 12:23:28 +02:00
ThanhDodeurOdoo 5e855453ae [FIX] web: web/image route image type fix
- the http route, when given width and height arguments is no
longer forcing the type PNG (which resulted in heavier images than the
original).
2018-09-05 16:33:25 +02:00
ThanhDodeurOdoo fa39019ee1 [FIX] tools: image.crop_image default type fix
- the image.crop_image method doesn't defaults the format to PNG anymore.
  Instead it uses the format of the original image
  and defaults to jpeg as a last resort as the save method requires
  a type if it is called with an image object.
2018-09-05 16:33:25 +02:00
Christophe Monniez e312ec71dd [FIX] tests: detect coverage and adjust timeout
When computing coverage, the tests are slowed down and the timeout is
often exceeded.

With this commit, HttpCase headless Chrome tests timeout is increased if
coverage is detected.
2018-09-05 15:30:49 +02:00
Christophe Monniez 69a24eb84b [FIX] tests: close Chrome and shutdown on SIGXCPU
When Odoo receive a SIGXCPU (CPU time limit reached), it shuts down
immediately. If a headless Chrome is running, it stays alive after the
Odoo shutdown.

With this commit, the signal is intercepeted and the Chrome browser is
properly closed before shutting down the Odoo server.
2018-09-05 15:30:49 +02:00
Christophe Monniez 2c09110927 [FIX] server: ensure that the error message is flushed
When Odoo intercept the SIGXCPU signal, an error message is written to
the stderr. Unfortunately, if stderr is redirected to a buffered file, the
message will not appear.
2018-09-05 15:30:49 +02:00
Christophe Monniez f468023bd9 [FIX] tests: properly stop chrome when no tab found
In some situations, Chrome remote debugging is sending an empty list of
opened tabs. In that case, an orphan Chrome process stays alive.

With this commit, Chrome is stopped properly in those situations.
2018-09-05 15:30:49 +02:00
Aaron Bohy 5ccc3f66e8 [FIX] web: read_progress_bar: convert dates to strings
Since rev. 960360af, Date (resp. Datetime) fields return
datetime.date (resp. datetime.datetime) objects. This caused an
issue in the read_progress_bar method which returns a dict, whose
keys are values of the group_by. Indeed, when grouped on a Date or
Datetime field, the key was no longer a string but a datetime.date
or datetime.datetime object, and it crashed when that dict was
turned into a JSON string.

This method isn't tested at all for now, but tests will come
shortly.

Task 1878254.
2018-09-05 15:25:57 +02:00
David Beguin ec801b5436 [FIX] calendar : all day event Date to Datetime error
- calendar.event.start and stop are expecting datetime and not date.
Now, if 'All Day' event, start time = 00h00 and stop time = 23h59m59s
- when switching from all day event to not all day event, due to
stop time = 23h59m59s, the rounding for duration leads to make the stop
pass to the next day (00h00). each time you switch between all day and
not all day, the duiration is incremented by 24h.
We remove 1 sec to event stop time to avoid this.
2018-09-05 15:22:50 +02:00
Martin Trigaux 5d2bea62c3 [FIX] mail: display icon
The icon for .o_user_online (e.g. fa-heart for bot) was not displayed as it was
the same color as the one defined in .o_thread_window_header

Use $o-enterprise-primary-color (aka green) to indicate the user is online

Closes #26350
2018-09-05 15:17:17 +02:00
jem-odoo 02273803e4 [FIX] sale_timesheet: visibility of SOL on timesheet subview
The field SOL on the timesheet list on task should
be visible when the project is billed at employee
rate. This help the user to see which timesheet is
included in which SOL.
2018-09-05 15:06:16 +02:00
jem-odoo 8ee2a9c232 [FIX] sale_timesheet: project manager can fill employee map
The access rights of project.sale.line.employee.map were not
created. This commit provides record rules and accesses for
a project manager to fill the map of a project, and configure
correctly the way of invoicing the timesheet.
With PO's agreements, a such manager should be able to read
services SO and SOL to do that action, without leaking
informations.
Note: reading SO is required as the name_get of SOL fetch
the name of the SO.
2018-09-05 15:06:05 +02:00
jem-odoo 0d16d65eb4 [FIX] sale: access right for name_get of SOL
Sometimes, we want to give access to sale lines only for some users. But to
allow them to read a SOL, they need the read access of the sale order (as
the name is part of the name_get of SOL), which might break the saleperson
rights. This commit makes the name_get of sOL as  to allow fetching
the name of SOL without having the access right on the order.
2018-09-05 15:05:46 +02:00
jem-odoo a6401391ed [FIX] fields: raise when setting aware datetime
Now that Date/Datetime fields use python naive datetime, we want
to prevent developper to call  or assign aware datetime to
fields. Moreover, if so, the timezone will be stored in the
database, but when reading Datetime fields, we expect naive datetime.
Comparing naive and aware datetime objects leads to errors.

This commit forces developpers to use naive datetime when saving
data in database.

As example, we have to erase the timezone of dates in calendar
modules. We also regroup the 2 assignations in one call to
`write` for performance reason.

Thanks to @dbeguin and @RomainLibert for spending some time
on this bug.
2018-09-05 15:05:33 +02:00
qsm-odoo a997a5a1c6 [FIX] web_editor: adapt 'small' colorpicker button UI 2018-09-05 14:25:53 +02:00
Jeremy Kersten 715d492c8c [FIX] website_event: attach 'new register' modal to body
Before this commit it was attached to the form, in case your banner was
customized to have the font-color white, the text modal become white on white.

Now we attach to body, to don't have custom design from parent div.

This commit closes opw-1881280
2018-09-05 13:55:41 +02:00
Sébastien Theys 18fd4c9177 [FIX] payment: fix typo in payment.icon form
group= should have been groups= so it had no effect.

At the same time the view is already accessible only through a debug menu, so we are fine to always show the list.
2018-09-05 12:05:12 +02:00
Alexandre Kühn 0d515f0c7a [IMP] mail: stylized 'no content' helper in activity view
Task-ID 1882552
2018-09-05 11:43:24 +02:00
Odoo Translation Bot 55a5aca6d9 [I18N] Update translation terms from Transifex 2018-09-05 11:24:24 +02:00
Martin Trigaux cdb4b1c7c2 [I18N] export saas-11.5 source terms 2018-09-05 10:59:44 +02:00
William Henrotin 72c82b34d8 [FIX] purchase_requisition: datetime convertion
Purchase agreements create request for quotation with prefilled field.
The issue is:
date_planned (on RfQ) is filled from schedule_date (on PA). The first
one is a datetime object. The second one is a date object.
This commit makes a right conversion between datetime and date at the
RfQ creation. This issue was introduced by the datetime refactoring
(#24717)

Task id: 1878136
2018-09-05 10:34:39 +02:00
Martin Trigaux 85722a76d6 [FIX] base: correct typo 2018-09-05 10:12:08 +02:00
Aaron Bohy 06e6887950 [FIX] web: Kanban: quick create with correct values
Let's assume a quick create form view with an onchange. Before
this rev., if the user set a value for the char field with
onchange, then clicked on 'Add', the record was created before
the onchange was applied, and thus with incorrect/incomplete data.

The reason is that, when clicking on 'Add', the user triggers a
'change' event on the char field, which notifies the model of its
new value. Then, as 'Add' is clicked, the quick create widgets asks
all widgets to commit their potential (uncommitted yet) changes.
But there is nothing left to commit as the changes have just been
notified. The quick create only waits for this to make the create
RPC, and thus totally ignores the changes that were committed at
the first place.

Task 1878254.
2018-09-05 08:47:21 +02:00
Aaron Bohy f29f131f85 [IMP] web: concurrency: add getUnlockedDef to mutex
This rev. adds a new function to the mutex concurrency helper:
'getUnlockedef'. This function returns a deferred resolved as soon
as the mutex has no more task to execute (or directly if it is
currently idle).

Such a function was needed for an upcoming fix.

Related to task 1878254.
2018-09-05 08:47:21 +02:00
Aaron Bohy 71254e956d [FIX] web: Kanban quick create: prevent multiple creation
Before this rev., if the user clicked several times on 'Add' (or
pressed several times 'Enter'), on a KanbanQuickCreate record,
multiple records were created.

This rev. makes sure that this doesn't happen anymore by locking
the widget when it is creating a record ('create' RPC that might
be preceeded by an 'onchange' RPC).

Several test cases are added, to mock the different scenarios that
could occur, as they are all slightly different (depending on if
there is an onchange or not and if the user clicks on Add or press
Enter).

There is still a scenario that needs to be handled, which is the
one with an onchange and where the user clicks on 'Add'. This one
is more tricky and will be handled by a future commit.

Task 1878254.
2018-09-05 08:47:21 +02:00
Aaron Bohy db9b91ffe6 [FIX] web: BasicController: remove deadlock situation
This rev. removes a deadlock situation that could *theoretically*
occur, but that was actually hard to reach in practice.

Before saving a record (e.g. in a form view), all field widgets
are asked to commit their value (in case they wouldn't have
notified the model yet, e.g. because the user just changed them).
For instance, let's assume that the user fills an input field, and
then triggers the save. In practice, by triggering the save, it
will force the widget to notify the model of its new value (because
it looses the focus). This is also the case using keyboard
navigation, as it actually simulates clicks. So when the widget is
asked to commit its value right after, it has nothing more to
commit.

This is fortunate, because if it actually had something to commit,
we would end up in a deadlock ('commitChanges' is executed in a
mutex, and if the widget triggers a new value, '_applyChange' is
called, and is executed in that mutex as well). In fact, executing
'commitChanges' in a mutex is useless, as '_applyChange', which is
called when a widget has something to commit, is already executed
in the mutex.

So this rev. removes the use of the mutex in 'commitChanges'.

Doing so broke several Many2One tests, because they wrongly relied
on the presence of the mutex for scenarios where the user quick
creates a relational record, and then directly saves (before the
relational record is actually created). We thus handled that
usecase properly to make the tests pass.

Task 1878254.
2018-09-05 08:47:21 +02:00
Aaron Bohy 027436ee5a [REF] web: FormTests: move test to correct section 2018-09-05 08:47:21 +02:00
Christophe Monniez c6ed80e1b6 [FIX] tests: disable screencast when no logfile
When an HttpCase browser_js test is started, the screencast is started
and is discarded at the end of the test if no logfile was provided by
the config.

This behavior can impact the performances.

With this commit, the screencast does not start at all if not needed.
2018-09-04 19:17:01 +02:00
Christophe Matthieu f29df7fb2e [FIX] web: Fixed the printing of reports.
A new exception has been added to detect inconsistent reports. However, many are not structured as expected. Thus, the change consists mainly of checking only when the print has to be separated in part to attach it to the respective documents.

We now take the page tag instead of the article, because the article tag is in the layout, so to separate the file, the t-call had to be inside the t-foreach (for the separation) and so possibly read the assets several times. Since all templates have the first tag (in the t-foreach) tag page, the choice is more sensible.

The javascripts files used in readonly were taken out of the editing assets.

A turn was made but not activated, it works locally, but on the runbot, an error is triggered when generating assets after choosing the settings.
2018-09-04 19:01:20 +02:00
Alexandre Kühn b67bb599b8 [IMP] note: improved no_content help in note
The `no_content` help was too long.

Task-ID 1877502
2018-09-04 17:52:38 +02:00
qsm-odoo a0fed1c719 [REF] website_theme_install, *: add theme.utils utility methods
* theme_bootswatch, theme_default

Allow to disable/enable a view from a xml_id whether the xml_id is
linked to an ir.ui.view or a theme.ir.ui.view.
2018-09-04 17:43:45 +02:00
Mathieu Duckerts-Antoine c4557580ef [IMP] web: review time range menu rendering
This commit changes two things in the time range menu
appearance:

	- the order of range options
	- the spacing between them (now two different groups
	  are separated by an empty lines)

Some tests had to be changed accordingly.
2018-09-04 17:37:14 +02:00
Mathieu Duckerts-Antoine 5510d808b8 [FIX] web: return information on pivot measures and groupbys
This commit fixes a bad behavior of the pivot view. By the
past, if there were no data to present in the pivot view, no
information on the pivot view configuration was returned by
the get function. This does not cause problems to the pivot
renderer (by design) but causes problems elsewhere, for
instance in a dashboard view that contains a pivot view.
Indeed, at each update, the dashboard view reinstantiates its
subviews, so that information can be lost if a subview is of
pivot type.
2018-09-04 17:37:14 +02:00
Mathieu Duckerts-Antoine d4b26c3372 [FIX] web: pivot model accept no __count key or null values
The _mergeData function used in pivot view comparison mode
was not designed to accept the absence of the __count key or
null values for measures in the objects returned by a 'read_group'.

The absence of the __count key would result in a traceback and null
values for measures into wrong calculations (infinities).

One could ask why null values did not cause problem before.
The simple reason is that the formatters used to format cell values
render a 'null' value like they render a zero.
This fix makes explicit that null values have to be considered
as zeros and avoid in that way Infinity values when computing
variations.
2018-09-04 17:37:07 +02:00
Mathieu Duckerts-Antoine 004b6e8b1c [FIX] web: fix time range menu button style in mobile mode
The search view in mobile mode has been redesigned and looks a bit different
from the search view in desktop mode. This commit adapts the time range menu
appearance in mobile mode.
2018-09-04 17:34:47 +02:00
Mathieu Duckerts-Antoine 39cfd5baa1 [FIX] web: export to excel in pivot view
Exporting data of a pivot view in comparison mode ends in a
crash. The root cause is that _t was replaced by _lt
so that some strings were replaced by objects with a toString method.
This does not cause problems when rendering a pivot view since
both QWeb or JQuery call that method. The function _exportData does not.

This commit fixes that situation and adds a test of _exportData.
2018-09-04 17:34:19 +02:00
Mathieu Duckerts-Antoine 4f4f111349 [FIX] web: disable buttons when no data presented in pivot view
The buttons 'Flip Axis', 'Expand All', and 'Download xls' are
now deactivated when no data are displayed in the pivot view
(those buttons are useless in that situation).
2018-09-04 17:34:02 +02:00
Arnold Moyaux e90fff6957 [FIX] stock: sn created for product w/o tracking
commit bed29a4aea create a demo serial
number for a product without tracking
2018-09-04 14:56:54 +02:00
Christophe Monniez 804b9b7c5e [FIX] hr_recruitment: limit new hired filter to group
In Employees views, selecting New Hired filters leads to an access error
with a simple user.

With this commit, this filter is limited to the corresponding users
group.

Closes #26747
2018-09-04 13:44:17 +02:00