Commit e686db80 authored by Simon Chabot's avatar Simon Chabot
Browse files

feat(schema): add budget_extra and budget_prev attributes

those two new attribute will describe:

- the estimated over/under extra consumption of the budget (eg: we expect to
  consume 10 more days)
- the total budget, that will be used for trajectory computations (which is
  the sum of the budget paid by the client and the budget_extra)

related: https://forge.extranet.logilab.fr/logilab/shingouz/-/issues/44
parent e2570f118e06
Pipeline #91893 passed with stages
in 2 minutes and 35 seconds
......@@ -44,7 +44,7 @@ msgctxt "inlined:Order.split_into.subject"
msgid "add a WorkOrder"
msgstr ""
msgid "amount that should not be overspent"
msgid "amount that should not be overspent (the budget paid by the client)"
msgstr ""
# subject and object forms for each relation type
......@@ -67,6 +67,13 @@ msgctxt "WorkOrder"
msgid "budget"
msgstr ""
msgid "budget_prev"
msgstr ""
msgctxt "WorkOrder"
msgid "budget_prev"
msgstr ""
msgid "cancel"
msgstr ""
......@@ -179,6 +186,12 @@ msgstr "part of"
msgid "start"
msgstr ""
msgid ""
"the total budget, adjusted if necessary, that is used for trajectory "
"computations. If lower than `budget`, some benefit is expected. If higher "
"than `budget`, some loss is expected."
msgstr ""
msgctxt "Order"
msgid "title"
msgstr "title"
......
......@@ -51,8 +51,8 @@ msgctxt "inlined:Order.split_into.subject"
msgid "add a WorkOrder"
msgstr "ajouter un lot"
msgid "amount that should not be overspent"
msgstr "montant à ne pas dépasser"
msgid "amount that should not be overspent (the budget paid by the client)"
msgstr "montant à ne pas dépasser (budget payé par le client)"
# subject and object forms for each relation type
# (no object form for final relation types)
......@@ -74,6 +74,13 @@ msgctxt "WorkOrder"
msgid "budget"
msgstr "budget"
msgid "budget_prev"
msgstr ""
msgctxt "WorkOrder"
msgid "budget_prev"
msgstr ""
msgid "cancel"
msgstr "annuler"
......@@ -186,6 +193,15 @@ msgstr "fait partie de"
msgid "start"
msgstr "commencer"
msgid ""
"the total budget, adjusted if necessary, that is used for trajectory "
"computations. If lower than `budget`, some benefit is expected. If higher "
"than `budget`, some loss is expected."
msgstr ""
"le budget total, ajusté si nécessaire, qui est utilisé pour le calcul "
"des trajectoires. S’il est plus petit que le budget, de la marge est prévue. "
"S’il est plus grand, de la perte est prévue."
msgctxt "Order"
msgid "title"
msgstr "titre"
......
#!/usr/bin/env python3
# coding: utf-8
add_attribute("WorkOrder", "budget_prev")
......@@ -20,11 +20,21 @@ class WorkOrder(WorkflowableEntityType):
title = String(required=True, fulltextindexed=True, indexed=True, maxsize=128)
description = RichString(fulltextindexed=True)
budget = Float(
description=_("amount that should not be overspent"),
description=_(
"amount that should not be overspent (the budget paid by the client)"
),
constraints=[BoundaryConstraint(">=", 0)],
required=True,
default=0,
)
budget_prev = Float(
description=_(
"the total budget, adjusted if necessary, that is "
"used for trajectory computations. "
"If lower than `budget`, some benefit is expected. "
"If higher than `budget`, some loss is expected."
)
)
begin_date = Date(description=_("date work order will begin on"))
end_date = Date(description=_("date work order will end on"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment