Commit Graph
27 Commits
Author SHA1 Message Date
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 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
Martin Geubelle 90d6573579 [FIX] lunch: adapt the code to new views
We also adapt the code to comply to the new guidelines and we have
added some tests.
2017-04-19 17:49:34 +02:00
Aaron Bohy 2e540eb3c1 [FIX] *: apply changes from web_studio
The new views and widgets (at least some of them) first landed
in web_studio (v10), and they we moved later to web, so changes
in web_studio need to be applied in web.
2017-04-11 19:44:38 +02:00
Géry Debongnie b717c67864 [REF] web,*: improve the way field_utils are done
We replace a bunch of formatting and parsing functions by an object
(parse or format) which can be used to dispatch on the correct type.  It
allows us to remove the format_field and parse_field functions.

Also, we camelcase our new code and add some comments.
2017-04-11 19:44:38 +02:00
Géry Debongnie 905e01921f [REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
2017-04-11 19:44:38 +02:00
Fabien Pinckaers 16b93b6dcc [IMP] lunch: better layout for recommendations 2017-02-27 11:48:01 +01:00
Nicolas Martinelli 018144b8ac [IMP] lunch: new lunch widget
The JS widget is simplified, which a cleaner approach.
For the rendering part:
  - the server reads the data
  - the JS widget formats/organizes the data
  - the template renders the data prepared by the widget

Quick summary of the modifications:
1. The associated field is a text field which contains JSON-encoded
data. The data are read server-side, and not client-side anymore.

2. The widget is an AbstractField, no need of ReinitializeWidgetMixin
anymore. No use of the FieldMonetary widget directly, but use a similar
format_value instead (inspired by ShowPaymentLineWidget).

3. Data formatting (call to format_value) is done in the widget, not in
the template anymore. This seems to be the standard way of doing, since
lunch was the only module where format_value was in the template and not
in the widget.

4. The addition of an order line is cleaner since all necessary data
are prepared server-side.
2016-11-03 11:41:39 +01:00
qsm-odoo 047dab7029 [REF] lunch: XML/LESS/JS
CSS to LESS
Adaptation to new webclient
2015-09-11 16:22:19 +02:00
qsm-odoo 2a40c195a5 [FIX] Many2ManyTags and web_tests
Adapt web_tests to the new many2manytag included in the tour widget_x2many
2015-06-19 13:42:15 +02:00
Nicolas Martinelli 3d63c15a56 [MIGR] lunch: migration to the new API, cleaning and new
widget for displaying previous orders.

Detailed changes :
- previous order is not a computed field, with its own custom widget that has been designed
according the new spec for widgets;
- useless wizards have been removed, and replaced by some server actions that perform the
same action with less code and views;
- removed deprecated or incomplete reporting;
- some renaming to follow the new specifications of module coding
2015-04-23 10:27:08 +02:00
Christophe Simonis ec277732fe [MERGE] forward port of branch 7.0 up to 3e3e35e 2014-11-05 21:10:15 +01:00
Christophe Simonis 388732dfa6 [IMP] *: one Makefile to rules them all.
Create one unique generic Makefile to compile sass files.
2014-11-05 19:30:28 +01:00
Antony Lesuisse fc70550ca2 [IMP] move html module description and icon
bzr revid: al@openerp.com-20130628100441-swpanf2jwcojygh4
2013-06-28 12:04:41 +02:00
Arnaud Pineux 3d3873339e [Lunch]
bzr revid: api@openerp.com-20121105160541-t8x8t7de2fjt0sq3
2012-11-05 17:05:41 +01:00
Arnaud Pineux 968868d481 Lunch
bzr revid: api@openerp.com-20121102130002-d33xd81hvgy4bblk
2012-11-02 14:00:02 +01:00
Arnaud Pineux 5212e76c47 Lunch
bzr revid: api@openerp.com-20121102101629-g5iktkcf8pbu1kyk
2012-11-02 11:16:29 +01:00
Arnaud Pineux ed791d908c Lunch
bzr revid: api@openerp.com-20121102081548-1ujcb6v6ivsx9dr5
2012-11-02 09:15:48 +01:00
Arnaud Pineux 4c73fdc993 Lunch
bzr revid: api@openerp.com-20121031142448-4te52l1vfjtp5pqb
2012-10-31 15:24:48 +01:00
Fabien Pinckaers a692a21546 [IMP] CSS lunch
bzr revid: fp@tinyerp.com-20121031102307-d4s8sq9v32poebzj
2012-10-31 11:23:07 +01:00
Arnaud Pineux bffa00134f [MERGE]lunch
bzr revid: api@openerp.com-20121030084701-lgiss30ih4elg4hh
2012-10-30 09:47:01 +01:00
Arnaud Pineux e3bcd71d1b [CORRECT]Lunch
bzr revid: api@openerp.com-20121026113901-9o8wi1v1k0j8coj4
2012-10-26 13:39:01 +02:00
Arnaud Pineux ccdec6f158 [MERGE]Lunch_new application
bzr revid: api@openerp.com-20121024133918-qu0xha3fuaisc0va
2012-10-24 15:39:18 +02:00
Arnaud Pineux 5ac75e44aa [MERGE]Lunch_new application
bzr revid: api@openerp.com-20121004073156-asqlj77f8v3q9m58
2012-10-04 09:31:56 +02:00
Arnaud Pineux eeb08e163e [ADD] Lunch module
bzr revid: api@openerp.com-20121002072149-9gcyy64wap5z7b2h
2012-10-02 09:21:49 +02:00
Minh Tran a64d3dbcbc Added modules icons for main apps
bzr revid: mit@openerp.com-20111214144815-itsfpfo68l2m0jnx
2011-12-14 15:48:15 +01:00