Commit Graph
117027 Commits
Author SHA1 Message Date
qsm-odoo cd2504c75f [FIX] *: wrap negated variables with parenthesis
* mail, web, web_editor, website_sale

Tricky difference between LESS and SCSS:
`0 -$var` will be one value in SCSS (the result of 0 - $var) but
two space-separated values in LESS.
2018-04-18 15:59:21 +02:00
qsm-odoo 6e4db7d13a [REF] *: review scss variables handling
Unlike LESS, SCSS variables are not lazy loaded. Our system has thus
to be updated. This commit creates new templates which are t-called
in assets bundles (to replace the old less_helpers template):

- web._assets_utils: regroups the mixins and functions which *can*
  (and so should) be available in every asset bundle

- web._assets_primary_variables: regroups the variables (or mixins
  used as variables) which *can* (and so should) be available in
  every asset bundle

- web._assets_secondary_variables: same as above but provides an
  environnement where all the 'primary' ones are accessible. This is
  for example useful to handle the community/enterprise split:

  // Community primary variables
  $o-pink-color: pink; // enterprise color
  $o-brand-primary: blue;

  // Enterprise primary variables
  $o-brand-primary: $o-pink-color;

  // Community secondary variables
  $o-my-darker-primary: darken($o-brand-primary, 5%);

  => If there was only one variable template, enterprise edition would
     have been able to define its primary color at the end but the
     darker primary would not have been updated. Using the "!default"
     system and putting enterprise definition above would not have
     solved the problem as the $o-pink-color would not have been
     accessible.

- web._assets_backend_helpers: regroups the variables, mixins and
  functions which *can* (and so should) be available in the backend
  asset bundle only. This is especially (only?) useful for bootstrap
  variables overriddes.

- web._assets_frontend_helpers: regroups the variables, mixins and
  functions which *can* (and so should) be available in the frontend
  asset bundle only. This is especially (only?) useful for bootstrap
  variables overriddes.

Note: bootstrap variables are not accessible in any of those anymore.
If you have variables that should depend on bootstrap, you have 3
solutions:

- Find another way: your variable is probably useless, use bootstrap
  variables directly or create a variable that will influence the
  value of bootstrap variables. E.g. instead of declaring:
  `$myvar: $bootstrapvar * 3`
  and using $myvar alone, declare:
  `$myvar: 3` and use `$myvar * $bootstrapvar` where needed.

- Declare a copy of the bootstrap variable and use that one. In that
  case, you should also force-set the real bootstrap one to be sure
  they match (this should be done in appropriate templates mentioned
  above). E.g.
  ```
  $o-boostrapvar: 5;
  ...
  $boostrapvar: $o-bootstrapvar;
  ```

- Set your variable to null and set it to your bootstrap expression
  in the file you will need it (where bootstrap variables are accessible)
  without forgetting to add the !default flag to allow overriddes.
  ```
  $myvar: null;
  ...
  $myvar: $bootstrapvar * 5 !default;
  ```

This commit also partly changes the variable names to follow the
convention:
$o-<app_id>-<name> where 'app_id' is the current's app name or a
meaningful unique identifier ("theme" for all themes for example, as
no multiple themes can be installed).
2018-04-18 15:59:19 +02:00
qsm-odoo fbfd011904 [REF] *: get rid of introduced @​extend
During first scss convertion, classes called as mixins were changed to
an @​extend instruction which was the best approximation given the fact
there is no equivalent in sass to do that. The problem is that the
instruction is slowing the scss computation a lot and might also break
the style in unexpected ways because of the complex unwanted selectors
the instruction induces.

This commit removes the need of extends. This is done case per case.
Sometimes this involves adding classes in xml, sometimes to change the
style a little, ... The button rendering refactoring which was made
at the start of the LESS to SASS merge was also done in prevision of
this.

After this commit, sass computation is like 5-6 times faster than less
computation while it was like 10 times *slower* before this commit.
2018-04-18 15:59:18 +02:00
qsm-odoo 97aa0a8dec [REF] *: convert less content to scss content
Convert content so that the assets compile on app installation. The
style is still broken after this as the variables/mixins/... are not
defined in the right order (as it did not matter in LESS but does in
SCSS).

This commit basically changes:
- Variables: @​var_hello -> $var-hello
- Mixins: .mixin_world() {} -> @​mixin mixin-world {}
- Classes used as mixin: .my_class() -> @​extend .my_class
    - Here there were no other solution than to convert the use of
      a mixin call by the use of an extend as a first approximation
- LESS functions -> SCSS functions (e.g. fade -> rgba)
- Move first variable definition before the variable is used
    - Still need to make sure last variable definition is at the
      right place
2018-04-18 15:59:16 +02:00
qsm-odoo b04dec4025 [REF] *: rename all LESS files to SCSS
This is a simple renaming without adaptation.
2018-04-18 15:59:15 +02:00
qsm-odoo a6393130e6 [REF] theme_bootswatch: reorganize folder
Reorganize the theme folder to follow standard hierarchy. In particular,
the libs are now placed in a dedicated folder in the /static/lib folder
instead of the /static/src folder.
2018-04-18 15:59:13 +02:00
qsm-odoo 9435fe110c [REF] web_editor: convert summernote less to css
Summernote is using LESS and no SCSS version exists (at least
officially). As summernote is meant to be replaced in the future and
that the LESS file was already overridden directly by Odoo, this
commit converts the LESS file to CSS once and for all.
2018-04-18 15:59:12 +02:00
qsm-odoo a13ba24b3a [REF] web: change bootstrap datetimepicker source from less to scss
Note: the scss version of the lib file was not up to date, I manually
updated it to our current version (very small changes). The lib will
probably have to be changed with bootstrap 4 anyway.

Note 2: the file is left included in the common assets but it would
probably make more sense to put it both in backend and frontend instead.
2018-04-18 15:59:10 +02:00
qsm-odoo 6096f24501 [REF] web: change bootstrap source from less to scss
Note: bootstrap 3.3.7 in SCSS produces slightly different CSS
of bootstrap 3.3.7 in LESS... the DOM result should be the same
though.
2018-04-18 15:59:09 +02:00
qsm-odoo 1a007c1a96 [REF] *: stop mentioning "LESS" where this is not required
* web, web_editor, website, im_livechat
2018-04-18 15:59:07 +02:00
qsm-odoo 3f6ddd4a66 [REF] odoo: adapt scaffolding templates 2018-04-18 15:59:06 +02:00
qsm-odoo 587d7a50d0 [REF] update manifest and makefile 2018-04-18 15:59:05 +02:00
qsm-odoo a75e3980ce [IMP] website: define default template for scss files creation 2018-04-18 15:59:04 +02:00
qsm-odoo 434d5de9c8 [REF] http_routing: guess scss mimetype 2018-04-18 15:59:03 +02:00
qsm-odoo 2d63d2d75a [REF] test_assetsbundle: adapt bundle tests 2018-04-18 15:59:02 +02:00
Romain Derie c71be32c89 [IMP] base: add new sass engine
Adapt the assets bundle computation to work with SASS (scss). LESS is
still supported though the dependencies are not installed automatically
and the LESS variables are not available anymore (obviously).

SASS is computed thanks to the libsass program, wrapped by the
python-libsass package (no need to start a nodejs process anymore).
2018-04-18 15:59:01 +02:00
qsm-odoo bf3193ac5e [REF] setup: review dependencies
Include libsass instead of node-less

Thank you to @d-fence for testing this.
2018-04-18 15:58:34 +02:00
qsm-odoo 549f60b3c2 [REF] *: <a/> elements do not need the oe_link class
The 'oe_link' class is not linked to any style. The class is
automatically converted to 'btn-link' for <button/> elements but this
will not be done on <a/> elements as they are (nearly) unprocessed
node during views rendering.

Also there is minor difference between a '.btn-link' element and a
<a/> element anyway (and maybe there should not be at all).
2018-04-18 14:47:42 +02:00
qsm-odoo e88913bd28 [IMP] web, *: do not use 'oe_highlight' and 'oe_link' class in the DOM
* test_main_flows

The style of a primary/link button is given by the
'btn-primary'/'btn-link' class. The old 'oe_highlight'/'oe_link'
class should still be supported in views but not rendered in the DOM.
2018-04-18 14:47:42 +02:00
qsm-odoo 374af562e8 [REF] web: review button rendering
Button rendering was most of the time wrong, incomplete or performed
with duplicated code. This led to:
- Both primary and default classes were put on some statusbar buttons
- Icons were not able to be put for statusbar buttons
- Stat buttons and list buttons code were duplicated
- Classes and style were added twice
- ...
2018-04-18 14:47:42 +02:00
Jaykishan Solanki 5ea27d471e [IMP] account: Accounting Date on bank statement
This commits adds a field on bank statement that will be used to force the creation of the accounting entries at this date instead of the bank statement date (in the same way than on invoices). This is useful if the accounting period in which the entries should normally be booked is already closed.
This field is only visible in debug mode.

Was PR #22441
Was task 46892
2018-04-18 13:32:59 +02:00
Hetashree Chauhan e095733a3a [IMP] account: Correct term/amount information in aged receivable/payable.
Was PR #14820
Was task: 28716
2018-04-18 12:28:28 +02:00
Christophe Matthieu 1f5d65e74a [IMP] bus: properly restart longpoll when necessary
Whenever we add or delete a channel in the bus/longpolling system, we
want the long poll to restart immediately, to be able to receive the
correct messages.

Before this commit, we had to wait for the longpoll timeout to finish
before receiving the correct messages.
2018-04-18 11:43:07 +02:00
Christophe Matthieu 77e5b82b7d [IMP] web: allow js code to abort xhr
We have a need to be able to abort a pending xmlhttprequest.  This is
necessary for the longpoll system so it can restart properly.

With this commit, we simply propagate the abort method from the jquery
deferred to the deferred returned by the session rpc method.

Note that this is not documented on purpose. The reason is that we do
not want to commit on maintaining this feature.

It is kind of awkward to have a deferred which can be aborted, but once
it is chained, the abort feature is lost. So, for now, this will stay a
lower level feature used exclusively for our needs.
2018-04-18 11:43:05 +02:00
dbh c58db31732 [IMP] account: support of filtering on partner (category) in reports
This commit allow to filter easily on partners or partner categories in financial reports

Was PR #23364
Was task: 36626
2018-04-18 09:55:33 +02:00
Christophe Simonis 0cd2cff259 [MERGE] forward port branch saas-11.3 up to fdef30fc29 2018-04-17 16:24:27 +02:00
Christophe Simonis fdef30fc29 [FIX] purchase: ignore quantity sign when computing move amount_currency
Since 348c371ee8, the quantity is negative
for out moves. Ignore the sign when computing the amount_currency value.
2018-04-17 15:30:02 +02:00
Romain Derie ab6c3f66a3 [FIX] website_sale_wishlist: correct tour for new checkout
The website sale wishlist tour checks if you are correctly redirected to the
cart.
To do so, it checks if the cart title 'Shopping Cart' appears on the screen.

But since there is a new checkout in saas-11.3 with 006ce9c88 that removed this
title, we need to trigger on something else.
2018-04-17 15:17:29 +02:00
Luis González 1328c0960d [IMP] tools: avoid concurrent creation of the session_dir
Instead of:
1. testing the existance
2. creating the directory if not exists

(which would not work if a concurrent creation is done between step 1 and 2)

do:
1. try to create the directory
2. skip if it fails

Ask forgiveness, not permission

Closes #24210
2018-04-17 14:09:34 +02:00
Yannick Tivisse 7a24df4889 [FIX] sale_margin: Fall back on the user company if not set on the SO line
As the company is not required on a sales order, this could lead to
errors when trying to compute the margin as _convert is expecting
a valid company.
2018-04-17 13:56:39 +02:00
Yannick Tivisse ceb5c2be57 [FIX] account: Pass correct company and date to _convert on dashboard rendering 2018-04-17 13:56:38 +02:00
qsm-odoo c35e24aa8e [REF] web: remove useless oe_number rule
This was introduced as a fix for grouped list views' headers while we
should have added the 'o_list_number' class instead... which is the
case now. So the oe_number rule became useless.

See https://github.com/odoo/enterprise/commit/a2ce226a2a085b26174cdfd32922517dff39658c
See https://github.com/odoo/odoo/commit/5d13a2f431e1c96e075b04d0eb07d98b912a6547
See https://github.com/odoo/odoo/pull/23966
2018-04-17 13:38:16 +02:00
Christophe Simonis f02cafa014 [FIX] stock_account: define variable in right function 2018-04-17 10:01:31 +02:00
Géry Debongnie 6d04faf6c2 [FIX] board: adapt test broken after forward port
Forward ports sucks...
2018-04-17 09:33:22 +02:00
Géry Debongnie 03d74531a3 [FIX] web: fix issue with initial action in web client
Here is a scenario that could happen before this commit:
1. web client is started
2. it binds a callback on hashchange
3. it performs some async work (read initial action for user)
4. the user (or more likely, a tour) changes the url
5. the hashchange handler is called, and it starts a new action
6. the async work for the web client is over, it then executes the
default action and/or clicks on the first menu
7. we are now in the default action state, instead of the desired action
state (the one from the new url)

With this fix, we simply do nothing when there was an hashchange before
the initial action was done.
2018-04-17 09:21:18 +02:00
Christophe Simonis 5dca782100 Revert "[FIX] web: remove &shy; when saving phone number"
This reverts commit b8b0f947bf.
2018-04-16 20:26:21 +02:00
Christophe Simonis 74033eb007 [MERGE] forward port branch saas-11.2 up to 90f8f17fb4 2018-04-16 19:50:50 +02:00
Christophe Simonis 90f8f17fb4 [FIX] google_calendar: correct xml declaration
Oversight of previous forward-port
2018-04-16 19:06:11 +02:00
Christophe Simonis 5f2d080cf8 [MERGE] forward port branch 11.0 up to ad825b673b 2018-04-16 18:34:56 +02:00
Christophe Simonis ad825b673b [MERGE] forward port branch saas-15 up to bfa5af45df 2018-04-16 17:10:23 +02:00
Florent de Labarre b7e47be012 [FIX] stock: remove wrong decorator
Was probably introduced during a forward-port as was correctly changed at 8df0a2a98e

Closes #24238
2018-04-16 16:59:36 +02:00
Kinjal Mehta 026be48ccb [FIX] purchase: "product_type" related field on po line
Issue:
Currently, since "product_type" is not set readonly, it is triggering write() of product.product
model when saving a PO having PO line with product_id. And it is failing by throwing access error
for users belonging to purchase "User" group users due to the fact that write() is permissible to
purchase "Manager" group users only.

Solution:
Made the "product_type" related field readonly since it is used in purchase order views domain
with lone purpose to set "received_qty" field non-editable when order line product is of type
stockable/consumable.

task id 1818787
2018-04-16 16:00:46 +02:00
Toufik Benjaa 904c2e5112 [FIX] payment: Portal payment were not saving tokens
- Portal payement is not respecting the option to save tokens after payments.
2018-04-16 15:20:15 +02:00
jem-odoo 71cdefd9f4 [FIX] sale_timesheet: UoM conversion failing when mixed category
When converting UoM, source and destiantion should be in the
same category. For timesheet, the product can be expressed in
Units if uoM is not activated. We don't want crash, but
interprete the timesheet duration in hours (which is has a different
uoM category). To avoid the error, we used the 'raise_if_failure'
parameter.
2018-04-16 14:32:45 +02:00
jem-odoo fb323d0068 [FIX] uom: avoid context key, and rather use parameter
When converting UoM, the conversion can fail if the source and destination
uoM are not in the same category. By default, and error is raised, but using
a context key, we can receive the initial quantity.
To avoid the context key (which is not used anymore), we prefer use a dedicated
parameter to be more explicit.
2018-04-16 14:32:25 +02:00
Swapnesh Shah d1c873e754 [IMP] mass_mailing: Use odoo instead of openerp
Closes #24237
2018-04-16 14:24:29 +02:00
Nicolas Lempereur 7680635c54 [FIX] web: setDate mixing utc+tz and local date
In the calendar view there is some mixing of moment with:

- a local date with given timezone
- a UTC date with added timezone manually applied

The setDate function of calendar model sometimes received either of the
two types, and always transforms them to UTC date with added timezone.

This cause eg. the following issues:

- in the minicalendar, if we click on a day (eg. 12) the day highlighed
  will be the one of 12th at midnight with timezone applied. So with a
  negative timezone the 11th would be highlighted in the mini calendar
  (but the 12th would still be the day shown).

- if we change scale (week/day/month) or open calendar or use next or
  previous button: we call `setDate` with a UTC+timezone moment. So each
  time this is done, we get an additional timezone

  eg. when opening the calendar view on the 12th at 5:00 with GMT-0200:
      -> the target date is 12th at 1:00
      -> if we set the day mode: target date is 11th at 23:00
      -> if we set the week mode: target date is 11th at 21:00

With this change we keep target_date and highlight_date as local date so
setDate always receives a local date and jquery-ui DatePicker gets the
date in the expected format.

opw-1831368
closes #24188
2018-04-16 00:22:18 -12:00
Christophe Simonis bfa5af45df [MERGE] forward port branch saas-14 up to aab0908818 2018-04-16 14:21:00 +02:00
Nicolas Martinelli 620a6f4557 [FIX] stock: change product on S/N
Do not allow to change the product on a serial/lot number for a product
which has existing stock moves. Doing so would screw up the traceability
report.

opw-1832452
2018-04-16 14:20:44 +02:00
Martin Trigaux a87dc3111c [IMP] doc: specify the API examples are in python2
Odoo 11 is python 3 but the xmlrpc interface works with python 2 too.
The example should probably be migrated to use python 3.
In the meantime specify exactly these examples are python 2 to avoid the
confusion.

Fixes #24232
2018-04-17 13:59:50 +02:00