Commit Graph
119555 Commits
Author SHA1 Message Date
qsm-odoo b56e647f2c [REF] web_editor, website: improve animations' restart
- Before this commit, when we asked to (re)start animations on an
  element, we checked the animations to be started on the element
  and started them after destroying the animations with the same
  name which were already running on that element. This is in fact
  not correct. Indeed, if an animation was running on element but
  that the conditions that made the animation start are now gone,
  asking to restart the animations on that element should destroy
  the deprecated ones. (e.g. an animation "A" is to be started on
  all elements which have a class "a", if we remove the class "a"
  on an element then restart animations, the animation "A" should
  be destroy). The implementation is in fact even simpler: when
  asking a restart, a full stop is performed then a simple start.

  Note: this does not need to be a fix as multiple animations on
  a same element was recently introduced and the described case
  never occurs with current features.

- When stopping the animations on an element, stops the animations
  of all its descendants too.

- Add an helper method in the `SnippetOption` class to restart the
  animations running on the `$target` element.
2018-08-13 18:42:52 +02:00
Cocographique 4dce6cc98b [IMP] website, *: review snippets and colors
* web, web_editor, website_hr_recruitment, website_mail_channel,
  website_mass_mailing

- Review all snippets and add new ones
- Add lots of new options
- Use odoo colors as default theme colors

task-38878
2018-08-13 18:30:01 +02:00
jem-odoo 2623644ba8 [MERGE] sale_timesheet: billing time at employee rate
When a project become billable, the employee can now timesheet
on a same task, at different rate.
The project should be linked to a SO, and the mapping between
the employee and the SO line will be done using 2 mecanisms:

1/ task rate: the SO line set on the task is chosen for any employee
timesheeting on the task.

2/ employee rate: a map exists on the project, matching employee
with an SO line from the SO of the project. If the employee is not in
the map, the fallback will be the SO from the task, or the one from
the project.
This makes the SO line on the task always visible.

See subcommit for more details.

Task #34703
Closes #26111
2018-08-13 17:32:54 +02:00
jem-odoo b4af54f9c2 [IMP] sale_timesheet: billing time at employee rate
When a project become billable, the employee can now timesheet
on a same task, at different rate.
The project should be linked to a SO, and the mapping between
the employee and the SO line will be done using 2 mecanisms:

1/ task rate: the SO line set on the task is chosen for any employee
timesheeting on the task.

2/ employee rate: a map exists on the project, matching employee
with an SO line from the SO of the project. If the employee is not in
the map, the fallback will be the SO from the task, or the one from
the project.
This makes the SO line on the task always visible.

The billable type of a project depends on if the map is filled
or not. There is 2 ways of making a project billable:
- project is created from SO confirmation (depending of product
configuration)
- through the wizard "Create Sales Order": a SO will be created
and the project will be associated to it.

The subtask should follow the configuration of its parent
project (and not parent task).

Task #34703
Closes #26111
2018-08-13 17:32:22 +02:00
jem-odoo 3e1207c4ac [IMP] project: task log settings 2018-08-13 17:32:22 +02:00
jem-odoo f192c3e90f [IMP] sale_timesheet: add project stat button on overview
The config of a project will become more
important and usefull for project manager, so
adding a shortcut from the overview to setup
correclty its project makes sense.
This commit adds this button on the overview.

Task #34703
2018-08-13 17:32:22 +02:00
jem-odoo 67c8a60aff [FIX] sale_timesheet: sale order line of subtasks
We want to set the sale line of the parent when changing the subtasks parent
but not force changing it when modifying the SO line of the parent task, and
we have to reset (empty) so line on subtasks when changing the customer of a
task to avoid no seeing the current SO line in its domain (dropdown) since the
customer has changed.

Task #34703
2018-08-13 17:32:22 +02:00
jem-odoo cfbd57a96e [IMP] sale_timesheet: introduce billable type for project
For futher developpement, the notion of billable
type of a project and a task will appears. This commit
introduces this notion to make clear the case 'task
rate' was already covered.

Task #34703
2018-08-13 17:32:22 +02:00
jem-odoo ba0b3dab71 [IMP] sale_timesheet: avoid modifying project of invoiced timesheet
Task #34703
2018-08-13 17:32:22 +02:00
jem-odoo 12430b59f3 [FIX] project,sale_timesheet: default partner on billed task 2018-08-13 17:32:22 +02:00
jem-odoo 20cc64f79e [IMP] *_timesheet: don't modify past timesheet when transfering task
Impacted modules: hr_timesheet, sale_timesheet

When task is changing project or sale order line, we
don't want anymore to change the linked timesheet.
We now consider a timesheet is done in a specific time
at certain condition that does not have to change when
the environment is modified afterwards.

So, a timesheet linked to an analytic account for a
certain project on a task (and mybe linked to a SO line)
will still be linked to the same object if the task is
billed with another SO or move into a new project.

The idea is task actual configuration (project, AA, SO
line) are the default value at timesheet creation. As
consequences, timesheet from another project can be linked
to a task that does not belong to that project.
Project and task can be modified thougth the UI of timesheet
app. SO line and analytic account of a timesheet can not
be modified as they are more sensitive field (in a business
point of view), especially for invoiced timesheets.

This commit revert opw-1803811, as at that time the
'inheritS' between project and AA was still effective,
and there was only one billable type (task rate) for
task. The introduction of 'employee rate' billing type
will complicate timesheet transfert.

Tasks #34703
2018-08-13 17:32:22 +02:00
Yannick Tivisse 02d565cc0e [IMP] mail: Allow to send a notification to the author
Purpose
=======

Sometimes we could want to send a notification to the author too.

Like in the onboarding bars, where we send a sample invoice to the administrator.

He's the author of the message, but the goal is to send him an email to check the
full process when sending a sales order/invoice by email to a customer.

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

For that purpose, if a key 'mail_notify_author' is set on the context when
sending the email, then notify the mail author.
2018-08-13 17:14:05 +02:00
eco-odoo f28369fd26 [IMP] sale,account: Fix/improve miscellaneous points on the onboarding bars
Purpose
=======

Clean some stuff on the onboarding bars:

- Payment setting should be activated in sales settings if a payment acquirer is
  activated from the sales bar, otherwise the customer can't pay with the acquirer
- No email is sent with sample documents -> sending to yourself using the chatter doesn't work...
- Select "sign online" by default
- Improve payment instructions
- Improve the default thank you message on payment acquirer accordingly (when no bank defined)
- Choose a custom payment method -> mark the step as done
- Improve buttons wording:
- Put a pointer cursor when hovering on done steps
- Fix typo : instructions -> Instructions
- Fix layout issue on tax screen
2018-08-13 17:14:05 +02:00
Martin Geubelle 9030781a51 [REF] web: Kanban: allow to override on_close callback
It could be useful to override this callback to, for example, reload the whole
kanban view.
2018-08-13 17:09:28 +02:00
Martin Geubelle 60318c76dd [IMP] base: get print paper size
When using a paper format to print a report, one needs to pass the format to
wkhtmltopdf (with --page-size, e.g. "A5").

The information about the print page size (width, height) has been added on the
paper.format model. It is used in Studio to correctly display the report
preview in HTML without printing the report.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 9eef25ae0a [FIX] web: can focus out then focus in when currently being selected
Before this fix, in studio when the user select the field then focus out
then focus in and selected a child field, an exception is triggered because
the last page is visible but the data are removed.
A test in enterprise (web_studio) is added with this commit.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 8f7fdb0d99 [FIX] web: fix JavaScript qweb and activate tests
Fix the issue of the t-esc display the content before the tag.
Activate qweb qunit test (same test for the JavaScript and python)
Use the same behavior as python: keep attributes order, and display content
as default value when the variable is falsy.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 61eef73b52 [IMP] base, *: use a many2one for the company report layout
Before this rev. one could set the report layout on the company using a
hardcoded list (background, clean, standard, etc.). Other modules (typically
accounting modules) could add options in this list. The used template was built
on the layout key.

Now, the layout is a many2one field to a newly created model `report.layout`,
which is linked to a view with the layout architecture.

This gives more control to customize reports and create a new layout (without
creating a python module that extend the layout selection).
2018-08-13 17:09:28 +02:00
Christophe Matthieu 149eb38b07 [IMP] account, sale: convert template python logic into computed field
Make simpler report edition in studio

* 'amount_by_group' for account.invoice and sale.order
* 'price_tax' for account.invoice.line
2018-08-13 17:09:28 +02:00
Christophe Matthieu 19106533d3 [FIX] qweb: t-call can be called with an id
Following the new studio features, the use of t-call in templates with
the id occurs. Doing the verification of the integer type of the template
in addition to checking whether the value of type string is a number or
not should be done at different levels. It is therefore simpler to ensure
that the value is a number or an xml_id in compile which is the entry
point of the render and t-call.

The cache made on compile does not change because we have no case where a
template is called with a number of type string in addition to being
called with an integer.
2018-08-13 17:09:28 +02:00
Martin Geubelle 9a98a4d60e [IMP] base: search template view based on key in addition to xml_id
In Studio, users can create views, reports, etc. which do not have an
xml_id (no record in 'ir.model.data' from import/install).

After this modification, the template can use the t-call using a readable
key on newly created views.
2018-08-13 17:09:28 +02:00
Christophe Matthieu ede9960a78 [FIX] qweb: correctly compile falsy t-value
An empty t-value is a empty string, which cannot be compiled as an expression.
The value is now considered as None so it can be compiled.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 79a0f401a4 [IMP] web: add options to dragAndDrop test util function
There is now an option `continueMove` that can be used to extend a previous drag
done in this function.

The option `position` has also been extended to take an object (to precise the
move position).
2018-08-13 17:09:28 +02:00
Christophe Matthieu 5779807a31 [IMP] base, hr_timesheet: add option digital in qweb field duration
The option `digital` has been added. It allows to display "01:00" instead of "1
hour". This behaviour was implemented in a report (timesheet) but the logic
was done in the XML, which is not adequate.

This commit also allows to have a negative value for this widget.
2018-08-13 17:09:28 +02:00
Martin Geubelle 9dbf815dd8 [REF] *: modify templates to allow smoother modifications
With the report editor in Studio, some reports were not easily editable (not
idiomatic XML, too much Python logic in XML, etc.).

These reports have been cleaned up.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 4d3a776389 [IMP] web: avoid failed tests affecting the next ones
When using positional clicks (among other examples) in tests, a previous failed
test might affect a next one because the assert failures are displayed on the
top of tests.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 8f216482b8 [IMP] web: propagate many2many attributes to the sub FieldMany2One
The FieldMany2ManyTags uses FieldMany2One in its implementation.
Before this commit, the field attributes were not propagated to the sub field.
In particular, the attribute `can_create` is useful to be propagated.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 6ca026119e [IMP] web: add method to convert JS domain into python condition 2018-08-13 17:09:28 +02:00
Christophe Matthieu cad272d5b6 [IMP] base: log wkhtmltopdf error
If wkthmltopdf silently raises an error without any error code, there was
previously nothing displayed to help debugging.

The error is now logged as a warning.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 65e7ce0bb2 [FIX] web: load only once the session.js 2018-08-13 17:09:28 +02:00
Martin Geubelle 7f4b4f86bd [IMP] web: add MutexedDropPrevious in concurrency
This new helper is meant to solve the following use case: serialize a number
of concurrent rpcs while skipping the rpcs that arrive in between the mutex.
2018-08-13 17:09:28 +02:00
Martin Geubelle 971629b9fe [IMP] web, web_tour: handle iframe in tests and tour
In both test util functions (`dragAndDrop`) and tours, using elements in iframe
was not supported.

As a jQuery selector won't work with an iframe, when using a selector like
`div.o_my_class iframe p:first` the tour manager will split the selector, which
will result to `$('div.o_my_class iframe').contents().find('p:first')`.
2018-08-13 17:09:28 +02:00
Christophe Matthieu bae6494520 [FIX] web: apply css border to the table 'th' like the 'td' 2018-08-13 17:09:28 +02:00
Vincent Schippefilt c38290a3c9 [IMP] web: add text decoration classes 2018-08-13 17:09:28 +02:00
Christophe Matthieu f69ebfcfe6 [FIX] qweb: correctly display qweb error message
When compiling the qweb template, if an error occurs, an error message is
displayed with the corresponding failed node.

This messsage was not always correct because the node is modified in place
during the compilation proccess.

The template is now re-read before displaying the error.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 24657828b5 [FIX] qweb: converted profile feature to py3 2018-08-13 17:09:28 +02:00
Christophe Matthieu acbcf36db4 [IMP] qweb: add many2many qweb widget
Instead of looping on x2m values in the qweb report, this new widget will
automatically render the x2m values for you (separeted with a comma).
2018-08-13 17:09:28 +02:00
Christophe Matthieu 14176015f5 [IMP] qweb: add method who defines qweb widget options
Each qweb widget should now explicitily define a method
`get_available_options` which specifies all options used in the widget
rendering.

The options are a dictionary with the option as key and the option type as
value (e.g. string, integer, array, model, etc.).

This is used by the Studio report editor (to customize widget options) and parsed
in JS.
2018-08-13 17:09:28 +02:00
Christophe Matthieu 32b269d3d5 [IMP] web: add default option to DomainSelector
This option is used to set a default domain value when creating a new node
(instead of [['id', '=', 1]]).
2018-08-13 17:09:28 +02:00
Christophe Matthieu 061175e598 [IMP] web: add more filtering and sorting options on ModelFieldSelector
A new `filter` option has been added to filter fields with an optional function.
A new `order` option has been added to sort displayed fields.

The `followRelations` options have also been extended to take a function.
2018-08-13 17:09:28 +02:00
Christophe Matthieu e082ee38e8 [IMP] qweb: adding t-options-key="value"
This change greatly facilitates inheritance and xpath and avoids having
to rewrite each time the entire dictionary of t-options.

e.g.

<span t-esc="5" t-options="{'widget': 'char'}" t-options-widget="'float'" t-options-precision="4"/>

the t-options-xxx overwrite the dict. The rendering became:

<span>5.0000</span>
2018-08-13 17:09:28 +02:00
Christophe Matthieu db8ed9aa47 [IMP] report: render report without editable mode
Before this change, the reports were generated in editable mode for branding
to be applied. The branding is used to cut the report and add on each
selected record for generating the pdf.
Applied branding and editing options takes a useless time and branding
was also applied by widgets even if branding was not requested.
2018-08-13 17:09:28 +02:00
Florent de Labarre d319160d3d [IMP] models: keep a consistent order for record metadata
When reading the metadata of a record, ensure the order is consistent.
The retrieval of ir.model.data is now done using an order=id query

Use the ORM to retrieve ir.model.data instead of making an SQL to clean old
code (introduced at b3b22afc68)

Closes #25658
2018-08-13 16:44:08 +02:00
Dharmraj Jhala 5038f068c0 [IMP] event: usability improvements
This commit includes various improvements:
* 'Event' menu is moved under 'Reporting' menu and will be visible without debug
  mode
* view sequence has been changed to pivot, graph, list, form
* new filters have been added:
    - Unconfirmed
    - Confirmed
    - Attended
    - Registration Date
    - Event Start Date
    - Attended Date

Task 1854339
2018-08-13 16:32:40 +02:00
Dharmraj Jhala 03ed4470b4 [IMP] doc: document timeline attribute on cohort view
Task 1854339
Closes #25576
2018-08-13 16:32:40 +02:00
Yannick Tivisse 08b0bc2f71 [IMP] account: Increment new account code till there's no conflict
Purpose
=======

Since https://github.com/odoo/odoo/commit/db3e40396232f41d86ec0c5f90e783e77f3e9510
we try to increment the account code on account duplication.

Now with this commit with increment the code till there are no other account with
the same code in the same company.
2018-08-13 16:00:21 +02:00
Francois Volral 914bbd363c [FIX] orm: Fix a bug in _read_group_fill_temporal.
_read_group_fill_temporal was returning a None value instand of a [] when its
'data' parameter was an empty array, resulting in crash in graph_view.
2018-08-13 15:45:38 +02:00
Arnold Moyaux 2e5c97c561 [FIX] mrp: remove sequence data
Warehouse's routes, locations, picking types and
sequences are now generated on create or with a post
init hook for exisiting warehouses before module installation.

Before the init hook, warehouses created before mrp module installation
do not have a specific sequence number for manufacturing and they
shared the same sequence production created in data.
2018-08-13 15:38:34 +02:00
Arnold Moyaux 0b73f17aa2 [IMP] stock: order rule by sequence,id instead of sequence,name
The purpose is to define a better sequence order by default.
Rules's name generation is base on their location and warehouse name.
Since locations order is not always the same than the alphabetical
order, we would rather use the id.
2018-08-13 15:38:34 +02:00
Arnold Moyaux 5acb048947 [IMP] stock: decrease reception route sequence
It improves default rendering for 2d routes representation
included in commit 94a3919d09
2018-08-13 15:38:34 +02:00