nh_activity¶
-
class
activity.nh_activity(pool, cr)[source]¶ Class representing any event that needs to be recorded by the system.
Any user executed event that has a starting and ending point in time could be represented as an instance of this class.
Most of them will need extra information recorded within them and that is why this class is closely related to the
data modelclasses, which could be also named activity type.-
assign(**kwargs)[source]¶ Sets
user_idto the specified user if allowed by access rights.See
data model assignfor full implementation.Parameters: Returns: TrueReturn type:
-
assign_locked¶
-
cancel(**kwargs)[source]¶ Sets activity
stateto cancelled and records the date and user ondate_terminatedandterminate_uidrespectively. Seedata model cancelfor full implementation.Parameters: activity_id (int) – activityidReturns: TrueReturn type: bool
-
child_ids¶ One2many field; the value of such a field is the recordset of all the records in comodel_name such that the field inverse_name is equal to the current record.
Parameters: - comodel_name – name of the target model (string)
- inverse_name – name of the inverse Many2one field in comodel_name (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - limit – optional limit to use upon read (integer)
The attributes comodel_name and inverse_name are mandatory except in the case of related fields or field extensions.
-
complete(**kwargs)[source]¶ Sets activity
stateto completed and records the date and user ondate_terminatedandterminate_uidrespectively. Seedata model completefor full implementation.Parameters: activity_id (int) – activityidReturns: TrueReturn type: bool
-
create(*args, **kwargs)[source]¶ Creates an activity. Raises an exception if
data_modelisn’t in parametervalsor ifdata_modeldoesn’t exist as a table in the database.Parameters: vals (dict) – must include data_modelkey:value pairRaises: osv.except_osv Returns: id of created activityReturn type: int
-
create_date¶
-
create_uid¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null','restrict','cascade' - auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - delegate – set it to
Trueto make fields of the target model accessible from the current model (corresponds to_inherits)
The attribute comodel_name is mandatory except in the case of related fields or field extensions.
-
created_ids¶ One2many field; the value of such a field is the recordset of all the records in comodel_name such that the field inverse_name is equal to the current record.
Parameters: - comodel_name – name of the target model (string)
- inverse_name – name of the inverse Many2one field in comodel_name (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - limit – optional limit to use upon read (integer)
The attributes comodel_name and inverse_name are mandatory except in the case of related fields or field extensions.
-
creator_id¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null','restrict','cascade' - auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - delegate – set it to
Trueto make fields of the target model accessible from the current model (corresponds to_inherits)
The attribute comodel_name is mandatory except in the case of related fields or field extensions.
-
data_model¶ Very similar to
Charbut used for longer contents, does not have a size and usually displayed as a multiline text box.Parameters: translate – whether the value of this field can be translated
-
data_ref¶
-
date_deadline¶
-
date_expiry¶
-
date_planned¶
-
date_scheduled¶
-
date_started¶
-
date_terminated¶
-
get_recursive_created_ids(*args, **kwargs)[source]¶ Recursively gets ids of all activities created by an activity or all activitie
Parameters: activity_id (int) – id of activity Returns: list of activity ids Return type: list
-
notes¶ Very similar to
Charbut used for longer contents, does not have a size and usually displayed as a multiline text box.Parameters: translate – whether the value of this field can be translated
-
parent_id¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null','restrict','cascade' - auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - delegate – set it to
Trueto make fields of the target model accessible from the current model (corresponds to_inherits)
The attribute comodel_name is mandatory except in the case of related fields or field extensions.
-
schedule(**kwargs)[source]¶ Sets
date_scheduledto the specified date and changes the activity state to scheduled. Seedata model schedulefor full implementation.Parameters: Returns: TrueReturn type:
-
sequence¶
-
start(**kwargs)[source]¶ Sets activity
stateto started.See
data model startfor full implementation.Parameters: activity_id (int) – activityidReturns: TrueReturn type: bool
-
state¶ Parameters: - selection – specifies the possible values for this field. It is given as either a list of pairs (value, string), or a model method, or a method name.
- selection_add – provides an extension of the selection in the case of an overridden field. It is a list of pairs (value, string).
The attribute selection is mandatory except in the case of related fields or field extensions.
-
submit(**kwargs)[source]¶ Updates activity data. See
data model submitfor full implementation.Parameters: Returns: TrueReturn type:
-
summary¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
terminate_uid¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null','restrict','cascade' - auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - delegate – set it to
Trueto make fields of the target model accessible from the current model (corresponds to_inherits)
The attribute comodel_name is mandatory except in the case of related fields or field extensions.
-
unassign(**kwargs)[source]¶ Sets
user_idto False. Only the current owner of the activity is allowed to do this action. Seedata model unassignfor full implementation.Parameters: activity_id (int) – activityidReturns: TrueReturn type: bool
-
update_activity(**kwargs)[source]¶ This method is meant to refresh any real time data that needs to be refreshed on the activity. Does nothing as default. Included for potential utility on some activity types.
Parameters: activity_id (int) – activityidReturns: TrueReturn type: bool
-
user_id¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null','restrict','cascade' - auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - delegate – set it to
Trueto make fields of the target model accessible from the current model (corresponds to_inherits)
The attribute comodel_name is mandatory except in the case of related fields or field extensions.
-
write(*args, **kwargs)[source]¶ Writes to an activity.
sequencewill be updated if the the state of the activity is changed.Parameters: Returns: TrueReturn type:
-
write_date¶
-
write_uid¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null','restrict','cascade' - auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False) - delegate – set it to
Trueto make fields of the target model accessible from the current model (corresponds to_inherits)
The attribute comodel_name is mandatory except in the case of related fields or field extensions.
-