Commit Graph
59 Commits
Author SHA1 Message Date
Alexandre Kühn 187ad14840 [REF] bus: prettify bus files
closes odoo/odoo#119530

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-27 02:44:42 +02:00
Mathieu Duckerts-Antoine d0b9c092bd [IMP] web: new field service
We move the function loadFields from the view service to a newly created
field service. That service can also be used to load model fields for a
given path (loadPath), i.e. load all model fields for the models
traversed by the given path.
We use loadPath in useModelField and DomainSelector.

closes odoo/odoo#117882

Related: odoo/enterprise#39418
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-07 19:43:20 +02:00
Lucas Lefèvre 052dadfc5b [REF] spreadsheet: introduce @odoo/o-spreadsheet module
Using o-spreadsheet features and functions is done using
the same import module as if it was installed from npm.

Additionaly, by adding the library as dev dependency in package.json[1], IDEs can
now leverage Typescript types for autocomplete and type checking.
The "alpha" release tag is always the lastest master version.

[1] enable web tooling `addons/web/tooling/enable.sh` ;)

closes odoo/odoo#115972

Related: odoo/enterprise#38471
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-03-30 17:57:44 +02:00
Julien 274bd4e1dc [REF] web_kanban_gauge, web: move gauge field into web
Move the kanban gauge field from web_kanban_gauge to web.
Also delete the web_kanban_gauge module and remove all its references.

opw-3231911

closes odoo/odoo#115293

Related: odoo/upgrade#4437
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-17 15:02:41 +01:00
Joseph CaburnayandJulien Mougenot 3a798039d6 [REF] web_tour,*: convert web_tour to owl
* The tours are now run by the `MacroEngine` defined in `macro.js`.
  * This is accomplished by converting (at runtime) the user-defined tours to
    `Macro`s. See `tour_compilers.js` for the step (and tour-to-macro) compilation.
* API is kept the same as much as possible. Basically, declaring tours stayed
  the same with some exceptions:
  * `allowInvisible` can be provided in a step to allow consuming the trigger
    element even if it is invisible.
  * `isCheck` can now be used to replace the no operation `run` that is
    traditionally signals the runner to only perform a check.
  * Before, multiple `run`s can be called simultaneously. Now, each `run` method
    is awaited before proceeding to the next step.
* If the trigger element is `disabled`, the tour runner will *not* proceed on
  calling the `run` method and the runner will stay on current step until the
  trigger element becomes `enabled`.
  * However, the tour runner is okay with `disabled` trigger element if the step
    has `isCheck = true`. As long as the trigger element is found for `isCheck`
    step, the tour runner will happily move to the next step.
* Some tours are adjusted to properly run with this new tour runner.
* When the tour failed:
  * The dom string is not logged anymore.
  * However, a warning message containing the relative location of the step will
    be logged. This is better in helping the author in locating the failed step.

**Some guidelines learned during the development:**

* Each step may trigger a dom mutation. It's a good practice to insert an
  intermediate step that *checks* the existence of an element that result from
  the action of the previous step.
* Refrain from using the `run` method for assertions. `run`, in principle, is
  provided to perform actions that are not offered by the helper. Use the
  `trigger` for assertions.
* During dev, find `SHOW_POINTER_DURATION` and set it to `250`. This will show
  the pointer (pointing to the trigger element) for 250ms when watching the
  tour.

closes odoo/odoo#107618

Task-id: 3082036
Related: odoo/enterprise#37560
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-03-15 13:19:45 +01:00
859a289b01 [REF] web,*: OWL GanttView (part 2)
This commit acts as a setup that allows the newly converted gantt view
extensions in enterprise to work properly.

Part-of: odoo/odoo#112756
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-28 20:38:49 +01:00
tsm-odoo 5b4da6ae73 [IMP] im_livechat, web: prettify im_livechat module
closes odoo/odoo#112999

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-18 02:49:45 +01:00
e93988ea65 [REF] mrp, web: OWL GanttView
Community counterpart of the enterprise commit having the same name.

This commit acts as a setup to allow for the reworked gantt view to work
properly.

Task Id: 3105022

Part-of: odoo/odoo#110819
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-14 17:09:06 +01:00
Simon Genin (ges) f5c5e51917 [FIX] web: tooling: fix support for older tooling
Older tooling used prettier config files. The issue was that the
disable command of the tooling was also changed to not remove those
files as they shouldn't exist anymore.
But changing from 16 to master without manually triggering a tooling
"disable" would then left the prettier config and mess with the addons
eslint whitelist.

closes odoo/odoo#110582

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-26 14:19:06 +01:00
niyasraphy bcf6f6625b [IMP] web: remove non existing module from _eslintignore
before this commit, the web_dashboard module was reffered in _eslintignore file

web_dashboard module was removed by this commit:  https://github.com/odoo/enterprise/commit/658606bd870041da8a7c969c3ffe63f762e5daf5

after this commit, the refferenced web_dashboard module will be removed from _eslintignore file.

closes odoo/odoo#110495

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-01-20 11:43:44 +01:00
Samuel Degueldre b34429b984 [IMP] web, test_lint: forbid private class fields
We don't want private class fields to be used in Odoo because they limit
how classes can be patched from the outside, extensibility is one of
Odoo's biggest strength and we do not want to limit it.

This commit adds the `no-restricted-syntax` rule to eslint configs with
a rule that forbids private class fields.

closes odoo/odoo#109664

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2023-01-11 17:58:41 +01:00
Samuel Degueldre 43529c8573 [REF] point_of_sale, *: extract navbar and remove ChromeAdapter
*: pos_hr, pos_restaurant, pos_six

The Chrome component a bloated "god component" that coordinates entirely
too many things which makes it hard to reason about, navigate, and
debug.

This commit extracts the navbar section of the chrome component into its
own component, and makes the sound player into its own self-contained
service.

This commit also merges the ChromeAdapter component into the Chrome
component, there is no reason for these to be two separate components.

Part-of: odoo/odoo#108891
2023-01-05 14:32:47 +01:00
Pierre Paridans bc325631b3 [FIX] web: lint tooling - exit script if cd fails
Ref:
- https://www.shellcheck.net/wiki/SC2164

closes odoo/odoo#107937

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-12-14 17:17:57 +01:00
Pierre Paridans 591c091c7a [FIX] web: lint tooling scripts - Double quote to prevent globbing
Double quote to prevent globbing and word splitting.

Ref.
- https://www.shellcheck.net/wiki/SC2086

Part-of: odoo/odoo#107937
2022-12-14 17:17:57 +01:00
Samuel Degueldre 990b10aece [REF] point_of_sale, *: convert legacy modules to ES odoo modules
*: l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos, l10n_in_pos,
l10n_sa_pos, pos_adyen, pos_discount, pos_epson_printer,
pos_epson_printer_restaurant, pos_hr, pos_loyalty, pos_mercury,
pos_restaurant, pos_restaurant_adyen, pos_restaurant_stripe, pos_sale,
pos_sale_product_configurator, pos_six, pos_stripe

We are about to refactor most of the Javasript code base of the point of
sale and related modules. In doing so, we will move a lot of files and
modernize the entire code-base. In order to avoid diffcult rebases,
their conversion to odoo-modules is done as a first step to avoid
getting lots of conflicts on files that were unindented, which marks the
entire file as being in conflict. Conflicts will occur during forward
ports but they will be easier to manage as the changes will be much
smaller in scope, and the author will have the context of the change
that causes the conflict in mind when dealing with it.

closes odoo/odoo#107621

Related: odoo/enterprise#34910
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-14 11:41:52 +01:00
Hubert Van de Walle (huvw) 2e497b886e [IMP] web: Add QUnit.debug type definition
closes odoo/odoo#107856

X-original-commit: 409fc809bafec2507342534bcdf4810ebffe9228
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-12-13 17:03:21 +01:00
Hubert Van de Walle (huvw) 96b4aac704 [FIX] web: conflict in qunit type definition
In the QUnit type definitions, there is a QUnit namespace and a QUnit
interface. When using a jetbrains IDE, it is confused between the two
and thinks the global QUnit is the namespace.
This means that it can't resolve QUnit.test, QUnit.module, etc

This fixes this issue by disambiguating between the two.

X-original-commit: 26dc799f841e51a6d57d427e095b662a45bc7e5a
Part-of: odoo/odoo#107856
2022-12-13 17:03:21 +01:00
Simon Genin (ges) 1d4164b729 [FIX] dx: js tooling: remove prettier cmp command from pre-commit
In this version of the tooling, the prettier files do not exist anymore.
We don't want to check if the files have changed, it will always be true
and trigger a reload of the tooling.

closes odoo/odoo#107825

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-12-13 13:51:52 +01:00
Simon Genin (ges) 2f6fd2048e [FIX] dx: js tooling: remove warning about glob syntax
The glob *.{js} should be written *.js
It was a relic from the *.{js,md} time.

Part-of: odoo/odoo#107825
2022-12-13 13:51:51 +01:00
Simon Genin (ges) 72f7d52254 [IMP] dx: js tooling: imp to jsconfig file
remove checkJS: It made the ts server check for error, bypassing some
eslint rules (such as globals).
add ts files in the include: ts files need to be included in the project
as there are some .d.ts files defining types.

closes odoo/odoo#105984

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-11-18 08:43:49 +01:00
Simon Genin (ges) 532b4194cb [IMP] dx: js tooling: imp to jsconfig file
closes odoo/odoo#105963

Checkjs: provide better erros in the IDEs
Disablesizelimit: experience to see if it works better with this
Target: import the default lib.d.ts for type checking
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-11-17 18:00:33 +01:00
Michael (mcm) 7172c5349b [IMP] web: give better autocompletion in js
This commit adds and fixes type annotations to give more accurate
autocompletion for javascript.

closes odoo/odoo#105670

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-11-17 16:58:43 +01:00
Simon Genin (ges) 729647493f [IMP] dx: tooling js: improvements and preparation for runbot lint
- Use of jsconfig instead of tsconfig
- jsconfig deployed with tooling, no need for CLI
- ecmascript bumped to version es2022 (static properties)
- prettierrc merged inside the eslintrc
- add a few globals
- cleanup package.json scripts
- add script to lint/format only the diff (opposed to staged files)
- bump up node packages versions
- use eslint as cli instead of prettier-eslint, as eslint does provide
parsable output for runbot.
- add the typescrit types of libs as dependencies + main.d.ts to
improve autompletion.

This upgrade makes it easier to deploy and use the js tooling, as it is
expected more and more people will use it if a lint check is added to
the runbot.

About the runbot:
The commit gets the code ready to enable the lint on the runbot.
It will lint the code with the same rules and same ignore file.
The only difference is the runbot will check only the diff and not the
entire commited file.
The goal will be to progressively (and aggressively) whitelist modules
to converge to a nice formatted codebase.

closes odoo/odoo#105165

Related: odoo/enterprise#34048
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-11-17 13:57:19 +01:00
Alexandre Kühn b0116e4523 [IMP] web, mail: add mail module to prettier and linter
closes odoo/odoo#105677

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-11-14 16:21:39 +01:00
Jorge Pinna Puissant 9fd3ddbce9 [IMP] web: add the new test_lint eslint rules to the tooling
closes odoo/odoo#105433

Related: odoo/enterprise#33802
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-11-09 16:08:07 +01:00
Aaron Bohy 77b120d367 [FIX] web_kanban_gauge: convert gauge field to owl
This commit introduces the wowl version of the `gauge` field.

X-original-commit: e857e8d7a6ccb51adf3d328dc5539d4d5d166f2d
Part-of: odoo/odoo#101661
2022-09-29 20:51:05 +02:00
Bruno BoiandJorge Pinna Puissant ed9a9d024a [REF] *: calendar view in owl
This commit introduces the new calendar view written in owl.

closes odoo/odoo#101185

X-original-commit: e88988f58582d5b49a32d7102a74a176f40c4c69
Related: odoo/enterprise#31808
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-09-26 22:48:44 +02:00
Aaron Bohy b5295df547 [FIX] web: tooling: enable lint/prettier scrip in 16.0
The web tooling to lint/prettify the js codebase was only enabled
for master branches, because we want minimal diffs in stable.
However, v16 just got freezed, and we can afford to lint for a
while, at least until it is released. This commit enables the
script for v16, in addition to master.

closes odoo/odoo#101110

X-original-commit: 47ffd1b9efa933fa37c1b629afeeb4e3df123249
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-26 13:41:55 +02:00
Aaron Bohy 37f9c31231 [FIX] base_import,web: do not allow import if create="0"
This commit is three-fold:
 1) we now honnor attributes `create` and `import` which can be
    set to a falsy value in archs (and in these cases, we disable
    the import feature)
 2) we converted the base_import test suite to use the owl views
 3) we whitelisted the base_import addon for the lint/prettier
    script

closes odoo/odoo#100026

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-09-14 01:52:47 +02:00
Lucas Lefèvre db7322c260 [IMP] web: add dashboard modules to web tooling
closes odoo/odoo#97606

Related: odoo/enterprise#26856
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-09-10 02:54:54 +02:00
Lucas Lefèvre f78691a6b8 [MOV] spreadsheet_account: move module to community
The spreadsheet_account module is moved to the community version
for the upcoming spreadsheet dashboards

Task 2799682

Part-of: odoo/odoo#97606
2022-09-10 02:54:52 +02:00
Lucas Lefèvre a20032cc1c [MOV] spreadsheet: move module to community
The spreadsheet module is moved to the community version
for the upcoming spreadsheet dashboards

This module is the core engine of spreadsheets in Odoo.
It contains `o-spreadsheet` library (o_spreadsheet.js) and all basic
integrations with odoo such as accounting formulas, lists, pivot, filters, etc.

This module alone does not have any action or menu to open a spreadsheet.
Those actions come with `documents_spreadsheet` module or the upcoming
`spreadsheet_dashboard` module.

Task 2799682

Part-of: odoo/odoo#97606
2022-09-10 02:54:51 +02:00
Xavier Morel b3b85cae9b [IMP] *: owlify password meter and convert change password to real wizard
The changes in `auth_password_policy` are largely the owlification of
the password meter widget:

- modernize the password policy module and convert it to an
  odoo-module (note: now exports a pseudo-abstract class which is
  really a policy, for the sake of somewhat sensibly typing
  `recommendations`)
- replace the implementation of the Meter and PasswordField widgets by
  owl versions

The changes to web and base stem from taking a look at converting the
ChangePassword wizard, and finding that it would be a pain in the ass
but also... unnecessary? It seems to have been done as a wizard
completely in javascript despite being backend-only for legacy
reasons: apparently one of the very old web clients (v5 or v6
probably) implemented it as a "native action" which was directly part
of the client's UI, and so it had to be implemented entirely in the
client.

Over time it was moved back into the regular UI (and moved around
quite a bit), hooked as a client action to maintain access to the
existing UI / dialog.

But since it's been an action opened via a button for years it can
just... be a normal wizard, with password fields, which
auth_password_policy can then set the widget of.

So did that:

- removed the old unnecessary JS, and its dedicated endpoint (which is
  *not* used by portal, portal has its own endpoint)
- used check_identity for the "old password check"
- split out `change_password` with an internal bit so we can have a
  safer (and logged) "set user password" without needing to provide
  the old password, which is now used for the bulk password change
  wizard as well
- added a small wizard which just takes a new password (and
  confirmation), for safety a given change password wizard is only
  accessible to their creator (also the wizard is restricted to
  employees though technically it would probably be fine for portal
  users as well)

Rather than extensive messy rewrite / monkeypatching (the original
wizard was 57 LOC, though also 22 LOC of template, the auth_policy
hooking / patching was 33, plus 8 lines of CSS),
`auth_password_policy` just sets the widget of the `new_password`
field in the new wizard, much as it did the bulk wizard.

Also improve the "hide meter if field is empty" feature by leveraging
`:placeholder-shown`. This requires setting a placeholder, and while
empty works fine in firefox, it doesn't work in chrome. So the
placeholder needs to be a single space. Still, seems better than
updating a fake attribute or manipulating a class for the sake of
trivial styling.

Notes on unlink + transient vacuum

Although the wizard object is only created when actually calling
`change_password`, and is deleted on success, it is possible for the
user to get an error and fail to continue (it should be unlikely
without overrides since the passwords are checked while creating /
saving but...).

While in that case the `new_password` in the database is not the
user's own, it could be their *future* password, or give evidence as
to their password-creation scheme, or some other signal useful to
attack that front of the user's life and behavior. As such, quickly
removing leftovers from the database (by setting a very low transient
lifetime) seems like a good idea.

This is compounded by the `check_identity` having a grace period of 10
minutes. 0.1 is 6 minutes, but because the cron runs every 10 the user
effectively has 6~10 minutes between the moment they create an
incorrect / incomplete version of the wizard and the moment where it
is destroyed if they just leave it.

closes odoo/odoo#99458

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-09-08 18:31:18 +02:00
Samuel Degueldre 2add185ff5 [FIX] web: fix tooling not working in enterprise and autorefresh config
Previously, the pre-commit hook was modified to disallow commiting when
the config files were not up to date, the paths that were checked for
changes assumed that the hook was executed in the community repo which
breaks in enterprise and disallows commiting completely instead.

This commit fixes that, and also reloads or refreshes the tooling
automatically when it is not up to date before running prettier and
eslint instead of aborting the commit and asking the user to do it by
hand.

closes odoo/odoo#97404

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-03 16:31:07 +02:00
Lucas Lefèvre 01e1b0fcc4 [IMP] web: add spreadsheet modules to web tooling
Enable automatic linting and formatting for spreadsheet modules.

`o_spreadsheet.js` lib file should not be checked since the file comes from
an external library (`o-spreadsheet`)

closes odoo/odoo#97393

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-03 15:10:17 +02:00
Samuel Degueldre 1107e18234 [IMP] web: configure prefer-const eslint rule to be more lax
We recently added the prefer-const eslint rule, but the default
configuration of this rule disallows some things that we often do and
which we do not think are bad practice such as declaring a variable with
let so that it's available to a function defined below, but assign it
only once later, we also sometimes destructure variables with let where
some of the variables could be const but not all, in those cases we
accept that some variables will be mutable even though it's not strictly
necessary in favour of conciseness.

closes odoo/odoo#97384

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-03 15:10:04 +02:00
Lucas Perais f9434f6cf8 [FIX] web: tooling: refresh script executable.
Fixup b099b0cb35 where the new script was not made executable.

Part-of: odoo/odoo#97280
2022-08-03 06:34:11 +02:00
Dardenne Florent (dafl) 20369e46e1 [FIX] tooling,base_setup: fix whitelist syntax
closes odoo/odoo#97234

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-02 15:49:50 +02:00
Dardenne Florent (dafl) 7b7ece114a [IMP] tooling,purchase: whitelist purchase module js
Part-of: odoo/odoo#97234
2022-08-02 15:49:50 +02:00
Samuel Degueldre b099b0cb35 [IMP] web: tooling: abort commit if tooling is outdated
Currently, if your tooling is not up to date, the pre-commit hook will
happily just format your code with the outdated config. This is
undesirable because the next person to touch the file with an up-to-date
config will introduce a bunch of linting noice in their commit.

This commit adds some basic checking by comparing the config files and
aborting the commit if they are out of date, and suggesting a refresh
when the eslint/prettier config files have changed or a full reload if
the package.json has changed.

closes odoo/odoo#97286

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-02 11:49:17 +02:00
Samuel Degueldre 4d380f8753 [IMP] web: tooling: add a refresh script
This commit adds a refresh script which is a lightweight alternative to
the reload script in case the package.json hasn't changed but some
eslint/prettier files have been changed (new rules or ignored files).

Part-of: odoo/odoo#97286
2022-08-02 11:49:17 +02:00
Samuel Degueldre 4949829e20 [IMP] web: enable prefer-const and curly rules in eslint config
The prefer-const rule disallows using const on variables that are never
reassigned, this improves readability by allowing the reader to know in
advance that all variables that are declared with const are never
reassigned and all variables declared with let will eventually be
reassigned.

The curly rule disallows braceless if/else, for and while which is a
rule we have thus far been enforcing by hand.

Part-of: odoo/odoo#97286
2022-08-02 11:49:16 +02:00
Simon Genin (ges) 6ab02de109 [REF] base_setup: convert module to new js framework
convert res_config_dev_tool widget
convert res_config_edition widget
convert res_config_invite_users widget

closes odoo/odoo#96615

Related: odoo/enterprise#29804
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-28 08:10:45 +02:00
Géry Debongnie 3c782440ab [REF] board: rewrite board action in owl
This commit rewrites the board action in owl. Legacy actions are
still supported inside this new board thanks to a compatibility
layer.

Part-of: odoo/odoo#92475
2022-06-30 09:29:45 +02:00
Simon Genin (ges) c81c1ac6b1 [FIX] web: tooling -> cp -r doesn't copy symlink on macOS
closes odoo/odoo#94124

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-06-21 11:20:26 +02:00
Pierre Rousseau aee53b0d48 [FIX] web: ensure realpath is installed
With this commit, if realpath is not available (for exemple on macos),
the script is directly stopped.

closes odoo/odoo#90522

X-original-commit: 7857c577948d55842a5697ca6d91bb6ea656ef6e
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-05-04 19:17:45 +02:00
Pierre Rousseau 9e65c6a00b [FIX] web: fix tooling for enterprise repo
Since fcf2e2210a639adfcdb9236c24cfb31046b6dead, the path of enterprise
is derived from the tooling path instead of the community path.

X-original-commit: 4ff8f62aa1e10d27189ebbdd22a01711c700ea32
Part-of: odoo/odoo#90522
2022-05-04 19:17:44 +02:00
Samuel Degueldre 92497ed4f1 [FIX] web: fix tooling failing to run due to bash-specific syntax
In #86163 we added a check on the branch name to avoid running the
tooling on stable branches, however this check used bash-specific
syntax. While the hashbang in the pre-commit hook specifies that the
hook should be run using bash, we were using the npm module "husky" to
manage git hooks, which would ignore this hashbang and always run the
hook using sh, causing the hook to fail in all cases.

After some consideration, we have decided to stop using husky, as its
main purpose is to make hook management easier in npm-based projects.
Since we already need a script to enable the tooling, we can do
essentially the same thing that husky is doing but with more control
over the process with no drawbacks.

closes odoo/odoo#87436

X-original-commit: 3104ab16ecf88d4f7b1618db4d62e7f57df34e6c
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-03-29 12:00:11 +02:00
Jorge Pinna Puissant 42940aa6e9 [FIX] web: add the globals
On 19e775b3cc we added the same rules that
exists in test_lint on the tooling, but we didn't add the globals.

closes odoo/odoo#86649

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-18 13:18:34 +01:00
Samuel Degueldre 074b2c7be6 [FIX] web: run tooling only on branches starting with master
Previously, the tooling for web ran on all branches, this can cause
problems because it will automatically lint all files that have been
changed on commit, which can cause a lot of noise in the diff which is
undesirable in stable branches, as it makes forward ports more
difficult, among other things.

This commit adds a condition in the tooling so that it only runs on
branches whose name starts with master to fix this issue.

closes odoo/odoo#86200

X-original-commit: 5962b63f4ad1cfeccc0a80de2307300b50492668
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-03-11 08:44:37 +00:00