The open_action_with_context was not using _for_xml_id, producing an
error when reading the action content.
In open_action, the action_name was taken from the context and needs
sanity checks. Ensure only actions from the account module can be
read and only if the user has access to the target model.
This is a limitation of the previous behaviour but, at the moment, all
known calls are made refering to an action from the account module.
Limit the scope of this method while the 14.0 is still early to avoid
having a door open to ready any action, and difficult to close later.
Remove old action fetching from the context in create_move that is no
longer used.
closesodoo/odoo#61602
X-original-commit: a39e94f7e4dc74e850650ac90bbc5f85af130bc8
Related: odoo/enterprise#14695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Xavier Morel <xmo@odoo.com>
Purpose
=======
Some fields weren't editable, even when the option is enabled on
the settings.
closesodoo/odoo#57842
X-original-commit: 57d595e87642fa6f7bec62cbb88a39c35cc72589
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Remove the employee's image by default to avoid unnecessary image storage.
Add a placeholder in the kanban view.
closesodoo/odoo#55243
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Right now on few business objects (like leads, invoices, tasks, helpdesk
tickets etc) creation message contains
* subtype description;
* generic creation message;
This looks like multiple creation message on chatter after creation of the
record as you generally have "Task Created - Task created" (subtype description
then generic message).
This happens when we provide custom subtype on creation by by overriding
`_creation_subtype` method.
This commit fixes the issue by only using provided creation subtype and
removing default body. If creation subtype is not provided default creation
message is posted as before.
In this commit we also fix subtype for Lead/Opportunity creation and make
it generic ('Lead/Opportunity created') to avoid inconsistent behavior.
Finally some cleaning is made in method naming. Semi followup of 92e9e84b63
LINKS
Task ID-2288458
PR odoo/odoo#56631
PR odoo/enterprise#12707closesodoo/odoo#56688
X-original-commit: 2ebbeb4b5443c6405dd9a3b202a1eee9c5c67ebb
Related: odoo/enterprise#12728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Since v13 some commits added code in mail thread file. This file is already
quite long and keeping it organized allow to understand its content.
SPECIFICATIONS
Some methods defined on mail.thread may actually be called on models
not inheriting from mail.thread . Instead of having model methods on mail
thread receiving a records parameter it seems better to have those available
directly on BaseModel.
Move static_message_track on BaseModel in models.py. This method is now called
_mail_track, to be coherent with othe rmail-related naming. It is used in
accounting to track values in line model that does not inherit from mail.
thread. Update accounting accordingly (followup of d862965).
Move _message_get_default_recipients_on_records in models.py. Renaming it
_message_get_default_recipients() allow to be compatible with current behavior
and current override available in some addons (like CRM, event, ...).
Move _notify_get_reply_to_on_records in models.py. Renaming it
_notify_get_reply_to() allows to be shorter and coherent.
Move _alias_check_contact_on_record in models.py. Renaming it
_alias_check_contact_() allows to be shorter and coherent. Its override in
hr is also moved on BaseModel.
LINKS
Task ID-2327096 (code cleaning)
PR #56631
X-original-commit: f5df1ed912455e5ed52a65df3149f30a9d424de0
Currently, Due to _compute_phones method when going to read
the work_phone and mobile_phone from salary configurator then
it will randomly failed on read access right for those two fields.
So in this commit, Defined the _compute_phones method properly and
remove the compute from mobile_phone as it's not computed anymore.
TaskID: 2283753
Closes: #56205
Make the method `_search` return a `Query` object, and make that object
generate a subquery when used on the right-hand side of a condition.
closesodoo/odoo#52403
Related: odoo/enterprise#10945
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.
Add sudo for other operations on ir.actions.*
Added a new tour for the module hr_recruitment
Hr.job:
Form view:
- Using a notebook view for increased clarity
Kanban view:
- Added a toggle button to publish/unpublish a job offer.
- In the menu, added the « Create Interview Form » button to create an interview form.
Hr.applicant:
Generale:
- Use of the "Applicant: Acknowledgement" template by default when an application is moved to the "First Interview" stage.
Form view:
- Possibility to consult an interview after this one and not before
- The "CREATE EMPLOYEE" button no longer directly creates an employee. The employee will be created if the "SAVE" button is pressed.
Hr.employee:
Generale:
- Added of two new certifications.
And some other minor style and name changes.
closesodoo/odoo#55928
Related: odoo/enterprise#12420
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
On the dashboard of Time Off (calendar view), the banner displaying
the remaining leaves is not shown as _get_contextual_employee_id
of hr_leave_type.py is returning False due to the missing required
on the company_id of hr.employee.
A fix was made in 2bd5e9a but missing the part that the employee_id
is not required. Confirmed by YTI
close opw-2252479
closesodoo/odoo#53109
Related: odoo/upgrade#1596
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Make the employee presence icons more descriptive.
Allow to quickly filter the Presence Reports based on the user status.
closesodoo/odoo#54527
Taskid: 2246447
Related: odoo/upgrade#1488
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Improve slightly the layout of some forms related to employee and contracts.
Modified modules:
hr
hr_expense
hr_holidays
timesheet_grid
hr_contract_salary
hr_payroll_account
Task ID 2277298
closesodoo/odoo#52981
Related: odoo/enterprise#11156
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose of the task is to improve the employee image and phone
behaviour while changing the user.
So in this commit, IF there is no pitcure on employee then apply the
image of user while adding the user to employee from cretae, write
and onchage. do not change the employee image if employee image is
already set while creating employee or changing the user on employee.
Also improve the phone behaviour when changing the company,
- Never change the mobile_phone when switching the company
on employee
- Always change the work_phone when switching the company, except
if empty on res.company.
closes odoo/odoo#50115
Taskid: 2240167
Closes: #50115
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))
Old syntax is still compatible but starts the migration to the new
syntax that catches error.
Issue
- Open console in debugger of the browser.
- Install "Employees" app
- Go to "Employees" and edit or create any employee
- In 'Department' field, quick create one
Error is raised in console and the modal department form view is opened.
Cause
'name' field is required but empty since 'complete_name'
is the one set as _rec_name in 'Department' python model.
Solution
Cherry-pick of 7c0fed48a1
opw-2267356
closesodoo/odoo#52489
X-original-commit: 056618914e9f1f437f8855459c302fc0ac6663c5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Purpose
=======
On the Employees App, we dont have a smart way to start a discuss
with a colleague or an employee.
Specification
=============
Style for each button :
- use fa-comments
- use primary color/action color (green)
On private/public employees form/kanban views, add a button to
start a chat with the user
closesodoo/odoo#51484
Taskid: 2252207
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
By using the user's related company to create a employee, we prevent
creating several employees for the same users on the basic flow.
But this is exactly the way we want people to use the system.
Example: Jojo is working in Belgium, has a belgian employee liked
to a belgian user in the system.
Now Jojo is about to work during 1 year in another company, based in
the USA. Jojo wants another employee, to manage the HR things
properly (payroll, ...), but he doesn't want to have 2 users, he
prefer to manage all its notifications in the same place.
We create another employee for Jojo, in the US company.
So instead of creating the employee in the user's company (Belgian),
as it would raise an error for the second employee, we should use the
contextual company instead, allowing to create the second employee
smoothly.
closesodoo/odoo#51435
X-original-commit: 0318f0acc5e98950c274c90a86a94d4588d2966d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, Creating New Employee from User's form was taking default company from the current logged-in User instead of the User for which it Employee is being created.
With this commit, We take default company from User for which employee is created.
closesodoo/odoo#51014
X-original-commit: 9206cc4db2a8dc5a7fbc281c1574f09bfba76544
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
For a tag to be displayed on a kanban card, it needs to have a color set.
We won't be changing that behaviour, since it would mean having
two options > the color, and whether or not to show it in the kanban
The purpose of this task is to set a color on new tags to make the user
save a bit more time, set a color for him as he might not find the feature,
and make sure the tag will be on the kanban cards.
Specification
=============
For each of the following models, at creation, set a random integer between
1 and 11 in field 'color'
Models:
res.partner.category
crm.tag
project.tags
hr.applicant.category
helpdesk.tag
hr.employee.category
event.track.tag
mrp.eco.tag
repair.tags
closesodoo/odoo#49967
Taskid: 2234527
Related: odoo/enterprise#10112
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Impacted modules: account_analytic_default, crm, event,
hr_recruitment, maintenance, mass_mailing, project,
purchase_requisition, stock_picking_batch, website_slides
The default image displayed when the record is unassigned is
confusing, so we are removing it.
FP request
Task 2234524
closesodoo/odoo#49333
Related: odoo/enterprise#9834
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, It was not possible to copy An employee which is already linked to User due `user_uniq` constraints.
Now we add `copy=False` on `user_id` field, so Employee will be copied without linked User.
closesodoo/odoo#49915
X-original-commit: 2a63df03859166414be338c6655ee8c4052666b7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Impacted modules:
hr, hr_contract, hr_recruitment, hr_payroll, fleet, hr_skills, hr_appraisal, ....
Several onchanges have been converted to computed fields in the following modules :
Community :
- hr
- hr_contract
- hr_recruitment
- hr_work_entry
- hr_maintenance
- hr_expense
- hr_expense_check
- hr_holidays
- sale_expense
- account_analytic_default_hr_expense
Enterprise:
- hr_contract_salary
- hr_referral
- hr_payroll
- hr_payroll_expense
- test_l10n_be_hr_payroll_account
There are still 2 onchanges with complex behavior that couldn't be converted easily:
- an onchange that updates "tz" (timezone) that is defined as a related field
to "resource_id.tz". Apparently it is useless except to initialize the default
value of "tz".
- an onchange that updates "name" that is defined as a related field to
"resource_id.name".
the applicant.
closesodoo/odoo#45414
Taskid: 2169099
Related: odoo/enterprise#8572
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
"Edition" is a French-English false friend word. "Edition" in English
means "version" whereas "edition" in French means "editing". This commit
updates user facing strings/documents that incorrectly use "edition" instead
of "edit" or "editing". Attempts were made to clean up English around
"edition" usage so please excuse any errors from lack of context
knowledge. Code comments and names incorrectly using "edition" were NOT
updated.
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.
This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.
closesodoo/odoo#46325
Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
If employee is not set, the default picture will be user-slash
instead of camera.
Task ID 2221250
closesodoo/odoo#48114
Related: odoo/enterprise#9398
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
PURPOSE
When incoming emails bounce due to alias security bounce email is quite
generic. Purpose of this task is to ease its customization and update.
SPECIFICATIONS
In order to improve the flexibility of alias, add a customizable html field
on the alias model. This html content will be send as bounce email core content
in case of bounced/unauthorized mail received for this alias,
Obviously it has no effect on 'everyone' security setting as no email will
bounce due to that issue.
If it is not set a default generic mail will be send depending on security
setting. It allows to keep void html fields when no specific bounce content
is required
In HR, an old template allowing some light customization for employee based
security option is removed as it is completely replaced by the new feature.
Also add references message-id of the mail received to the answer so that
threads are correctly set.
LINKS
Task ID 2126509
Issue
- Install Employees
- Create a new user
- Click on "Create employee"
Traceback
Cause
In 999ced42989f, we add the user_id key but we
already have in the action_create_employee method
The key is duplicated so this is why there is a
traceback
Solution
Remove the key in action_create_employee since
we have it in _sync_user
OPW-2205354
closesodoo/odoo#46375
X-original-commit: e0c29f1a4cd8d95654963b024fd0b0e1b0578776
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
When creating a new user on-the-fly on the employee detail page (HR Settings/Related User), if the employee is never linked with a user before, the new created user will not be linked with the employee automatically and we have to select the user again.
With this commit, the new created user will be linked with the employee automatically.
Fixes#44442closesodoo/odoo#46125
X-original-commit: 136c0dbea0ab00ff27daac69c27dc0824a16ff70
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose of the task is, when creating a new employee, the default
gender should be empty.
closes odoo/odoo#42843
Taskid: 2165484Closes: #42843
Related: odoo/enterprise#7648
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Followup on 5ce8f1e375
Before this commit, There would be traceback on Launching Plan with `Responsible` set to `other` and No `Responsible Person` defined on activity due to Extra argument.
In this commit, We remove that extra Argument.
closesodoo/odoo#44965
X-original-commit: 009e5526ee398415693d1d3df8f3c2ac546fd258
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In 0.15 accessing werkzeug.urls functions directly through werkzeug
is deprecated, the shortcut will be removed in the eventual werkzeug
1.0.
Fix existing uses of these shortcuts. Also cleanup some imports when
they're not far from a werkzeug* import being altered.
PURPOSE
=======
When you close a payroll (employees), there are often a lot of document
linked. Archiving an employee should archive the contract, cancel future
leaves, archive the private address
Specification
=============
Add departure date (hr):
- Add a Date field to both hr.departure.wizard and hr.employee. In
the wizard, the field is required.
- In toggle_active() method in hr.employee, set departure_date to
false when unarchive the employee.
- If user has a current running contract, a user error will raise if
user enter a departure date earlier than the start date of the
contract.
Add checkbox to set a closing date on hr.contract (hr.contract):
- In the hr.departure.wizard, set the departure date to be the end
date of runing contract. Set the states of all draft contracts to
"cancel".
Add checkbox to free car (hr.fleet):
- In the hr.departure.wizard, set end_date to
fleet.vehicle.assignation.log, if there is no end_date or end_date >
departure_date
- Go through fleet.vehicle, find records with dirver_id to be the
employee, set it to False.
Add checkbox to archive private address (hr):
- when the private address not link to a internel user, set
employee.address_home_id.active to Flase
- unarchive it after the employee unarchived
Add checkbox to cancel future appraisals (hr.appraisal)
- find all appraisals link to the employee and state in
['new', 'pending'], set their state to 'cancel'.
Add checkbox to cancel future leaves (hr.holidays):
- only consider leaves are not in state ['refuse', 'cancel'],
find leaves with to_date > departure_date, set their state to
'cancel'.
PR #42526
Task 2153106
Related: odoo/enterprise#7471
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In Employee / Work information / Responsible: there is a lack of
information on the "help message" The objective is to change text
in the help message by the ones below:
Field "Coach":
-Employee responsible of this employee.
-The "coach" has no specific rignts or responsibilities by default.
Field "Time Off":
-User responsible for approving "time off" of this employee.
-If empty, the approval is done by any administrators or approvers (determinated in settings/users)
Field "expense":
-User responsible for approving "Expenses" of this employee.
-If empty, the approval is done by any administrators or approvers (determinated in settings/users)
TaskId :2168330
closes odoo/odoo#43467
Closes: #43467
Related: odoo/enterprise#7778
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Open Employees>[DEMO]. Go to HR Settings and generate badge id
Now go to POS Settings, enable "Login with Employees". Now open
the session and login by scanning the [DEMO] employee badge.
The badge will not be recognized, this is caused by the fact that the
badge is 8 digits randomly generated, while the parser recognize
cashiers only if the barcode has a prefix of 041.
Fixed the badge id generation, and adjusted the length to other barcodes
in the system
opw-2151942
closesodoo/odoo#43228
X-original-commit: 90bcda64ba6058169b48ff8214e7c2a98eb9a0f8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When we add a user to employee, we can have problem with leave,
expense or coach manager. It's due to those compute fields.
closesodoo/odoo#40795
Related: odoo/enterprise#6865
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Current activity types master data cannot be unlinked through a quite harsh
override of unlink using xml id existence, introduced at 2602642a78.
Some of them are real master data, other could be unlinked if users want it.
Finally custom activity types may cause errors when removed if used in some
side models like server actions or automated actions.
To allow more flexibility we remove the removal constraint and implement
a fallback mechanism. It is implemented in mail.activity.mixin when calling
activity_schedule(xmlid, ...). If the given xmlid is not found
_default_activity_type() specifies the default activity to use. It can
be overridden in modules if some specific behavior is wanted.
e.g.
def _default_activity_type(self):
"""Define a default fallback activity type when xml id not found
only used in in activity_schedule() for now.
"""
try:
return self.env.ref('mail.mail_activity_data_todo')
except Exception:
return False
In this commit we also
* restrict deletion of activity type (hr.plan and ir.actions.server);
* fallback on default activity type if xmlid ref not found in
activity_schedule;
* correct calls to activity_schedule and replace some manual creation calls
by activity_schedule;
Task ID 1961156
PR #39013
Related: odoo/enterprise#6238
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Make some fields editable in multi edit.
Some onchange are tranformed in compute fields.
id=2078674
closesodoo/odoo#39711
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit:
Private email and phone are related of partner 'address' fields.
But the phone was read-only and the email is editable.
After this commit:
As phone and mail are related, they are read-only. We must edit
them on the partner of Address field.
close#38518closesodoo/odoo#38872
X-original-commit: ed6fb25ca0671a520c9d003a58eefefcf93dbc1a
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
Since there are message_post overrides using the form `def message_post(self,
**kwargs)` in some modules, this method is intended to be invoked with keyword
arguments only.
This commit enforces this behavior. Calls such as `message_post("body")` will
fail regardless of which addon is installed, forcing users to use
`message_post(body="body")`.
It also fixes a message_post override in hr, and applies the same
mechanism to message_notify, and _message_log.
closesodoo/odoo#33306
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Move and adapt gantt unavailability related methods (
_get_work_interval() and _get_unavailable_intervals() ) from
hr.employee to resource.resource. This move allows the unavailability
to be generated for users without related employees (like in FSM in
enterprise).
Task-2069861
closesodoo/odoo#36785
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Currently, parent_id is defined on hr.employee. This field
as an onchange defined.
But the inherit of hr.employee.base in the leave module
adds an onchange('parent_id'). The onchange method is never
called because the onchange in hr.employee does not call super
(which it's not supposed to do because the parent model
does not have the parent_id field).
To fix the issue, parent_id and all its onchange methods
are now defined on hr.employee.base