summaryrefslogtreecommitdiff
path: root/addons/mail/static/tests/activity_tests.js
AgeCommit message (Collapse)Author
2019-03-06[REF] mail: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-11[MERGE] forward port branch saas-12.1 up to 93d736e905eChristophe Simonis
2019-02-07[MERGE] forward port branch 12.0 up to a46138cb019Christophe Simonis
2019-02-05[FIX] mail: activity model js: pass context to get activity dataLucas Perais (lpe)
Go on the crm activity view Have your user operate in another language than en_US Bafore this commit, the activity types were not translated This was because the context was not passed to the function After this commit, the terms are translated OPW 1924232 closes odoo/odoo#30837
2018-12-07[REF] *: adapt views outside webAaron Bohy
to ControlPanel/Search view refactoring. *: mail,sale,web_diagram The ControlPanel being now inside the DOM of views' controller, those existing widgets needed to be adapted (in the way they define if and how they want a ControlPanel, and in the way the manipulate their DOM as it slightly changed). Tests needed to be adapted as well. Part of task 1893568 Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com>
2018-11-19[REF] *: update js test suite to use helpersGéry Debongnie
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.
2018-12-12[IMP] mail: clean activities access rightsSébastien Theys
This commit improves code of access rights checks when creating or updating activities. Several points triggers this commit * we would like to use _filter_access_rules and override it on activities model in order to be more standard; * we would like to get rid of sudo used in various CRUD overrides as using standard ORM method allows to correctly use current user; * we would like to get rid of create_user_id field once we can keep the current user as create_uid; Access rights are a bit updated. They are now the following * you can create activities for documents like posting messages (using _mail_post_access attribute; if not defined, write access on document is required); * you can read activities for documents you can read; * you can write and unlink activities either following the defined access rule (created OR assigned), and otherwise like posting messages ( using _mail_post_access attribute; if not defined, write access on document is required); In this commit we also hide edit / mark as done / cancel buttons for activities the current user cannot modify. This commit is linked to task ID 1856417 and PR #27619. Co-Authored-By: Sébastien Theys <seb@odoo.com> Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2018-09-18[REF] mail: activities list, ‘mark as done’ sliding panelsri-odoo
Refactor ‘mark as done’ popup JS in order to use a sliding panel layout instead. Sliding panels are currently needed in kanban views, where activities are listed in a dropdown that can't handle popups because of CSS overflow and lack of space. Since this new system check for default bootstrap data-toggle attributes, it could be easily used elsewhere changing the buttons's data-toggle and providing the necessary container for the “mark as done” form.
2018-09-07[FIX] mail: improve activity view and fix activity feedbackXavierDo
-Improve no content helper on activity view -Update chatter after editing an activity un form view -Avoid context to appear as feedback When using call_button the context is set as an arg and will be catched by the kwargs of the called action. As for action_feedback, we can create a wrapper without kwargs used when calling this method from a button to avoid this problem. Another solution would be to change the call_button in order to give the context as a kwargs. Maybe a possible improvement for master. -Remove groupby from activity view group by has no effect on activity -Change cursor to pointer on record name in activity view Task: #1878184 PR: #26668
2018-09-05[IMP] mail: stylized 'no content' helper in activity viewAlexandre Kühn
Task-ID 1882552
2018-08-20[IMP] mail: refactor activity.js and add some testXavierDo
activity.js was a little dirty with a lot of copy paste. Most of the common logic is now in a BasicModel. This commit also add some tests on activity view Co-authored-by: RomainLibert <rli@odoo.com>