Commit Graph
7 Commits
Author SHA1 Message Date
Xavier-Do f842ae07d2 [IMP] tests: make python version accessible without importing sys
closes odoo/odoo#108202

X-original-commit: 27575ed59476238c76d40143d81f6975f1934f7c
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-12-16 19:37:53 +01:00
Romeo Fragomeli 68a3bd651f [REF] *: BS5: Migrate tables
- avoid black border in table of BS5

In BS5 there is a new rule:
```css
.table > :not(:first-child) {
    border-top: 2px solid currentColor;
}
```
This rule generate unwanted border in our visual, so we change the color
to the old one we have in BS4 and in some case set the `border-top` to
´none´.

PS: another solution is to use the `table-borderless` class, but then
we have `tr` flickering for the height in list view (edit mode).

- table background-color :
  * BS4:
  the background color is set with the `background-color` property
  * BS5:
  it's set with a box shadow and the `--table-accent-bg` CSS variable

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +02:00
Thibault Francois 226df213f2 [FIX] cloc: fix count of studio field + exclude sa
This commit fix 3 problem

Don't count studio field
------------------------

the commit https://github.com/odoo/odoo/commit/75b8c4eb1ed6e44f427886eea06ad216995e16c8
was supposed to stop counting count field generate by addins a smart
button with studio.

It works fine when base import module is not installed which is never
the case.

When base_import_module the field is counted as a field that belong
to a imported module installed : studio_customization

studio_customization should not be counted as an imported module
installed

Count Field with standard xml_id
--------------------------------

With https://github.com/odoo/odoo/commit/9afce4805fc8bac45fdba817488aa867fddff69b
Each manual can end up with an xml_id from a standard module:
the original module of the model

A standard module should never create a manual field so we can consider
they should be counted unless they match the criteria of the first
problem

If a field has a standard module xml_id and no other the module
should be odoo/studio and not the name of the standard module

Make possible to exclude some db record from cloc
-------------------------------------------------
It's possible to exclude some file in python module
but it's not possible to exclude some field or SA in
the database from the count

Make it possible if they are link to an xml_id
from the module __cloc_exclude__

The exclude record will be shown in cloc report with
the verbose mode

closes odoo/odoo#95028

X-original-commit: db52fb174461107e26b066147801f54a89d0dbf9
Related: odoo/enterprise#29007
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-07-01 16:36:18 +02:00
Thibault Francois dc8f06624f [ADD] cloc: count loc in style file and from imported module
Context
-------

Web design specific require a lot of work and need maintenance.
So far the style files were not taken into account despite the
amount of maintenance they require.

With this commit they are going to be counted,
knowing they still can be excluded in the manifest.

Imported module allow to deploy frontend assets: stylesheet,
javascript, xml template and Qweb view that require
as well some maintenance. They are going to be counted

Implementation
--------------

- Add method to parse css and scss file
- Include .scss and .css file in the count

- Add external_id to attachment that store
  frontend asset of imported module
- Find all attachment with .js, .css, .scss, .xml
  from imported module
- Find qweb view from imported module
- cound the content of the attachment and the qweb view

closes odoo/odoo#86816

X-original-commit: d2e0b48271dbd8cd7bbdbc5c2c1649c55c51417b
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Thibault Francois <tfr@odoo.com>
2022-03-21 17:57:05 +01:00
Thibault Francois e1983aa413 [FIX] base{_import_module}: cloc should not count generated code
* Studio generate computed field "count" when the user add a button
in the button box. Since those lines are written by studio with drag and drop
it should not be counted for the maintenance subscription.

We can detect them because field created by the user in studio start with x_studio
and fields created outside studio does not have studio_customization
xml_id

* Add test to make no standard module introduce customization in the
database during the install the will be counted by cloc

see https://github.com/odoo/enterprise/pull/22664

closes odoo/odoo#85763

X-original-commit: 47ae24081fe5c0c86ce8507229dfb550ec585633
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Thibault Francois <tfr@odoo.com>
2022-03-04 11:16:52 +00:00
Thibault Francois 6f47bfd916 [FIX] base: cloc test and default exclude
- Python code is counted slightly differently
in python 3.8.

```python
a = """
  str
"""
```

is counted as 2 lines until python 3.7
and only one since python 3.8

This change will not impact a lot the count
but we have to make sure the test will pass
if the test are run
on python 3.8

- the folder migrations is not maintained
from version to version and thus should not be
counted for the maintenance.

closes odoo/odoo#54537

X-original-commit: 2a57a156c7b8e81c01afa095b3291361d208611f
Signed-off-by: Antony Lesuisse (al) <al@openerp.com>
2020-07-15 18:49:20 +00:00
1c522ee778 [ADD] odoo-bin cloc cli subcommand.
Odoo cloc is a tool to count the number of relevant lines written in Python,
Javascript or XML. This can be used as rough metric for pricing maintenance of
customizations.

It has two modes of operation, either by providing a path:

    odoo-bin cloc -p module_path

Or by providing the name of a database:

    odoo-bin cloc --addons-path=dirs -d database

In the latter mode, only the custom code is accounted for.
Both modes can be used simultaneously.

Files that cannot be parsed are shown at the end of the report.
Parsing can fail due to syntax errors or excessive file size.

closes odoo/odoo#52635

X-original-commit: ae858c3ac66267b4726db459032b91a6be1cc1d6
Related: odoo/enterprise#11018
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Co-authored-by: Thibault Francois <tfr@odoo.com>
Co-authored-by: Antoine Vandevenne (anv) <anv@odoo.com>
2020-06-09 00:30:55 +00:00