Commit Graph
99311 Commits
Author SHA1 Message Date
svs-odoo 74fcd3ac3b [IMP] web: FieldInteger and FieldFloat can use input of type number
This allow the browser/device to handle the experience of handling number in a more native way.

FieldInteger and FieldFloat now inherits from NumericField because we want
to format it or not dependent of the view (readonly or edit) and the
NumericField will manage it.

We do that because input type number can't take a value with comma on Chrome
(FireFox is more permissive but not perfect because comma is the separator
for decimal in this case).

Task #1880376
2018-09-07 16:18:45 +02:00
ThanhDodeurOdooandPierre Paridans 16aeecc73d [REF] base, mail: Documents (enterprise) related changes
-removed force_ext from ir.http.
    -added signature arg to web/image to differentiate cache entries by URL.
    -added an embed youtube viewer for youtube URL's
    -added a PDF splitter to the PDF viewer UI
    -added tests for mail's Document Viewer
    -added a "signature" param to web/image to go around the browser cache

    -thumbnail field of ir.attachment is now stored in the filestore
    as a distinct attachment.

task 1853490

Co-authored-by: Pierre Paridans <app@odoo.com>
2018-09-07 16:06:47 +02:00
eco-odoo 469d7acb89 [FIX] snailmail: fix cron job name typo (#26851)
The typo could be inconvenient when searching through  logs for
example.
2018-09-07 15:47:57 +02:00
Thibault Delavallée 9abbd843a8 [FIX] mail: set cursor as pointer when hovering contact name in activity summary view
Purpose of this commit is to make it obvious contact name cell is clickable.

This commit is linked to task ID 1882545 and PR #26797.
2018-09-07 15:29:57 +02:00
Thibault Delavallée a75b7cd517 [IMP] mail: sort activity summary view by deadline ascending
Purpose of this commit is to have first activities to perform displayed
first in the activities summary view.

This commit is linked to task ID 1882545 and PR #26797.
2018-09-07 15:29:57 +02:00
Thibault Delavallée 540226d806 [IMP] mail, contacts: allow to have actions in systray elements
Purpose of this commit is to allow having an icon redirecting to the
activity summary view in the partner activities section of systray.

This is done by supporting an additional 'actions' list in the activity
data given to the systray. It displays small icons that redirect to an
Odoo action given its xml ID.

This commit is linked to task ID 1882545 and PR #26797.
2018-09-07 15:29:57 +02:00
Thibault Delavallée 11918bbf43 [FIX] mail: use contact app icon for partner-related activities in systray
As res.partner model is defined in base systray takes the base icon as icon
used in the systray when classifying activities by model. As base module has
no icon it leads to a blank icon being displayed in the systray. Purpose of
this commit is to use the icon from Contact application instead.

As contacts application now depends on mail we do it simply through
inheriting the systray_get_activities method that return the data to display
the systray elements.

This commit is linked to task ID 1882545 and PR #26797.
2018-09-07 15:29:57 +02:00
Thibault Delavallée db3cdee226 [FIX] note: use calendar icon when setting the reminder date in systray
Specifications :

 * clock icon is generally used for datetime;
 * calendar icon is generally used for date;
 * as we set the reminder date in the systray let us use the calendar
   icon in the systray in the reminder section;
 * please also remove the extra margin bottom of note when entering a
   new reminder, it makes @est-odoo very sad;

This commit is linked to task ID 1882545 and PR #26797.
2018-09-07 15:29:47 +02:00
Thibault Delavallée 8be06de0af [REF] contacts: set mail module as dependency of contacts
Contact application allows notably to see the activity summary view on
customers activities. It require mail to be installed. As there is no
real use of contacts application without mail let us set mail as a
dependency of contacts. It seems a better solution than having a bridge
module between contacts and mail.

This commit is linked to task ID 1882545 and PR #26797.
2018-09-07 15:25:43 +02:00
XavierDo 7f47dcae5b [FIX] mail: improve activity view and fix activity feedback
-Improve no content helper on activity view

-Update chatter after editing an activity un form view

-Avoid context to appear as feedback
When using call_button the context is set as an arg and will be catched by
the kwargs of the called action.

As for action_feedback, we can create a wrapper without kwargs
used when calling this method from a button to avoid this problem.

Another solution would be to change the call_button in order to give
the context as a kwargs. Maybe a possible improvement for master.

-Remove groupby from activity view
group by has no effect on activity

-Change cursor to pointer on record name in activity view

Task: #1878184
PR: #26668
2018-09-07 14:59:05 +02:00
Pratima Gupta dd32131ce6 [IMP] various: improve settings wording and labelling
Purpose of this commit is to improve settings by improving labels and
section titles. Purpose is to ease use of settings by users and make
it easier to understand.

This commit is linked to task ID 47221 and PR #26483.
2018-09-07 14:39:32 +02:00
jem-odoo 9c277c6b6d [FIX] sale_timesheet: correct domain for SOL on task
The onchange returned a domain with a non existing
field of sale.order.line.
This commit fixes it.
2018-09-07 14:06:49 +02:00
jem-odoo d11636191b [FIX] sale_timesheet: avoid recreating task from SOL on confirmation
When cancelling SO, then reconfirm it, a new task will be created. This is
no the willing bahavior. This commit fixes this, so reconfirmating does
not create a second task.
This commit also provides a test case and so, mixes 2 test cases into
one for a better coverage.
2018-09-07 14:06:49 +02:00
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
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
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
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 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