I am implementing a party creation wizard, loading the data, and opening the form with:
class MyWizard(Wizard):
"My Wizard"
__name__ = 'xxx'
start = StateTransition()
create_party = StateView('party.party', 'party.party_view_form', [
Button("Cancel", 'end', 'tryton-cancel'),
def value_create_party(self, fields):
pass
The problem is that I want a specific company to appear in the party context. (For Multivalue)
Is this possible to do? Or is it a missing feature?
Doing it this way works, but I want to do it individually.
class PartiesWizard(StateView):
"Parties Wizard"
__name__ = 'party.parties_wizard'
company = fields.Many2One('company.company', ...)
parties = fields.One2Many('party.party', None, "Parties",
context={
'company': Eval('company', None),
},
depends={'company'})
class MyWizard(Wizard):
"My Wizard"
__name__ = 'xxx'
start = StateTransition()
create_parties = StateView('party.parties_wizard', 'xxxxxxx', [
Button("Cancel", 'end', 'tryton-cancel'),
def value_create_parties(self, fields):
pass