Commit Graph
2217 Commits
Author SHA1 Message Date
Raphael Collet 2a2ff6eb5c [FIX] tools: serialize lazy to json 2018-08-16 16:39:20 +02:00
Christophe Monniez 49fb7a4682 [FIX] tests: avoid traceback when websocket-client is not installed
The account module needs to import Form from "tests.common" causing a
traceback when websocket-client module is not installed.

As this module is only required for the tests, there is no reason to add
it to the "requirements.txt" file.

With this commit, Odoo account can be installed even when
websocket-client is not installed, in that case, the HttpCase tests that
needs to run Chrome headless will be skipped with a warning.

Closes: #26404
2018-08-16 15:07:43 +02:00
Yannick Tivisse 9aaa32b6f6 [IMP] base: Better implementation of 8166eae 2018-08-16 14:40:46 +02:00
Yannick Tivisse 8166eae0bf [IMP] base: Don't set customer=True on new users
Purpose
=======

Create a user, then the partner is shown in Customers.

Most of the time, user is not a customer.
2018-08-16 14:19:37 +02:00
antonylesuisse de84ad9c1f [REF] tests: replace phantomjs by Chrome headless
As the phantomjs project was suspended[1], there was a need to change the js test
engine. Moreover, the engine was rather old and leading to non
deterministic crashes.

Chrome headless was choosen for simplicity and the long term vision of
the devtools protocol [2].

The 'phantom_js' method still exists but will be deprecated in
favor of 'browser_js' with the same parameters.

In order to communicate with the browser, the python websocket-client package
is needed.

[1] https://github.com/ariya/phantomjs/issues/15344
[2] https://chromedevtools.github.io/devtools-protocol/

#closes 25991
2018-08-16 11:45:43 +02:00
Mohammed Shekha 8fbadb9575 [ADD] base_import: debug option to create M2O/M2M records
Adds a checkbox to import columns (in debug mode) allowing a user to
create records M2O and M2M records not found (via name_search).

Task ID: 1850633

* uses a context key to avoid altering basically all the import callstack
* attempted to lift the creation in the `_str_to_*` functions and create
  m2m via commands, but that doesn't really work out
2018-08-16 11:10:35 +02:00
Stefan Rijnhart b3824aa6cb [RFR] Hide implementation of constraint definition storage, courtesy of Raphael Collet 2018-08-16 10:33:06 +02:00
Stefan Rijnhart 6327b8f97f [IMP] Store the original constraint definition as a comment on the constraint
and use it to determine if the constraint definition was changed. This prevents
endless readding of constraints that are reformatted by postgresql in an
unrecognizable way (in which e.g. "CHECK (credit*debit=0)" becomes
"CHECK ((credit * debit) = 0::numeric)")
2018-08-16 10:33:06 +02:00
Moises Lopez ef110440dd [IMP] base: no private filters by default
The custom filters created through the search view are still private by default
but the ir.filters created manually (e.g. through xml files) are most of the
time global.
In odoo core addons, all ir.filters defined add the line

   <field name="user_id" eval="False"/>

This should simplify the development while not changing the behaviour for
actual users.

Closes #8218
2018-08-16 09:07:55 +02:00
Fabien Pinckaers 7aff231690 [IMP] web: improve mobile view switcher 2018-08-14 22:43:10 +02:00
Christophe Simonis 0ac7f8fbe6 [MERGE] forward port branch saas-11.4 up to dabe59df9c 2018-08-14 20:16:03 +02:00
Christophe Simonis dabe59df9c [MERGE] forward port branch saas-11.3 up to 27d8daf8a7 2018-08-14 19:43:32 +02:00
Christophe Simonis 27d8daf8a7 [MERGE] forward port branch 11.0 up to 51225c9b9f 2018-08-14 18:59:57 +02:00
Christophe Simonis 51225c9b9f [MERGE] forward port branch saas-15 up to 52e88036f2 2018-08-14 18:24:40 +02:00
Christophe Simonis 52e88036f2 [MERGE] forward port branch saas-14 up to d4ee30b4fa 2018-08-14 17:45:46 +02:00
Christophe Simonis d4ee30b4fa [MERGE] forward port branch 10.0 up to a487d7d397 2018-08-14 17:09:32 +02:00
Fabien Pinckaers 1ab2a4d47d [IMP] base: config panel close dialog: correct buttons 2018-08-14 16:18:05 +02:00
Xavier Morel 61a6347c54 [IMP] tests logging
* Make phantomjs logging clearer by logging within the test case's
  module, not odoo.tests.common.

  This way, a tour in e.g. point of sale is clearly logged as that,
  rather than be logged as odoo.tests.common.phantomjs and require
  hunting which module/test we happen to be in.

* Clarify tagging causes for exclusion of selection of tests.
2018-08-14 15:37:26 +02:00
Nhomar Hernández c77d4effc4 [IMP] web: Better view fields for debug mode.
When you need to fast review all properties of a model, mostly the
fields it is really anoying go to all the technical path which has all
the information already.

The previous "View Fields" action was very messy.

My proposal is simply instead use a dialog which is almost useless open
a normal vie (a little improved) which allow us audit completely
everything.

Remove the previous dialog, this will not be used anymore.

Closes #26364
2018-08-14 13:59:59 +02:00
Sébastien Theys 9b7635dd67 [FIX] test_main_flows: fix issue with button name
Commit 4c31a758cf changed the name of a button, but the test wasn't updated correctly.

PR: none
Task: none
2018-08-13 23:09:30 +02:00
Jeremy Kersten 0b608109ee [FIX] website_version: unpromote this module
It doesn't exists anymore in enterprise version.

Combinaison of website_publish , website_page, and multi website allow to
partially replace it.

AB testing will be back in a later version after a big refactoring.
2018-08-13 20:38:38 +02:00
Jeremy KerstenandDerie Romain 853e13800f [IMP] base,web,website: asset bundle make url overridable
Allow to override the asset url generation to add in the path the website ID
and avoid continue invalidation cache and bad cache by browser.

Asset url is:
    "/web/content/{id}-{unique}/{extra}{name}{page}{type}"
with:
    id = attachment id
    unique = hash
    extra = allow to add custom params eg: website_id/ or rtl/
    name = filename
    page = used in css to split rules 4095 / file
    type = css|js

Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>
2018-08-13 20:16:34 +02:00
Jeremy KerstenandDerie Romain c0968e68ed [ADD] website_theme_install: try to make theme multi website compliant
From now, when you install a theme, it load the data from xml to template
table theme [ir.ui.view|ir.attachment|website.page|website.menu].

Data are only copied from this template table into the real table when you
choose a theme on a website; Making them website_specific and with a link
to the original to allow futur update.

A special case is done to create theme.ir.ui.view when you are installing
a theme, even if you continue to use template tag to create quick view.

Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>
2018-08-13 20:16:34 +02:00
Jeremy KerstenandDerie Romain 066cfc9598 [IMP] website_[blog|event|forum|sale|slide]: make website specific
Set up env & tools for module website multiwebsite (blog, event, sale..)
website_id in modelConverter and ir_rule

add _compute_domain_keys to have a different cache per website
  or rules would not be correctly website_dependant
  eg: blog 1 on website 1, blog 2 on website 2
      access blog 1 from website 1 => can access -> normal
      access blog 1 from website 2 => can access -> should crash because (ir rule)

split mixing website.published.mixin and website.published.multi.mixin to have
website_id only on last one.
 multi mixing will:
     - override website_published compute to take current_website into account (not in backend)
     - force website when clicking on published in backend

- website blog, website_sale, website_event, website_forum, website_slides are now multi website

Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>
2018-08-13 20:16:34 +02:00
Jeremy KerstenandDerie Romain 62d73253f3 [ADD] website, base: improve name_get in case of multi_Website mode
In some case like for website_menu or res.partner from the sale_order form view
it is nice to know easily on which website this record is depending.

Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>
2018-08-13 20:16:34 +02:00
Jeremy KerstenandDerie Romain 602807acdf [FIX] website: improve/fix menu, copy on unlink, clone page, unique_path, sale_report, ...
Fix bug from the initial poc of JOV

Fix menu creation
   - creating a menu would create a 'container' menu in the DB (.create is call without website_id)
   then writing on it would copy (if condition to cow) the menu with a website_id leaving the first
   one as a menu container unused.
   - website_menu should always have a website_id
     we dont want to support the multiwebsite system that allow to have generic/specific menu
     unlink/write is useless now since we always have a website_id

Make unique_path website dependent, 2 distinct website can have a page with same name

Make Sale report multiwebsite compliant

Make website_id on sale_order / account.invoice as a related stored from partner_id.

Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>
2018-08-13 20:16:34 +02:00
Joren Van Onder 4f6ec1cd2a [IMP] website,*: support multiple websites
This implements support to administer multiple websites. Although the
core functionality already existed, managing multiple websites was
fairly technical.

In the interest of database updates and migration this attempts to
keep duplicated data to a minimum. To do this the usual generic
records are rendered unless some website-specific record exists that
replaces it. Copy-on-write (COW) is used to create these
website-specific records. Through this mechanism creating a
website-specific record is delayed until necessary. A COW mechanism
has been implemented on 4 models: ir.ui.view, website.page,
website.menu and ir.attachment. These COW mechanisms are activated
when editing data through the website (aka frontend). These frontend
edits (e.g. with web_editor) will be website-specific, possibly
creating a website-specific record when necessary. When editing data
in the backend nothing special will happen, even when editing a
generic record. Note that because of this mechanism also facilitates
the ability to create new, uncustomized websites because the generic
data is kept.

Support is provided for a website to have any theme. Themes are fairly
complex to handle. Standalone themes can depend on other standalone
themes (e.g. theme_beauty depends on theme_loftspace) and themes
usually modify some data of the themes they depend on. Because a theme
can be installed on multiple websites, using website_id m2o fields
does not work well. It would require duplicate data, making updates
and migration harder. Because of this, data for themes (ir.ui.view and
ir.attachment specifically) have a theme_id m2o. website has a
theme_ids m2m that identifies all theme modules currently installed on
it. Through these fields we figure out what to render. A theme is only
fully uninstalled when it's no longer active on any website. The
advantage of this approach is that upgrading or migrating theme data
is no different from the single-website case.

The website.published.mixin class was modified to handle multiple
websites. A wizard was added in the backend to easily manage this for
multiple website.

Although not used anywhere in this commit, a 'website_id' variable has
been added in the evaluation context of ir.rule. It allows to easily
make any model multi-website aware, all that's needed is a custom
website_id m2o field on a model and a custom record rule.
2018-08-13 19:51:10 +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 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 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 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 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 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 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 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
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
sri-odoo 6153d65664 [REF] base: partners, use new record design 2018-08-13 14:46:47 +02:00
sri-odoo 1de38243a9 [FIX] base: apps list alignment 2018-08-13 14:46:47 +02:00
len-odoo b41baa3c92 [FIX] base: handle RedirectWarning exceptions during import
During an import, account_invoice.py's _onchange_partner_id can return a
RedirectWarning exception, which wasn't properly handled by the load method.
Since it is an Exception, it was expected to have a name field.
We add it as a property so that they can be treated uniformly.

opw 1866965
2018-08-13 13:53:12 +02:00
Xavier ALT c5e1bffa3d [FIX] tools: formatLang should use cached lang 2018-08-13 11:18:00 +02:00
60aa9ffd01 [IMP] base,mail,web: attachments adaptation for documents
This commit is the counter-part of an enteprise commit introducing
the Documents app.

Here is a summary of what has been done:
  - tweak unlink of ir_attachment to prevent unlink recursivity
    (when attachments are attached to ir_attachments)
  - improve ir_attachment kanban view
  - add several arguments to binary_content controller:
    - 'force_ext': to force the extension in the filename, base on
      mimetype
    - 'share_token' and 'share_id': to autorize download from a
      share link
  - add 'thumbnail' field on ir_attachment to optimize Kanban view
  - add 'upper_limit' argument to image to allow to bypass the
    500*500 size limit
  - DocumentViewer now handles text files

More information available on task 1853490

Co-authored-by: Pierre Paridans <app@odoo.com>
Co-authored-by: sri-odoo <sri@odoo.com>
Co-authored-by: ThanhDodeurOdoo <tso@odoo.com>
2018-08-13 09:11:53 +02:00
Odoo Translation Bot 566d1586bc [I18N] Update translation terms from Transifex 2018-08-12 07:14:34 +02:00