Commit Graph
20 Commits
Author SHA1 Message Date
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
Tommy (tong) fb43199c8b [FIX] base_import_module: fix imported static files cannot be replaced
Issue:

 Imported module is not able to search existing static files to replace them

Cause:

 After changing the new loc calculation, ir.attachment will link to the
 ir.model.data. However, those attachments will not able to search anymore
 without sudo. Therefore, the system will try to create the attachment again.
 It will return error because constraint "ir_model_data_module_name_uniq_index"
 will prevent ir.model.data to create again.

Solution:

 Use sudo to search the attachment.

closes odoo/odoo#93752

X-original-commit: 8f604847eb1ec96955ee724ad7b882c74160b9d7
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2022-06-21 11:20:17 +02:00
Thibault Francois fc65ae4dfe [FIX] cloc: do not count studio qweb
Since
https://github.com/odoo/odoo/commit/d2e0b48271dbd8cd7bbdbc5c2c1649c55c51417b,
qweb view from imported module are counted. the issue is that qweb view
created with the wysiwig editor of studio got an external ID from
studio_customization module which is declared as imported

So those views were wrongly counted for the maintenance fee.

Solution
--------
Exclude qweb view from studio_customization module

closes odoo/odoo#87424

X-original-commit: 77db024140e4f7c9ae8e6b5eb95de857afbab0da
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-03-29 10:56:40 +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
Julien Mougenot 54b45aec9e [FIX] base_import_module: Keep manifest assets of dynamic modules
The `ir_import_module` module is used by users to upload custom module
data via a zip file. The zip file can contain xml data, xml views and
static files.

Before this commit, the "import module" feature of this module was
broken since the imported module's manifest was lost after the import
was performed.

Now, 'ir.asset' records are created along with the attachments pointing
to the imported static files.

closes odoo/odoo#80120

X-original-commit: ec77577796e72707fbb2077f05067428cebc3c7f
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2021-11-22 11:12:44 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Julien Mougenot c20e5ad072 [FIX] base_import: Convert test.xml assets
Before this commit: some testing assets in base_import_module have not
been converted to the new manifest asset declaration system.

This commit converts these assets.

X-original-commit: 3509493e8d0c0106f1dfc7dabe2e3edeec98fbd7
2021-04-21 15:49:57 +00:00
Victor Feyens 07631a5185 [IMP] * : manifest module categories cleanup
closes odoo/odoo#35754

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-09-25 14:03:45 +00:00
kujiu 9de1bc0eef [IMP] Improve compatibility with screen readers (accessibility) (#24574)
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable.

This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader.


* [IMP] Labels must have a for attribute. Improve accessibility.
* [IMP] Better error message when trying to read a missing cached value
* [FIX] Add some aria-label and title attributes for screen readers.
* [FIX] Template name is not included in the error message in case of SyntaxError in QWeb
* [FIX] Improve the Tour failed at step error message to be more explicit.
* [IMP] Add aria-labels
* [FIX] Add missing aria-label on failing test
* [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all.
* [IMP] Color names on kanban views and many2many tags
* [IMP] Add some checks on views for accessibility.
* [IMP] Add `alt` attribute on `img` tags.
* [IMP] Add aria-label and title on non-described icons
* [IMP] Add button role to widgets with btn class
* [IMP] Translate aria and formatted attributes.
* [IMP] Remove wrong aria-labelledby
* [IMP] Add menu role on dropdowns
* [IMP] Buttons must be focusable
* [IMP] Add aria attributes on progress bars
* [IMP] Improve accessibility of basic widgets
* [IMP] Change main layout to more semantic tags
* [IMP] Add menuitem role when missing
* [IMP] Remove wrong role='presentation'
* [IMP] Improve accessibility of tab panels
* [IMP] Add aria-invalid on invalid fields
* [IMP] Add aria-sort on ordered columns
* [IMP] Add role on alerts
* [IMP] Use dialog role, header, main and footer tags for modals
* [IMP] Add labels on o_status
* [IMP] Improve accessibility of kanban view with feeds and articles
* [IMP] Add alerts in case of new messages
* [IMP] Add widget, navigation or img role to aria-labelled items
2018-06-22 21:22:21 +02:00
rde 8baabfb6be [FIX] website_*: convert old ir.ui.view page=True into website.page in 1 record
Before this commit, website.page xml record were created in 2 steps:
	1. Create an ir.ui.view record with <template> tag
	2. Create a website.page record with <record model="website.page">
But this is useless since website.page inheritS ir.ui.view, you can create both
records just in one <record> tag.

Note: This is NOT TRUE in every case:
Odoo's ORM will suffix external_id of inherited records (in this case the
ir.ui.view created through the website.page record) with its model's name.
This can be a problem in some case (this is an example):
	website_crm_template.xml create an ir.ui.view inheriting the
	ir.ui.view 'website.contactus'.
	But if we didn't keep website.page & ir.ui.view records split for that
	specific case, the ir.ui.view would inherit a website.page record
	causing an error. (website.contactus would be the id of the page record
	while the ir.ui.view's id would be website.contactus_ir_ui_view)

In short: when migrating an ir.ui.view (<record> xml) to a website.page:
	* If there is record inheriting the ir.ui.view ID, then split
	  website.page & ir.ui.view
	* if not, you can create the website.page and its ir.ui.view both in one
	  record (<record model="website.page").

This commit also removed remaining page="True" from xml template since we
removed the 'page' attribute from ir.ui.view model overrided in website module.
2017-09-26 16:08:14 +02:00
Laurent Smet 3425752eac [REM] odoo/report: remove deprecated stuff
- RML Reports
- Webkit Reports (most part already removed by 13b9982c62)
- LocalService in netsvc.py
- rename attributes like rml_% to report_%
- rename ir.actions.report.xml to ir.actions.report
- allow rendering directly on an ir.actions.report by calling render method
- remove 'controller' report_type
- remove unused res.font stuff
- remove print_report method in models.py (not used)
- restore removed call to pdftotext process in test_reports
2017-05-08 09:22:56 +02:00
Olivier Dony 859d443863 [IMP] *: rename manifest files for v10 naming convention 2016-09-05 11:57:50 +02:00
Mohammed Shekha 870f2ff893 [MIG] base_import_module: Migrated to new API 2016-07-13 12:46:50 +02:00
Yannick Tivisse 82acdbaa49 [FIX] Several fixed due to some of the demo data removal
NB : Some tests have been modified.
One assert statement in orderpoint_calendar.yml has been modified,
but the change is legit has no python method has been modified at all
2015-08-25 19:27:24 +02:00
Yannick Tivisse 0decfd94d1 [IMP] __openerp.py__ files : remove all occurence of authors and website
where it was 'Odoo SA', 'OpenERP SA', 'OpenERP s.a.', 'OpenERP SA', 'OpenERP'
      or 'http(s)://openerp.com' or 'http(s)://www.odoo.com'
2015-08-20 16:15:59 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
Fabien Meghazi 9ca54d43ca [ADD] base_import_module test module, static asset in backend bundle
bzr revid: fme@openerp.com-20140505145816-jz7e4byh1imrkaek
2014-05-05 16:58:16 +02:00
Fabien Meghazi 3861a93bd9 [IMP] Test module
bzr revid: fme@openerp.com-20140327105023-x3r7mjmptjxpzkqc
2014-03-27 11:50:23 +01:00
Fabien Meghazi 0195f0d817 [ADD] Test module
Test suite is still todo

bzr revid: fme@openerp.com-20140326151411-moo1yuozvpgro1mh
2014-03-26 16:14:11 +01:00