Am 22.03.2012 22:34, schrieb Cédric Krier:
On 22/03/12 20:58 +0100, Jan Grasnick | grasbauer ug wrote:
Short example:
Sale> Transition form 'draft' to 'quotation'
SaleLine> field.XXX with states = {required:
Not(Equal(Get(Eval('_parent_sale', {}), 'state'), 'draft'))}
in this case you can do the transition of the Sale without a
warning, that the field.XXX of SaleLine is required in case Sale has
another state than 'draft'
Its a little bit hard to explain: I know, that the pyson domain says
clearly: the field.XXX is required if the state of Sale is in all
other states than 'draft'. So the field.XXX is required after the
transition. But it would be nice to have a possibility to
pre-evaluate the values of some fields meanwhile the transition. We
have this use-cases very often if a document stays a long time in a
particular state and people is collecting informations to transform
it to the next state. So we have implemented a solution with a
workaround - if there are missing fields, we are doing the
pre-evaluation in write() depending of the presence of the key
'state' and his value.
This has nothing to do with workflow.
Your issue comes from that you make the value of a field of a record
depends on the value of an other field of an other record.
This can not work and I'm pretty will never.
All that can be done in your example is to have a validation check on
Sale that will check each lines when on the specific state.
Yes, I know. I only was thinking about the posibilities of a extension
like field.on_transition_xxx(pyson)
Jan
--
[email protected] mailing list