Project¶
-
class
moco_wrapper.models.
Project
(moco)¶ Class for handling projects.
-
archive
(project_id: int)¶ Archive a project.
Parameters: project_id (int) – Id of the project to archive Returns: The archived project Return type: moco_wrapper.util.response.ObjectResponse
-
assigned
(active: bool = None)¶ Get list of all project currently assigned to the user.
Parameters: active (bool) – Show only active or inactive projects (default None
)Returns: List of project objects Return type: moco_wrapper.util.response.ListResponse
-
create
(name: str, currency: str, leader_id: int, customer_id: int, deal_id: int = None, finish_date: datetime.date = None, identifier: str = None, billing_address: str = None, billing_email_to: str = None, billing_email_cc: str = None, billing_notes: str = None, setting_include_time_report: bool = None, billing_variant: moco_wrapper.models.project.ProjectBillingVariant = None, hourly_rate: float = None, budget: float = None, tags: list = None, custom_properties: dict = None, info: str = None, fixed_price: bool = False)¶ Create a new project.
Parameters: - name (str) – Name of the project
- currency (str) – Currency used by the project (e.g. EUR)
- leader_id (int) – User id of the project leader
- customer_id (int) – Company id of the customer
- deal_id (int) – Deal id the the project originated from
- finish_date (datetime.date, str) – Finish date (default
None
) - identifier (str) – Project Identifier (default
None
) - billing_address (str) – Billing address the invoices go to (default
None
) - billing_email_to (str) – Email address to send billing email to (default
None
) - billing_email_cc (str) – Email address to cc in billing emails (default
None
) - billing_notes (str) – Billing notes (default
None
) - setting_include_time_report (bool) – Include time report in billing emails (default
None
) - billing_variant (
ProjectBillingVariant
, str) – Billing variant used (defaultNone
) - hourly_rate (float) – Hourly rate that will get billed (default
None
) - budget (float) – Budget for the project (default
None
) - tags (list) – Array of additional tags (default
None
) - custom_properties (dict) – Custom values used by the project (default
None
) - info (str) – Additional information (default
None
) - fixed_price (bool) – If the project is a fixed price projects (default
False
)
Returns: The created project object
Return type: Note
The parameter
identifier
is required if number ranges are manual.Note
If you create a project with
fixed_price = True
,budget
also has to be specified
-
destroy
(project_id: int)¶ Deletes a project. Only possible if there are no activities, invoices, offers or expenses
Parameters: project_id (int) – Id of the project to delete Returns: Empty response on success Return type: moco_wrapper.util.response.EmptyResponse
Note
Deleting a project is only possible if there are no acitivities, invoices offers or expenses
-
static
endpoints
() → List[moco_wrapper.util.endpoint.endpoint.Endpoint]¶ Returns all endpoints associated with the model
Returns: List of Endpoint objects Return type: moco_wrapper.util.endpoint.Endpoint
-
get
(project_id: int)¶ Get a single project.
Parameters: project_id (int) – Id of the project Returns: Project object Return type: moco_wrapper.util.response.ObjectResponse
-
getlist
(include_archived: bool = None, include_company: bool = None, leader_id: int = None, company_id: int = None, created_from: datetime.date = None, created_to: datetime.date = None, updated_from: datetime.date = None, updated_to: datetime.date = None, tags: list = None, identifier: str = None, sort_by: str = None, sort_order: str = 'asc', page: int = 1)¶ Get a list of projects.
Parameters: - include_archived (bool) – Include archived projects (default
None
) - include_company (bool) – Include the complete company object or just the company id (default
None
) - leader_id (int) – User id of the project leader (default
None
) - company_id (int) – Company id the projects are assigned to (default
None
) - created_from (datetime.date, str) – Created start date (default
None
) - created_to (datetime.date, str) – Created end date (default
None
) - updated_from (datetime.date, str) – Updated start date (default
None
) - updated_to (datetime.date, str) – Updated end date (default
None
) - tags (list) – Array of tags (default
None
) - identifier – Project identifier (default
None
) - sort_by (str) – Field to sort the results by (default
None
) - sort_order (str) – asc or desc (default
"asc"
) - page (int) – Page number (default
1
)
Returns: List of project objects
Return type: - include_archived (bool) – Include archived projects (default
-
report
(project_id: int)¶ Retrieve a project report.
Parameters: project_id (int) – Id of the project Returns: Report with the most important project business indicators Return type: moco_wrapper.util.response.ObjectResponse
Note
All costs are in the accounts main currency, it might differ from the budget and billable items.
-
unarchive
(project_id: int)¶ Unarchive a project.
Parameters: project_id (int) – Id of the project to unarchive Returns: The unarchived project Return type: moco_wrapper.util.response.ObjectResponse
-
update
(project_id: int, name: str = None, leader_id: int = None, customer_id: int = None, deal_id: int = None, finish_date: datetime.date = None, identifier: str = None, billing_address: str = None, billing_email_to: str = None, billing_email_cc: str = None, billing_notes: str = None, setting_include_time_report: bool = None, billing_variant: moco_wrapper.models.project.ProjectBillingVariant = None, hourly_rate: float = None, budget: float = None, tags: list = None, custom_properties: dict = None, info: str = None)¶ Update an existing project.
Parameters: - project_id (int) – Id of the project to update
- name (str) – Name of the project (default
None
) - leader_id (int) – User id of the project leader (default
None
) - customer_id (int) – Company id of the customer (default
None
) - deal_id (int) – Deal id of the project (default
None
) - finish_date (datetime.date, str) – Finish date (default
None
) - identifier (str) – Project Identifier (default
None
) - billing_address (str) – Address the invoices go to (default
None
) - billing_email_to (str) – Email address to send billing emails to (default
None
) - billing_email_cc (str) – Email address to cc in billing emails (default
None
) - billing_notes (str) – Billing notes
- setting_include_time_report (bool) – Include time reports in billing emails
- billing_variant (
ProjectBillingVariant
, str) – Billing variant used (defaultNone
) - hourly_rate (float) – Hourly rate that will get billed (default
None
) - budget (float) – Budget for the project (default
None
) - tags (list) – Array of additional tags (default
None
) - custom_properties (dict) – Custom values used by the project (default
None
) - info (str) – Additional information (default
None
)
Returns: The updated project object
Return type:
-
-
class
moco_wrapper.models.project.
ProjectBillingVariant
¶ Enumeration for allowed values of the
billing_variant
argument ofProject.create()
andProject.update()
.Example usage:
from moco_wrapper.models.project import ProjectBillingVariant from moco_wrapper import Moco m = Moco() new_project = m.Project.create( .. billing_variant = ProjectBillingVariant.USER )
-
PROJECT
= 'project'¶
-
TASK
= 'task'¶
-
USER
= 'user'¶
-