Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I am looking to add some functionality to the kanban view that I've not seen elsewhere so I'm unsure if it is possible.
Essentially, I have an entity called "Cases" within my system. These are used to track issues raised by customers. Cases have states. We dont allow users to directly edit states, instead they must go through a custom workflow in order to progress a state. For example, if they want to close a case (move case from work complete to closed status) then they must press a "Close" button which launches a popup. The popup asks the user to fill in some details, they press another button which then updates the cases and changes the state.
I would like to add this functionality to the kanban view for cases. So, if a user drags a case from the "Work Complete" column in to the "Closed" column, I would like them to fill out the same form as before.
Does anyone know if this is possible? If it is possible, has it already been done in one of the standard OpenERP modules?
Many thanks for your time,
Here you can find some example. It overwrite the write function to check changes in the state field. If some conditions is not passed it raises warning and doesn't allows to make such changes. I think this approach doesn't allow to raise widget with a form you need. I can suggest another simple solution: add button to a kanban card, which will raise widget and if user will move state and some conditions is not passed show to him warning "Click button ... before moving to new state"
def write(self, vals):
if 'stage_id' in vals:
new_stage = self.env['crm.case.stage'].browse(vals['stage_id'])
for r in self:
res = r.try_update_stage(new_stage)
result = super(crm_lead, self).write(vals)
If you want to automatically open a wizard/popup or another window when a kanban card is moved, you'll have to modify the web client, which is usually not easy and not recommended.
I was in a similar situation where I created a kanban view for sale orders based on the "expected delivery week". So if a sale order was having some problems in production, the user could just move the card to the next week. The idea was originally to open a wizard when the card was moved to send a mail alerting the customer of the change of the date, so similar to what you want to do, but we quickly discovered it was not possible without modifying the client code of Odoo.
We ended up using two field "previously agreed delivery week" and "expected delivery week". When the user moves the kanban the "expected delivery week" is changed, and when "expected delivery week" and "previously agreed delivery week" are different, it shows a button "alert customer of change" which opens the wizard to send the email.
You could try to work around the problem in a similar fashion. For example, in the kanban view, you could show a "Insert closing information" button/link when the state = closed, so that when an user drags a card to the closed column the link will appear. It will not be automatic (the user will have to remember to click the link to open the wizard instead of having it opens automatically) but I think it's a good compromise.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/24/13, 2:26 PM|
|Seen: 4668 times|
|Last updated: 4/5/18, 4:32 AM|