CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hi, I have a wizard that must display files inside a directory and its subdirectories. I created a selection field with a custom selection method that displays the subdirectories and another selection field that should display files that are inside the subdirectory active on the first selection field.
So I need to update the file selection range when the user selects a value in the subdir selection but I cannot pass the value selected in the first field to the selection method of the second field.
Is there a way to do this?
I'm open to all suggestions, basically I need to let the user select a relative path inside a subdirectory in this wizard, if there's a quicker way I'm all ears :-)
Franco, a selection field's list is pulled down when the HTML page is requested, so you cannot change the selections dynamically. What I would suggest is to use a many2one field instead of selection field. It will still be displayed similar to a selection (a dropdown), you can put a domain to restrict the list of items that can be selected, and you can change the domain dynamically using on_change. But, user can create a new item if they have the appropriate ACL.
Sorry, this karma thing doesn't let me add another comment, only an answer, isn't this supposed to be a discussion forum?
John can you please explain how can I populate a TransientModel when opening the wizard?
I had thought about the binary field but I need only the file path, not its content, is it possible to send to the server just the path?
About This Community
Odoo Training Center
|Asked: 11/24/14, 9:39 AM|
|Seen: 1816 times|
|Last updated: 3/16/15, 8:10 AM|