[Erp5-dev] TaskConstraint proposition

Mikolaj Antoszkiewicz mikolaj at erp5.pl
Mon May 19 12:43:01 CEST 2008



Romain Courteaud wrote:
> * Mikolaj Antoszkiewicz [2008-05-16 19:18:47 +0200]:
> 
>> Hi All,
> 
> Hi Mikolaj,
> 
>> Since the Order_validateData script for task_workflow has been removed,
>> I propose a proper TaskConstraint replacement to verify task consistency 
>> before confirmation, so that Task Report could be generated.
> 
> Thanks for your contribution.
> 
>> TaskLineCategoryExistence constraint class handles the more complicated 
>> check for existence of specific category ('reference' in our case) on 
>> all contained Task Lines.
> 
> I don't understand why such Constraint class is required.
> It seems easier to configure a PropertySheet on the Task Line Level
> which uses CategoryExistence constraint, isn't it?

And check each line's consistency on the workflow script level, right?
That is in the script that conducts consistency check for the Task.

> 
>> Index: TaskReport_notifyAssignee.xml
>> ===================================================================
>> --- TaskReport_notifyAssignee.xml	(revision 20916)
>> +++ TaskReport_notifyAssignee.xml	(working copy)
>> @@ -65,15 +65,24 @@
>>          </item>
>>          <item>
>>              <key> <string>_body</string> </key>
>> -            <value> <string>packing_list = state_change[\'object\']\n
>> +            <value> <string>task_report = state_change[\'object\']\n
>> +from Products.ERP5Type.Message import Message\n
>> +T_ = lambda msg: Message(\'ui\', msg)\n
> 
> This T_ variable does not follow the ERP5 convention.
> Can you please use N_ variable instead.

Well, I used T which was to mean T(ranslate), and I couldn't find the 
convention about that.
Why N_ then?

> 
>> Index: TaskReport_copyOrderPropertiesAndNotifyAssignee.xml
>> ===================================================================
> 
> As your modifying this script, I think it could also be a good idea to
> improve his name, by changing it to something like:
>  TaskReport_copyOrderPropertyAndNotifyAssignee  or
> TaskReport_copyOrderPropertyListAndNotifyAssignee.

Ahh, right, sorry I missed that in such a looong name :)
I'll supply the newly-named version for replacement along with other 
corrections.

Best regards,
Mikolaj



More information about the Erp5-dev mailing list