summaryrefslogtreecommitdiff
path: root/addons/hr_org_chart/static/src
AgeCommit message (Collapse)Author
2019-03-06[REF] hr_org_chart: 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-14[IMP] hr_*: introduce the employee profileLucas Lefèvre
General Purpose =============== We want an 'Employee profile' gathering every data about an employee. The main form view is modified to become this employee profile. A user can also see his own profile through the Preferences menu. The new profile replaces the current Preferences view if the hr module is installed and the current user is linked to an employee. A user should be able to see and edit his own profile. *Problem*: Many fields on hr.employee are protected by groups="hr.group_hr_user". Therefore, a regular user cannot see or edit those fields. This protection must be bypassed to allow read/write access to the regular user's own data. A similar mechanism already exists for res.users (for Preferences) The better (least worst) solution found is to reuse this mechanism by adding related fields on res.users. Pros: - Don't change security access on hr.employee - Don't implement yet another custom security layer, risking to add new security breaches - A lot of fields are added by other modules on hr.employee. It would have required to integrate them with the custom security layer. - Fields added by other modules on the user's preferences view (normal view, not the profile) are automatically included in the employee's profile view. - Allow the hr.employee form view to be different than the user profile accessible through the Preferences menu. E.g. add custom buttons only relevant to the logged in user such as "Request a leave". Cons: - Each field from hr.employee that you want to appear on its profile must be added as a related field on res.users - Those related fields must be added to user's preferences view (duplicate views) - They also must be added to SELF_[READABLE | WRITABLE]_FIELDS Note: When the front-end loads the views it gets the list of available fields for the user (according to its access rights). Later, when the front-end wants to populate the view with data, it only asks to read those available fields. However, in this case, we want the user to be able to read/write its own data, even if they are protected by groups (groups are kept on the related fields on res.users). The front-end need to be made aware of those fields by sending all field definitions. hr_attendance ============= This commit integrate attendance in the new employee profile. It also adds a stat button to this employee profile showing the number of hours worked last month. Remove the boolean computed field 'manual_attendance'. This field is just a shortcut to add/remove the employee's user in the "Manual Attendance" group. The checkbox is confusing on the employee's form and this should be done through the normal group management screens. hr_presence =========== Display the presence status on the employee kanban template. The status is a colored chip which can be green (present), orange (to define) or red (absent). Currently, the presence status is only computed when accessing the report view. As this commits displays it on the employee kanban, it should be updated more frequently. The state should not be updated every time the kanban view is loaded since the computation is a bit heavy. Instead: add a cron to update status every 15 minutes. -> The status is accurate on the report view (status is still updated when loading the view) -> The status in accurate at 15 minutes on the kanban view [ADD] hr_attendance_presence ============================ Bridge module between hr_attendance and hr_presence. This commit integrates hr_presence module in the employee profile and adds the presence status on the employee kanban view. But hr_attendance adds at the same place a similar status icon for checkin/checkout. This bridge module makes the status from hr_presence invisible as hr_attendance should be the main presence control mechanism. Also, this commit adds the ability (through a new setting option) for hr_presence to take into account checkin/checkout to determine the presence status. l10n_be_hr_payroll ================== integration with employee profile
2019-01-18[MERGE] forward port branch 12.0 up to f854e01a983Christophe Simonis
2019-01-16[MERGE] forward port branch saas-11.3 up to 83cc046e9a9Christophe Simonis
2019-01-16[FIX] hr_org_chart: undefined manager name in breadcrumbsJorge Pinna Puissant
Before this commit, in the organization chart, when a manager that have too many subordinates, and we want to view all the subordinates clicking the '...' button. There was an error in the breadcrumbs, the text 'Undefined' was shown in the place of the manager's name. Now, the breadcrumbs shows the name of the manager. OPW-1923990 closes odoo/odoo#30231
2018-12-06[IMP] hr_org_chart: Allow recursion in hierarchylul-odoo
Employees can appear multiple times in the org chart Purpose ======= Allow recursive hierarchy (an employee can be its own manager; e.g. the CEO is manager of everyone but is also member of a department managed by the CTO who is himself managed by the CEO). This means an employee might appear in multiple place in the organisational chart. The button to see more of the hierarchy in the organisation chart opens all employees under the N+2 of the current employee being displayed but does not open the view of the N+2. Specification ============= Add 'subordinates_ids' computed field on 'hr.employee' to get all subordinates (direct and indirect). closes odoo/odoo#27900
2018-11-29[MERGE] forward port branch 12.0 up to 82a1e1dcc33Christophe Simonis
2018-10-26[REF] account, hr_org_chart: use correct sub-assetsqsm-odoo
Some variables were placed at the beginning of the backend helper. While it was working, the normal convention is to place them at the end of the variables helper. closes odoo/odoo#28203
2018-11-28[FIX] hr_org_chart: 3 level num subordinate rightNicolas Lempereur
On the third level of a organization chart, the number of subordinates on the right but over the container boundary. For the second level there was already a special case: padding-left: $tmp-gap-base; So for the third a fix could have been: padding-left: $tmp-gap-base*2; But this changeset replaces margin by padding so invisible content does not create a horizontal scrollbar (since we had 100% width with margin-left that busted it out of its container). opw-1912437 closes #29043
2018-09-20[FIX] hr_org_chart : Fix width of organisation chartDavid Beguin
Task ID 1881825 Closes PR #27087
2018-08-02[FIX] hr_org_chart: BS4, restore most of the hr_org_chart featureqsm-odoo
With BS4, the popover and the chart design were broken. This is now restored but could still use a bit of redesigning.
2018-07-27[REF] *: BS4, review the 'media' structureqsm-odoo
Only two classes remain to declare a media structure: 'media' and 'media-body'. 'media-left/right' are guessed by their position using the flex layout. Also, the 'media-list' class has been dropped but <ul/> element should use the 'list-unstyled' class instead. Like all other components, spacing between medias are now to be handled explicitely thanks the spacing utility classes.
2018-07-27[REF] *: BS4, 'pull-left/right' -> 'float-left/right'qsm-odoo
2018-07-27[REF] *: BS4, adapt the badge component structureqsm-odoo
The '.badge' elements must now also use the 'badge-pill' class to get the same style as before as '.badge' elements without it are meant to replace the old 'label' component.
2018-07-27[REF] *: BS4, adapt tables (and list view)qsm-odoo
`table-condensed` -> `table-sm` Also SCSS variables were renamed. Also restore list view design.
2018-07-27[REF] *: BS4, replace img-rounded/img-circle classesqsm-odoo
'img-rounded' -> 'rounded' 'img-circle' -> 'rounded-circle'
2018-07-27[REF] *: BS4, review panel and well structureqsm-odoo
Panels and wells were dropped and replaced by the "Card" component.
2018-07-27[REF] *: BS4, review color systemqsm-odoo
Odoo used to declare two main colors: primary and optional (which are purple and turquoise in enterprise). Those were respectively assigned to the 'primary' bootstrap variable and the 'btn-primary' bootstrap variable. BS4, however, does not allow to have a different primary color for buttons. Instead, the 'primary' color is used for all 'primary' related components and utility classes, same as for all other colors. So, if we want to keep our enterprise buttons green, our 'optional' colors had to become our 'primary' color. The old odoo primary is then renamed to the 'odoo' color. The palette of grays is now larger by default and is numbered from 100 to 900 alongside the $black and $white variables. The equivalence for older variables and the way we used them is: $gray-darker -> gray 900 (unused before) $gray-dark -> gray 900 $gray -> gray 700 $gray-light -> gray 600 $gray-lighter-darker -> gray 400 (the old variable was created by us) $gray-lighter-dark -> gray 300 (the old variable was created by us) $gray-lighter -> gray 200 Fortunately, the 'lighter' variations we created fit well in the default BS4 system ! Unfortunately, our $gray-lighter which carried the same function as $gray-200 (see above) is very close to the new default $gray-100 and quite distant from the new $gray-200. This will be handled in the next commit.
2018-07-27[REF] *: BS4, the $text-color variable was renamed to $body-colorqsm-odoo
2018-07-27[REF] *: BS4, get rid of the removed 'square' mixinqsm-odoo
2018-07-27[REF] *: BS4, adapt media queriesqsm-odoo
media queries that target a specific screen size handled by bootstrap have now a more convenient way to be defined: ``` @​media (min-width: $screen-sm-min) { ... } -> @​include media-breakpoint-up(sm) { ... } ``` ``` @​media (max-width: $screen-sm-max) { ... } -> @​include media-breakpoint-down(sm) { ... } ``` ``` @​media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { ... } -> @​include media-breakpoint-only(sm) { ... } ``` ``` @​media (min-width: $screen-sm-min) and (max-width: $screen-md-max) { ... } -> @​include media-breakpoint-between(sm, md) { ... } ``` Also, bootstrap has changed the values for its default screen sizes: ------------------ | BS3 | BS4 | ------------------ 0 | XS | XS | -> Portrait Mobile 576 | / | SM | -> Landscape Mobile 768 | SM | MD | -> Portrait Tablet 992 | MD | LG | -> Landscape Tablet / Small Desktop 1200 | LG | XL | -> Desktop ------------------ While it is possible to configure BS variables to behave as BS3, we took the decision to keep the BS4 variables untouched. BS4 system seems indeed better and having the purest bootstrap possible is better for Odoo to be used as a framework.
2018-07-27[REF] web, *: BS4, adapt use of tooltip/popover.jsqsm-odoo
2018-07-27[REF] *: get rid of vendor prefixesqsm-odoo
BS4 do not provide vendor prefixes scss mixins anymore as it is meant to be used with the 'autoprefixer' library. As we only support the last version of every major browsers in Odoo, we took the decision to not use the library as it was also complex to integrate in Odoo. We decided to do the library's work by hand if it ever become necessary.
2018-06-22[IMP] Improve compatibility with screen readers (accessibility) (#24574)kujiu
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-04-18[REF] *: review scss variables handlingqsm-odoo
Unlike LESS, SCSS variables are not lazy loaded. Our system has thus to be updated. This commit creates new templates which are t-called in assets bundles (to replace the old less_helpers template): - web._assets_utils: regroups the mixins and functions which *can* (and so should) be available in every asset bundle - web._assets_primary_variables: regroups the variables (or mixins used as variables) which *can* (and so should) be available in every asset bundle - web._assets_secondary_variables: same as above but provides an environnement where all the 'primary' ones are accessible. This is for example useful to handle the community/enterprise split: // Community primary variables $o-pink-color: pink; // enterprise color $o-brand-primary: blue; // Enterprise primary variables $o-brand-primary: $o-pink-color; // Community secondary variables $o-my-darker-primary: darken($o-brand-primary, 5%); => If there was only one variable template, enterprise edition would have been able to define its primary color at the end but the darker primary would not have been updated. Using the "!default" system and putting enterprise definition above would not have solved the problem as the $o-pink-color would not have been accessible. - web._assets_backend_helpers: regroups the variables, mixins and functions which *can* (and so should) be available in the backend asset bundle only. This is especially (only?) useful for bootstrap variables overriddes. - web._assets_frontend_helpers: regroups the variables, mixins and functions which *can* (and so should) be available in the frontend asset bundle only. This is especially (only?) useful for bootstrap variables overriddes. Note: bootstrap variables are not accessible in any of those anymore. If you have variables that should depend on bootstrap, you have 3 solutions: - Find another way: your variable is probably useless, use bootstrap variables directly or create a variable that will influence the value of bootstrap variables. E.g. instead of declaring: `$myvar: $bootstrapvar * 3` and using $myvar alone, declare: `$myvar: 3` and use `$myvar * $bootstrapvar` where needed. - Declare a copy of the bootstrap variable and use that one. In that case, you should also force-set the real bootstrap one to be sure they match (this should be done in appropriate templates mentioned above). E.g. ``` $o-boostrapvar: 5; ... $boostrapvar: $o-bootstrapvar; ``` - Set your variable to null and set it to your bootstrap expression in the file you will need it (where bootstrap variables are accessible) without forgetting to add the !default flag to allow overriddes. ``` $myvar: null; ... $myvar: $bootstrapvar * 5 !default; ``` This commit also partly changes the variable names to follow the convention: $o-<app_id>-<name> where 'app_id' is the current's app name or a meaningful unique identifier ("theme" for all themes for example, as no multiple themes can be installed).
2018-04-18[REF] *: convert less content to scss contentqsm-odoo
Convert content so that the assets compile on app installation. The style is still broken after this as the variables/mixins/... are not defined in the right order (as it did not matter in LESS but does in SCSS). This commit basically changes: - Variables: @​var_hello -> $var-hello - Mixins: .mixin_world() {} -> @​mixin mixin-world {} - Classes used as mixin: .my_class() -> @​extend .my_class - Here there were no other solution than to convert the use of a mixin call by the use of an extend as a first approximation - LESS functions -> SCSS functions (e.g. fade -> rgba) - Move first variable definition before the variable is used - Still need to make sure last variable definition is at the right place
2018-04-18[REF] *: rename all LESS files to SCSSqsm-odoo
This is a simple renaming without adaptation.
2018-03-16[FIX] hr_org_chart: add missing event on show more buttonJoão Santos
The event was lost during new view refactoring at e3d1abc75f The "show more" button at the bottom of a too long employee list was not binded to an event. After this commit, clicking the button leads to the subordinates list. CLA signature for agente2012 Closes #23665
2017-05-04[REF] web, *: restore views designqsm-odoo
Since the new views merge, a lot of design elements were broken. This was particularly impacting the fields in the editable list view; indeed the editable list view is not using an inline form view anymore so the fields in the list were not properly styled as the LESS was still defined assuming the form view environment (for example the invalid fields were red for o2m fields in form view but not in editable list view even though they got the right CSS class). This commit refactor the LESS following these rules: - No more division of non-layout and layout rules. Dividing LESS rules in x_layout.less and x.less was a mistake. Many rules can be considered to be layout and not layout at the same time, developers always have to switch from one file part to the other, many CSS selectors (and rules!) are duplicated for nothing, ... - Field style is extracted from x_view.less and put in the new fields.less file. As before, the fields_extra.less will contain the rules specific to community so that the enterprise repo can override those by replacing the whole file. - Many classes have been renamed so that o_form_x_y becomes o_x_y as many classes can now be applied outside of form view. These classes should not be used in templates anyway. The commit also changes the DOM of fields so that it is more minimalist (no useless parent div, etc). Input elements are not automatically styled anymore, they have to get the o_input class explicitely. This allows to fix lots of small style bugs of previous versions (required monetary field had not the proper style, readonly m2m tags appeared as editable, ...). This also improves the LESS code. The editable list view should also completely stop flickering on chrome and firefox. The commit also removes the orange outline on list view dirty cells. The commit also removes deprecated static xml, LESS and other code. Notice there are still styles to restore/fix and LESS to improve.
2017-05-02[IMP] hr_recruitment: improved kanban view of applicantsFabien Pinckaers
[IMP] hr_org_chart: help sentence [IMP] sale: search on customer in main search
2017-04-24[TYPO] Hr org chart : Missing 'to'Sanjay Jamod
This commit correct the sentence 'In order get an organigram, assign a manager to the related employees.' This commit add a 'to' before the get.
2017-04-11[FIX] hr_org_chart: update to new views and guidelinesfwi-odoo
2017-04-03[ADD] hr_org_chart: organizational chart on employee formsFabien Pinckaers
This commit introduces a new widget specific to employees. It is used to display an org chart centered on the current displayed employee. Two levels of managers as well as subordinates are displayed. It is contained in its own module and its installation is available from hr settings. Thanks to Stefano Rigano <sri@odoo.com> (@stefanorigano) for design and UX implementation.