Activity

class activity_extension.nh_activity(pool, cr)[source]

Extends class nh_activity.

cancel_open_activities(*args, **kwargs)[source]

Cancels all open activities associated with the spell_activity_id.

Parameters:
  • spell_act_id (int) – id of the spell activity
  • model (str) – model (type) of activity
  • cancel_reason (nh.clinical.cancel_reason record) – The reason used when cancel activities
Returns:

True if all open activities are cancelled or if there are no open activities. Otherwise, False

Return type:

bool

cancel_with_reason(*args, **kwargs)[source]

Cancel the activity add a cancel reason to it.

Parameters:cancel_reason – Reason for cancelling
Returns:True
Return type:bool
create(*args, **kwargs)[source]

Extends Odoo’s create() method.

Writes user_ids for responsible users of the activities` location.

Parameters:vals (doct) – values to create record
Returns:nh_activity id
Return type:int
update_spell_users(*args, **kwargs)[source]

Updates spell activities with the user_ids of users responsible for parent locations of spell location.

Parameters:user_ids (list) – user ids. See class res_users
Returns:True
Return type:bool
update_users(*args, **kwargs)[source]

Updates activities with the user_ids of users responsible for the activities’ locations.

Parameters:user_ids (list) – user ids. See class res_users
Returns:True
Return type:bool
write(*args, **kwargs)[source]

Extends Odoo’s write() method.

Also writes user_ids for responsible users of the activities’ location. See class nh_clinical_location.

Parameters:
  • ids (list) – nh_activity record ids
  • vals (dict) – values to update records (may include location_id)
Returns:

True

Return type:

bool