Make project status configurable

issue7746
review64411002
This commit is contained in:
Cédric Krier
2020-01-28 11:45:54 +01:00
parent 37cd94b62a
commit 714ca2070b
5 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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::
+5 -5
View File
@@ -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')
+2 -2
View File
@@ -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',