Cycle Manager
Cycle Manager#
odoo.addons.g2p_programs.models.managers.cycle_manager
provides the class BaseCycleManager
define the interface
for this manager. DefaultCycleManager
is the default implementation of this class that should be used
in most of the cases.
- class odoo.addons.g2p_programs.models.managers.cycle_manager.BaseCycleManager[source]#
-
- approve_cycle(cycle, auto_approve=False, entitlement_manager=None)[source]#
- Parameters
cycle --
auto_approve --
entitlement_manager --
- Returns
- check_eligibility(cycle, beneficiaries=None)[source]#
Validate the eligibility of each beneficiary for the cycle
- mark_import_as_done(cycle, msg)[source]#
Complete the import of beneficiaries. Base
mark_import_as_done()
. This is executed when all the jobs are completed. Post a message in the chatter.- Parameters
cycle -- A recordset of cycle
msg -- A string to be posted in the chatter
- Returns
- mark_prepare_entitlement_as_done(cycle, msg)[source]#
Complete the preparation of entitlements. Base
mark_prepare_entitlement_as_done()
. This is executed when all the jobs are completed. Post a message in the chatter.- Parameters
cycle -- A recordset of cycle
msg -- A string to be posted in the chatter
- Returns
- class odoo.addons.g2p_programs.models.managers.cycle_manager.DefaultCycleManager[source]#
-
- approver_group_id#
The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
- Parameters
comodel_name (str) -- name of the target model
Mandatory
except for related or extended fields.domain -- an optional domain to set on candidate values on the client side (domain or string)
context (dict) -- an optional context to use on the client side when handling that field
ondelete (str) -- what to do when the referred record is deleted; possible values are:
'set null'
,'restrict'
,'cascade'
auto_join (bool) -- whether JOINs are generated upon search through that field (default:
False
)delegate (bool) -- set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)check_company (bool) -- Mark the field to be verified in
_check_company()
. Add a default company domain depending on the field attributes.
- check_eligibility(cycle, beneficiaries=None)[source]#
Default Cycle Manager eligibility checker
- Parameters
cycle (
g2p_programs.models.cycle.G2PCycle
) -- The cycle that is being verifiedbeneficiaries (list or None) -- the beneficiaries that need to be verified. By Default the one with the state
draft
orenrolled
are verified.
- Returns
The list of eligible beneficiaries
- Return type
Validate the eligibility of each beneficiary for the cycle using the configured manager(s)
g2p_programs.models.managers.eligibility_manager.BaseEligibilityManager
. If there is multiple managers for eligibility, each of them are run using the filtered list of eligible beneficiaries from the previous one.The
state
of beneficiaries is updated to eitherenrolled
if they match the enrollment criteria ornot_eligible
in case they do not match them.
- create_uid#
The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
- Parameters
comodel_name (str) -- name of the target model
Mandatory
except for related or extended fields.domain -- an optional domain to set on candidate values on the client side (domain or string)
context (dict) -- an optional context to use on the client side when handling that field
ondelete (str) -- what to do when the referred record is deleted; possible values are:
'set null'
,'restrict'
,'cascade'
auto_join (bool) -- whether JOINs are generated upon search through that field (default:
False
)delegate (bool) -- set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)check_company (bool) -- Mark the field to be verified in
_check_company()
. Add a default company domain depending on the field attributes.
- display_name#
Basic string field, can be length-limited, usually displayed as a single-line string in clients.
- Parameters
size (int) -- the maximum size of values stored for that field
trim (bool) -- states whether the value is trimmed or not (by default,
True
). Note that the trim operation is applied only by the web client.translate (bool or callable) -- enable the translation of the field's values; use
translate=True
to translate field values as a whole;translate
may also be a callable such thattranslate(callback, value)
translatesvalue
by usingcallback(term)
to retrieve the translation of terms.
- id#
Special case for field 'id'.
- write_uid#
The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
- Parameters
comodel_name (str) -- name of the target model
Mandatory
except for related or extended fields.domain -- an optional domain to set on candidate values on the client side (domain or string)
context (dict) -- an optional context to use on the client side when handling that field
ondelete (str) -- what to do when the referred record is deleted; possible values are:
'set null'
,'restrict'
,'cascade'
auto_join (bool) -- whether JOINs are generated upon search through that field (default:
False
)delegate (bool) -- set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)check_company (bool) -- Mark the field to be verified in
_check_company()
. Add a default company domain depending on the field attributes.