Commit Graph
117098 Commits
Author SHA1 Message Date
Géry Debongnie a577ee12a0 [DOC] web: add documentation on notification system
Also, fix a few errors in the js docstring
2018-04-19 17:17:54 +02:00
Christophe Matthieu 07cd24b1ec [IMP] web: convert notification popup in service and add buttons params
this.call('web.Notification', 'notify', params)

Display a notification at the appropriate location, and returns the
reference id to the same widget. Note that this method does not wait
for the appendTo method to complete.

@param {Object} params
@param {string} params.title notification title
@param {string} params.message notification main message
@param {string} params.type 'notification' or 'warning'
@param {boolean} [params.sticky=false] if true, the notification will stay
  visible until the user clicks on it.
@param {string} [params.className] className to add on the dom
@param {function} [params.onClose] callback when the user click on the x
  or when the notification is auto close (no sticky)
@param {Array<Object>} params.buttons
@param {function} params.buttons[0].click callback on click
@param {Boolean} [params.buttons[0].primary] display the button as primary
@param {string} [params.buttons[0].text] button label
@param {string} [params.buttons[0].icon] font-awsome className or image src
@returns {Number} notification id

this.call('web.Notification', 'close', notificationId)
2018-04-19 17:17:54 +02:00
qsm-odoo 67a7d1f2b5 [FIX] web: restore searchview buttons style 2018-04-19 16:25:41 +02:00
Christophe Simonis 699f3dda1d [FIX] web: another less/scss error introduced by previous forward-port 2018-04-19 14:41:35 +02:00
Christophe Simonis 1ad82eb73f [FIX] web: first less/sass oversight of forward-port... 2018-04-19 13:56:13 +02:00
Martin Trigaux 583066f19e [FIX] doc: correct doc version
As now published at https://www.odoo.com/documentation/master/
2018-04-19 13:33:47 +02:00
Christophe Simonis e56be854ab [MERGE] forward port branch saas-11.3 up to 204935119d 2018-04-19 11:58:44 +02:00
qdp-odoo 204935119d [FIX] account: default journal on payment shouldn't be misc
This was fixed by https://github.com/odoo/odoo/commit/8327b67cf5498a1d9d133ec02f0e7619c4ce26d1 but somehow lost in the forward port I suppose
2018-04-19 10:59:24 +02:00
qdp-odoo ccd58febd4 [FIX] base, account: usability on company currency selection.
We now display all the existing currencies (even the unactivated) instead of a link to activate more of them, and upon the save we make sure to activate the selected currency if it's not yet the case. That's better from a point of view since it avoids jumping off of the screen then come back to make this setting
2018-04-19 10:59:24 +02:00
qdp-odoo b874448e79 [FIX] base_vat: import missing file
A whole XML file was missing in the initial import which had as effect to still display 'TIN' instead of 'VAT' in the res.company form view even if the module was installed
2018-04-19 10:59:24 +02:00
qdp-odoo 23bf2ba33a [FIX] base_vat_autocomplete: enable feature on res.company
Filling the VAT on the company form will now call VIES to try to fill the rest of the company address
2018-04-19 10:59:24 +02:00
qdp-odoo 4dce643126 [FIX] account: usability fix
Renamed button that opens a payment frmo the payment widget on invoices: 'Open' was more reffering to an action which was confusing
2018-04-19 10:59:24 +02:00
RomainLibert e162ff8701 [FIX] hr_holidays: make rights coherent
As we have two parallel tasks changing the rights for the approval of
leaves, we have to make sure that it stays coherent.

Basically by default an hr_holiday manager can approve anything and the
hr_holiday officer can only approve the leaves of his department and
cannot approve his own leaves.

But you can override this behaviour by setting the Validation By to
"Manager" which will force the leave to be approved by an hr_holiday
manager.
2018-04-19 10:44:53 +02:00
RomainLibert 548f92d207 [FIX] hr_holidays: change label override limit and default visibility
The label and the help message for override limit were confusing, it is
now changed for a less confusing label and help message.

Another confusing thing is that when having a leave type able to
override the limit it should not be visible in the allocations hence it
should not be possible to set the visibility option.
2018-04-19 10:44:53 +02:00
Christophe Monniez 54ae09b100 [IMP] tests: improve log when phantomjs crashes
When phantomjs crashes, an error is logged only when the crash is a segfault.
From time to time, we see on the runbot some crashes without any
informations. When digging in the log files, it appears that the exit value
of phantomjs is -6 (that could correspond to the SIGABRT signal).

With this commit, the error message will clearly show the return code
and, above all, it will show that the test failed due to a phantomjs
crash.
2018-04-19 09:16:05 +02:00
Christophe Simonis c309ccd7b3 [MERGE] forward port branch saas-11.2 up to fed775bc0c 2018-04-18 18:30:35 +02:00
Christophe Simonis fed775bc0c [MERGE] forward port branch 11.0 up to 8c64159b88 2018-04-18 18:20:40 +02:00
Josse Colpaert 8c64159b88 [FIX] stock_account: valuation report needs company_owned in context
When calculating the stock_value of a product,
the system will take into account all the locations
that have this company as company.  (that way if owner_id
is not set, the company_id on the location is the owner (virtual: not set))

The Qty on Hand field takes into account however
the quantities that are in the warehouses.

This could lead to weird situations where the Quantity On Hand is 0
and so the record is not shown, while the stock value is positive.
(e.g. stock in Transit)

In order to use the same logic for both fields, we pass company_owned=True
in the context.
2018-04-18 17:42:22 +02:00
Aaron Bohy 05589db823 [FIX] web: don't ignore required attrs on image fields
Before this rev., falsy image fields could be saved even if they
were required.
2018-04-18 17:40:09 +02:00
Martin Trigaux 55ac2f1738 [IMP] project: remove chatter on portal view
Was not present in the backend, to be consistent

Closes #24297
2018-04-18 17:37:19 +02:00
popod 839d3482e1 [FIX] account_bank_statement_import: correct typo
Closes #24294
2018-04-18 17:36:05 +02:00
jem-odoo e63e985741 [FIX] sale_timesheet: milestone SO line in plan project
In the table of the project overview, we want the
milestone Sale Line not to be included in the remaining
computation of the SO (sold - done column), because selling
milestone product may not be expressed in Hours.

This commit excludes those line from the computation, and
aoivd displaying those 2 columns for this kind of table
rows. Also, it adds italic style on milestone lines to
indicate to users that they are not included in remaining
value.

Task #1834454
2018-04-18 16:54:54 +02:00
Toufik Benjaa 0e49ccc419 [FIX] payment: Save payment token only if user is connected
- Fix an issue where the transaction were always set a 'form_save' thus always creating payment tokens.
- Fix an issue where when the customer paying while not being logged in was crashing.
  The issue is due to the fact that we are creating payment transactions linked to no partners, doing so it crashing the code when creating the payment token with no partner set.
2018-04-18 16:49:53 +02:00
Martin Trigaux 8550cf28e8 [IMP] doc: add link to qweb variable syntax
To mention you can use the {{ var }} syntax too

Closes #12035
2018-04-18 16:25:42 +02:00
qsm-odoo e41bcb0e31 [MERGE] *: use SCSS as language for design (instead of LESS)
The main reason this is done is to prepare the migration to bootstrap 4.
It has other advantages though, like speed to compute the css and more
convenient language features (if/else/maps/...).

Detailed information about this merge can be found in the merge's
sub-commits.
2018-04-18 16:14:28 +02:00
qsm-odoo 16ddf4ae54 [REF] doc: adapt to mention scss instead of less 2018-04-18 15:59:26 +02:00
qsm-odoo e5b268827f [REF] web, web_editor, website: convert LESS editor to SCSS editor 2018-04-18 15:59:25 +02:00
qsm-odoo 6713d03ac8 [REF] theme_bootswatch: update themes to scss and review support
Remove support of:
- Theme Amelia: removed with bootstrap 3.3.0, but released in odoo at
  bootstrap version 3.2.0 (should have been removed since Odoo 9.0
  (boostrap version 3.3.5))
- Theme Readable: removed with bootstrap 4.0.0 so it is best to remove
  it now so as we are gonna migrate to bootstrap 4.0.0.

We may want to add new bootswatch theme with bootstrap 4.0.0 migration.

This commit also adds the missing LICENSE file.
2018-04-18 15:59:23 +02:00
qsm-odoo 67cace90a9 [REF] theme_default: adapt the scss convertion for everything to work 2018-04-18 15:59:22 +02:00
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
Martin Trigaux c74f975994 [FIX] base: correct Arabic iso_code
The Arabic we use on Transifex is "simple" Arabic, not the one from Syria.
The .po files we synchronise are named 'ar.po', not 'ar_SY.po'

Change the iso_code to match the one we actually use.
transifex module relies on the iso_code to make its URL
2018-04-18 15:51:30 +02:00
len-odoo 7671e0c30d [FIX] calendar: fix event sorting function with relational fields
When working with relational fields, the sorting function would
compare empty recordsets with Strings (the field value),
crashing in the process.

This is essentially an addendum to previous commit
b6c962e62a
which fixed the sorting for non-relational fields.

opw 1831457
2018-04-18 15:15:47 +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