There is a form action in our application. This action runs a wizard that can change multiple records, not just the current record. To reload the data, we set the attribute on_write = “on_write” in the tree tag and defined a method on_write. We also registered the method in trytond.model.Model._rpc_. But at change of records the method on_write is not called and the client does not reload the data.
What are we doing wrong?
on_write works only with write change.
Sorry, if to mark changed records, then changes become visible in a tree view.
We save changes using the method
However, the method
on_write is still not called.
I do not understand what this means?
How are you using a method? Are you using a client? If yes which one? How to do you test?
Our wizard can change several records, even if only the current record is marked. In this case, the changes are not visible in the tree view.
If we pre-mark the changeable records, the changes are displayed in the tree view.
We change the required records and execute
Desktop Client 4.6.
logger.info() into the method
on_write and this logging does not work.
What does the wizard? Is it run as dialog?
The wizard call a reload with written set when it ends tryton: 7ab6b091a0b1 tryton/gui/window/wizard.py
I do not understand what mean “pre-mark”?
Yes, it is run as dialog.
I see, but written set must be marked (more precisely, selected).
“pre-mark” means “select before calling the wizard”.
But it is not clear why the method
on_write is not called.
We solved the problem of data reloading without
Here is our solution:
class OurWizard(Wizard): ..... start = StateView( ..... [ Button('Cancel', 'end', 'tryton-cancel'), Button('Run', 'run', 'tryton-ok', default=True), ] ) run = StateTransition() def transition_run(self): ..... return 'end' def end(self): return 'reload'
The ending state of the wizard may return one of the client side action keywords:
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.