summaryrefslogtreecommitdiff
path: root/addons/hr/security
AgeCommit message (Collapse)Author
2020-05-26[IMP] *: remove access to ir.propertyMartin Trigaux
Only administrators can access properties and configure them. ir.property may contain sensitive information and should only be accessed via code call to specific methods
2020-03-20[IMP] *: remove global field definition in ir rules xmlVictor Feyens
It is a computed field, there is no need to manually set its value.
2020-02-04[ADD] *: add ir.model.access on all transient modelsMartin Trigaux
Following changes needing ir.model.access on transient models too. Remove groups declaration on the action to move it to ir.model.access when possible. Rules are strict by default with no unlink access by default and high priviledge asked. Adaptations may be needed later. Write access is given as a wizard may need to be modified in case the action triggers an error and the user has to correct a value account*: use account.group_account_user for all transient by default remove account.print.journal relic stock*: use stock.group_stock_user by default survey: survey user can send invitations mail: allow any employee to execute wizards additional verifications are made to ensure they are executed only on the documents the user has access to you give portal access to mail.compose.message as portal still does some actions like posting messages on the forum add ir.rule to avoid reading somebody else messages increase the query count because of undeterminist count crm: saleman for lead2opp, manager for massmailing partner manager for actions linked to partners avoid a write in test_lead_lost sms: any employee can send sms mrp: mrp user can execute wizards give unlink access as making write during do_produce operation base_import: employees can import files delivery: stock user can deliver event_sale: sale user can configure the wizards event user inherit from sale rights gamification: employee can give badge google_service: resolve FIXME hr: add specific rights manager can set a plan according to group on button anyone who can write on an employee can register a departure hr_expense: set rights based on buttons hr_holidays: an approver can make a summary report hr_recruitment: recruiter can refuse a candidate hr_timesheet: can use the wizard if can create a timesheet l10n_eu_service: managers can create fiscal positions mass_mailing: same group as on mass.mailing.list membership: accountant can create invoice from membership payment: accountant can create a link as the source is an account.move keep the payment.acquirer.onboarding.wizard to system user only as it is called during company configuration point_of_sale: PoS manager only can use wizards never create closing_balance_confirm_wizard records product_expiry: stock user has rights on stock.picking product_margin: access from accounting menus repair: same rules as for above models sale: set ir.rule for self wizard only add rule from model introduced in payment to add salesman group sale_crm: saleman can create a quotation from a lead sale_coupon: any saleman can generate coupon add self ir.rule sale_product_configurator: salesman can select product variants snailmail: employee can send letters website: designers can write on website website_crm_partner_assign: same rule as group on action website_sale: sale ACL as for payment.acquirer.onboarding.wizard website_slides: anyone can send invitation base: base.language.*: allow employee (cf lang_install) change.password.user: can not read change password wizard of other users test.*: no access is needed Courtesy of Damien Bouvy, William Andre and Antoine Prieëls for review of acl
2019-05-31[IMP] hr: Introduce the public employee profileRomainLibert
Purpose ======= 1/ Robustness & security: right now it is not easy to understand and do something clean in term of security (hr people vs employees, private info vs public). A HR officer doesn't know if he can write something on the chatter. Currently, a note will be visible for all the employees who have access to the employee form view for example. 2/ In term of business, it makes sense to let a hr manages payroll stuff (contract, employees private information, ... and other employee see public information (résumé and work information) Specification ============= Introduce 2 new models: - hr.employee.base (AbstractModel): This represents the basic skeleton model on which the shared fields and methods between the public and the private employees models. - hr.employee.public (_auto=False): This is a sql view based on the employee values, readable for an internal user (i.e. an employee). The model hr.employee is not readable anymore for an employee. There are now 3 ways to access the employee data: 1/ From the hr.employee views. HR officer access rights are required 2/ From the public profile. The public data for an employee are accessible but can't be modified. 3/ From the 'My Profile' menu. A classic employee can access its own data from there, and can modify them.
2019-05-13[IMP] base: Contextualize the multi companyYannick Tivisse
Purpose ======= Allow the user to select the allowed companies for which he wants to see records on top of selecting his current company. It is confusing for users to see the records from the company he is connected to and the records of the children companies. Instead of using the hierarchy of companies to access records across companies, the user can now select (from his set of allowed companies) the companies for which he wants to access records. /!\ This means that the user will interact with records from company A when in company B. Example: a SO has been created and confirmed in A. When in B, I create the invoice from it. Specifications ============== 1/ Deprecate the parent/children hierarchy on the res.company model. The fields are kept on the res.company model to ensure the retro-compatibility, but won't be used accross the standard code anymore. The only functional usage for this mechanism was to allow to see records from several companies by creating a virtual parent company, which will be possible with the new mechanism. 2/ By default, a user will only see the records of the company he is connected to (or records without a company). (It is still editable by the user if needed). For that, put this information in the user context, to allow having different configurations on different browser tabs. Instead of having domains like ['|', ('company_id', '=', False), ('company_id', 'child_of', user.company_id.id)] you'll have something like ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] Note that the 'company_ids' is a value that is passed in the evaluation context on the record rule, as we already have user, or time. company_ids is a list of the ids of all the enabled companies in the user's context. 3/ Out of the generic improvements brought by this task, this will illustrate issues that could exist since several versions. For example, it should not be possible to create a scrap order for the company A with a package of the company B, or it should not be possible to create an invoice on the company A with payment terms from the company B. Before the version 12.0, it was easy to encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side effect of the fact that the SUPERUSER_ID has become an inactive user was to make it more difficult to introduce mismatch on the records, but haven't solved the issue, as it was still possible to do it with parent companies configuration. Some of these issues have been fixed in this commit, but all the business flows should be re-tested to check if an ir.rule should be introduced (eg: a multi company rule for stock.quand.package), if the company of a record is correctly transfered to another record created from the first record (eg: From a SO, create an invoice and a payment, the company of the sales order should be transfered on the invoice and the payment, even if the company of the sales order is A and I'm logged into the company B with the company A enabled. 4/ Currently, if I click on a button on a notification email (example 'View Task'), I face a traceback if I'm not logged into the company of the record. Now, if you click on a button and if you have access to the record, the correct company will be automatically set. 5/ If I display a kanban view with several records from several companies (and an image), all the images should be displayed. 6/ Currently if you copy paste an url, this will crash if you're not in the correct company. This won't be fixed because it's quite impossible to do it in a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into the correct company, re-copy/paste -> Ok. 7/ 2 property methods have been added on the environment to retrieve the company on which the user is logged in and the companies the user enabled, on a specific tab. That way, when creating a record, instead of doing default=lambda self: self.env.user.company_id do default=lambda self: self.env.company_id On the other hand, to retrieve the enabled companies, do companies = self.env.company_ids 8/ Modify the Company Switcher widget to allow to log into another company WITHOUT writing on the res.users (and thus bringing cache invalidation issues and so on). Also allow to enable several companies and see records from several companies, and independantly of the other browser's tabs. 9/ When focusing on a tab, save the current company configuration on the local storage. That way, when doing 'CTRL+T' or a middle click, the context is propagated to the new tab. 10/ Improve the error message in case of multi company access errors. Now, when the user is in debug mode, display the related names of the records and the name of the user who brings the issue. 11/ Remove the context erasing when writing on a res.users This is probably coming from the migration to new API of the base module. The context was not propagated at this moment, which was a common mistake at that time. When migrating the module, probably by using the 'black box' method, as the context was not propagated, it was erased on the new version. This is now an issue because the context (i.e. the enabled companies) was erased when writing on a res.users, leading to tracebacks. See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624 12/ Fix the crash manager on redirect warnings. The issue is the following - Create an invoice on a company without a configured CoA. - Set a partner - On the onchange_partner_id, a redirect warning is raised to propose you to configure a CoA - Click on 'Go to the configuration panel' - A generic warning says something like 'Do you want to discard your changes?' - Click on yes, the page refreshes, but not on the redirect action. Now, set correctly the action on the hash, and reload instead. The breadcrumb is lost for example, but you reach the correct action at least. 13/ Introduce a res.group to enable/disable the multi company per tab feature. 14/ To help the users to know which tab is in which company, add the possibility to have a favicon per company. When creating a company, the classical 'O' icon is colored by default in a random color. 15/ Remove the company switcher on the frontend. This was mainly there to allow a user to swicth to the company linked to the website. This behavior is now transparent to the user. If the website A is activated, then the company set on the context is the company of the website. 16/ Deprecated the _company_default_get method on the res.company model. Remove the method _get_company on the res.users model. 17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval context. You can now use those variables on domains in the views to access directly to the activated company.ies on the current tab. TaskID: 1960971 closes odoo/odoo#32341 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-03-05[IMP] base,*: Reorganize access rights groupsjbm-odoo
Purpose ======= Access group terminology is missleading. Yous have to be manager to administrate an application. This task consists to rename groups to be understandable for everyone. Groups should be reorganised on the users form to be more explicit. Specification ============= 1/ Rename 'Manager' to 'Administrator' in users groups. 2/ Define a hierarchy on access groups by using the category_id in the manifests A category 'Operations/Project' will create a category Project with a parent category 'Operations', and something smart is already developed (in modules/db.py) to avoid duplicating categories. 3/ Add a group in expenses to be able to approve expenses reports for my team. 4/ Add a group in timesheets to be able to approve timesheets for my team. 5/ Remove partially the useless crap in ir_module_category_data.xml 6/ Sort access rights groups on users form according to its parent category closes odoo/odoo#29362 Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-02-22[MERGE] forward port branch saas-12.1 up to 0f4abc5c228Christophe Simonis
2019-02-18[FIX] hr: Add a multi company ir.rule on hr.employee modelYannick Tivisse
2018-12-18[IMP] hr: add onboarding/offboarding activity planningsRomainLibert
Purpose ======= Give the possibility to elaborate plans through Odoo. For instance, in HR, you could create an onboarding plan when a employee is created. Someone manages laptop and other equipment, someone check hr stuff, ... This feature is generic but in a first time we will apply it only on the hr module. Ease HR process in a company by creating plans: a plan is an assembly of Next Activities that will be launched together whenever you need it. Example of plan for an employee onboarding: Activity: Prepare materials Responsible: Alain Deadline: At the contract signature Activity: Manage Cars Responsible: Cécile Deadline: at the contract signature (both signature) Activity: Plan Training Responsible: Caroline Deadline: After signature Activity: Training Responsible: Employee Deadline: 1 week after the employement date Specifications ============== On HR Configuration: Add a menu "Activity Plans" Activity plan object: - Name - Model (debug mode) (hr by default) - Activity Template o2m - Activity Type (only the one related to hr) - Deadline (come from Activity Type) - Responsible \/ 0 Coach 0 Manager 0 Other [Responsible_name] \/ (coach, manager or manually set if other) Add datas, 2 plans: Onboarding - Name: Onboarding - Plan lines: Activity: Setup IT Materials Responsible: [a user] (manager) Deadline: At the contract signature Activity: Plan Training Responsible: [manager] Deadline: After signature Activity: Training Responsible: [Employee] Deadline: 1 week after the employement date Offboarding - Name: Onboarding - Plan lines: Activity: Compute Out Delais Responsible: [a user] (manager) Deadline: today Activity: Take Back HR Materials Responsible: [manager] Deadline: today Activity: Manage Car Responsible: [manager] Deadline: today When to trigger it ? HR specific use case: 1/ On employee, from the employee chatter: when you create an employee, Odoobot will log a note with the following message: "Congratulations ! May i recommand you to setup an onboarding plan?", with a link create a plan from it. 2/ Add a button 'launch plan' to open a wizard to select the plan 3/ When archive an employee Open a wizard with: - Reason (selection) - Action plan (m2o not required) Error if employee not linked to a user. Task : 1912681 closes odoo/odoo#29151
2018-08-27[MERGE] forward port branch saas-11.4 up to a5187cef107Christophe Simonis
2018-08-23[IMP] base: add regular user admin as uid 2Raphael Collet
User 1 simply becomes a technical user (inactive, no password).
2018-08-23[IMP] hr: rephrase help messageMartin Trigaux
Courtesy of Yenthe Van Ginneken
2018-08-15[FIX] hr: security - an officier is an employee/internal userJeremy Kersten
Tests from hr_recruitments work luckily until now. Because module maintenance imply base.group_user for group_equipment_manager <record id="group_equipment_manager" model="res.groups"> ... <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> </record> and module hr_maintenante imply group_equipment_manager for hr_user <record id="hr.group_hr_user" model="res.groups"> <field name="implied_ids" eval="[(4, ref('maintenance.group_equipment_manager'))]"/> </record> After this commit launch test on hr_recruitment module without any other module will works. Design-theme repo show this error because repo tests hr_recruitment without installing maintenance (Repo install website_* modules -> website_hr_recruitment -> hr_recruitment -> hr)
2018-05-04[IMP] base: Add support for private addressesYannick Tivisse
Purpose ======= Add the possibility to create private addresses, only accessible for a subset of users. Specification ============= - Add a new 'Private' partner type - Add a res.groups in base 'Access to Private Addresses' - Add ir.rules for the following behavior: - Every employees/internal users can read non-private addresses - Only users in group_private_addresses can access private addresses - Add in base a simplified form view for private addresses - A HR Officer is automatically granted in group_private_addresses - Use the simplified form view to open the address_home_id form on employees
2018-04-26[IMP] *: Define groups on res.users modelsYannick Tivisse
The reified view on the res users will be dropped in the following commit. The previous commit adds support to define each group as a computed field on the res users. This commit defines: - A boolean field for each 'isolated' res.group, i.e. a group in the hidden category. - A selection field for each 'Application' res.group, i.e. a group in a application category. Example: - The group to manage pricelist in sales becomes a boolean field - The groups project user/manager become a selection field
2017-12-13[IMP] hr,mail: adapt tooltip message to new field values and fix a typoViral Thakar
2017-10-02[IMP] hr: remove useless group descriptionMartin Trigaux
The group is in base, this is where the group should be described. Manage your "own stuff" is probably not very informative anyway.
2017-01-26[FIX] hr_attendance, hr_*: move group_hr_attendance to hr_attendanceDenis Vermylen
move group_hr_attendance from hr -> hr_attendance where it belongs.
2016-09-02[FIX] all: remove external ids fakely from baseMartin Trigaux
Several modules defines records with the external ID `base.foo_bar` while it is created inside this module (typically menus and groups). While there is no technical reasons to do so but this may introduce issues: - these records will not be deleted during uninstall - if a language is loaded before the installation of the module, it won't be translated The uninstallation will only remove the records with an external id linked to this module (these would only be removed when removing base). Installing a language before the module will drop the translations not linked to an existing external id (as it can not be resolved). This commit correct all the external ids tagged as from base or other incorrect modules.
2016-08-23[IMP] base_setup: Allow the admin to modify the default user acess rightsYannick Tivisse
Add a link in the general settings to access easily the default_user form view in order to modify the default access rights The default_user manager rights declarations in all the applications have been move in a noupdate="1" definition to avoid the manual configuration overwrittings
2016-04-13[MIGR] hr : migrate to new apiRavi Gohil
- Rewrite the code to new api without changes business behavior - Remove old v7 backward compatibility method - Regroup view definitions in the same xml file - Use read_group for computed fields
2015-11-20[IMP] Newly created users get all manager access rightYannick Tivisse
Coming from a bug in web_settings_dashboard. Invited user didn't have any rights when created from the dashboard, which was leading to an error. This bug leaded to a new discussion. Better to have basic employee having user rights for all main applications. For bigger entreprises there is an admin that will carefully remove extra rights, if necessary. The target is small businesses, it makes sense that every way to create a user gives the same result. In conclusion, each new user has a full access to the applications by default How is it implemented ? We added an inactive default user which original access right to the groups 'base.group_user' and 'base.group_partner_manager' in base. Each application will extend the default user's access right by adding the maximal access right for this application. On user creation, we will use by default the 'group_id' field from the default user. We will in the same time remove the ugly 'default_groups_ref' key which was passed sometimes in the context for some fields in some views, and sometimes nothing. So, the user can modify the access rights for the default user, but he should be aware that removing project user access rights for a default user will prevent a *created on the fly in a task* user will not be able to access the task.
2015-06-23[IMP] employees form view : Usability improvementsYannick Tivisse
- remove otherid field from the model, and the reports - reorganize several fields on the form - removed group_multi_department group, departments are always activated, as 3 departments are now in the datas - departments menuitem is accessible to the hr officers and managers only - removed all the configurations in the employee root menu - moved payroll country module selection to payroll configuration - removed useless fields from the form : attendance state, goals_ids, remaining leaves, as they are accessible via stat buttons, kanban views, etc. Conflicts: addons/hr/hr_view.xml addons/hr_holidays/hr_holidays_view.xml
2015-06-09Revert "[IMP] HR Usability cleaning"Thibault Delavallée
This reverts commit 79c338dcb352be3d40118f998a76e1b7576a35da. This commit has been done hastily without review. Moreover it mixes changes related to different stuff. The commit is then reverted to allow a propre review and cleaning of the branch.
2015-06-09[IMP] HR Usability cleaningYannick Tivisse
2015-03-31[IMP] config: various improvementsGaurav Panchal
- sales_team: demo data enable sales team features to users - hr_attendance: admin can enable attendance features from hr settings - multi_company: if admin enable these features, she gets the multi-company usability settings - account: enabling multi-currency functionalities enable pricelist functionalities
2015-02-25[IMP] hr_department: new kanban view for HR Departments.dka-odoo
hr add a simple kanban view that is updated by the various hr modules. Each module adds statistics and links in the kanban vignette, either in a to do or to approve column. The department kanban view can be seen as a small dashboard to have the main data about the department displayed. Links allow the HR manager to be redirected towards the various things to do or to approve in its department.
2013-04-29[REM] bunch of nonsensical @model + @refXavier Morel
bzr revid: xmo@openerp.com-20130429124333-p1h11fpy04y3sljy
2012-12-19[MERGE] Harmonization of noupdate flag on security XML data, courtesy of ↵Olivier Dony
Alexis de Lattre (Akretion) ir.rule records are in noupdate data blocks to let the admin alter them without fear of them being reset at next update. Other records such as groups are in normal mode, so they can be updated whenever necessary bzr revid: odo@openerp.com-20121218232001-t425t4hi7qbmsip2
2012-09-06[FIX] sale,hr: tips on user groupsHarry (OpenERP)
bzr revid: hmo@tinyerp.com-20120906064936-qrckr0avzpjpm4m4
2012-09-06[MERGE]Harry (OpenERP)
bzr revid: hmo@tinyerp.com-20120906054754-0ia4w343p38gqv26
2012-08-31[MERGE] Merged HSA's branch to add currency field on accounting config ↵pso (OpenERP)
wizard and to improve tooltip bzr revid: pso@tinyerp.com-20120831125842-m0ioafazvs1h47gq
2012-08-31[IMP]Add multi currency field and tooltip messages are addHardik
bzr revid: hsa@tinyerp.com-20120831084455-fnugi1p4q6hwb5r3
2012-07-13Harmonize the noupdate flag on security XML files :Alexis de Lattre
- ir.rule objects are noupdate="1" - all other objects are noupdate="0" bzr revid: alexis@via.ecp.fr-20120713170838-pjsysliyt6twazrc
2012-05-31[IMP] change the group nameKuldeep Joshi (OpenERP)
bzr revid: kjo@tinyerp.com-20120531071155-07paq206kiqrifd5
2012-04-04[IMP] groups: remove auto-inclusion of admin in groups, and make the ↵Raphael Collet
inclusion explicit in groups bzr revid: rco@openerp.com-20120404090830-nteimn2kvz8nkk7h
2012-03-07[FIX] hr: remove referecne of res.partner.addressBhumika (OpenERP)
bzr revid: sbh@tinyerp.com-20120307052100-ylqekp6w7xe72ucd
2011-12-13[MERGE] trunk-user-groups-rco: add category_id to groupsRaphael Collet
bzr revid: rco@openerp.com-20111213141949-ohvn0c9iq6tcl7jj
2011-12-12[IMP] Security Rule: removed duplicates due to inheritancies of groupsFabien Pinckaers
bzr revid: fp@tinyerp.com-20111212181113-mhnnbps3ip8ls6pp
2011-12-12[IMP] hr, idea, knowledge, lunch: add group categoriesRaphael Collet
bzr revid: rco@openerp.com-20111212134938-xwfnq4d3ks1awuu9
2011-09-16[MERGE] branch merged with lp:openobject-addonsMeera Trambadia (OpenERP)
bzr revid: mtr@tinyerp.com-20110916054138-93b3caomaij5dyp4
2011-08-24[FIX] hr: HR Officer group should imply HR Employee groupOlivier Dony
Failure to have this dependency means that the drop-down for HR permissions on the user will always only show Employee even if the user also has Officer/Manager access bzr revid: odo@openerp.com-20110824151143-cysnlvetzrvqrfs2
2011-08-15[IMP] Improved bank account management, report footer, stages by default on ↵fp
projects bzr revid: fp@fp-laptop-20110815142141-938zg1laoe8wtbkd
2011-08-02add group implicationsRaphael Collet
bzr revid: rco@openerp.com-20110802130811-pkdmw43ufifz0tpj
2011-06-08[FIX] analytic,hr,hr_evaluation,hr_expense,hr_recruitment: added ↵mtr
multi-company access rules lp bug: https://launchpad.net/bugs/788139 fixed bzr revid: mtr@mtr-20110608072935-blig6ejq1oa36un5
2011-04-08[IMP] hr: replaced marital.status object by a fields.selection to ease to ↵Quentin (OpenERP)
use in payroll module bzr revid: qdp-launchpad@openerp.com-20110408163116-3qmhc4phurtpuzmf
2011-02-16[IMP]: hr related changesksa (Open ERP)
bzr revid: ksa@tinyerp.co.in-20110216084531-xr94jx9116ns3qyh
2011-01-28[FIX] hr, access rights: a simple employee should be able to see the list of ↵qdp-launchpad@tinyerp.com
departments bzr revid: qdp-launchpad@tinyerp.com-20110128092939-u6lpij6zexv6qztl
2010-12-29[IMP] removed contract tab in employee form view + fixed holidays shortcutFrançois Degrave
bzr revid: fde@openerp.com-20101229161029-o5cko7yu1sf3li45
2010-12-29[IMP] HR access rightsFrançois Degrave
bzr revid: fde@openerp.com-20101229074726-3iucy5o1886n9y9e