On 23/08/11 08:27 -0400, Sharoon Thomas wrote:
> 
> On Aug 22, 2011, at 5:15 PM, Cédric Krier wrote:
> 
> > 
> > class Example(Wizard):
> >    start = 'init'
> >    end = 'end'
> > 
> >    init = StateForm('account.invoice', buttons=[Button('Cancel'), 
> > Button('ok', 'step2')],
> >        default='default_invoice')
> >    step2 = StateAction('action_step2', 'next_step2')
> > 
> >    def default_invoice(self):
> >        return {
> >            'code': 'ABC',
> >            }
> > 
> >    def action_step2(self):
> >        party_obj = Pool().get('party.party')
> >        # self.init.party is a BrowseRecord for the party filled in init Form
> >        party_obj.write(self.init.party.id, {'invoiced': True})
> > 
> >    def next_step2(self):
> >        return 'end'
> 
> Is this going to be invoked from the pool too ? I assume the mechanism of 
> loading from pool will remain the same (and an _name attribute).
> And will it support inheritance just as with regular models ?

Yes of course but I think it will store class in the pool instead of instance.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgptZoARRhLqD.pgp
Description: PGP signature

Reply via email to