* barcodes, calendar, partner_autocomplete, web_settings_dashboard
Make the notification system better, using bootstrap toast component,
and make it available in the frontend.
The toast component allowed to remove some JS code and made the
component customizable by themes but it had to be reviewed/fixed to make
it functional (maybe bootstrap will review its work in next versions).
This work should still be improved because there are still too many
ways (deprecated and not deprecated) to instantiate toasts in the
backend. The goal here was however to make the toasts more modern and
make them available in the frontend.
This work is needed for some tasks. @kig-odoo and @fja-odoo made a
pre-work to instantiate toasts in the frontend for their respective
tasks. This commit unifies the system.
Part of https://github.com/odoo/odoo/pull/32793
task-1970731
closesodoo/odoo#32793
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
A `description` key has been added on AbstractField and all generic
field widgets ; it is used to display a more user friendly name (both in
the webclient and in Studio).
Non-generic field widgets have an empty string as description.
Related task 1918327
closesodoo/odoo#30131
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
*partner_autocomplete,test_main_flows
In jQuery 3, the active element in autocomplete dropdowns is no
longer identified with class 'ui-state-focus' on the <li/>, but
with class 'ui-state-active' is on its child <a/>. Moreover, the
background color of the active element is now set on the <a/>
instead of the <li/>.
This rev. adapts scss rules accordingly, and selectors in the
main_flow_tour.
Issue reported on the jquery update pad.
closesodoo/odoo#31693
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
The field ignored is set in javascript on company object to filter the
ones we want to show. As it is not an odoo field, it triggers a
traceback when the trigger_up 'field_changed' is called.
OPW-1921568
closesodoo/odoo#30153
The field ignored is set in javascript on company object to filter the
ones we want to show. As it is not an odoo field, it triggers a
traceback when the trigger_up 'field_changed' is called.
OPW-1921568
closesodoo/odoo#29864
We wanted to make it possible to manually mark records from the partner_autocomplete service as 'ignored' so that they wouldn't appear in suggestions.
Previously, this was done by removing, in the service, records that were marked as 'ignored' from returned suggestions.
The problem is that, since the record was not present in odooSuggestions, the data from this company was retrieved from clearbitSuggestions and the company was still present in the dropdown.
We fix this problem by also returning ignored companies from the service, marked as 'ignored', so that they can be filtered out after getting additional suggestions from clearbit.
closesodoo/odoo#29785
Commit a6e1eb9f0a
introduced the show_vat context key, that displays the Tax ID of a customer
after its name when present, similarly to show_address.
However it appears on the field when being edited, then disappears at save,
which is confusing.
Other unclean things tended to happen: you would have "name - taxid" on customer
field, but "name" on invoice address and delivery address.
Furthermore a client could edit the name manually to erase the Tax ID, and thus
recreate a new record for the same customer.
We introduce a method to clean the name from the Tax ID, and use it so that it
is directly the client's name that is selected at edit.
Note that we also replace the standard dash in the 'name - taxid'
by a figuredash (‒, U+2012) so as to avoid potential egregious splits
because of legitimate customer names.
Similar to commit: 3cbfc40303
(same thing for show_address)
opw 1911954
closesodoo/odoo#29189
This rev. introduces robust helpers to use in the JS tests suite to
interact with DOM and components, and starts using them (almost)
everywhere.
All the helpers are exposed though testUtils.js.
There are 2 kinds of helpers:
1. Assertions
-------------
* assert.containsNone, containsN, containsOnce check that the DOM
(or a specific part of the DOM) contains a `selector`. It
generates a correct error message automatically.
ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg");
-> assert.containsOnce(form, '.o_form_editable');
* assert.isVisible, isNotVisible check that the DOM has an element
visible or not. They also check that the element is actually in
the DOM (before most tests didn't verify this).
* assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific
properties of a DOM element, and also validate that it is
applied on a single existing DOM element (before most tests
didn't verify this).
ex: assert.notOk(form.$('button').hasClass('btn-primary'));
-> assert.doesNotHaveClass(form.$('button'), 'btn-primary');
2. Utilities
------------
The goal of the utilities is to centralize the definition of many
standard components and interactions, ensuring that when we
refactor the JS framework, we do not need to change all the tests.
Existing mock utilities (addMockEnvironment, intercept, path,
patchDate, unpatch and fieldsViewGet) are moved to
'testUtils.mock.*'.
Existing DOM utilities are moved to 'testUtils.dom.*'.
New dom utilities are created for opendDatePicker, click,
clickFirst and clickLast. Helper `click` verifies that there is
exactly 1 element visible in the DOM you click on, `clickFirst`
and `clickLast` verify that there are more than one element on the
DOM.
ex: form.$('button').click();
-> testUtils.dom.click(form.$('button'));
New Form utilities: (testUtils.form.*)
clickEdit, clickSave, clickCreate, clickDiscard, all clicks on
the control panel buttons of the form.
`reload` reloads the form data.
New modal, graph, kanban and pivot utils (testUtils.pivot.*,
testUtils.kanban.*, etc.).
New fields utils: (testUtils.fields.*)
* editInput, editSelect: allow to change the value of a field,
using a selector to identify it. They validate that the input
exists and trigger the change event automatically.
* editAndTrigger: allow to modify a field and trigger specific
events after the value change
* many2one (testUtils.fields.many2one.*)
clickOpenDropdown, clickHighlightedItem, clickItem,
searchAndClickItem: use a field name instead of a selector and
do all the complex mechanism to open, filter and highlight
many2one fields.
Joint work with aab, dam, ged, mge, svs and vsc.
Add a check to see if we're in test mode that returns an InsufficientCreditError to avoid failing other tests if partner_autocomplete server fails
closesodoo/odoo#28324
Bugfix to prevent traceback in mobile apps due to override
of Many2one widget with native implementation.
Happens in every form view containing a partner field.
Implemented as defensive programming.
The goal of the included test is to prevent a silent error for the
webclient. It doesn't test the actual behavior in mobile (where there is
no DOM for Many2one).
Task #1896641closesodoo/odoo#27967
Instead of forcing the creation of iap account to consult its balance,
since it will most likely be 0 at creation, we only generate it on
explicit user action (e.g. Click to recharge the account).
- CRON changed to 60min
- Fixed display/rendering issues with autocomplete widgets.
- Moved 'Insufficient credit' banner
- Editable endpoint for partner_autocomplete service