Skip to Content
Menu
This question has been flagged

I have a scenario where I've added numerous custom fields to the account.move inherited view, and most of these fields share the same visibility condition. The challenge is that I need to write multiple conditions to control their visibility. Whenever a requirement changes, I must update the condition for multiple fields individually. Additionally, if I want to display a field for multiple move_types , I end up writing lengthy conditions for each field.

Over time, the account.move form view has become very large due to these customizations and conditions, making it increasingly difficult to implement changes without risking disruptions to other flows, such as vendor bills, customer invoices, and journal entries. Is there a more efficient way to manage this, where I can define a single condition that applies to multiple fields, simplifying maintenance and ensuring stability across the views? basically an if block where i can check the move type and define all the fields for a certain move_type, similarly another if condition to deal with another move_type

Avatar
Discard
Author

I don’t have enough karma to post, so I’m commenting here. As Andre mentioned, I’d prefer using the second option, but the challenge I’m facing is how to create separate workflow views while inheriting the original account.move form view. I want to avoid copying the entire XML from the original form view into my custom view. Instead, I’d like to inherit the form view for each workflow, allowing me to manage fields based on the specific workflow.

Best Answer

Hi.
Managing large views is always hard especially when the conditions start to increase exponentially. 

Someway you can make the process easier:

Option 1: Define a new selection field that tracks each workflow, and have a computed action for changing the visibility of the other fields, or set any rules you might have (domains, fields values, etc
).
This lets you define each process with a single user action, and every aspect of that workflow is embedded into a single function.

Option 2: Create one view per workflow type.
As before, this gives you more control over each workflow. The negative part is that you increase maintenance difficulty, as your fields are replicated through more locations, but for some cases this works well.

Avatar
Discard
Related Posts Replies Views Activity
1
Jan 25
758
1
May 25
265
0
May 25
252
1
May 25
449
1
Apr 25
865