Make project status configurable
issue7746 review64411002
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ The methods are:
|
||||
|
||||
- Manual: Tryton doesn't create any invoice.
|
||||
- On Effort: The invoices are created based on the *Effort* hours for all
|
||||
children works in state *Done*.
|
||||
children works with 100% progress.
|
||||
- On Progress: The invoices are create proportionally to the *Progress* of the
|
||||
*Effort* hours of each children work.
|
||||
- On Timesheet: The invoices are created based on the timesheets encoded on all
|
||||
|
||||
@@ -137,7 +137,7 @@ Check project duration::
|
||||
|
||||
Do 1 task::
|
||||
|
||||
>>> task.state = 'done'
|
||||
>>> task.progress = 1
|
||||
>>> task.save()
|
||||
|
||||
Check project duration::
|
||||
@@ -164,9 +164,9 @@ Invoice project::
|
||||
Do project::
|
||||
|
||||
>>> set_user(project_user)
|
||||
>>> task_no_effort.state = 'done'
|
||||
>>> task_no_effort.progress = 1
|
||||
>>> task_no_effort.save()
|
||||
>>> project.state = 'done'
|
||||
>>> project.progress = 1
|
||||
>>> project.save()
|
||||
|
||||
Check project duration::
|
||||
|
||||
@@ -95,9 +95,9 @@ Check project duration::
|
||||
|
||||
Do project and subproject::
|
||||
|
||||
>>> subproject.state = 'done'
|
||||
>>> subproject.progress = 1
|
||||
>>> subproject.save()
|
||||
>>> project.state = 'done'
|
||||
>>> project.progress = 1
|
||||
>>> project.save()
|
||||
|
||||
Check project duration::
|
||||
|
||||
@@ -159,12 +159,12 @@ Invoice project::
|
||||
>>> project.invoiced_amount
|
||||
Decimal('50.00')
|
||||
|
||||
Do 75% of task and 100% of project::
|
||||
Do 75% of task and 80% of project::
|
||||
|
||||
>>> set_user(project_user)
|
||||
>>> task.progress = 0.75
|
||||
>>> task.save()
|
||||
>>> project.progress = 1.
|
||||
>>> project.progress = 0.80
|
||||
>>> project.save()
|
||||
|
||||
Check project duration::
|
||||
@@ -172,7 +172,7 @@ Check project duration::
|
||||
>>> project.reload()
|
||||
>>> project.invoiced_duration == datetime.timedelta(0, 9000)
|
||||
True
|
||||
>>> project.duration_to_invoice == datetime.timedelta(0, 8100)
|
||||
>>> project.duration_to_invoice == datetime.timedelta(0, 7380)
|
||||
True
|
||||
>>> project.invoiced_amount
|
||||
Decimal('50.00')
|
||||
@@ -181,9 +181,9 @@ Invoice again project::
|
||||
|
||||
>>> set_user(project_invoice_user)
|
||||
>>> project.click('invoice')
|
||||
>>> project.invoiced_duration == datetime.timedelta(0, 17100)
|
||||
>>> project.invoiced_duration == datetime.timedelta(0, 16380)
|
||||
True
|
||||
>>> project.duration_to_invoice
|
||||
datetime.timedelta(0)
|
||||
>>> project.invoiced_amount
|
||||
Decimal('95.00')
|
||||
Decimal('91.00')
|
||||
|
||||
@@ -143,7 +143,7 @@ class Work(metaclass=PoolMeta):
|
||||
@staticmethod
|
||||
def _get_duration_to_invoice_effort(works):
|
||||
return dict((w.id, w.effort_duration) for w in works
|
||||
if w.state == 'done' and not w.invoice_line and w.effort_duration)
|
||||
if w.progress == 1 and not w.invoice_line and w.effort_duration)
|
||||
|
||||
@staticmethod
|
||||
def _get_duration_to_invoice_progress(works):
|
||||
@@ -485,7 +485,7 @@ class Work(metaclass=PoolMeta):
|
||||
|
||||
if (not self.invoice_line
|
||||
and self.effort_hours
|
||||
and self.state == 'done'):
|
||||
and self.progress == 1):
|
||||
if not self.product:
|
||||
raise InvoicingError(
|
||||
gettext('project_invoice.msg_missing_product',
|
||||
|
||||
Reference in New Issue
Block a user